基于msf

模块:
scanner/smb/smb_version

  1. msf auxiliary(scanner/smb/smb_version) > show options
  2. Module options (auxiliary/scanner/smb/smb_version):
  3. Name Current Setting Required Description
  4. ‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐
  5. RHOSTS 192.168.1.0/24 yes The target address range or CIDR identifier
  6. SMBDomain . no The Windows domain to use for authentication
  7. SMBPass no The password for the specified username
  8. SMBUser no The username to authenticate as
  9. THREADS 1 yes The number of concurrent threads
  10. msf auxiliary(scanner/smb/smb_version) > set threads 20
  11. threads => 20
  12. msf auxiliary(scanner/smb/smb_version) > exploit
  13. [+] 192.168.1.4:445 Host is running Windows 7 Ultimate SP1 (build:7601) (name:XXXXXX) (workgroup:WORKGROUP )
  14. [*] Scanned 39 of 256 hosts (15% complete)
  15. [*] Scanned 61 of 256 hosts (23% complete)
  16. [*] Scanned 81 of 256 hosts (31% complete)
  17. [+] 192.168.1.99:445 Host is running Windows 7 Ultimate SP1 (build:7601) (name:XXXXXX) (workgroup:WORKGROUP )
  18. [+] 192.168.1.119:445 Host is running Windows 2003 R2 SP2 (build:3790) (name:XXXXXX)
  19. [*] Scanned 103 of 256 hosts (40% complete)
  20. [*] Scanned 130 of 256 hosts (50% complete)
  21. [*] Scanned 154 of 256 hosts (60% complete)
  22. [*] Scanned 181 of 256 hosts (70% complete)
  23. [*] Scanned 205 of 256 hosts (80% complete)
  24. [*] Scanned 232 of 256 hosts (90% complete)
  25. [*] Scanned 256 of 256 hosts (100% complete)
  26. [*] Auxiliary module execution completed

第二十二课:基于SMB发现内网存活主机 - 图1

基于cme(参考第九十三课)

  1. root@John:~# cme smb 192.168.1.0/24
  2. SMB 192.168.1.4 445 JOHNPC [*] Windows 7 Ultimate 7601 Service Pack 1
  3. x64 (name:JOHNPC) (domain:JOHNPC) (signing:False) (SMBv1:True)
  4. SMB 192.168.1.99 445 JOHNPC [*] Windows 7 Ultimate 7601 Service Pack
  5. x64 (name:JOHNPC) (domain:JOHNPC) (signing:False) (SMBv1:True)
  6. SMB 192.168.1.119 445 WIN03X64 [*] Windows Server 2003 R2 3790 Service
  7. Pack 2 x32 (name:WIN03X64) (domain:WIN03X64) (signing:False) (SMBv1:True

第二十二课:基于SMB发现内网存活主机 - 图2

基于nmap

  1. root@John:~# nmap sU sS ‐‐script smbenumshares.nse p 445 192.168.1.119
  2. Starting Nmap 7.70 ( https://nmap.org ) at 20190129 08:45 EST
  3. Nmap scan report for 192.168.1.119
  4. Host is up (0.0029s latency).
  5. PORT STATE SERVICE
  6. 445/tcp open microsoftds
  7. 445/udp open|filtered microsoftds
  8. MAC Address: 00:0C:29:85:D6:7D (VMware)
  9. Host script results:
  10. | smbenumshares:
  11. | account_used: guest
  12. | \\192.168.1.119\ADMIN$:
  13. | Type: STYPE_DISKTREE_HIDDEN
  14. | Comment: \xE8\xBF\x9C\xE7\xA8\x8B\xE7\xAE\xA1\xE7\x90\x86
  15. | Anonymous access: <none>
  16. | Current user access: <none>
  17. | \\192.168.1.119\C$:
  18. | Type: STYPE_DISKTREE_HIDDEN
  19. | Comment: \xE9\xBB\x98\xE8\xAE\xA4\xE5\x85\xB1\xE4\xBA\xAB
  20. | Anonymous access: <none>
  21. | Current user access: <none>
  22. | \\192.168.1.119\E$:
  23. | Type: STYPE_DISKTREE_HIDDEN
  24. | Comment: \xE9\xBB\x98\xE8\xAE\xA4\xE5\x85\xB1\xE4\xBA\xAB
  25. | Anonymous access: <none>
  26. | Current user access: <none>
  27. | \\192.168.1.119\IPC$:
  28. | Type: STYPE_IPC_HIDDEN
  29. | Comment: \xE8\xBF\x9C\xE7\xA8\x8B IPC
  30. | Anonymous access: READ
  31. | Current user access: READ/WRITE
  32. | \\192.168.1.119\share:
  33. | Type: STYPE_DISKTREE
  34. | Comment:
  35. | Anonymous access: <none>
  36. |_ Current user access: READ/WRITE
  37. Nmap done: 1 IP address (1 host up) scanned in 1.24 seconds

第二十二课:基于SMB发现内网存活主机 - 图3

基于CMD:

  1. for /l %a in (1,1,254) do start /min /low telnet 192.168.1.%a 445

第二十二课:基于SMB发现内网存活主机 - 图4

基于powershell:

一句话扫描:
单IP:

  1. 445 | %{ echo ((newobject Net.Sockets.TcpClient).Connect("192.168.1.1
  2. 19",$_)) "$_ is open"} 2>$null

第二十二课:基于SMB发现内网存活主机 - 图5

多ip:

  1. 1..5 | % { $a = $_; 445 | % {echo ((newobject
  2. Net.Sockets.TcpClient).Connect("192.168.1.$a",$_)) "Port $_ is open"}
  3. 2>$null}

第二十二课:基于SMB发现内网存活主机 - 图6

多port,多IP:

  1. 118..119 | % { $a = $_; writehost "‐‐‐‐‐‐"; writehost
  2. "192.168.1.$a"; 80,445 | % {echo ((newobject Net.Sockets.TcpClient).Conn
  3. ect("192.168.1.$a",$_)) "Port $_ is open"} 2>$null}

第二十二课:基于SMB发现内网存活主机 - 图7

Micropoor