Skip to content

Commit

Permalink
fixes knownsec#149 && 修复--pocs-path参数
Browse files Browse the repository at this point in the history
  • Loading branch information
mku16 committed Mar 5, 2021
1 parent 15b0270 commit ebd00c6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,4 +212,9 @@ Cross-platform shell code generation

# version 1.7.2
-----------------
* 增加powershell bash反弹shell 以及编码函数
* 增加powershell bash反弹shell 以及编码函数

# version 1.7.2
-----------------
* 修复批量执行poc时因为报错导致扫描中断问题 fixes #149
* 修复--pocs-path参数bug
2 changes: 1 addition & 1 deletion pocsuite3/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__title__ = 'pocsuite'
__version__ = '1.7.3'
__version__ = '1.7.4'
__author__ = 'Knownsec Security Team'
__author_email__ = '[email protected]'
__license__ = 'GPL 2.0'
Expand Down
3 changes: 3 additions & 0 deletions pocsuite3/lib/core/option.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,9 @@ def _set_user_pocs_path():
if conf.pocs_path:
if check_path(conf.pocs_path):
paths.USER_POCS_PATH = conf.pocs_path
for root, dirs, files in os.walk(paths.USER_POCS_PATH):
files = list(filter(lambda x: not x.startswith("__") and x.endswith(".py"), files))
conf.poc = [paths.USER_POCS_PATH + "\\" + f for f in files]
else:
warm_msg = "User defined pocs path {0} is invalid".format(conf.pocs_path)
logger.warn(warm_msg)
Expand Down
5 changes: 4 additions & 1 deletion pocsuite3/lib/core/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ def exec_module(self, module):
poc_code = self.get_data(filename)
self.check_requires(poc_code)
obj = compile(poc_code, filename, 'exec', dont_inherit=True, optimize=-1)
exec(obj, module.__dict__)
try:
exec(obj, module.__dict__)
except Exception as err:
logger.error("Poc: '{}' exec arise error: {} ".format(filename,err))


def load_file_to_module(file_path, module_name=None):
Expand Down

0 comments on commit ebd00c6

Please sign in to comment.