Attempt to find the sha256 hash

Attempt to find the sha256 hash

For education purposes only.

Recently we been giving a hash consist with 64 character !! And we ask, what's this hash?? And which algorithm generate it ??

"We don't know !!" - the answer.

I simply google it.

No alt text provided for this image

Then I thought, let me just take small steps starting by identifying the hash algorithm (that generate such hashs). Google "hash detector" or "hash analyzer" or "hash identify". Pingo !!

No alt text provided for this image

Identify step, is the 50% of any provided solution.

We thought to find the word that been converted into Sha256, but we know that cracking or decrypting such algorithm is almost impossible . What should we do? Remember google it at the beginning ? Is the easiest way to find anything on internet.

Now we left with certain options:

Online decrypting , you my find many webs will try to match your hash with their millions and millions of hashs in their database. Try to google "sha256 decrypt". Good luck ^_^

What else, John the Ripper, brute force or Rainbow table attack? i'm out date it in this field.

Then i thought to play around PowerShell scripts for education purposes only.

Which functions we need? code to generate Sha256 hash (done), Matching code (done), Random Word generator (done).

You may replace Word generator with Wordlist . > Md5decrypt web can provide you with 30 millions of unique words.

$Goldenhash = "8089BC47EC25157AF5CFEB1EEE40E3BD7815421AF9B445F9516AF6DBAC57B893"
$Generatedhash = ""
[Reflection.Assembly]::LoadWithPartialName("System.Web") | Out-Null;




function Get-SHA256 {
? ? Param (
? ? ? ? [Parameter(Mandatory = $true)]
? ? ? ? [string]$String
? ? )
? ? process {
? ? ? ? $hasher = [System.Security.Cryptography.HashAlgorithm]::Create('sha256')
? ? ? ? $hash = $hasher.ComputeHash([System.Text.Encoding]::UTF8.GetBytes($String))


? ? ? ? $hashString = [System.BitConverter]::ToString($hash)
? ? ? ? $hashString -replace '-', ''
? ? }
}






Function RandomSha256(){
$RandomTxt = [System.Web.Security.Membership]::GeneratePassword(8,1)
$Generatedhash = Get-SHA256 $RandomTxt


$RandomTxt
$Generatedhash
}




if ($Generatedhash -ne $Goldenhash){


Do {


RandomSha256


? ? }Until ($Generatedhash -eq $Goldenhash)
? ? ? ??
? ? ? ? } Else {
Write-Host -BackgroundColor Red -ForegroundColor White "Found it = ($RandomTxt)"
pause
}        

The result, you will get an amazing matrix of generating new words, then convert it into sha256 hash using the algorithm after that trying to match the two hashes, as showing below

It generated about 18.5 thousand line of hashes per 10 seconds (it depends on your computer speed)

No alt text provided for this image
No alt text provided for this image

Now you may increase the length of each word by adjusting the number from 8 to whatever you like.

No alt text provided for this image

And here if you want to change the algorithm from sha256 to Sha-family or MD5. More details


Please remember this tutorial is for education purposes only, and use it on your own risk.

If you have a question, don't hesitate to contact me.

Best Luck

要查看或添加评论,请登录

社区洞察

其他会员也浏览了