From 55eb10f7080d06210f8acff8df77f993d9ebbf7d Mon Sep 17 00:00:00 2001 From: Stephen Tomkinson Date: Fri, 16 Jan 2026 19:10:24 +0000 Subject: [PATCH 1/6] Add missing sleep. In the event the potfile has changed size triggering a HTTP request which failled, the old code would loop without sleeping. --- HashmobAPI.py | 1 + 1 file changed, 1 insertion(+) diff --git a/HashmobAPI.py b/HashmobAPI.py index 2b2ac84..67d85a8 100644 --- a/HashmobAPI.py +++ b/HashmobAPI.py @@ -128,6 +128,7 @@ def main(): else: logging.error(f'Failed to send new finds! We were given a status code of {response.status_code}. ' 'Retrying after resubmission delay...') + time.sleep(resubmission_delay) except Exception as e: logging.error(f'Error encountered when trying to send new finds: {e}') From 3132c1f85d5fd236776aee3fa1715c5e00891d85 Mon Sep 17 00:00:00 2001 From: Stephen Tomkinson Date: Fri, 16 Jan 2026 19:13:02 +0000 Subject: [PATCH 2/6] Remove unused variable --- HashmobAPI.py | 1 - 1 file changed, 1 deletion(-) diff --git a/HashmobAPI.py b/HashmobAPI.py index 67d85a8..b700236 100644 --- a/HashmobAPI.py +++ b/HashmobAPI.py @@ -7,7 +7,6 @@ import time CONFIG_PATH = 'hashmob_config.ini' -POTFILE_PATH = 'hashcat.potfile' API_ENDPOINT = 'https://hashmob.net/api/v2/submit' From 462d556d7ca0f542ece1c017c27aa65e1eff6012 Mon Sep 17 00:00:00 2001 From: Stephen Tomkinson Date: Fri, 16 Jan 2026 19:15:16 +0000 Subject: [PATCH 3/6] Added requirements.txt to capture dependencies --- requirements.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..f229360 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +requests From cd1d540c3736e653feae5868228effb6a9cfc405 Mon Sep 17 00:00:00 2001 From: Stephen Tomkinson Date: Sat, 17 Jan 2026 10:16:57 +0000 Subject: [PATCH 4/6] Move API endpoint into config file to support alternative endpoints, e.g. SteppingStones --- HashmobAPI.py | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/HashmobAPI.py b/HashmobAPI.py index b700236..31ad83b 100644 --- a/HashmobAPI.py +++ b/HashmobAPI.py @@ -1,4 +1,4 @@ -from configparser import ConfigParser +from configparser import ConfigParser, DuplicateSectionError from pathlib import Path import logging import requests @@ -7,7 +7,7 @@ import time CONFIG_PATH = 'hashmob_config.ini' -API_ENDPOINT = 'https://hashmob.net/api/v2/submit' +DEFAULT_API_ENDPOINT = 'https://hashmob.net/api/v2/submit' def setup(): @@ -73,14 +73,27 @@ def main(): # Use defined config or ask for defaults on first time try: + api_endpoint = config['API']['api_endpoint'] + except KeyError: + try: + config.add_section('API') + except DuplicateSectionError: + pass + + # We're here because no api_endpoint was defined, so don't need to worry about overwriting it + config['API']['api_endpoint'] = DEFAULT_API_ENDPOINT + api_endpoint = DEFAULT_API_ENDPOINT + + try: + # If we've got this far, we can safely assume the API section exists api_key = config['API']['api_key'] - resubmission_delay = int(config['API']['resubmission_delay']) except KeyError: - config.add_section('API') - api_key = input("Enter your API key: ") config['API']['api_key'] = api_key + try: + resubmission_delay = int(config['API']['resubmission_delay']) + except KeyError: while not (resubmission_delay := input("Enter the delay between resubmissions in seconds: ")).isdigit(): print('Please provide an integer for the delay!') @@ -115,7 +128,7 @@ def main(): # Upload data to API try: - response = upload_to_api(data, API_ENDPOINT, api_key) + response = upload_to_api(data, api_endpoint, api_key) if response.status_code == 200: logging.info('Successfully sent new finds!') previous_size = os.path.getsize(potfile_path) From 64873872305ccc0e37543dff3daca2144b3e7eec Mon Sep 17 00:00:00 2001 From: Stephen Tomkinson Date: Sat, 17 Jan 2026 10:27:57 +0000 Subject: [PATCH 5/6] Made readme file match program behaviour --- README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a271f0a..1220e49 100644 --- a/README.md +++ b/README.md @@ -17,20 +17,19 @@ Before using this script, ensure you have the following installed: 3. Run the script using the following command: -python hashcat_parser.py +python hashcat_parser.py /path/to/hashcat.potfile 4. Follow the prompts to enter the required information: -- Path to the `hashcat.potfile` -- Path for the JSON output file -- API endpoint URL - API key -- Value for the 'algorithm' - Delay between resubmissions in seconds +- Value for the 'algorithm' (i.e. hashcat mode number) 5. The script will continuously monitor the `hashcat.potfile`, converting its contents into JSON format and uploading them to the specified API endpoint. It will wait for the specified delay between resubmissions. -**Note:** This script was written to submit hashes to Hashmob.net's API and does not currently support salted submissions, though their API does. +**Note 1:** This script was written to submit hashes to Hashmob.net's API and does not currently support salted submissions, though their API does. + +**Note 2:** The API endpoint can be modified in the `hashmob_config.ini` file created on first run. ## Contributing From 04ef994dae4cea9eed68ebca354d017bb65e5ecb Mon Sep 17 00:00:00 2001 From: Stephen Tomkinson Date: Sat, 17 Jan 2026 10:32:32 +0000 Subject: [PATCH 6/6] Further readme corrections --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1220e49..f4db087 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This Python script allows you to parse a `hashcat.potfile`, convert its contents Before using this script, ensure you have the following installed: - Python 3 -- Requests library (install via `pip install requests`) +- Requests library (install via `pip install -r requirements.txt`) ## Usage @@ -17,7 +17,7 @@ Before using this script, ensure you have the following installed: 3. Run the script using the following command: -python hashcat_parser.py /path/to/hashcat.potfile +python HashmobAPI.py /path/to/hashcat.potfile 4. Follow the prompts to enter the required information: