Added python cat alias

readme-wiki
xorrior 2017-11-30 07:14:27 -08:00
parent 6ddba3f0ee
commit d678ea7333
1 changed files with 22 additions and 0 deletions

View File

@ -2777,6 +2777,28 @@ class PythonAgentMenu(SubMenu):
else: else:
print helpers.color("[!] python/management/osx/ls_m module not loaded") print helpers.color("[!] python/management/osx/ls_m module not loaded")
def do_cat(self, line):
"View the contents of a file"
if line != "":
cmd = """
try:
output = ""
with open("%s","r") as f:
for line in f:
output += line
print output
except Exception as e:
print str(e)
""" % (line)
# task the agent with this shell command
self.mainMenu.agents.add_agent_task_db(self.sessionID, "TASK_CMD_WAIT", str(cmd))
# update the agent log
msg = "Tasked agent to cat file %s" % (line)
self.mainMenu.agents.save_agent_log(self.sessionID, msg)
def do_whoami(self, line): def do_whoami(self, line):
"Print the currently logged in user" "Print the currently logged in user"