700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > kali linux 渗透技术学习笔记 2.信息收集——测试网络范围

kali linux 渗透技术学习笔记 2.信息收集——测试网络范围

时间:2022-03-16 03:46:12

相关推荐

kali linux 渗透技术学习笔记 2.信息收集——测试网络范围

测试网络范围

通过测试网络范围内地IP地址或域名,可以确定是否有人入侵自己的网络并损害系统。kali提供了DMitry和Scapy工具,DMitry工具用来查询目标网络中的IP地址或域名信息Scapy用来扫描网络及修谈数据包。

域名查询工具

DMitry

DMitry是一个用来查询IP或域名WHOIS信息的。WHOIS是用来查询域名是否已经被注册以及注册域名的详细信息的数据库。使用此工具可以查询到域名的注册商和过期时间等。

官方用途说明:

DMitry(Deepmagic信息收集工具)是用C编码的UNIX /(GNU)Linux命令行应用程序.DMitry能够收集尽可能多的关于主机的信息。基本功能可以收集可能的子域,电子邮件地址,正常运行时间信息,tcp端口扫描,whois查找等。

以下是当前功能的列表:

一个开源项目。执行Internet编号whois查找。检索可能的正常运行时间数据,系统和服务器数据。在目标主机上执行子域搜索。在目标主机上执行电子邮件地址搜索。在主机目标上执行TCP端口扫描。模块化程序,允许用户指定的模块

来源:/information-gathering/dmitry

实例:dmitry -wnpb ; dmitry -wnpb 这里我做了两个个实验

fxy@kali ~[19:25:25] > $ dmitry -wnpbDeepmagic Information Gathering Tool"There be some deep magic going on"HostIP:220.181.57.216 //主机IPHostName: //主机名Gathered Inic-whois information for ---------------------------------Domain Name: //域名Registry Domain ID: 11181110_DOMAIN_COM-VRSN//注册域名IDRegistrar WHOIS Server://注册商WHOIS服务器Registrar URL://注册商网址Updated Date: -01-25T04:08:55Z//更新时间Creation Date: 1999-10-11T11:05:17Z//注册时间Registry Expiry Date: 2026-10-11T11:05:17Z //到期时间Registrar: MarkMonitor Inc. //注册商Registrar IANA ID: 292//注册商IANA(互联网号码分配局) IDRegistrar Abuse Contact Email: abusecomplaints@ //注册商e-mailRegistrar Abuse Contact Phone: +1.2083895740//注册商电话Domain Status: clientDeleteProhibited //域状态 禁止删除客户端/epp#clientDeleteProhibitedDomain Status: clientTransferProhibited /epp#clientTransferProhibitedDomain Status: clientUpdateProhibited /epp#clientUpdateProhibitedDomain Status: serverDeleteProhibited /epp#serverDeleteProhibitedDomain Status: serverTransferProhibited /epp#serverTransferProhibitedDomain Status: serverUpdateProhibited /epp#serverUpdateProhibitedName Server: //名称服务器Name Server: Name Server: Name Server: Name Server: DNSSEC: unsigned//域名系统安全扩展URL of the ICANN Whois Inaccuracy Complaint Form: /wicf/>>> Last update of whois database: -04-12T11:26:15Z <<<××× 这里是关于whois的更多提示内容,省略×××The Registry database contains ONLY .COM, .NET, .EDU domains andRegistrars.Gathered Netcraft information for ---------------------------------Retrieving information for Information gatheredGathered TCP Port information for 220.181.57.216---------------------------------PortState80/tcpopen //查到的部分端口信息Portscan Finished: Scanned 150 ports, 69 ports were in state closedAll scans completed, exiting

fxy@kali ~[19:31:08] > $ dmitry -wnpb Deepmagic Information Gathering Tool"There be some deep magic going on"HostIP:180.178.61.83HostName:Gathered Inic-whois information for ---------------------------------Domain Name: Registry Domain ID: 965877923_DOMAIN_NET-VRSNRegistrar WHOIS Server: Registrar URL: Updated Date: -05-02T01:50:14ZCreation Date: -05-09T10:08:08ZRegistry Expiry Date: -05-09T10:08:08ZRegistrar: , Inc.Registrar IANA ID: 471Registrar Abuse Contact Email:Registrar Abuse Contact Phone:Domain Status: clientDeleteProhibited /epp#clientDeleteProhibitedDomain Status: clientTransferProhibited /epp#clientTransferProhibitedName Server: Name Server: DNSSEC: unsignedURL of the ICANN Whois Inaccuracy Complaint Form: /wicf/>>> Last update of whois database: -04-12T11:31:17Z <<<---------------------------------Retrieving information for Information gatheredGathered TCP Port information for 180.178.61.83---------------------------------PortState21/tcpopen>> 220 Welcome22/tcpopen>> SSH-2.0-OpenSSH_4.380/tcpopenPortscan Finished: Scanned 150 ports, 141 ports were in state closedAll scans completed, exiting

官方提供完整选项:

dmitry:无效选项 - 'h' 用法:dmitry [-winsepfb] [-t 0-9] [-o%host .txt] host -o 将输出保存到%host.txt或由-o file指定的文件-i 对主机的IP地址-w 对主机的域名执行whois查找-n 检索主机上的信息-s 执行可能的子域搜索-e 执行搜索可能的电子邮件地址-p 在主机上执行TCP端口扫描* -f 在主机上执行TCP端口扫描,显示输出报告过滤端口* -b读入从扫描端口收到的横幅* -t 0-9设置扫描TCP端口时的TTL(默认值为2)*需要-p标记为传递

虽然DMitry可以获得IP或域名信息,但是不能判断网络范围,所以可以将IP地址转换为子网掩码的格式、CIDR格式和思科反向子网掩码的格式等。kali中使用netmask可以进行转换。

实例:netmask -s 220.181.57.216 上文获取的

fxy@kali ~/文档/txt [20:03:32] > $ netmask -s 220.181.57.216 220.181.57.216/255.255.255.255

fxy@kali ~/文档/txt [19:57:53] > $ netmask -hThis is netmask, an address netmask generation utilityUsage: netmask spec [spec ...]-h, --helpPrint a summary of the options-v, --versionPrint the version number-d, --debugPrint status/progress information-s, --standardOutput address/netmask pairs-c, --cidrOutput CIDR format address lists-i, --ciscoOutput Cisco style address lists-r, --rangeOutput ip address ranges-x, --hexOutput address/netmask pairs in hex-o, --octalOutput address/netmask pairs in octal-b, --binaryOutput address/netmask pairs in binary-n, --nodnsDisable DNS lookups for addresses-f, --filesTreat arguments as input filesDefinitions:a spec can be any of:addressaddress:addressaddress:+addressaddress/maskan address can be any of:Ndecimal number0Noctal number0xNhex numberN.N.N.Ndotted quadhostnamedns domain namea mask is the number of bits set to one from the left

路由跟踪工具

Scapy

Scapy是一款强大的交互式数据包处理工具、数据包生成工具、网络扫描器、网络发现工具和包嗅探工具。他提供多种类别的生成数据包或数据包集合、对数据包进行操作、发送数据包、包嗅探、应答、反馈匹配等功能。

这里以使用Scapy实现多行并行跟踪路由功能为例:

必须用root权限打开才可以正常使用,如果出于安全性使用非root用户登录的话可以 sudo scapy或采取下面链接给出的意见:/questions/22421290/scapy-operation-not-permitted-when-sending-packets

(1)启用scapy

(2) 使用sr()函数实现发送和接收数据包。

(3) 使用表的形式查看数据包

(4) 查看TCP路由跟踪信息

可以单独查找,也可以查找一个列表,其中SA表示服务区。

(5) 使用res.graph()以图形显示路由跟踪结果

这里当使用scapy 2.4版本的时候可能报错所以只需使用语句:res.graph(ASres=AS_resolver_radb() ,type="svg") 或 res.graph(target="> /home/root/图片/graph.svg", ASres=AS_resolver_radb() ,type="svg")来代替res.graph()即可

res.trace3D()可以制作3d图片,不过需要vpython的支持

(6) exit()退出

博主还在学习kali的相关内容,如有错误,还请各位指出,谢谢支持。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。