-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathsecondorder_changepass.php
125 lines (95 loc) · 2.12 KB
/
secondorder_changepass.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<!-- Enable debug using ?debug=true" -->
<?php
ob_start();
session_start();
include("db_config.php");
if (!$_SESSION["id"]){
header('Location:Login1.php?msg=1');
}
ini_set('display_errors', 1);
?>
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Change Password Page - SQL Injection Training App</title>
<link href="./css/htmlstyles.css" rel="stylesheet">
</head>
<body>
<div class="container-narrow">
<div class="jumbotron">
<p class="lead" style="color:white">
Non functional Change Password page - shows second order SQLi</a>
</p>
</div>
<?php
$q = "Select * from users where username = '".$_SESSION["username"]."'";
if (isset($_GET['debug']))
{
if ($_GET['debug']=="true")
{
echo "<h2><pre>".$q."</pre></h2><br /><br />";
}
}
$result = mysqli_query($con,$q);
if (!$result)
{
die("".mysqli_error($con));
}
$e = mysqli_get_warnings($con);
if ($e){
do {
echo "Warning: $e->errno: $e->message<br />";
} while ($e->next());
}
$row = mysqli_fetch_array($result);
if ($row){
$_SESSION["username"] = $row[1];
$_SESSION["name"] = $row[3];
$_SESSION["descr"] = $row[4];
}
?>
<div class="response">
<p style="color:white">
<table class="response">
<form method="POST" autocomplete="off">
<tr>
<td>
Enter new password:
</td>
<td>
<input type="password" id="password" name="password"><br />
</td>
</tr>
<tr>
<td>
Repeat password:
</td>
<td>
<input type="password" id="password" name="password">
</td>
</tr>
<td>
<br />
</td>
</tr>
<tr>
<td>
<input type="submit" value="Change!"/>
</td>
</tr>
</table>
</p>
</form>
</div>
<br />
<div class="row marketing">
<div class="col-lg-6">
</div>
</div>
<div class="footer">
<p><h4><a href="index.php">Home</a><h4></p>
</div>
<div class="footer">
<p>Riyaz Walikar | @riyazwalikar | [email protected]</p>
</div>
</div> <!-- /container -->
</body>
</html>