nslookup命令
- 域名解析ip地址,nslookup 命令后输入(type可用q替代):
查询服务器A类地址(ip): set type=a
查询服务器C类地址(没有www): set type=ns
查询关联的邮箱服务器(没有www): set type=mx
查询所有(没有www,server 8.8.8.8后可查): set type=any
Server dns服务器ip,
set type=a,
待解析的域名
注意:any参数有时候查不出来,需要先使用server 参数设定DNS(域名解析服务器)
- Ip地址反查域名,nslookup命令后输入:
Set type=ptr
Ip地址
dig 命令
- 域名查询:
查询域名信息: dig sina.com
指定google服务器解析: dig sina.com @8.8.8.8
增加参数查询: dig sina.com any @8.8.8.8
查看ip(A类地址) dig sina.com a
查看邮箱服务器 dig sina.com mx
查看c类地址 dig sina.com ns
只查看关键信息: dig +noall +answer a sina.com
- Ip查询以及dns的bind版本:
通过IP查询服务器域名 dig –x ip
bind版本信息: dig +noall +answer txt chaos VERSION.BIND @ns3.dnsv4.com
查询服务器bind版本信息:
查出c类地址: dig sina.com ns
bind版本信息: dig +noall +answer txt chaos VERSION.BIND @类地址 version bind
- 区域传输——请求连接获取C类域名服务器中的主机记录:
方法一:
获取c类域名服务器: dig qq.com ns
连接c类域名服务器: dig @ns1.qq.com axfr
(注意:只有粗心大意的C类服务器可连接)
方法二:
获取c类域名服务器: dig qq.com ns
连接c类域名服务器: host –T –l qq.com ns3.qq.com
- 域名追踪;
dig +trace weixin.qq.com
思路:先去查根域 (.域),然后去查13个辅根域找到是com域,在通过com域找到其中的qq.com域名,在再qq.com域名中找到weixin.qq.com域名,通过weixin.qq.com域名找到它的C类地址(ns),C类地址再通过本地域名服务器解析成A类地址,即微信服务器ip地址。
如图所示:
以下是抓包工具说明:
字典爆破主机记录
Fierce命令爆破:
- 准备字典文件:
*查看fierce软件相关目录,包管理命令:dpkg –L fierce
*找到hosts.txt文件作为字典(也可以自己准备字典txt格式)
2. 开始通过字典爆破:
命令:fierce -dnsserver 8.8.8.8 -dns sina.com.cn -wordlist /usr/share/fierce/hosts.txt
dnsdict6命令爆破:
命令: dnsdict6 -d4 -t 16 -x sina.com
安装dnsdict6:
- 追加更新源:vim /etc/apt/sources.list
deb http://mirrors.ustc.edu.cn/kali kali-rolling main non-free-contrib
deb-src http://mirrors.ustc.edu.cn/kali kali-rolling main non-free-contrib
- 下载安装包放虚拟机:
- 更新源文件,安装前置环境:
#apt-get update 更新本地软件包列表库
#apt-get install libpcap-dev libssl-dev libnetfilter-queue-dev 下载安装环境
- 压缩包解压:
#cp /Desktop/ thc-ipv6-2.7 /tmp【从桌面复制到tmp目录】
#cd /tmp
#tar zxvf thc-ipv6-2.7.tar.gz【解压】
- 进入压缩后生成安装文件:
执行编译安装命令:
#make
#install -m0755 -d /usr/local/man/man8**
或
#make
#install -m0644 -D thc-ipv6.8 /usr/local/man/man8
#make && make install**
dnsenum命令爆破:
*查找字典命令:find / -name dnsenus 或 dpkg –L dnsenum
爆破命令:dnsenum -f /usr/share/dnsenum.txt -dnsserver 8.8.8.8 sina.com -o sina.xml
找到sina.xml文件: find / -name sina.xml
dnsrecon命令爆破:
查字典:dpkg –L dnsrecon
爆破命令:dnsrecon -d sina.com --lifetime 10 -t brt -D /usr/share/dnsrecon/namelist.txt
爆破命令:dnsrecon -t std -d sina.com
DNS注册信息查询
- 查询网站:
Afrinic http://www.afrinic.net
Apnic http://www.apnic.net
Arin http://ws.arin.net
Iana http://www.iana.com
Icann http://www.icann.org
Lacnic http://www.lacnic.net
Ripe http://www.ripe.net
Internic http://www.internic.net
- Whois命令查询:
执行命令:whois sina.com
执行命令:whois ip地址
Shodan搜索:• https://www.shodan.io/
账号:maojungang 密码:maomao123
常见过滤搜索参数:net:211.144.145.0/24 country:CN city:Beijing
Port:81 HTTP:1.1 200 os:linux hostname:baidu.com
User:admin pass:password linux upnp avtech 200 ok cisco
注意:shodan可接入API,直接做开发:https://developer.shodan.io/api
火狐浏览器记得搜索添加shodan插件
- Google搜索:
+支付 –充值 –宝 “+”号表示需要,”-“表示不需要
搜索:intitle:电⼦商务 intext:法⼈ intext:电话
参数:itle:标题 intext:内容 inurl:contact SOX filetype:pdf payment site:fr
例如:
• inurl:"level/15/exec/-/show"
• intitle:"netbotz appliance" "ok"
• inurl /admin/login.php
• inurl:qq.txt
• filetype:xls "username | password“
• inurl:ftp "password" filetype:xls site:baidu.com
• Service.pwd
•http://exploit-db.com/google-dorks (找google常用搜索指令)
Yandex (俄罗斯搜索引擎)
网址:https://yandex.com/ (全球第四大搜索引擎)
Recon-ng搜索
- 使用命令查看帮助:recon-ng –h
- 添加api命令:Keys add hashes_api akshdkahsdhkhasdkjfhkshfdkasdf
- 全局选项
• USER-AGENT
• Proxy
• Workspace
• Snapshot
• Show schema
• Help
• Query 数据库
• Select * from hosts where host like ‘%baidu.com%’ order by ip_address
⽤户信息
- theHarverster邮箱挖掘
安装命令:sudo apt-get install theharvester
• theharvester -d sina.com -l 300 -b google
metagoofil -d microsoft.com -t pdf -l 200 -o test -f 1.html