Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
boy-hack committed Oct 22, 2019
1 parent ed33438 commit 054c0e2
Showing 3 changed files with 17 additions and 5 deletions.
5 changes: 4 additions & 1 deletion pocsuite3/cli.py
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@

from pocsuite3.lib.core.option import init
from pocsuite3.lib.core.option import init_options
from pocsuite3.lib.core.exception import PocsuiteUserQuitException
from pocsuite3.lib.core.exception import PocsuiteUserQuitException, PocsuiteSystemException
from pocsuite3.lib.core.exception import PocsuiteShellQuitException
from pocsuite3.lib.core.common import set_paths
from pocsuite3.lib.core.common import banner
@@ -62,6 +62,9 @@ def main():
except PocsuiteShellQuitException:
pass

except PocsuiteSystemException:
pass

except KeyboardInterrupt:
pass

8 changes: 4 additions & 4 deletions pocsuite3/lib/core/option.py
Original file line number Diff line number Diff line change
@@ -305,6 +305,8 @@ def _set_user_pocs_path():
def _set_pocs_modules():
# TODO
# load poc scripts .pyc file support
if conf.ssvid:
conf.plugins.append('poc_from_seebug')
if conf.poc:
# step1. load system packed poc from pocsuite3/pocs folder
exists_poc_with_ext = list(
@@ -341,7 +343,6 @@ def _set_pocs_modules():
logger.info(info_msg)
if "poc_from_seebug" not in conf.plugins:
conf.plugins.append('poc_from_seebug')
load_poc_sucess = True

load_keyword_poc_sucess = False
if conf.vul_keyword:
@@ -636,11 +637,10 @@ def init():
update()
_set_multiple_targets()
_set_user_pocs_path()
_set_plugins() # load plugins
_set_pocs_modules() # poc module模块要在插件模块前,poc选项中某些参数调用了插件
_set_plugins()
_init_targets_plugins()
_init_pocs_plugins()
# this method should put the end,because plugin also load poc
_set_pocs_modules()
_set_task_queue()
_init_results_plugins()

9 changes: 9 additions & 0 deletions pocsuite3/plugins/poc_from_seebug.py
Original file line number Diff line number Diff line change
@@ -38,5 +38,14 @@ def init(self):
info_msg = "[PLUGIN] load PoC script '{0}' from seebug failed".format(poc_item['name'])
logger.info(info_msg)

if conf.ssvid:
ssvid = conf.ssvid
poc = self.seebug.fetch_poc(ssvid)
if poc and self.add_poc(poc):
info_msg = "[PLUGIN] load PoC script 'ssvid-{0}' from seebug success".format(ssvid)
else:
info_msg = "[PLUGIN] load PoC script 'ssvid-{0}' from seebug failed".format(ssvid)
logger.info(info_msg)


register_plugin(PocFromSeebug)

0 comments on commit 054c0e2

Please sign in to comment.