kali学习-被动信息收集-DNS相关
1. 被动信息收集简介
2. DNS 查询
3.被动信息收集-nslookup
4.被动信息收集-dig
5.DNS字典爆破
1. 被动信息收集简介
OSINT
美国军方:http://www.fas.org/irp/doddir/army/atp2-22-9.pdf
北大西洋公约组织:http://information-retrieval.info/docs/NATO-OSINT.html
信息搜集内容
- IP地址段
- 域名信息
- 邮件地址
- 文档内容数据
- 公司地址
- 公司组织架构
- 联系电话/传真号码
- 人员姓名/职务
- 目标系统使用的技术架构
- 公开的商业信息
信息用途
- 用信息描述目标
- 发现
- 社会工程学攻击
- 物理缺口
2. DNS 查询
域名记录
- A:主机地址(域名 -> IP)
- Cname:主机别名记录
- NS:域名服务器记录
- MX:邮件交换记录
- PTR:反向解析(IP -> 域名)
DNS查找:
- 浏览器缓存,浏览器会缓存DNS记录一段时间(2-30min)
- 系统缓存(gethostname)
- 路由器缓存
- 如果还是没有,那么就去检查ISP有没有吧
- 递归搜索
- ISP的DNS服务器会从根域名开始进行递归查询
递归查询:
主机向本地域名服务器的查询一般都是采用递归查询。
如果主机所询问的本地域名服务器不知道被查询的域名的IP地址,那么本地域名服务器就以DNS客户的身份,向其根域名服务器继续发出查询请求报文(即替主机继续查询),而不是让主机自己进行下一步查询。因此,递归查询返回的查询结果或者是所要查询的IP地址,或者是返回一个失败的响应,表示无法查询到所需的IP地址。
迭代查询:
本地域名服务器向根域名服务器的查询通常是采用迭代查询。
当根域名服务器收到本地域名服务器发出的迭代查询请求报文时,要么返回给本地域名服务器所要查询的IP地址,要么返回给本地域名服务器下一步应当查询的域名服务器的IP地址。
假设的主机想知道另一个主机(域名为 my.xxsilence.net)的IP地址。具体步骤如下:
① 主机先向其本地域名服务器进行递归查询,如果缓存中没有,继续下一步。
② 本地域名服务器采用迭代查询,先向一个根域名服务器查询。
③ 根域名服务器告诉本地域名服务器,下一次查询的顶级域名服务器 dns.net。
④ 本地域名服务器向顶级域名服务器 dns.net。
⑤ 顶级域名服务器 dns.net,下一次应查询的权限域名服务器dns.xxsilence.net的IP地址。
⑥ 本地域名服务器向权限域名服务器dns.xxsilence.net进行查询。
⑦ 权限域名服务器dns.xxsilence.net告诉本地域名服务器,所查询的主机的IP地址。
⑧ 本地域名服务器最后把查询结果告诉主机。
3.被动信息收集-nslookup
1. NSLOOKUP
- type=a、mx、ns、any
- 或者使用 q 。(q = type)
组合使用
nslookup -type=ns example.com 156.154.70.22
主机解析 Cname(别名记录)
只查询 A 记录
> set type=a > www.sina.com
只查询 mx 记录
> set type=mx > sina.com
-
# 查邮件交换服务器的IP地址 > set type=a > freemx1.sinamail.sina.com.cn > freemx2.sinamail.sina.com.cn > freemx3.sinamail.sina.com.cn.
查询域名服务器名称
> set type=ns > sina.com
-
# 查询域名服务器的IP地址 > set type=a > ns1.sina.com. > ns4.sina.com. > ns3.sina.com.cn. > ns4.sina.com.cn. > ns1.sina.com.cn.
查询 PTR 记录
> set type=ptr > 202.108.3.242
# 查询域名对应的多条 IP 记录set type=a
mail3-242.sinamail.sina.com.cn.
设置指定域名服务器
# 指定域名服务器之后,两次结果不同 > server 8.8.8.8 > www.sina.com
指定 type 为 any
> set type=any > sina.com
-
text = "v=spf1 include:spf.sinamail.sina.com.cn -all" # spf 记录:反垃圾邮件记录 # 在接收邮件的时候进行反向域名解析,查询比对这个记录,来确认是否是垃圾邮件
组合使用
# 默认使用 /etc/resolv.conf 文件的域名服务器 root@kali:~# cat /etc/resolv.conf domain localdomainsearch localdomainnameserver 10.10.10.2root@kali:~# nslookup -q=any 163.comServer: 10.10.10.2Address: 10.10.10.2#53# 指定域名服务器 root@kali:~# nslookup -q=any 163.com 114.114.114.114
4.被动信息收集-dig
1. DIG
2. 区域传送
3. 帮助文件
1. DIG
- dig @8.8.8.8 www.sina.com mx
- dig www.sina.com any
- 反向查询:dig +noall +answer -x 8.8.8.8
- bind版本信息: dig +noall +answer txt chaos VERSION.BIND @ns3.dnsv4.com
- DNS追踪: dig +trace example.com
- 抓包比较递归查询、迭代查询过程的区别
默认使用 /etc/resplv.conf 指定的域名服务器
root@kali:~# nslookup sina.com -type=any 8.8.8.8Server: 8.8.8.8Address: 8.8.8.8#53Non-authoritative answer:Name: sina.comAddress: 66.102.251.33#默认使用 /etc/resplv.conf 指定的域名服务器 root@kali:~# dig sina.com any
-
# 指定域名服务器 root@kali:~# dig sina.com any @8.8.8.8
-
# 尝试指定不同的域名服务器 root@kali:~# dig sina.com any @202.106.2.20 root@kali:~# dig sina.com any @114.114.114.114 root@kali:~# dig sina.com any @8.8.8.8
迭代别名记录查询
# 修改默认域名服务器 root@kali:~# cat /etc/resolv.conf domain localdomainsearch localdomainnameserver 114.114.114.114root@kali:~# dig mail.163.com any
一些参数
- +noall:不显示信息
+answer:显示结果
root@kali:~# dig +noall +answer mail.163.com any mail.163.com. 131 IN CNAME mail163.ntes53.netease.com. root@kali:~# dig +noall +answer mail.163.com any | awk '{print $5}'
反向查询
root@kali:~# dig 163.com
-
# 反向查询 PTR记录 root@kali:~# dig -x 123.58.180.8
查询 bind 版本信息
# 使用 dig 默认只会查询当前 fqdn 名称,不会查询所有的记录 # dig 可以查询 bind 版本信息,根据 bind 漏洞,就可以全部获取 DNS 服务器权限 root@kali:~# dig sina.com any
-
# 查询结果为空(被隐藏) root@kali:~# dig +noall +answer txt chaos VERSION.BIND @ns2.sina.com. VERSION.BIND. 0 CH TXT " "
DNS 追踪
# 跟踪过程:直接迭代查询,不经过本地缓存域名0服务器(从根域开始)root@kali:~# dig +trace 163.com
-
抓包比较递归查询、迭代查询过程的区别
2. 区域传送
区域传送:在本域的各个域名服务器之间进行信息同步
区域传送
# dig @ns1.example.com example.com axfrroot@kali:~# dig sina.com any
-
root@kali:~# dig @ns2.sina.com sina.com axfr
-
# host -T -l sina.com 8.8.8.8root@kali:~# host -T -l sina.com ns2.sina.com.
3. 帮助文件
root@kali:~# dig -h
Usage: dig [@global-server] [domain] [q-type] [q-class] {q-opt}{global-d-opt} host [@local-server] {local-d-opt}[ host [@local-server] {local-d-opt} [...]]
Where: domain is in the Domain Name Systemq-class is one of (in,hs,ch,...) [default: in]q-type is one of (a,any,mx,ns,soa,hinfo,axfr,txt,...) [default:a](Use ixfr=version for type ixfr)q-opt is one of:-4 (use IPv4 query transport only)-6 (use IPv6 query transport only)-b address[#port] (bind to source address/port)-c class (specify query class)-f filename (batch mode)-i (use IP6.INT for IPv6 reverse lookups)-k keyfile (specify tsig key file)-m (enable memory usage debugging)-p port (specify port number)-q name (specify query name)-t type (specify query type)-u (display times in usec instead of msec)-x dot-notation (shortcut for reverse lookups)-y [hmac:]name:key (specify named base64 tsig key)d-opt is of the form +keyword[=value], where keyword is:+[no]aaflag (Set AA flag in query (+[no]aaflag))+[no]aaonly (Set AA flag in query (+[no]aaflag))+[no]additional (Control display of additional section)+[no]adflag (Set AD flag in query (default on))+[no]all (Set or clear all display flags)+[no]answer (Control display of answer section)+[no]authority (Control display of authority section)+[no]badcookie (Retry BADCOOKIE responses)+[no]besteffort (Try to parse even illegal messages)+bufsize=### (Set EDNS0 Max UDP packet size)+[no]cdflag (Set checking disabled flag in query)+[no]class (Control display of class in records)+[no]cmd (Control display of command line)+[no]comments (Control display of comment lines)+[no]cookie (Add a COOKIE option to the request)+[no]crypto (Control display of cryptographic fields in records)+[no]defname (Use search list (+[no]search))+[no]dnssec (Request DNSSEC records)+domain=### (Set default domainname)+[no]dscp[=###] (Set the DSCP value to ### [0..63])+[no]edns[=###] (Set EDNS version) [0]+ednsflags=### (Set EDNS flag bits)+[no]ednsnegotiation (Set EDNS version negotiation)+ednsopt=###[:value] (Send specified EDNS option)+noednsopt (Clear list of +ednsopt options)+[no]expire (Request time to expire)+[no]fail (Don't try next server on SERVFAIL)+[no]header-only (Send query without a question section)+[no]identify (ID responders in short answers)+[no]idnout (convert IDN response)+[no]ignore (Don't revert to TCP for TC responses.)+[no]keepopen (Keep the TCP socket open between queries)+[no]mapped (Allow mapped IPv4 over IPv6)+[no]multiline (Print records in an expanded format)+ndots=### (Set search NDOTS value)+[no]nsid (Request Name Server ID)+[no]nssearch (Search all authoritative nameservers)+[no]onesoa (AXFR prints only one soa record)+[no]opcode=### (Set the opcode of the request)+[no]qr (Print question before sending)+[no]question (Control display of question section)+[no]rdflag (Recursive mode (+[no]recurse))+[no]recurse (Recursive mode (+[no]rdflag))+retry=### (Set number of UDP retries) [2]+[no]rrcomments (Control display of per-record comments)+[no]search (Set whether to use searchlist)+[no]short (Display nothing except shortform of answer)+[no]showsearch (Search with intermediate results)+[no]sigchase (Chase DNSSEC signatures)+[no]split=## (Split hex/base64 fields into chunks)+[no]stats (Control display of statistics)+subnet=addr (Set edns-client-subnet option)+[no]tcp (TCP mode (+[no]vc))+timeout=### (Set query timeout) [5]+[no]topdown (Do +sigchase in top-down mode)+[no]trace (Trace delegation down from root [+dnssec])+trusted-key=#### (Trusted Key to use with +sigchase)+tries=### (Set number of UDP attempts) [3]+[no]ttlid (Control display of ttls in records)+[no]ttlunits (Display TTLs in human-readable units)+[no]unknownformat (Print RDATA in RFC 3597 "unknown" format)+[no]vc (TCP mode (+[no]tcp))+[no]zflag (Set Z flag in query)global d-opts and servers (before host name) affect all queries.local d-opts and servers (after host name) affect only that lookup.-h (print help and exit)-v (print version and exit)root@kali:~# host -h
host: illegal option -- h
Usage: host [-aCdilrTvVw] [-c class] [-N ndots] [-t type] [-W time][-R number] [-m flag] hostname [server]-a is equivalent to -v -t ANY-c specifies query class for non-IN data-C compares SOA records on authoritative nameservers-d is equivalent to -v-i IP6.INT reverse lookups-l lists all hosts in a domain, using AXFR-m set memory debugging flag (trace|record|usage)-N changes the number of dots allowed before root lookup is done-r disables recursive processing-R specifies number of retries for UDP packets-s a SERVFAIL response should stop query-t specifies the query type-T enables TCP/IP mode-v enables verbose output-V print version number and exit-w specifies to wait forever for a reply-W specifies how long to wait for a reply-4 use IPv4 query transport only-6 use IPv6 query transport only
5.DNS字典爆破
1. DNS 字典爆破1-1. 简介1-2. fierce1-3. dnsenum1-4. dnsmap1-5. dnsrecon
2. DNS 注册信息
1. DNS 字典爆破
1. 简介
- fierce -dnsserver 8.8.8.8 -dns sina.com.cn -wordlist a.txt
- dnsenum -f dnsbig.txt -dnsserver 8.8.8.8 sina.com -o sina.xml
- dnsmap sina.com -w dns.txt
- dnsrecon -d sina.com --lifetime 10 -t brt -D dnsbig.txt
- dnsrecon -t std -d sina.com
2. fierce ##
root@kali:~# dpkg -L fierce/usr/share/fierce/hosts.txtroot@kali:~# cp /usr/share/fierce/hosts.txt wordlist.txt -f
root@kali:~# fierce -dnsserver 8.8.8.8 -dns sina.com.cn -wordlist wordlist.txt
3. dnsenum
root@kali:~# dpkg -L dnsenum/usr/share/dnsenum/dns.txtroot@kali:~# cp /usr/share/dnsenum/dns.txt dnsenum.txt
root@kali:~# dnsenum -f dnsenum.txt -dnsserver 8.8.8.8 sina.com -o sina.xml
4. dnsmap
root@kali:~# dpkg -L dnsmap
/usr/share/dnsmap/wordlist_TLAs.txtroot@kali:~# cp /usr/share/dnsmap/wordlist_TLAs.txt dnsmap.txt
root@kali:~# dnsmap sina.com -w dnsmap.txt
5. dnsrecon
root@kali:~# dpkg -L dnsrecon
/usr/share/dnsrecon/namelist.txt
root@kali:~# dnsrecon -d sina.com --lifetime 10 -t brt -D /usr/share/dnsrecon/namelist.txt
root@kali:~# dnsrecon -t std -d sina.com
2. DNS 注册信息
- 在网页查询
https://www.afrinic.net/
http://www.apnic.net/
https://www.arin.net
https://www.iana.com
使用
root@kali:~# whois sina.com
-
root@kali:~# whois wooyun.org
-
root@kali:~# whois -h whois.apnic.net 192.0.43.10
转载于:https://www.cnblogs.com/cx-ajun/p/9332309.html
kali学习-被动信息收集-DNS相关相关推荐
- Kali linux 学习笔记(七)被动信息收集——DNS(nslookup、dig、区域传输、字典爆破、注册信息) 2020.2.17
前言 被动信息收集定义可认为如下: 公开渠道可获得的信息 与目标系统不产生直接交互 尽量避免留下一切痕迹 有两个最早的官方文件如下: 美国军方:http://www.fas.org/irp/doddi ...
- kali实战-被动信息收集
在***测试的初级阶段,我们首先要对目标系统进行信息收集,最初的信息收集所做的都是被动信息的收集,本课程逐一讲解被动信息收集的工具使用,除了讲解Kali工具之外,本课程的将成为***测试中真真正正的被 ...
- 被动信息收集-DNS篇
一.DNS记录类型 A: Ipv4 主机记录AAAA IPv6 主机记录CNAME 别名NS NameServer 域名服务器MX 邮件交换服务器 二.DNS记录类型信息收集 #工具NSLOOKUPD ...
- kali linux 渗透测试学习笔记——被动信息收集
kali linux 渗透测试学习笔记--linux 被动信息收集 被动信息收集 被动信息收集 公开渠道可获得的信息 已公开的信息,通过互联网等渠道去获得 与目标系统不产生直接交互 不对目标访问,扫描 ...
- Kali Linux渗透测试之被动信息收集(一)——nslookup、dig、DNS区域传输,DNS字典爆破,DNS注册信息
一.被动信息收集 1.被动信息搜集 公开渠道可获得信息: 与目标系统不产生直接交互: 尽量避免留下痕迹: 2.搜集的内容 IP地址段,域名信息,邮件地址,文档图片数据,公司地址,公司组织架构.联系电话 ...
- Kali Linux渗透测试之被动信息收集(一)——nslookup、dig、DNS区域传输、DNS字典爆破、DNS注册信息
1. 被动信息搜集 (1)被动信息搜集 公开渠道可获得的信息: 与目标系统不产生直接交互: 尽量避免留下痕迹: (2)搜集的内容 IP地址段.域名信息.邮件地址.文档图片数据.公司地址.公司组织架构. ...
- kali linux之被动信息收集(dns信息收集,区域传输,字典爆破)
公开可获取的信息,不与目标系统产生交互,避免留下痕迹 下图来自美军方 pdf链接:http://www.fas.org/irp/doddir/army/atp2-22-9.pdf 信息收集内容(可利用 ...
- 渗透测试技术----被动信息收集(一)--nslookup、dig、DNS字典爆破、whois
一.渗透测试流程 1.信息收集(包括被动搜集和主动搜集) 2.漏洞扫描 3.漏洞利用 4.提权 5.植入后门,清理痕迹 6.生成渗透测试报告 很多人在信息收集阶段大概会占用30%到50%的时间,由此可 ...
- Kali渗透测试之被动信息收集
一.渗透测试的流程 信息收集(很重要,时间占比30% ~ 50%) 漏洞扫描 漏洞利用 提权 清除痕迹,留后门 写渗透测试报告 其中信息收集很重要,它通常占整个渗透测试过程所需时间的30% ~ 50% ...
最新文章
- 适合做公安网的php,gonganbeian.php
- android蓝牙固件升级_AirPods Pro 如何升级固件开启「空间音频」?为何「空间音频」未生效?如何体验「空间音频」?...
- sequelize模型关联_关于Sequelize连接查询时inlude中model和association的区别详解
- 第一弹!安利10个让你爽到爆的IDEA必备插件!
- 中班音乐 机器人教案_【李小娜老师优秀教案分享】中班音乐活动小树叶教案及反思...
- android动态设置全屏,Android开发之全屏与非全屏的切换设置方法小结
- 全国大学校园网—拓扑图欣赏
- [C++]Linux之C编程异常[true未定义解决方案]
- UVa1225 - Digit Counting
- 李嘉诚培养23岁孙女接班 每年安保费就要花10亿!
- Android开发学习之路-带文字的图片分享
- OA项目之我的审批(查询会议签字)
- win7电脑如何安装柯尼卡美能达C364e打印驱动
- 没基础的大学生如何自学c语言 ?
- 数字电路设计之低功耗设计方法六:旁路(by-passing)
- 【技能】Zoho CRM系统无代码集成智齿客服、企业微信群机器人方法
- T480s安装Ubuntu16
- 如何看待培训机构出来的非科班程序员
- 思科6509 引擎720-3BXL 更换风扇造成设备重启
- 一、性能测试的八大类