âïž HackTricks Cloud âïž -ðŠ Twitter ðŠ - ðïž Twitch ðïž - ð¥ Youtube ð¥
- **ãµã€ããŒã»ãã¥ãªãã£äŒç€Ÿ**ã§åããŠããŸããïŒ **HackTricksã§äŒç€Ÿã宣äŒ**ãããã§ããïŒãŸãã¯ã**PEASSã®ææ°ããŒãžã§ã³ãå
¥æããããHackTricksãPDFã§ããŠã³ããŒã**ãããã§ããïŒ[**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)ããã§ãã¯ããŠãã ããïŒ
- [**The PEASS Family**](https://opensea.io/collection/the-peass-family)ãèŠã€ããŠãã ãããç¬å çãª[**NFT**](https://opensea.io/collection/the-peass-family)ã®ã³ã¬ã¯ã·ã§ã³ã§ãã
- [**å
¬åŒã®PEASSïŒHackTricksã®ã°ããº**](https://peass.creator-spring.com)ãæã«å
¥ããŸãããã
- [**ð¬**](https://emojipedia.org/speech-balloon/) [**Discordã°ã«ãŒã**](https://discord.gg/hRep4RUj7f)ãŸãã¯[**ãã¬ã°ã©ã ã°ã«ãŒã**](https://t.me/peass)ã«åå ãããã**Twitter**ã§[**ðŠ**](https://github.com/carlospolop/hacktricks/tree/7af18b62b3bdc423e11444677a6a73d4043511e9/\[https:/emojipedia.org/bird/README.md)[**@carlospolopm**](https://twitter.com/hacktricks_live)**ããã©ããŒ**ããŠãã ããã
- **ãããã³ã°ã®ããªãã¯ãå
±æããã«ã¯ã[hacktricksãªããžããª](https://github.com/carlospolop/hacktricks)ãš[hacktricks-cloudãªããžããª](https://github.com/carlospolop/hacktricks-cloud)ã«PRãæåº**ããŠãã ããã
# ãã¡ã€ã«ã®ã¢ããããŒãäžè¬çãªæ¹æ³è«
1. **ããã«æ¡åŒµå**ãæã€ãã¡ã€ã«ãã¢ããããŒãããŠã¿ãŠãã ããïŒäŸïŒ_file.png.php_ãŸãã¯_file.png.php5_ïŒã
* PHPã®æ¡åŒµåïŒ_.php_, _.php2_, _.php3_, ._php4_, ._php5_, ._php6_, ._php7_, ._phps_, ._pht_, _.phtml_, ._pgif_, _.shtml, .htaccess, .phar, .inc_
* ASPã®æ¡åŒµåïŒ_.asp, .aspx, .config, .ashx, .asmx, .aspq, .axd, .cshtm, .cshtml, .rem, .soap, .vbhtm, .vbhtml, .asa, .asp, .cer, .shtml_
2. æ¡åŒµåã®äžéšã**倧æå**ã«ããŠã¿ãŠãã ãããäŸïŒ_.pHp, .pHP5, .PhAr ..._
3. **ããã«ïŒãŸãã¯ãã以äžã®ïŒæ¡åŒµå**ãã¢ããããŒãããŠã¿ãŠãã ããïŒç¹å®ã®æ¡åŒµåãååšãããã©ããããã¹ããããã¹æ§æã®ãã§ãã¯ããã€ãã¹ããã®ã«åœ¹ç«ã¡ãŸãïŒïŒ
1. _file.png.php_
2. _file.png.txt.php_
4. **éããã«æ¡åŒµå**ãã¢ããããŒãããŠã¿ãŠãã ããïŒApacheã®ãã¹æ§æãæªçšããã®ã«åœ¹ç«ã¡ãŸããæ¡åŒµå_.php_ã§ããããå¿
ããã.phpã§çµããããã§ã¯ãªãå Žåã«ã³ãŒããå®è¡ãããŸãïŒïŒ
* äŸïŒfile.php.png
5. **ãã«æå**ã䜿çšããããã«æ¡åŒµåïŒ
1. äŸïŒfile.php%00.png
6. æ¡åŒµåã®**æ«å°Ÿã«ç¹æ®æåãè¿œå **ããŠãã ããïŒ%00ã%20ãïŒè€æ°ã®ãããïŒ....
1. _file.php%00_
2. _file.php%20_
3. _file.php...... --> Windowsã§ã¯ããã¡ã€ã«ãæ«å°Ÿã«ãããã§äœæããããšããããã¯åé€ãããŸãïŒ.phpãšããæ¡åŒµåããã§ãã¯ãããã£ã«ã¿ããã€ãã¹ã§ããŸãïŒ
4. _file.php/_
5. _file.php.\_
7. **Content-Type**ãããã®**å€**ãèšå®ããããšã§ã**Content-Type**ã®ãã§ãã¯ããã€ãã¹ããŠãã ããïŒ_image/png_ã_text/plain_ã_application/octet-stream_
8. **ããžãã¯ãã³ããŒãã§ãã¯**ããã€ãã¹ããããã«ããã¡ã€ã«ã®å
é ã«**å®éã®ç»åã®ãã€ã**ãè¿œå ããŠãã ããïŒ_file_ã³ãã³ããæ··ä¹±ãããŸãïŒããŸãã¯ãã·ã§ã«ã**ã¡ã¿ããŒã¿**ã«æ¿å
¥ããŸãïŒ`exiftool -Comment="*?â`ãªã©ã®**ç¡å¹ãªæå**ãå«ã**Windows**ã§ã®ãã¡ã€ã«ã®ã¢ããããŒãïŒWindowsïŒ
6. **CONãPRNãAUXãNULãCOM1ãCOM2ãCOM3ãCOM4ãCOM5ãCOM6ãCOM7ãCOM8ãCOM9ãLPT1ãLPT2ãLPT3ãLPT4ãLPT5ãLPT6ãLPT7ãLPT8ãLPT9**ãªã©ã®**äºçŽæžã¿ïŒçŠæ¢ïŒå**ã䜿çšããŠ**Windows**ã«ãã¡ã€ã«ã
`.phar`ãã¡ã€ã«ã¯ãJavaã®`.jar`ã®ãããªãã®ã§ãããPHPçšã§ããPHPã§å®è¡ããããã¹ã¯ãªããå
ã§ã€ã³ã¯ã«ãŒããããããããšãã§ããŸãã
`.inc`æ¡åŒµåã¯ããã¡ã€ã«ãã€ã³ããŒãããããã ãã«äœ¿çšãããããšããããŸãã®ã§ãããæç¹ã§ã誰ãããã®æ¡åŒµåãå®è¡ã§ããããã«ããŠããå¯èœæ§ããããŸãã
BurpSuitãã©ã°ã€ã³ã䜿çšããŠãå€ãã®å¯èœãªãã¡ã€ã«ã¢ããããŒãã®è匱æ§ããã§ãã¯ããŠãã ããã[https://github.com/modzero/mod0BurpUploadScanner](https://github.com/modzero/mod0BurpUploadScanner)ãŸãã¯ãã¢ããããŒãã§ãããã¡ã€ã«ãèŠã€ããããŸããŸãªããªãã¯ãè©ŠããŠã³ãŒããå®è¡ããã³ã³ãœãŒã«ã¢ããªã±ãŒã·ã§ã³ã䜿çšããŠãã ããã[https://github.com/almandin/fuxploider](https://github.com/almandin/fuxploider)
## **wgetãã¡ã€ã«ã¢ããããŒã/SSRFããªãã¯**
å Žåã«ãã£ãŠã¯ããµãŒããŒããã¡ã€ã«ãããŠã³ããŒãããããã«`wget`ã䜿çšããŠãããURLãæå®ã§ããããšããããŸãããããã®å Žåãã³ãŒãã¯ããŠã³ããŒãããããã¡ã€ã«ã®æ¡åŒµåããã¯ã€ããªã¹ãå
ã«ããããšã確èªããŠãèš±å¯ããããã¡ã€ã«ã®ã¿ãããŠã³ããŒããããããã«ããŸãããã ãããã®ãã§ãã¯ã¯ãã€ãã¹ã§ããŸãã
Linuxã§ã®ãã¡ã€ã«åã®æ倧é·ã¯255ã§ããã`wget`ã¯ãã¡ã€ã«åã236æåã«åãè©°ããŸãã"A"\*232+".php"+".gif"ãšããååã®ãã¡ã€ã«ãããŠã³ããŒãããããšãã§ããŸãããã®ãã¡ã€ã«åã¯ãã§ãã¯ããã€ãã¹ããŸãïŒãã®äŸã§ã¯".gif"ãæå¹ãªæ¡åŒµåã§ãïŒããã ãã`wget`ã¯ãã¡ã€ã«ã"A"\*232+".php"ãšããååã«å€æŽããŸãã
```bash
#Create file and HTTP server
echo "SOMETHING" > $(python -c 'print("A"*(236-4)+".php"+".gif")')
python3 -m http.server 9080
```
```bash
#Download the file
wget 127.0.0.1:9080/$(python -c 'print("A"*(236-4)+".php"+".gif")')
The name is too long, 240 chars total.
Trying to shorten...
New name is AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.php.
--2020-06-13 03:14:06-- http://127.0.0.1:9080/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.php.gif
Connecting to 127.0.0.1:9080... connected.
HTTP request sent, awaiting response... 200 OK
Length: 10 [image/gif]
Saving to: âAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.phpâ
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA 100%[===============================================>] 10 --.-KB/s in 0s
2020-06-13 03:14:06 (1.96 MB/s) - âAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.phpâ saved [10/10]
```
泚æããŠãã ããããã®ãã§ãã¯ããã€ãã¹ããããã«èããŠãã**å¥ã®ãªãã·ã§ã³**ã¯ã**HTTPãµãŒããŒãå¥ã®ãã¡ã€ã«ã«ãªãã€ã¬ã¯ã**ãããããšã§ãããã®ãããåæã®URLã¯ãã§ãã¯ããã€ãã¹ããwgetã¯æ°ããååã§ãªãã€ã¬ã¯ãããããã¡ã€ã«ãããŠã³ããŒãããŸãã**wgetããã©ã¡ãŒã¿**`--trust-server-names`**ã䜿çšããŠããå Žåãé€ããŠãããã¯æ©èœããŸãã**ããªããªããwgetã¯ãªãã€ã¬ã¯ããããããŒãžãå
ã®URLã§æå®ããããã¡ã€ã«åã§ããŠã³ããŒãããããã§ãã
# ãã¡ã€ã«ã¢ããããŒãããä»ã®è匱æ§ãž
* **ãã¡ã€ã«å**ã`../../../tmp/lol.png`ã«èšå®ãã**ãã¹ãã©ããŒãµã«**ãè©Šã¿ã
* **ãã¡ã€ã«å**ã`sleep(10)-- -.jpg`ã«èšå®ãã**SQLã€ã³ãžã§ã¯ã·ã§ã³**ãéæããããšãã§ãããããããŸãã
* **ãã¡ã€ã«å**ã`