Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Commit

Permalink
fix #570
Browse files Browse the repository at this point in the history
FeeiCN committed Sep 12, 2017

Verified

This commit was signed with the committer’s verified signature.
bcoe Benjamin E. Coe
1 parent a60cd60 commit 27f0fd2
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cobra/cast.py
Original file line number Diff line number Diff line change
@@ -286,7 +286,7 @@ def is_controllable_param(self):
logger.debug("[AST] Not Java/PHP, can't parse ({l})".format(l=self.language))
return False, self.data
else:
logger.warning("[AST] Can't get `param`, check built-in rule")
logger.debug("[AST] Can't get `param`, check built-in rule")
return False, self.data

def match(self, rule, block_id):
6 changes: 4 additions & 2 deletions cobra/engine.py
Original file line number Diff line number Diff line change
@@ -175,9 +175,11 @@ def store(result):
return False
logger.info('[PUSH] {rc} Rules'.format(rc=len(rules)))
push_rules = []
off_rules = 0
for idx, single_rule in enumerate(rules):
if single_rule['status'] is False:
logger.info('[CVI-{cvi}] [STATUS] OFF, CONTINUE...'.format(cvi=single_rule['id']))
off_rules += 1
logger.debug('[CVI-{cvi}] [STATUS] OFF, CONTINUE...'.format(cvi=single_rule['id']))
continue
# SR(Single Rule)
logger.debug("""[PUSH] [CVI-{cvi}] {idx}.{name}({language})""".format(
@@ -227,7 +229,7 @@ def store(result):
if vn == 0:
logger.info('[SCAN] Not found vulnerability!')
else:
logger.info("[SCAN] Trigger Rules: {tr} Vulnerabilities ({vn})\r\n{table}".format(tr=len(trigger_rules), vn=len(find_vulnerabilities), table=table))
logger.info("[SCAN] Trigger Rules/Not Trigger Rules/Off Rules: {tr}/{ntr}/{fr} Vulnerabilities ({vn})\r\n{table}".format(tr=len(trigger_rules), ntr=len(diff_rules), fr=off_rules, vn=len(find_vulnerabilities), table=table))
if len(diff_rules) > 0:
logger.info('[SCAN] Not Trigger Rules ({l}): {r}'.format(l=len(diff_rules), r=','.join(diff_rules)))

2 changes: 1 addition & 1 deletion cobra/export.py
Original file line number Diff line number Diff line change
@@ -130,7 +130,7 @@ def write_to_file(target, sid, output_format='', filename=None):
:return:
"""
if not filename:
logger.info('[EXPORT] No filename given, nothing exported.')
logger.debug('[EXPORT] No filename given, nothing exported.')
return False

scan_data_file = os.path.join(running_path, '{sid}_data'.format(sid=sid))

0 comments on commit 27f0fd2

Please sign in to comment.