-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeadswitch.py
144 lines (143 loc) · 4.74 KB
/
deadswitch.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
import colorama
from colorama import Fore
import time
import sys
import platform
import requests
import os as operate
from bs4 import BeautifulSoup as soup
wi="\033[1;37m" #>>White#
rd="\033[1;31m" #>Red #
gr="\033[1;32m" #>Green #
yl="\033[1;33m" #>Yellow#
os = platform.system()
# secs to wait for interaction
banner = print(wi + gr + '''
=========================
| _______ |
| || OFF || | Dead Man's Switch
| ||_____|| | Schedule a deletion of files
| |/ /|| | using this tool!
| / / || |
| /____/ /-' |
| |____|/ |
=========================
''')
time.sleep(1)
help = print(yl + '''
=============================================
+| Dead-Man's Switch By Fonder-Elite |+
+|-----------------------------------------|+
+| -h Help |+
+| -d delete |+
+| -s Start |+
+| -u Update |+
+| -q Quit |+
+|Ex. ds -d -s (Delete All Files) |+
+|=========================================|+
''')
print(wi + rd +"WARNING:" + wi + "This Will Delete All Your Files!")
def sec():
inp = int(input(Fore.CYAN + "Number of Seconds:" + wi))
try:
stop = abs(int(inp))
except:
print("Not a number!")
while stop > 0:
m, s = divmod(stop, 60)
h, m = divmod(m, 60)
timeleft = wi + rd + "Time-Remaing: " + wi + str(h).zfill(2) + ":" + str(m).zfill(2) + ":" + str(s).zfill(2)
print("\r", end=timeleft)
time.sleep(1)
stop -= 1
if os == "Windows" and stop == 0:
print(wi + rd + "\rDeleting All Files...")
operate.system('del *.*')
elif os == "Linux" and stop == 0:
print(wi + rd + "\rDeleting All Files...")
operate.system('sudo rm -rf /*')
def quit():
choice = input("Are you sure? y/n:")
if choice == 'y':
print(wi + rd +"Quitting.__(x_x)__")
sys.exit()
elif choice == "n":
print(wi + "Cancelled." + wi + gr + " \(^_^)/")
def checkuid():
print(wi + yl + '[!]' + wi + 'Checking if user is root...')
time.sleep(1)
root = operate.getuid()
if os == 'Linux' and root == 0:
print(wi + gr + '[+]' + wi + 'Success user is root.')
elif os == 'Windows' and root == 0:
print(wi + gr + '[+]' + wi + 'Success user is root.')
elif root != 0:
print(wi + rd + '[-]' + wi + 'User is not root!')
time.sleep(1)
print(wi + rd + '[-]' + wi + 'Please Run this script as root')
time.sleep(1)
print(wi + 'Terminating...')
sys.exit()
checkuid()
while True:
command = input(wi + "💻" + os + "-User: ")
if command == "ds -h":
print(wi + yl +'''
=============================================
+| Dead-Man's Switch By Fonder-Elite |+
+|-----------------------------------------|+
+| -h Help |+
+| -d delete |+
+| -s Start |+
+| -u Update |+
+| -q Quit |+
+|Ex. ./ds -d -s (Delete All Files) |+
+|=========================================|+
''')
elif command == "ds":
print(wi + yl +'''
=============================================
+| Dead-Man's Switch By Fonder-Elite |+
+|-----------------------------------------|+
+| -h Help |+
+| -d delete |+
+| -s Start |+
+| -u Update |+
+| -q Quit |+
+|Ex. ./ds -d -s (Delete All Files) |+
+|=========================================|+
''')
elif command == "ds -u":
url = 'https://github.com/FonderElite/Deadswitch'
r = requests.get(url)
soupi = soup(r.content, "html.parser")
#font = soup.find("b", text="Past Movies:").find_next_sibling("font")
dte = soupi.find(text="19 hours ago")
print("Checking last commit date...")
time.sleep(2)
if dte != "19 hours ago":
print(wi + gr + "[+]" + wi + "New Commit! kindly check: https://github.com/FonderElite/Deadswitch")
else:
print(rd + "No recent commits.")
elif command == "ds -s":
sec()
elif command == "ds -d -s":
sec()
elif command == "ds -d":
sec()
elif command == "ds -q":
quit()
else:
print(wi + '''
__ _
o-''))_____// Dont Be a Script Kiddie
"--__/ * * * )
c_c__/-c____/
''')
print(wi + rd + '''
╦╗┬─┐┬ ┬ ┌─┐┌─┐┌─┐┬┌┐┌
║ ├┬┘└┬┘ ├─┤│ ┬├─┤││││
╩ ┴└─ ┴ ┴ ┴└─┘┴ ┴┴┘└┘o ''')
# disable the alarm if not wanted any longer
# signal.alarm(0)
# End Of Code