Prototype Pollution: Poisoning JavaScript's Object Chain
How Prototype Pollution corrupts JavaScript's prototype chain and how to defend against it
Understanding different DNS record types is important for reconnaissance:
Unix Tools:
host: A simple utility for DNS lookups.
host www.example.com
host -t mx example.com
host -t txt example.com
# Standard enumeration
dnsrecon -d example.com -t std
# Brute-force subdomains using a wordlist
dnsrecon -d example.com -D ~/list.txt -t brt
dnsenum example.com
Windows Tools:
nslookup: The standard Windows command-line tool for querying DNS.
nslookup mail.example.com
# Query a specific record type against a specific DNS server
nslookup -type=TXT info.example.com 192.168.1.1
net view: Can sometimes reveal information in Windows environments (though not strictly DNS).
net view \\dc01 /all
While not a dedicated port scanner like Nmap, nc can be used for basic port checks. It’s often slower and less feature-rich.
Options:
-n: Do not resolve hostnames (faster).-v/-vv: Verbose output.-w <seconds>: Timeout for connections.-z: Zero-I/O mode (scan without sending data).-u: Scan UDP ports.Examples:
nc -nvv -w 3 -z 192.168.212.151 1-100
nc -nv -u -z -w 1 192.168.50.149 120-123
xargs):
# TCP Scan with 20 parallel connections
seq 1000 10000 | xargs -P 20 -I {} nc -nvv -w 1 -z 192.168.50.151 {} 2>&1 | grep "open"
# UDP Scan with 20 parallel connections
seq 100 200 | xargs -P 20 -I {} nc -nvv -u -w 3 -z 192.168.159.151 {} 2>&1 | grep "open"
Nmap is the industry standard for port scanning and network discovery.
Windows Alternatives:
Test-NetConnection: Built-in PowerShell cmdlet for testing network connectivity, including specific ports.
Test-NetConnection -Port 445 192.168.50.151
# Scan TCP ports 1-1024
1..1024 | % { try { $tcpClient = New-Object Net.Sockets.TcpClient; $tcpClient.Connect("192.168.50.151", $_); Write-Output "TCP port $_ is open"; $tcpClient.Close() } catch {} } 2>$null
# Scan the last octet for an open port (e.g., port 43)
1..254 | ForEach-Object {
$ip = "192.168.50.$_"
try {
$tcpClient = New-Object Net.Sockets.TcpClient
$tcpClient.Connect($ip, 43)
if ($tcpClient.Connected) { Write-Output "TCP port 43 is open on $ip"; $tcpClient.Close() }
} catch {}
}
Server Message Block (SMB) is commonly used for file sharing in Windows environments.
Using Nmap for SMB Enumeration:
nmap -v -p 139,445 -oG smb_scan.txt 192.168.159.0/24
grep "open" smb_scan.txt
nmap -v -p 139,445 --script smb-os-discovery 192.168.159.152
ls -1 /usr/share/nmap/scripts/smb*
Other SMB Enumeration Tools:
Windows SMB Commands:
net view \\dc01 /all
Simple Mail Transfer Protocol (SMTP) runs on TCP port 25. Enumeration can reveal valid usernames.
Techniques:
VRFY: Asks the server to verify an email address.EXPN: Asks the server for the membership of a mailing list (often disabled).Manual Enumeration with nc:
nc -nv 192.168.50.8 25
# Connected... Server sends banner (e.g., 220 mail ESMTP Postfix)
VRFY root
# Server responds (e.g., 252 2.0.0 root)
VRFY nonexistantuser
# Server responds (e.g., 550 5.1.1 <nonexistantuser>: Recipient address rejected...)
QUIT
Using a Script (Example: vrfy.py)
A simple Python script can automate VRFY checks against a list of usernames. (See original note for script code).
Using Telnet:
Telnet can also be used for interactive SMTP sessions.
telnet 192.168.178.8 25
# Connected... Server sends banner
VRFY root
# Server responds
QUIT
Windows SMTP Checks:
Test-NetConnection -Port 25 192.168.50.8
# Enable Telnet Client feature if not already installed
dism /online /Enable-Feature /FeatureName:TelnetClient
# Connect using Telnet
telnet 192.168.50.8 25
Simple Network Management Protocol (SNMP) typically uses UDP port 161. It can expose a wealth of system information if misconfigured.
MIB (Management Information Base):
A hierarchical database containing manageable objects on a device. OIDs (Object Identifiers) point to specific pieces of information.
Common OIDs for Enumeration:
| OID | Information |
|---|---|
| 1.3.6.1.2.1.25.1.6.0 | System Processes |
| 1.3.6.1.2.1.25.4.2.1.2 | Running Programs |
| 1.3.6.1.2.1.25.4.2.1.4 | Process Path |
| 1.3.6.1.2.1.25.2.3.1.4 | Storage Units |
| 1.3.6.1.2.1.25.6.3.1.2 | Installed Software Names |
| 1.3.6.1.4.1.77.1.2.25 | User Accounts |
| 1.3.6.1.2.1.6.13.1.3 | TCP Local Ports |
Scanning for SNMP Hosts:
sudo nmap -sU --open -p 161 192.168.50.0/24 -oG open_snmp.txt
grep "open" open_snmp.txt
SNMP Enumeration Tools:
정찰(reconnaissance)을 제대로 하려면 다양한 DNS 레코드 유형을 알아 두는 게 중요합니다.
Unix 도구:
host: DNS 조회를 위한 간단한 유틸리티.
host www.example.com
host -t mx example.com
host -t txt example.com
# Standard enumeration
dnsrecon -d example.com -t std
# Brute-force subdomains using a wordlist
dnsrecon -d example.com -D ~/list.txt -t brt
dnsenum example.com
Windows 도구:
nslookup: DNS를 질의하는 표준 Windows 명령줄 도구.
nslookup mail.example.com
# Query a specific record type against a specific DNS server
nslookup -type=TXT info.example.com 192.168.1.1
net view: Windows 환경에서 (엄밀히 DNS는 아니지만) 정보를 드러내기도 한다.
net view \\dc01 /all
nc가 Nmap 같은 전용 포트 스캐너는 아니지만, 기본적인 포트 확인 정도는 충분히 해냅니다. 다만 보통 더 느리고 기능도 단출하죠.
옵션:
-n: 호스트 이름을 해석하지 않는다(더 빠름).-v/-vv: 상세 출력.-w <seconds>: 연결 타임아웃.-z: Zero-I/O 모드(데이터를 보내지 않고 스캔).-u: UDP 포트를 스캔.예시:
nc -nvv -w 3 -z 192.168.212.151 1-100
nc -nv -u -z -w 1 192.168.50.149 120-123
xargs 사용):
# TCP Scan with 20 parallel connections
seq 1000 10000 | xargs -P 20 -I {} nc -nvv -w 1 -z 192.168.50.151 {} 2>&1 | grep "open"
# UDP Scan with 20 parallel connections
seq 100 200 | xargs -P 20 -I {} nc -nvv -u -w 3 -z 192.168.159.151 {} 2>&1 | grep "open"
Nmap은 포트 스캐닝과 네트워크 탐색의 사실상 업계 표준입니다.
Windows 대안:
Test-NetConnection: 특정 포트를 포함해 네트워크 연결성을 테스트하는 내장 PowerShell cmdlet.
Test-NetConnection -Port 445 192.168.50.151
# Scan TCP ports 1-1024
1..1024 | % { try { $tcpClient = New-Object Net.Sockets.TcpClient; $tcpClient.Connect("192.168.50.151", $_); Write-Output "TCP port $_ is open"; $tcpClient.Close() } catch {} } 2>$null
# Scan the last octet for an open port (e.g., port 43)
1..254 | ForEach-Object {
$ip = "192.168.50.$_"
try {
$tcpClient = New-Object Net.Sockets.TcpClient
$tcpClient.Connect($ip, 43)
if ($tcpClient.Connected) { Write-Output "TCP port 43 is open on $ip"; $tcpClient.Close() }
} catch {}
}
Server Message Block(SMB)은 Windows 환경에서 파일 공유에 흔히 쓰이는 프로토콜입니다.
Nmap으로 SMB 열거:
nmap -v -p 139,445 -oG smb_scan.txt 192.168.159.0/24
grep "open" smb_scan.txt
nmap -v -p 139,445 --script smb-os-discovery 192.168.159.152
ls -1 /usr/share/nmap/scripts/smb*
기타 SMB 열거 도구:
Windows SMB 명령:
net view \\dc01 /all
Simple Mail Transfer Protocol(SMTP)는 TCP 25번 포트에서 동작합니다. 이 열거를 잘 활용하면 유효한 사용자 이름을 캐낼 수 있죠.
기법:
VRFY: 서버에 이메일 주소를 검증해 달라고 요청합니다.EXPN: 서버에 메일링 리스트 구성원을 물어봅니다(대개 비활성화돼 있죠).nc를 이용한 수동 열거:
nc -nv 192.168.50.8 25
# Connected... Server sends banner (e.g., 220 mail ESMTP Postfix)
VRFY root
# Server responds (e.g., 252 2.0.0 root)
VRFY nonexistantuser
# Server responds (e.g., 550 5.1.1 <nonexistantuser>: Recipient address rejected...)
QUIT
스크립트 사용(예: vrfy.py)
간단한 Python 스크립트로 사용자 이름 목록에 대한 VRFY 검사를 자동화할 수 있습니다. (스크립트 코드는 원본 노트를 참고하세요.)
Telnet 사용:
Telnet으로도 인터랙티브 SMTP 세션을 열 수 있습니다.
telnet 192.168.178.8 25
# Connected... Server sends banner
VRFY root
# Server responds
QUIT
Windows SMTP 점검:
Test-NetConnection -Port 25 192.168.50.8
# Enable Telnet Client feature if not already installed
dism /online /Enable-Feature /FeatureName:TelnetClient
# Connect using Telnet
telnet 192.168.50.8 25
Simple Network Management Protocol(SNMP)은 보통 UDP 161번 포트를 씁니다. 그런데 설정이 허술하면 시스템 정보를 통째로 흘려 버릴 수 있어 눈여겨볼 만하죠.
MIB (Management Information Base):
장치의 관리 가능한 객체들을 담아 둔 계층형 데이터베이스입니다. 그 안에서 OID(Object Identifier)가 특정 정보 조각을 콕 집어 가리키죠.
열거에 유용한 대표 OID:
| OID | 정보 |
|---|---|
| 1.3.6.1.2.1.25.1.6.0 | 시스템 프로세스 |
| 1.3.6.1.2.1.25.4.2.1.2 | 실행 중인 프로그램 |
| 1.3.6.1.2.1.25.4.2.1.4 | 프로세스 경로 |
| 1.3.6.1.2.1.25.2.3.1.4 | 스토리지 단위 |
| 1.3.6.1.2.1.25.6.3.1.2 | 설치된 소프트웨어 이름 |
| 1.3.6.1.4.1.77.1.2.25 | 사용자 계정 |
| 1.3.6.1.2.1.6.13.1.3 | TCP 로컬 포트 |
SNMP 호스트 스캔:
sudo nmap -sU --open -p 161 192.168.50.0/24 -oG open_snmp.txt
grep "open" open_snmp.txt
SNMP 열거 도구: