This is th initial commit of rizzlehash
rizzlehash was originally write on python but now rewrite on C++
This commit is contained in:
46
include/CPUID.h
Normal file
46
include/CPUID.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright © 2015 Matthieu DUVAL, Rudy DUCHE
|
||||
*
|
||||
* This file is part of RizzleHash.
|
||||
*
|
||||
* RizzleHash is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* RizzleHash is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with RizzleHash. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
#ifndef CPUID_H_INCLUDED
|
||||
#define CPUID_H_INCLUDED
|
||||
|
||||
#include <string>
|
||||
#include <cpuid.h>
|
||||
#include <stdint.h>
|
||||
|
||||
//#include <w32api.h>
|
||||
|
||||
class CPUID{
|
||||
uint32_t regs[4];
|
||||
public:
|
||||
explicit CPUID(unsigned eax , unsigned ecx)
|
||||
{
|
||||
asm volatile ("cpuid":"=a"(regs[0]),
|
||||
"=b"(regs[1]),
|
||||
"=c"(regs[2]),
|
||||
"=d"(regs[3]):
|
||||
"a"(eax),"c"(ecx));
|
||||
}
|
||||
const uint32_t &EAX() const {return regs[0];}
|
||||
const uint32_t &EBX() const {return regs[1];}
|
||||
const uint32_t &ECX() const {return regs[2];}
|
||||
const uint32_t &EDX() const {return regs[3];}
|
||||
|
||||
};
|
||||
#endif // CPUID_H_INCLUDED
|
||||
92
include/RH_Constants.h
Normal file
92
include/RH_Constants.h
Normal file
@@ -0,0 +1,92 @@
|
||||
/*
|
||||
* Copyright © 2015 Matthieu DUVAL, Rudy DUCHE
|
||||
*
|
||||
* This file is part of RizzleHash.
|
||||
*
|
||||
* RizzleHash is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* RizzleHash is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with RizzleHash. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
#ifndef RH_CONSTANTS_H
|
||||
#define RH_CONSTANTS_H
|
||||
|
||||
#include <string>
|
||||
#include <list>
|
||||
#include "CPUID.h"
|
||||
//#include <w32api.h>
|
||||
using namespace std;
|
||||
class RH_Constants
|
||||
{
|
||||
private:
|
||||
RH_Constants();
|
||||
static list<char> trimProcName(int32_t * value, int taille);
|
||||
|
||||
public:
|
||||
static string getOSName();
|
||||
static string getOSFamily();
|
||||
static int getNumberOfCore();
|
||||
static string getProcessorVendor();
|
||||
static string getProcessorName();
|
||||
};
|
||||
|
||||
namespace PARAMS_CONSTANTS
|
||||
{
|
||||
|
||||
namespace LONG_PARAMS
|
||||
{
|
||||
const string VERBOSE = "--verbose";
|
||||
const string HELP = "--help";
|
||||
const string MODE = "--mode";
|
||||
const string HASH = "--hash";
|
||||
const string ENCRYPTION_KEY = "--key";
|
||||
const string PORT = "--port";
|
||||
const string SERVER_IP = "--ip";
|
||||
const string ROLE = "--role";
|
||||
const string SECRET_PARAM = "--cd";
|
||||
const string CORE = "--core";
|
||||
const string MAX_LENGTH = "--length";
|
||||
}
|
||||
|
||||
namespace SHORT_PARAMS
|
||||
{
|
||||
const string VERBOSE = "-v";
|
||||
const string HELP = "-h";
|
||||
const string MODE = "-m";
|
||||
const string ENCRYPTION_KEY = "-k";
|
||||
const string PORT = "-p";
|
||||
const string SERVER_IP = "-s";
|
||||
const string ROLE = "-r";
|
||||
const string CORE = "-c";
|
||||
const string MAX_LENGTH = "-l";
|
||||
}
|
||||
|
||||
namespace PARAMS_VALUE
|
||||
{
|
||||
const string MODE_LOCAL = "local";
|
||||
const string MODE_LAN = "lan";
|
||||
const string ROLE_CLIENT = "client";
|
||||
const string ROLE_SERVER = "server";
|
||||
}
|
||||
}
|
||||
|
||||
static const string APPLICATION_NAME("RizzleHash V0.8 - rc1");
|
||||
static const string APPLICATION_YEAR("2015");
|
||||
static const string APPLICATION_AUTHORS("Matthieu DUVAL,Rudy DUCHE");
|
||||
static const string OS(RH_Constants::getOSName());
|
||||
static const int NB_CORE(RH_Constants::getNumberOfCore());
|
||||
static const string PROCESSOR_VENDOR(RH_Constants::getProcessorVendor());
|
||||
static const string PROCESSOR_NAME(RH_Constants::getProcessorName());
|
||||
|
||||
|
||||
|
||||
#endif // RH_CONSTANTS_H
|
||||
33
include/RH_Encryption.h
Normal file
33
include/RH_Encryption.h
Normal file
@@ -0,0 +1,33 @@
|
||||
#ifndef RH_ENCRYPTION_H
|
||||
#define RH_ENCRYPTION_H
|
||||
|
||||
#include <string>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <functional>
|
||||
#include <openssl/sha.h>
|
||||
#include <openssl/md5.h>
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
|
||||
|
||||
using namespace std;
|
||||
|
||||
class RH_Encryption
|
||||
{
|
||||
public:
|
||||
RH_Encryption();
|
||||
static function<string (string)> none();
|
||||
static function<string (string)> md5();
|
||||
static function<string (string)> sha1();
|
||||
static function<string (string)> sha224();
|
||||
static function<string (string)> sha384();
|
||||
static function<string (string)> sha256();
|
||||
static function<string (string)> sha512();
|
||||
//static function<string (string)> hashForLambda(function<string(string)> functionLambda, string value);
|
||||
virtual ~RH_Encryption();
|
||||
protected:
|
||||
private:
|
||||
};
|
||||
|
||||
#endif // RH_ENCRYPTION_H
|
||||
81
include/RH_GUI.h
Normal file
81
include/RH_GUI.h
Normal file
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Copyright <20> 2015 Matthieu DUVAL, Rudy DUCHE
|
||||
*
|
||||
* This file is part of RizzleHash.
|
||||
*
|
||||
* RizzleHash is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* RizzleHash is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with RizzleHash. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
#ifndef RH_GUI_H
|
||||
#define RH_GUI_H
|
||||
#include "RH_Constants.h"
|
||||
#include "CPUID.h"
|
||||
|
||||
#include <time.h>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
#include <list>
|
||||
#include <sstream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class GUI
|
||||
{
|
||||
public:
|
||||
GUI();
|
||||
virtual ~GUI();
|
||||
void displayHeader();
|
||||
void displayProcessPerfs(string host, string processName, int WordsSeconds, string currentWord);
|
||||
void displayProcessPerfsList(string host, list<string> processName, list<int> WordsSeconds, list<string> curentWord);
|
||||
void displayTotalPerfs(string host,int WordsSeconds);
|
||||
void displayError(string host,string errorCode,string errorMessage);
|
||||
void displayMessage(string host,string message);
|
||||
void displayResult(string value,time_t secondes);
|
||||
void displayCopyright();
|
||||
void displayShortHelp();
|
||||
void displayFullHelp();
|
||||
void displayVersion();
|
||||
void clearScreen();
|
||||
|
||||
//interation avec l'utilisateur
|
||||
int getInputInt(string question);
|
||||
string getInputString(string question);
|
||||
int displayMenuInt(string title,list<string> entryList, string margin);
|
||||
string displayMenuString(string title,list<string> entryList, string margin);
|
||||
|
||||
|
||||
private:
|
||||
void setLocale();
|
||||
list<string> prepareHeader();
|
||||
string separationLineCreator(string leftBroder, string rightBorder, string separator, int lenGui);
|
||||
string centredLine(string leftBroder, string rightBorder, string offsetChar, int lenGui,string value);
|
||||
string tableLine(string value1, string value2, string offsetChar, int lenMaxValue1);
|
||||
string leftAlignLine(string leftBroder, string rightBorder, string offsetChar, int lenGui,string value);
|
||||
|
||||
|
||||
private:
|
||||
time_t guiTime;
|
||||
|
||||
list<string> headerLines;
|
||||
/*struct time
|
||||
{
|
||||
string day;
|
||||
string hours;
|
||||
string minutes;
|
||||
string seconds;
|
||||
};*/
|
||||
};
|
||||
|
||||
#endif
|
||||
91
include/RH_ProcessBruteForce.h
Normal file
91
include/RH_ProcessBruteForce.h
Normal file
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* Copyright <20> 2015 Matthieu DUVAL, Rudy DUCHE
|
||||
*
|
||||
* This file is part of RizzleHash.
|
||||
*
|
||||
* RizzleHash is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* RizzleHash is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with RizzleHash. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
#ifndef RH_PROCESSBRUTEFORCE_H
|
||||
#define RH_PROCESSBRUTEFORCE_H
|
||||
|
||||
#include <iostream>
|
||||
#include <queue>
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <functional>
|
||||
#include "../include/RH_Encryption.h"
|
||||
//#include <thread>
|
||||
//#include <time.h>
|
||||
//#include <atomic>
|
||||
//#include <list>
|
||||
//#include <stdlib.h>
|
||||
//#include <vector>
|
||||
//#include <mutex>
|
||||
|
||||
|
||||
using namespace std;
|
||||
|
||||
class ProcessBruteForce
|
||||
{
|
||||
public:
|
||||
struct statReturn
|
||||
{
|
||||
bool isFound = false;
|
||||
uint32_t nbSecond;
|
||||
uint32_t totalWords;
|
||||
string currentWord;
|
||||
string currentProcessName;
|
||||
};
|
||||
|
||||
public:
|
||||
ProcessBruteForce();
|
||||
ProcessBruteForce(queue<statReturn> *q,int idx,int nbInstence,string hashString,string clef,uint32_t limite,bool verbose,string hashMethode);
|
||||
void init(queue<statReturn> *q,int idx,int nbInstence,string hashString,string clef,uint32_t limite,bool verbose,string hashMethode);
|
||||
void operator()();
|
||||
virtual ~ProcessBruteForce();
|
||||
private:
|
||||
function<string(string)> getFunctionHash(string hashMethode);
|
||||
void bruteForce();
|
||||
void recursiveFunction(uint32_t index);
|
||||
void testSpeed(string currentWord);
|
||||
|
||||
|
||||
private:
|
||||
queue<statReturn> *q;
|
||||
int idx;
|
||||
int nbInstence;
|
||||
bool verbose;
|
||||
uint32_t nbWord;
|
||||
function<string(string)> hashMethodeFunction;
|
||||
bool keySet;
|
||||
string clef;
|
||||
uint32_t limite;
|
||||
string hashString;
|
||||
char* password;
|
||||
bool isFound = false;
|
||||
|
||||
char tabChar[62] = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',
|
||||
'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
|
||||
'0','1','2','3','4','5','6','7','8','9'};
|
||||
|
||||
short indexMin = 0;
|
||||
short indexMax = 0;
|
||||
// test de performaces
|
||||
time_t clock;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // BF_PROCESSBRUTEFORCE_H
|
||||
14
include/RH_Utils.h
Normal file
14
include/RH_Utils.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#ifndef RH_UTILS_H
|
||||
#define RH_UTILS_H
|
||||
|
||||
|
||||
class RH_Utils
|
||||
{
|
||||
public:
|
||||
RH_Utils();
|
||||
virtual ~RH_Utils();
|
||||
protected:
|
||||
private:
|
||||
};
|
||||
|
||||
#endif // RH_UTILS_H
|
||||
Reference in New Issue
Block a user