Skip to content

Commit 4369044

Browse files
authored
Merge pull request #293 from 13ph03nix/master
Some improvements & Bug fixes
2 parents c68e5bd + 706acc1 commit 4369044

File tree

24 files changed

+95
-55
lines changed

24 files changed

+95
-55
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,3 +343,10 @@ Cross-platform shell code generation
343343
* target url support cidr, user can use -p provide additional ports
344344
* support local mode, local mode do not need any targets, e.g. LPE
345345
* bug fixes
346+
347+
# version 1.9.6
348+
----------------
349+
* support -o parameter, save the result in json lines format
350+
* optimize timeout for cyberspace search engine plugins
351+
* optimize the handling of the url protocol
352+
* docs update

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ RUN sh -c "$(wget -O- https://raw.githubusercontent.com/13ph03nix/zsh-in-docker/
3131
&& sudo apt-get clean -y \
3232
&& sudo rm -rf /var/lib/apt/lists/*
3333

34-
RUN sudo pip3 install --upgrade pip && sudo pip3 install --upgrade pocsuite3==1.9.5
34+
RUN sudo pip3 install --upgrade pip && sudo pip3 install --upgrade pocsuite3==1.9.6
3535

3636
WORKDIR /home/pocsuite3
3737
CMD ["zsh"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ cli mode
130130
# run poc with shell mode
131131
pocsuite -u http://example.com -r example.py -v 2 --shell
132132
133-
# search for the target of redis service from ZoomEye and perform batch detection of vulnerabilities. The thread is set to 20
133+
# search for the target of redis service from ZoomEye and perform batch detection of vulnerabilities. The threads is set to 20
134134
pocsuite -r redis.py --dork service:redis --threads 20
135135
136136
# load all poc in the poc directory and save the result as html

docs/USAGE.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Request:
4949
--host HOST HTTP Host header value
5050
--referer REFERER HTTP Referer header value
5151
--user-agent AGENT HTTP User-Agent header value (default random)
52-
--proxy PROXY Use a proxy to connect to the target URL
52+
--proxy PROXY Use a proxy to connect to the target URL (protocol://host:port)
5353
--proxy-cred PROXY_CRED
5454
Proxy authentication credentials (name:password)
5555
--timeout TIMEOUT Seconds to wait before timeout connection (default 10)
@@ -118,6 +118,8 @@ Modules:
118118
Optimization:
119119
Optimization options
120120
121+
-o OUTPUT_PATH, --output OUTPUT_PATH
122+
Output file to write (JSON Lines format)
121123
--plugins PLUGINS Load plugins to execute
122124
--pocs-path POCS_PATH
123125
User defined poc scripts path
@@ -208,7 +210,7 @@ $ pocsuite --dork 'port:6379' --vul-keyword 'redis' --max-page 2
208210
Search libssh server with `libssh` keyword.
209211

210212
```
211-
pocsuite -r pocs/libssh_auth_bypass.py --dork-shodan libssh --thread 10
213+
pocsuite -r pocs/libssh_auth_bypass.py --dork-shodan libssh --threads 10
212214
```
213215

214216
**--dork-fofa DORK**
@@ -219,7 +221,7 @@ $ pocsuite --dork 'port:6379' --vul-keyword 'redis' --max-page 2
219221

220222

221223
```
222-
$ pocsuite -r pocs/check_http_status.py --dork-fofa 'body="thinkphp"' --search-type web --thread 10
224+
$ pocsuite -r pocs/check_http_status.py --dork-fofa 'body="thinkphp"' --search-type web --threads 10
223225
```
224226

225227
**--dork-quake DORK**
@@ -230,7 +232,7 @@ $ pocsuite --dork 'port:6379' --vul-keyword 'redis' --max-page 2
230232

231233

232234
```
233-
$ pocsuite -r pocs/check_http_status.py --dork-quake 'app:"ThinkPHP"' --thread 10
235+
$ pocsuite -r pocs/check_http_status.py --dork-quake 'app:"ThinkPHP"' --threads 10
234236
```
235237

236238
**--dork-b64**
@@ -271,7 +273,7 @@ cli mode
271273
# run poc with shell mode
272274
pocsuite -u http://example.com -r example.py -v 2 --shell
273275
274-
# search for the target of redis service from ZoomEye and perform batch detection of vulnerabilities. The thread is set to 20
276+
# search for the target of redis service from ZoomEye and perform batch detection of vulnerabilities. The threads is set to 20
275277
pocsuite -r redis.py --dork service:redis --threads 20
276278
277279
# load all poc in the poc directory and save the result as html

manpages/poc-console.1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
.TH POC-CONSOLE "1" "May 2022" "Manual page for poc-console"
1+
.TH POC-CONSOLE "1" "July 2022" "Manual page for poc-console"
22
.\"
3-
.\" 24st May 2022
3+
.\" July 6, 2022
44
.\" Man page author:
55
.\" Tian Qiao <[email protected]>
66
.\"
@@ -31,7 +31,7 @@ is maintained at:
3131
.I https://github.com/knownsec/pocsuite3/blob/master/docs/USAGE.md
3232
.PP
3333
.SH VERSION
34-
This manual page documents pocsuite3 version 1.9.5
34+
This manual page documents pocsuite3 version 1.9.6
3535
.SH AUTHOR
3636
.br
3737
(c) 2014-2022 by Knownsec 404 Team

manpages/pocsuite.1

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
.TH POCSUITE "1" "May 2022" "Manual page for pocsuite"
1+
.TH POCSUITE "1" "July 2022" "Manual page for pocsuite"
22
.\"
3-
.\" 24st May 2022
3+
.\" July 6, 2022
44
.\" Man page author:
55
.\" Tian Qiao <[email protected]>
66
.\"
@@ -90,7 +90,7 @@ HTTP Referer header value
9090
HTTP User\-Agent header value (default random)
9191
.TP
9292
\fB\-\-proxy\fR PROXY
93-
Use a proxy to connect to the target URL
93+
Use a proxy to connect to the target URL (protocol://host:port)
9494
.TP
9595
\fB\-\-proxy\-cred\fR PROXY_CRED
9696
Proxy authentication credentials (name:password)
@@ -200,6 +200,9 @@ Whether dork is in base64 format
200200
.IP
201201
Optimization options
202202
.TP
203+
\fB\-o\fR OUTPUT_PATH, \fB\-\-output\fR OUTPUT_PATH
204+
Output file to write (JSON Lines format)
205+
.TP
203206
\fB\-\-plugins\fR PLUGINS
204207
Load plugins to execute
205208
.TP
@@ -280,7 +283,7 @@ is maintained at:
280283
.I https://github.com/knownsec/pocsuite3/blob/master/docs/USAGE.md
281284
.PP
282285
.SH VERSION
283-
This manual page documents pocsuite3 version 1.9.5
286+
This manual page documents pocsuite3 version 1.9.6
284287
.SH AUTHOR
285288
.br
286289
(c) 2014-2022 by Knownsec 404 Team

pocsuite.ini

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ host =
2525
referer =
2626
; http user-agent header value (default random)
2727
agent =
28-
; use a proxy to connect to the target url
28+
; use a proxy to connect to the target url (protocol://host:port)
2929
proxy =
3030
; proxy authentication credentials (name:password)
3131
proxy_cred =
@@ -99,6 +99,8 @@ comparison = False
9999
dork_b64 = False
100100

101101
[Optimization]
102+
; output file to write (json lines format)
103+
output_path =
102104
; load plugins to execute
103105
plugins =
104106
; user defined poc scripts path

pocsuite3/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__title__ = 'pocsuite3'
2-
__version__ = '1.9.5'
2+
__version__ = '1.9.6'
33
__author__ = 'Knownsec 404 Team'
44
__author_email__ = '[email protected]'
55
__license__ = 'GPLv2'

pocsuite3/lib/controller/controller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
def runtime_check():
1919
if not kb.registered_pocs:
20-
msg = "try 'pocsuite -h' or 'pocsuite --help' for more information"
20+
msg = "No poc specified, try 'pocsuite -h' or 'pocsuite --help' for more information"
2121
logger.warn(msg)
2222
raise PocsuiteSystemException(msg)
2323

pocsuite3/lib/core/common.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -252,19 +252,14 @@ def parse_target_url(url):
252252
"""
253253
Parse target URL
254254
"""
255-
ret = url
256-
257-
if conf.ipv6 and is_ipv6_address_format(url):
258-
ret = "[" + ret + "]"
259-
260-
if not re.search("^http[s]*://", ret, re.I) and not re.search("^ws[s]*://", ret, re.I) and '://' not in ret:
261-
port = urlparse(ret).port
262-
if port and str(port).endswith('443'):
263-
ret = "https://" + ret
264-
else:
265-
ret = "http://" + ret
255+
try:
256+
pr = urlparse(url)
257+
if pr.scheme.lower() not in ['http', 'https', 'ws', 'wss']:
258+
url = pr._replace(scheme='https' if str(pr.port).endswith('443') else 'http').geturl()
259+
except ValueError:
260+
pass
266261

267-
return ret
262+
return url
268263

269264

270265
def is_url_format(value):
@@ -419,13 +414,18 @@ def parse_target(address, additional_ports=[]):
419414
pass
420415

421416
targets.add(address)
422-
pr = urlparse(address)
423-
for port in additional_ports:
424-
netloc = f'[{pr.hostname}]:{port}' if conf.ipv6 else f'{pr.hostname}:{port}'
425-
t = pr._replace(netloc=netloc).geturl()
426-
if t.startswith('tcp://'):
427-
t = t.lstrip('tcp://')
428-
targets.add(t)
417+
418+
try:
419+
pr = urlparse(address)
420+
for port in additional_ports:
421+
netloc = f'[{pr.hostname}]:{port}' if conf.ipv6 else f'{pr.hostname}:{port}'
422+
t = pr._replace(netloc=netloc).geturl()
423+
if t.startswith('tcp://'):
424+
t = t.lstrip('tcp://')
425+
targets.add(t)
426+
except ValueError:
427+
pass
428+
429429
return targets
430430

431431

0 commit comments

Comments
 (0)