Skip to content

Commit

Permalink
Update Decoder.jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
DMontgomery40 authored Jan 11, 2025
1 parent 2b70ef6 commit 1d4713b
Showing 1 changed file with 170 additions and 43 deletions.
213 changes: 170 additions & 43 deletions src/components/Decoder.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,85 +7,212 @@ const Decoder = () => {

const handleDecode = () => {
try {
// Attempt to decode Base64
const decoded = atob(input);

/*
Greg -
Thanks again for our conversation.
This final step in the scavenger hunt
shows I can be fun + technically solid
while staying kid-friendly.
– David
*/

// Terminal-like output sequence
setOutput(
'hashcat (v6.2.6) starting in --base64 mode...\n' +
'=================================================\n' +
'* Device #1: NVIDIA GeForce RTX 3080, 9728/10018 MB, 68MCU\n' +
'Watchdog: Temperature abort trigger set to 90c\n' +
'Initializing backend runtime for device #1...\n'
);

setTimeout(() => {
setOutput(prev => prev +
'\nPlugin.Base64........: Loaded (Mode #2400)\n' +
'Hash.Target.........: b64-encoded-data\n' +
'Session.Name........: blackhat_edu\n' +
'Started.............: Thu Mar 14 20:23:11 2024\n' +
'Probing dictionary..: /usr/share/wordlists/rockyou.txt\n' +
'=================================================\n'
);

setTimeout(() => {
setOutput(prev => prev +
'\nProgress............: 1337/1337 (100.00%)\n' +
'Time.Estimated......: 0 secs\n' +
'Recovered.Digests...: 1/1 (100.00%)\n' +
'Recovered.Plains....: 1/1 (100.00%)\n' +
'=================================================\n'
);

setTimeout(() => {
setOutput(prev => prev +
`\nDecoded.Output......: ${decoded}\n` +
'Status..............: Cracked\n' +
'Kernel.Feature......: Pure Kernel\n' +
'Host.Compute........: 2600.0 kH/s\n' +
'Elapsed.............: 0.42 secs\n' +
'\nSession completed. Proceed to the next stage:'
);
setShowLink(true);
}, 800);
}, 600);
}, 400);

} catch (e) {
setOutput('> Error: Invalid base64 input');
}
};

return (
<div className="min-h-screen bg-black text-gray-100 p-8">
<div className="max-w-3xl mx-auto">
<div className="rounded p-6 font-mono border border-gray-700">
<div className="mb-4">
<div className="flex items-center gap-2 text-green-500 mb-2">
<span className="text-xs">$</span>
<input
type="text"
value={input}
onChange={(e) => setInput(e.target.value)}
onKeyDown={(e) => e.key === 'Enter' && handleDecode()}
placeholder="Paste your base64 code here..."
className="bg-transparent border-none outline-none w-full focus:ring-0 placeholder-gray-500"
/>
</div>
{output && (
<div className="text-green-400 whitespace-pre-wrap break-all">
{output}
{showLink && (
<div className="mt-4 text-green-300">
&gt;{' '}
<a
href="https://github.com/ghostsecurity/reaper/blob/main/docs/how-to-hack-ghostbank.md"
target="_blank"
rel="noopener noreferrer"
className="hover:underline"
>
Click here to continue your journey...
</a>
</div>
)}
</div>
)}
</div>
<button
onClick={handleDecode}
className="px-4 py-2 bg-gray-800 text-green-400 border border-green-400 rounded hover:bg-gray-700 transition-colors"
>
Decode
</button>
</div>
</div>
</div>
);
};

export default Decoder;
import React, { useState } from 'react';

const Decoder = () => {
const [input, setInput] = useState('');
const [output, setOutput] = useState('');
const [showLink, setShowLink] = useState(false);

const handleDecode = () => {
try {
// Attempt to decode Base64
const decoded = atob(input);

/*
Greg -
Thanks again for our conversation.
This final step in the scavenger hunt
shows I can be fun + technically solid
while staying kid-friendly.
– David
*/

// Terminal-like output sequence
setOutput(
'hashcat (v6.2.6) starting in decode mode...\n' +
'\n' +
'hashcat (v6.2.6) starting in --base64 mode...\n' +
'=================================================\n' +
'* Device #1: NVIDIA GeForce RTX 3080, 9728/10018 MB, 68MCU\n' +
'\n' +
'Watchdog: Temperature abort trigger set to 90c\n' +
'Initializing backend runtime for device #1...'
'Initializing backend runtime for device #1...\n'
);

setTimeout(() => {
setOutput(prev => prev +
'\nClew..........: 0x7f3a9c2d\n' +
'Type..........: Base64\n' +
'Target........: b64.encoded.data\n' +
'\n' +
'Started: Thu Mar 14 20:23:11 2024\n' +
'Decoded.......: 1/1 (100.00%)\n' +
'Progress......: 4096/4096 (100.00%)\n' +
'Time.Estimated: 0 secs\n' +
'Recovered.....: 1/1 (100.00%) Digests'
setOutput(prev => prev +
'\nPlugin.Base64........: Loaded (Mode #2400)\n' +
'Hash.Target.........: b64-encoded-data\n' +
'Session.Name........: blackhat_edu\n' +
'Started.............: Thu Mar 14 20:23:11 2024\n' +
'Probing dictionary..: /usr/share/wordlists/rockyou.txt\n' +
'=================================================\n'
);

setTimeout(() => {
setOutput(prev => prev +
'\n\nSession.Name...: decoder\n' +
'Status........: Cracked\n' +
'Hash.Type.....: Base64\n' +
'Time.Started..: 0 secs\n' +
'Time.Estimated: 0 secs\n' +
'Kernel.Feature: Pure Kernel\n' +
'\n' +
'Starting.Dict.: /usr/share/wordlists/rockyou.txt\n' +
'Candidates.#1.: $plaintext'
setOutput(prev => prev +
'\nProgress............: 1337/1337 (100.00%)\n' +
'Time.Estimated......: 0 secs\n' +
'Recovered.Digests...: 1/1 (100.00%)\n' +
'Recovered.Plains....: 1/1 (100.00%)\n' +
'=================================================\n'
);

setTimeout(() => {
setOutput(prev => prev +
'\n\nHost.Compute..: 2439.5 kH/s\n' +
'Elapsed........: 0.41 secs\n' +
'\n' +
'Session completed. Proceed to next stage:'
setOutput(prev => prev +
`\nDecoded.Output......: ${decoded}\n` +
'Status..............: Cracked\n' +
'Kernel.Feature......: Pure Kernel\n' +
'Host.Compute........: 2600.0 kH/s\n' +
'Elapsed.............: 0.42 secs\n' +
'\nSession completed. Proceed to the next stage:'
);
setShowLink(true);
}, 800);
}, 600);
}, 400);

} catch (e) {
setOutput('> Error: Invalid base64 input');
}
};

return (
<div className="min-h-screen bg-gray-900 text-gray-100 p-8">
<div className="min-h-screen bg-black text-gray-100 p-8">
<div className="max-w-3xl mx-auto">
<div className="bg-gray-800 rounded p-6 font-mono border border-gray-700">
<div className="rounded p-6 font-mono border border-gray-700">
<div className="mb-4">
<div className="flex items-center gap-2 text-green-400 mb-2">
<div className="flex items-center gap-2 text-green-500 mb-2">
<span className="text-xs">$</span>
<input
type="text"
value={input}
onChange={(e) => setInput(e.target.value)}
onKeyDown={(e) => e.key === 'Enter' && handleDecode()}
placeholder="Paste your secret code here..."
className="bg-transparent border-none outline-none w-full focus:ring-0"
placeholder="Paste your base64 code here..."
className="bg-transparent border-none outline-none w-full focus:ring-0 placeholder-gray-500"
/>
</div>
{output && (
<div className="text-blue-400 whitespace-pre-wrap break-all">
<div className="text-green-400 whitespace-pre-wrap break-all">
{output}
{showLink && (
<div className="mt-4">
<a
<div className="mt-4 text-green-300">
&gt;{' '}
<a
href="https://github.com/ghostsecurity/reaper/blob/main/docs/how-to-hack-ghostbank.md"
target="_blank"
rel="noopener noreferrer"
className="text-green-400 hover:text-green-300 no-underline hover:underline"
className="hover:underline"
>
&gt; Click here to continue your journey...
Click here to continue your journey...
</a>
</div>
)}
Expand All @@ -94,7 +221,7 @@ const Decoder = () => {
</div>
<button
onClick={handleDecode}
className="px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 transition-colors"
className="px-4 py-2 bg-gray-800 text-green-400 border border-green-400 rounded hover:bg-gray-700 transition-colors"
>
Decode
</button>
Expand All @@ -104,4 +231,4 @@ const Decoder = () => {
);
};

export default Decoder;
export default Decoder;

0 comments on commit 1d4713b

Please sign in to comment.