-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
176 lines (169 loc) · 4.62 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>URI Mimic Generator</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.10/semantic.min.css">
<!--Let browser know website is optimized for mobile-->
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
</head>
<body>
<div id="app">
<div class="ui grid container">
<div class="row">
<div class="column">
<p>
This tool creates similar versions of the supplied text replacing
some characters with others that are much alike. The goal here
is to show that the font-family used in an application may
affect it's security.
</p>
<p>
If you're using Linux, please, make sure to install microsoft fonts.
In Ubuntu/Debian, the package you'll need is <i>ttf-mscorefonts-installer</i>
</p>
<p>
Supported chars: <span v-text='charsAsStr'></span>
</p>
</div>
</div>
<div class="row">
<form class="ui form">
<div class="field">
<label>First Name</label>
<input v-model='message' name="first-name" placeholder="type some URI here" type="text" />
</div>
</form>
</div>
<div class="row">
<div class='sixteen wide mobile eight wide tablet four wide computer column' v-for='(value, key) in families'>
<p>
<strong :style="{'font-family': value}" title="font family name" v-text='key'></strong>
</p>
<ol>
<li v-for='msg in scramble(message)'>
<span :style="{'font-family': value}" v-text='msg'></span>
</li>
</ol>
</div><!-- list item -->
</div>
</div><!-- ui grid -->
</div>
<script
src="https://code.jquery.com/jquery-3.1.1.min.js"
integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/semantic-ui/2.2.10/semantic.min.js"></script>
<script src="https://unpkg.com/vue"></script>
<script>
// codes from python3 ord
var chrMap = {
'0': [
'O' // 79
], // 48
'1': [
'l', // 108
'i' // 105
], // 49
'2': [
'z', // 122
'Z' // 90
], // 50
'8': [
'B' // 66
], // 56
'B': [
'ß', // 223
'8' // 56
],
'f': [
'ƒ' // 402
], // 102
'i': [
'1', // 49
'l', // 108
'¡' // 161
], // 105
'I': [
'L', // 76
'¡' // 161
], // 73
'l': [
'1', // 49
'i' // 105
], // 108
'o': [
'0', // 48
'°', // 176
'º', // 186
'ð', // 240
'ø' // 248
], // 111
'O': [
'0' // 48
], // 79
'p': [
'þ' // 254
], // 112
't': [
'†' // 8224
], // 116
'T': [
'†' // 8224
], // 84
'x': [
'×' // 215
], // 120
'z': [
'2' // 50
], // 122
'Z': [
'2' // 50
] // 90
};
var app = new Vue({
el: '#app',
data: function () {
return {
families: {
'verdana': 'Verdana, Geneva, sans-serif',
'courier new': '"Courier New", Courier, monospace',
'trebuchet': '"Trebuchet MS", Helvetica, sans-serif',
'comic sans': '"Comic Sans MS", cursive, sans-serif',
'arial': 'Arial, Helvetica, sans-serif',
'georgia': 'Georgia, serif',
'times new roman': '"Times New Roman", Times, serif',
// semantic-ui font
'lato': 'Lato,"Helvetica Neue",Arial,Helvetica,sans-serif'
},
message: 'Type your message'
}
},
computed: {
charsAsStr: function () {
return Object.keys(chrMap).join(', ');
}
},
methods: {
scramble: function (msg) {
var rs = ['[ ] ' + msg];
var chrKeys = Object.keys(chrMap);
var chr = null;
// for each mapped character
for (i=0; i<chrKeys.length; i++) {
var chr = chrKeys[i];
// if it is found in msg
if (msg.indexOf(chr) > -1) {
var mapped = chrMap[chr];
for (j=0; j<mapped.length; j++) {
rs.push('['+ mapped[j] +'] ' + msg.replace(chr, mapped[j]));
}
}
}
return rs;
}
}
})
</script>
</body>
</html>