whois 域名/ip 查看域名的详细信息。 ping 域名/ip 测试本机到远端主机是否联通。 dig 域名/ip 查看域名解析的详细信息。 host -l 域名 dns服务器 传输zone。

扫描

小白入门web渗透(Web渗透之BT渗透常用命令)(1)

nmap: -sS 半开扫描TCP和SYN扫描。 -sT 完全TCP连接扫描。 -sU UDP扫描 -PS syn包探测(防火墙探测) -PA ack包探测(防火墙探测) -PN 不ping。 -n 不dns解析。 -A -O和-sV。 -O 操作系统识别。 -sV 服务版本信息(banner) -p 端口扫描。 -T 设置时间级别(0-5) -iL 导入扫描结果。 -oG 输出扫描结果。

操作系统识别:

p0f -i eth0 -U -p 开启混杂模式。 xprobe2 ip|域名 检测os。

banner获取:

nc ip port 检测端口是否打开。 telnet ip port 检测端口是否打开。 wget ip 下载主页。 cat index.html | more 显示主页代码。 q 退出。

windows枚举

nmap -sS -p 139,445 ip 扫描windows。 cd /pentest/enumeration/smb-enum nbtscan -f targetIP 检测netbios。 smbgetserverinfo -i targetIP 扫描name,os,组。 smbdumpusers -i targetIP 列出用户。 smbclient -L //targetIP 列出共享。

使用windows:

net use \\ip\ipc$ "" /u:"" 开启空会话。 net view \\ip 显示共享信息。 smbclient: smbclient -L hostName -I targetIP 枚举共享。 smbclient -L hostName/share -U "" 用空用户连接。 smbclient -L hostName -I targetIP -U admin普通用户连接。

rpcclient:

rpcclient targetIP -U “”打开一个空会话。 netshareenum 枚举共享。 enumdomusers 枚举用户。 lsaenumsid 枚举域SID。 queryuser RID 查询用户信息。 createdomuser 创建用户访问。

ARP欺骗:

nano /usr/local/share/ettercap/etter.dns编辑配置文件 Plugins > Manage the plugins > dns_spoof 设置dns欺骗 Mitm > Arp poisoning > Sniff remote connections > OK 设置ARP Start > Start sniffing 开始攻击

小白入门web渗透(Web渗透之BT渗透常用命令)(2)

dns欺骗:

cd /pentest/exploits/exploit-db 进入目录 cat sploitlist.txt | grep -i [exploit] 查询需要的漏洞 cat exploit | grep "#include"检查运行环境 cat sploitlist.txt | grep -i exploit | cut -d " " -f1 | xargs grep sys | cut -d ":" -f1 | sort -u只保留可以在linux下运行的代码

Exploits漏洞利用:

cd /pentest/exploits/exploit-db 进入目录 cat sploitlist.txt | grep -i [exploit] 查询需要的漏洞 cat exploit | grep "#include"检查运行环境 cat sploitlist.txt | grep -i exploit | cut -d " " -f1 | xargs grep sys | cut -d ":" -f1 | sort -u只保留可以在linux下运行的代码

Metasploit:

svn update 升级 ./msfweb Web接口127.0.0.1:55555。. ./msfconsole 字符下的Console。 help 帮助 show <option> 显示选项 search <name> 搜索名字 use <exploit name> 使用漏洞 show options 显示选项 set <OPTION NAME> <option> 设置选项 show payloads 显示装置 set PAYLOAD <payload name> 设置装置 show options 显示选项 set <OPTION NAME> <option> 设置选项 show targets 显示目标(os版本) set TARGET <target number> 设置目标版本 exploit 开始漏洞攻击 sessions -l 列出会话 sessions -i <ID> 选择会话 sessions -k <ID> 结束会话 <ctrl> z 把会话放到后台 <ctrl> c 结束会话 jobs 列出漏洞运行工作 jobs -K 结束一个漏洞运行工作 show auxiliary 显示辅助模块 use <auxiliary name> 使用辅助模块 set <OPTION NAME> <option> 设置选项 run 运行模块 scanner/smb/version 扫描系统版本 scanner/mssql/mssql_ping 测试mssql是否在线 scanner/mssql/mssql_login 测试登录(暴力或字典) Attacker behind firewall: bind shell正向 Target behind firewall: reverse shell反向 Meterpreter衔接不懂dos的可以用这个: db_import_nessus_nbe 加载nessus的扫描结果 db_import_nmap_xml 加载nmap的扫描结果

自动化攻击流程:

cd /pentest/exploit/framework3 ./msfconsole load db_sqlite3 db_destroy pentest db_create pentest db_nmap targetIP db_hosts db_services db_autopwn -t -p -e

字符接口攻击流程:

./msfcli | grep -i <name> ./msfcli <exploit or auxiliary> S ./msfcli <exploit name> <OPTION NAME>=<option> PAYLOAD=<payload name> E

,