Example #1
0
void OpenCainFile()
{
	GtkWidget *chooser;
	   
	chooser = gtk_file_chooser_dialog_new("Open cain file", GTK_WINDOW(gui.windows.hash), GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL);

	if (gtk_dialog_run(GTK_DIALOG(chooser)) == GTK_RESPONSE_ACCEPT)
	{
		const gchar *txt = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(chooser));
		std::vector<std::string> tmp, tmp2;
		LoadLMHashFromCainLSTFile(txt, tmp, tmp2, db.hashes);
	}
	gtk_widget_destroy(chooser);
}
Example #2
0
/* Crack a Cain & Abel file */
boost::python::dict cain(std::string cainFilePath, std::string pathToTables,
		std::string outputFile, std::string sSessionPathName,
		std::string sProgressPathName, std::string sPrecalcPathName,
		bool debug, bool keepPrecalcFiles, int enableGPU, unsigned int maxThreads,
		uint64 maxMem)
{
	std::vector<std::string> vHash;		// hash cracker
	std::vector<std::string> vUserName;	// lm cracker
	std::vector<std::string> vLMHash;	// lm cracker
	std::vector<std::string> vNTLMHash;	// lm cracker
	std::vector<std::string> vPathName;
	bool resumeSession = false; // Sessions not currently supported
	CHashSet hashSet;
	if ( debug )
	{
		version(debug);
	}
	/* Parse file for hashes */
	LoadLMHashFromCainLSTFile(cainFilePath, vUserName, vLMHash, vNTLMHash);
	for (uint32 index = 0; index < vLMHash.size(); index++)
	{
		hashSet.AddHash(vLMHash[index].substr(0, 16));
		hashSet.AddHash(vLMHash[index].substr(16, 16));
	}
	/* Load rainbow tables */
	GetTableList(pathToTables, vPathName);
	if ( debug )
	{
		std::cout << "[Debug]: Found " << vPathName.size() << " rainbow table file(s)..." << std::endl;
	}
	/* Start cracking! */
	CCrackEngine crackEngine;
	crackEngine.setSession(sSessionPathName, sProgressPathName, sPrecalcPathName, keepPrecalcFiles);
	crackEngine.Run(vPathName, hashSet, maxThreads, maxMem, resumeSession, debug, enableGPU);
    boost::python::dict results = otherResults(vLMHash, vNTLMHash, vUserName, hashSet, outputFile, debug);
    return results;
}