akde/infosec

Information security is ultimately about managing risk


  • Nmap has it’s own script­ing lan­guage with which com­plex or recur­ring tasks can be autom­a­tized. See the man­page. And share/nmap/scripts. Vulnerability scan # nmap -sV -T5 -F $victim --script vuln | tee nmap-vuln.txt Bet­ter vul­ner­a­bil­i­ty scans (thanks to this source) cd /usr/share/nmap/scripts/vulscan/utilities/updater/ && ./updateFiles.sh nmap --script nmap-vulners -sV -sC -p22 $victim nmap --script vulscan -sV…


  • Mandatory Optional Use this script to list all end­points for fur­ther research:


  • high per­for­mance, open source uni­ver­sal RPC framework GRPC Client CLI Down­load the CLI via https://github.com/vadimi/grpc-client-cli. Then: ./grpc-client-cli $target:50051 GRPC Curl Down­load via https://github.com/fullstorydev/grpcurl. gRPC UI Down­load via https://github.com/fullstorydev/grpcui. Graph­i­cal com­mand line interface. See also


  • Enumeration Mandatory Optional


  • Enumeration Mandatory Try to per­form a zone trans­fer:dig axfr @10.10.11.166 trick.htb


  • (!) If upload does not seem to work, change the suf­fix e.g. from .php to .pHp. More: File uploads / images


  • Cre­ate file to exe­cute code via meta data: https://github.com/convisolabs/CVE-2021–22204-exiftool


  • See https://www.infosecmatter.com/firebird-database-exploitation/


  • First, try to deter­mine the shell echo $PATH echo $SHELL Try to set the PATH variable export PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin Upload the escape_from_restricted_shell.c pro­gram (scripts directory). Have a look into a local bin direc­to­ry and see if you can use any bina­ry there to escape.


  • If you can reg­is­ter, do this, cre­ate a repo and go to set­tings -> githooks and there add a com­mand as post-receive hook like a reverse shell. See https://www.cvedetails.com/vulnerability-list/vendor_id-19185/product_id-49829/Gitea-Gitea.html


  • UDP 623 https://book.hacktricks.xyz/pentesting/623-udp-ipmi Metas­plot: scanner/ipmi/ipmi_version scanner/ipmi/ipmi_dumphashes ipmitool Tool for man­ag­ing IPMI See hack­tricks article


  • Registers General purpose registers Reg­is­ter x86 Reg­is­ter x64 Name Descrip­tion EAX RAX Accu­mu­la­tor For results of cal­cu­la­tions and return codes EBX RBX Base reg­is­ter Gen­er­al purpose ECX RCX Count reg­is­ter For num­ber of iter­a­tions, often used for loops EDX RDX Data reg­is­ter For data of cal­cu­la­tions or a point­er to large data ESI RSI Source index Point­er to a…


  • Keyboard functions CTRL+S Find sequence of commands SHIFT+F9 Pass exception


  • Assume you have a buffer over­flow vul­ner­a­bil­i­ty. You can con­trol the EIP. But your shell­code is nev­er executed. Your shell­code is exe­cut­ed when a ret instruc­tion is exe­cut­ed which calls the address you overwrite. But maybe the ret at the end of the func­tion where the buffer over­flow occurs is nev­er reached, because you over­wrote the…


  • SID Security Identifiers All ele­ments have attrib­ut­es. They are iden­ti­fied via a Secu­ri­ty Iden­ti­fi­er SID. The struc­ture of a SID: Exam­ple: The Domain Iden­ti­fi­er ist the SID with­out the last RID part. Exam­ples for well-known SIDs: Basic Windows security access control Security context Mandatory Integrity Control and integrity levels Win­dows (from Vista on) has five integri­ty levels:…


  • ASLR Address Space Lay­out Ran­dom­iza­tion is a tech­nique which ran­dom­izes address­es in the stack and heap. If address­es of func­tions are ran­dom­ized (e.g. from shared libraries like libc), then an attack­er can­not use a pre­de­fined exploit with hard-cod­ed addresses. Linux Dis­able ASLR: echo 0 > /proc/sys/kernel/randomize_va_space Enable ASLR: echo 2 > /proc/sys/kernel/randomize_va_space In GDB, ASLR is…


  • The stack can be pro­tect­ed against buffer overflows. Stack protection with canaries Like in a coal mine, a canary can pro­vide an indi­ca­tion if some­thing goes wrong. Here, a canary is a defined val­ues which is added between the buffer (where an attack­er will start writ­ing the pay­load) and the SFP Stack Frame Point­er and…


  • On the return-to-libc post, we described the process of inject­ing a sys­tem call with para­me­ters via envi­ron­ment vari­ables to start a new process. But this requires to exe­cute anoth­er pro­gram (which maybe no avail­able on the target). Instead of call­ing sys­tem we can call oth­er instruc­tions from some­where in the mem­o­ry. But it would be…


  • Assume that we detect­ed a buffer over­flow vul­ner­a­bil­i­ty, but we don’t have enough space on the stack for our shellcode or the bina­ry’s stack is marked as not-exe­cutable (DEP enabled). Then we can try to call a com­mon library which is also loaded (wie the plt). Walkthrough of a ret2lib attack Before we start, dis­able ASLR as…


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