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

Commit

Permalink
Merge pull request #130 from wufeifei/develop
Browse files Browse the repository at this point in the history
improves something else
  • Loading branch information
FeeiCN authored Sep 22, 2016
2 parents 87e495b + 4c2d4fc commit d545ec5
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions engine/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,19 @@ def is_annotation(self):
else:
return len(match_result) > 0

def is_can_parse(self):
"""
是否可以进行解析参数是否可控的操作
:return:
"""
return self.file_path[-3:] == 'php' or self.file_path[-4:] == 'java'

def push_third_party_vulnerabilities(self, vulnerabilities_id):
"""
推送到第三方漏洞管理平台
:param vulnerabilities_id:
:return:
"""
try:
q = Queue(self.project_name, self.third_party_vulnerabilities_name, self.third_party_vulnerabilities_type, self.file_path, self.line_number, self.code_content, vulnerabilities_id)
q.push()
Expand Down Expand Up @@ -270,7 +282,7 @@ def scan(self):
else:
found_vul = False
# 判断参数是否可控
if self.rule_repair.strip() != '':
if self.is_can_parse() and self.rule_repair.strip() != '':
try:
parse_instance = parse.Parse(self.rule_location, self.file_path, self.line_number, self.code_content)
if parse_instance.is_controllable_param():
Expand Down Expand Up @@ -356,7 +368,7 @@ def repair(self):
else:
found_vul = False
# 判断参数是否可控
if self.rule_repair.strip() != '':
if self.is_can_parse() and self.rule_repair.strip() != '':
try:
parse_instance = parse.Parse(self.rule_location, self.file_path, self.line_number, self.code_content)
if parse_instance.is_controllable_param():
Expand Down

0 comments on commit d545ec5

Please sign in to comment.