diff options
| author | 2026-11-11 05:31:06 +0000 | |
|---|---|---|
| committer | 2026-11-11 06:14:42 +0000 | |
| commit | 9e1d304cac5367c3dbb1ca14700736680bd3a804 (patch) | |
| tree | 31f328747acb934d365d423adfda144818ff5ad4 /02/src/cracking.h | |
| download | lab-01-05-9e1d304cac5367c3dbb1ca14700736680bd3a804.tar.gz | |
Diffstat (limited to '02/src/cracking.h')
| -rw-r--r-- | 02/src/cracking.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/02/src/cracking.h b/02/src/cracking.h new file mode 100644 index 0000000..0173dbb --- /dev/null +++ b/02/src/cracking.h | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | /// src/cracking.h --- password cracking utilities | ||
| 2 | // | ||
| 3 | // Copyright (c) 2026 Martin Michalec <martin@michalec.dev> | ||
| 4 | // | ||
| 5 | // SPDX-License-Identifier: MIT | ||
| 6 | // | ||
| 7 | /// Commentary: | ||
| 8 | // | ||
| 9 | /// Code: | ||
| 10 | |||
| 11 | #ifndef INCLUDED_CRACKING_H | ||
| 12 | #define INCLUDED_CRACKING_H | ||
| 13 | |||
| 14 | #include <stdio.h> | ||
| 15 | #include <unistd.h> | ||
| 16 | |||
| 17 | #include "string-builder.h" | ||
| 18 | #include "string-view.h" | ||
| 19 | |||
| 20 | struct shell { | ||
| 21 | FILE *in; | ||
| 22 | FILE *out; | ||
| 23 | pid_t pid; | ||
| 24 | }; | ||
| 25 | |||
| 26 | void password_bump (STRING_BUILDER); | ||
| 27 | bool test_credentials (struct shell, | ||
| 28 | struct string_view login, | ||
| 29 | struct string_view password); | ||
| 30 | struct shell spawn_shell (void); | ||
| 31 | void close_shell (struct shell); | ||
| 32 | |||
| 33 | #endif // INCLUDED_CRACKING_H | ||
| 34 | |||
| 35 | /// src/cracking.h ends here | ||
