11
11
---
12
12
13
13
In 2010, Andlabs discovered an attack to fingerprint open TCP ports at client
14
- workstation. Here is a blog post from them which is describing this
15
- vulnerability. JS-Recon was a tool developed by them proving the weakness of
16
- the browser. Unfortunately JS-Recon is not available on mentioned link for
17
- unknown reasons. I tried my best to find the source code of that tool, but I
18
- was ended with no results. Because the source code of the tool is not
19
- available, the only way to confirm the possibility of this attack was to
20
- reconstruct it from steps mentioned by the author.rom steps mentioned by the
21
- author.
14
+ workstation. You can read [ this blog post] [ andlabs_blogpost ] which is describing
15
+ details of this method. JS-Recon was a tool implementing this attack on its
16
+ client to prove the danger of this vulnerability. Unfortunately, JS-Recon is not
17
+ available on mentioned link for unknown reasons. I tried my best to find the
18
+ source code of that tool, but I was ended with no results. Because the source
19
+ code of the tool is not available, the only way to confirm the possibility of
20
+ this attack was to reconstruct it from steps mentioned at that blog post.
22
21
23
22
In this post I will share my experience of rebuilding this attack. Because this
24
23
attack is from the front-end side, knowledge of basic Javascript API is
@@ -34,12 +33,12 @@ developer console of your browser.
34
33
* ** XHR** : A short form of [ XML Http Request] [ mdn_xhr ] .
35
34
* ** Socket** : A TCP/IP raw socket.
36
35
37
- According to the author , If I write a Javascript code to open a XHR to
38
- http://localhost:8084 and host that code at xyz .com then when you visit the
39
- xyz .com the browser will open that XHR to port 8084 of your workstation,
40
- because the localhost for your browser is your workstation. This gap invites
41
- many vulnerabilities for users. One of them is the possibility to fingerprint
42
- open TCP ports at client workstation.
36
+ According to that blog post , If I write a Javascript code to open a XHR to
37
+ ` http://localhost:8084 ` and host that code at example .com then when you visit
38
+ the example .com the browser will open that XHR to port ` 8084 ` of your
39
+ workstation, because the localhost for your browser is your workstation. This
40
+ gap invites many vulnerabilities for users. One of them is the possibility to
41
+ fingerprint open TCP ports at client workstation.
43
42
44
43
The author claims that the browser takes recognizably more time to open a XHR
45
44
targeting an occupied port. Comparatively, time took to open a XHR aimed at an
@@ -54,7 +53,7 @@ var requestPort = function(port) {
54
53
xhr .onreadystatechange = function () {
55
54
if (xhr .readyState === 1 ) {
56
55
var timeTook = Date .now () - startTime;
57
- console .log (" Browser took : " + timeTook + " microsecounds to open." );
56
+ console .log (" Browser took : " + timeTook + " microseconds to open." );
58
57
}
59
58
};
60
59
startTime = Date .now ();
@@ -84,17 +83,17 @@ above results, We can conclude that mentioned method is not giving different
84
83
results for occupied and empty port. We can conclude that mentioned method by
85
84
AndLabs is failing to distinguish an occupied port from a non occupied port.
86
85
87
- I tried hard to find any possible cause for the failure of this attack. I
88
- didn't found any certain evidences. May be our hardware or browser code has
89
- improved for opening a TCP sockets quicker than what it used to. I will not
90
- lie, but that abstract blog post by the AndLabs took sometime to understand the
91
- anatomy of this attack. I wasn't happy with going back from this point. Just
92
- for my satisfaction, I tried every possible combinations of ` xhr.readyState `
93
- values to find any pattern. From my observation, I recognized that timing for
94
- returning a header from an occupied port was delayed. Comparatively, this
95
- response was quick for ports where no service was running. I am comparing the
96
- time browser took to return a response headers whereas in the previous method
97
- it was dependent on the time browser took for opening a socket.
86
+ I tried hard to find any possible cause for the failure of this attack. I didn't
87
+ found any conclusive evidences. May be our hardware or browser code has improved
88
+ for opening a TCP sockets quicker than what it used to. I will not lie, but that
89
+ abstract blog post by the AndLabs took sometime to understand the anatomy of
90
+ this attack. I wasn't happy with going back from this point. Just for my
91
+ satisfaction, I tried every possible combinations of ` xhr.readyState ` values to
92
+ find any pattern. From my observation, I recognized that timing for returning a
93
+ header from an occupied port was delayed. Comparatively, this response was quick
94
+ for ports where no service was running. I am comparing the time browser took to
95
+ return a response headers whereas in the previous method it was dependent on the
96
+ time browser took for opening a socket.
98
97
99
98
``` javascript
100
99
var requestPort = function (port ) {
@@ -103,7 +102,7 @@ var requestPort = function(port) {
103
102
xhr .onreadystatechange = function () {
104
103
if (xhr .readyState === 2 ) {
105
104
var timeTook = Date .now () - startTime;
106
- console .log (" Browser took : " + timeTook + " microsecounds to send response headers." );
105
+ console .log (" Browser took : " + timeTook + " microseconds to send response headers." );
107
106
}
108
107
};
109
108
startTime = Date .now ();
@@ -125,15 +124,15 @@ go beyond 200 microseconds. Comparing this with a header response time of
125
124
occupied ports, we can see that response time of non-empty port is recognizably
126
125
higher than empty port.
127
126
128
- Browser is the most common tool used by us. Asserting this venerability requires
129
- knowledge of Javascript and everyone is not a developer. As I mentioned earlier,
130
- I failed to find the source code of JS-Recon (the tool written by AndLabs
131
- proving possibility of this attack). For those reasons, I decided to write a
132
- tool pioneered on my improvements on an attempt of Andlabs. Today, I have
133
- successfully completed that tool. I have decided to name it
127
+ Browser is the most common tool used by us. Asserting this vulnerability
128
+ requires knowledge of Javascript and everyone is not a developer. As I mentioned
129
+ earlier, I failed to find the source code of JS-Recon (the tool written by
130
+ AndLabs proving possibility of this attack). For those reasons, I decided to
131
+ write a tool pioneered on my improvements on an attempt of Andlabs. Today, I
132
+ have successfully completed that tool. I have decided to name it
134
133
[ "Chatur"] [ chatur_pronounciation ] . Chatur means intelligent person in Hindi.
135
- Please find the source code of Chatur [ here ] [ chatur_github ] . Chatur is a free
136
- software. Try this tool and share your thoughts with me. This is not a
134
+ Please find the source code of Chatur [ on Github ] [ chatur_github ] . Chatur is a
135
+ free software. Try this tool and share your thoughts with me. This is not a
137
136
bulletproofed idea, but it works most of the time you will try.
138
137
139
138
[ andlabs_blogpost ] : http://blog.andlabs.org/2010/12/port-scanning-with-html5-and-js-recon.html
0 commit comments