Teamserver {
    Host = "0.0.0.0"
    Port = {{ havoc_teamserver_port | default(40056) }}
    
    Build {
        Compiler64 = "/usr/bin/x86_64-w64-mingw32-gcc"
        Compiler86 = "/usr/bin/x86_64-w64-mingw32-gcc"
        Nasm = "/usr/bin/nasm"
    }
}

Operators {
    user "{{ havoc_admin_user | default('admin') }}" {
        Password = "{{ havoc_admin_password | default(lookup('password', '/dev/null chars=ascii_letters,digits length=24')) }}"
    }
    {% if havoc_operators is defined %}
    {% for operator in havoc_operators %}
    user "{{ operator.name }}" {
        Password = "{{ operator.password }}"
    }
    {% endfor %}
    {% endif %}
}

Listeners {
    Http {
        Name = "https"
        Hosts = [
            "{{ redirector_subdomain }}.{{ domain }}"
        ]
        HostBind = "0.0.0.0"
        HostRotation = "round-robin"
        PortBind = {{ havoc_https_port | default(9443) }}
        PortConn = {{ havoc_https_port | default(9443) }}
        UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36"
        Headers = [
            "Accept: */*",
            "Accept-Language: en-US,en;q=0.9"
        ]
        Uris = [
            "/api/v2",
            "/content",
            "/static/css",
            "/wp-content/plugins"
        ]
        Response {
            Headers = [
                "Content-Type: application/json",
                "Cache-Control: no-store, private",
                "X-Content-Type-Options: nosniff"
            ]
        }
        Secure = true
        
        Cert {
            Cert = "/etc/letsencrypt/live/{{ domain }}/fullchain.pem"
            Key = "/etc/letsencrypt/live/{{ domain }}/privkey.pem"
        }
    }
}

Demon {
    Sleep = {{ havoc_sleep | default(5) }}
    Jitter = {{ havoc_jitter | default(30) }}
    
    Injection {
        {% if havoc_spawn64 is defined %}
        Spawn64 = "{{ havoc_spawn64 }}"
        {% else %}
        Spawn64 = "C:\\Windows\\System32\\dllhost.exe"
        {% endif %}
        
        {% if havoc_spawn32 is defined %}
        Spawn32 = "{{ havoc_spawn32 }}"
        {% else %}
        Spawn32 = "C:\\Windows\\SysWOW64\\dllhost.exe"
        {% endif %}
    }
}