Skip to content

Commit fc445a8

Browse files
committed
chore: clean unused plugin
1 parent ca58204 commit fc445a8

31 files changed

+1
-551
lines changed

community-common/modules/common_bof.lua

Lines changed: 1 addition & 222 deletions
Original file line numberDiff line numberDiff line change
@@ -1,225 +1,4 @@
1-
local parent_command = "common"
2-
local function bof_path(bof_name, arch)
3-
return "common/bof/" .. bof_name .. "." .. arch .. ".o"
4-
end
5-
local function command_register(command_name, command_function, help_string, ttp)
6-
command(parent_command .. ":" .. command_name, command_function,
7-
help_string, ttp)
8-
end
9-
10-
-- netUserAdd
11-
12-
local function run_netuseradd_bof(cmd)
13-
local username = cmd:Flags():GetString("username")
14-
local password = cmd:Flags():GetString("password")
15-
if username == "" then error("username is required") end
16-
if password == "" then error("password is required") end
17-
local pack_args = bof_pack("ZZ", username, password)
18-
local session = active()
19-
local arch = session.Os.Arch
20-
if not isadmin(session) then
21-
error("You need to be an admin to run this command")
22-
end
23-
local bof_file = bof_path("NetUserAdd", arch)
24-
return bof(session, script_resource(bof_file), pack_args, true)
25-
end
26-
27-
local netuseradd_bof_command = command("common:netuseradd_bof",
28-
run_netuseradd_bof,
29-
"netuseradd_by_bof <username> <password>",
30-
"")
31-
netuseradd_bof_command:Flags():String("username", "", "the username to add")
32-
netuseradd_bof_command:Flags():String("password", "", "the password to set")
33-
34-
-- curl
35-
local function parse_curl_bof(args)
36-
local size = #args
37-
if size < 1 then error(">=1 arguments are allowed") end
38-
local host = args[1]
39-
local port = "80"
40-
local method = "GET"
41-
local header = "Accept: */*"
42-
local userAgent =
43-
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36"
44-
local body = ""
45-
46-
if size >= 2 then port = args[2] end
47-
local valid_methods = {
48-
GET = true,
49-
POST = true,
50-
PUT = true,
51-
PATCH = true,
52-
DELETE = true
53-
}
54-
if size >= 3 then
55-
method = args[3]
56-
if not valid_methods[method] then
57-
error("HTTP method " .. method .. " isn't valid.")
58-
end
59-
end
60-
local output = 1
61-
if args[4] == "--disable-output" then output = 0 end
62-
proxy = 1
63-
if args[4] == "--noproxy" then proxy = 0 end
64-
if size >= 5 then userAgent = args[5] end
65-
if size >= 6 then header = args[6] end
66-
if size >= 7 then body = args[7] end
67-
return bof_pack("zizizzzi", host, port, method, output, userAgent, header,
68-
body, proxy)
69-
end
70-
71-
local function run_curl_bof(args)
72-
args = parse_curl_bof(args)
73-
local session = active()
74-
local arch = session.Os.Arch
75-
local bof_file = bof_path("curl", arch)
76-
return bof(session, script_resource(bof_file), args, true)
77-
end
78-
command_register("curl_bof", run_curl_bof,
79-
"curl <host> [port] [method] [--show|--noproxy] [userAgent] [header] [body]",
80-
"")
81-
-- readfile
82-
83-
local function run_readfile_bof(args)
84-
if args[1] == nil then error(">=1 arguments are allowed") end
85-
local file_path = args[1]
86-
local packed_args = bof_pack("z", file_path)
87-
local session = active()
88-
local arch = session.Os.Arch
89-
local bof_file = bof_path("readfile", arch)
90-
return bof(session, script_resource(bof_file), packed_args, true)
91-
end
92-
command_register("readfile_bof", run_readfile_bof, "readfile_bof <file_path>",
93-
"")
94-
95-
-- kill_defender
96-
local function parse_kill_defender_bof(args)
97-
local size = #args
98-
if size < 1 then error(">=1 arguments are allowed") end
99-
local action = args[1]
100-
if action == "kill" or action == "check" then
101-
local username = session.Os.Username
102-
end
103-
return bof_pack("z", args[1])
104-
end
105-
local function run_kill_defender_bof(args)
106-
local session = active()
107-
local arch = session.Os.Arch
108-
local bof_file = bof_path("kill_defender", arch)
109-
return bof(session, script_resource(bof_file), args, true)
110-
end
111-
command_register("kill_defender_bof", run_kill_defender_bof,
112-
"kill_defender_bof <action>", "")
113-
-- clipboard
114-
local function run_clipboard_bof(args)
115-
local session = active()
116-
local arch = session.Os.Arch
117-
local bof_file = bof_path("clipboard", arch)
118-
return bof(session, script_resource(bof_file), args, true)
119-
end
120-
-- dump clipboard
121-
local function run_dump_clipboard(args)
122-
local session = active()
123-
local arch = session.Os.Arch
124-
local bof_file = bof_path("dump_clipboard", arch)
125-
return bof(session, script_resource(bof_file), args, true)
126-
end
127-
command_register("dump_clipboard_bof", run_dump_clipboard, "dump_clipboard_bof",
128-
"")
129-
-- wifidump
130-
local function parse_wifidump_bof(args)
131-
local size = #args
132-
if size < 1 then error(">=1 arguments are allowed") end
133-
print(args[1])
134-
local interface = args[1]
135-
return bof_pack("Z", interface)
136-
end
137-
local function run_wifidump_bof(args)
138-
args = parse_wifidump_bof(args)
139-
local session = active()
140-
local arch = session.Os.Arch
141-
local bof_file = bof_path("wifidump", arch)
142-
return bof(session, script_resource(bof_file), args, true)
143-
end
144-
command_register("wifidump_bof", run_wifidump_bof, "wifidump_bof <profilename>",
145-
"")
146-
147-
-- wifienum
148-
local function run_wifienum_bof(args)
149-
if #args > 0 then error("no arguments are allowed") end
150-
local session = active()
151-
local arch = session.Os.Arch
152-
local bof_file = bof_path("wifienum", arch)
153-
return bof(session, script_resource(bof_file), args, true)
154-
end
155-
command_register("wifienum_bof", run_wifienum_bof, "wifienum_bof", "")
156-
157-
-- memory info
158-
local function run_read_memory_bof()
159-
local session = active()
160-
local arch = session.Os.Arch
161-
local bof_file = bof_path("memory", arch)
162-
return bof(session, script_resource(bof_file), {}, true)
163-
end
164-
command_register("meminfo_bof", run_read_memory_bof, "meminfo_bof", "")
165-
166-
-- memory reader
167-
-- Usage : memreader <target-pid> <pattern> <output-size>
168-
local function parse_memory_reader_bof(args)
169-
local size = #args
170-
if size < 2 then error(">=2 arguments are allowed") end
171-
local target_pid = args[1]
172-
local pattern = args[2]
173-
local output_size = 10
174-
if size == 3 then output_size = args[3] end
175-
return bof_pack("izi", target_pid, pattern, output_size)
176-
end
177-
178-
local function run_memory_reader_bof(args)
179-
args = parse_memory_reader_bof(args)
180-
local session = active()
181-
local arch = session.Os.Arch
182-
local bof_file = bof_path("memreader", arch)
183-
return bof(session, script_resource(bof_file), args, true)
184-
end
185-
command_register("mem_reader_bof", run_memory_reader_bof,
186-
"common mem_reader_bof <target-pid> <pattern> <output-size>",
187-
"")
188-
189-
-- regdump
190-
local function run_regdump_bof(args)
191-
local session = active()
192-
if not isadmin(session) then
193-
error("You need to be an admin to run this command")
194-
end
195-
local location = args[1] or ""
196-
local packed_args = bof_pack("z", location)
197-
198-
local arch = session.Os.Arch
199-
local bof_file = bof_path("regdump", arch)
200-
return bof(session, script_resource(bof_file), packed_args, true)
201-
end
202-
command_register("regdump_bof", run_regdump_bof, "regdump_bof <location>", "")
203-
204-
-- screenshot
205-
local function run_screenshot(args)
206-
local filename
207-
if #args == 1 then
208-
filename = args[1]
209-
else
210-
filename = "screenshot.jpg"
211-
end
212-
local packed_args = bof_pack("z", filename)
213-
local session = active()
214-
local arch = session.Os.Arch
215-
local bof_file = bof_path("screenshot", arch)
216-
local result = bof(session, script_resource(bof_file), packed_args, true)
217-
return result
218-
end
219-
command_register("screenshot_bof", run_screenshot,
220-
"Command: situational screenshot <filename>", "T1113")
221-
222-
--- common sharp
1+
--- common sharp
2232
local function run_SharpWebServer(args)
2243
local session = active()
2254
local arch = session.Os.Arch

community-common/modules/operatorskit.lua

Lines changed: 0 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,6 @@
11
-- Master Lua Script to load all Beacon Object Files from the
22
local bof_dir = "OperatorsKit/"
33

4-
-- Addexclusion
5-
local function parse_addexclusion(args)
6-
if #args < 2 then
7-
error("Please specify one of the following exclusion types: path | process | extension.")
8-
end
9-
local excltype = args[1]
10-
local excldata = args[2]
11-
12-
if excltype ~= "path" and excltype ~= "process" and excltype ~= "extension" then
13-
error("This exclusion type isn't supported.")
14-
end
15-
return bof_pack("zZ", excltype, excldata)
16-
end
17-
local function run_addexclusion(args)
18-
local session = active()
19-
args = parse_addexclusion(args)
20-
local bof_path = bof_dir .. "AddExclusion/addexclusion" .. ".o"
21-
return bof(session, script_resource(bof_path), args, true)
22-
end
23-
command("operatorskit:addexclusion", run_addexclusion, "Command: operatorskit addexclusion <exclusion type> <exclusion data>", "T1562.001")
24-
254
--- Start Addfirewallrule
265
local function parse_addfirewallrule(args)
276
if #args < 3 then
@@ -154,23 +133,6 @@ local function run_credprompt(args)
154133
end
155134
command("operatorskit:credprompt", run_credprompt, 'Command: operatorskit credprompt "<title>" "<message>" [timeout]', "T1056.004")
156135

157-
-- Delexclusion
158-
local function parse_delexclusion(args)
159-
if #args < 2 then
160-
error("Please provide exclusion type and data.")
161-
end
162-
local excltype = args[1]
163-
local excldata = args[2]
164-
return bof_pack("zZ", excltype, excldata)
165-
end
166-
local function run_delexclusion(args)
167-
local session = active()
168-
args = parse_delexclusion(args)
169-
local bof_path = bof_dir .. "DelExclusion/delexclusion" .. ".o"
170-
return bof(session, script_resource(bof_path), args, true)
171-
end
172-
command("operatorskit:delexclusion", run_delexclusion, 'Command: operatorskit delexclusion <exclusion type> <exclusion data>', "T1562.001")
173-
174136
-- Delfirewallrule
175137
local function parse_delfirewallrule(args)
176138
if #args < 1 then
@@ -242,22 +204,6 @@ local function run_dllenvhijacking(args)
242204
end
243205
command("operatorskit:dllenvhijacking", run_dllenvhijacking, 'Command: operatorskit dllenvhijacking <sysroot> <proxy DLL> <path to DLL> <vulnerable binary> <parent PID>', "T1574.001")
244206

245-
-- Enumlocalcert
246-
local function parse_enumlocalcert(args)
247-
if #args < 1 then
248-
error("Please specify a valid certificate store name.")
249-
end
250-
local store = args[1]
251-
return bof_pack("Z", store)
252-
end
253-
local function run_enumlocalcert(args)
254-
local session = active()
255-
args = parse_enumlocalcert(args)
256-
local bof_path = bof_dir .. "EnumLocalCert/enumlocalcert" .. ".o"
257-
return bof(session, script_resource(bof_path), args, true)
258-
end
259-
command("operatorskit:enumlocalcert", run_enumlocalcert, 'Command: operatorskit enumlocalcert <store name>', "T1553.003")
260-
261207
-- Enumsecproducts
262208
local function parse_enumsecproducts(args)
263209
local remotehost = args[1] or ""
@@ -317,40 +263,6 @@ local function run_enumwsc(args)
317263
end
318264
command("operatorskit:enumwsc", run_enumwsc, 'Command: operatorskit enumwsc <option>', "T1518.001")
319265

320-
-- Enumdotnet
321-
local function run_enumdotnet()
322-
local session = active()
323-
local bof_path = bof_dir .. "EnumDotnet/enumdotnet" .. ".o"
324-
return bof(session, script_resource(bof_path), {}, true)
325-
end
326-
command("operatorskit:enumdotnet", run_enumdotnet, "Command: operatorskit enumdotnet", "T1033")
327-
328-
-- Enumexclusions
329-
local function run_enumexclusions()
330-
local session = active()
331-
local bof_path = bof_dir .. "EnumExclusions/enumexclusions" .. ".o"
332-
return bof(session, script_resource(bof_path),{}, true)
333-
end
334-
command("operatorskit:enumexclusions", run_enumexclusions, "Command: operatorskit enumexclusions", "T1518.001")
335-
336-
-- Enumfiles
337-
local function parse_enumfiles(args)
338-
if #args < 2 then
339-
error("Please provide the directory path and search pattern.")
340-
end
341-
local lpDirectory = args[1]
342-
local lpSearchPattern = args[2]
343-
local keyword = args[3] or ""
344-
return bof_pack("zzz", lpDirectory, lpSearchPattern, keyword)
345-
end
346-
local function run_enumfiles(args)
347-
local session = active()
348-
args = parse_enumfiles(args)
349-
local bof_path = bof_dir .. "EnumFiles/enumfiles" .. ".o"
350-
return bof(session, script_resource(bof_path), args, true)
351-
end
352-
command("operatorskit:enumfiles", run_enumfiles, 'Command: operatorskit enumfiles <directory> <search pattern> [keyword]', "T1083")
353-
354266
-- Enumhandles
355267
local function parse_enumhandles(args)
356268
if #args < 2 then
@@ -535,14 +447,6 @@ local function run_silencesysmon(args)
535447
end
536448
command("operatorskit:silencesysmon", run_silencesysmon, 'Command: operatorskit silencesysmon <PID>', "T1562.002")
537449

538-
-- Systeminfo
539-
local function run_systeminfo()
540-
local session = active()
541-
local bof_path = bof_dir .. "SystemInfo/systeminfo" .. ".o"
542-
return bof(session, script_resource(bof_path), {}, true)
543-
end
544-
command("operatorskit:systeminfo", run_systeminfo, "Command: operatorskit systeminfo", "T1082")
545-
546450
-- Dllcomhijacking
547451
local function parse_dllcomhijacking(args)
548452
if #args < 2 then
@@ -588,14 +492,6 @@ local function run_injectpoolparty(args)
588492
end
589493
command("operatorskit:injectpoolparty", run_injectpoolparty, 'Command: operatorskit injectpoolparty <variant> <PID> <listener>', "T1055.012")
590494

591-
-- Enumdrives
592-
local function run_enumdrives(args)
593-
local session = active()
594-
local bof_path = bof_dir .. "EnumDrives/enumdrives" .. ".o"
595-
return bof(session, script_resource(bof_path), args, true)
596-
end
597-
command("operatorskit:enumdrives", run_enumdrives, 'Command: operatorskit enumdrives', "T1135")
598-
599495
-- Passwordspray
600496
local function parse_passwordspray(args)
601497
if #args < 3 then

0 commit comments

Comments
 (0)