Security and Cryptography
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationSecurity and Cryptography
Receive the tools necessary to be the rock star of your field. Our 12-month program teaches you the evolving world of multi-channel marketing as well as the complex issues and opportunities found in the industry.

ASP Free and Iron Speed Designer are giving away $5,500+ in FREE licenses. Iron Speed's RAD CASE toolset can save up to 80% of your coding time. One free license per week, one perpetual license per month!
Download and Activate to enter!

Web development can be a daunting task, even for specialists. There is a lot of information to absorb and a lot of technologies to learn in order to manage a superior website. When trying to learn the ropes, developers need a reliable source to introduce new ideas that can be easily implemented. When working on large projects, even web veterans may run into a technology or an aspect of a technology that they are unfamiliar with.

Learn More!


Download to Enter
| Contest Rules

Tutorials | Forums

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 25th, 2003, 06:57 AM
ebloggy ebloggy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 123 ebloggy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 44 m 54 sec
Reputation Power: 9
SSL Man-in-the-Middle Attack

I don't quite understand the Man-In-The-Middle Attack when using SSL, as describe here: http://developer.netscape.com/docs/...slin/index.html


If the rogue program intercepts the communication between the server and client and replaces the legtimate keys with its own, the digital signature of the certificate would show that the certificate have been tampered with, is it not?
__________________
free blog | free blogs

Reply With Quote
  #2  
Old September 25th, 2003, 04:59 PM
alexgreg's Avatar
alexgreg alexgreg is offline
Full Access
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jun 2000
Location: London, UK
Posts: 2,019 alexgreg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 sec
Reputation Power: 14
Quote:
If the rogue program intercepts the communication between the server and client and replaces the legtimate keys with its own, the digital signature of the certificate would show that the certificate have been tampered with, is it not?

If the client is connecting to a server for the first time, then it wouldn't have a previous record of the server's key to compare to the one it's receiving, hence it can't know from the certificate that it isn't communicating with the server it intended to.

The man-in-the-middle is doing the SSL negotiation with the legitimate server using its keys, and the victim is doing SSL negotiation with the man-in-the-middle using the man-in-the-middle's key (which it thinks is the legitimate server's key). As far as both parties are concerned, they are talking to legitimate clients/servers. Neither the legitimate server or the victim are any the wiser.
__________________
Alex
(http://www.alex-greg.com)

Reply With Quote
  #3  
Old September 27th, 2003, 06:05 AM
ebloggy ebloggy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 123 ebloggy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 44 m 54 sec
Reputation Power: 9
Assuming we are connecting to a Root CA Server, wouldn't my browser already store the public key of this server? Hence rendering a Man-In-The-Middle Attack futile.

Reply With Quote
  #4  
Old September 27th, 2003, 12:49 PM
alexgreg's Avatar
alexgreg alexgreg is offline
Full Access
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jun 2000
Location: London, UK
Posts: 2,019 alexgreg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 sec
Reputation Power: 14
Quote:
Assuming we are connecting to a Root CA Server

You're not, because that's not the way SSL works. The SSL client doesn't contact the "Root CA Server" (I assume by this you mean a trusted authority such as VeriSign?) - the SSL client has a list of root CA's that it trusts, and it checks if the certificate has been signed by one of those. If so, then it proceeds. If not, then it may issue a warning, saying that the certificate wasn't signed by a root authority.

Reply With Quote
  #5  
Old September 28th, 2003, 03:22 AM
ebloggy ebloggy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 123 ebloggy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 44 m 54 sec
Reputation Power: 9
Hmm so for the client to check if the certificate is genuinely signed by say Verisign, it would have the public key of Verisign, right?

And if the man in the middle changes the key of the certificate, then the certificate would be invalid, because the message digest is different.

Reply With Quote
  #6  
Old September 1st, 2004, 05:46 PM
kimmylin kimmylin is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 2 kimmylin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question

Quote:
Originally Posted by alexgreg
If the client is connecting to a server for the first time, then it wouldn't have a previous record of the server's key to compare to the one it's receiving, hence it can't know from the certificate that it isn't communicating with the server it intended to.


I am also confused by the article in URL when talking about the Man-In-The-Middle attack.
The client is supposed to get a certificate, vouchered by a trusted CA, from the server. So if the man-in-the-middle want to intercept, it then has two options (from my imagination):

- give the client a tampered certificate intercepted from the true server
But the client will find out that this certificate has been tampered with from the CA's digital signature.

- give the client a certificate with his Man-In-The-Middle public key
But the client will find out it has different Distinguished Name from the server if the certificate is vouchered by a trusted CA and then terminate the session
(Unless the client doesn't know the DN of the server. Is it why the article talk about checking domain name of the server and the one on the certificate?)

So how does the Man-in-the-middle attack still occur?
I'm just learning about InfoSec and is VERY NAIVE. So please forgive me to ask naive questions.

Reply With Quote
  #7  
Old September 2nd, 2004, 06:57 AM
mitakeet's Avatar
mitakeet mitakeet is offline
I'm Baaaaaaack!
Dev Shed God (5000 - 5499 posts)
 
Join Date: Jul 2003
Location: Maryland
Posts: 5,414 mitakeet User rank is First Lieutenant (10000 - 20000 Reputation Level)mitakeet User rank is First Lieutenant (10000 - 20000 Reputation Level)mitakeet User rank is First Lieutenant (10000 - 20000 Reputation Level)mitakeet User rank is First Lieutenant (10000 - 20000 Reputation Level)mitakeet User rank is First Lieutenant (10000 - 20000 Reputation Level)mitakeet User rank is First Lieutenant (10000 - 20000 Reputation Level)mitakeet User rank is First Lieutenant (10000 - 20000 Reputation Level)mitakeet User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 2 Weeks 3 Days 9 h 10 m 2 sec
Reputation Power: 213
Think of a proxy server. The client initiates communication with the proxy, indicating it really wants to talk to server xyz, the proxy initiates communication with server xyz and then acts as a virtual circuit betwixt the twain for the duration of the communication. Since this is voluntary no one gives it much thought, but the exact same principle is involved in the man-in-the-middle attack. The 'evil-proxy' listens to the communication stream from the client looking for an attempt to contact server xyz (there are many ways to do this; networking protocols are, by themselves, very insecure). When it finds such an attempt, it hijacks the connection attempt (meaning it acts like server xyz as far as the client's network is concerned), then makes the connection to xyz itself. Since everyone has an acceptable certificate (ever research how easy it is to get one?), none of the signatures at any location show any false flags. Though the link talks about verifying the domain of the server, that is also not very difficult to spoof, so the upshot is you cannot guarentee that you are communicating with the target server unless you have an independant way of obtaining its certificate (in which case it is then trivial to detect). Further, particularlly in the case of HTTPS, client users are very likely to click on the 'OK' button when the client browser tells them that the domain does not match the certificate making the warning almost useless.
__________________

My blog, The Fount of Useless Information http://sol-biotech.com/wordpress/
Free code: http://sol-biotech.com/code/.
Secure Programming: http://sol-biotech.com/code/SecProgFAQ.html.
Performance Programming: http://sol-biotech.com/code/PerformanceProgramming.html.
LinkedIn Profile: http://www.linkedin.com/in/keithoxenrider

It is not that old programmers are any smarter or code better, it is just that they have made the same stupid mistake so many times that it is second nature to fix it.
--Me, I just made it up

The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man.
--George Bernard Shaw

Reply With Quote
  #8  
Old September 2nd, 2004, 09:59 AM
kimmylin kimmylin is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 2 kimmylin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Red face How do apps prevent MITM attack?

So the way to avoid this kind of attack is really to get a certificate from a trusted CA before you further communicate with a particular server? How do applications do it nowadays since it's not difficult to spoof someone else's domain name?

Reply With Quote
  #9  
Old September 2nd, 2004, 10:07 AM
mitakeet's Avatar
mitakeet mitakeet is offline
I'm Baaaaaaack!
Dev Shed God (5000 - 5499 posts)
 
Join Date: Jul 2003
Location: Maryland
Posts: 5,414 mitakeet User rank is First Lieutenant (10000 - 20000 Reputation Level)mitakeet User rank is First Lieutenant (10000 - 20000 Reputation Level)mitakeet User rank is First Lieutenant (10000 - 20000 Reputation Level)mitakeet User rank is First Lieutenant (10000 - 20000 Reputation Level)mitakeet User rank is First Lieutenant (10000 - 20000 Reputation Level)mitakeet User rank is First Lieutenant (10000 - 20000 Reputation Level)mitakeet User rank is First Lieutenant (10000 - 20000 Reputation Level)mitakeet User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 2 Weeks 3 Days 9 h 10 m 2 sec
Reputation Power: 213
Not before further communication, before any communication. Applications mostly do it poorly now, but since there are so many other easier ways to hack, the bad guys are not spending a lot of time doing it. However, there are plenty of mainstream attacks that are in place and scripted, so even those with little to no programming experience can give them a try. If you are casually surfing the web, just keep in mind that the little security icon is not proof that you are secure.

Reply With Quote
  #10  
Old December 3rd, 2004, 03:27 PM
avitar.net's Avatar
avitar.net avitar.net is offline
'seasoned' OR 'flavor' text?
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: USA::CA::LA
Posts: 154 avitar.net User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 25 m 30 sec
Reputation Power: 9
Send a message via AIM to avitar.net
and then....

...it is also worth noting that even if you don't have a little security icon, you can have secure communication too (via cgi/java apps, etc.).

There is no garenteed security software system, especially across the web. The best you can do is check to make sure there is a "reasonable" amount of security.

For instance when i buy things online i talk to others that have bought things from them before that i trust, I check to make sure the company has been around for a while, i do a dns lookup (and compare ip's) to make sure i am looking at the right site, then i look at their cert, then i make sure they are using a current version of apache and that my order goes over https, then i make sure I have to enter the security code on my CC.

Those are just some basic things that everyone can do to make sure that anyone can (and should) do to make sure that the company at least has a legitamite appearance.

The only secure computer is one that is turned off and that has no way to turn it on... and no physical connections, and that is buryed under a steel reinforced slab of concrete =P

So in response to: How do apps prevent MITM attack?

If you are running the app on your network, one model is to distribute keys/certificates through an alternate method then using the application (which will download the key/cert again).

So you can FTP 10 public 4096 bit key/certs to your 10 servers, during configuration before using the app. Another way is using USB keychains and phyically adding them.

Using bizitine generals as an analogy to the problem:
http://www.cs.cornell.edu/gupta/byzantine.htm
http://citeseer.ist.psu.edu/lamport82byzantine.html

The best solution for software (and possibly a revision of https) is to use a similair solution to bizitine generals in order form a circle of trust between computers. So in other words your client will contact a list of x random # of servers it has on a server list. Then it will validate that the response from all the servers are the same. This technique is called "Trianglation" of your results.
__________________
Visit my site Avitar.net for great Atricles on Project Managment, Web Development, and System Administration.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationSecurity and Cryptography > SSL Man-in-the-Middle Attack


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.

© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 10 - Follow our Sitemap