Skip to content

Commit 30a9429

Browse files
authored
Merge pull request #375 from 13ph03nix/fix/urllib3-hook
Bug fixes & improvements
2 parents c2bd358 + 0338e56 commit 30a9429

File tree

18 files changed

+196
-98
lines changed

18 files changed

+196
-98
lines changed

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
run: |
7070
export VERSION=$(echo $GH_REF | sed 's:refs/tags/v::')
7171
git config --global user.email "[email protected]"
72-
git config --global user.name 'Tian Qiao'
72+
git config --global user.name '13ph03nix'
7373
git commit -a -m "Version ${VERSION} (automated version bump)"
7474
git push origin master
7575
env:

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# version 2.0.5
2+
----------------
3+
* fix hook failure due to urllib3 update #368 #373
4+
* optimize DSL expression execution #372
5+
* making mmh3 an optional dependency #359
6+
* disable mandatory updates
7+
18
# version 2.0.4
29
----------------
310
* Updated protocol names that are compatible with Nuclei v2.9.1

manpages/poc-console.1

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
.\"
33
.\" Nov 3, 2022
44
.\" Man page author:
5-
.\" Tian Qiao <[email protected]>
5+
.\" 13ph03nix <[email protected]>
66
.\"
77
.SH NAME
88
.I poc-console
@@ -31,7 +31,7 @@ is maintained at:
3131
.I https://pocsuite.org
3232
.PP
3333
.SH VERSION
34-
This manual page documents pocsuite3 version 2.0.4
34+
This manual page documents pocsuite3 version 2.0.5
3535
.SH AUTHOR
3636
.br
3737
(c) 2014-present by Knownsec 404 Team
@@ -46,7 +46,7 @@ redistribute this software under certain conditions. If you wish to embed
4646
pocsuite3 technology into proprietary software, we sell alternative licenses
4747
4848
.PP
49-
Manual page started by Tian Qiao
49+
Manual page started by 13ph03nix
5050
5151
.PP
5252

manpages/pocsuite.1

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
.\"
33
.\" Nov 3, 2022
44
.\" Man page author:
5-
.\" Tian Qiao <[email protected]>
5+
.\" 13ph03nix <[email protected]>
66
.\"
77
.SH NAME
88
.I pocsuite3
@@ -289,7 +289,7 @@ is maintained at:
289289
.I https://pocsuite.org
290290
.PP
291291
.SH VERSION
292-
This manual page documents pocsuite3 version 2.0.4
292+
This manual page documents pocsuite3 version 2.0.5
293293
.SH AUTHOR
294294
.br
295295
(c) 2014-present by Knownsec 404 Team
@@ -304,7 +304,7 @@ redistribute this software under certain conditions. If you wish to embed
304304
pocsuite3 technology into proprietary software, we sell alternative licenses
305305
306306
.PP
307-
Manual page started by Tian Qiao
307+
Manual page started by 13ph03nix
308308
309309
.PP
310310

pocsuite3/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__title__ = 'pocsuite3'
2-
__version__ = '2.0.4'
2+
__version__ = '2.0.5'
33
__author__ = 'Knownsec 404 Team'
44
__author_email__ = '[email protected]'
55
__license__ = 'GPLv2'

pocsuite3/lib/core/update.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import sys
21
from pocsuite3.lib.core.data import logger, conf
32
from six.moves.xmlrpc_client import ServerProxy
43
from pkg_resources import parse_version
@@ -47,5 +46,5 @@ def update():
4746
' $ unzip master.zip\n'
4847
' $ cd pocsuite3-master\n'
4948
' $ pip3 install -r requirements.txt\n'
50-
' $ python3 setup.py install\n')
51-
sys.exit(-1)
49+
' $ python3 setup.py install\n'
50+
)

pocsuite3/lib/request/patch/add_httpraw.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def httpraw(raw: str, ssl: bool = False, **kwargs):
4949
raise Exception
5050
tmp_headers = raws[1:index - 1]
5151
tmp_headers = extract_dict('\n'.join(tmp_headers), '\n', ": ")
52-
postData = raws[index]
52+
postData = '\n'.join(raws[index:])
5353
try:
5454
json.loads(postData)
5555
_json = postData

pocsuite3/lib/request/patch/hook_urllib3_parse_url.py

+32-33
Original file line numberDiff line numberDiff line change
@@ -115,39 +115,6 @@ def __str__(self):
115115
return self.url
116116

117117

118-
def split_first(s, delims):
119-
"""
120-
Given a string and an iterable of delimiters, split on the first found
121-
delimiter. Return two split parts and the matched delimiter.
122-
123-
If not found, then the first part is the full input string.
124-
125-
Example::
126-
127-
>>> split_first('foo/bar?baz', '?/=')
128-
('foo', 'bar?baz', '/')
129-
>>> split_first('foo/bar?baz', '123')
130-
('foo/bar?baz', '', None)
131-
132-
Scales linearly with number of delims. Not ideal for large number of delims.
133-
"""
134-
min_idx = None
135-
min_delim = None
136-
for d in delims:
137-
idx = s.find(d)
138-
if idx < 0:
139-
continue
140-
141-
if min_idx is None or idx < min_idx:
142-
min_idx = idx
143-
min_delim = d
144-
145-
if min_idx is None or min_idx < 0:
146-
return s, '', None
147-
148-
return s[:min_idx], s[min_idx + 1:], min_delim
149-
150-
151118
def patched_parse_url(url):
152119
"""
153120
Given a url, return a parsed :class:`.Url` namedtuple. Best-effort is
@@ -170,6 +137,38 @@ def patched_parse_url(url):
170137
# Additionally, this implementations does silly things to be optimal
171138
# on CPython.
172139

140+
def split_first(s, delims):
141+
"""
142+
Given a string and an iterable of delimiters, split on the first found
143+
delimiter. Return two split parts and the matched delimiter.
144+
145+
If not found, then the first part is the full input string.
146+
147+
Example::
148+
149+
>>> split_first('foo/bar?baz', '?/=')
150+
('foo', 'bar?baz', '/')
151+
>>> split_first('foo/bar?baz', '123')
152+
('foo/bar?baz', '', None)
153+
154+
Scales linearly with number of delims. Not ideal for large number of delims.
155+
"""
156+
min_idx = None
157+
min_delim = None
158+
for d in delims:
159+
idx = s.find(d)
160+
if idx < 0:
161+
continue
162+
163+
if min_idx is None or idx < min_idx:
164+
min_idx = idx
165+
min_delim = d
166+
167+
if min_idx is None or min_idx < 0:
168+
return s, '', None
169+
170+
return s[:min_idx], s[min_idx + 1:], min_delim
171+
173172
if not url:
174173
# Empty
175174
return Url()

pocsuite3/lib/utils/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,8 @@ def minimum_version_required(ver):
286286
from pkg_resources import parse_version
287287
v1, v2 = parse_version(ver), parse_version(__version__)
288288
if v1 > v2:
289-
logger.error(f'The minimum version required for this PoC plugin is {ver}, '
290-
f'you installed {__version__}, please upgrade pocsuite3 :)')
289+
logger.warning(f'The minimum version required for this PoC plugin is {ver}, '
290+
f'you installed {__version__}, please consider upgrading pocsuite3.')
291291
from pocsuite3.lib.core.data import conf
292292
from pocsuite3.lib.core.update import update
293293
conf.update_all = True

0 commit comments

Comments
 (0)