aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorheqnx <root@heqnx.com>2025-05-25 08:33:41 +0300
committerheqnx <root@heqnx.com>2025-05-25 08:33:41 +0300
commit1f073d1d2114bcb66baadaa6bfa15ab8a27faa59 (patch)
treea9cab4d78cd24dfaed26f9677a382f94a1927f3f
parent56b09942c04c191b7581a26e1375226d40709a34 (diff)
downloadansible-playbooks-1f073d1d2114bcb66baadaa6bfa15ab8a27faa59.tar.gz
ansible-playbooks-1f073d1d2114bcb66baadaa6bfa15ab8a27faa59.zip
added different home dir for sliver
-rw-r--r--sliver-c2/handlers/main.yaml2
-rw-r--r--sliver-c2/tasks/sliver_configure.yaml9
-rw-r--r--sliver-c2/templates/sliver.service.j21
3 files changed, 6 insertions, 6 deletions
diff --git a/sliver-c2/handlers/main.yaml b/sliver-c2/handlers/main.yaml
index a6c8d49..0987034 100644
--- a/sliver-c2/handlers/main.yaml
+++ b/sliver-c2/handlers/main.yaml
@@ -4,7 +4,7 @@
- name: reload fail2ban
command: fail2ban-client reload
-- name: reload systemd daemon
+- name: reload systemd
command: systemctl daemon-reload
when: ansible_facts['service_mgr'] == 'systemd'
diff --git a/sliver-c2/tasks/sliver_configure.yaml b/sliver-c2/tasks/sliver_configure.yaml
index 68d2ba4..bf4797e 100644
--- a/sliver-c2/tasks/sliver_configure.yaml
+++ b/sliver-c2/tasks/sliver_configure.yaml
@@ -1,6 +1,6 @@
- name: ensure .sliver config directory exists
file:
- path: /root/.sliver/configs
+ path: "{{ install_path }}/.sliver/configs"
state: directory
owner: root
group: root
@@ -9,7 +9,7 @@
- name: deploy custom server.json config
template:
src: server.json.j2
- dest: /root/.sliver/configs/server.json
+ dest: "{{ install_path }}/.sliver/configs/server.json"
owner: root
group: root
mode: '0600'
@@ -17,7 +17,7 @@
- name: ensure sliver client config directory exists
file:
- path: /root/.sliver-client/configs
+ path: "{{ install_path }}/.sliver-client/configs"
state: directory
owner: root
group: root
@@ -27,8 +27,7 @@
loop: "{{ sliver_operators }}"
loop_control:
loop_var: operator
- command: >
- /opt/sliver/sliver-server operator --name {{ operator }} --lhost {{ sliver_server }} --save /root/.sliver-client/configs
+ command: /opt/sliver/sliver-server operator --name {{ operator }} --lhost {{ sliver_server }} --save /root/.sliver-client/configs
notify: sliver systemd handler
- name: fix permissions for .sliver-client directory
diff --git a/sliver-c2/templates/sliver.service.j2 b/sliver-c2/templates/sliver.service.j2
index 11cc2bd..c45687d 100644
--- a/sliver-c2/templates/sliver.service.j2
+++ b/sliver-c2/templates/sliver.service.j2
@@ -8,6 +8,7 @@ Type=simple
Restart=on-failure
RestartSec=3
User=root
+Environment=SLIVER_ROOT_DIR={{ install_path }}/.sliver
ExecStart={{ install_path }}/sliver-server daemon
[Install]