We help IT Professionals succeed at work.

troubleshoot a python script

923 Views
Last Modified: 2017-03-23
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
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2016
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Author

Commented:
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

Author

Commented:
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.

Author

Commented:
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

Author

Commented:
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.

Author

Commented:
I'm not on Linux but Windows
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION