rapid7 / metasploit-framework

Metasploit Framework
https://www.metasploit.com/
Other
34.04k stars 13.94k forks source link

Python shell reverse tcp Syntax error #14207

Closed yuioldodl closed 3 years ago

yuioldodl commented 4 years ago

Hi everyone. I'm trying to make a python shell reverse tcp but when I'm trying to run it on terminal i get this error :

File "shells.py", line 6 buf = ^ SyntaxError: invalid syntax

Anyone can help me ?

h00die commented 4 years ago

It would be helpful to know the exact command(s) you ran to generate this error

yuioldodl commented 4 years ago

The command i ran was : python3 shells.py

h00die commented 4 years ago

Was shell.py generated from msfvenom? If not, then you may want to ask the source code's developer as this git repo is specifically for metasploit

yuioldodl commented 4 years ago

No it was generated with metasploit.

Asking the source code of the python reverse shell ? How ?

h00die commented 4 years ago

how did the content of shells.py get there? did you use a specific module (which, what were your settings, what was the module output), did you use msfvenom to generate shellcode that you then put in the file? What version of python3 is it?

yuioldodl commented 4 years ago

Generated with metasploit using the payload python/shell_reverse_tcp.

I'v putted the content of the shells.py by copying pasting it manually in a python file as the metasploit generate it giving you only the shell code without creating the python file. Python version : python3 --version Python 3.8.4

CJSparrow commented 3 years ago

could you please attach your payload code here? I think i did fix it before! dont forget to remove your private info

timwr commented 3 years ago

I think currently python/shell_reverse_tcp is not compatible with python3. I will send a fix asap.

CJSparrow commented 3 years ago

I think currently python/shell_reverse_tcp is not compatible with python3. I will send a fix asap.

If it's not, there is a tool can convert py2 to py3, but i wanna see his output first, i might fix it