-
Notifications
You must be signed in to change notification settings - Fork 477
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
18 changed files
with
1,393 additions
and
6 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
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,18 @@ | ||
#!/usr/bin/python | ||
# coding: utf-8 | ||
|
||
import sys, json | ||
from rq import Queue | ||
from redis import Redis | ||
from base64 import b64decode | ||
|
||
import bot | ||
|
||
try: | ||
with open('/bot/config.json', 'r') as fp: | ||
REDIS_PASSWORD = json.load(fp)['password'] | ||
q = Queue(connection=Redis(password=REDIS_PASSWORD)) | ||
q.enqueue(bot.add, b64decode(sys.argv[1])) | ||
print 'Done! Please waiting for the admin :)' | ||
except Exception as e: | ||
print 'Error[%s] Please contact admin' % e.message |
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,38 @@ | ||
#!/usr/bin/python | ||
# coding: utf-8 | ||
|
||
from selenium import webdriver | ||
import time, sys, json, selenium | ||
|
||
# cd /bot/ && rq worker -v -u redis://:orangenogg@127.0.0.1:6379/ | ||
|
||
def add(url): | ||
chrome_options = webdriver.ChromeOptions() | ||
chrome_options.add_argument('--headless') | ||
chrome_options.add_argument('--disable-gpu') | ||
chrome_options.add_argument('--disable-dev-shm-usage') | ||
# chrome_options.add_argument('--no-sandbox') | ||
|
||
with open('config.json', 'r') as fp: | ||
ADMIN_URL = json.load(fp)['admin_url'] | ||
|
||
client = webdriver.Chrome(chrome_options=chrome_options) | ||
client.set_page_load_timeout(5) | ||
client.set_script_timeout(5) | ||
client.get(ADMIN_URL) | ||
client.get(url) | ||
i = 0 | ||
while 1: | ||
try: | ||
client.switch_to_alert().accept() | ||
i += 1 | ||
if i > 1000: | ||
break | ||
except selenium.common.exceptions.NoAlertPresentException: | ||
break | ||
|
||
time.sleep(2) | ||
client.quit() | ||
|
||
if __name__ == '__main__': | ||
add(sys.argv[1]) |
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,7 @@ | ||
{ | ||
"password": "orangenogg", | ||
"server_ip": "3.114.5.202", | ||
"base": "http://3.114.5.202/", | ||
"admin_url": "http://3.114.5.202/.admin.php", | ||
"flag": "hitcon{/FD 1s 0ur g0d <(_ _)>}" | ||
} |
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,6 @@ | ||
<?php | ||
$config = json_decode(file_get_contents("/bot/config.json")); | ||
$ip = $_SERVER['REMOTE_ADDR']; | ||
if ($_SERVER['REMOTE_ADDR'] == $config->server_ip) { | ||
setcookie("flag", $config->flag); | ||
} |
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,33 @@ | ||
<?php | ||
$q = isset($_GET['q'])? $_GET['q']: ''; | ||
$q = str_replace(array("\r", "\n", "/", "\\", "<", "."), "", $q); | ||
|
||
if( substr_count($q, "'") > 1) $q = str_replace("'", "", $q); | ||
if( substr_count($q, '"') > 1) $q = str_replace('"', "", $q); | ||
$host = $q . ".orange.ctf"; | ||
|
||
?> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"/> | ||
<script type="text/javascript"> | ||
if (window.top == window.self) { | ||
window.self.location.href = "https://<?=$host;?>/oauth/authorize?client_id=1&scope=read&redirect_uri=https://twitter.com/orange_8361"; | ||
} else { | ||
var data = JSON.stringify({ | ||
message: 'CTF.API.remote', | ||
data: { | ||
location: "https://<?=$host;?>/oauth/authorize?client_id=1&scope=read&redirect_uri=https://twitter.com/orange_8361" | ||
} | ||
}); | ||
window.parent.postMessage( | ||
data, | ||
"https://<?=$host;?>" | ||
); | ||
} | ||
</script> | ||
</head> | ||
<body> | ||
</body> | ||
</html> |
Oops, something went wrong.