rapid7 / metasploit-payloads

Unified repository for different Metasploit Framework payloads
Other
1.73k stars 669 forks source link

meterpreter-python: Inconsistent use of tabs and spaces in indentation #265

Closed jojonas closed 6 years ago

jojonas commented 6 years ago

As the title indicates, execution of the meterpreter stage fails (tried with Python 3.6.2 on x64 Windows 10).

Traceback (most recent call last):
  File "exploit.py", line 16, in <module>
    exec(d,{'s':s})
  File "<string>", line 645
    try:

I could confirm that in the repository, there is a change in indentation mode between line 644 and 645 of meterpreter.py.

jojonas commented 6 years ago

The culprit seems to be this commit: https://github.com/rapid7/metasploit-payloads/commit/b5372d2a98a47509b2ddf0b60a90de5a43f32f23

busterb commented 6 years ago

Thanks, will take a look.

busterb commented 6 years ago

@zeroSteiner would you object to us switching python meterpreter to use all spaces as per standard python? In this case my editor always wants to put spaces in python code, which I failed to notice.

busterb commented 6 years ago

@bwatters-r7 could you please verify that the payload test automation catches the negative case here? Might have to try a newer python with stricter warnings.

zeroSteiner commented 6 years ago

@busterb no, I would not be opposed to that. It's probably better to change it sooner before there are additional extensions and the existing code grows.

busterb commented 6 years ago

Done, thanks!