huuck / ADBHoney

Low interaction honeypot designed for Android Debug Bridge over TCP/IP
GNU General Public License v3.0
158 stars 33 forks source link

Add Python 3.x support #12

Closed bontchev closed 4 years ago

bontchev commented 5 years ago

Currently the honeypot seems written for Python 2.x. I think it contains a few pieces of code that wouldn't work without modification in Python 3.x. It would be nice if the code is rewritten so that it works in both Python dialects.

This isn't urgent in any way; I'm just creating an issue to document the idea.

pixie-dust commented 5 years ago

@huuck Pypi / pip will drop Python 2.x support at the beginning of 2020. Are you planning to migrate this to Python 3.x?

t3chn0m4g3 commented 5 years ago

@huuck With regard to T-Pot and the expected Python 2.7 EOL it would be awesome if you could add Python 3.x support :bowtie:

huuck commented 5 years ago

Aye. It's next on my bucket list. I'll pick up the pace again as soon as I settle into my new job, I swear :D

Kindest regards, Gabriel

t3chn0m4g3 commented 5 years ago

@huuck Thank you for the swift feedback and good luck for the new job!

bontchev commented 5 years ago

@huuck My colleague has started making our ADB honeypot compatible with both Python 2.x and 3.x. I thought that protocol.py would cause most of the trouble but, surprisingly, the required change there is minimal. There are some changes in the output plug-ins - but you don't have those, so you don't need to worry about that. Most of the changes in the main script concern surrounding literal strings with b''. There are a few places where a check is needed whether the data type is bytes or not and a few other minor peculiarities.

Take a look at it; the py3 branch; maybe it can save you some work. The current result seems to work but we're just starting to test it in production, so no promises that it works flawlessly; we might still need to fix things here and there.

huuck commented 5 years ago

I'll definitely take a look. Next thing on the order of business is Python3 support.

bontchev commented 5 years ago

When I wrote that message, the code was still rather buggy - for instance, it turned out that the receiving of files was broken. I've fixed many things since then and currently we have the py3 branch running in production under Python3 (although it was confirmed that it works with Python2 as well) and it is working flawlessly. So, it is safe to borrow from that code now.

huuck commented 4 years ago

added python3 support, gonna close this one

t3chn0m4g3 commented 4 years ago

Thank you!