✅
Penetration Testing
  • Introduction
  • Methodology
  • Port Scanning
    • Ports and Associated Service
    • Nmap Port States
    • Nmap Scanning
  • Service Enumeration
    • SMB
    • HTTP 80,443
      • Sub-Domain Enumeration
      • Authentication Bypassing
      • Directory Busting
  • Reverse Shells
    • Reverse shell Cheatsheets
    • Msfvenom to get Reverse Shell
    • Spawning Shells - TTY Shells
    • Listener Setup
    • Python pty shells
    • Stabilizing shell
  • Linux Privilege Escalation
    • Enumeration
    • Automated Enumeration Tools
    • Kernel Exploits
    • Weak File Permissions
    • Sudo
    • Cron Job
    • SUID /SGID
    • Passwords and Keys
    • NFS
  • PENETRATION TESTING REPORT RESOURCES
    • Resources
  • OSCP Like Machines Walkthrough
    • HACKTHEBOX
      • Linux
      • Windows
      • Harder than OSCP
Powered by GitBook
On this page
  1. Reverse Shells

Stabilizing shell

Stabilize your shell:

  1. Import pty module and spawn bash shell

    python3 -c 'import pty;pty.spawn("/bin/bash")'
  2. Press CTRL + Z to background process and get back to your host machine

  3. Use stty command to set terminal line settings and foreground back the target terminal

    stty raw -echo; fg
  4. Set the terminal emulator to xterm:

    export TERM=xterm
  5. Press Enter

PreviousPython pty shellsNextEnumeration

Last updated 2 years ago