-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature v2.4.16 新增 --authorization-file 参数
- Loading branch information
panyi
committed
May 22, 2024
1 parent
d1bd3c2
commit 23add4c
Showing
6 changed files
with
95 additions
and
61 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
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
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 |
---|---|---|
@@ -1,49 +1,23 @@ | ||
import json | ||
|
||
from fofa_hack import fofa | ||
from tookit import fofaUseragent | ||
|
||
import requests,sys,mmh3,codecs | ||
|
||
def main(): | ||
result_generator = fofa.api('protocol="socks5" && "Authentication"', endcount=1000) | ||
for data in result_generator: | ||
for proxy in data: | ||
proxies = {'http': "http://{}".format(proxy), "https": "https://{}".format(proxy)} | ||
print(fr'[-] test: ' + str(proxies)) | ||
try: | ||
r = requests.get('https://www.taobao.com/help/getip.php', proxies=proxies, timeout=3) | ||
if 'ipCallback' in r.text: | ||
print(fr'[*] success: ' + str(proxies)) | ||
except requests.exceptions.ConnectionError: | ||
pass | ||
except requests.exceptions.ReadTimeout: | ||
pass | ||
except KeyboardInterrupt: | ||
print('用户退出') | ||
exit() | ||
except requests.exceptions.InvalidSchema: | ||
print('未检测到pysocks') | ||
print('pip install -U requests[socks]') | ||
print('pip install pysocks') | ||
exit() | ||
|
||
|
||
def get_ip(): | ||
proxies = {'http': 'socks5://18.178.209.57:5555', 'https': 'socks5://18.178.209.57:5555'} | ||
response = requests.get('https://api64.ipify.org?format=json',proxies=proxies).json() | ||
return response["ip"] | ||
|
||
def get_location(): | ||
ip_address = get_ip() | ||
response = requests.get(f'https://ipapi.co/{ip_address}/json/').json() | ||
location_data = { | ||
"ip": ip_address, | ||
"city": response.get("city"), | ||
"region": response.get("region"), | ||
"country": response.get("country_name") | ||
} | ||
return location_data | ||
|
||
|
||
if __name__ == '__main__': | ||
main() | ||
import requests | ||
|
||
from tookit import config, fofaUseragent | ||
|
||
|
||
request_url="https://api.fofa.info/v1/m/profile" | ||
# au = config.AUTHORIZATION_LIST[0] | ||
# print(au) | ||
|
||
|
||
rep = requests.get(request_url, headers=fofaUseragent.getFofaPageNumHeaders(), timeout=10) | ||
print(json.loads(rep.text)["data"]["info"]["data_limit"]) | ||
|
||
|
||
request_url2 = "https://api.fofa.info/v1/m/data_usage/month" | ||
rep = requests.get(request_url2, headers=fofaUseragent.getFofaPageNumHeaders(), timeout=10) | ||
print(json.loads(rep.text)["data"]) | ||
|
||
# au = config.AUTHORIZATION_LIST.pop() | ||
# print(au) | ||
# print(config.AUTHORIZATION_LIST) |
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