Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a54c261

Browse files
committed
Minor update for Issues #292 & #293 (only single alert per target)
1 parent 5c2451d commit a54c261

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

lib/controller/checks.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -521,15 +521,18 @@ def genCmpPayload():
521521
injection.conf.regexp = conf.regexp
522522
injection.conf.optimize = conf.optimize
523523

524-
if conf.beep:
525-
beep()
524+
if not kb.alerted:
525+
if conf.beep:
526+
beep()
526527

527-
if conf.alert:
528-
infoMsg = "executing alerting shell command(s) ('%s')" % conf.alert
529-
logger.info(infoMsg)
528+
if conf.alert:
529+
infoMsg = "executing alerting shell command(s) ('%s')" % conf.alert
530+
logger.info(infoMsg)
531+
532+
process = execute(conf.alert, shell=True)
533+
process.wait()
530534

531-
process = execute(conf.alert, shell=True)
532-
process.wait()
535+
kb.alerted = True
533536

534537
# There is no need to perform this test for other
535538
# <where> tags

lib/core/option.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1480,6 +1480,7 @@ def _setKnowledgeBaseAttributes(flushAll=True):
14801480

14811481
kb.absFilePaths = set()
14821482
kb.adjustTimeDelay = None
1483+
kb.alerted = False
14831484
kb.alwaysRefresh = None
14841485
kb.arch = None
14851486
kb.authHeader = None

0 commit comments

Comments
 (0)