Python Module and parser library issues

Type your comment> @acidbat said:

Thanks @HadesSec
yeah no luck in even installing pip2
curled the file and ran it and got the following error:

  File "get-pip.py", line 24244, in <module>
    main()
  File "get-pip.py", line 199, in main
    bootstrap(tmpdir=tmpdir)
  File "get-pip.py", line 82, in bootstrap
    from pip._internal.cli.main import main as pip_entry_point
  File "/tmp/tmp2JmL1p/pip.zip/pip/_internal/cli/main.py", line 60
    sys.stderr.write(f"ERROR: {exc}") ```

But a good nose you had for pointing out the python2 (py2) ...
I guess its python3 now for me all the way :)

Wonder if there is a way to convert the script ... (google )

Did you run get-pip.py in python2 or 3? Honestly, I’ve absolutely NEVER had any issues with that python script.

lol whoops I’m an idiot - installed it via python3 successfully.
Successfully installed pip-21.0.1
Thanks mate - will see how this goes

Type your comment> @acidbat said:

lol whoops I’m an idiot - installed it via python3 successfully.
Successfully installed pip-21.0.1
Thanks mate - will see how this goes

Happy to see it work! Was a bit nervous and stumped for a second haha.
For sure! Let me know how it goes!

@acidbat
in your error message File "/usr/share/offsec-awae-wheels/beautifulsoup4-4.9.1-py2-none-any.whl/bs4/__init__.py", especially the beautifulsoup4-4.9.1-py2-none-any.whl part, means:
this package is part of beautifulsoup version 4, 4.9.1 to be specific, but it is THE ONE THAT IS SUITABLE FOR PYTHON2, not picky about your OS, nor your processor architecture

partially disagree with @HadesSec, i don’t think this -py2 means the exploit script is written in python2, but i do think it means this beautifulsoup that comes with offsec-awae install, is only made for use with python2
edit: i see what exploit are you dealing with now haha! yeah the exploit script is in python3

then i guess you should install beautifulsoup4-4.9.1-py2-none-any.whl’s brother i.e. beautifulsoup4-4.9.1-py3-none-any.whl? link here

<nonsense removed, still no idea based on what word is a lib located>

Type your comment> @bitn4b said:

@acidbat
in your error message File "/usr/share/offsec-awae-wheels/beautifulsoup4-4.9.1-py2-none-any.whl/bs4/__init__.py", especially the beautifulsoup4-4.9.1-py2-none-any.whl part, means:
this package is part of beautifulsoup version 4, 4.9.1 to be specific, but it is THE ONE THAT IS SUITABLE FOR PYTHON2, not picky about your OS, nor your processor architecture

Ok, that is good to know and thank you for explaining.

partially disagree with @HadesSec, i don’t think this -py2 means the exploit script is written in python2, but i do think it means this beautifulsoup that comes with offsec-awae install, is only made for use with python2
edit: i see what exploit are you dealing with now haha! yeah the exploit script is in python3

I admire people who can just read code and understand what needs to be done right away. Seriously think I course in python3 would do me some good.

then i guess you should install beautifulsoup4-4.9.1-py2-none-any.whl’s brother i.e. beautifulsoup4-4.9.1-py3-none-any.whl? link here

Awesome, thank you - will look at this at home (where the problematic distro lives)
Any tips on how to install *.whl files?

Type your comment> @acidbat said:

Awesome, thank you - will look at this at home (where the problematic distro lives)
Any tips on how to install *.whl files?

Apparently this is the way to do it: pip install FILE.whl

@acidbat said:
I admire people who can just read code and understand what needs to be done right away. Seriously think I course in python3 would do me some good.
uh man i just see command print come with parentheses and assume it’s python3, (should be right…i guess? have you fixed your distro?)
i unfortunately don’t know ■■■■ about code >> every time i try to learn i just get overwhelmed by so many new words >>

but seriously have you fixed your python…thing?

No dice yet - I didn’t get too much time last night.
installing the .whl files did not work (said it was already installed and the python2 one did not meet my requirements of distro ‘’‘ERROR: beautifulsoup4-4.9.3-py2-none-any.whl is not a supported wheel on this platform.’‘’
will download beautifulsoup4-4.9.1-py2-none-any.whl and see what happens - expecting it will be the same.

Also tried a convert from python2 to python3 script - got little further but still some modules complaints.
whats this space

bro you ALREADY HAVE beautifulsoup4-4.9.1-py2-none-any.whl, it is the reason why your exploit script errored out in the first place aaaahhhhhhhhhhhhh
in my original answer i think you need to install beautifulsoup4-4.9.1-py3-none-any.whl, the -py3 one! the -py3 one!

bro i think you need to try pip3 install beautifulsoup4-4.9.1-py3-none-any.whl
specify! 3! wherever! you! can!
including when you run your exploit python3 <exploit>

(pls work)

<i really dont know anymore>

Type your comment> @bitn4b said:

bro you ALREADY HAVE beautifulsoup4-4.9.1-py2-none-any.whl, it is the reason why your exploit script errored out in the first place aaaahhhhhhhhhhhhh
in my original answer i think you need to install beautifulsoup4-4.9.1-py3-none-any.whl, the -py3 one! the -py3 one!

bro i think you need to try pip3 install beautifulsoup4-4.9.1-py3-none-any.whl
specify! 3! wherever! you! can!
including when you run your exploit python3 <exploit>

(pls work)

Yeah did that - installed it (yay)

python3 exploit.py

Traceback (most recent call last):
  File "exploit.py", line 16, in <module>
    from random_words import RandomWords
ModuleNotFoundError: No module named 'random_words'

Module is installed

sudo pip3 install Random-Word                                                                                                                                                                                                        1 ⨯
Requirement already satisfied: Random-Word in /usr/local/lib/python3.9/dist-packages (1.0.6)
Requirement already satisfied: nose in /usr/local/lib/python3.9/dist-packages (from Random-Word) (1.3.7)
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (from Random-Word) (2.25.1)

I feel like season2 of LOST

i know it now!
it should be from random_word import RandomWords!!!
there’s no s after random_word! the original script made a typo!

Type your comment> @bitn4b said:

then edit the script import part to be from Random-Word import RandomWords?

i dont feel a thing anymore

SFA mate.

Thank you for your help so far - I’ll park this crazy project for now. I did root the machine on my other VM but would be nice to align it all to work properly.
And they say python is the easiest one to learn --- yeah okay -

@acidbat
no no no pls try edit the script import part to be from random_word import RandomWords!
it is underscore (my bad) but without s followed pls try it ahhhh i tried it and it worked!

@acidbat
ahhh don’t park it man we are so close! it is not crazy it is the original writer made a typo! typo is not crazy it’s careless and stupid (or intended) it’s not your fault!

pls just try edit the script import part to be from random_word import RandomWords it just take 3 seconds and if it still wont work we will then park it!

see the original exploit said from random_words but it should be from random_word, no s, and we’re done

@bitn4b I appreciate your passion on this :D.

So I got further (thank you)

But

line 92, in <module>
    project_name = r.random_word()
AttributeError: 'RandomWords' object has no attribute 'random_word'

Shout out to @bitn4b
Script is executing (finally) - python2 to python3 issues.
Mate you are a legend for sticking with this :smiley: - so thank you once again.

Having some environmental issue - but I don’t think that is the script

i need good book for learning python zero to hero