Link to home
Start Free TrialLog in
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
ASKER CERTIFIED SOLUTION
Avatar of sarabande
sarabande
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sunhux
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
Avatar of 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.
Avatar of 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
Avatar of 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?
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.
Avatar of sunhux

ASKER

I'm not on Linux but Windows
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial