sha.html

OUTPUT of sha.html
___________________________________________________________________________________________________
###################################################################################################
sha.php

Explanation is mentioned in
comments ;
OUTPUT of sha.php
_______________________________________________________________________________________________
##############################################################################################
Text files ::



RAW CODE ::::
___________________________________________ sha.html _____________________________________________
<!DOCTYPE html>
<html>
<head>
<title>
SHA-crack
</title>
<style type="text/css">
body {
font-size:
20px;
}
fieldset {
width:
600px;
}
input{
width:
500px;
}
</style>
</head>
<body>
<center>
<form method="POST"
action="sha.php">
<fieldset>
<legend>SHA Hashes</legend>
<br>
<input type="text" name="hash"
placeholder="Enter your hash">
<br><br>
<button
id="calc">crack</button>
</fieldset>
</form>
</center>
</body>
</html>
####################################################################################################
___________________________________________________ sha.php ________________________________________
<?php
if ( isset($_POST["hash"]) ){
$hash = $_POST["hash"];
$type = "none";
// This preg_match also maintains security for our
site
if (preg_match("/\b([a-f0-9]{40})\b/", $hash)){
$type = "sha1";
}elseif (preg_match("/\b([a-f0-9]{56})\b/", $hash))
{
$type = "sha224";
}elseif (preg_match("/\b([a-f0-9]{64})\b/", $hash))
{
$type = "sha256";
} // First we find out the hash type by the length of
that hash
if ($type !== "none"){ // So that we can get rid of
searching all 3 files
$fn = fopen($type."_list.txt","r");
// we can particularly search only 1 file
$Arr = array(); // We have used the
Array data structues to load the file data
while(! feof($fn)) { // While loop
for reading lines one by one
$result =
fgets($fn); // grabbing the line
$line =
substr($result, 0, strlen($result)-1); //removing '\n'
if(strlen($line)
=== 0){ // End of file
break; // terminating
}
$str_arr =
explode (":", $line); // split by ':'
$Arr[$str_arr[1]] = $str_arr[0]; // appending to array ; Arr[hash]
= value
}fclose($fn); // after completion
of reading data ; closing the file
if (array_key_exists($hash, $Arr)){
// If the key means hash exits
$value =
$Arr[$hash]; // Grabbing the value which results in hash
$msg =
$type."('".$value."') => ".$hash; // Making the msg var to
output
// both hash and
value ; as sha...('value') => hash | in that way
}
}else{
$msg = "Enter a valid hash"; // If
pregmatch failed ; means wrong hash
}
}else{
$msg = "Enter a hash value"; // If hash value not sent
by vai post
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Hash</title>
</head>
<body>
<center>
<!-- At last printing the msg
which we want to output through html -->
<p><b><?php echo
$msg;?></b></p>
<!-- To crack another hash
-->
<a href="sha.html">To Crack
another hash</a>
</center>
</body>
</html>
################################################################################################
________________________________________ sha1_list.txt _____________________________________________
hello:aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d
world:7c211433f02071597741e6ff5a8ea34789abbf43
asdf:3da541559918a808c2402bba5012f6c60b27661c
asdf@123:1b28fb759ac3a1212038d60e8cffbada07093f5d
################################################################################################
_______________________________________ sha224_list.txt ___________________________________________
hello:d222253ccf19d787ecaa84c7dbfe5d3ee0311d19f085ce1d6a6d78fe
world:06d2dbdb71973e31e4f1df3d7001fa7de268aa72fcb1f6f9ea37e0e5
asdf:cda1d665441ef8120c3d3e82610e74ab0d3b043763784676654d8ef1
asdf@123:7c227e7f624e83b2c6463a8894f30229a1b3d411a5c171bc16c27f92
###############################################################################################
_______________________________________ sha256_list.txt __________________________________________
hello:2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
world:486ea46224d1bb4fb680f34f7c9ad96a8f24ec88be73ea8e5a6c65260e9cb8a7
asdf:f0e4c2f76c58916ec258f246851bea091d14d4247a2fc3e18694461b1816e13b
asdf@123:2ff38c248d716dae4131fc40cb2097f9b3de7227792bdb33e78dedc1e11ffc1c
##############################################################################################
For this task you will create a reverse SHA lookup website. A user will be able...
PHP
you need to create a form to allow the user to enter their name,
email, and address
information. That information will be sent to a PHP script that
will process and display that information.
Your assignment should have two pages. The first page is straight
html (user_input.html) that has
a form with the appropriate form elements to collect the user
input. The form should then be submitted
using the POST method to a php script (display_user_info.php) that
will process...
Create a folder named "TrainerApp". In that folder create the following files. Create a PHP file, "insert-user-form.php", with a form that has the following fields: - First Name (text) - Last Name (text) - Email (text) - Password (text) - Submit button Create another PHP file, "insert-exercise-form.php" with a form that has the following fields: - Exercise Name (text) - Description (text) - Demonstration Image (file) - Submit button Create another PHP file, "login-user-form.php" with a form that has the...
(10 points) Image Gallery Search: The following HTML snippet is the skeleton of a . simple image gallery. The gallery stores all of its images in a directory called im ages. Write a PHP sear ch page for an program called search php to implement the searching feature. An image is onsidered a mat ch" to the search string if the name of the image contains the entirety of the search string. For example, query of "tea" mightmatch 'teajpg" or...
You need to implement a web application that is split in three parts, namely, Webpage, PHP and MySQL. Each of them will be used accordingly to solve a simple problem described below. Remember to implement the logic in the most secure way of your knowledge. PHP Implement a PHP function that reads in input a string from the user and store it in a table (e.g., in a field called "Content Name"). The function should be able to read the...
You need to implement a web application that is split in three parts, namely, Webpage, PHP and MySQL. Each of them will be used accordingly to solve a simple problem described below. Remember to implement the logic in the most secure way of your knowledge. PHP Implement a PHP function that reads in input a string from the user and store it in a table (e.g., in a field called "Content Name"). The function should be able to read the...
C++ OPEN AND COPY FILES Your task is to create a simple C++ program that prompts the user for two file names, opens both files, reads the data from one file and copies that data to the other file. After this is done, the files are both closed and the program ends. 1. Your program, opencopy.cpp, needs to use both an ifstream object and an ofstream object. 2. You only need to use #include for these but make sure that...
In this problem, you will create a selectable “To Do” List. To
add a task to this list, the user clicks the Add Task button and
enters a description of the task. To delete a task from the list,
the user selects the task and then clicks the Delete Task
button.
Open the HTML and JavaScript files provided as start-up files
(index.html from within todo_list_Q.zip file). Then,
review the HTML in this file. Note, within the div element, there
is...
Task 2.6 : In this exercise, you will create a script to echo users, based on a list of usernames in a file. 1. create a new file called userlist. #vi userlist 2. Insert a short list of usernames, such as the following. Make sure that none are the names of existing users. moe larry curly binny 3. create a script file userscript.sh and type the following lines #!/bin/bash for TheUSER in $(cat userlist) do echo The user is $TheUSER...
PHP - Use of classes This is a further development of the previous task, the participant registration. You must use the following Participant class. <?php class Deltaker { private $etterNavn; private $forNavn; private $fAar; function __construct(string $fornavn, string $etternavn, string $aar) { $this->forNavn = $fornavn; $this->etterNavn = $etternavn; $this->fAar = $aar; } function hentEtterNavn() : string { return $this->etterNavn; } function hentForNavn() : string { return $this->forNavn; } function hentFAar() : string{ return $this->fAar; } //Setters function settForNavn(string $fornavn) {...