getting the c2 running

This commit is contained in:
n0mad1k
2025-04-24 14:52:50 -04:00
parent 2a8502a30c
commit 9f49b52ff6
+18 -106
View File
@@ -8,39 +8,26 @@ Teamserver {
Compiler64 = "/usr/bin/x86_64-w64-mingw32-gcc" Compiler64 = "/usr/bin/x86_64-w64-mingw32-gcc"
Compiler86 = "/usr/bin/i686-w64-mingw32-gcc" Compiler86 = "/usr/bin/i686-w64-mingw32-gcc"
Nasm = "/usr/bin/nasm" Nasm = "/usr/bin/nasm"
{% if havoc_compiler_flags is defined %}
CompilerFlags = "{{ havoc_compiler_flags }}"
{% else %}
CompilerFlags = "-Os -fno-asynchronous-unwind-tables -fno-ident -fpack-struct=8 -ffunction-sections"
{% endif %}
} }
} }
Operators { Operators {
{{ havoc_admin_user | default('admin') }} { user "{{ havoc_admin_user | default('admin') }}" {
Password = "{{ havoc_admin_password | default(lookup('password', '/dev/null chars=ascii_letters,digits length=24')) }}" Password = "{{ havoc_admin_password | default(lookup('password', '/dev/null chars=ascii_letters,digits length=24')) }}"
{% if havoc_auth_secret is defined %} Secret = "{{ havoc_auth_secret | default(lookup('password', '/dev/null chars=hex_lower length=32')) }}"
Secret = "{{ havoc_auth_secret }}"
{% else %}
Secret = "{{ lookup('password', '/dev/null chars=hex_lower length=32') }}"
{% endif %}
} }
{% if havoc_operators is defined %} {% if havoc_operators is defined %}
{% for operator in havoc_operators %} {% for operator in havoc_operators %}
{{ operator.name }} { user "{{ operator.name }}" {
Password = "{{ operator.password }}" Password = "{{ operator.password }}"
{% if operator.secret is defined %} Secret = "{{ operator.secret | default(lookup('password', '/dev/null chars=hex_lower length=32')) }}"
Secret = "{{ operator.secret }}"
{% else %}
Secret = "{{ lookup('password', '/dev/null chars=hex_lower length=32') }}"
{% endif %}
} }
{% endfor %} {% endfor %}
{% endif %} {% endif %}
} }
Listeners { Listeners {
http { Http {
Name = "http" Name = "http"
KillDate = "{{ havoc_killdate | default('2030-01-01') }}" KillDate = "{{ havoc_killdate | default('2030-01-01') }}"
WorkingHours = "{{ havoc_working_hours | default('0:00-23:59') }}" WorkingHours = "{{ havoc_working_hours | default('0:00-23:59') }}"
@@ -55,12 +42,11 @@ Listeners {
{% endif %} {% endif %}
HostBind = "0.0.0.0" HostBind = "0.0.0.0"
HostRotation = "{{ havoc_host_rotation | default('round-robin') }}" HostRotation = "{{ havoc_host_rotation | default('round-robin') }}"
Port = {{ havoc_http_port | default(8080) }}
PortBind = {{ havoc_http_port | default(8080) }} PortBind = {{ havoc_http_port | default(8080) }}
{% if havoc_user_agent is defined %} {% if havoc_user_agent is defined %}
UserAgent = "{{ havoc_user_agent }}" UserAgent = "{{ havoc_user_agent }}"
{% else %} {% else %}
UserAgent = "Mozilla/5.0 (Windows NT 10.{{ random_hex[0] | int }}.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/{{ random_hex[1] | int + 80 }}.0.{{ random_hex[2:4] | int }}.{{ random_hex[4:6] | int }} Safari/537.36" UserAgent = "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:{{ random_hex[1] | int + 90 }}.0) Gecko/20100101 Firefox/{{ random_hex[2] | int + 95 }}.0"
{% endif %} {% endif %}
Headers = [ Headers = [
{% if havoc_http_headers is defined %} {% if havoc_http_headers is defined %}
@@ -87,7 +73,7 @@ Listeners {
] ]
Secure = false Secure = false
{% if havoc_proxy_enabled | default(false) %} {% if havoc_proxy_enabled | default(false) %}
Proxy = { Proxy {
Host = "{{ havoc_proxy_host }}" Host = "{{ havoc_proxy_host }}"
Port = {{ havoc_proxy_port }} Port = {{ havoc_proxy_port }}
Username = "{{ havoc_proxy_username | default('') }}" Username = "{{ havoc_proxy_username | default('') }}"
@@ -96,7 +82,7 @@ Listeners {
{% endif %} {% endif %}
} }
https { Http {
Name = "https" Name = "https"
KillDate = "{{ havoc_killdate | default('2030-01-01') }}" KillDate = "{{ havoc_killdate | default('2030-01-01') }}"
WorkingHours = "{{ havoc_working_hours | default('0:00-23:59') }}" WorkingHours = "{{ havoc_working_hours | default('0:00-23:59') }}"
@@ -111,12 +97,11 @@ Listeners {
{% endif %} {% endif %}
HostBind = "0.0.0.0" HostBind = "0.0.0.0"
HostRotation = "{{ havoc_host_rotation | default('round-robin') }}" HostRotation = "{{ havoc_host_rotation | default('round-robin') }}"
Port = {{ havoc_https_port | default(443) }}
PortBind = {{ havoc_https_port | default(443) }} PortBind = {{ havoc_https_port | default(443) }}
{% if havoc_user_agent is defined %} {% if havoc_user_agent is defined %}
UserAgent = "{{ havoc_user_agent }}" UserAgent = "{{ havoc_user_agent }}"
{% else %} {% else %}
UserAgent = "Mozilla/5.0 (Windows NT 10.{{ random_hex[0] | int }}.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/{{ random_hex[1] | int + 80 }}.0.{{ random_hex[2:4] | int }}.{{ random_hex[4:6] | int }} Safari/537.36" UserAgent = "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:{{ random_hex[1] | int + 90 }}.0) Gecko/20100101 Firefox/{{ random_hex[2] | int + 95 }}.0"
{% endif %} {% endif %}
Headers = [ Headers = [
{% if havoc_https_headers is defined %} {% if havoc_https_headers is defined %}
@@ -142,10 +127,14 @@ Listeners {
{% endif %} {% endif %}
] ]
Secure = true Secure = true
Cert {
Cert = "{{ havoc_cert_path | default('/root/Tools/havoc/data/certs/havoc.crt') }}" Cert = "{{ havoc_cert_path | default('/root/Tools/havoc/data/certs/havoc.crt') }}"
Key = "{{ havoc_key_path | default('/root/Tools/havoc/data/certs/havoc.key') }}" Key = "{{ havoc_key_path | default('/root/Tools/havoc/data/certs/havoc.key') }}"
}
{% if havoc_proxy_enabled | default(false) %} {% if havoc_proxy_enabled | default(false) %}
Proxy = { Proxy {
Host = "{{ havoc_proxy_host }}" Host = "{{ havoc_proxy_host }}"
Port = {{ havoc_proxy_port }} Port = {{ havoc_proxy_port }}
Username = "{{ havoc_proxy_username | default('') }}" Username = "{{ havoc_proxy_username | default('') }}"
@@ -155,81 +144,28 @@ Listeners {
} }
{% if havoc_smb_enabled | default(false) %} {% if havoc_smb_enabled | default(false) %}
smb { Smb {
Name = "smb" Name = "smb"
PipeName = "{{ havoc_smb_pipename | default('havoc-' ~ random_hex[0:6]) }}" PipeName = "{{ havoc_smb_pipename | default('havoc-' ~ random_hex[0:6]) }}"
} }
{% endif %} {% endif %}
{% if havoc_external_enabled | default(false) %}
external {
Name = "external"
KillDate = "{{ havoc_external_killdate | default('2030-01-01') }}"
WorkingHours = "{{ havoc_external_hours | default('0:00-23:59') }}"
Endpoint = "{{ havoc_external_endpoint }}"
}
{% endif %}
{% if havoc_additional_listeners is defined %}
{% for listener in havoc_additional_listeners %}
{{ listener.name }} {
{% for key, value in listener.config.items() %}
{{ key }} = {% if value is string %}"{{ value }}"{% else %}{{ value }}{% endif %}
{% endfor %}
}
{% endfor %}
{% endif %}
} }
Demon { Demon {
Sleep = {{ havoc_sleep | default(random_hex[0:2] | int % 5 + 2) }} Sleep = {{ havoc_sleep | default(random_hex[0:2] | int % 5 + 2) }}
SleepJitter = {{ havoc_jitter | default(random_hex[2:4] | int % 30 + 20) }} Jitter = {{ havoc_jitter | default(random_hex[2:4] | int % 30 + 20) }}
Injection = {{ havoc_injection_method | default(random_hex[4] | int % 3) }}
IndirectSyscalls = {{ havoc_indirect_syscalls | default(true) | lower }}
Injection { Injection {
{% if havoc_spawn64 is defined %} {% if havoc_spawn64 is defined %}
Spawn64 = "{{ havoc_spawn64 }}" Spawn64 = "{{ havoc_spawn64 }}"
{% else %} {% else %}
{% set process_list = [ Spawn64 = "C:\\Windows\\System32\\dllhost.exe"
"C:\\Windows\\System32\\notepad.exe",
"C:\\Windows\\System32\\RuntimeBroker.exe",
"C:\\Windows\\System32\\dllhost.exe",
"C:\\Windows\\System32\\smartscreen.exe",
"C:\\Windows\\System32\\ctfmon.exe",
"C:\\Windows\\System32\\sihost.exe",
"C:\\Windows\\System32\\taskhostw.exe"
] %}
Spawn64 = "{{ process_list[random_hex[5] | int % process_list|length] }}"
{% endif %} {% endif %}
{% if havoc_spawn32 is defined %} {% if havoc_spawn32 is defined %}
Spawn32 = "{{ havoc_spawn32 }}" Spawn32 = "{{ havoc_spawn32 }}"
{% else %} {% else %}
{% set process32_list = [ Spawn32 = "C:\\Windows\\SysWOW64\\dllhost.exe"
"C:\\Windows\\SysWOW64\\notepad.exe",
"C:\\Windows\\SysWOW64\\dllhost.exe",
"C:\\Windows\\SysWOW64\\ctfmon.exe"
] %}
Spawn32 = "{{ process32_list[random_hex[6] | int % process32_list|length] }}"
{% endif %}
{% if havoc_allocation_method is defined %}
AllocationMethod = {{ havoc_allocation_method }}
{% else %}
AllocationMethod = {{ random_hex[7] | int % 3 }}
{% endif %}
{% if havoc_execution_method is defined %}
ExecutionMethod = {{ havoc_execution_method }}
{% else %}
ExecutionMethod = {{ random_hex[3] | int % 2 }}
{% endif %}
{% if havoc_execution_options is defined %}
ExecuteOptions = {{ havoc_execution_options }}
{% else %}
ExecuteOptions = 1
{% endif %} {% endif %}
} }
@@ -247,28 +183,4 @@ Demon {
{% endif %} {% endif %}
} }
{% endif %} {% endif %}
{% if havoc_masking_enabled | default(true) %}
Masking {
HeapType = {{ random_hex[1] | int % 2 }}
SleepMaskTechnique = {{ random_hex[2] | int % 4 }}
}
{% endif %}
{% if havoc_binary_signing_enabled | default(false) %}
Binary {
SignTemplate = {
Name = "{{ havoc_sign_template_name | default('MicrosoftLLC') }}"
{% if havoc_sign_template_extra_options is defined %}
Options = {
{% for key, value in havoc_sign_template_extra_options.items() %}
{{ key }} = "{{ value }}"
{% endfor %}
}
{% endif %}
}
}
{% endif %}
{{ havoc_additional_options | default('') }}
} }