This repository has been archived by the owner on Mar 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#!/usr/bin/env python2 | ||
|
||
import requests | ||
import grequests | ||
import json | ||
import time | ||
|
||
interval = 1 | ||
url = 'https://10.10.10.5' | ||
|
||
verify = False | ||
|
||
endpoints = [ | ||
'/index.php?p=game', | ||
'/index.php?p=scoreboard&modal=scoreboard', | ||
'/data/scores.php', | ||
'/data/configuration.php', | ||
'/data/country-data.php', | ||
'/data/map-data.php', | ||
'/data/teams.php', | ||
'/data/command-line.php', | ||
'/inc/gameboard/modules/announcements.php', | ||
'/inc/gameboard/modules/filter.php', | ||
'/inc/gameboard/modules/activity.php', | ||
'/inc/gameboard/modules/teams.php', | ||
'/inc/gameboard/modules/leaderboard.php', | ||
'/inc/gameboard/modules/game-clock.php', | ||
] | ||
|
||
def check_ok(r, *args, **kwargs): | ||
if r.status_code != 200: | ||
print '[!] Received bad status code: ' + r.status_code | ||
|
||
def exception(r, e): | ||
print '[!] Request failed: ' + str(e) | ||
|
||
def login(): | ||
s = requests.Session() | ||
uri = url + '/index.php?ajax=true' | ||
data = { | ||
'action': 'login_team', | ||
'team_id': '1', | ||
'teamname': 'admin', | ||
'password': 'password', | ||
} | ||
r = s.post(uri, data=data, verify=verify) | ||
res = json.loads(r.content) | ||
if res['result'] == 'OK': | ||
print '[+] Logged in successfully' | ||
else: | ||
print '[!] Log in failed, exiting' | ||
exit(1) | ||
|
||
return s | ||
|
||
def main(): | ||
s = login() | ||
|
||
rs = [grequests.get(url + endpoint, callback=check_ok, session=s, verify=verify) | ||
for endpoint in endpoints] | ||
while True: | ||
print '[+] Sending %d requests...' % len(rs) | ||
start_time = time.time() | ||
grequests.map(rs) | ||
duration = time.time() - start_time | ||
print '[+] done in %d seconds' % duration | ||
time.sleep(interval) | ||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
CSRF_TOKEN=$1 | ||
SESSION=$2 | ||
FLAG=${3:-a} | ||
LEVEL_ID=${4:-1} | ||
|
||
for i in {0..10}; do | ||
curl 'https://10.10.10.5/index.php?p=game&ajax=true' -H "Cookie: Leaderboard=close; Announcements=close; Activity=close; Teams=close; Filter=close; Game Clock=close; FBCTF=$SESSION" -H 'Origin: https://10.10.10.5' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.8,en-GB;q=0.6' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Accept: */*' -H 'Connection: keep-alive' --data "action=answer_level&level_id=$LEVEL_ID&answer=$FLAG&csrf_token=$CSRF_TOKEN" --compressed --insecure & | ||
done |