Avatar of sunhux
sunhux
 asked on

troubleshoot a python script

https://github.com/mazen160/struts-pwn/blob/master/README.md

I refer to the above url & I've got python 2.7 installed successfully on my Win XP.

When I ran the command below, got the error below:  need to help with the line 13 & importError :
 C:\rootc\strut>python struts-pwn.py --check --url 'http://www.google.com'
Traceback (most recent call last):
  File "struts-pwn.py", line 13, in <module>
    import requests
ImportError: No module named requests


Attached is the python script I downloaded ie struts-pwn.py
struts-pwn.py
PythonScripting LanguagesProgrammingProgramming Languages-OtherR

Avatar of undefined
Last Comment
Member_2_276102

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
sarabande

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
sunhux

ASKER
I just tried without quotes & with double quotes & still getting the same message:

C:\rootc\strut>python struts-pwn.py --check --url http://www.google.com
Traceback (most recent call last):
  File "struts-pwn.py", line 13, in <module>
    import requests
ImportError: No module named requests

C:\rootc\strut>
C:\rootc\strut>python struts-pwn.py --check --url "http://www.google.com"
Traceback (most recent call last):
  File "struts-pwn.py", line 13, in <module>
    import requests
ImportError: No module named requests


Line 13 reads:
import requests
sunhux

ASKER
If I comment out line 13 by prefixing with #   and then rerun, it looks better:

C:\rootc\strut>python struts-pwn.py --check --url "http://www.google.com"

[*] URL: http://www.google.com
EXCEPTION::::--> global name 'requests' is not defined
[*] Status: Not Affected.
[%] Done.
sunhux

ASKER
Thing is without that line, I'm not sure if the script is working correctly.

So far it reported a few URLs as  "not affected" : if anyone has an affected URL for me to scan to verify, will be good
Your help has saved me hundreds of hours of internet surfing.
fblack61
sunhux

ASKER
I know why:  though I have python Ver 2.7 installed, I'll still need
requests library installed : where can I download this?

A few links lead me to a site that requires me to have Sign-In id?
Anyone has it?
Member_2_276102

Try running:
python -m pip install requests

Open in new window

If you don't have pip, you might want to download/install that first.
sunhux

ASKER
I'm not on Linux but Windows
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Member_2_276102

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.