Skip to content

Commit 71601dd

Browse files
committed
2022.5.14
1 parent 54f8873 commit 71601dd

File tree

182 files changed

+3006
-2594
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

182 files changed

+3006
-2594
lines changed

README.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
- [临兵漏洞扫描系统](#临兵漏洞扫描系统)
2+
- [使用说明](#使用说明)
23
- [修改加密key](#修改加密key)
34
- [修改aes key](#修改aes-key)
45
- [修改rsa key](#修改rsa-key)
@@ -33,13 +34,18 @@
3334
- [[v2.7] 2021.10.11](#v27-20211011)
3435
- [[v2.8] 2021.10.24](#v28-20211024)
3536
- [[v2.9] 2021.12.26](#v29-20211226)
37+
- [[v3.0] 2022.5.14](#v30-2022514)
3638
- [致谢](#致谢)
3739
- [免责声明](#免责声明)
3840
- [License](#license)
3941

4042
# 临兵漏洞扫描系统
4143

42-
> 本系统是对Web中间件和Web框架进行漏洞扫描的一个系统,前端采用vue技术,后端采用python.poc有110多个,包含绝大部分的中间件漏洞,本系统的poc皆来源于网络或在此基础上进行修改
44+
> 本系统是对Web中间件和Web框架进行自动化渗透的一个系统,根据扫描选项去自动化收集资产,然后进行POC扫描,POC扫描时会根据指纹选择POC插件去扫描,POC插件扫描用异步方式扫描.前端采用vue技术,后端采用python fastapi.
45+
46+
## 使用说明
47+
48+
> 扫描分为指纹探测、子域名爆破、端口扫描、目录扫描、POC扫描.如果选择所有扫描选项,子域名扫出的IP会传给端口扫描,端口扫描中识别指纹,扫描出的资产传给目录扫描和POC扫描,POC扫描会根据资产指纹去加载插件扫描,如果识别不到指纹,则加载所有插件,POC插件分为2种类型,http和port,http类型指发送http请求,port指发送socket请求,扫描出的资产如果是url格式,则加载http类型插件,否则则加载port类型插件.
4349
4450
## 修改加密key
4551

@@ -51,8 +57,7 @@
5157
5258
### 修改rsa key
5359

54-
> 需要先生成rsa的公私钥(私钥1024位)[参考地址](https://www.jianshu.com/p/d614ba4720ec)
55-
60+
> 需要生成rsa的公私钥(私钥1024位)[参考地址](https://www.jianshu.com/p/d614ba4720ec)
5661
> 修改python/rsa.py文件中的公钥和私钥信息,vue部分则需要修改vue_src/src/libs/crypto.js文件中第77行的公钥,要和python/rsa.py文件中的公钥保持一致
5762
5863
修改vue部分后要重新打包,然后把打包后的文件夹dist中的内容复制到vue文件夹,vue原有的文件要删除.
@@ -94,7 +99,6 @@
9499
## 从dockerhub中获取镜像
95100

96101
> docker pull taomujian/linbing:latest
97-
98102
> docker run -it -d -p 11000:11000 -p 8800:8800 taomujian/linbing
99103
100104
## 访问
@@ -216,24 +220,25 @@
216220

217221
- 集成dnslog.cn的功能,提供dnslog功能
218222

223+
### [v3.0] 2022.5.14
224+
225+
- POC插件扫描换成异步扫描方式,加快扫描速度
226+
219227
## 致谢
220228

221229
> 感谢vulhub项目提供的靶机环境:
222-
223230
> <https://github.com/vulhub/vulhub>,
224-
225231
> <https://hub.docker.com/r/2d8ru/struts2>
226-
227-
> POC也参考了很多项目:
228232
>
233+
> POC也参考了很多项目:
229234
> <https://github.com/Xyntax/POC-T>
230235
>
231236
> <https://github.com/ysrc/xunfeng>
232237
>
233238
> <https://github.com/se55i0n/DBScanner>
234239
>
235240
> <https://github.com/vulscanteam/vulscan>
236-
241+
>
237242
> 感谢师傅pan带我入门安全,也感谢呆橘同学在vue上对我的指导
238243
239244
## 免责声明
@@ -242,4 +247,4 @@
242247

243248
## License
244249

245-
[MIT](https://github.com/taomujian/linbing/blob/master/LICENSE)
250+
[MIT](https://github.com/taomujian/linbing/blob/master/LICENSE)

centos.dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ RUN mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backu
2323
&& mkdir /root/python && cd gcc-9.2.0 && ./contrib/download_prerequisites && mkdir build && cd build && ../configure --prefix=/usr/local --disable-multilib --enable-languages=c,c++ && make && make install \
2424
&& ln -sf /usr/local/bin/gcc cc && yum remove -y gcc && sed -i "s|bind 127.0.0.1 ::1|bind 127.0.0.1|" /etc/redis/redis.conf && sed -i "s|# requirepass foobared|requirepass '${REDIS_PASS}'|" /etc/redis/redis.conf
2525

26-
RUN wget https://www.python.org/ftp/python/3.8.1/Python-3.8.1.tgz && tar -zxvf Python-3.8.1.tgz && cd Python-3.8.1 && ./configure prefix=/usr/local/python3.8 --enable-shared --enable-optimizations LDFLAGS="-Wl,--rpath=/usr/local/python3.8/lib" \
27-
&& make && make install && rm -rf /usr/bin/python3 && rm -rf /usr/bin/pip3 && ln -s /usr/local/python3.8/bin/python3.8 /usr/bin/python3 && ln -s /usr/local/python3.8/bin/pip3.8 /usr/bin/pip3
26+
RUN wget https://www.python.org/ftp/python/3.10.4/Python-3.10.4.tgz && tar -zxvf Python-3.10.4.tgz && cd Python-3.10.4 && ./configure prefix=/usr/local/python3.10 --enable-shared LDFLAGS="-Wl,--rpath=/usr/local/python3.10/lib" \
27+
&& make && make install && rm -rf /usr/bin/python3 && rm -rf /usr/bin/pip3 && ln -s /usr/local/python3.10/bin/python3.10 /usr/bin/python3 && ln -s /usr/local/python3.10/bin/pip3.10 /usr/bin/pip3
2828

2929
# 复制本地文件到docker 中
3030
ADD nginx/vue.conf /etc/nginx/conf.d/vue.conf

python/app/data/db/password.txt

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
2+
root
3+
123456
4+
password
5+
p@ssw0rd
6+
1qaz2wsx
7+
qwer!@#$
8+
qwer1234
9+
test
10+
toor
11+
1234
12+
root123
13+
P@ssw0rd!!
14+
qwa123
15+
12345678
16+
123qwe!@#
17+
123456789
18+
123321
19+
1314520
20+
666666
21+
fuckyou
22+
000000
23+
1234567890
24+
8888888
25+
qwerty
26+
1qaz2wsx
27+
abc123
28+
abc123456
29+
1q2w3e4r
30+
123qwe
31+
159357
32+
p@ssw0rd
33+
p@55w0rd
34+
password!
35+
p@ssw0rd!
36+
password1
37+
r00t
38+
system
39+
111111

python/app/data/db/username.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
root
2+
admin
3+
guest
4+
anonymous
5+
test
6+
www
7+
web
8+
rsync
9+
db
10+
ftp

python/app/password.txt renamed to python/app/data/password.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ qwer1234
1111
|$|N|E|X|U|S|$|
1212
admin888
1313
glassfish
14-
vulhub_default_password
1514
test
1615
neagrle
1716
toor

python/app/username.txt renamed to python/app/data/username.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,9 @@ deployment
66
test
77
www
88
web
9-
rsync
10-
db
119
wwwroot
1210
data
1311
tomcat
14-
ftp
1512
Admin
1613
Administrator
1714
administrator
File renamed without changes.

python/app/lib/utils/common.py renamed to python/app/lib/common.py

Lines changed: 10 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
#!/usr/bin/env python3
22

3-
import os
43
import re
54
import shlex
65
import random
76
import string
87
import socket
9-
import signal
108
import tldextract
119
from IPy import IP
1210
from urllib.parse import urlparse
13-
from app.lib.utils.request import request
11+
from app.lib.request import request
1412

1513
def get_useragent():
1614

@@ -53,7 +51,7 @@ def get_capta():
5351
capta = capta + random.choice(words)
5452
return capta
5553

56-
def get_live(url, num):
54+
async def get_live(url, num):
5755

5856
"""
5957
确认目标是否存活,尝试访问一定次数后确认目标是否存活
@@ -73,16 +71,14 @@ def get_live(url, num):
7371
# 判断没有http协议类型的网站是http还是https,并判断是否存活
7472
if not url.startswith("http") and not url.startswith("https"):
7573
url = 'http://' + url
76-
req = request.get(url, headers = headers, verify = False, allow_redirects = True)
77-
return urlparse(req.url).scheme + '://' + urlparse(req.url).netloc
78-
# 并判断目标是否存活
74+
req = await request.get(url, headers = headers, allow_redirects = True)
75+
return req.real_url
7976
else:
80-
req = request.get(url, headers = headers, verify = False, allow_redirects = True)
81-
return urlparse(req.url).scheme + '://' + urlparse(req.url).netloc
77+
req = request.get(url, headers = headers, allow_redirects = True)
78+
return req.real_url
8279
except Exception as e:
83-
print(e)
80+
# print(e)
8481
pass
85-
return None
8682

8783
def parse_target(target):
8884

@@ -121,7 +117,8 @@ def parse_target(target):
121117
domain_result = domain_regex.findall(url_parse.netloc)
122118
scan_ip = socket.gethostbyname(url_parse.hostname)
123119
except Exception as e:
124-
print(e)
120+
# print(e)
121+
pass
125122
finally:
126123
pass
127124

@@ -173,28 +170,4 @@ def parser_url(url):
173170
"""
174171
data = urlparse(url)
175172
parser_url = data.scheme + '://' + data.netloc
176-
return parser_url
177-
178-
def check(parameter):
179-
180-
"""
181-
等待指定时间后杀掉指定的进程
182-
183-
:param str parameter: 要查找的进程名字关键字
184-
:return:
185-
186-
"""
187-
188-
try:
189-
out = os.popen("ps -ef |grep \'%s\' |grep -v grep | awk '{print $2}'" %(parameter)).read()
190-
if out:
191-
for line in out.splitlines():
192-
try:
193-
os.kill(int(line), signal.SIGKILL)
194-
except Exception as e:
195-
print(e)
196-
pass
197-
except Exception as e:
198-
print(e)
199-
finally:
200-
pass
173+
return parser_url
File renamed without changes.

python/app/lib/request.py

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
#!/usr/bin/env python3
2+
3+
import aiohttp
4+
import configparser
5+
6+
def get_conf():
7+
8+
""""
9+
从配置文件中读取代理地址和超时时间
10+
11+
:param:
12+
:return tuple result: 代理地址和超时时间
13+
"""
14+
15+
config = configparser.ConfigParser()
16+
config.read('conf.ini')
17+
proxy = config.get('request', 'proxy')
18+
if not config.get('request', 'timeout'):
19+
timeout = 5
20+
else:
21+
timeout = int(config.get('request', 'timeout'))
22+
if not proxy:
23+
proxies = None
24+
else:
25+
proxies = {
26+
'http': '%s' %(proxy),
27+
'https': '%s' %(proxy),
28+
}
29+
return proxies, timeout
30+
31+
class request:
32+
33+
"""
34+
封装aiohttp
35+
"""
36+
37+
def __init__(self):
38+
pass
39+
40+
@classmethod
41+
async def get(self, url, params = None, data = None, json = None, headers = None, proxy = None, cookies = None, verify_ssl = False, allow_redirects = False):
42+
result = get_conf()
43+
proxy = result[0]
44+
timeout = result[1]
45+
async with aiohttp.ClientSession() as session:
46+
async with session.get(url, params = params, data = data, json = json, headers = headers, proxy = proxy, cookies = cookies, timeout = timeout, verify_ssl = verify_ssl, allow_redirects = allow_redirects) as response:
47+
result = await response.text()
48+
return response
49+
50+
@classmethod
51+
async def post(self, url, params = None, data = None, json = None, headers = None, proxy = None, cookies = None, verify_ssl = False, allow_redirects = False):
52+
result = get_conf()
53+
proxy = result[0]
54+
timeout = result[1]
55+
async with aiohttp.ClientSession() as session:
56+
async with session.post(url, params = params, data = data, json = json, headers = headers, proxy = proxy, cookies = cookies, timeout = timeout, verify_ssl = verify_ssl, allow_redirects = allow_redirects) as response:
57+
await response.text()
58+
return response
59+
60+
@classmethod
61+
async def put(self, url, params = None, data = None, json = None, headers = None, proxy = None, cookies = None, verify_ssl = False, allow_redirects = False):
62+
result = get_conf()
63+
proxy = result[0]
64+
timeout = result[1]
65+
async with aiohttp.ClientSession() as session:
66+
async with session.put(url, params = params, data = data, json = json, headers = headers, proxy = proxy, cookies = cookies, timeout = timeout, verify_ssl = verify_ssl, allow_redirects = allow_redirects) as response:
67+
await response.text()
68+
return response
69+
70+
@classmethod
71+
async def head(self, url, params = None, data = None, json = None, headers = None, proxy = None, cookies = None, verify_ssl = False, allow_redirects = False):
72+
result = get_conf()
73+
proxy = result[0]
74+
timeout = result[1]
75+
async with aiohttp.ClientSession() as session:
76+
async with session.head(url, params = params, data = data, json = json, headers = headers, proxy = proxy, cookies = cookies, timeout = timeout, verify_ssl = verify_ssl, allow_redirects = allow_redirects) as response:
77+
await response.text()
78+
return response
79+
80+
@classmethod
81+
async def patch(self, url, params = None, data = None, json = None, headers = None, proxy = None, cookies = None, verify_ssl = False, allow_redirects = False):
82+
result = get_conf()
83+
proxy = result[0]
84+
timeout = result[1]
85+
async with aiohttp.ClientSession() as session:
86+
async with session.patch(url, params = params, data = data, json = json, headers = headers, proxy = proxy, cookies = cookies, timeout = timeout, verify_ssl = verify_ssl, allow_redirects = allow_redirects) as response:
87+
await response.text()
88+
return response
89+
90+
@classmethod
91+
async def options(self, url, params = None, data = None, json = None, headers = None, proxy = None, cookies = None, verify_ssl = False, allow_redirects = False):
92+
result = get_conf()
93+
proxy = result[0]
94+
timeout = result[1]
95+
async with aiohttp.ClientSession() as session:
96+
async with session.options(url, params = params, data = data, json = json, headers = headers, proxy = proxy, cookies = cookies, timeout = timeout, verify_ssl = verify_ssl, allow_redirects = allow_redirects) as response:
97+
await response.text()
98+
return response
99+
100+
@classmethod
101+
async def delete(self, url, params = None, data = None, json = None, headers = None, proxy = None, cookies = None, verify_ssl = False, allow_redirects = False):
102+
result = get_conf()
103+
proxy = result[0]
104+
timeout = result[1]
105+
async with aiohttp.ClientSession() as session:
106+
async with session.delete(url, params = params, data = data, json = json, headers = headers, proxy = proxy, cookies = cookies, timeout = timeout, verify_ssl = verify_ssl, allow_redirects = allow_redirects) as response:
107+
await response.text()
108+
return response
109+
110+
@classmethod
111+
async def request(self, method, url, params = None, data = None, json = None, headers = None, proxy = None, cookies = None, verify_ssl = False, allow_redirects = False):
112+
result = get_conf()
113+
proxy = result[0]
114+
timeout = result[1]
115+
async with aiohttp.ClientSession() as session:
116+
async with session.request(url, params = params, data = data, json = json, headers = headers, proxy = proxy, cookies = cookies, timeout = timeout, verify_ssl = verify_ssl, allow_redirects = allow_redirects) as response:
117+
await response.text()
118+
return response

0 commit comments

Comments
 (0)