feature: guardrail data

This commit is contained in:
Dobin Rutishauser
2024-06-18 16:05:37 +02:00
parent f84fd98416
commit ae3567847c
5 changed files with 21 additions and 1 deletions
+14
View File
@@ -239,6 +239,20 @@
</div>
</div>
{% if project.settings.plugin_guardrail != "none" %}
<div class="form-group row">
<label for="guardrail" class="col-sm-5 col-form-label">
Guard Data
</label>
<div class="col-sm-7">
<input type="text" name="guardrail_data" class="hidden form-control"
placeholder="" value="{{project.settings.plugin_guardrail_data}}"
aria-label="guardrail_data" aria-describedby="basic-addon1"
onchange="this.form.submit()">
</div>
</div>
{% endif %}
<div class="form-group row">
<label for="antiemulation_style" class="col-sm-5 col-form-label">
AntiEmulation
+2
View File
@@ -215,6 +215,8 @@ def add_project():
payload_location = request.form['payload_location']
settings.payload_location = PayloadLocation[payload_location]
settings.plugin_guardrail_data = request.form['guardrail_data']
# overwrite project
project = storage.get_project(project_name)
project.settings = settings
+1 -1
View File
@@ -15,7 +15,7 @@ int mystrcmp(wchar_t* str1, wchar_t* str2) {
int executionguardrail() {
// Execution Guardrail: Env Check
wchar_t envVarName[] = L"USERPROFILE";
wchar_t tocheck[] = L"C:\\Users\\";
wchar_t tocheck[] = L"{{guardrail_data}}";
WCHAR buffer[1024]; // NOTE: Do not make it bigger, or we have a __chkstack() dependency!
DWORD result = GetEnvironmentVariableW(envVarName, buffer, 1024);
if (result == 0) {
+1
View File
@@ -17,6 +17,7 @@ class Settings():
self.plugin_antiemulation = "none"
self.plugin_decoy = "none"
self.plugin_guardrail = "none"
self.plugin_guardrail_data = "C:\\Users\\"
self.dllfunc: str = "" # For DLL injection
+3
View File
@@ -32,6 +32,9 @@ def create_c_from_template(settings: Settings, payload_len: int):
settings.plugin_guardrail)
with open(filepath_guardrails, "r", encoding='utf-8') as file:
plugin_guardrails = file.read()
plugin_guardrails = Template(plugin_guardrails).render({
'guardrail_data': settings.plugin_guardrail_data,
})
# Plugin: Decoder
filepath_decoder = PATH_DECODER + "{}.c".format(