-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathmain.py
40 lines (31 loc) · 1.1 KB
/
main.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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import requests, sys, re
from bs4 import BeautifulSoup
session = requests.Session()
def exploit_rce():
print ("(+) RCE: Reverse shell spawned....")
def auth_bypass(target_ip):
"""
url = 'http://%s/path' % target_ip
body = {'parameter1': 'value1',
'parameter2': 'value2'
}
session.get(target) #GET Request
session.post(url, data = body) #POST Request
#Parse response based on string match, check Skeleton Function/parse_response for more examples
s = BeautifulSoup(r.text, 'lxml')
authenticated_string = re.search("Welcome to dashboard", s.text)
if authenticated_string:
return "Authenticated"
return "Unable to authenticate"
"""
def main():
if len(sys.argv) != 4:
print ("(+) usage: %s <target ip> <nc ip> <nc port>" % sys.argv[0])
print ('(+) eg: %s 192.168.121.103' % sys.argv[0])
sys.exit(-1)
print ("(+) Auth Bypass: Exploiting XYZ vulnerability....")
auth_bypass(sys.argv[1])
print ("(+) RCE: Exploiting XYZ vulnerability....")
exploit_rce()
if __name__ == "__main__":
main()