houndsniff

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 3ad5709f3dd3fd18865d6873ea7cdbf7b25c75e7
parent 20d400104da79f9d9886ef2e9b311532ef2cd340
Author: MichaelDim02 <31562759+MichaelDim02@users.noreply.github.com>
Date:   Fri, 25 Sep 2020 22:10:38 +0000

Add files via upload
Diffstat:
Ahound | 0
Asrc/hashes | 0
Asrc/list.txt | 52++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/main.c | 102+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/select.c | 44++++++++++++++++++++++++++++++++++++++++++++
Asrc/select.h | 3+++
Asrc/upp.c | 21+++++++++++++++++++++
Asrc/upp.h | 2++
8 files changed, 224 insertions(+), 0 deletions(-)

diff --git a/hound b/hound Binary files differ. diff --git a/src/hashes b/src/hashes Binary files differ. diff --git a/src/list.txt b/src/list.txt @@ -0,0 +1,52 @@ +MD5 + +SHA1 +SHA256 +SHA224 +SHA384 +SHA512 +RIPEMD160 +MD4 +MD2 +CRC32b +ADLER32 +CRYPT16 +LanManager Hash +Windows NT-Hash +MSSQL 2000 +MSSQL 2005 +MySQL 3.2.3 +DES Crypt +FreeBSD nthash +CRC32 +HAVAL128,5 +HAVAL128,4 +HAVAL128,3 +HAVAL256,5 +HAVAL224,5 +HAVAL192,5 +HAVAL160,5 +HAVAL224,4 +HAVAL192,4 +HAVAL160,4 +HAVAL256,3 +HAVAL224,3 +HAVAL192,3 +HAVAL160,3 +Whirpool +GOST Hash +Snefru-128 +RIPEMD128 +RIPEMD256 +RIPEMD320 +Tiger128,3 +Tiger160,3 +Tiger192,3 +Tiger128,4 +Tiger160,4 +Tiger192,4 +LM +Wordpress hash +MD5 crypt(3) +SHA256 crypt(3) +SHA512 crypt(3) diff --git a/src/main.c b/src/main.c @@ -0,0 +1,102 @@ +#include <stdio.h> +#include <stdbool.h> +#include <string.h> +#include <stdlib.h> +#include "upp.h" +#include "select.h" + +void banner(float vesion){ + printf(" __ \n"); + printf("(\\,------'()'--o Sniff..\n"); + printf(" l_ ) _ /-'' Sniff...\n"); + printf(" /_)_) /_)_)\n\n"); + + //https://www.asciiart.eu/animals/dogs + + printf("Houndsniff - Hash Identification Program - Version %.1f\nBy MCD\n\n",vesion); +} + +void list_() { + printf("\nHoundsniff supports:\n\n"); +int c; + FILE *file; + file = fopen("list.txt", "r"); + if (file) { + while ((c = getc(file)) != EOF) + putchar(c); + fclose(file); + } + +} + +void definite(char string[1000], int length){ + if (string[0]=='$' && string[1]=='P' && string[2]=='$'){ + printf("[+] Definite identification: Wordpress hash\n"); + exit(0); + } else if (string[0]=='$' && string[1]=='1' && string[2]=='$'){ + printf("[+] Definite identification: MD5 crypt(3)\n"); + exit(0); + } else if (string[0]=='$' && string[1]=='5' && string[2]=='$'){ + printf("[+] Definite identification: SHA256 crypt(3)\n"); + exit(0); + } else if (string[0]=='$' && string[1]=='6' && string[2]=='$'){ + printf("[+] Definite identification: SHA512 crypt(3)\n"); + exit(0); + } else if (string[length-1]=='=') { + printf("[+] Definite identification: Base64\n"); + exit(0); + } +} + +const char* charset(char string[1000]){ + const char* result; + if (strchr(string, '$') != NULL){ + return "b"; + } else if (strchr(string, '/') != NULL){ + return "c"; + } else if (string[0]=='0' && string[1]=='x' && string[2]=='0'){ + return "d"; + } else if (hasUpper(string)==true) { + return "e"; + } else { + return "a"; + } +} + +void help(){ + printf("Houndsniff is a hash recognition program\n"); + printf("It works by extracting some info about the\n"); + printf("the hash and comparing it to info about\n"); + printf("other hashes in an SQLite database. Then,\n"); + printf("it prints the matches sorted by popularity.\n"); + printf("Their popularity is determined by Google\n"); + printf("search result numbers in comparison to\n"); + printf("to other hashes with the same characteristcs\n\n"); + printf("If your hash includes a dollar sign ($), make\nsure you place it in between quotes.\n\n"); + printf("Send missing hashes at houndsniff@protonmail.com\n\n"); + printf("-h to display this panel and exit\n"); + printf("-l to list supported hashing algorithms\n"); + printf("\nUsage: hound [HASH]\n"); +} +int main(int argc, char* argv[]) { + float version = 1.0; + banner(version); + if(argc>1){ + if(strcmp(argv[1],"-h")==0 || strcmp(argv[1],"--help")==0){ + help(); + } else if(strcmp(argv[1], "-l")==0) { + list_(); + } else { + int len = strlen(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); + } + } else { + printf("Usage: hound [HASH] or -h for help\n"); + } + return 0; +} diff --git a/src/select.c b/src/select.c @@ -0,0 +1,44 @@ +#include <sqlite3.h> +#include <stdio.h> +#include <string.h> +#include <stdlib.h> +#include "select.h" + +int counter = 0; +int callback(void *, int, char **, char **); +int sel(int length, const char *charset); + +int sel(int length, const char *charset) { + sqlite3 *db; + char *err_msg = 0; + //int count = 0; + + int rc = sqlite3_open("hashes", &db); + char sql[1150], len[5], pt2[30], pt3[40]; + + strcpy(sql, "SELECT name FROM hashes WHERE length="); + sprintf(len, "%d", length); + strcpy(pt2, " AND charset='"); + strcpy(pt3, "' ORDER BY popularity DESC;"); + + strcat(sql, len); + strcat(sql, pt2); + strcat(sql, charset); + strcat(sql, pt3); + rc = sqlite3_exec(db, sql, callback, 0, &err_msg); + sqlite3_close(db); + + return 0; +} + +int callback(void *unused, int argc, char **argv, char **azColName) { + counter++; + for (int i = 0; i < argc; i++) { + if (counter == 1) { + printf("Possible results:\n\n[%d] %s", counter, argv[i] ? argv[i] : "NULL"); + } else { + printf("[%d] %s", counter, argv[i] ? argv[i] : "NULL"); + } + } printf("\n"); + return 0; +} diff --git a/src/select.h b/src/select.h @@ -0,0 +1,3 @@ +//int counter = 0; +int callback(void *, int, char **, char **); +int sel(int length, const char *charset); diff --git a/src/upp.c b/src/upp.c @@ -0,0 +1,21 @@ +#include <stdio.h> +#include <stdbool.h> +#include <string.h> +#include "upp.h" + +bool hasUpper(char ch[600]); + +bool hasUpper(char ch[600]) { + + bool hup = false; + + int len = strlen(ch); + + for (int i=0; i<len; i++) { + if (ch[i] >= 'A' && ch[i] <= 'Z') { + hup = true; + break; + } //else if (ch[i] >= 'a' && ch[i] <= 'z') { + } + return hup; +} diff --git a/src/upp.h b/src/upp.h @@ -0,0 +1,2 @@ +#include <stdbool.h> +bool hasUpper(char ch[600]);