80,443 - Pentesting ์น ๋ฐฉ๋ฒ๋ก
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.
๊ธฐ๋ณธ ์ ๋ณด
์น ์๋น์ค๋ ๊ฐ์ฅ ์ผ๋ฐ์ ์ด๊ณ ๊ด๋ฒ์ํ ์๋น์ค์ด๋ฉฐ, ๋ง์ ๋ค์ํ ์ ํ์ ์ทจ์ฝ์ ์ด ์กด์ฌํฉ๋๋ค.
๊ธฐ๋ณธ ํฌํธ: 80 (HTTP), 443(HTTPS)
PORT STATE SERVICE
80/tcp open http
443/tcp open ssl/https
nc -v domain.com 80 # GET / HTTP/1.0
openssl s_client -connect domain.com:443 # GET / HTTP/1.0
Web API ์๋ด
๋ฐฉ๋ฒ๋ก ์์ฝ
์ด ๋ฐฉ๋ฒ๋ก ์์๋ ํ๋์ domain (๋๋ subdomain)๋ง ๊ณต๊ฒฉํ๋ค๊ณ ๊ฐ์ ํฉ๋๋ค. ๋ฐ๋ผ์ ์ด ๋ฐฉ๋ฒ๋ก ์ scope ๋ด์์ ๋ฏธํ์ธ web server๊ฐ ์๋ ๊ฐ ๋ฐ๊ฒฌ๋ domain, subdomain ๋๋ IP์ ๋ํด ์ ์ฉํด์ผ ํฉ๋๋ค.
- ๋จผ์ ์น ์๋ฒ์์ ์ฌ์ฉ๋๋ ๊ธฐ์ ์ ์๋ณํ์ธ์. ๊ธฐ์ ์ ์ฑ๊ณต์ ์ผ๋ก ์๋ณํ ์ ์๋ค๋ฉด ๋๋จธ์ง ํ ์คํธ ๋์ ์ผ๋์ ๋ tricks๋ฅผ ์ฐพ์๋ณด์ธ์.
- ํด๋น ๊ธฐ์ ๋ฒ์ ์ known vulnerability๊ฐ ์๋์?
- ์ ์๋ ค์ง ๊ธฐ์ ์ ์ฌ์ฉํ๊ณ ์๋์? ๋ ๋ง์ ์ ๋ณด๋ฅผ ์ป์ ์ ์๋ useful trick์ด ์๋์?
- ์คํํ specialised scanner๊ฐ ์๋์ (์: wpscan)?
- general purposes scanners๋ฅผ ์คํํ์ธ์. ๋ญ๊ฐ๋ฅผ ๋ฐ๊ฒฌํ๊ฑฐ๋ ํฅ๋ฏธ๋ก์ด ์ ๋ณด๋ฅผ ์ฐพ์ ์ ์์ต๋๋ค.
- initial checks๋ถํฐ ์์ํ์ธ์: robots, sitemap, 404 error ๋ฐ SSL/TLS scan (HTTPS์ธ ๊ฒฝ์ฐ).
- ์น ํ์ด์ง๋ฅผ spideringํ์ธ์: ๊ฐ๋ฅํ ๋ชจ๋ files, folders ๋ฐ parameters being used๋ฅผ findํ ์๊ฐ์ ๋๋ค. ๋ํ special findings๋ฅผ ํ์ธํ์ธ์.
- brute-forcing ๋๋ spidering ์ค์ ์๋ก์ด ๋๋ ํฐ๋ฆฌ๊ฐ ๋ฐ๊ฒฌ๋๋ฉด ํด๋น ๋๋ ํฐ๋ฆฌ๋ฅผ ๋ฐ๋์ spidering ํด์ผ ํฉ๋๋ค.
- Directory Brute-Forcing: ๋ฐ๊ฒฌ๋ ๋ชจ๋ ํด๋์ ๋ํด brute force๋ฅผ ์๋ํ์ฌ ์๋ก์ด files ๋ฐ directories๋ฅผ ์ฐพ์๋ณด์ธ์.
- brute-forcing ๋๋ spidering ์ค์ ์๋ก์ด ๋๋ ํฐ๋ฆฌ๊ฐ ๋ฐ๊ฒฌ๋๋ฉด ํด๋น ๋๋ ํฐ๋ฆฌ๋ฅผ ๋ฐ๋์ Brute-Forced ํด์ผ ํฉ๋๋ค.
- Backups checking: ์ผ๋ฐ์ ์ธ ๋ฐฑ์ ํ์ฅ์๋ฅผ ๋ง๋ถ์ฌ discovered files์ backups๋ฅผ ์ฐพ์ ์ ์๋์ง ํ ์คํธํ์ธ์.
- Brute-Force parameters: ์จ๊ฒจ์ง parameters๋ฅผ ์ฐพ์๋ณด์ธ์.
- ๋ชจ๋ ๊ฐ๋ฅํ endpoints ์ค user input์ ๋ฐ๋ ๊ฒ์ identifiedํ๋ค๋ฉด, ํด๋น ์ ๋ ฅ๊ณผ ๊ด๋ จ๋ ๋ชจ๋ ์ข ๋ฅ์ vulnerabilities๋ฅผ ํ์ธํ์ธ์.
- ์ด ์ฒดํฌ๋ฆฌ์คํธ๋ฅผ ๋ฐ๋ฅด์ธ์
Server Version (Vulnerable?)
Identify
ํ์ฌ ์คํ ์ค์ธ ์๋ฒ version์ ๋ํด known vulnerabilities๊ฐ ์๋์ง ํ์ธํ์ธ์.
์๋ต์ HTTP headers and cookies๋ ์ฌ์ฉ ์ค์ธ technologies ๋ฐ/๋๋ version์ identifyํ๋ ๋ฐ ๋งค์ฐ ์ ์ฉํ ์ ์์ต๋๋ค. Nmap scan์ ์๋ฒ ๋ฒ์ ์ ์๋ณํ ์ ์์ง๋ง, whatweb, webtech ๋๋ https://builtwith.com/** ๊ฐ์ ๋๊ตฌ๋ค๋ ์ ์ฉํ ์ ์์ต๋๋ค:**
whatweb -a 1 <URL> #Stealthy
whatweb -a 3 <URL> #Aggresive
webtech -u <URL>
webanalyze -host https://google.com -crawl 2
Search for vulnerabilities of the web application version
Check if any WAF
- https://github.com/EnableSecurity/wafw00f
- https://github.com/Ekultek/WhatWaf.git
- https://nmap.org/nsedoc/scripts/http-waf-detect.html
Web tech tricks
์ฌ์ฉ ์ค์ธ ๋ค์ํ ์ ์๋ ค์ง technologies์์ vulnerabilities๋ฅผ ์ฐพ๊ธฐ ์ํ ๋ช ๊ฐ์ง tricks:
- AEM - Adobe Experience Cloud
- Apache
- Artifactory
- Buckets
- CGI
- Custom UDP RPC Protocols
- Dotnet SOAP WSDL client exploitation
- Drupal
- Flask
- Fortinet FortiWeb
- Git
- Golang
- GraphQL
- H2 - Java SQL database
- ISPConfig
- IIS tricks
- Microsoft SharePoint
- JBOSS
- Jenkins
- Jira
- Joomla
- JSP
- Laravel
- Moodle
- Nginx
- PHP (php has a lot of interesting tricks that could be exploited)
- Python
- Roundcube
- Spring Actuators
- Symphony
- Tomcat
- VMWare
- Web API Pentesting
- WebDav
- Werkzeug
- Wordpress
- Electron Desktop (XSS to RCE)
- Sitecore
- Zabbix
๊ฐ์ domain์ด ์๋ก ๋ค๋ฅธ ports, folders, subdomains์์ ์๋ก ๋ค๋ฅธ technologies๋ฅผ ์ฌ์ฉํ ์ ์๋ค๋ ์ ์ ๊ณ ๋ คํ์ธ์.
์น ์ ํ๋ฆฌ์ผ์ด์
์ด ์์ ๋์ด๋ ์ ์๋ ค์ง tech/platform์ด๋ ๋ค๋ฅธ ๊ฒ์ ์ฌ์ฉํ๊ณ ์๋ค๋ฉด, ์ธํฐ๋ท์์ ์๋ก์ด tricks๋ฅผ ์ฐพ์๋ณด๋ ๊ฒ์ ์์ง ๋ง์ธ์ (๊ทธ๋ฆฌ๊ณ ์ ์๊ฒ ์๋ ค์ฃผ์ธ์!).
Source Code Review
์ ํ๋ฆฌ์ผ์ด์ ์ source code๊ฐ github์ ๊ณต๊ฐ๋์ด ์๋ค๋ฉด, ์์ฒด์ ์ผ๋ก White box test๋ฅผ ์ํํ๋ ๊ฒ ์ธ์๋ ํ์ฌ์ Black-Box testing์ ์ ์ฉํ ์ ์๋ ์ ๋ณด๋ค์ด ์์ต๋๋ค:
- ์น์์ ์ ๊ทผ ๊ฐ๋ฅํ Change-log, Readme ๋๋ Version ํ์ผ์ด๋ ๋ฒ์ ์ ๋ณด๊ฐ ์๋๊ฐ?
- credentials๋ ์ด๋ป๊ฒ ์ด๋์ ์ ์ฅ๋์ด ์๋๊ฐ? ์ฌ์ฉ์๋ช ์ด๋ passwords์ ๊ฐ์ file์ด (์ ๊ทผ ๊ฐ๋ฅํ๊ฒ) ์๋๊ฐ?
- passwords๊ฐ plain text์ธ๊ฐ, encrypted๋์ด ์๋๊ฐ, ์๋๋ฉด ์ด๋ค hashing algorithm์ด ์ฌ์ฉ๋๋๊ฐ?
- ์ํธํ์ ์ฌ์ฉ๋๋ master key๊ฐ ์๋๊ฐ? ์ด๋ค algorithm์ด ์ฌ์ฉ๋๋๊ฐ?
- ์ด๋ค ์ทจ์ฝ์ ์ ์ด์ฉํด ์ด ํ์ผ๋ค์ ์ ๊ทผํ ์ ์๋๊ฐ?
- github์ ์ด์(ํด๊ฒฐ๋ ๊ฒ๊ณผ ํด๊ฒฐ๋์ง ์์ ๊ฒ)๋ commit history์ ํฅ๋ฏธ๋ก์ด ์ ๋ณด๊ฐ ์๋๊ฐ? (์: ์ค๋๋ ์ปค๋ฐ์ ๋น๋ฐ๋ฒํธ๊ฐ ํฌํจ๋ ๊ฒฝ์ฐ)
Source code Review / SAST Tools
Automatic scanners
General purpose automatic scanners
nikto -h <URL>
whatweb -a 4 <URL>
wapiti -u <URL>
W3af
zaproxy #You can use an API
nuclei -ut && nuclei -target <URL>
# https://github.com/ignis-sec/puff (client side vulns fuzzer)
node puff.js -w ./wordlist-examples/xss.txt -u "http://www.xssgame.com/f/m4KKGHi2rVUN/?query=FUZZ"
CMS ์ค์บ๋
CMS๊ฐ ์ฌ์ฉ ์ค์ด๋ผ๋ฉด ์์ง ๋ง๊ณ ์ค์บ๋๋ฅผ ์คํํ์ธ์, ์์ธ๋ก ํฅ๋ฏธ๋ก์ด ๊ฒ์ด ๋ฐ๊ฒฌ๋ ์ ์์ต๋๋ค:
Clusterd: JBoss, ColdFusion, WebLogic, Tomcat, Railo, Axis2, Glassfish
CMSScan: WordPress, Drupal, Joomla, vBulletin ์น์ฌ์ดํธ์ ๋ณด์ ๋ฌธ์ ๋ฅผ ๊ฒ์ฌํฉ๋๋ค. (GUI)
VulnX: Joomla, Wordpress, Drupal, PrestaShop, Opencart
CMSMap: (W)ordpress, (J)oomla, (D)rupal ๋๋ (M)oodle
droopscan: Drupal, Joomla, Moodle, Silverstripe, Wordpress
cmsmap [-f W] -F -d <URL>
wpscan --force update -e --url <URL>
joomscan --ec -u <URL>
joomlavs.rb #https://github.com/rastating/joomlavs
์ด ์์ ์์๋ ํด๋ผ์ด์ธํธ๊ฐ ์ฌ์ฉ ์ค์ธ ์น ์๋ฒ์ ๋ํ ์ ๋ณด(์ ๊ณต๋ ๋ฐ์ดํฐ๊ฐ ์๋ค๋ฉด)์ ํ ์คํธ ์ค์ ๊ธฐ์ตํด๋ ๋ช ๊ฐ์ง ์๋ น์ ์ด๋ฏธ ํ๋ณดํ์ด์ผ ํฉ๋๋ค. ์ด์ด ์ข๋ค๋ฉด CMS๋ฅผ ๋ฐ๊ฒฌํด scanner๋ฅผ ์คํํ์ ์๋ ์์ต๋๋ค.
๋จ๊ณ๋ณ ์น ์ ํ๋ฆฌ์ผ์ด์ ํ์
์ด ์์ ๋ถํฐ ์น ์ ํ๋ฆฌ์ผ์ด์ ๊ณผ ์ํธ์์ฉ์ ์์ํฉ๋๋ค.
์ด๊ธฐ ํ์ธ
๊ธฐ๋ณธ ํ์ด์ง(์ ์ฉํ ์ ๋ณด):
- /robots.txt
- /sitemap.xml
- /crossdomain.xml
- /clientaccesspolicy.xml
- /.well-known/
- ๋ฉ์ธ ๋ฐ ๋ณด์กฐ ํ์ด์ง์ ์ฃผ์๋ ํ์ธํ์ธ์.
์ค๋ฅ ์ ๋
์น ์๋ฒ๋ ์ด์ํ ๋ฐ์ดํฐ๋ฅผ ์ ์กํ ๋ ์๊ธฐ์น ์๊ฒ ๋์ํ ์ ์์ต๋๋ค. ์ด๋ ์ทจ์ฝ์ ์ด๋ ๋ฏผ๊ฐํ ์ ๋ณด ๋ ธ์ถ๋ก ์ด์ด์ง ์ ์์ต๋๋ค.
- /whatever_fake.php (.aspx,.html,.etc) ๊ฐ์ fake pages์ ์ ๊ทผํ์ธ์
- ์ค๋ฅ๋ฅผ ๋ง๋ค๊ธฐ ์ํด ์ฟ ํค ๊ฐ(cookie values) ๋ฐ **ํ๋ผ๋ฏธํฐ ๊ฐ(parameter values)**์ **โ[]โ, โ]]โ, โ[[โ**๋ฅผ ์ถ๊ฐํ์ธ์
- URL์ ๋์ **
/~randomthing/%s**๋ฅผ ์ ๋ ฅํ์ฌ ์ค๋ฅ๋ฅผ ๋ฐ์์์ผ ๋ณด์ธ์ - PATCH, DEBUG ๊ฐ์ ๋ค๋ฅธ HTTP Verbs๋ฅผ ์๋ํ๊ฑฐ๋ FAKE์ฒ๋ผ ์๋ชป๋ ๊ฒ๋ ์๋ํด ๋ณด์ธ์
Check if you can upload files (PUT verb, WebDav)
WebDav๊ฐ ํ์ฑํ๋์ด ์์ง๋ง ๋ฃจํธ ํด๋์ ํ์ผ ์ ๋ก๋ ๊ถํ์ด ์ถฉ๋ถ์น ์๋ค๋ฉด ๋ค์์ ์๋ํ์ธ์:
- ์๊ฒฉ์ฆ๋ช ์ ๋ํด Brute Force ์๋
- Web ํ์ด์ง ๋ด ๋ค๋ฅธ ๋ฐ๊ฒฌ๋ ํด๋๋ค์ WebDav๋ก ํ์ผ ์ ๋ก๋๋ฅผ ์๋ํ์ธ์. ๋ค๋ฅธ ํด๋์๋ ์ ๋ก๋ ๊ถํ์ด ์์ ์ ์์ต๋๋ค.
SSL/TLS ์ทจ์ฝ์
- ์ ํ๋ฆฌ์ผ์ด์ ์ด ์ด๋ ๋ถ๋ถ์์๋ HTTPS ์ฌ์ฉ์ ๊ฐ์ ํ์ง ์๋๋ค๋ฉด, MitM์ ์ทจ์ฝํฉ๋๋ค
- ์ ํ๋ฆฌ์ผ์ด์ ์ด ๋ฏผ๊ฐํ ๋ฐ์ดํฐ(๋น๋ฐ๋ฒํธ)๋ฅผ HTTP๋ก ์ ์กํ๋ค๋ฉด, ์ด๋ ๋์ ์ฌ๊ฐ๋์ ์ทจ์ฝ์ ์ ๋๋ค
Use testssl.sh๋ก ์ทจ์ฝ์ ์ ๊ฒ์ฌํ์ธ์ (Bug Bounty ํ๋ก๊ทธ๋จ์์๋ ์ด๋ฐ ์ ํ์ ์ทจ์ฝ์ ์ด ์ธ์ ๋์ง ์๋ ๊ฒฝ์ฐ๊ฐ ๋ง์ต๋๋ค) ๊ทธ๋ฆฌ๊ณ a2sv๋ก ์ทจ์ฝ์ ์ ์ฌ๊ฒ์ฌํ์ธ์:
./testssl.sh [--htmlfile] 10.10.10.10:443
#Use the --htmlfile to save the output inside an htmlfile also
# You can also use other tools, by testssl.sh at this momment is the best one (I think)
sslscan <host:port>
sslyze --regular <ip:port>
Information about SSL/TLS vulnerabilities:
- https://www.gracefulsecurity.com/tls-ssl-vulnerabilities/
- https://www.acunetix.com/blog/articles/tls-vulnerabilities-attacks-final-part/
Spidering
์น ๋ด๋ถ์ ์ด๋ค ์์ผ๋ก๋ spider๋ฅผ ์คํํ์ธ์. spider์ ๋ชฉํ๋ ํ ์คํธ ์ค์ธ ์ ํ๋ฆฌ์ผ์ด์ ์ผ๋ก๋ถํฐ ๊ฐ๋ฅํ ํ ๋ง์ ๊ฒฝ๋ก๋ฅผ ์ฐพ๋ ๊ฒ์ ๋๋ค. ๋ฐ๋ผ์ ์น ํฌ๋กค๋ง๊ณผ ์ธ๋ถ ์์ค๋ฅผ ํ์ฉํด ๊ฐ๋ฅํ ๋ง์ ์ ํจํ ๊ฒฝ๋ก๋ฅผ ์ฐพ์์ผ ํฉ๋๋ค.
- gospider (go): HTML spider, JS files์์ LinkFinder ์ฌ์ฉ ๋ฐ ์ธ๋ถ ์์ค(Archive.org, CommonCrawl.org, VirusTotal.com).
- hakrawler (go): HML spider, JS ํ์ผ์ ๋ํ LinkFider ๋ฐ Archive.org๋ฅผ ์ธ๋ถ ์์ค๋ก ์ฌ์ฉ.
- dirhunt (python): HTML spider, ๋ํ โjuicy filesโ๋ฅผ ํ์ํจ.
- evine (go): ๋ํํ CLI HTML spider. ๋ํ Archive.org์์ ๊ฒ์ํจ.
- meg (go): ์ด ๋๊ตฌ๋ spider๋ ์๋์ง๋ง ์ ์ฉํ ์ ์์. hosts ํ์ผ๊ณผ paths ํ์ผ์ ์ง์ ํ๋ฉด meg๊ฐ ๊ฐ host์ ๊ฐ path๋ฅผ ๊ฐ์ ธ์ ์๋ต์ ์ ์ฅํจ.
- urlgrab (go): JS ๋ ๋๋ง ๊ธฐ๋ฅ์ ๊ฐ์ง HTML spider. ๋ค๋ง ์ ์ง๋ณด์๋์ง ์๋ ๋ฏ ๋ณด์ด๋ฉฐ, ์ฌ์ ์ปดํ์ผ ๋ฐ์ด๋๋ฆฌ๋ ์ค๋๋์๊ณ ํ์ฌ ์ฝ๋๋ ์ปดํ์ผ๋์ง ์์.
- gau (go): ์ธ๋ถ ์ ๊ณต์(wayback, otx, commoncrawl)๋ฅผ ์ฌ์ฉํ๋ HTML spider.
- ParamSpider: ํ๋ผ๋ฏธํฐ๊ฐ ์๋ URL์ ์ฐพ์ ๋์ดํ๋ ์คํฌ๋ฆฝํธ.
- galer (go): JS ๋ ๋๋ง ๊ธฐ๋ฅ์ ๊ฐ์ง HTML spider.
- LinkFinder (python): HTML spider, JS beautify ๊ธฐ๋ฅ์ ํตํด JS ํ์ผ์์ ์๋ก์ด ๊ฒฝ๋ก๋ฅผ ๊ฒ์ ๊ฐ๋ฅ. LinkFinder์ ๋ํผ์ธ JSScanner๋ ์ดํด๋ณผ ๊ฐ์น๊ฐ ์์.
- goLinkFinder (go): HTML ์์ค์ ์๋ฒ ๋๋ javascript ํ์ผ ๋ชจ๋์์ ์๋ํฌ์ธํธ๋ฅผ ์ถ์ถ. bug hunters, red teamers, infosec ninjas์๊ฒ ์ ์ฉ.
- JSParser (python2.7): Tornado์ JSBeautifier๋ฅผ ์ฌ์ฉํด JavaScript ํ์ผ์์ ์๋ URL์ ํ์ฑํ๋ python 2.7 ์คํฌ๋ฆฝํธ. AJAX ์์ฒญ์ ์ฝ๊ฒ ๋ฐ๊ฒฌํ๋ ๋ฐ ์ ์ฉ. ์ ์ง๋ณด์๋์ง ์๋ ๊ฒ์ผ๋ก ๋ณด์.
- relative-url-extractor (ruby): ํ์ผ(HTML)์ ์ฃผ๋ฉด ์ ๊ท์์ ์ด์ฉํด ugly(minify) ํ์ผ์์ ์๋ URL์ ์ฐพ์ ์ถ์ถํจ.
- JSFScan (bash, ์ฌ๋ฌ ๋๊ตฌ): ์ฌ๋ฌ ๋๊ตฌ๋ฅผ ์ฌ์ฉํด JS ํ์ผ์์ ํฅ๋ฏธ๋ก์ด ์ ๋ณด๋ฅผ ์์ง.
- subjs (go): JS ํ์ผ ์ฐพ๊ธฐ.
- page-fetch (go): headless browser๋ก ํ์ด์ง๋ฅผ ๋ก๋ํ๊ณ ํ์ด์ง๋ฅผ ๋ก๋ํ๊ธฐ ์ํด ๋ถ๋ฌ์จ ๋ชจ๋ urls๋ฅผ ์ถ๋ ฅ.
- Feroxbuster (rust): ์ด์ ๋๊ตฌ๋ค์ ์ฌ๋ฌ ์ต์ ์ ํผํฉํ content discovery ๋๊ตฌ.
- Javascript Parsing: JS ํ์ผ์์ ๊ฒฝ๋ก ๋ฐ ํ๋ผ๋ฏธํฐ๋ฅผ ์ฐพ๋ Burp extension.
- Sourcemapper: .js.map URL์ ์ฃผ๋ฉด beautified JS ์ฝ๋๋ฅผ ๊ฐ์ ธ์ค๋ ๋๊ตฌ.
- xnLinkFinder: ์ฃผ์ด์ง ํ๊น์ ์๋ํฌ์ธํธ๋ฅผ ๋ฐ๊ฒฌํ๋ ๋๊ตฌ.
- waymore: wayback machine์์ ๋งํฌ๋ฅผ ๋ฐ๊ฒฌ(wayback์ ์๋ต๋ ๋ค์ด๋ก๋ํ๊ณ ๋ ๋ง์ ๋งํฌ๋ฅผ ์ฐพ์).
- HTTPLoot (go): ํผ ์ฑ์ฐ๊ธฐ๊น์ง ํฌํจํด ํฌ๋กค๋งํ๊ณ ํน์ regex๋ก ๋ฏผ๊ฐํ ์ ๋ณด๋ฅผ ์ฐพ์.
- SpiderSuite: Spider Suite๋ ์ฌ์ด๋ฒ ๋ณด์ ์ ๋ฌธ๊ฐ๋ฅผ ์ํ ๊ณ ๊ธ ๋ค๊ธฐ๋ฅ GUI ์น ๋ณด์ Crawler/Spider.
- jsluice (go): JavaScript ์์ค ์ฝ๋์์ URLs, paths, secrets ๋ฐ ๊ธฐํ ํฅ๋ฏธ๋ก์ด ๋ฐ์ดํฐ๋ฅผ ์ถ์ถํ๋ Go ํจํค์ง ๋ฐ command-line tool.
- ParaForge: ์์ฒญ์์ parameters์ endpoints๋ฅผ ์ถ์ถํ์ฌ fuzzing ๋ฐ ์ด๊ฑฐ์ฉ ์ปค์คํ ์๋๋ฆฌ์คํธ๋ฅผ ๋ง๋๋ ๊ฐ๋จํ Burp Suite extension.
- katana (go): ์ด ์ฉ๋์ ์์ฃผ ์ข์ ๋๊ตฌ.
- Crawley (go): ์ฐพ์ ์ ์๋ ๋ชจ๋ ๋งํฌ๋ฅผ ์ถ๋ ฅ.
Brute Force directories and files
๋ฃจํธ ํด๋์์ brute-forcing์ ์์ํ๊ณ , ์ด ๋ฐฉ๋ฒ์ผ๋ก ์ฐพ์ ๋ชจ๋ ๋๋ ํฐ๋ฆฌ์ Spidering์ผ๋ก ๋ฐ๊ฒฌ๋ ๋ชจ๋ ๋๋ ํฐ๋ฆฌ๋ฅผ ๋ฐ๋์ brute-force ํ์ธ์(๋ฐ๊ฒฌ๋ ๋๋ ํฐ๋ฆฌ ์ด๋ฆ์ ์ฌ์ฉํ ์๋๋ฆฌ์คํธ๋ฅผ ์์ ๋ถ์ฌ ์ฌ๊ท์ ์ผ๋ก brute-forcing ํ ์ ์์ต๋๋ค).
๋๊ตฌ:
- Dirb / Dirbuster - Kali์ ํฌํจ, ์ค๋๋(๊ทธ๋ฆฌ๊ณ ๋๋ฆฐ) ๋๊ตฌ์ง๋ง ์๋ํจ. auto-signed certificates์ recursive search ์ง์. ๋ค๋ฅธ ์ต์ ๋ค์ ๋นํด ๋๋ฌด ๋๋ฆผ.
- Dirsearch (python): auto-signed certificates๋ ํ์ฉํ์ง ์์ง๋ง recursive search๋ฅผ ํ์ฉ.
- Gobuster (go): auto-signed certificates ํ์ฉ, ๊ทธ๋ฌ๋ recursive search๋ ์์.
- Feroxbuster - ๋น ๋ฅด๋ฉฐ recursive search ์ง์.
- wfuzz
wfuzz -w /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt https://domain.com/api/FUZZ - ffuf - ๋น ๋ฆ:
ffuf -c -w /usr/share/wordlists/dirb/big.txt -u http://10.10.10.10/FUZZ - uro (python): spider๋ ์๋์ง๋ง ๋ฐ๊ฒฌ๋ URL ๋ฆฌ์คํธ๋ฅผ ๋ฐ์ โ์ค๋ณตโ URL์ ์ ๊ฑฐํ๋ ๋๊ตฌ.
- Scavenger: Burp history์์ ์ฌ๋ฌ ํ์ด์ง์ ๋๋ ํฐ๋ฆฌ ๋ชฉ๋ก์ ์์ฑํ๋ Burp Extension.
- TrashCompactor: js imports ๊ธฐ๋ฐ์ผ๋ก ์ค๋ณต ๊ธฐ๋ฅ์ ๊ฐ์ง URL ์ ๊ฑฐ.
- Chamaleon: wapalyzer๋ฅผ ์ฌ์ฉํด ์ฌ์ฉ ์ค์ธ ๊ธฐ์ ์ ๊ฐ์งํ๊ณ ์ฌ์ฉํ ์๋๋ฆฌ์คํธ๋ฅผ ์ ํ.
๊ถ์ฅ ์๋๋ฆฌ์คํธ:
- https://github.com/carlospolop/Auto_Wordlists/blob/main/wordlists/bf_directories.txt
- Dirsearch included dictionary
- http://gist.github.com/jhaddix/b80ea67d85c13206125806f0828f4d10
- Assetnote wordlists
- https://github.com/danielmiessler/SecLists/tree/master/Discovery/Web-Content
- raft-large-directories-lowercase.txt
- directory-list-2.3-medium.txt
- RobotsDisallowed/top10000.txt
- https://github.com/random-robbie/bruteforce-lists
- https://github.com/google/fuzzing/tree/master/dictionaries
- https://github.com/six2dez/OneListForAll
- https://github.com/random-robbie/bruteforce-lists
- https://github.com/ayoubfathi/leaky-paths
- /usr/share/wordlists/dirb/common.txt
- /usr/share/wordlists/dirb/big.txt
- /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
์ฐธ๊ณ : brute-forcing ๋๋ spidering ์ค ์๋ก์ด ๋๋ ํฐ๋ฆฌ๊ฐ ๋ฐ๊ฒฌ๋๋ฉด ํญ์ ํด๋น ๋๋ ํฐ๋ฆฌ๋ฅผ Brute-Force ํด์ผ ํฉ๋๋ค.
What to check on each file found
- Broken link checker: HTML ๋ด๋ถ์ broken links๋ฅผ ์ฐพ์ takeover์ ์ทจ์ฝํ ์ ์๋์ง ํ์ธ.
- File Backups: ๋ชจ๋ ํ์ผ์ ์ฐพ์ ํ ์คํ ํ์ผ์ ๋ฐฑ์ ์ ์ฐพ์๋ณด์ธ์(โ.phpโ, โ.aspxโโฆ). ๋ฐฑ์ ํ์ผ ์ด๋ฆ์ ์ผ๋ฐ์ ์ธ ๋ณํ์: file.ext~, #file.ext#, ~file.ext, file.ext.bak, file.ext.tmp, file.ext.old, file.bak, file.tmp and file.old. ๋๊ตฌ bfac ๋๋ backup-gen๋ฅผ ์ฌ์ฉํ ์ ์์.
- Discover new parameters: ์จ๊ฒจ์ง ํ๋ผ๋ฏธํฐ๋ฅผ ์ฐพ๊ธฐ ์ํด Arjun, parameth, x8 ๋ฐ Param Miner๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค. ๊ฐ๋ฅํ๋ฉด ๊ฐ ์คํ ๊ฐ๋ฅํ ์น ํ์ผ์์ ์จ๊ฒจ์ง ํ๋ผ๋ฏธํฐ๋ฅผ ์ฐพ์๋ณด์ธ์.
- Arjun all default wordlists: https://github.com/s0md3v/Arjun/tree/master/arjun/db
- Param-miner โparamsโ : https://github.com/PortSwigger/param-miner/blob/master/resources/params
- Assetnote โparameters_top_1mโ: https://wordlists.assetnote.io/
- nullenc0de โparams.txtโ: https://gist.github.com/nullenc0de/9cb36260207924f8e1787279a05eb773
- Comments: ๋ชจ๋ ํ์ผ์ ์ฃผ์์ ํ์ธํ์ธ์. credentials๋ hidden functionality๋ฅผ ์ฐพ์ ์ ์์.
- CTF๋ฅผ ํ๋ ์ดํ๋ ๊ฒฝ์ฐ, ํํ ํธ๋ฆญ์ผ๋ก ํ์ด์ง์ ์์ค ์ฐ์ธก์ ์๋ฐฑ ๊ฐ์ ๊ณต๋ฐฑ์ ๋ฃ์ด ๋ธ๋ผ์ฐ์ ๋ก๋ ๋ณด์ด์ง ์๊ฒ ์ฃผ์์ ์ ๋ณด๋ฅผ ์จ๊ธฐ๋ ๊ฒ์ด ์์. ๋๋ ์ฌ๋ฌ ๊ฐ์ newline์ ์ฌ์ฉํด ์นํ์ด์ง ํ๋จ์ ์ฃผ์์ ์ ๋ณด๋ฅผ ์จ๊ธฐ๋ ๋ฐฉ๋ฒ๋ ์์.
- API keys: API key๋ฅผ ์ฐพ์ผ๋ฉด ๋ค์ํ ํ๋ซํผ์ API ํค ์ฌ์ฉ ๋ฐฉ๋ฒ์ ์๋ดํ๋ ํ๋ก์ ํธ๋ค์ ์ฐธ๊ณ ํ์ธ์: keyhacks, zile, truffleHog, SecretFinder, RegHex, DumpsterDive, EarlyBird
- Google API keys: AIza๋ก ์์ํ๋ ํํ์ API key(์: AIzaSyA-qLheq6xjDiEIRisP_ujUseYLQCHUjik)๋ฅผ ๋ฐ๊ฒฌํ๋ฉด gmapapiscanner ํ๋ก์ ํธ๋ก ํด๋น ํค๊ฐ ์ ๊ทผํ ์ ์๋ API๋ฅผ ํ์ธํ ์ ์์.
- S3 Buckets: spidering ์ค์ ์ด๋ค subdomain์ด๋ link๊ฐ S3 bucket๊ณผ ๊ด๋ จ๋์ด ์๋์ง ํ์ธํ์ธ์. ๊ทธ๋ฐ ๊ฒฝ์ฐ, ๋ฒํท์ ๊ถํ์ ํ์ธํ์ธ์.
Special findings
spidering๊ณผ brute-forcing์ ์ํํ๋ ๋์ ์ฃผ์ํด์ผ ํ ํฅ๋ฏธ๋ก์ด ์ฌํญ๋ค์ด ๋ฐ๊ฒฌ๋ ์ ์์ต๋๋ค.
Interesting files
- CSS ํ์ผ ๋ด๋ถ์ links๋ก ์ฐ๊ฒฐ๋ ๋ค๋ฅธ ํ์ผ๋ค์ ์ฐพ์๋ณด์ธ์.
- If you find a .git file some information can be extracted
- .env ํ์ผ์ ์ฐพ์ผ๋ฉด api keys, db ๋น๋ฐ๋ฒํธ ๋ฐ ๊ธฐํ ์ ๋ณด๋ฅผ ์ป์ ์ ์์.
- API endpoints๋ฅผ ์ฐพ์ผ๋ฉด ํด๋น ์๋ํฌ์ธํธ๋ค๋ ํ ์คํธํด์ผ ํฉ๋๋ค. ์ด๋ค์ ํ์ผ์ด ์๋์ง๋ง ํ์ผ์ฒ๋ผ ๋ณด์ผ ๊ฐ๋ฅ์ฑ์ด ํผ.
- JS files: spidering ์น์ ์์ JS ํ์ผ์์ ๊ฒฝ๋ก๋ฅผ ์ถ์ถํ ์ ์๋ ์ฌ๋ฌ ๋๊ตฌ๋ฅผ ์ธ๊ธํ์ต๋๋ค. ๋ํ ๋ฐ๊ฒฌ๋ ๊ฐ JS ํ์ผ์ ๋ชจ๋ํฐ๋งํ๋ ๊ฒ์ด ํฅ๋ฏธ๋ก์ธ ์ ์์ต๋๋ค. ์ผ๋ถ ๊ฒฝ์ฐ JS ํ์ผ์ ๋ณ๊ฒฝ์ ์ฝ๋์ ์ ์ฌ์ ์ทจ์ฝ์ ์ด ๋์ ๋์์์ ์๋ฏธํ ์ ์์ต๋๋ค. ์๋ฅผ ๋ค์ด JSMon๋ฅผ ์ฌ์ฉํ ์ ์์.
- ๋ฐ๊ฒฌ๋ JS ํ์ผ์ RetireJS๋ JSHole๋ก ๊ฒ์ฌํด ์ทจ์ฝ ์ฌ๋ถ๋ฅผ ํ์ธํ์ธ์.
- Javascript Deobfuscator and Unpacker: https://lelinhtinh.github.io/de4js/, https://www.dcode.fr/javascript-unobfuscator
- Javascript Beautifier: http://jsbeautifier.org/, http://jsnice.org/
- JsFuck deobfuscation (javascript with chars:โ[]!+โ https://enkhee-osiris.github.io/Decoder-JSFuck/)
- TrainFuck:
+72.+29.+7..+3.-67.-12.+55.+24.+3.-6.-8.-67.-23. - ์ ๊ท ํํ์์ ์ดํดํด์ผ ํ๋ ๊ฒฝ์ฐ๊ฐ ์์ฃผ ์์ต๋๋ค. ๋์์ด ๋๋ ์ฌ์ดํธ: https://regex101.com/ ๋๋ https://pythonium.net/regex
- ํผ์ด ๊ฐ์ง๋ ํ์ผ๋ค์ ๋ชจ๋ํฐ๋งํ๋ ๊ฒ๋ ์ข์ต๋๋ค. ํ๋ผ๋ฏธํฐ ๋ณ๊ฒฝ์ด๋ ์๋ก์ด ํผ์ ์ถํ์ ์ ์ฌ์ ์ทจ์ฝ ๊ธฐ๋ฅ์ ๋์ ์ ์์ฌํ ์ ์์ต๋๋ค.
403 Forbidden/Basic Authentication/401 Unauthorized (bypass)
502 Proxy Error
์ด๋ค ํ์ด์ง๊ฐ ํด๋น ์ฝ๋๋ก ์๋ตํ๋ฉด, ๋ณดํต ์๋ชป ๊ตฌ์ฑ๋ proxy์ผ ๊ฐ๋ฅ์ฑ์ด ๋์ต๋๋ค. ๋ง์ฝ GET https://google.com HTTP/1.1์ ๊ฐ์ HTTP ์์ฒญ์ ๋ณด๋ธ๋ค๋ฉด(Host ํค๋ ๋ฐ ๋ค๋ฅธ ์ผ๋ฐ ํค๋ ํฌํจ), proxy๋ _google.com_์ ์ ๊ทผํ๋ ค๊ณ ์๋ํ ๊ฒ์ด๊ณ ๊ทธ๋ SSRF๋ฅผ ๋ฐ๊ฒฌํ๊ฒ ๋ ์ ์์ต๋๋ค.
NTLM Authentication - Info disclosure
์๋ฒ๊ฐ ์ธ์ฆ์ ์๊ตฌํ๋๋ฐ ํด๋น ์๋ฒ๊ฐ Windows์ด๊ฑฐ๋ ๋ก๊ทธ์ธ์์ ๋๋ฉ์ธ ์ด๋ฆ์ ์๊ตฌํ๋ ๊ฒฝ์ฐ ์ ๋ณด ๋์ถ์ ์ ๋ํ ์ ์์ต๋๋ค.
๋ค์ ํค๋๋ฅผ ์ ์กํ์ธ์: โAuthorization: NTLM TlRMTVNTUAABAAAAB4IIAAAAAAAAAAAAAAAAAAAAAAA=โ ๊ทธ๋ฌ๋ฉด NTLM ์ธ์ฆ ๋์ ๋ฐฉ์ ๋๋ฌธ์ ์๋ฒ๋ โWWW-Authenticateโ ํค๋ ๋ด๋ถ์ ๋ด๋ถ ์ ๋ณด(IIS ๋ฒ์ , Windows ๋ฒ์ ๋ฑ)๋ฅผ ์๋ต์ผ๋ก ๋ณด๋ผ ์ ์์ต๋๋ค.
์ด๋ฅผ ์๋ํํ๋ ค๋ฉด nmap ํ๋ฌ๊ทธ์ธ โhttp-ntlm-info.nseโ๋ฅผ ์ฌ์ฉํ ์ ์์.
HTTP Redirect (CTF)
๋ฆฌ๋ค์ด๋ ์ ๋ด๋ถ์ ์ฝํ ์ธ ๋ฅผ ๋ฃ์ ์ ์์ต๋๋ค. ์ด ์ฝํ ์ธ ๋ ๋ธ๋ผ์ฐ์ ๊ฐ ๋ฆฌ๋ค์ด๋ ์ ์ ์คํํ๊ธฐ ๋๋ฌธ์ ์ฌ์ฉ์์๊ฒ๋ ๋ณด์ฌ์ง์ง ์์ง๋ง, ๊ทธ ๋ด๋ถ์ ๋ฌด์ธ๊ฐ ์จ๊ฒจ์ ธ ์์ ์ ์์ต๋๋ค.
Web Vulnerabilities Checking
์น ์ ํ๋ฆฌ์ผ์ด์ ์ ๋ํ ํฌ๊ด์ ์ด๊ฑฐ๊ฐ ์๋ฃ๋์์ผ๋ฉด ์ด์ ๊ฐ๋ฅํ ๋ง์ ์ทจ์ฝ์ ์ ํ์ธํ ์ฐจ๋ก์ ๋๋ค. ์ฒดํฌ๋ฆฌ์คํธ๋ ๋ค์์์ ํ์ธํ์ธ์:
Web Vulnerabilities Methodology
์น ์ทจ์ฝ์ ์ ๋ํ ์ถ๊ฐ ์ ๋ณด:
- https://six2dez.gitbook.io/pentest-book/others/web-checklist
- https://kennel209.gitbooks.io/owasp-testing-guide-v4/content/en/web_application_security_testing/configuration_and_deployment_management_testing.html
- https://owasp-skf.gitbook.io/asvs-write-ups/kbid-111-client-side-template-injection
Monitor Pages for changes
ํ์ด์ง ๋ณํ๋ฅผ ๋ชจ๋ํฐ๋งํ์ฌ ์ ์ฌ์ ์ทจ์ฝ์ ์ด ์ฝ์ ๋์๋์ง ํ์ธํ๋ ค๋ฉด https://github.com/dgtlmoon/changedetection.io์ ๊ฐ์ ๋๊ตฌ๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค.
HackTricks Automatic Commands
HackTricks Automatic Commands
```yaml Protocol_Name: Web #Protocol Abbreviation if there is one. Port_Number: 80,443 #Comma separated if there is more than one. Protocol_Description: Web #Protocol Abbreviation Spelled outEntry_1: Name: Notes Description: Notes for Web Note: | https://book.hacktricks.wiki/en/network-services-pentesting/pentesting-web/index.html
Entry_2: Name: Quick Web Scan Description: Nikto and GoBuster Command: nikto -host {Web_Proto}://{IP}:{Web_Port} &&&& gobuster dir -w {Small_Dirlist} -u {Web_Proto}://{IP}:{Web_Port} && gobuster dir -w {Big_Dirlist} -u {Web_Proto}://{IP}:{Web_Port}
Entry_3: Name: Nikto Description: Basic Site Info via Nikto Command: nikto -host {Web_Proto}://{IP}:{Web_Port}
Entry_4: Name: WhatWeb Description: General purpose auto scanner Command: whatweb -a 4 {IP}
Entry_5: Name: Directory Brute Force Non-Recursive Description: Non-Recursive Directory Brute Force Command: gobuster dir -w {Big_Dirlist} -u {Web_Proto}://{IP}:{Web_Port}
Entry_6: Name: Directory Brute Force Recursive Description: Recursive Directory Brute Force Command: python3 {Tool_Dir}dirsearch/dirsearch.py -w {Small_Dirlist} -e php,exe,sh,py,html,pl -f -t 20 -u {Web_Proto}://{IP}:{Web_Port} -r 10
Entry_7: Name: Directory Brute Force CGI Description: Common Gateway Interface Brute Force Command: gobuster dir -u {Web_Proto}://{IP}:{Web_Port}/ -w /usr/share/seclists/Discovery/Web-Content/CGIs.txt -s 200
Entry_8:
Name: Nmap Web Vuln Scan
Description: Tailored Nmap Scan for web Vulnerabilities
Command: nmap -vv โreason -Pn -sV -p {Web_Port} โscript=banner,(http* or ssl*) and not (brute or broadcast or dos or external or http-slowloris* or fuzzer) {IP}
Entry_9: Name: Drupal Description: Drupal Enumeration Notes Note: | git clone https://github.com/immunIT/drupwn.git for low hanging fruit and git clone https://github.com/droope/droopescan.git for deeper enumeration
Entry_10: Name: WordPress Description: WordPress Enumeration with WPScan Command: | ?What is the location of the wp-login.php? Example: /Yeet/cannon/wp-login.php wpscan โurl {Web_Proto}://{IP}{1} โenumerate ap,at,cb,dbe && wpscan โurl {Web_Proto}://{IP}{1} โenumerate u,tt,t,vp โpasswords {Big_Passwordlist} -e
Entry_11: Name: WordPress Hydra Brute Force Description: Need User (admin is default) Command: hydra -l admin -P {Big_Passwordlist} {IP} -V http-form-post โ/wp-login.php:log=^USER^&pwd=^PASS^&wp-submit=Log In&testcookie=1:S=Locationโ
Entry_12: Name: Ffuf Vhost Description: Simple Scan with Ffuf for discovering additional vhosts Command: ffuf -w {Subdomain_List}:FUZZ -u {Web_Proto}://{Domain_Name} -H โHost:FUZZ.{Domain_Name}โ -c -mc all {Ffuf_Filters}
</details>
> [!TIP]
> AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:<img src="../../../../../images/arte.png" alt="" style="width:auto;height:24px;vertical-align:middle;">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="../../../../../images/arte.png" alt="" style="width:auto;height:24px;vertical-align:middle;">\
> GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ: <img src="../../../../../images/grte.png" alt="" style="width:auto;height:24px;vertical-align:middle;">[**HackTricks Training GCP Red Team Expert (GRTE)**](https://training.hacktricks.xyz/courses/grte)<img src="../../../../../images/grte.png" alt="" style="width:auto;height:24px;vertical-align:middle;">
> Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ: <img src="../../../../../images/azrte.png" alt="" style="width:auto;height:24px;vertical-align:middle;">[**HackTricks Training Azure Red Team Expert (AzRTE)**](https://training.hacktricks.xyz/courses/azrte)<img src="../../../../../images/azrte.png" alt="" style="width:auto;height:24px;vertical-align:middle;">
>
> <details>
>
> <summary>HackTricks ์ง์ํ๊ธฐ</summary>
>
> - [**๊ตฌ๋
๊ณํ**](https://github.com/sponsors/carlospolop) ํ์ธํ๊ธฐ!
> - **๐ฌ [**๋์ค์ฝ๋ ๊ทธ๋ฃน**](https://discord.gg/hRep4RUj7f) ๋๋ [**ํ
๋ ๊ทธ๋จ ๊ทธ๋ฃน**](https://t.me/peass)์ ์ฐธ์ฌํ๊ฑฐ๋ **ํธ์ํฐ** ๐ฆ [**@hacktricks_live**](https://twitter.com/hacktricks_live)**๋ฅผ ํ๋ก์ฐํ์ธ์.**
> - **[**HackTricks**](https://github.com/carlospolop/hacktricks) ๋ฐ [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.**
>
> </details>


