我怎么能开始制作我自己的简单的基于UNIX的网络扫描仪?

时间:2017-03-12 11:55:25

标签: linux networking scanning

我正在使用Linux进行安全性和渗透测试。我经常使用nmapwireshark,但我想制作一个自己的网络扫描仪来了解它们的工作原理。

我希望它扫描整个网络,而不是扫描一个目标的端口,但我不知道从哪里开始。

有人使用哪种编程/脚本语言来执行基于命令行的语言 网络扫描仪,我在哪里开始制作它?

1 个答案:

答案 0 :(得分:1)

试用python + scapy

  

Scapy是一个功能强大的交互式数据包操作程序。它是   能够伪造或解码大量协议的数据包,发送   他们在线上,捕获它们,匹配请求和回复等等   更多。

以下是一些样本感受http://networkinterfaze.com/scapy-examples/的功效(未检查,可能稍微过时):

从Ubuntu发送ping数据包到Windows 7

ip = IP() # Creates an IP header
ip.src = '192.168.1.25' # Source address in the IP header is configured with IP address of ubuntu.
ip.dst = '192.168.1.100' # Destination address in the IP header is configured with the IP address of Windows 7.
icmp = ICMP() # Creates an ICMP header
icmp.type = 8 # Type value inserted in ICMP header as 8 for ping crafting
icmp.code = 0 # Code value inserted in ICMP header as 0 for ping crafting.
send(ip/icmp) # Sending ping packet.

在Ubuntu上的Scapy上使用随机源地址

在Windows 7上创建TCP SYN到端口80
cp = TCP() # Creates a TCP header
tcp.dport = 80 # Configures the destination port in the TCP header with port 80.
tcp.flags = ’S’ # Configure the flag in the TCP header with the SYN bit.
ip = IP() # Creates an IP header
ip.src = '192.168.1.25' # Source address in the IP header is configured with IP address of ubuntu.
ip.dst = '192.168.1.100' # Destination address in the IP header is configured with the IP address of Windows 7.
send(ip/tcp) # Sending tcp packet.