Skip to content

Instantly share code, notes, and snippets.

@lauslim12
Created March 19, 2020 12:58
Show Gist options
  • Save lauslim12/8e4ebc4c59c5644b835fddcd5515f9a0 to your computer and use it in GitHub Desktop.
Save lauslim12/8e4ebc4c59c5644b835fddcd5515f9a0 to your computer and use it in GitHub Desktop.
Practice for type confusion.
<?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