commit e18a32ea739ffb793ede966318740b062a71f559
parent 61a9f03ba52ad36fc462d8557309c41dfbfb9339
Author: Michael Constantine Dimopoulos <mk@mcdim.xyz>
Date: Mon, 11 Oct 2021 17:40:59 +0000
Minor improvements
Diffstat:
3 files changed, 43 insertions(+), 38 deletions(-)
diff --git a/src/houndsniff b/src/houndsniff
Binary files differ.
diff --git a/src/main.c b/src/main.c
@@ -7,11 +7,12 @@
/*
* Houndsniff
- * hash identification program in C
+ * hash identification
+ *
* by Michael Constantine Dimopoulos et al
*/
-#define VERSION "1.7"
+#define VERSION "1.8"
/* has uppercase letters */
static int
@@ -33,12 +34,13 @@ banner()
{
printf( " __ \n"
"(\\,------'()'--o Sniff.. \n"
- " l_ ) _ /-'' Sniff... \n"
- " /_)_) /_)_) \n\n");
+ " \\_ ) _ /-'' Sniff... \n"
+ " /_)_) /_)_) \n\n");
/*https://www.asciiart.eu/animals/dogs*/
printf( "Houndsniff - Hash Identification Program - Version %s\n"
- "By Michael Constantine Dimopoulos et al, 2020\n\n",VERSION);
+ "By Michael Constantine Dimopoulos et al <mk@mcdim.xyz>\n"
+ "\n",VERSION);
}
/* This is the first test;
@@ -48,27 +50,31 @@ banner()
void
definite(char string[], int length)
{
+ char *def = "[+] Definite identification";
+
if (string[0]=='$' && string[1]=='P' && string[2]=='$')
- printf("[+] Definite identification: Wordpress hash\n");
- else if (string[0]=='$' && string[1]=='1' && string[2]=='$')
- printf("[+] Definite identification: MD5 crypt(3)\n");
- else if (string[0]=='$' && string[1]=='5' && string[2]=='$')
- printf("[+] Definite identification: SHA256 crypt(3)\n");
- else if (string[0]=='$' && string[1]=='6' && string[2]=='$')
- printf("[+] Definite identification: SHA512 crypt(3)\n");
- else if (string[length-1]=='=')
- printf("[+] Definite identification: Base64 or Base32\n");
- else if (string[0]=='$' && string[1]=='a' && string[2]=='p' && string[3]=='r' && string[4]=='1' && string[5]=='$')
- printf("[+] Definite identification: APR1\n");
- else if (string[0]=='$' && string[1]=='H' && string[2]=='$')
- printf("[+] Definite identification: phpBB\n");
- else if (string[0]=='s' && string[1]=='h' && string[2]=='a' && string[3]=='1' && string[4]=='$')
- printf("[+] Definite identification: SHA1 Django\n");
- else if (length==65 && string[32]==':')
- printf("[+] Definite identification: MD5 Joomla (pass:salt)\n");
+ printf("%s Wordpress hash\n", def);
+ else if (string[0]=='$' && string[1]=='1' && string[2]=='$')
+ printf("%s MD5 crypt(3)\n", def);
+ else if (string[0]=='$' && string[1]=='5' && string[2]=='$')
+ printf("%s SHA256 crypt(3)\n", def);
+ else if (string[0]=='$' && string[1]=='6' && string[2]=='$')
+ printf("%s SHA512 crypt(3)\n", def);
+ else if (string[length-1]=='=')
+ printf("%s Base64 or Base32\n", def);
+ else if (string[0]=='$' && string[1]=='a' && string[2]=='p'
+ && string[3]=='r' && string[4]=='1' && string[5]=='$')
+ printf("%s APR1\n", def);
+ else if (string[0]=='$' && string[1]=='H' && string[2]=='$')
+ printf("%s phpBB\n", def);
+ else if (string[0]=='s' && string[1]=='h' && string[2]=='a' &&
+ string[3]=='1' && string[4]=='$')
+ printf("%s SHA1 Django\n", def);
+ else if (length==65 && string[32]==':')
+ printf("%s MD5 Joomla (pass:salt)\n", def);
}
-/* this function determines charset (used later for identification)*/
+/* this function determines charset*/
const char*
charset(char string[])
{
@@ -87,25 +93,24 @@ charset(char string[])
static void
help(void)
{
- printf( "Houndsniff is a hash recognition program. \n"
+ printf( "Houndsniff is a hash recognition tool.\n"
"It works by extracting some info about \n"
- "the hash and comparing it to info about \n"
- "other hashes in a local database. Then, \n"
- "it prints the matches sorted by popularity. \n"
- "Their popularity is determined by web \n"
+ "the hash and comparing it to info about\n"
+ "other hashes in a local database. Then,\n"
+ "it prints the matches sorted by their \n"
+ "popularity, which is determined by web \n"
"search result numbers in comparison to \n"
- "to other hashes with the same features \n\n"
+ "other hashes with the same features \n\n"
"If your hash includes a dollar sign ($)\n"
- "make sure you place it in between quotes. \n\n"
-
- "By Michael Constantine Dimopoulos et al \n"
- "Contributors: Christopher Wellons, Martin K. \n"
- " tuu & fizzie on ##c@freenode \n\n"
+ "make sure you place it in between quotes.\n\n"
- "Send missing hashes: houndsniff@protonmail.com \n\n"
+ "By Michael Constantine Dimopoulos et al\n"
+ "Contributors:"
+ "Christopher Wellons, Martin K.\n"
+ "tuu & fizzie on ##c@freenode\n\n"
- "-h to display this panel and exit \n"
+ "-h to display this panel and exit\n"
"-l to list supported hashing algorithms\n"
"\nUsage: hound [HASH]\n");
}
@@ -122,9 +127,9 @@ main(int argc, char* argv[])
list();
} else {
int len = strlen(argv[1]);
+ const char* chars = charset(argv[1]);
printf("Hash: %s\n", argv[1]);
printf("Length: %d\n",len);
- const char* chars = charset(argv[1]);
printf("Charset: %s\n\n", chars);
sel(len, chars);
definite(argv[1], len);
diff --git a/src/select.c b/src/select.c
@@ -126,7 +126,7 @@ list(void)
puts(hashes[i].name);
}
- /* hashes from definite(); */
+ /* hashes from main.c:definite(); */
printf( "Wordpress hash \n"
"MD5 crypt(3) \n"
"SHA256 crypt(3)\n"