mirror of
https://github.com/shmilylty/OneForAll.git
synced 2026-08-26 04:47:48 +08:00
typos
This commit is contained in:
@@ -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,4 +1,3 @@
|
||||
from common import utils
|
||||
from common.query import Query
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
from common import utils
|
||||
from common.query import Query
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
from common import utils
|
||||
from common.query import Query
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
"""
|
||||
|
||||
from common.module import Module
|
||||
from common import utils
|
||||
|
||||
|
||||
class CheckCDX(Module):
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
import socket
|
||||
import ssl
|
||||
|
||||
from common import utils
|
||||
from common.module import Module
|
||||
from config.log import logger
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
检查内容安全策略收集子域名收集子域名
|
||||
"""
|
||||
from common.module import Module
|
||||
from common import utils
|
||||
|
||||
|
||||
class CheckRobots(Module):
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
检查内容安全策略收集子域名收集子域名
|
||||
"""
|
||||
from common.module import Module
|
||||
from common import utils
|
||||
|
||||
|
||||
class CheckRobots(Module):
|
||||
|
||||
@@ -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,5 +1,4 @@
|
||||
from config import api
|
||||
from common import utils
|
||||
from common.query import Query
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
from common import utils
|
||||
from common.query import Query
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
from common import utils
|
||||
from common.query import Query
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
from common import utils
|
||||
from common.query import Query
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from config import api
|
||||
from common import utils
|
||||
from common.query import Query
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user