forked from OWASP/EnDe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EnDeHTTP-Test.html
148 lines (138 loc) · 4.66 KB
/
EnDeHTTP-Test.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
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
<html>
<head>
<title>Test :: EnDe.HTTP</title>
<script type="text/javascript" >
//<![CDATA[
var EnDeGUI = new function EnDeGUI(typ) {} // need a dummy here
function go(typ) {
//alert(typ); return false;
var bux = '--undef--';
var src = document.getElementById('t').value;
var req = document.getElementById('r').checked;
if (req===false) {
bux = EnDe.HTTP.req.get(typ,src);
} else {
bux = EnDe.HTTP.res.get(typ,src);
}
alert(typ + ':\n' + bux);
return false;
}
function out(typ) {
var bux = '--undef--';
var src = document.getElementById('t').value;
if(typ==='request') {
bux = EnDe.HTTP.req.set(typ,src);
} else {
bux = EnDe.HTTP.res.set(typ,src);
}
alert(typ + ':\n' + bux);
return false;
}
function ana(typ) {
var bux = '--undef--';
var src = document.getElementById('t').value;
bux = EnDe.HTTP.dispatch(typ,src);
document.getElementById('out').value = bux.join('\n');
//alert(typ + ':\n' + bux);
return false;
}
function add(typ) {
if(typ==='clear') {
document.getElementById('t').value = '';
} else {
document.getElementById('t').value += '\n';
document.getElementById('t').value += document.getElementById(typ).value;
}
return false;
}
//]]>
</script>
<script type="text/javascript" src="EnDeForm.js" ></script>
<script type="text/javascript" src="EnDeHTTP.js" ></script>
</head>
<body>
<form action="#" >
<h4>Add request, response sample data</h4>
add:
<button onClick="return add(this.innerHTML);">clear</button>
<button onClick="return add(this.innerHTML);">url</button>
<button onClick="return add(this.innerHTML);">req</button>
<button onClick="return add(this.innerHTML);">res</button>
   |    show:
<button onClick="return out(this.innerHTML);">request</button>
<button onClick="return out(this.innerHTML);">response</button>
<br>
<textarea id="t" cols=80 rows=20 >
</textarea>
<h4>Test or extract values from above data</h4>
<div>
<label for="r" title="if checked following buttons work on request" >Response: <input id="r" type="checkbox" /></label>
<br>
<button onClick="return go(this.innerHTML);">SCHEMA</button>
<button onClick="return go(this.innerHTML);">USER</button>
<button onClick="return go(this.innerHTML);">FQDN</button>
<button onClick="return go(this.innerHTML);">PORT</button>
<button onClick="return go(this.innerHTML);">URL</button>
<button onClick="return go(this.innerHTML);">PATH</button>
<button onClick="return go(this.innerHTML);">VERB</button>
<button onClick="return go(this.innerHTML);">PARAM</button>
<button onClick="return go(this.innerHTML);">QUERY</button>
<button onClick="return go(this.innerHTML);">SEARCH</button>
<button onClick="return go(this.innerHTML);">VERSION</button>
<button onClick="return go(this.innerHTML);">BODY</button>
<br>
<button onClick="return go(this.innerHTML);">__head__</button>
<button onClick="return go(this.innerHTML);">__body__</button>
<button onClick="return go(this.innerHTML);">Content-Type</button>
<button onClick="return go(this.innerHTML);">Cookie</button>
<br>
<button onClick="return ana(this.innerHTML);">httpGET</button>
<button onClick="return ana(this.innerHTML);">httpPOST</button>
<button onClick="return ana(this.innerHTML);">httpGWT</button>
<button onClick="return ana(this.innerHTML);">httpJSON</button>
<button onClick="return ana(this.innerHTML);">httpJSON-GWT</button>
</div>
<!-- ************************ sample data { ********************* -->
<div style="display:none;">
<textarea id="url">
http://host.some.tld:81/path/file.fcc;sid=dead-beaf?TYPE=42&key=val
</textarea>
<textarea id="req">
POST /path/file.fcc;sid=dead-beaf?TYPE=42&key=val HTTP/1.0
Host: host.some.tld
User-Agent: ...
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: de, en
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Cookie: SID=dead-beaf
Keep-Alive: 300
Connection: close
Referer: https://...
cookie: SID=second
Content-Type: application/x-www-form-urlencoded
Content-Length: 259
{"user":"[email protected]","forecast":7,"t":"vlIj","zip":94089}
&USER=user&PASSWORD=pass&lang=tr&a|ab|<xml xx="qqq" />|cc|
</textarea>
<textarea id="res">
HTTP/1.1 302 Found
Date: Thu, 06 May 2010 15:48:32 GMT
Server: Apache
Set-Cookie: smm=1; path=/; domain=.bmwgroup.com
Set-Cookie: smm=; expires=Sat, 07 Nov 2009 15:48:32 GMT; path=/; domain=.some.tld
Expires: Thu, 01 Dec 1994 16:00:00 GMT
Location: https://...
Content-Length: 260
Connection: close
Content-Type: text/html; charset=iso-8859-1
x=y&|a|b|c|
</textarea>
</div>
<!-- ************************ sample data } ********************* -->
</form>
<div class="out">
<textarea id="out" cols=80 rows=20 >
</textarea>
</div>
</body>
</html>