-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathless-17.asp
executable file
·155 lines (136 loc) · 7.6 KB
/
less-17.asp
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="gbk">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>MSSQL SQLi Labs</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<style type="text/css">
body {
padding-top: 70px;
text-align: center;
}
form {
text-align: left;
}
</style>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<a href="#" class="navbar-brand">MSSQL SQLi Labs</a>
</div>
<ul class="nav navbar-nav navbar-right">
<li class="active"><a href="index.asp">Index</a></li>
<li><a href="install.asp">Install</a></li>
</ul>
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-sm-2">
<div class="list-group">
<a class="list-group-item" href="less-1.asp">Less-1</a>
<a class="list-group-item" href="less-2.asp">Less-2</a>
<a class="list-group-item" href="less-3.asp">Less-3</a>
<a class="list-group-item" href="less-4.asp">Less-4</a>
<a class="list-group-item" href="less-5.asp">Less-5</a>
<a class="list-group-item" href="less-6.asp">Less-6</a>
<a class="list-group-item" href="less-7.asp">Less-7</a>
<a class="list-group-item" href="less-8.asp">Less-8</a>
<a class="list-group-item" href="less-9.asp">Less-9</a>
<a class="list-group-item" href="less-10.asp">Less-10</a>
</div>
</div>
<div class="col-sm-8">
<div class="jumbotron">
<h1>Less-17</h1>
<p class="lead">Update Query - Error based - String</p>
</div>
<div class="row">
<form class="form-horizontal" role="form" action="less-17.asp" name="form1" method="post">
<div class="form-group">
<label for="username" class="col-sm-2 control-label">User name</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="username" name="username" placeholder="Username">
</div>
</div>
<div class="form-group">
<label for="password" class="col-sm-2 control-label">New password</label>
<div class="col-sm-10">
<input type="password" class="form-control" id="password" name="password" placeholder="Password">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-default">Submit</button>
</div>
</div>
</form>
</div>
<dir class="alert alert-info" role="alert">
<!--#include file="config.asp"-->
<%
On Error Resume Next
Dim username, password
username = Request.Form("username")
password = Request.Form("password")
If username <> "" And password <> "" Then
username = Replace(username, "'", "''")
Dim cmd, cmd_str, sql_str
Set cmd=Server.CreateObject("ADODB.Command")
cmd.ActiveConnection=conn
sql_str = "select username, password from users where username='" & username & "'"
cmd.CommandText=sql_str
Dim rs
Set rs=cmd.Execute
'If Err.Number <> 0 Then
'Response.Write(Err.Description)
'Response.End()
If rs.BOF = False And rs.EOF = False Then
real_username = rs("username")
sql_str = "update users set password = '" & password & "' where username='" & real_username & "'"
cmd.CommandText=sql_str
Set rs=cmd.Execute
If Err.Number <> 0 Then
Response.Write(Err.Description)
End If
Response.Write("Successfully updated your password")
Else
Response.Write("Bug off you Silly Dumb hacker")
End If
End If
%>
</dir>
</div>
<div class="col-sm-2">
<div class="list-group">
<a class="list-group-item" href="less-11.asp">Less-11</a>
<a class="list-group-item" href="less-12.asp">Less-12</a>
<a class="list-group-item" href="less-13.asp">Less-13</a>
<a class="list-group-item" href="less-14.asp">Less-14</a>
<a class="list-group-item" href="less-15.asp">Less-15</a>
<a class="list-group-item" href="less-16.asp">Less-16</a>
<a class="list-group-item" href="less-17.asp">Less-17</a>
<a class="list-group-item" href="less-18.asp">Less-18</a>
<a class="list-group-item" href="less-19.asp">Less-19</a>
<a class="list-group-item" href="less-20.asp">Less-20</a>
</div>
</div>
</div>
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="jquery/1.11.1/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>