主动信息收集之主机发现

主动信息收集

  1. 二层发现

···arping

···arping 192.168.11.10

···arping 192.168.243.10 -c 只发送一个包

···nmap 192.168.243.0/24 -sn

···nmap 192.168.243.1-254 -sn

···nmap -iL a.txt -sn

-sn 参数为不做端口扫描

···netdiscover -i eth0 -r 192.168.243.0/24

···netdiscover -r 198.168.243.0/24

···netdiscover -l a.txt

···netdiscover -p

-p 为被动收集 ,不容易被发现

···scapy

Python的一个模块

若要进行arp扫描

···arp=ARP()                       //定义一个变量arp

···arp.pdst=”192.168.243.11”         //目标地址ip

···answer=sr1(arptimeout=0.5,verbose=0)                 //sr1为发送函数,并将结果保存在变量answer,超时为0.5,不显示详细信息)

  1. 三层发现

···ping 192.168.243.1 -c

-c参数为发几个包

速度比较 nmap > shell脚本 > python 脚本

···ping -R www.baudu.com==traceroute www.baudu.com

Ping如果ping的是主机所在的局域网,用的是arp协议,ping外网用的icmp协议

我认为ping外网时是先找到该网络的网关,然后该网关来进行arp,然后再返回

···nmap 192.168.243.1 -sn

···nmap -iL a.txt -sn

···fping

···fping 192.168.1.1 -c 1

···fping -g 10.2.1.1 10.2.1.100  -c 1

···fping -g 10.2.1.0/24 -c 1

···fping -f a.txt

···hpnig3 192.168.1.1 --icmp -c 2

···for addr in $(seq 1 254); do hping3 192.168.254.$addr --icmp -c 1

四层发现

···scapy

···TCP(直接发送ack,没有三次握手,导致对方会回复“R”,从而知道对方ip在线,如果对方ip不在线,那就收不到了)

ans=sr1(IP(dst=”192.168.243.1”)/TCP(dport=80,flags=”A”),timeout=1,verbose=0)

···UDP(不在线的或者在线且端口打开的情况下不会回复,在线且端口未打开的回复一个icmp的数据包,说端口不可达)

···ans=sr1(IP(dst=”192.168.204.1”)/UDP(dport=1526))

···nmap

···nmap 1.1.1.1-254 -PA1526 -sn

···nmap 1.1.1.1-254 -PU1526 -sn

注:PA1526之间没有空格

···hping3 --udp 1.1.1.1 -c 1UDP

···hping3 1.1.1.1 -c 1TCP

端口发现

···scapy

···nmap

···nmap 1.1.1.1 -sU -p 53

···nmap 1.1.1.1 -sU -p 1-100

···nmap -iL a.txt -sU -p 53

···nmap 1.1.1.1 -sU -p - (代表所有端口)

若执行时间过长,想在中途看一下进展如何,按回车

僵尸扫描

···nmap 1.1.11.1 -p 53 --script=ipidseq.nse (看是不是僵尸机)

···nmap 192.101.1.1 -sI 1.1.11.1 -Pn -p 1-100

服务扫描

···banner信息

··· nc -vn 1.1.1.1 22

···nc -vn 1.1.1.1 80        然后输入get /

···用socket模块获得

···dmitry -pb 1.1.1.1 p tcpscan)(b banner information

···nmap 1.1.1.1 -p1-1000 --script=banner.nse

···nmap -sT 1.1.1.1 -p1-1000 --script=banner.nse这两个没区别

···amap -B 1.1.1.1 22-8080

···nmap 特征方式来识别

···nmap 1.1.1.1 -p 1-100 -sV

···amap 1.1.1.1 20-30 -qb

系统扫描
···nmap -O 1.1.1.1

···xprobe2 1.1.1.1

···p0f

···onesixty 1.1.1.1 public

···nmap -sU -p 161 192.168.1.1

···snmpwalk 1.1.1.1 -c public -v 2c      (-v 后面还可以加 1 3

···snmpcheck -t 1.1.1.1

···snmpcheck -t 1.1.1.2 -c privete -v 2

···snmpcheck -t 1.1.1.1 -w

SMB扫描

···nmap -v 1.1.1.1 -p 139,445

···nmap 1.1.1.1 -p 139,445 --script=os-discovery.nse

···nmap -v -p 139 445 --script=smb-check-vuls --script-args=unsafe=1 1.1.1.1

···nbtscan -r 1.1.1.1/24

···enum4linux -a 1.1.1.1

SMTP扫描

···nc -vn 1.1.1.1 25  VRFY root

···nmap smtp.163.com -p 25  --script=smtp-enum-nsers.nse --script-args-smtp-enum-users.methods={VERY}

···nmap smtp.163.com -p 25 --script=smtp-open-relay.nse

Smtp-user-enum -M VERY - U a.txt -t 1.1.1.1

防火墙识别

···nmap -sA 1.1.1.1 -p 22

负载均衡检测

···lbd www.baidu.com

Waf识别

···

Nmap www.microsoft.com --script=http-waf-detect.nse

···wafw00f   

···wafw00f https://www.microsoft.com

猜你喜欢

转载自www.cnblogs.com/lihaipeng/p/10045752.html