-
Notifications
You must be signed in to change notification settings - Fork 0
/
req_smuggling.html
73 lines (63 loc) · 1.59 KB
/
req_smuggling.html
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
<!DOCTYPE html>
<!--
This simple page will calculate Content-Length and chunked Transfer-Encoding values for a given text. This is aiding HTTP Request smuggling.
https://portswigger.net/web-security/request-smuggling
-->
<html>
<head>
<style>
* {
box-sizing: border-box;
}
/* Create two equal columns that floats next to each other */
.column {
float: left;
width: 300px;
padding: 10px;
word-wrap: break-word;
}
/* Clear floats after the columns */
.row:after {
content: "";
display: table;
clear: both;
white-space: pre;
}
</style>
</head>
<body>
<form>
<p><label for="w3review">Data:</label></p>
<textarea placeholder="enter body here" name="inputbox" rows="4" cols="50" autofocus></textarea>
<br><p>
<input type="button" NAME="button" Value="Process" onClick="process(this.form)">
</form>
<br>
<div class="row">
<div id=1 class="column" style="background-color:#aaaccc;">
Content-Length: 0
<br><br>
</div>
<div id=2 class="column" style="background-color:#aaaaff;">
Transfer-Encoding: chunked
<br><br>
0
<br><br>
</div>
</div>
</body>
<script>
function clean(data){
data = data.replace(/</g, '<').replace(/>/g, '>').replace(/\n/g,'<br>');
return data;
}
function process(form){
var data = form.inputbox.value;
var l = data.replace(/\n/g,'\r\n').length;
if (l>0) {
document.getElementById(1).innerHTML = "Content-Length: " + l + "<br><br>" + clean(data) + "<br><br>";
document.getElementById(2).innerHTML = "Transfer-Encoding: chunked<br><br>" + l.toString(16) + "<br>" + clean(data) + "<br>0<br><br>";
}
}
</script>
</html>