-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathconfig.go
155 lines (134 loc) · 4.82 KB
/
config.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
package main
import (
"io/ioutil"
"gopkg.in/yaml.v2"
)
type Config struct {
Applications StringSelection `yaml:"applications"`
Websites StringSelection `yaml:"websites"`
Preferences Preferences `yaml:"preferences"`
StartMenuItems StringSelection `yaml:"start_menu_items"`
FileOperations FileOperations `yaml:"file_operations"`
EmailOperations EmailOperations `yaml:"email_operations"`
SoftwareManagement StringSelection `yaml:"software_management"`
SystemUpdates SystemUpdates `yaml:"system_updates"`
UserAccounts []UserAccount `yaml:"user_accounts"`
NetworkSettings []Network `yaml:"network_settings"`
SystemLogs StringSelection `yaml:"system_logs"`
MediaFiles MediaLocation `yaml:"media_files"`
Printing StringSelection `yaml:"printing"`
ScheduledTasks ScheduledTaskSelection `yaml:"scheduled_tasks"`
DecoyFiles DecoyFiles `yaml:"decoy_files"`
Lures []LureConfig `yaml:"lures"`
General GeneralConfig `yaml:"general"`
}
type StringSelection struct {
Options []string `yaml:"options"`
SelectionMethod string `yaml:"selection_method"`
}
type ScheduledTaskSelection struct {
Options []ScheduledTask `yaml:"options"`
SelectionMethod string `yaml:"selection_method"`
}
type Preferences struct {
DefaultBrowser StringSelection `yaml:"default_browser"`
BackgroundImages MediaLocation `yaml:"background_images"`
ScreenResolutions StringSelection `yaml:"screen_resolutions"`
Languages StringSelection `yaml:"languages"`
}
type FileOperations struct {
CreateModifyFiles []FileOperation `yaml:"create_modify_files"`
}
type FileOperation struct {
Path string `yaml:"path"`
Content string `yaml:"content"`
UseGPT bool `yaml:"use_gpt"`
GPTPrompt string `yaml:"gpt_prompt"`
}
type EmailOperations struct {
GoogleAccount EmailAccount `yaml:"google_account"`
MicrosoftAccount EmailAccount `yaml:"microsoft_account"`
SendReceive []EmailOperation `yaml:"send_receive"`
}
type EmailAccount struct {
Email string `yaml:"email"`
Password string `yaml:"password"`
}
type EmailOperation struct {
SendTo string `yaml:"send_to"`
Subject string `yaml:"subject"`
Body string `yaml:"body"`
UseGPT bool `yaml:"use_gpt"`
GPTPrompt string `yaml:"gpt_prompt"`
}
type MediaLocation struct {
Location string `yaml:"location"`
Type string `yaml:"type"`
SelectionMethod string `yaml:"selection_method"`
Options []string `yaml:"options"`
}
type DecoyFiles struct {
Sets []DecoyFileSet `yaml:"sets"`
}
type DecoyFileSet struct {
Location []string `yaml:"location"`
Type string `yaml:"type"`
TargetDirectory []string `yaml:"target_directory"`
SelectionMethod string `yaml:"selection_method"`
}
type UserAccount struct {
Name string `yaml:"name"`
Password string `yaml:"password"`
FullName string `yaml:"full_name"`
Description string `yaml:"description"`
}
type Network struct {
SSID string `yaml:"ssid"`
Password string `yaml:"password"`
}
type ScheduledTask struct {
Name string `yaml:"name"`
Path string `yaml:"path"`
Schedule string `yaml:"schedule"`
StartTime string `yaml:"start_time"`
}
type LureConfig struct {
Name string `yaml:"name"`
Type string `yaml:"type"`
Location string `yaml:"location"`
GenerationParams map[string]interface{} `yaml:"generation_params"`
GenerativeType string `yaml:"generative_type"`
OpenaiPrompt string `yaml:"openai_prompt,omitempty"`
Responder string `yaml:"responder,omitempty"`
}
type SystemUpdates struct {
Method string `yaml:"method"`
SpecificUpdates []string `yaml:"specific_updates,omitempty"`
SelectionMethod string `yaml:"selection_method"`
HideUpdates []string `yaml:"hide_updates,omitempty"`
}
type GeneralConfig struct {
Redis struct {
IP string `yaml:"ip"`
Port int `yaml:"port"`
} `yaml:"redis"`
LogFile string `yaml:"log_file,omitempty"`
OpenaiApiKey string `yaml:"openai_api_key,omitempty"`
InteractionDuration int `yaml:"interaction_duration"`
ActionDelay int `yaml:"action_delay"`
RandomnessFactor int `yaml:"randomness_factor"`
Usernames []string `yaml:"usernames"`
SelectionMethod string `yaml:"selection_method"`
}
func loadConfig(filename string) (*Config, error) {
data, err := ioutil.ReadFile(filename)
if err != nil {
return nil, err
}
var config Config
err = yaml.Unmarshal(data, &config)
if err != nil {
return nil, err
}
return &config, nil
}