-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.html
202 lines (184 loc) · 4.13 KB
/
index.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
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
<!DOCTYPE html>
<html>
<head>
<title>Webshark</title>
<meta charset="utf-8" />
<style>
body {
background: #02080F;
color: #CCC;
padding-bottom: 50px;
}
#topbar {
width: 100%;
padding: 0.2em;
margin-bottom: 0.4em;
background: #222;
}
.packet-table {
display: table;
border: 1px solid #333;
border-spacing: 0;
}
.packet-table th {
padding: 0.2em 0.5em;
width: 200px;
text-align: left;
font-weight: normal;
border-right: 1px solid #333;
}
.packet-table tr:not(:last-child) th,
.packet-table tr:not(:last-child) td {
border-bottom: 1px solid #111;
}
.packet-table th p {
margin: 0;
}
.packet-table th p > strong {
display: block;
float: left;
}
.packet-table th p > .ip {
display: block;
text-align: right;
}
/*
.packet-table th p > .ip {
display: block;
float: left;
}
.packet-table th p > .port {
display: block;
text-align: right;
}
*/
.packet-area {
position: relative;
}
.packet {
display: inline-block;
position: relative;
height: 20px;
background: #444;
border: 1px solid #000;
}
.packet.udp {
background: #A11;
}
.packet.tcp {
background: #1A1;
}
#info-window {
position: fixed;
top: 1em;
right: 1em;
width: 14em;
padding: 0.5em;
z-index: 5;
border: 1px solid #333;
background: rgba(0,0,0,0.9);
}
#info-window hr {
margin: 0.2em 0;
height: 1px;
background: #333;
border: 0 none;
}
#hexdump {
max-height: 20em;
overflow-y: auto;
}
#info-window pre {
margin: 0.2em;
text-align: left;
}
#hexdump .zero { color: #666666 }
#hexdump .low { color: #80aa55 }
#hexdump .high { color: #8055d5 }
#hexdump .highlight { background: #222 }
#info-window dl {
margin: 0;
padding: 0;
border-top: 1px solid #333;
font-family: monospace;
}
#info-window dl > dt {
display: block;
float: left;
font-weight: bold;
}
#info-window dl > dd {
display: block;
text-align: right;
margin: 0;
padding: 0;
}
#info-window dl > dt.block {
float: none;
}
#scrollbar {
position: fixed;
bottom: 0.5em;
left: 0.5em;
right: 0.5em;
height: 40px;
background: rgba(0,0,0,0.5);
}
</style>
</head>
<body>
<div id="topbar">
<input type="file" id="file-selector" />
</div>
<div id="info-window">
<div id="hexdump"></div>
<dl id="info"></dl>
</div>
<table id="packet-table" class="packet-table">
<!--
<tr>
<th>
<p>
<strong>Source</strong>
<span class="ip">192.168.0.1</span>
<span class="port">1234</span>
</p>
<p>
<strong>Destination</strong>
<span class="ip">123.45.67.89</span>
<span class="port">50123</span>
</p>
</th>
<td class="packet-area">
<div class="packet" style="left:100px"></div>
<div class="packet" style="left:150px"></div>
<div class="packet" style="left:200px"></div>
</td>
</tr>
<tr>
<th>
<p>
<strong>Source</strong>
<span class="ip">192.168.0.1</span>
<span class="port">1234</span>
</p>
<p>
<strong>Destination</strong>
<span class="ip">123.45.67.89</span>
<span class="port">50123</span>
</p>
</th>
<td class="packet-area">
<div class="packet" style="left:20px"></div>
<div class="packet" style="left:110px"></div>
<div class="packet" style="left:180px"></div>
</td>
</tr>
-->
</table>
<canvas id="scrollbar"></canvas>
<script src="js/binaryparser.js"></script>
<script src="js/pcap.js"></script>
<script src="webshark.js"></script>
</body>
</html>