1080 - Pentesting Socks
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์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.
๊ธฐ๋ณธ ์ ๋ณด
SOCKS๋ ํด๋ผ์ด์ธํธ์ ์๋ฒ ๊ฐ์ ๋ฐ์ดํฐ๋ฅผ ํ๋ก์๋ฅผ ํตํด ์ ์กํ๋ ๋ฐ ์ฌ์ฉ๋๋ ํ๋กํ ์ฝ์
๋๋ค. ๋ค์ฏ ๋ฒ์งธ ๋ฒ์ ์ธ SOCKS5๋ ์ ํ์ ์ธ์ฆ ๊ธฐ๋ฅ์ ์ถ๊ฐํ์ฌ ๊ถํ์ด ์๋ ์ฌ์ฉ์๋ง ์๋ฒ์ ์ ๊ทผํ ์ ์๋๋ก ํฉ๋๋ค. ์ฃผ๋ก TCP ์ฐ๊ฒฐ์ ํ๋ก์์ UDP ํจํท์ ์ ๋ฌ(UDP ASSOCIATE ๋ช
๋ น์ ํตํด)์ ์ฒ๋ฆฌํ๋ฉฐ, OSI ๋ชจ๋ธ์ ์ธ์
๊ณ์ธต (Layer 5)์์ ๋์ํฉ๋๋ค. ๋๊ตฌ๊ฐ socks5h ์คํด์ ์ง์ํ๋ฉด, DNS ํด์์ด ํ๋ก์๋ฅผ ํตํด ๊ฐ์ ๋ก ์ด๋ฃจ์ด์ ธ ๋ก์ปฌ DNS leak์ ๋ฐฉ์งํ๊ณ ๋ฐ์ ํธ์คํธ์ fingerprinting์ ์ด๋ ต๊ฒ ํฉ๋๋ค.
๊ธฐ๋ณธ ํฌํธ: 1080
์ด๊ฑฐ
์ธ์ฆ ํ์ธ
nmap -p 1080 <ip> --script socks-auth-info
Brute Force
๊ธฐ๋ณธ ์ฌ์ฉ๋ฒ
nmap --script socks-brute -p 1080 <ip>
๊ณ ๊ธ ์ฌ์ฉ๋ฒ
nmap --script socks-brute --script-args userdb=users.txt,passdb=rockyou.txt,unpwdb.timelimit=30m -p 1080 <ip>
Output
PORT STATE SERVICE
1080/tcp open socks
| socks-brute:
| Accounts
| patrik:12345 - Valid credentials
| Statistics
|_ Performed 1921 guesses in 6 seconds, average tps: 320
Hydra ๋ชจ๋
hydra -L users.txt -P passwords.txt -s 1080 -t 16 -V <ip> socks5
๋ฐฉ๋ฒ & open-proxy enumeration
nmap -sV --script socks-methods,socks-open-proxy -p 1080 <ip>
socks-methods๋ ์๋ฒ๊ฐ ์ง์ํ๋ ์ธ์ฆ ์ ํ์ ๋์ดํ๋๋ก ๊ฐ์ ํ๊ณ , socks-open-proxy๋ ์๋น์ค๊ฐ ๋ฆด๋ ์ด๋ก ์
์ฉ๋ ์ ์๋์ง ํ์ธํ๊ธฐ ์ํด ์์๋ฐ์ด๋ CONNECT๋ฅผ ์๋ํฉ๋๋ค.
์์ ํธ๋์ ฐ์ดํฌ ๊ฒ์ฌ
printf '\x05\x01\x00' | nc -nv <ip> 1080
A \x05 01 00 ์๋ต์ SOCKS5๊ฐ โno authenticationโ์ ์ ๊ณตํจ์ ๋ํ๋
๋๋ค. \x00 ๋ค์์ \x02๊ฐ ์ค๋ฉด username/password๊ฐ ํ์ํจ์ ์๋ฏธํ๋ฉฐ, ์ด๋ scripts์์ ๋
ธ์ถ๋ ์ฅ์น๋ฅผ ๋น ๋ฅด๊ฒ fingerprintingํ๋ ๋ฐ ์ ์ฉํฉ๋๋ค.
๋น ๋ฅธ egress ๊ฒ์ฆ
curl --socks5-hostname <ip>:1080 https://ifconfig.me
curl --socks5-hostname user:pass@<ip>:1080 http://internal.target
DNS ํด์์ด ์๊ฒฉ์์ ์ด๋ฃจ์ด์ง๋๋ก --socks5-hostname(๋๋ socks5h:// URL)๋ฅผ ์ฌ์ฉํ์ธ์. ํ๋ก์๊ฐ ์ค์ ๋ก ๋ด๋ถ ์ ๊ทผ์ ์ ๊ณตํ๋์ง ํ์ธํ๋ ค๋ฉด proxychains4 -q nmap -sT -Pn --top-ports 200 <internal-host>์ ํจ๊ป ์ฌ์ฉํ์ธ์.
์ธํฐ๋ท ์ ์ญ ํ์ / ์ง๋ฌธ ์์ง
masscan 0.0.0.0/0 -p1080 --banners --rate 100000 -oX socks.xml
๊ฒฐ๊ณผ๋ฅผ NSE, zgrab2, ๋๋ custom python scripts์ ๋ค์ ํผ๋๋ฐฑํ์ฌ ์ ๋งํ ํธ์คํธ(์: ๋ฐฐ๋ ๋ฌธ์์ด 3proxy, Dante, MikroTik)์ ์ฐ์ ์์๋ฅผ ์ ํ์ธ์.
Tunneling and Port Forwarding
tunneling and post forwarding์ ๊ดํ ์ ๋ณด๋ ๋ค์ ํ์ด์ง๋ฅผ ํ์ธํ์ธ์: Tunneling and Port Forwarding
์ฐธ๊ณ ์๋ฃ
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์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.


