/
constants.go
61 lines (52 loc) 路 1.05 KB
/
constants.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
package protocol
import (
"time"
)
// Response codes sent as DNS answers.
const (
SuccessDNSResponse = "1.1.1.1"
FailureDNSResponse = "1.1.1.2"
)
// TXT record default responses
var (
NoCmdTxtResponse = "v=B2B3FE1C"
ErrorTxtResponse = "v=D31CFAA4"
CmdTxtResponse = "v=A9F466E8"
UploadTxtResponse = "v=H34FERKL"
)
// MaxLabelSize is the maximum size a DNS hostname label may be.
const MaxLabelSize = 63
// Protocols understood
const (
FileProtocol = iota
CmdProtocol
UploadProtocol
CobaltStrikeProtocol
)
// PollTypes to expect from agents.
const (
PollTypeUndefined = iota
PollTypeCheckin
PollTypeUpload
)
// Request stream status
const (
StreamStart = 0xbe
StreamData = 0xef
StreamEnd = 0xca
)
// IncomingDNSBuffer represents a pending incoming DNS conversation
type IncomingDNSBuffer struct {
Identifier string
Data []byte
Seq int
Started bool
Finished bool
Protocol int
}
// Agent represents an agent connected to this C2
type Agent struct {
Identifier string
FirstCheckin time.Time
LastCheckin time.Time
}