The VX-Files
The VX-Files
  • README.txt
  • For updates, questions, suggestions or just chatting: @malcrvz
  • Download your own local copy or check my other libre projects: Github/malcrvz
  • 📕Cybersecurity Theory
    • Index
      • Malware types
        • Viruses, worms and Trojans
        • Backdoors, Rootkits and Spyware
        • Botnets, DDoS and Spammer
        • Ransomware
        • Scareware and Adware/PUP/PUA
        • Downloaders and Launchers
        • Hacktool
        • APT - Advanced Persistent Threat
      • Social engineering techniques
        • Phishing
        • Pretexting
        • Baiting
        • Quid pro quo
        • Tailgating
      • Cryptography
        • Hash functions
        • Symmetric, Asymmetric and Hybrid cryptography
        • Digital signatures & Digital certificates
        • TLS Protocol
      • Pentesting methodology & Techniques
        • CIA Triad - Confidentiality, Integrity & Availability
        • The methodology steps
        • Pre-Engagement
        • Information Gathering
          • HTTP status codes
          • robots.txt
        • Vulnerability Assessment
        • Exploitation
          • Password cracking
        • Post-Exploitation & Persistence
          • Types of Shells
        • Privilege Escalation & Lateral Movement
        • Reporting & Remediation
  • 🐧Linux Essentials
    • Index
      • 1, 0, bits, Bytes: Units of digital information
      • User management
      • Packet management
      • Privileges & sudo
      • Passwd & Shadow files
      • Managing files, links and regex
      • find
      • Terminal/TTY
      • SSH
  • 🪟Windows Essentials
    • Index
      • CLI user management
      • CMD File management
  • 🌍Networking Essentials
    • Index
      • Windows CLI IP management
      • Linux IP management
      • Linux CLI Wi-Fi connection
  • 🕸️Network Pentesting
    • Tools
      • 1. Pre-Engagement
        • OpenVPN
      • 2. Information gathering
        • cURL & wget
        • Nmap
        • arp
        • Netcat
        • whatweb
      • 3. Vulnerability assessment
        • smbclient
      • 4. Exploitation
        • Metasploit
        • Hashcat
        • John the Ripper
      • 5. Post-Exploitation & Persistence
        • SSH
      • 6. Privilege escalation & Lateral movement
        • Possible privilege escalation vectors - Auto-enumeration scripts
      • 7. Reporting & Remediation
    • Techniques
      • Upgrade reverse shell to interactive
      • Transferring files to/from remote victim
      • Possible privilege escalation vectors - Manual checklist
    • Resources
      • Manufacturer default passwords lists
        • IP Cameras
      • Get Shells
  • 💉Web App pentesting
    • Tools
      • CeWL
      • Gobuster
      • whatweb
    • Techniques
      • Command injection
    • Resources
      • Reverse Shells
      • Bind Shells
  • 📡Wireless pentesting
    • Tools
    • Techniques
    • Resources
  • 🔓On-Premises Pentesting
    • Tools
    • Techniques
      • Removing Linux user passwords
      • Removing Windows user passwords
    • Resources
  • 💽Disks & Forensics
    • Index
      • Getting a disk ready
      • Inodes & Sectors
      • Recover deleted files
      • BUILDING - Secure file deletion
  • 🕷️Bash scripts
    • coming soon
  • ⚡PowerShell Scripts
    • coming soon
  • 🟩HTB Walkthroughs
    • coming soon
  • 🏴‍☠️External Resources
    • Schools
    • Books & Wikis
    • Utilities
    • Interactive cheat sheets
    • Wordlists
Powered by GitBook
On this page
  1. Network Pentesting
  2. Techniques

Upgrade reverse shell to interactive

First things first

When getting a reverse shell, it will most probably be a basic shell that doesn't have TAB auto-completion or gets broken when using CTRL + C To upgrade to a interactive shell we can do the following:

Steps
script /dev/null -c bash
"CTRL + Z"
stty raw -echo; fg
reset xterm
export TERM=xterm
export SHELL=/bin/bash    #Optional
stty size                 #In attacking shell to check sizing you want
stty rows n columns m     #"n" and "m" corresponding to the size we just checked
  1. script /dev/null -c bash script starts a script session that records every command you do, but we pass the output to /dev/null, thus discarding it, then -c allows us to pass a command, in this case bash so it runs the bash shell within that session

  2. CTRL + Z Sends current process to the foreground, returning us to our attacking shell

  3. stty raw -echo; fg stty to change terminal settings, raw to turn on raw mode so input as for example CTRL + C is not interpreted in the attacker terminal and -echo so its not printed too fg "foreground" brings back the process of the victim's terminal

  4. reset xterm Write it even if the prompt is hidden, will reset the terminal to its default state and we are almost finished

  5. export TERM=xterm Establishes xterm as the terminal emulator if it isn't already

  6. export SHELL=/bin/bash Optional step but recommended as bash is in almost systems so its compatible and we want everything to be functional

  7. stty size In our attacking shell, will print current size of the window in rows and columns so that's what we want to imitate

  8. stty rows n columns m Sets the victim shell to the same size as our terminal, so binaries like nano look proportionate

Last updated 1 year ago

🕸️