Created
March 11, 2016 21:01
-
-
Save antoniomika/4d88a47a542a456532ca to your computer and use it in GitHub Desktop.
Simple Vulnerabilities for Michigan Hackers CTF
This file contains 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 | |
$username = $_GET['username']; | |
$db = new mysqli("example.com", "user", "password", "database"); | |
$query = 'SELECT * FROM users where name = ' . $username . ';'; | |
$result = $mysqli->query($query); | |
echo json_encode($result->fetchAll()); | |
?> |
This file contains 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
<html> | |
<h1>You requested product ID: <span id="productid"></span></h1> | |
<script> | |
$("#productid").innerHTML = decodeURIComponent(location.search.substr(5)); | |
</script> | |
</html> |
This file contains 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
#include <stdio.h> | |
#include <string.h> | |
int main(void) { | |
char userinput[15]; | |
int pass = 0; | |
printf("Enter password: \n"); | |
gets(userinput); | |
if(strcmp(userinput, "h4x0r")) { | |
printf ("Access Denied! \n"); | |
} else { | |
printf ("Access Granted! \n"); | |
pass = 1; | |
} | |
if(pass) { | |
printf ("Secret sauce \n"); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment