Created
March 19, 2020 12:58
-
-
Save lauslim12/8e4ebc4c59c5644b835fddcd5515f9a0 to your computer and use it in GitHub Desktop.
Practice for type confusion.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Exploit the type confusion by first sending a random number, then tamper with the get so | |
* the parameter will become like '?angka[]=yournumber' (add an array notation in the 'angka variable'). | |
*/ | |
?> | |
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<title>Latihan Type Casting</title> | |
</head> | |
<body> | |
<h5>Type Confusion Test</h5> | |
<form action='' method='GET'> | |
<input type='text' name='angka' required> | |
<input type='submit' value='Submit' name='Kirim'> | |
</form> | |
<?php | |
if(isset($_GET['angka'])) { | |
$awal = $_GET['angka']; | |
$nilai_akhir = $awal + 5; | |
echo "Nilai akhir adalah: '$nilai_akhir'"; | |
} | |
?> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment