📘
OSCP Exam Prep
OSCP Exam Prep
OSCP Exam Prep
  • Reference List
  • Guideline
  • Commons
    • Basic Scans
    • Service Enumeration
      • HTTP(S) (80 / 443)
      • SMB (139 / 445)
      • FTP (21)
      • DNS (53)
      • SSH (22)
      • LDAP (389/636/3268)
      • Kerberos (88)
      • SNMP (161)
      • SMTP (25)
      • RDP (3389)
      • Evil-WinRM (5985/5986)
      • MYSQL (3306)
      • MSSQL (1433)
    • Default/Common Credentials
    • Shells
      • TTY Shell
    • File Transfer
    • KeePass Database
    • Port Forwarding
    • File Metadata
  • Attacks
    • Run a command x times
    • Public Exploits
    • User Creation
    • Password Cracking
      • Using custom wordlists
    • LFI/RFI
    • SQLi
    • PwnKit
    • SAM and SYSTEM files
    • Phishing for Access (Requires MailSVR)
    • GitDumper
  • Enumeration
    • Linux
    • Windows
  • Privilege Escalation
    • Linux
    • Windows
  • Port Forwarding Extras
    • Linux
    • Windows
  • Active Directory
    • Enumeration
    • Lateral Movement
    • Privilege Escalation
Powered by GitBook
On this page
  1. Commons
  2. Shells

TTY Shell

Sometimes when we get a reverse shell, the received shell may not be fully functional.

The following commands will allow us to spawn a proper shell.

Python -
    python -c 'import pty; pty.spawn("/bin/sh")'
    python3 -c 'import pty;pty.spawn("/bin/bash")'; export TERM=xterm-256color

Bash -
    echo os.system('/bin/bash')
    /bin/sh -i
    /bin/bash -i
    script -qc /bin/bash /dev/null

Perl -
    perl -e 'exec "/bin/sh";'
    exec "/bin/sh";

Ruby: exec "/bin/sh"

Lua: os.execute('/bin/sh')

IRB: exec "/bin/sh"

vi: :!bash

vi: :set shell=/bin/bash:shell

Nmap: !sh

PreviousShellsNextFile Transfer

Last updated 3 months ago