OSCP
Search…
OSCP
All About OSCP
OSCP- One Page Repository
About the Author
Basic Linux & Windows Commands
Recon (Scanning & Enumeration)
Web Application
Brute Force
Shells
Linux Reverse Shell [One liner]
Reverse Shell to fully interactive
Reverse Shell Cheat Sheet
WebShell
Transferring files
Priv Escalation
Post Exploitation
Pivoting
Buffer Overflow
Main Tools
MISC
CheatSheet (Short)
OSCP/ Vulnhub Practice learning
Powered By
GitBook
Reverse Shell to fully interactive
1
echo os.system('/bin/bash')
2
/bin/sh -i
3
​
4
​
5
# Enter while in reverse shell
6
$ python -c 'import pty; pty.spawn("/bin/bash")'
7
​
8
Ctrl-Z
9
​
10
# In Kali
11
$ stty raw -echo
12
$ fg
13
​
14
# In reverse shell
15
$ reset
16
$ export SHELL=bash
17
$ export TERM=xterm-256color
18
$ stty rows <num> columns <cols>
Copied!
1
python -c "import pty; pty.spawn('/bin/bash')"
Copied!
​
1
stty raw -echo
2
fg
Copied!
​
1
stty size
Copied!
​
This should return two numbers, which are the number of rows and columns in your terminal. For example’s sake let’s say this command returned
48 120
Head on back to your victim box’s shell and run the following.
1
stty -rows 48 -columns 120
Copied!
1
$ export SHELL=bash
2
$ export TERM=xterm-256color
3
$ stty rows <num> columns <cols>
Copied!
Previous
Linux Reverse Shell [One liner]
Next
Reverse Shell Cheat Sheet
Last modified
2yr ago
Copy link