This commit is contained in:
Jing Ling
2020-08-01 13:55:32 +08:00
parent 08db52e946
commit f5e88e0b05
15 changed files with 7 additions and 22 deletions
+6 -6
View File
@@ -23,12 +23,12 @@ def github_takeover(url):
print('[*]正在读取配置文件')
user = api.github_api_user
token = api.github_api_token
CHECK_HEADERS = {
headers = {
"Authorization": 'token ' + token,
"Accept": "application/vnd.github.switcheroo-preview+json"
}
repos_url = 'https://api.github.com/repos/' + user + '/' + repo_name
repos_r = requests.get(url=repos_url, headers=CHECK_HEADERS)
repos_r = requests.get(url=repos_url, headers=headers)
# 验证token是否正确
if 'message' in repos_r.json():
if repos_r.json()['message'] == 'Bad credentials':
@@ -41,7 +41,7 @@ def github_takeover(url):
}
creat_repo_url = 'https://api.github.com/user/repos'
creat_repo_r = requests.post(url=creat_repo_url,
headers=CHECK_HEADERS,
headers=headers,
data=json.dumps(creat_repo_dict))
creat_repo_status = creat_repo_r.status_code
if creat_repo_status == 201:
@@ -76,9 +76,9 @@ def github_takeover(url):
html_url = 'https://api.github.com/repos/' + user + '/' + repo_name + '/contents/index.html'
url_url = 'https://api.github.com/repos/' + user + '/' + repo_name + '/contents/CNAME'
html_r = requests.put(url=html_url, data=json.dumps(html_dict),
headers=CHECK_HEADERS) # 上传index.html
headers=headers) # 上传index.html
cname_r = requests.put(url=url_url, data=json.dumps(url_dict),
headers=CHECK_HEADERS) # 上传CNAME
headers=headers) # 上传CNAME
rs = cname_r.status_code
if rs == 201:
print('[*]生成接管库成功,正在开启Github pages')
@@ -90,7 +90,7 @@ def github_takeover(url):
}
page_r = requests.post(url=page_url,
data=json.dumps(page_dict),
headers=CHECK_HEADERS) # 开启page
headers=headers) # 开启page
if page_r.status_code == 201:
print('[+]自动接管成功,请稍后访问http://' + str(url) + '查看结果')
else:
-1
View File
@@ -1,4 +1,3 @@
from common import utils
from common.query import Query
-1
View File
@@ -1,4 +1,3 @@
from common import utils
from common.query import Query
-1
View File
@@ -1,4 +1,3 @@
from common import utils
from common.query import Query
-1
View File
@@ -3,7 +3,6 @@
"""
from common.module import Module
from common import utils
class CheckCDX(Module):
-1
View File
@@ -6,7 +6,6 @@
import socket
import ssl
from common import utils
from common.module import Module
from config.log import logger
+1 -2
View File
@@ -3,7 +3,6 @@ Collect subdomains from ContentSecurityPolicy
"""
import requests
from common import utils
from common.module import Module
from config.log import logger
@@ -79,4 +78,4 @@ def do(domain, header=None): # 统一入口名字 方便多线程调用
if __name__ == '__main__':
resp = requests.get('https://content-security-policy.com/')
do('google-analytics.com', resp.headers)
do('google-analytics.com', dict(resp.headers))
-1
View File
@@ -2,7 +2,6 @@
检查内容安全策略收集子域名收集子域名
"""
from common.module import Module
from common import utils
class CheckRobots(Module):
-1
View File
@@ -2,7 +2,6 @@
检查内容安全策略收集子域名收集子域名
"""
from common.module import Module
from common import utils
class CheckRobots(Module):
-2
View File
@@ -42,8 +42,6 @@ class CloudFlareAPI(Query):
else:
return
elif zones_resp.json()['success']:
zone_id = zones_resp.json()['result'][0]['id']
delete_zone_resp = self.delete(self.addr + f'zones/{zone_id}', check=False)
zone_id = self.create_zone(account_id)
if zone_id:
self.list_dns(zone_id)
-1
View File
@@ -1,5 +1,4 @@
from config import api
from common import utils
from common.query import Query
-1
View File
@@ -1,4 +1,3 @@
from common import utils
from common.query import Query
-1
View File
@@ -1,4 +1,3 @@
from common import utils
from common.query import Query
-1
View File
@@ -1,4 +1,3 @@
from common import utils
from common.query import Query
-1
View File
@@ -1,5 +1,4 @@
from config import api
from common import utils
from common.query import Query