Last active
August 26, 2020 20:02
-
-
Save TheLukeGuy/b56d52a8c91b591d915b76f8401c2b78 to your computer and use it in GitHub Desktop.
SSH brute force time test based on thread count.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Start config | |
ATTEMPT_SECONDS = 1.694 | |
COMBINATIONS = 56800235584 | |
# End config | |
threads = float(input("Threads: ")) | |
tests_per_second = threads / ATTEMPT_SECONDS | |
tests_per_minute = tests_per_second * 60 | |
tests_per_hour = tests_per_minute * 60 | |
hours = COMBINATIONS / tests_per_hour | |
days = hours / 24 | |
print("\nHours at full-speed: " + str(hours)) | |
print("As days: " + str(days)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import subprocess | |
import time | |
from threading import Thread | |
# Start config | |
ATTEMPT_SECONDS = 1.694 | |
COMBINATIONS = 56800235584 | |
# End config | |
threads = float(input("Threads: ")) | |
done = 0 | |
def thread_test(): | |
global done | |
subprocess.run(["sleep", str(ATTEMPT_SECONDS)]) | |
done += 1 | |
print("Running test...") | |
start_time = time.time() | |
for _ in range(int(threads)): | |
Thread(target=thread_test, daemon=True).start() | |
while done < threads: | |
continue | |
elapsed_time = time.time() - start_time | |
tests_per_second = threads / elapsed_time | |
tests_per_minute = tests_per_second * 60 | |
tests_per_hour = tests_per_minute * 60 | |
hours = COMBINATIONS / tests_per_hour | |
days = hours / 24 | |
print("\nHours: " + str(hours)) | |
print("As days: " + str(days)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment