This commit is contained in:
n0mad1k
2025-04-09 15:22:21 -04:00
commit 241668a84d
23 changed files with 5019 additions and 0 deletions
+410
View File
@@ -0,0 +1,410 @@
---
- name: Configure FlokiNET C2 server
hosts: c2
gather_facts: true
vars_files:
- vars.yaml
tasks:
- name: Install C2 framework and required packages
ansible.builtin.apt:
name:
- curl
- wget
- git
- python3-pip
- python3-virtualenv
- tmux
- nmap
- tcpdump
- hydra
- john
- hashcat
- sqlmap
- gobuster
- dirb
- enum4linux
- dnsenum
- seclists
- responder
- golang
- proxychains
- tor
- jq
- unzip
- postfix
- certbot
- opendkim
- opendkim-tools
- dovecot-core
- dovecot-imapd
- dovecot-pop3d
- dovecot-sieve
- dovecot-managesieved
- yq
state: present
become: true
- name: Add UFW rules for C2 server (internal only)
ansible.builtin.ufw:
rule: allow
port: "{{ item.port }}"
proto: "{{ item.proto }}"
from_ip: "{{ redirector_ip }}"
with_items:
- { port: 8888, proto: tcp } # C2 HTTP listener
- { port: 50051, proto: tcp } # Sliver gRPC
- { port: 31337, proto: tcp } # Sliver console
- { port: 8443, proto: tcp } # Beacon server
become: true
- name: Create directories for C2 operation
ansible.builtin.file:
path: "{{ item }}"
state: directory
mode: '0700'
owner: root
group: root
with_items:
- /opt/c2
- /opt/beacons
- /opt/payloads
- /root/Tools
become: true
- name: Copy operational scripts for C2
ansible.builtin.copy:
src: "../files/{{ item }}"
dest: "/opt/c2/{{ item }}"
mode: '0700'
owner: root
group: root
with_items:
- clean-logs.sh
- secure-exit.sh
- serve-beacons.sh
become: true
# Tool Installation
- name: Ensure pipx path is configured
ansible.builtin.shell: |
pipx ensurepath
become: true
args:
executable: /bin/bash
- name: Install tools via pipx
ansible.builtin.shell: |
export PATH=$PATH:/root/.local/bin
pipx ensurepath
pipx install git+https://github.com/Pennyw0rth/NetExec
pipx install git+https://github.com/blacklanternsecurity/TREVORspray
pipx install impacket
become: true
args:
executable: /bin/bash
- name: Download Kerbrute
ansible.builtin.shell: |
mkdir -p /root/Tools/Kerbrute
wget https://github.com/ropnop/kerbrute/releases/latest/download/kerbrute_linux_amd64 -O /root/Tools/Kerbrute/kerbrute
chmod +x /root/Tools/Kerbrute/kerbrute
become: true
args:
executable: /bin/bash
- name: Clone SharpCollection nightly builds
ansible.builtin.git:
repo: https://github.com/Flangvik/SharpCollection.git
dest: /root/Tools/SharpCollection
version: master
become: true
- name: Clone PEASS-ng
ansible.builtin.git:
repo: https://github.com/carlospolop/PEASS-ng.git
dest: /root/Tools/PEASS-ng
become: true
- name: Clone MailSniper
ansible.builtin.git:
repo: https://github.com/dafthack/MailSniper.git
dest: /root/Tools/MailSniper
become: true
- name: Clone Inveigh
ansible.builtin.git:
repo: https://github.com/Kevin-Robertson/Inveigh.git
dest: /root/Tools/Inveigh
become: true
# C2 Framework Installation
- name: Install Sliver C2 framework
ansible.builtin.shell: |
curl https://sliver.sh/install | bash
args:
creates: /usr/local/bin/sliver-server
become: true
- name: Configure Sliver service
ansible.builtin.template:
src: templates/sliver-server.service.j2
dest: /etc/systemd/system/sliver.service
owner: root
group: root
mode: '0644'
become: true
- name: Start and enable Sliver service
ansible.builtin.systemd:
name: sliver
state: started
enabled: yes
daemon_reload: yes
become: true
- name: Install Metasploit Framework
ansible.builtin.shell: |
curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > /tmp/msfinstall
chmod 755 /tmp/msfinstall
/tmp/msfinstall
rm /tmp/msfinstall
args:
creates: /opt/metasploit-framework/bin/msfconsole
become: true
# GoPhish Installation
- name: Grab GoPhish
ansible.builtin.shell: |
curl -L "$(curl -s https://api.github.com/repos/gophish/gophish/releases/latest | jq -r '.assets[] | select(.browser_download_url | contains("linux-64bit.zip")) | .browser_download_url')" -O /root/Tools/gophish.zip
unzip /root/Tools/gophish.zip -d /root/Tools/gophish
rm -rf /root/Tools/gophish.zip
chmod +x /root/Tools/gophish/gophish
become: true
args:
executable: /bin/bash
creates: /root/Tools/gophish/gophish
- name: Deploy Gophish config.json with custom admin port
ansible.builtin.template:
src: templates/gophish-config.j2
dest: /root/Tools/gophish/config.json
owner: root
group: root
mode: '0644'
become: true
vars:
gophish_admin_port: "{{ gophish_admin_port }}"
domain: "{{ domain }}"
# Mail Server Configuration
- name: Configure Postfix main.cf
ansible.builtin.lineinfile:
path: /etc/postfix/main.cf
regexp: "{{ item.regexp }}"
line: "{{ item.line }}"
with_items:
- { regexp: '^myhostname', line: "myhostname = mail.{{ domain }}" }
- { regexp: '^mydomain', line: "mydomain = {{ domain }}" }
- { regexp: '^myorigin', line: "myorigin = $mydomain" }
- { regexp: '^inet_interfaces', line: "inet_interfaces = all" }
- { regexp: '^inet_protocols', line: "inet_protocols = ipv4" }
- { regexp: '^smtpd_banner', line: "smtpd_banner = $myhostname ESMTP $mail_name" }
- { regexp: '^mynetworks', line: "mynetworks = 127.0.0.0/8 [::1]/128" }
- { regexp: '^relay_domains', line: "relay_domains = $mydestination" }
- { regexp: '^smtpd_tls_cert_file', line: "smtpd_tls_cert_file = /etc/letsencrypt/live/{{ domain }}/fullchain.pem" }
- { regexp: '^smtpd_tls_key_file', line: "smtpd_tls_key_file = /etc/letsencrypt/live/{{ domain }}/privkey.pem" }
- { regexp: '^smtpd_tls_security_level', line: "smtpd_tls_security_level = encrypt" }
- { regexp: '^smtpd_tls_session_cache_database', line: "smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache" }
- { regexp: '^smtp_tls_session_cache_database', line: "smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache" }
- { regexp: '^smtpd_use_tls', line: "smtpd_use_tls = yes" }
- { regexp: '^smtpd_tls_auth_only', line: "smtpd_tls_auth_only = yes" }
- { regexp: '^milter_default_action', line: "milter_default_action = accept" }
- { regexp: '^milter_protocol', line: "milter_protocol = 6" }
- { regexp: '^smtpd_milters', line: "smtpd_milters = unix:/var/spool/postfix/opendkim/opendkim.sock" }
- { regexp: '^non_smtpd_milters', line: "non_smtpd_milters = unix:/var/spool/postfix/opendkim/opendkim.sock" }
become: true
- name: Configure OpenDKIM
ansible.builtin.lineinfile:
path: /etc/opendkim.conf
regexp: "{{ item.regexp }}"
line: "{{ item.line }}"
with_items:
- { regexp: '^Domain', line: "Domain {{ domain }}" }
- { regexp: '^KeyFile', line: "KeyFile /etc/opendkim/keys/{{ domain }}/mail.private" }
- { regexp: '^Selector', line: "Selector mail" }
- { regexp: '^Socket', line: "Socket local:/var/spool/postfix/opendkim/opendkim.sock" }
- { regexp: '^Syslog', line: "Syslog yes" }
- { regexp: '^UMask', line: "UMask 002" }
- { regexp: '^Mode', line: "Mode sv" }
become: true
- name: Create DKIM directory
ansible.builtin.file:
path: /etc/opendkim/keys/{{ domain }}
state: directory
owner: opendkim
group: opendkim
mode: 0700
become: true
- name: Generate DKIM keys
ansible.builtin.command: >
opendkim-genkey -D /etc/opendkim/keys/{{ domain }} -d {{ domain }} -s mail
args:
creates: /etc/opendkim/keys/{{ domain }}/mail.private
become: true
- name: Set permissions for DKIM keys
ansible.builtin.file:
path: /etc/opendkim/keys/{{ domain }}/mail.private
owner: opendkim
group: opendkim
mode: 0600
become: true
- name: Configure OpenDKIM TrustedHosts
ansible.builtin.copy:
content: |
127.0.0.1
::1
localhost
{{ domain }}
dest: /etc/opendkim/TrustedHosts
owner: opendkim
group: opendkim
mode: 0644
become: true
- name: Enable submission port (587) in master.cf
ansible.builtin.blockinfile:
path: /etc/postfix/master.cf
insertafter: '^#submission'
block: |
submission inet n - y - - smtpd
-o syslog_name=postfix/submission
-o smtpd_tls_security_level=encrypt
-o smtpd_sasl_auth_enable=yes
-o smtpd_recipient_restrictions=permit_sasl_authenticated,reject
-o smtpd_relay_restrictions=permit_sasl_authenticated,reject
become: true
- name: Configure Dovecot for Postfix SASL
ansible.builtin.blockinfile:
path: /etc/dovecot/conf.d/10-master.conf
insertafter: '^service auth {'
block: |
# Postfix smtp-auth
unix_listener /var/spool/postfix/private/auth {
mode = 0660
user = postfix
group = postfix
}
become: true
- name: Set Dovecot auth_mechanisms
ansible.builtin.lineinfile:
path: /etc/dovecot/conf.d/10-auth.conf
regexp: '^auth_mechanisms'
line: 'auth_mechanisms = plain login'
become: true
- name: Create Dovecot password file for SASL authentication
ansible.builtin.file:
path: /etc/dovecot/passwd
state: touch
mode: '0600'
owner: dovecot
group: dovecot
become: true
- name: Add SMTP auth user to Dovecot
ansible.builtin.lineinfile:
path: /etc/dovecot/passwd
line: "{{ smtp_auth_user }}:{{ smtp_auth_pass | password_hash('sha512_crypt') }}"
become: true
- name: Disable system auth and use passwd-file
ansible.builtin.lineinfile:
path: /etc/dovecot/conf.d/10-auth.conf
regexp: '^!include auth-system.conf.ext'
line: '#!include auth-system.conf.ext'
become: true
- name: Add auth-passwdfile configuration
ansible.builtin.blockinfile:
path: /etc/dovecot/conf.d/10-auth.conf
insertafter: '^auth_mechanisms ='
block: |
passdb {
driver = passwd-file
args = scheme=sha512_crypt /etc/dovecot/passwd
}
userdb {
driver = static
args = uid=vmail gid=vmail home=/var/vmail/%u
}
become: true
- name: Create vmail group
ansible.builtin.group:
name: vmail
gid: 5000
state: present
become: true
- name: Create vmail user
ansible.builtin.user:
name: vmail
uid: 5000
group: vmail
create_home: no
become: true
- name: Restart Postfix
ansible.builtin.service:
name: postfix
state: restarted
become: true
- name: Restart Dovecot
ansible.builtin.service:
name: dovecot
state: restarted
become: true
# Beacon Server Configuration
- name: Configure beacon server
ansible.builtin.shell: |
sed -i "s/C2_HOST=.*$/C2_HOST=\"{{ c2_ip }}\"/g" /opt/c2/serve-beacons.sh
chmod +x /opt/c2/serve-beacons.sh
nohup /opt/c2/serve-beacons.sh > /dev/null 2>&1 &
become: true
# Set up cron job for log cleaning
- name: Set up cron job for log cleaning
ansible.builtin.cron:
name: "Clean logs"
minute: "0"
hour: "*/6"
job: "/opt/c2/clean-logs.sh > /dev/null 2>&1"
become: true
when: zero_logs|bool
# Install Let's Encrypt certificate if domain specified
- name: Install Let's Encrypt certificate
ansible.builtin.command: >
certbot certonly --standalone -d {{ c2_subdomain }}.{{ domain }} --non-interactive --agree-tos -m {{ letsencrypt_email }}
args:
creates: /etc/letsencrypt/live/{{ c2_subdomain }}.{{ domain }}/fullchain.pem
become: true
when: domain != "example.com"
- name: Display C2 server setup information
ansible.builtin.debug:
msg:
- "C2 server setup completed!"
- "IP Address: {{ ansible_host }}"
- "Domain: {{ c2_subdomain }}.{{ domain }}"
- "Sliver C2 listening on port 8888"
- "Beacons server available at http://{{ ansible_host }}:8443/"
+134
View File
@@ -0,0 +1,134 @@
---
- name: Common provisioning for FlokiNET servers
hosts: all
gather_facts: true
vars_files:
- vars.yaml
tasks:
- name: Set hostname
ansible.builtin.hostname:
name: "{{ inventory_hostname }}"
become: true
- name: Update apt cache
ansible.builtin.apt:
update_cache: yes
become: true
- name: Upgrade all packages
ansible.builtin.apt:
upgrade: dist
become: true
- name: Install base security packages
ansible.builtin.apt:
name:
- apt-transport-https
- ca-certificates
- curl
- gnupg
- lsb-release
- unattended-upgrades
- ufw
- fail2ban
- secure-delete
state: present
become: true
- name: Configure UFW
ansible.builtin.ufw:
state: enabled
policy: deny
logging: 'on'
become: true
- name: Add SSH rule to UFW
ansible.builtin.ufw:
rule: allow
port: "{{ ssh_port }}"
proto: tcp
become: true
- name: Configure SSH for better security
ansible.builtin.lineinfile:
path: /etc/ssh/sshd_config
regexp: "{{ item.regexp }}"
line: "{{ item.line }}"
state: present
with_items:
- { regexp: '^#?PermitRootLogin', line: 'PermitRootLogin prohibit-password' }
- { regexp: '^#?PasswordAuthentication', line: 'PasswordAuthentication no' }
- { regexp: '^#?X11Forwarding', line: 'X11Forwarding no' }
- { regexp: '^#?AllowTcpForwarding', line: 'AllowTcpForwarding no' }
- { regexp: '^#?Port', line: 'Port {{ ssh_port }}' }
- { regexp: '^#?LogLevel', line: 'LogLevel ERROR' }
- { regexp: '^#?MaxAuthTries', line: 'MaxAuthTries 3' }
- { regexp: '^#?ClientAliveInterval', line: 'ClientAliveInterval 300' }
become: true
- name: Restart SSH service
ansible.builtin.service:
name: ssh
state: restarted
become: true
- name: Setup directory for operational scripts
ansible.builtin.file:
path: /opt/c2
state: directory
mode: '0700'
owner: root
group: root
become: true
- name: Copy operational scripts
ansible.builtin.copy:
src: "../files/{{ item }}"
dest: "/opt/c2/{{ item }}"
mode: '0700'
owner: root
group: root
with_items:
- clean-logs.sh
- secure-exit.sh
become: true
- name: Setup cron to clean logs
ansible.builtin.cron:
name: "Log cleanup"
minute: "*/{{ log_rotation_hours * 60 }}"
job: "/opt/c2/clean-logs.sh >/dev/null 2>&1"
become: true
when: disable_history | bool
- name: Disable system history
ansible.builtin.lineinfile:
path: "{{ item }}"
line: "{{ line_item }}"
state: present
create: yes
with_items:
- /etc/profile
- /root/.bashrc
with_nested:
- [ 'export HISTFILESIZE=0', 'export HISTSIZE=0', 'unset HISTFILE' ]
loop_control:
loop_var: line_item
become: true
when: disable_history | bool
- name: Set memory security measures
ansible.builtin.lineinfile:
path: /etc/sysctl.conf
line: "{{ item }}"
state: present
with_items:
- "vm.swappiness=0"
- "kernel.randomize_va_space=2"
become: true
when: secure_memory | bool
- name: Apply sysctl settings
ansible.builtin.command: sysctl -p
become: true
when: secure_memory | bool
+118
View File
@@ -0,0 +1,118 @@
---
- name: Configure FlokiNET redirector server
hosts: redirector
gather_facts: true
vars_files:
- vars.yaml
tasks:
- name: Install Nginx and required packages
ansible.builtin.apt:
name:
- nginx
- certbot
- python3-certbot-nginx
- socat
- netcat-openbsd
- cryptsetup
- secure-delete
- jq
state: present
become: true
- name: Add UFW rules for redirector
ansible.builtin.ufw:
rule: allow
port: "{{ item }}"
proto: tcp
with_items:
- 80
- 443
- "{{ shell_handler_port }}"
become: true
- name: Setup directory for shell handler
ansible.builtin.file:
path: /opt/shell-handler
state: directory
mode: '0700'
owner: root
group: root
become: true
- name: Copy shell handler script
ansible.builtin.copy:
src: "../files/persistent-listener.sh"
dest: "/opt/shell-handler/persistent-listener.sh"
mode: '0700'
owner: root
group: root
become: true
- name: Configure shell handler service
ansible.builtin.template:
src: templates/shell-handler.service.j2
dest: /etc/systemd/system/shell-handler.service
owner: root
group: root
mode: '0644'
become: true
- name: Configure NGINX for zero-logging
ansible.builtin.template:
src: templates/nginx.conf.j2
dest: /etc/nginx/nginx.conf
owner: root
group: root
mode: '0644'
become: true
- name: Configure NGINX default site for C2 redirection
ansible.builtin.template:
src: templates/default-site.j2
dest: /etc/nginx/sites-available/default
owner: root
group: root
mode: '0644'
vars:
domain: "{{ redirector_subdomain }}.{{ domain }}"
c2_host: "{{ c2_ip }}"
become: true
- name: Create index.html for legitimate-looking website
ansible.builtin.template:
src: templates/index.html.j2
dest: /var/www/html/index.html
owner: www-data
group: www-data
mode: '0644'
become: true
- name: Start and enable shell handler service
ansible.builtin.systemd:
name: shell-handler
state: started
enabled: yes
daemon_reload: yes
become: true
- name: Install Let's Encrypt certificate if domain specified
ansible.builtin.command: >
certbot --nginx -d {{ redirector_subdomain }}.{{ domain }} --non-interactive --agree-tos -m {{ letsencrypt_email }}
args:
creates: /etc/letsencrypt/live/{{ redirector_subdomain }}.{{ domain }}/fullchain.pem
become: true
when: domain != "example.com"
- name: Restart Nginx
ansible.builtin.service:
name: nginx
state: restarted
become: true
- name: Display redirector setup information
ansible.builtin.debug:
msg:
- "Redirector setup completed!"
- "IP Address: {{ ansible_host }}"
- "Domain: {{ redirector_subdomain }}.{{ domain }}"
- "Shell Handler Port: {{ shell_handler_port }}"
+80
View File
@@ -0,0 +1,80 @@
server {
listen 80;
listen [::]:80;
server_name {{ domain }};
# Redirect to HTTPS
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name {{ domain }};
# SSL Configuration
ssl_certificate /etc/letsencrypt/live/{{ domain }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{ domain }}/privkey.pem;
# Root directory
root /var/www/html;
index index.html;
# Primary location for legitimate website traffic
location / {
try_files $uri $uri/ =404;
}
# Special URI patterns for C2 traffic
# These will redirect to the actual C2 server
# Sliver HTTP C2 channel
location /ajax/ {
proxy_pass http://{{ c2_host }}:8888;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
# Static resources that actually redirect to C2
location ~ ^/static/(css|js|images)/.*\.(css|js|png|jpg|jpeg|gif|ico)$ {
proxy_pass http://{{ c2_host }}:8888;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
# Additional security headers
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header Referrer-Policy "no-referrer" always;
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data:;" always;
# Disable logging for this server block
access_log off;
error_log /dev/null crit;
}
# Catch-all server block to respond to unknown hosts
server {
listen 80 default_server;
listen [::]:80 default_server;
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
# Self-signed cert for catch-all
ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem;
ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;
# Redirect all unknown traffic to a legitimate-looking site
return 301 https://www.google.com;
# Disable logs
access_log off;
error_log /dev/null crit;
}
+23
View File
@@ -0,0 +1,23 @@
{
"admin_server": {
"listen_url": "0.0.0.0:{{ gophish_admin_port }}",
"use_tls": true,
"cert_path": "/etc/letsencrypt/live/{{ domain }}/fullchain.pem",
"key_path": "/etc/letsencrypt/live/{{ domain }}/privkey.pem",
"trusted_origins": []
},
"phish_server": {
"listen_url": "0.0.0.0:80",
"use_tls": false,
"cert_path": "/etc/letsencrypt/live/{{ domain }}/fullchain.pem",
"key_path": "/etc/letsencrypt/live/{{ domain }}/privkey.pem"
},
"db_name": "sqlite3",
"db_path": "gophish.db",
"migrations_prefix": "db/db_",
"contact_address": "",
"logging": {
"filename": "",
"level": ""
}
}
+122
View File
@@ -0,0 +1,122 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ redirector_subdomain }} - Content Delivery Network</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f4f4f4;
color: #333;
}
header {
background-color: #2c3e50;
color: white;
padding: 1em;
text-align: center;
}
.container {
width: 80%;
margin: 0 auto;
padding: 2em;
}
.card {
background-color: white;
border-radius: 5px;
padding: 1.5em;
margin-bottom: 1.5em;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.feature {
display: flex;
align-items: center;
margin-bottom: 1em;
}
.feature-icon {
background-color: #3498db;
color: white;
border-radius: 50%;
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 1em;
font-weight: bold;
}
footer {
background-color: #2c3e50;
color: white;
text-align: center;
padding: 1em;
position: fixed;
bottom: 0;
width: 100%;
}
.btn {
display: inline-block;
background-color: #3498db;
color: white;
padding: 0.7em 1.5em;
border-radius: 5px;
text-decoration: none;
font-weight: bold;
}
</style>
</head>
<body>
<header>
<h1>{{ redirector_subdomain }}.{{ domain }}</h1>
<p>Enterprise Content Delivery Network</p>
</header>
<div class="container">
<div class="card">
<h2>Welcome to Our CDN</h2>
<p>This server is part of our global content delivery network, optimizing digital asset delivery for enterprise applications. Our CDN provides fast, reliable, and secure content distribution across our global network.</p>
<p><em>This is a private service. Unauthorized access is prohibited.</em></p>
</div>
<div class="card">
<h2>Our Features</h2>
<div class="feature">
<div class="feature-icon">1</div>
<div>
<h3>Global Distribution</h3>
<p>Content cached and distributed across multiple geographic locations for minimum latency.</p>
</div>
</div>
<div class="feature">
<div class="feature-icon">2</div>
<div>
<h3>DDoS Protection</h3>
<p>Enterprise-grade protection against distributed denial of service attacks.</p>
</div>
</div>
<div class="feature">
<div class="feature-icon">3</div>
<div>
<h3>Asset Optimization</h3>
<p>Automatic compression and format optimization for images, scripts, and styles.</p>
</div>
</div>
</div>
<div class="card" style="text-align: center;">
<h2>Need Access?</h2>
<p>If you're a client requiring access to our CDN services, please contact your account representative.</p>
<a href="#" class="btn">Contact Sales</a>
</div>
</div>
<footer>
<p>&copy; 2025 {{ domain }} CDN Services. All rights reserved.</p>
</footer>
</body>
</html>
+43
View File
@@ -0,0 +1,43 @@
Welcome to your new C2 Server!
The following tools and utilities have been installed:
Apt-Installed Tools:
--------------------
- git, wget, curl, unzip
- python3-pip, python3-venv, pipx
- tmux, nmap, tcpdump, hydra, john, hashcat
- sqlmap, gobuster, dirb, enum4linux, dnsenum, seclists, responder
- golang, proxychains, tor, crackmapexec, jq, unzip
- postfix, certbot, opendkim, opendkim-tools
Pipx-Installed Tools:
---------------------
- NetExec: git+https://github.com/Pennyw0rth/NetExec
- TREVORspray: git+https://github.com/blacklanternsecurity/TREVORspray
- impacket: (various network protocols and service tools)
Custom Tools Installed in ~/Tools:
----------------------------------
- SharpCollection: /home/kali/Tools/SharpCollection
- Kerbrute: /home/kali/Tools/Kerbrute
- PEASS-ng: /home/kali/Tools/PEASS-ng
- MailSniper: /home/kali/Tools/MailSniper
- Inveigh: /home/kali/Tools/Inveigh
- Gophish: /home/kali/Tools/gophish (unzipped here)
Other Installed C2 Frameworks:
------------------------------
- Metasploit Framework: system installed (run 'msfconsole')
- Sliver C2: system installed (run 'sliver')
Also, remember that many reconnaissance and attack tools are now available system-wide due to the apt and pipx installations.
Once your DNS record points to this servers public IP, you can obtain a Lets Encrypt certificate by running:
sudo certbot certonly --non-interactive --agree-tos --email {{ letsencrypt_email }} --standalone -d {{ mail_hostname }}
sudo certbot certonly --non-interactive --agree-tos --email {{ letsencrypt_email }} --standalone -d {{ domain }}
**IMPORTANT:**
Dont forget to set up a DMARC record for your domain. Update your DNS providers dashboard (e.g., GoDaddy) to add a TXT record named `_dmarc` with a suitable DMARC policy (e.g., `v=DMARC1; p=reject; rua=mailto:admin@{{ domain }}; ruf=mailto:admin@{{ domain }}; pct=100`). This ensures better email deliverability and security for your domain.
+59
View File
@@ -0,0 +1,59 @@
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 1024;
multi_accept on;
}
http {
# Basic Settings
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
server_tokens off;
# MIME
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Zero-logs configuration
# This completely disables all access logs
access_log off;
# Minimal error logs - critical only
error_log /dev/null crit;
# SSL Settings
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256';
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off;
# Headers to confuse fingerprinting
# Microsoft-IIS/8.5 server header to throw off analysis
#more_set_headers 'Server: Microsoft-IIS/8.5';
add_header Server "Microsoft-IIS/8.5";
server_name_in_redirect off;
# OPSEC: Hide proxy headers
proxy_hide_header X-Powered-By;
proxy_hide_header X-AspNet-Version;
proxy_hide_header X-Runtime;
# IP Rotation and proxying
real_ip_header X-Forwarded-For;
set_real_ip_from 127.0.0.1;
# Gzip Settings
gzip off; # Disabled to avoid BREACH attack
# Virtual Host Configs
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
@@ -0,0 +1,27 @@
[Unit]
Description=Reverse Shell Handler Service
After=network.target
[Service]
Type=simple
User=root
Group=root
ExecStart=/opt/shell-handler/persistent-listener.sh
Restart=always
RestartSec=10
# Hide process information
PrivateTmp=true
ProtectSystem=full
NoNewPrivileges=true
# Make shell handler hard to find
StandardOutput=null
StandardError=null
# Environment variables
Environment="C2_HOST={{ c2_ip }}"
Environment="LISTEN_PORT={{ shell_handler_port }}"
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,24 @@
[Unit]
Description=Sliver C2 Server
After=network.target
[Service]
Type=simple
User=root
Group=root
WorkingDirectory=/root/.sliver
ExecStart=/usr/local/bin/sliver-server daemon
Restart=always
RestartSec=10
# Security measures
PrivateTmp=true
ProtectHome=false
NoNewPrivileges=true
# Hide process information
StandardOutput=null
StandardError=null
[Install]
WantedBy=multi-user.target