diff --git a/tavern/tomes/process_info/main.eldritch b/tavern/tomes/process_info/main.eldritch new file mode 100644 index 000000000..94e90ed2c --- /dev/null +++ b/tavern/tomes/process_info/main.eldritch @@ -0,0 +1,17 @@ +def process_info(pid): + info = process.info(sys.get_pid() if pid == -1 else pid) + for key, value in info.items(): + if key == "cmd": + print("cmd_args=\n") + for nested_value in value.split(" "): + print("\t- {}\n".format(nested_value)) + elif key == "environ": + print("env_variables=\n") + for nested_value in value.split(","): + print("\t- {}\n".format(nested_value)) + else: + print("{}={}\n".format(key, value)) + +process_info(int(input_params['pid'])) +print("\n") +print("\n") diff --git a/tavern/tomes/process_info/metadata.yml b/tavern/tomes/process_info/metadata.yml new file mode 100644 index 000000000..3f6bedeec --- /dev/null +++ b/tavern/tomes/process_info/metadata.yml @@ -0,0 +1,10 @@ +name: Process info +description: Get information about process with specified PID or -1 for current process +author: Alextibtab +support_model: FIRST_PARTY +tactic: DISCOVERY +paramdefs: +- name: pid + label: Process ID + type: int + placeholder: process id eg. 245