Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib
- import urllib2
- import hashlib
- def mid(s, offset, amount):
- return s[offset-1:offset+amount-1]
- def find_str(s, char):
- index = 0
- if char in s:
- c = char[0]
- for ch in s:
- if ch == c:
- if s[index:index+len(char)] == char:
- return index
- index += 1
- return -1
- def computeMD5hash(my_string):
- m = hashlib.md5()
- m.update(my_string.encode('utf-8'))
- return m.hexdigest()
- req = urllib2.Request("http://docker.hackthebox.eu:33843")
- res = urllib2.urlopen(req)
- data = res.read()
- x = find_str(data, "<h3 align='center'>")
- y = find_str(data, "</h3><center>")
- hashstr = mid(data, x+len("<h3 align='center'>")+1, y-(x+len("<h3 align='center'>")))
- print (hashstr+"\n")
- hashmd5 = computeMD5hash(hashstr)
- print (hashmd5)
- data = urllib.urlencode({'hash' : hashmd5})
- content = urllib2.urlopen(url="http://docker.hackthebox.eu:33843", data=data).read()
- print (content)
- if (find_str(content, "Too slow") > 0):
- print ("NOIS")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement