Need help with manual py exploit (can't concat str to bytes)

IT WORKED! I really appreciate the help you two provided. This was my first post on the forum and I have to say it feels great to get help from the community and to get something working after having spent so much time pulling my hair out.

TazWake, checking the version to see what’s installed was a huge help, I kept looking in my usr/bin folder and all the different python folders just made me more confused. I remember coming across the whole version thing before but I totally forgot about it. I kept thinking python2 wasn’t there at all but as the -V switch and as HomeSun pointed out, it’s there it just doesn’t have many modules, like pip.

My default python version is 2.7.18 and pip was 3 because I didn’t have pip2. I tried downloading it from the pypi link HomeSun provided but I had some trouble finding all the right modules to download so I ended up finding this https://linuxize.com/post/how-to-install-pip-on-ubuntu-20.04/ and just used
curl https://bootstrap.pypa.io/get-pip.py --output get-pip.py
sudo python2 get-pip.py
which downloaded pip2 no problem. Then I was able to get impacket and then I stopped getting that str to binary error. However after all that I couldn’t get the exploit to work so I used a different one MS17-010/send_and_execute.py at master · helviojunior/MS17-010 · GitHub

Anyway, thanks again!!