This XML file does not appear to have any style information associated with it. The document tree is shown below. <cross-domain-policy> <allow-access-fromdomain="*.baidu.com"/> <allow-access-fromdomain="*.bdstatic.com"/> <allow-http-request-headers-fromdomain="*.baidu.com"headers="*"/> <allow-http-request-headers-fromdomain="*.bdstatic.com"headers="*"/> </cross-domain-policy>
┌──(root㉿Executor)-[/home/kali] └─# nslookup -type=mx stu.xidian.edu.cn main parsing stu.xidian.edu.cn .... Non-authoritative answer: printsection() stu.xidian.edu.cn mail exchanger = 30 mx-edu.icoremail.net.
....
查询NX记录
1
nslookup -type=nx <域名>
查询所有类型
1
nslookup -type=any <域名>
交互模式
1
nslookup
搜索引擎利用
基本搜索
逻辑与AND
逻辑或
逻辑非
如果搜索"调用约定"时
不想看到CSDN的结果
调用约定 -csdn
通配
使用通配符*
进阶用法
限定站点范围
1
site:<站点>
标题含有关键词
1
intitle "<keyword>"
标题含有多组关键词
1
allintitle <keyword1> <keyword2>
所有链接到某个URL地址的网页
1
link: <域名>
含有关键字的url地址
1
inurl: <keyword>
特定拓展名文件
1
filetype: <ex_name>
配合应用
在某网站下搜索含有某关键字标题的页面
主机信息收集
1.主机开放的端口和服务
2.主机操作系统
常见端口及对应服务
nmap
命令行运行:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
┌──(root㉿Executor)-[/home/kali] └─# nmap 192.168.43.44 Starting Nmap 7.92 ( https://nmap.org ) at 2022-06-04 10:01 CST Nmap scan report for Executor (192.168.43.44) Host is up (0.00058s latency). Not shown: 996 filtered tcp ports (no-response) PORT STATE SERVICE 80/tcp open http 135/tcp open msrpc 139/tcp open netbios-ssn 445/tcp open microsoft-ds
Nmap done: 1 IP address (1 host up) scanned in 5.04 seconds
┌──(root㉿Executor)-[/home/kali/mydir] └─# nmap -iL list.txt Starting Nmap 7.92 ( https://nmap.org ) at 2022-06-04 10:12 CST Nmap scan report for Executor (192.168.43.44) Host is up (0.00044s latency). Not shown: 996 filtered tcp ports (no-response) PORT STATE SERVICE 80/tcp open http 135/tcp open msrpc 139/tcp open netbios-ssn 445/tcp open microsoft-ds
Nmap scan report for 192.168.43.1 Host is up (0.014s latency). Not shown: 999 closed tcp ports (reset) PORT STATE SERVICE 53/tcp open domain
Nmap done: 3 IP addresses (2 hosts up) scanned in 7.13 seconds
┌──(root㉿Executor)-[/home/kali/mydir] └─# nmap -Pn -iL list.txt Starting Nmap 7.92 ( https://nmap.org ) at 2022-06-04 10:13 CST Nmap scan report for Executor (192.168.43.44) Host is up (0.00029s latency). Not shown: 996 filtered tcp ports (no-response) PORT STATE SERVICE 80/tcp open http 135/tcp open msrpc 139/tcp open netbios-ssn 445/tcp open microsoft-ds
Nmap scan report for 192.168.43.1 Host is up (0.0063s latency). Not shown: 999 closed tcp ports (reset) PORT STATE SERVICE 53/tcp open domain
Nmap scan report for 192.168.43.2 Host is up (0.060s latency). #这里"host is up"是-Pn选项的作用,让nmap认为它在线,但是没有找到任何打开的端口 All 1000 scanned ports on 192.168.43.2 are in ignored states. Not shown: 996 filtered tcp ports (no-response), 4 filtered tcp ports (host-unreach)
Nmap done: 3 IP addresses (3 hosts up) scanned in 14.64 seconds
-PS/PA/PU/PY使用各种协议方式进行扫描
如果不指定这四个之一,则默认使用TCP和ICMP两种方式分别进行主机发现
1 2 3 4 5 6 7 8
┌──(root㉿Executor)-[/home/kali/mydir] └─# nmap -sn -iL list.txt Starting Nmap 7.92 ( https://nmap.org ) at 2022-06-04 10:50 CST Nmap scan report for Executor (192.168.43.44) Host is up (0.00034s latency). Nmap scan report for 192.168.43.1 Host is up (0.0054s latency). Nmap done: 3 IP addresses (2 hosts up) scanned in 2.55 seconds
-PS使用TCP
SYN方式进行主机发现
1 2 3 4 5 6 7 8
┌──(root㉿Executor)-[/home/kali/mydir] └─# nmap -PS -sn -iL list.txt Starting Nmap 7.92 ( https://nmap.org ) at 2022-06-04 10:16 CST Nmap scan report for Executor (192.168.43.44) Host is up (0.00051s latency). Nmap scan report for 192.168.43.1 Host is up (0.0080s latency). Nmap done: 3 IP addresses (2 hosts up) scanned in 1.51 seconds
又比如,AB正常建立连接了,正在通讯时,A向B发送了FIN包要求关连接,B发送ACK后,网断了,A通过若干原因放弃了这个连接(例如进程重启)。网通了后,B又开始发数据包,A收到后表示压力很大,不知道这野连接哪来的,就发了个RST包强制把连接关了,B收到后会出现connect
reset
by peer错误。
┌──(root㉿Executor)-[/home/kali/mydir] └─# nmap -PY -sn -iL list.txt Starting Nmap 7.92 ( https://nmap.org ) at 2022-06-04 10:44 CST Nmap done: 3 IP addresses (0 hosts up) scanned in 2.17 seconds
真的太逊了,谁也没发现
全都是kali发往其他ip的SCTP数据报,但是没有收到任何回复
端口扫描
端口状态
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
┌──(root㉿Executor)-[/home/kali/mydir] └─# nmap -p 80 -iL list.txt Starting Nmap 7.92 ( https://nmap.org ) at 2022-06-04 11:04 CST Nmap scan report for Executor (192.168.43.44) Host is up (0.00031s latency).
PORT STATE SERVICE 80/tcp open http
Nmap scan report for 192.168.43.1 Host is up (0.0089s latency).
PORT STATE SERVICE 80/tcp closed http
Nmap done: 3 IP addresses (2 hosts up) scanned in 2.69 seconds
本机192.168.43.44上的80端口就是open状态
192.168.43.1上的80端口就是close状态
netstat -n查看本机端口状态
1 2 3 4 5 6 7 8 9 10 11 12 13
PS C:\Users\86135> netstat -n
活动连接
协议 本地地址 外部地址 状态 TCP 127.0.0.1:28825127.0.0.1:54530 ESTABLISHED TCP 127.0.0.1:28826127.0.0.1:28827 ESTABLISHED TCP 127.0.0.1:28827127.0.0.1:28826 ESTABLISHED TCP 127.0.0.1:54530127.0.0.1:28825 ESTABLISHED TCP 192.168.43.44:2894440.90.189.152:443 ESTABLISHED TCP 192.168.43.44:29072103.212.12.46:3000 ESTABLISHED TCP 192.168.43.44:2991061.150.43.81:443 CLOSE_WAIT ....
┌──(root㉿Executor)-[/home/kali/mydir] └─# nmap -iL list.txt Starting Nmap 7.92 ( https://nmap.org ) at 2022-06-04 11:00 CST Nmap scan report for Executor (192.168.43.44) Host is up (0.00025s latency). Not shown: 994 closed tcp ports (reset) PORT STATE SERVICE 80/tcp open http 135/tcp open msrpc 139/tcp open netbios-ssn 445/tcp open microsoft-ds 902/tcp open iss-realsecure 912/tcp open apex-mesh
Nmap scan report for 192.168.43.1 Host is up (0.0098s latency). Not shown: 999 closed tcp ports (reset) PORT STATE SERVICE 53/tcp open domain
Nmap done: 3 IP addresses (2 hosts up) scanned in 2.94 seconds
kali nmap对大量端口展开了轰炸
-p <port>扫描指定端口
比如指定扫描list.txt中列出主机的80端口(http服务器端口)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
┌──(root㉿Executor)-[/home/kali/mydir] └─# nmap -p 80 -iL list.txt Starting Nmap 7.92 ( https://nmap.org ) at 2022-06-04 10:53 CST Nmap scan report for Executor (192.168.43.44) Host is up (0.00028s latency).
PORT STATE SERVICE 80/tcp open http
Nmap scan report for 192.168.43.1 Host is up (0.062s latency).
PORT STATE SERVICE 80/tcp closed http
Nmap done: 3 IP addresses (2 hosts up) scanned in 2.72 seconds
确实Executor上开着一个Apache服务器,但是192.168.43.1手机上没有
-F快速模式,只扫描nmap-services中列出的端口
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
┌──(root㉿Executor)-[/home/kali/mydir] └─# nmap -F -iL list.txt Starting Nmap 7.92 ( https://nmap.org ) at 2022-06-04 11:02 CST Nmap scan report for Executor (192.168.43.44) Host is up (0.00050s latency). Not shown: 96 closed tcp ports (reset) PORT STATE SERVICE 80/tcp open http 135/tcp open msrpc 139/tcp open netbios-ssn 445/tcp open microsoft-ds
Nmap scan report for 192.168.43.1 Host is up (0.010s latency). Not shown: 99 closed tcp ports (reset) PORT STATE SERVICE 53/tcp open domain
Nmap done: 3 IP addresses (2 hosts up) scanned in 2.72 seconds
相对于不使用命令行参数的默认扫描方式,该种方式没有扫描到
1 2
902/tcp open iss-realsecure 912/tcp open apex-mesh
操作系统检测
操作系统检测是基于端口扫描的
如果不指定扫描端口,却进行操作系统检测,是无效的
1 2 3 4
┌──(root㉿Executor)-[/home/kali/mydir] └─# nmap -O -A -sn -iL list.txt WARNING: OS Scan is unreliable without a port scan. You need to use a scan type along with it, such as -sS, -sT, -sF, etc instead of -sn QUITTING!
┌──(root㉿Executor)-[/home/kali/mydir] └─# nmap -O -A -iL list.txt Starting Nmap 7.92 ( https://nmap.org ) at 2022-06-04 11:07 CST Nmap scan report for Executor (192.168.43.44) Host is up (0.00038s latency). Not shown: 994 closed tcp ports (reset) PORT STATE SERVICE VERSION 80/tcp open http Apache httpd 2.4.39 ((Win64) OpenSSL/1.1.1b mod_fcgid/2.3.9a mod_log_rotate/1.02) |_http-server-header: Apache/2.4.39 (Win64) OpenSSL/1.1.1b mod_fcgid/2.3.9a mod_log_rotate/1.02 |_http-title: Site doesn't have a title (text/html; charset=UTF-8). 135/tcp open msrpc Microsoft Windows RPC 139/tcp open netbios-ssn Microsoft Windows netbios-ssn 445/tcp open microsoft-ds? 902/tcp open ssl/vmware-auth VMware Authentication Daemon 1.10 (Uses VNC, SOAP) 912/tcp open vmware-auth VMware Authentication Daemon 1.0 (Uses VNC, SOAP) No exact OS matches for host (If you know what OS is running on it, see https://nmap.org/submit/ ). TCP/IP fingerprint: OS:SCAN(V=7.92%E=4%D=6/4%OT=80%CT=1%CU=37312%PV=Y%DS=2%DC=T%G=Y%TM=629ACC98 OS:%P=x86_64-pc-linux-gnu)SEQ(SP=101%GCD=1%ISR=10D%TI=I%CI=I%II=I%SS=S%TS=A OS:)OPS(O1=MFFD7NW8ST11%O2=MFFD7NW8ST11%O3=MFFD7NW8NNT11%O4=MFFD7NW8ST11%O5 OS:=MFFD7NW8ST11%O6=MFFD7ST11)WIN(W1=FFFF%W2=FFFF%W3=FFFF%W4=FFFF%W5=FFFF%W OS:6=FFDC)ECN(R=Y%DF=Y%T=7F%W=FFFF%O=MFFD7NW8NNS%CC=N%Q=)T1(R=Y%DF=Y%T=7F%S OS:=O%A=S+%F=AS%RD=0%Q=)T2(R=Y%DF=Y%T=7F%W=0%S=Z%A=S%F=AR%O=%RD=0%Q=)T3(R=Y OS:%DF=Y%T=7F%W=0%S=Z%A=O%F=AR%O=%RD=0%Q=)T4(R=Y%DF=Y%T=7F%W=0%S=A%A=O%F=R% OS:O=%RD=0%Q=)T5(R=Y%DF=Y%T=7F%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=7 OS:F%W=0%S=A%A=O%F=R%O=%RD=0%Q=)T7(R=Y%DF=Y%T=7F%W=0%S=Z%A=S+%F=AR%O=%RD=0% OS:Q=)U1(R=Y%DF=N%T=7F%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=37DE%RUD=G)IE OS:(R=Y%DFI=N%T=7F%CD=Z)
Network Distance: 2 hops Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows
TRACEROUTE (using port 587/tcp) HOP RTT ADDRESS 10.41 ms Executor.mshome.net (172.28.16.1) 20.43 ms Executor (192.168.43.44)
Nmap scan report for 192.168.43.1 Host is up (0.0065s latency). Not shown: 999 closed tcp ports (reset) PORT STATE SERVICE VERSION 53/tcp open domain dnsmasq 2.51 | dns-nsid: |_ bind.version: dnsmasq-2.51 No exact OS matches for host (If you know what OS is running on it, see https://nmap.org/submit/ ). TCP/IP fingerprint: OS:SCAN(V=7.92%E=4%D=6/4%OT=53%CT=1%CU=35611%PV=Y%DS=2%DC=T%G=Y%TM=629ACC98 OS:%P=x86_64-pc-linux-gnu)SEQ(SP=103%GCD=1%ISR=10C%TI=Z%CI=Z%II=I%TS=A)OPS( OS:O1=M5B4ST11NW9%O2=M5B4ST11NW9%O3=M5B4NNT11NW9%O4=M5B4ST11NW9%O5=M5B4ST11 OS:NW9%O6=M5B4ST11)WIN(W1=FFFF%W2=FFFF%W3=FFFF%W4=FFFF%W5=FFFF%W6=FFFF)ECN( OS:R=Y%DF=Y%T=40%W=FFFF%O=M5B4NNSNW9%CC=Y%Q=)T1(R=Y%DF=Y%T=40%S=O%A=S+%F=AS OS:%RD=0%Q=)T2(R=N)T3(R=N)T4(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=%RD=0%Q=)T5(R= OS:Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F= OS:R%O=%RD=0%Q=)T7(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)U1(R=Y%DF=N%T OS:=40%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=3EAE%RUD=G)IE(R=Y%DFI=N%T=40% OS:CD=S)
Network Distance: 2 hops
TRACEROUTE (using port 587/tcp) HOP RTT ADDRESS - Hop 1 is the same as for 192.168.43.44 27.82 ms 192.168.43.1
OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 3 IP addresses (2 hosts up) scanned in 30.29 seconds
这里检测出了192.168.43.44的操作系统
1
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows
但是没有检测出192.168.43.1的操作系统
1
No exact OS matches for host (If you know what OS is running on it, see https://nmap.org/submit/ ).
┌──(root㉿Executor)-[/home/kali/mydir] └─# masscan -p1-65535 --rate=10000 192.168.43.44 Starting masscan 1.3.2 (http://bit.ly/14GZzcT) at 2022-06-04 03:22:19 GMT Initiating SYN Stealth Scan Scanning 1 hosts [65535 ports/host] Discovered open port 135/tcp on 192.168.43.44 Discovered open port 49664/tcp on 192.168.43.44 Discovered open port 49672/tcp on 192.168.43.44 Discovered open port 49666/tcp on 192.168.43.44 Discovered open port 54260/tcp on 192.168.43.44 Discovered open port 9955/tcp on 192.168.43.44 Discovered open port 902/tcp on 192.168.43.44 Discovered open port 445/tcp on 192.168.43.44 Discovered open port 49667/tcp on 192.168.43.44 Discovered open port 5040/tcp on 192.168.43.44 Discovered open port 49665/tcp on 192.168.43.44 Discovered open port 912/tcp on 192.168.43.44 Discovered open port 49669/tcp on 192.168.43.44 Discovered open port 139/tcp on 192.168.43.44 rate: 0.00-kpps, 100.00% done, waiting 4-secs, found=14
┌──(root㉿Executor)-[/home/kali] └─# nmap -sP 192.168.3.0/24 Starting Nmap 7.92 ( https://nmap.org ) at 2022-06-04 16:22 CST Nmap scan report for 192.168.3.1 Host is up (0.0027s latency). Nmap scan report for host.docker.internal (192.168.3.2) Host is up (0.00026s latency). Nmap scan report for 192.168.3.7 Host is up (0.0060s latency). Nmap done: 256 IP addresses (3 hosts up) scanned in 5.14 seconds
┌──(root㉿Executor)-[/home/kali] └─# nmap -O -A 192.168.43.44 Starting Nmap 7.92 ( https://nmap.org ) at 2022-06-04 19:28 CST Nmap scan report for Executor (192.168.43.44) Host is up (0.00023s latency). Not shown: 994 closed tcp ports (reset) PORT STATE SERVICE VERSION 80/tcp open http Apache httpd 2.4.39 ((Win64) OpenSSL/1.1.1b mod_fcgid/2.3.9a mod_log_rotate/1.02) |_http-title: Site doesn't have a title (text/html; charset=UTF-8). |_http-server-header: Apache/2.4.39 (Win64) OpenSSL/1.1.1b mod_fcgid/2.3.9a mod_log_rotate/1.02 135/tcp open msrpc Microsoft Windows RPC 139/tcp open netbios-ssn Microsoft Windows netbios-ssn 445/tcp open microsoft-ds? 902/tcp open ssl/vmware-auth VMware Authentication Daemon 1.10 (Uses VNC, SOAP) 912/tcp open vmware-auth VMware Authentication Daemon 1.0 (Uses VNC, SOAP) No exact OS matches for host (If you know what OS is running on it, see https://nmap.org/submit/ ). TCP/IP fingerprint: ...
<Usage>: D:\web安全\twoScan\wwwscan.exe <HostName|Ip> [Options] <Options>: -p port : set http/https port -m thread : set max thread -t timeout : tcp timeout in seconds -r rootpath : set root path to scan -ssl : will use ssl <Example>: D:\web安全\twoScan\wwwscan.exe www.target.com -p8080-m10-t16 D:\web安全\twoScan\wwwscan.exe www.target.com -r"/test/"-p80 D:\web安全\twoScan\wwwscan.exe www.target.com -ssl
-p指定目标端口
-m指定线程数
-t指定超时
-r指定次级目录,不写则为根目录
首先使用nmap扫描端口,看看目标的web服务器是不是在80端口开放
1 2 3 4 5 6 7 8 9 10 11 12 13
PS C:\Users\86135> nmap www.sdtxsn.com Starting Nmap 7.92 ( https://nmap.org ) at 2022-06-0420:08 中国标准时间 Nmap scan report for www.sdtxsn.com (121.36.56.23) Host is up (0.046s latency). rDNS record for121.36.56.23: ecs-121-36-56-23.compute.hwclouds-dns.com Not shown: 966 filtered tcp ports (no-response), 28 closed tcp ports (reset) PORT STATE SERVICE 22/tcp open ssh 80/tcp open http 1024/tcp open kdm 3306/tcp open mysql 3690/tcp open svn 8888/tcp open sun-answerbook
┌──(kali㉿Executor)-[/mnt/d/phpstudy_pro/www/atomcms] └─$ ls -a -l total 36 drwxrwxrwx 1 kali kali 4096 Jun 4 21:18 . drwxrwxrwx 1 kali kali 4096 Apr 26 20:53 .. ... -rwxrwxrwx 1 kali kali 176 Oct 22 2015 index.php -rwxrwxrwx 1 kali kali 4096 Jun 4 21:18 .index.php.swo -rwxrwxrwx 1 kali kali 4096 Jun 4 21:18 .index.php.swp ...
______ / \ ( W00f! ) \ ____/ ,, __ 404 Hack Not Found |`-.__ / / __ __ /" _/ /_/ \ \ / / *===* / \ \_/ / 405 Not Allowed / )__// \ / /| / /---` 403 Forbidden \\/` \ | / _ \ `\ /_\\_ 502 Bad Gateway / / \ \ 500 Internal Error `_____``-` /_/ \_\ ~ WAFW00F : v2.1.0 ~ The Web Application Firewall Fingerprinting Toolkit [*] Checking http://www.sdtxsn.com/ [+] Generic Detection results: [-] No WAF detected by the generic detection [~] Number of requests: 7
wafw00f没有检测出waf
nmap
测试waf是否存在
1
nmap <目标域名> --script=http-waf-detect.nse
1 2 3 4 5 6 7 8 9 10 11
┌──(root㉿Executor)-[/home/kali] └─# nmap www.sdtxsn.com --script=http-waf-detect.nse -p 80 Starting Nmap 7.92 ( https://nmap.org ) at 2022-06-05 09:33 CST Nmap scan report for www.sdtxsn.com (121.36.56.23) Host is up (0.044s latency). rDNS record for 121.36.56.23: ecs-121-36-56-23.compute.hwclouds-dns.com
PORT STATE SERVICE 80/tcp open http
Nmap done: 1 IP address (1 host up) scanned in 2.29 seconds
这里就没有检测到waf存在
拿学校官网试一下
1 2 3 4 5 6 7 8 9 10 11 12
┌──(root㉿Executor)-[/home/kali] └─# nmap ehall.xidian.edu.cn --script=http-waf-detect.nse -p 80 Starting Nmap 7.92 ( https://nmap.org ) at 2022-06-05 09:34 CST Nmap scan report for ehall.xidian.edu.cn (61.150.43.100) Host is up (0.022s latency).
PORT STATE SERVICE 80/tcp open http | http-waf-detect: IDS/IPS/WAF detected: |_ehall.xidian.edu.cn:80/?p4yl04d3=<script>alert(document.cookie)</script>
Nmap done: 1 IP address (1 host up) scanned in 9.34 seconds
发现是有防火墙存在的,检测方法是在主页上构造xss攻击负载,结果被拦截
判断waf指纹
1
nmap <目标域名> --script=http-waf-fingerprint
1 2 3 4 5 6 7 8 9 10 11
┌──(root㉿Executor)-[/home/kali] └─# nmap ehall.xidian.edu.cn --script=http-waf-fingerprint -p 80,443 Starting Nmap 7.92 ( https://nmap.org ) at 2022-06-05 09:37 CST Nmap scan report for ehall.xidian.edu.cn (61.150.43.100) Host is up (0.027s latency).
PORT STATE SERVICE 80/tcp open http 443/tcp open https
Nmap done: 1 IP address (1 host up) scanned in 6.28 seconds