Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

bounds checking for jitter #1332

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lib/common/empire.py
Original file line number Diff line number Diff line change
Expand Up @@ -1326,6 +1326,10 @@ def do_sleep(self, line):
if len(parts) == 3:
jitter = parts[2]

if jitter < 0 or jitter >= 1:
print helpers.color("[!] Jitter is a decimal between 0.0 and 1.0'")
return

allAgents = self.mainMenu.agents.get_agents_db()

for agent in allAgents:
Expand Down Expand Up @@ -1357,6 +1361,10 @@ def do_sleep(self, line):
if len(parts) == 3:
jitter = parts[2]

if jitter < 0 or jitter >= 1:
print helpers.color("[!] Jitter is a decimal between 0.0 and 1.0'")
return

if sessionID and len(sessionID) != 0:
# update this agent's information in the database
self.mainMenu.agents.set_agent_field_db('delay', delay, sessionID)
Expand Down