When we challenge the CTF (Capture the Flag), we sometimes encounter the vulnerability of EternalBlue.
There are many payloads to perform this exploitation. For example:
Regardless of what you choose, you can get it right as long as Python2.
However, if you run it with Python3 you might get the error “TypeError: can’t concat str to bytes”.
It is caused by certain codes in the “mysmb.py” because it is for Python2, but not Python3. By the way, the mysmb.py is imported by the main script on EternalBlue.
If you don’t have mysmb.py, you can download it here (rename it to “mysmb.py”).
When you use Python3, you need to fix a few lines on mysmb.py as follows.
Near the Line.69~
That way, you can exploit EternalBlue correctly with even Python 3.
For details about EternalBlue, please check my webpage.