Skip to content

Commit 56f8ab4

Browse files
authored
Add files via upload
1 parent aefdb35 commit 56f8ab4

6 files changed

Lines changed: 188 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
安全狗
2+
Not Found
3+
云锁
4+
找不到
5+
云盾
6+
百度云加速
7+
D盾
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[config]
2+
calc_xc=500
3+
gol=baidu.com
4+
search=http://baidu.com
5+
id=0
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
login.js
2+
admin.js
3+
log.js
4+
jquery-1.10.2.min_65682a2.js
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
## 接口搜索器_靡忘 ##
2+
conf文件夹下的
3+
```
4+
config.ini #配置文件
5+
config.txt #白名单文件(要匹配的关键字放在里面)
6+
black.txt #黑名单文件(要过滤的关键字放在里面)
7+
```
8+
9+
config.ini详解
10+
```
11+
[config]
12+
calc_xc=500 #当任务满多少个时开始多进程+协程 (注意:不要设置太低,否则本机或目标会死掉)
13+
gol=baidu.com #无限爬虫时过滤关键字
14+
search=http://baidu.com #无限爬的域名
15+
id=0 #id为0是单线程,id为1是多进程+协程
16+
```
17+
18+
本程序思路图:
19+
![](https://s2.ax1x.com/2019/06/05/VUs9Ug.md.png)
20+
21+
22+
测试图:
23+
24+
![](https://s2.ax1x.com/2019/06/05/VUrOgI.png)

接口搜索器_靡忘/fw.py

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
# @author:九世
2+
# @time:2019/6/5
3+
# @file:fw.py
4+
5+
6+
from gevent import monkey;monkey.patch_all()
7+
import requests
8+
import os
9+
import gevent
10+
from multiprocessing import Process
11+
from configparser import ConfigParser
12+
import re
13+
14+
banner='''
15+
16+
_______ __ ________
17+
| ___|.-----.|__| | | |.---.-.-----.-----.
18+
| ___|| -__|| | | | || _ | | _ |
19+
|___| |_____||__|________||___._|__|__|___ |
20+
|_____|
21+
'''
22+
print(banner)
23+
24+
black_list=[]
25+
bai_list=[]
26+
dept=[]
27+
js=[]
28+
hei=[]
29+
guol=[]
30+
config={}
31+
32+
class Fw:
33+
def __init__(self,path,path2,path3,PATTERN_URl):
34+
self.path=path
35+
self.path2=path2
36+
self.path3=path3
37+
self.PATTERN_URl=PATTERN_URl
38+
39+
def file_pd(self):
40+
if os.path.exists(path=self.path) and os.path.exists(path=self.path2) and os.path.exists(path=self.path3):
41+
print('[+] 找到配置文件:{}'.format(self.path))
42+
print('[+] 找到黑名单文件:{}'.format(self.path2))
43+
print('[+] 找到ini配置文件:{}'.format(self.path3))
44+
dk=open(self.path,'r',encoding='utf-8')
45+
for d in dk.readlines():
46+
qc="".join(d.split('\n'))
47+
bai_list.append(qc)
48+
49+
dk2=open(self.path2,'r',encoding='utf-8')
50+
for d in dk2.readlines():
51+
qc="".join(d.split('\n'))
52+
black_list.append(qc)
53+
54+
cf=ConfigParser()
55+
cf.read(self.path3)
56+
config['xc_size']=cf.get('config','calc_xc')
57+
config['search_filter']=cf.get('config','gol')
58+
config['search']=cf.get('config','search')
59+
config['id']=cf.get('config','id')
60+
try:
61+
self.respone(config['search'])
62+
except Exception as r:
63+
print(r)
64+
else:
65+
print('[-] 配置文件找不到或黑名单或ini配置文件找不到....')
66+
exit()
67+
68+
def respone(self,url):
69+
headers={'user-agent':'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36'}
70+
try:
71+
rqt=requests.get(url=url,headers=headers)
72+
if rqt.status_code==200 and rqt.text!='':
73+
if rqt.url not in hei:
74+
for g in black_list:
75+
if g in rqt.text:
76+
print('黑名单匹配:{} url:{}'.format(g, rqt.url))
77+
print('黑名单匹配:{} url:{}'.format(g,rqt.url),file=open('save/save.txt','a',encoding='utf-8'))
78+
hei.append(rqt.url)
79+
80+
if rqt.url not in hei and rqt.url not in guol:
81+
print('存活url:{}'.format(rqt.url))
82+
print('存活url:{}'.format(rqt.url),file=open('save/save.txt','a',encoding='utf-8'))
83+
guol.append(rqt.url)
84+
85+
for b in bai_list:
86+
if b in rqt.text:
87+
print('白名单匹配:{} url:{}'.format(b,rqt.url))
88+
print('白名单匹配:{} url:{}'.format(b, rqt.url),file=open('save/save.txt','a',encoding='utf-8'))
89+
90+
91+
zz=re.findall(self.PATTERN_URl,rqt.text)
92+
for z in zz:
93+
if config['search_filter'] in z:
94+
if z not in dept:
95+
dept.append(z)
96+
97+
98+
if int(config['id'])==1:
99+
reg=[]
100+
calc=0
101+
for d in dept:
102+
if calc==int(config['xc_size']):
103+
p=Process(target=self.xc,args=(reg,))
104+
p.start()
105+
reg.clear()
106+
calc=0
107+
reg.append(d)
108+
calc+=1
109+
110+
if len(reg)>0:
111+
p = Process(target=self.xc, args=(reg,))
112+
p.start()
113+
else:
114+
for d in dept:
115+
self.respone(d)
116+
except Exception as r:
117+
print(r)
118+
119+
def xc(self,rg):
120+
rb=[]
121+
for r in rg:
122+
rb.append(gevent.spawn(self.respone,r))
123+
124+
gevent.joinall(rb)
125+
126+
if __name__ == '__main__':
127+
path='conf/config.txt'
128+
path2='conf/black.txt'
129+
path3='conf/config.ini'
130+
PATTERN_URl='<a.*href=\"(https?://.*?)[\"|\'].*'
131+
obj=Fw(path=path,path2=path2,path3=path3,PATTERN_URl=PATTERN_URl)
132+
obj.file_pd()
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
存活url:https://www.baidu.com/
2+
白名单匹配:jquery-1.10.2.min_65682a2.js url:https://www.baidu.com/
3+
存活url:http://www.baidu.com/more/
4+
存活url:https://tieba.baidu.com/index.html
5+
白名单匹配:log.js url:https://tieba.baidu.com/index.html
6+
存活url:https://zhidao.baidu.com/
7+
白名单匹配:login.js url:https://zhidao.baidu.com/
8+
白名单匹配:log.js url:https://zhidao.baidu.com/
9+
存活url:http://image.baidu.com
10+
存活url:http://v.baidu.com
11+
存活url:https://map.baidu.com/
12+
存活url:https://www.baidu.com/
13+
白名单匹配:jquery-1.10.2.min_65682a2.js url:https://www.baidu.com/
14+
存活url:http://www.baidu.com/more/
15+
存活url:https://tieba.baidu.com/index.html
16+
白名单匹配:log.js url:https://tieba.baidu.com/index.html

0 commit comments

Comments
 (0)