1python fofa.py --keyword nextchat" && icon_hash="-489732743 --endcount 50000 -
Above is the project search statement to see how it starts. After getting all NextChat sites, the code detects if a password is required.
x1import requests2import concurrent.futures3
4
5def fetch_url_data(url):6 headers = {7 'accept': 'application/json',8 'authorization': 'Bearer nk-'9 }10 try:11 full_url = f"{url}/api/config" #添加 /api/config 到 URL12 response = requests.post(full_url, headers=headers, verify=False)13 response.raise_for_status()14 data = response.json()15
16 if not data.get('needCode', True) and data.get('customModels'):17 result = f"URL: {url}\nCustom Models: {data.get('customModels')}\n"18 with open('results.txt', 'a') as file:19 file.write(result)20 except requests.RequestException as e:21 print(f"Error fetching {url}: {e}")22
23
24def read_urls_from_file(file_path):25 with open(file_path, 'r') as file:26 return [line.strip() for line in file]27
28
29def main():30 urls = read_urls_from_file('final_fofaHack.txt')31
32 with concurrent.futures.ThreadPoolExecutor(max_workers=10) as executor:33 executor.map(fetch_url_data, urls)34
35
36if __name__ == "__main__":37 main()<OVER~>