snmp-smtp=smb扫描

一、SNMP扫描

SNMP(简单网络管理协议)明文

  • 基于SNMP,进行网络设备监控,如:交换机、防火墙、服务器,CPU等其系统内部信息,基本都可以监控到。
  • 信息的金矿,经常被管理员配置错误
  • community:登录证书,默认值为public。容易被管理员遗忘修改其特征字符。两个默认的community strings,一个是public(可读),另一个是private(可写)
  • 服务器:161端口,客户端:162端口(UDP)

MIB Tree:

  • SNMP Management Information Base(MIB)
  • 树形的网络设备管理功能数据库

在目标主机上安装SNMP服务,并查看服务的状态、团队信息等。

控制面板——添加或删除程序,出现下图所示界面:

1、onesixtyone

  • 扫描硬件信息

 
 
  1. root@kali:~ # onesixtyone 192.168.247.129 public
  2. Scanning 1 hosts, 1 communities
  3. 192.168.247.129 [public] Hardware: x86 Family 6 Model 142 Stepping 9 AT/AT COMPATIBLE - Software: Windows Version 5.2 (Build 3790 Uniprocessor Free)
  • 如果没有扫除查询结果,有可能目标主机已经改变了它的默认community,我们可以结合字典对其进行扫描。

 
 
  1. root@kali:~ # dpkg -L onesixtyone
  2. /.
  3. /usr
  4. /usr/bin
  5. /usr/bin/onesixtyone
  6. /usr/share
  7. /usr/share/doc
  8. /usr/share/doc/onesixtyone
  9. /usr/share/doc/onesixtyone/README
  10. /usr/share/doc/onesixtyone/changelog.Debian.amd64.gz
  11. /usr/share/doc/onesixtyone/changelog.Debian.gz
  12. /usr/share/doc/onesixtyone/changelog.gz
  13. /usr/share/doc/onesixtyone/copyright
  14. /usr/share/doc/onesixtyone/dict.txt //默认字典
  15. /usr/share/man
  16. /usr/share/man/man1
  17. /usr/share/man/man1/onesixtyone.1.gz
  18. root@kali:~ # onesixtyone -c /usr/share/doc/onesixtyone/dict.txt 192.168.247.129 -o my.log -w 100
  19. Logging to file my.log
  20. Scanning 1 hosts, 49 communities
  21. [
  22. ] ,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~���������������������������������������

2、snmpwalk

  • 能查出更多的信息,-c 指定community, -v指定使用的SNMP版本,2c版本使用比较广泛,但可读性不是很好。

 
 
  1. root@kali:~ # snmpwalk 192.168.247.129 -c public -v 2c
  2. Created directory: /var/lib/snmp/mib_indexes
  3. iso.3.6.1.2.1.1.1.0 = STRING: "Hardware: x86 Family 6 Model 142 Stepping 9 AT/AT COMPATIBLE - Software: Windows Version 5.2 (Build 3790 Uniprocessor Free)"
  4. iso.3.6.1.2.1.1.2.0 = OID: iso.3.6.1.4.1.311.1.1.3.1.2
  5. iso.3.6.1.2.1.1.3.0 = Timeticks: (176845) 0:29:28.45
  6. iso.3.6.1.2.1.1.4.0 = ""
  7. iso.3.6.1.2.1.1.5.0 = STRING: "CHENGQIA-852040"
  8. iso.3.6.1.2.1.1.6.0 = ""
  9. iso.3.6.1.2.1.1.7.0 = INTEGER: 76
  10. iso.3.6.1.2.1.2.1.0 = INTEGER: 2
  11. iso.3.6.1.2.1.2.2.1.1.1 = INTEGER: 1
  12. iso.3.6.1.2.1.2.2.1.1.327683 = INTEGER: 327683
  13. iso.3.6.1.2.1.2.2.1.2.1 = Hex-STRING: 4D 53 20 54 43 50 20 4C 6F 6F 70 62 61 63 6B 20
  14. 69 6E 74 65 72 66 61 63 65 00
  15. ......
  16. iso.3.6.1.2.1.25.6.3.1.4.3 = INTEGER: 4
  17. iso.3.6.1.2.1.25.6.3.1.5.1 = Hex-STRING: 07 E2 0B 19 11 32 2A 00
  18. iso.3.6.1.2.1.25.6.3.1.5.2 = Hex-STRING: 07 E3 04 18 17 1A 16 00
  19. iso.3.6.1.2.1.25.6.3.1.5.3 = Hex-STRING: 07 E2 0B 19 11 34 2E 00
  • 指定IOD进行查询

 
 
  1. root@kali:~ # snmpwalk 192.168.247.129 -c public -v 2c iso.3.6.1.2.1.1.5
  2. iso.3.6.1.2.1.1.5.0 = STRING: "CHENGQIA-852040"

3、snmp-check

相比snmpwalk,增强了可读性

  • snmp-check 192.168.247.129
  • snmp-check 192.168.247.129 -w          //是否可写

 
 
  1. root@kali:~ # snmp-check 192.168.247.129
  2. snmp-check v1.9 - SNMP enumerator
  3. Copyright (c) 2005-2015 by Matteo Cantoni (www.nothink.org)
  4. [+] Try to connect to 192.168.247.129:161 using SNMPv1 and community 'public'
  5. [*] System information:
  6. Host IP address : 192.168.247.129
  7. Hostname : CHENGQIA-852040
  8. Description : Hardware: x86 Family 6 Model 142 Stepping 9 AT/AT COMPATIBLE - Software: Windows Version 5.2 (Build 3790 Uniprocessor Free)
  9. Contact : -
  10. Location : -
  11. Uptime snmp : 4 days, 16:23:42.81
  12. Uptime system : 03:39:26.46
  13. System date : 2019-5-4 14:40:46.9
  14. Domain : WORKGROUP
  15. [*] User accounts: //用户账户
  16. cqq
  17. Guest
  18. test$
  19. Administrator
  20. SUPPORT_388945a0
  21. IUSR_CHENGQIA-852040
  22. IWAM_CHENGQIA-852040
  23. [*] Network information:
  24. IP forwarding enabled : no
  25. Default TTL : 128
  26. TCP segments received : 149505
  27. TCP segments sent : 73696
  28. TCP segments retrans : 36
  29. Input datagrams : 151617
  30. Delivered datagrams : 151592
  31. Output datagrams : 76693
  32. [*] Network interfaces:
  33. Interface : [ up ] MS TCP Loopback interface
  34. Id : 1
  35. Mac Address : :::::
  36. Type : softwareLoopback
  37. Speed : 10 Mbps
  38. MTU : 1520
  39. In octets : 61841
  40. Out octets : 61841
  41. Interface : [ up ] Intel(R) PRO/1000 MT Network Connection
  42. Id : 327683
  43. Mac Address : 00:0c:29:8f:74:74
  44. Type : ethernet-csmacd
  45. Speed : 10 Mbps
  46. MTU : 1500
  47. In octets : 11941081
  48. Out octets : 6663859
  49. [*] Network IP:
  50. Id IP Address Netmask Broadcast
  51. 1 127.0.0.1 255.0.0.0 1
  52. 327683 192.168.247.129 255.255.255.0 1
  53. [*] Routing information: //路由信息
  54. Destination Next hop Mask Metric
  55. 0.0.0.0 192.168.247.2 0.0.0.0 30
  56. 127.0.0.0 127.0.0.1 255.0.0.0 1
  57. 192.168.247.0 192.168.247.129 255.255.255.0 30
  58. 192.168.247.129 127.0.0.1 255.255.255.255 30
  59. 192.168.247.255 192.168.247.129 255.255.255.255 30
  60. 224.0.0.0 192.168.247.129 240.0.0.0 30
  61. 255.255.255.255 192.168.247.129 255.255.255.255 1
  62. ......

 
 
  1. root@kali:~ # snmp-check 192.168.247.129 -w
  2. snmp-check v1.9 - SNMP enumerator
  3. Copyright (c) 2005-2015 by Matteo Cantoni (www.nothink.org)
  4. [+] Try to connect to 192.168.247.129:161 using SNMPv1 and community 'public'
  5. [+] Write access check enabled
  6. [!] 192.168.247.129:161 SNMP request timeout

二、SMB扫描

SMB协议(Server Message Block)

  • 微软历史上出现问题最多的协议;
  • 实现复杂,默认在Windows上是开放的,也是最常用的协议,用于实现文件的共享。

空会话未身份认证访问(SMB1)——Windows 2000/XP/Windows 2003

  • 不用建立连接也可以获取密码,用户名,组名,机器名,用户、组ID

1、nmap

  •  nmap -v -p139,445 192.168.247.129-131          //nmap扫描3个主机默认开放的139、445端口,但是不能准确判断操作系统的类型,一般情况下是Windows系统。
  • nmap 192.168.247.129 -p139,445 --script=smb-os-discovery.nse                                  //使用nmap自带的脚本进行操作系统的判断。
  • nmap -v -p139,445 --script=smb-vuln-*.nse --script-args=safe=1 192.168.247.129       //扫描Windows系统中的SMB协议是否有漏洞;smb-vuln-*.nse  指定所有关于smb-vuln的脚本文件,进行全扫描;safe — 对目标主机安全地进行扫描,unsafe扫描容易使目标系统宕机。

 
 
  1. root@kali:~ # nmap -v -p139,445 192.168.247.129-131
  2. Starting Nmap 7.70 ( https://nmap.org ) at 2019-05-04 14:46 CST
  3. Initiating ARP Ping Scan at 14:46
  4. Scanning 3 hosts [1 port/host]
  5. Completed ARP Ping Scan at 14:46, 0.22s elapsed (3 total hosts)
  6. Initiating Parallel DNS resolution of 3 hosts. at 14:46
  7. Completed Parallel DNS resolution of 3 hosts. at 14:46, 0.09s elapsed
  8. Nmap scan report for 192.168.247.130 [host down]
  9. Nmap scan report for 192.168.247.131 [host down]
  10. Initiating SYN Stealth Scan at 14:46
  11. Scanning bogon (192.168.247.129) [2 ports]
  12. Discovered open port 445/tcp on 192.168.247.129
  13. Discovered open port 139/tcp on 192.168.247.129
  14. Completed SYN Stealth Scan at 14:46, 0.00s elapsed (2 total ports)
  15. Nmap scan report for bogon (192.168.247.129)
  16. Host is up (0.00045s latency).
  17. PORT STATE SERVICE
  18. 139/tcp open netbios-ssn
  19. 445/tcp open microsoft-ds
  20. MAC Address: 00:0C:29:8F:74:74 (VMware)
  21. Read data files from: /usr/bin/../share/nmap
  22. Nmap done: 3 IP addresses (1 host up) scanned in 0.43 seconds
  23. Raw packets sent: 7 (228B) | Rcvd: 3 (116B)

 
 
  1. root@kali:~ # nmap 192.168.247.129 -p139,445 --script=smb-os-discovery.nse
  2. Starting Nmap 7.70 ( https://nmap.org ) at 2019-05-04 14:47 CST
  3. Nmap scan report for bogon (192.168.247.129)
  4. Host is up (0.00024s latency).
  5. PORT STATE SERVICE
  6. 139/tcp open netbios-ssn
  7. 445/tcp open microsoft-ds
  8. MAC Address: 00:0C:29:8F:74:74 (VMware)
  9. Host script results: //目标主机操作系统信息
  10. | smb-os-discovery:
  11. | OS: Windows Server 2003 3790 Service Pack 2 (Windows Server 2003 5.2)
  12. | OS CPE: cpe:/o:microsoft:windows_server_2003::sp2
  13. | Computer name: chengqia-852040
  14. | NetBIOS computer name: CHENGQIA-852040\x00
  15. | Workgroup: WORKGROUP\x00
  16. |_ System time: 2019-05-04T14:47:50+08:00
  17. Nmap done: 1 IP address (1 host up) scanned in 0.50 seconds

 
 
  1. root@kali:~ # nmap -v -p139,445 --script=smb-vuln-*.nse --script-args=safe=1 192.168.247.129
  2. Starting Nmap 7.70 ( https://nmap.org ) at 2019-05-04 14:50 CST
  3. NSE: Loaded 10 scripts for scanning.
  4. NSE: Script Pre-scanning.
  5. Initiating NSE at 14:50
  6. Completed NSE at 14:50, 0.00s elapsed
  7. Initiating ARP Ping Scan at 14:50
  8. Scanning 192.168.247.129 [1 port]
  9. Completed ARP Ping Scan at 14:50, 0.00s elapsed (1 total hosts)
  10. Initiating Parallel DNS resolution of 1 host. at 14:50
  11. Completed Parallel DNS resolution of 1 host. at 14:50, 0.01s elapsed
  12. Initiating SYN Stealth Scan at 14:50
  13. Scanning bogon (192.168.247.129) [2 ports]
  14. Discovered open port 445/tcp on 192.168.247.129
  15. Discovered open port 139/tcp on 192.168.247.129
  16. Completed SYN Stealth Scan at 14:50, 0.00s elapsed (2 total ports)
  17. NSE: Script scanning 192.168.247.129.
  18. Initiating NSE at 14:50
  19. Completed NSE at 14:50, 5.00s elapsed
  20. Nmap scan report for bogon (192.168.247.129)
  21. Host is up (0.00044s latency).
  22. PORT STATE SERVICE
  23. 139/tcp open netbios-ssn
  24. 445/tcp open microsoft-ds
  25. MAC Address: 00:0C:29:8F:74:74 (VMware)
  26. Host script results: //目标主机存在的漏洞
  27. | smb-vuln-ms08-067:
  28. | VULNERABLE:
  29. | Microsoft Windows system vulnerable to remote code execution (MS08-067)
  30. | State: VULNERABLE
  31. | IDs: CVE:CVE-2008-4250
  32. | The Server service in Microsoft Windows 2000 SP4, XP SP2 and SP3, Server 2003 SP1 and SP2,
  33. | Vista Gold and SP1, Server 2008, and 7 Pre-Beta allows remote attackers to execute arbitrary
  34. | code via a crafted RPC request that triggers the overflow during path canonicalization.
  35. |
  36. | Disclosure date: 2008-10-23
  37. | References:
  38. | https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-4250
  39. |_ https://technet.microsoft.com/en-us/library/security/ms08-067.aspx
  40. |_smb-vuln-ms10-054: false
  41. |_smb-vuln-ms10-061: NT_STATUS_OBJECT_NAME_NOT_FOUND
  42. | smb-vuln-ms17-010:
  43. | VULNERABLE:
  44. | Remote Code Execution vulnerability in Microsoft SMBv1 servers (ms17-010)
  45. | State: VULNERABLE
  46. | IDs: CVE:CVE-2017-0143
  47. | Risk factor: HIGH
  48. | A critical remote code execution vulnerability exists in Microsoft SMBv1
  49. | servers (ms17-010).
  50. |
  51. | Disclosure date: 2017-03-14
  52. | References:
  53. | https://technet.microsoft.com/en-us/library/security/ms17-010.aspx
  54. | https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-0143
  55. |_ https://blogs.technet.microsoft.com/msrc/2017/05/12/customer-guidance-for-wannacrypt-attacks/
  56. NSE: Script Post-scanning.
  57. Initiating NSE at 14:50
  58. Completed NSE at 14:50, 0.00s elapsed
  59. Read data files from: /usr/bin/../share/nmap
  60. Nmap done: 1 IP address (1 host up) scanned in 5.41 seconds
  61. Raw packets sent: 3 (116B) | Rcvd: 3 (116B)

2、nbtscan

  • -r :使用本地端口137,兼容性好,扫描结果全;
  • 可以跨网段扫描

 
 
  1. root@kali:~ # nbtscan -r 192.168.247.0/24
  2. Doing NBT name scan for addresses from 192.168.247.0/24
  3. IP address NetBIOS Name Server User MAC address
  4. ------------------------------------------------------------------------------
  5. 192.168.247.0 Sendto failed: Permission denied
  6. 192.168.247.1 LAPTOP-PCL3G0V7 <server> <unknown> 00:50:56:c0:00:08
  7. 192.168.247.129 CHENGQIA-852040 <server> <unknown> 00:0c:29:8f:74:74
  8. 192.168.247.177 <unknown> <unknown>
  9. 192.168.247.255 Sendto failed: Permission denied

3、enum4linux


 
 
  1. root@kali:~ # enum4linux -U 192.168.247.129
  2. Starting enum4linux v0.8.9 ( http://labs.portcullis.co.uk/application/enum4linux/ ) on Sat May 4 14:54:15 2019
  3. ==========================
  4. | Target Information |
  5. ==========================
  6. Target ........... 192.168.247.129
  7. RID Range ........ 500-550,1000-1050
  8. Username ......... ''
  9. Password ......... ''
  10. Known Usernames .. administrator, guest, krbtgt, domain admins, root, bin, none
  11. =======================================================
  12. | Enumerating Workgroup/Domain on 192.168.247.129 |
  13. =======================================================
  14. [+] Got domain/workgroup name: WORKGROUP
  15. ========================================
  16. | Session Check on 192.168.247.129 |
  17. ========================================
  18. [+] Server 192.168.247.129 allows sessions using username '', password '' //允许建立空连接
  19. ==============================================
  20. | Getting domain SID for 192.168.247.129 |
  21. ==============================================
  22. Cannot connect to server. Error was NT_STATUS_INVALID_PARAMETER
  23. [+] Can 't determine if host is part of domain or part of a workgroup
  24. ================================
  25. | Users on 192.168.247.129 |
  26. ================================
  27. Use of uninitialized value $users in print at ./enum4linux.pl line 874.
  28. Use of uninitialized value $users in pattern match (m//) at ./enum4linux.pl line 877.
  29. Use of uninitialized value $users in print at ./enum4linux.pl line 888.
  30. Use of uninitialized value $users in pattern match (m//) at ./enum4linux.pl line 890.
  31. enum4linux complete on Sat May 4 14:54:16 2019

三、SMTP扫描

SMTP:Simple Mail Transfer Protocol,简单邮件传输协议。

1、nc


 
 
  1. root@kali:~ # nc -nv 192.168.247.129 25 //连接25端口
  2. (UNKNOWN) [192.168.247.129] 25 (smtp) open
  3. 220 chengqia-852040 Microsoft ESMTP MAIL Service, Version: 6.0.3790.3959 ready at Sat, 4 May 2019 14:55:24 +0800
  4. ^C

2、nmap

  • 需先进行端口扫描、判断目标主机是否开启25号端口;
  • nmap smtp.163.com -p25 --script=smtp-enum-users.nse --script-args=smtp-enum-users.methods={VRFY}      //使用VRFY方法进行账户枚举。
  • nmap smtp.163.com -p25 --script=smtp-open-relay.nse        #扫描是否开启中继,如果开启邮件中继的话,容易被黑客利用,发送垃圾邮件。

 
 
  1. root@kali:~ # nmap smtp.163.com -p25 --script=smtp-enum-users.nse --script-args=smtp-enum-users.methods={VRFY}
  2. Starting Nmap 7.70 ( https://nmap.org ) at 2019-05-04 14:57 CST
  3. Nmap scan report for smtp.163.com (123.125.50.134)
  4. Host is up (0.00032s latency).
  5. Other addresses for smtp.163.com (not scanned): 123.125.50.133 123.125.50.138 123.125.50.132 123.125.50.135
  6. rDNS record for 123.125.50.134: m50-134.163.com
  7. PORT STATE SERVICE
  8. 25/tcp filtered smtp
  9. Nmap done: 1 IP address (1 host up) scanned in 0.66 seconds

 
 
  1. root@kali:~ # nmap smtp.163.com -p25 --script=smtp-open-relay.nse
  2. Starting Nmap 7.70 ( https://nmap.org ) at 2019-05-04 14:59 CST
  3. Nmap scan report for smtp.163.com (123.125.50.135)
  4. Host is up (0.0072s latency).
  5. Other addresses for smtp.163.com (not scanned): 123.125.50.132 123.125.50.138 123.125.50.133 123.125.50.134
  6. rDNS record for 123.125.50.135: m50-135.163.com
  7. PORT STATE SERVICE
  8. 25/tcp open smtp
  9. |_smtp-open-relay: Server doesn 't seem to be an open relay, all tests failed
  10. Nmap done: 1 IP address (1 host up) scanned in 2.60 seconds

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值