0% found this document useful (0 votes)
22 views2 pages

Bot Deshash

The document describes a Discord bot command that can decrypt hashes by comparing them to a wordlist using crypto hashing functions. It loads a wordlist from a file, takes in a hash and salt as command options, hashes each word combined with the salt and compares it to the input hash to find the matching plaintext password.

Uploaded by

ikaridevelopment
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views2 pages

Bot Deshash

The document describes a Discord bot command that can decrypt hashes by comparing them to a wordlist using crypto hashing functions. It loads a wordlist from a file, takes in a hash and salt as command options, hashes each word combined with the salt and compares it to the input hash to find the matching plaintext password.

Uploaded by

ikaridevelopment
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

const { SlashCommandBuilder } = require('@discordjs/builders');

const { MessageEmbed } = require('discord.js');


const crypto = require('crypto');
const fs = require('fs');
const path = require('path');

let wordlist = null;

module.exports = {
data: new SlashCommandBuilder()
.setName('deshash')
.setDescription('Desencripta un hash')
.addStringOption(option =>
option.setName('hash')
.setDescription('El hash a desencriptar')
.setRequired(true))
.addStringOption(option =>
option.setName('salt')
.setDescription('El salt asociado al hash')
.setRequired(true)),
async execute(interaction) {
const { hash, salt } = interaction.options.getString('hash');
if (!wordlist) {
return interaction.reply({ content: 'La lista de palabras aún no ha
sido cargada. Por favor, inténtalo de nuevo más tarde.', ephemeral: true });
}

let result = null;


let embedDescription = 'Desencriptando...';
for (const word of wordlist) {
const hashFunction = hash.includes('SHA512') ?
crypto.createHash('sha512') : crypto.createHash('sha256');
const password_hash = hashFunction.update(word).digest('hex');
const final = hashFunction.update(password_hash + salt).digest('hex');
if (final === hash) {
result = word;
embedDescription = `La contraseña es: ${result}`;
break;
}
}

const embed = new MessageEmbed()


.setTimestamp()
.setTitle('Desencriptación de Hash')

.setImage('https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExamQ4NThqcXNyNDZiMzliNjR
mMHNhbGc3bDQ5cjAwbXZ6Y3N3aGNpYSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/
txDC5TClSOgFIbXTYC/source.gif')
.setDescription(embedDescription);

if (result) {
embed.setColor('#00ff00');
} else {
embed.setColor('#ff0000');
}

await interaction.reply({ embeds: [embed], ephemeral: true });


},
loadWordlist: function () {
const wordlistPath = path.join(__dirname, 'dont-touch.txt'); // Ruta de
acceso al archivo rockyou.txt dentro de la misma carpeta que el script del
deshasher
fs.readFile(wordlistPath, 'utf8', (err, data) => {
if (err) {
console.error('Error al cargar la lista de palabras:', err);
} else {
wordlist = data.split('\n');
console.log(`Lista de palabras cargada. Total de palabras: $
{wordlist.length}`);
}
});
}
};

You might also like