Skip to content
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
20 changes: 10 additions & 10 deletions credmaster.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def Execute(self, args):
##
pluginargs['thread_count'] = self.thread_count

self.start_time = datetime.datetime.utcnow()
self.start_time = datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None)
self.log_entry(f"Execution started at: {self.start_time}")

# Check with plugin to make sure it has the data that it needs
Expand Down Expand Up @@ -322,7 +322,7 @@ def Execute(self, args):

self.weekdaywarrior = int(self.weekdaywarrior)
sleep_time = self.ww_calc_next_spray_delay(self.weekdaywarrior)
next_time = datetime.datetime.utcnow() + datetime.timedelta(hours=self.weekdaywarrior) + datetime.timedelta(minutes=sleep_time)
next_time = datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None) + datetime.timedelta(hours=self.weekdaywarrior) + datetime.timedelta(minutes=sleep_time)
self.log_entry(f"Weekday Warrior: sleeping {sleep_time} minutes until {next_time.strftime('%H:%M')} on {spray_days[next_time.weekday()]} in UTC {self.weekdaywarrior}")
time.sleep(sleep_time*60)

Expand All @@ -342,19 +342,19 @@ def Execute(self, args):

if self.delay is None or len(passwords) == 1 or password == passwords[len(passwords)-1]:
if self.userpassfile != None:
self.log_entry(f"Completed spray with user-pass file {self.userpassfile} at {datetime.datetime.utcnow()}")
self.log_entry(f"Completed spray with user-pass file {self.userpassfile} at {datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None)}")
elif self.userenum:
self.log_entry(f"Completed userenum at {datetime.datetime.utcnow()}")
self.log_entry(f"Completed userenum at {datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None)}")
else:
self.log_entry(f"Completed spray with password {password} at {datetime.datetime.utcnow()}")
self.log_entry(f"Completed spray with password {password} at {datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None)}")

notify.notify_update(f"Info: Spray complete.", self.notify_obj)
continue
elif count != self.passwordsperdelay:
self.log_entry(f"Completed spray with password {password} at {datetime.datetime.utcnow()}, moving on to next password...")
self.log_entry(f"Completed spray with password {password} at {datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None)}, moving on to next password...")
continue
else:
self.log_entry(f"Completed spray with password {password} at {datetime.datetime.utcnow()}, sleeping for {self.delay} minutes before next password spray")
self.log_entry(f"Completed spray with password {password} at {datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None)}, sleeping for {self.delay} minutes before next password spray")
self.log_entry(f"Valid credentials discovered: {len(self.results)}")
for success in self.results:
self.log_entry(f"Valid: {success['username']}:{success['password']}")
Expand All @@ -376,7 +376,7 @@ def Execute(self, args):
self.log_entry("Second KeyboardInterrupt detected, unable to clean up APIs :( try the --clean option")

# Capture duration
self.end_time = datetime.datetime.utcnow()
self.end_time = datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None)
self.time_lapse = (self.end_time-self.start_time).total_seconds()

# Print stats
Expand Down Expand Up @@ -629,7 +629,7 @@ def ww_calc_next_spray_delay(self, offset):

spray_times = [8,12,14] # launch sprays at 7AM, 11AM and 3PM

now = datetime.datetime.utcnow() + datetime.timedelta(hours=offset)
now = datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None) + datetime.timedelta(hours=offset)
hour_cur = int(now.strftime("%H"))
minutes_cur = int(now.strftime("%M"))
day_cur = int(now.weekday())
Expand Down Expand Up @@ -675,7 +675,7 @@ def log_entry(self, entry):

self.lock.acquire()

ts = datetime.datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3]
ts = datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None).strftime('%Y-%m-%d %H:%M:%S.%f')[:-3]
print(f"[{ts}] {entry}")

if self.outfile is not None:
Expand Down