DNS枚举
查找主机的IP地址
for dns in $(cat namelist.txt);do host $dns.google.com;done|grep "has address"
反向查找主机名
for adr in $(seq 164 167); do host $ip.$adr;done|grep "pointer"
Kali工具进行区域传输和枚举
host -t ns google.com
host -l google.com ns4.google.com
dnsrecon -d bytefellow.com -t axfr
brute force domain name
枚举使用Nmap
端口扫描和服务枚举
#扫描所有端口
nmap -vvv -Pn -p- -oN allports $ target
#扫描快速UDP端口
nmap -sU -v -oN udpPorts $ targets
自动枚举脚本
下载:https://github.com/21y4d/nmapAutomator
./nmapAutomator.sh $ target_ip全部
其他枚举命令
binwalk <image> strings -n 8 <image/file> steghide info <image> strace <file> ltrace <file> file <file> ls -la <file>
渗透测试专用服务
端口21(FTP)打开
使用Nmap扫描FTP
nmap -vvv -sC -p21 $ target
登录并上传后门
$ ftp $target
ftp> USER anonymous
ftp> PASS anon@bytefellow.com
ftp> binary
ftp> upload path/file_name.ext
端口22(SSH)打开
Banner Grab
ssh root@target
快速爆破
hydra -l root -P wordlist ssh://target_ip
端口25(SMTP)打开
枚举使用netcat。用于用户名枚举。对于暴力破解很有用
nc $target 25
VRFY username
端口53(DNS)打开
用nslookup,dig和gobuster枚举:
$ nslookup
>server $target_ip
.
.
>$target_ip
13.10.10.10.in-addr.arpa name = ns1.cronos.htb.
$ dig axfr cronos.htb @10.10.10.13
$ gobuster dns -d cronos.htb -w /usr/share/seclists/Discovery/DNS/bitquark-subdomains-top100000.txt
其他可尝试的工具
host -l target name_server #Zone Transfer
dnsrecon -d target.com -t axfr #Zone Transfer
dnsrecon -d target.com -D ~/words.txt -t brt #brute force domain.
dnsenum target #Zone transfer
79号端口打开
枚举用户名
nmap -vvv -Pn -sC -sV -p79 $ target
端口80/443(HTTP / HTTPS)打开
检查什么?
- 手动浏览公用文件。
- 识别技术。使用已识别的信息搜索漏洞。
- 从SSL收集信息。
- 检查它是否具有与代理相关的任何漏洞。
- 目录,敏感文件强行搜索所有发现的目录。
- 可能需要找出隐藏的参数。
- 查找所有输入点。
- 使用dnsrecon或dnsenum查找子域
查看源,并手动浏览
http://ip/robots.txt
http://ip/sitemap.xml
http://ip/not_exist
通过whatWeb识别
whatweb -a 3 $ target
用Nikto扫描
nikto -h $ target
CMS
wpscan --url http://$target -e p,t,u --detection-mode aggressive > wpscan.log #For wordpress
wpscan -e vp --plugins-detection aggressive --api-token API_KEY --url http://172.31.1.8 #plugins
droopescan scan drupal http://$target -t 32 #drupal
joomscan --ec -u $target #joomla