<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2728810436550067529</id><updated>2012-02-16T17:39:03.725-08:00</updated><category term='privacy tor vpn'/><category term='linux'/><category term='bind named'/><category term='pastebin hacking'/><category term='SSL'/><category term='MITM routers'/><category term='mitm lan'/><category term='wireless'/><category term='ipv6'/><category term='blippy'/><category term='SSL TLS Cryptography'/><title type='text'>##security (freenode) official blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://fnsecurity.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2728810436550067529/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://fnsecurity.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Albert Gonzalez</name><uri>http://www.blogger.com/profile/11199783170451043527</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>12</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2728810436550067529.post-7884196026699570956</id><published>2012-01-18T19:10:00.000-08:00</published><updated>2012-01-18T19:17:52.130-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='privacy tor vpn'/><title type='text'>Privacy and Secrecy on Untrusted Networks</title><content type='html'>&lt;div&gt;A common question that comes up in the channel quite often is to how to keep your internet traffic "private".  Of course, "private" can mean many different things, and the answer to this question can vary quite a bit depending on what you're trying to keep private from.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;People tend to fall into 3 categories.&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Want to hide your traffic from the local network&lt;/li&gt;&lt;li&gt;Want to hide your source from a remote website&lt;/li&gt;&lt;li&gt;HIDE ALL THE THINGS!&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;Before we get into specific solutions for these problems, lets talk about potential solutions at a high level.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;SSL&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;I'm sure at this point you're familiar with SSL.  SSL provides transport layer&lt;/div&gt;&lt;div&gt;security between your browser and a remote server.  There are potential attacks against SSL, but for the most part it does a good job of preventing someone from eavesdropping on your traffic.  Of course, that depends on the remote service supporting SSL.  If the remote system you're accessing does not support SSL, there's nothing really you can do to add it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It will not prevent any eavesdropper or the website operator from knowing your IP or what webserver you are visiting.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Tor&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Tor provides anonymity by encrypting your network traffic through a series of intermediate nodes before sending the traffic out through an "Exit node".  The traffic from the exit node then looks like it would have without Tor in the first place.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Tor does an excellent job of hiding your source IP address from remote websites.  There are attacks to bypass this level of anonymity, but in most cases it works out well.  It also does a good job of hiding the content and destination of your traffic from attackers on your local network (are you on unprotected wifi at a coffee shop?)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;A big warning though.  Unencrypted traffic (http, imap, pop3 or smtp without SSL), can be sniffed by the owner of the exit node, much like if someone was on the same open wireless network as you are and you used these sorts of protocols.  So who are the people who own these exit nodes?  Quite often they are security researchers, government agencies, or other people with vested interest in sniffing your traffic.  So you may be trading a small risk for a much larger one.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;VPN&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;VPNs and VPN like systems (SSH forwarding, SSH SOCKS proxy support, etc) allow you to essentially forward your traffic to a remote location where it is then sent unencrypted.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Much like a Tor exit node, the owner of the VPN server may sniff any unencrypted traffic.  The difference is who owns the VPN server.  Chances are the system is owned by you, the company you work for, or a service you're paying money to.  A bit more trustworthy than an exit node operator, although SSL encryption is still recommended.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So going back to the 3 problems.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;Want to hide your traffic from the local network&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;SSL is a good basic option.  For traffic that doesn't support encryption, or for things that are a bit more sensitive, add a VPN service of some sort.  Running a VPN type service on your home system may be a good option if you're comfortable setting one up.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Want to hide your source from a remote website&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Assuming you really need to hide your identity, Tor is your best option here.  A VPN would transfer your source IP from your current IP to the VPN endpoint... but who owns that endpoint?  Is it a system you own?  One you're paying for a service from (vulnerable to a subpoena)?  Your employer?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Just make sure you take the necessary steps to protect any login credentials, or&lt;/div&gt;&lt;div&gt;sensitive content.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;HIDE ALL THE THINGS!&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Perhaps you should talk to a therapist?&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2728810436550067529-7884196026699570956?l=fnsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fnsecurity.blogspot.com/feeds/7884196026699570956/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fnsecurity.blogspot.com/2012/01/privacy-and-secrecy-on-untrusted.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2728810436550067529/posts/default/7884196026699570956'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2728810436550067529/posts/default/7884196026699570956'/><link rel='alternate' type='text/html' href='http://fnsecurity.blogspot.com/2012/01/privacy-and-secrecy-on-untrusted.html' title='Privacy and Secrecy on Untrusted Networks'/><author><name>G.D. Fuego</name><uri>http://www.blogger.com/profile/10646006841687422655</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2728810436550067529.post-8513096819628114810</id><published>2011-11-17T18:08:00.000-08:00</published><updated>2011-11-17T18:31:11.385-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bind named'/><title type='text'>New DoS in Bind - What it means</title><content type='html'>&lt;div&gt;Yesterday ISC announced a new &lt;a href="https://www.isc.org/software/bind/advisories/cve-2011-4313"&gt;vulnerability&lt;/a&gt; in bind that appears to be getting exploited in the wild.  So far it appears to be a denial of service (DoS) only, causing a crash in recursive nameservers.  There is no impact to authoritative only nameservers (authoritative that are also recursive could be impacted).  I'm not quite certain if the crash is caused by badly formatted requests or responses, and if the record type matters.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So what does this mean to your environment?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Well, first, you'll want to patch your recursive nameservers (the nameservers dedicated to allowing your users to turn names into IP addresses).  Your exposure should be limited since your recursive nameservers should be limited to just your users.  You are limiting your recursive nameservers to your user IPs, right?  If not, go do that as well.  There are a number of problems that can be caused by having your nameservers open to the general public.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now, you likely have authoritative nameservers as well for allowing your customers to look up IPs for your servers (www.yourcompany.com).  These boxes should be save as long as your authoritative nameservers don't have recursion enabled.  If they do, disable it.  Keeping those services separate is definitely a good idea.  In this case, someone could take your company off the internet by exploiting the vulnerability.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now a number of people like to run recursive nameservers bound to localhost or restricted to just the local system via firewall rules.  Are these boxes safe?  Well, it depends.  Now is where the questions about request versus response, and request type really matter.  With these restrictions, sending a malicious request would be difficulty (assuming it is a bad formatting of the request itself).  Getting the box to receive a malicious response could very well be possible, depending on what the box is doing.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Run an SSH daemon?  SSH daemons are often configured to look up DNS records for the IPs that connect to them.  A malicious PTR (reverse DNS) record could get you.  The PTR record is then looked up in an A record query in order to make sure they match.  A malicious A record could get you.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Proxy server?  Pretty easy to trigger a proxy to look up an IP.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Web Browser?  A malicious webserver can get you to look up all sorts of things.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;SMTP servers do a lot of reverse and forward lookups.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Malicious responses could crash DNS and cause service outages in a lot of these cases.  Now, maybe the DNS server doesn't matter so much on these boxes.  That's something you'll need to decide on your own based upon your own requirements.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2728810436550067529-8513096819628114810?l=fnsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fnsecurity.blogspot.com/feeds/8513096819628114810/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fnsecurity.blogspot.com/2011/11/new-dos-in-bind-what-it-means.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2728810436550067529/posts/default/8513096819628114810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2728810436550067529/posts/default/8513096819628114810'/><link rel='alternate' type='text/html' href='http://fnsecurity.blogspot.com/2011/11/new-dos-in-bind-what-it-means.html' title='New DoS in Bind - What it means'/><author><name>G.D. Fuego</name><uri>http://www.blogger.com/profile/10646006841687422655</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2728810436550067529.post-5818081671183404054</id><published>2011-11-16T18:18:00.000-08:00</published><updated>2011-11-17T13:49:12.519-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSL TLS Cryptography'/><title type='text'>SSL/TLS Basics</title><content type='html'>SSL and TLS are a big part of security on the internet, and is often not very well understood by users or by sysadmins alike.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;History of the Protocol&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;SSL got its start back in 1994 with version 2.0 (Initially labelled 0.2), authored by engineers at Netscape.  Due to vulnerabilities in the protocol, it was replaced by SSLv3 in 1996.  Future development of the protocol was handed off to the IETF, including a rename to TLS in 1999.   &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Since SSL version 2 was replaced by version 3 so long ago, backwards compatibility from older clients is NOT necessary or desired.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Quick Intro to Cryptography&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Before we get started on SSL itself, it is useful to have a very high level understanding of the difference between various types of cryptography.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There are two major types of cryptography, symmetric and asymmetric. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Asymmetric cryptography, or public key cryptography, is a system which uses a pair of keys for encryption purposes.  The user generates a private key and a public one.  Messages encrypted with the public key can be read by the private key, and messages encrypted with the private key can be read by the public key (for message signing purpose).  Examples of asymmetric crypto include RSA and DSA.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Symmetric cryptography uses a single key which both the sender and receiver need to have a copy of prior to communication occurring.  Examples of symmetric cryptography include des, 3des (triple des) or AES.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Symmetric crypto is much faster than asymmetric crypto, and is much more secure while using small key sizes.  DSA uses a key size of 1024 bits while RSA is commonly used at 1024, 2048 or 4096 bits.  AES on the other hand is most commonly used at 128 or 256 bits.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;How SSL uses Crypto&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;SSL uses a combination of both symmetric and asymmetric crypto in order to secure access to websites (or other services).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Webservers are configured with a key pair made up of a private key (typically RSA), and a public x509 certificate which has the matching public key embedded in it.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The x509 certificate includes a number of fields including valid dates, a Common Name (CN) which identifies the site the certificate belongs to, and various other identifying fields.  The cert is signed by another RSA cert which belongs to a Certificate Authority (CA) which is trusted either directly or indirectly by the browser.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As a browser hits a website, an SSL handshake occurs.  At a high level, this handshake includes the client sending a list of suggested symmetric ciphers and compression methods.  The server sends its public cert and a random number and selects a cipher to use for the session.  Assuming the public cert verifies properly or the user chooses to accept it, the client then chooses a PreMasterSecret and encrypts it to the server's public key.  The client and server then use the PreMasterSecret and the random number to create the symmetric key to be used in the agreed upon cipher.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Once the browser and cert have agreed upon the symmetric key and cipher, the rest of the session is encrypted using symmetric crypto, which is faster and more secure.  This is why you generate a 1024 or 2048 it key for your webserver, yet hear recommendations to use 128 or 256 bit key strength.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;X509 Cert Validation&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;X509 certs are validated using &lt;a href="http://en.wikipedia.org/wiki/Public_key_infrastructure"&gt;PKI&lt;/a&gt;, which is more than I really want to get into right now.  Lets just say it brings a whole giant mess of additional complexity and weakness into the picture.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;More Info&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;For more info, the Wikipedia article on &lt;a href="http://en.wikipedia.org/wiki/Transport_Layer_Security"&gt;TLS&lt;/a&gt; is very well written.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2728810436550067529-5818081671183404054?l=fnsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fnsecurity.blogspot.com/feeds/5818081671183404054/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fnsecurity.blogspot.com/2011/11/ssltls-basics.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2728810436550067529/posts/default/5818081671183404054'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2728810436550067529/posts/default/5818081671183404054'/><link rel='alternate' type='text/html' href='http://fnsecurity.blogspot.com/2011/11/ssltls-basics.html' title='SSL/TLS Basics'/><author><name>G.D. Fuego</name><uri>http://www.blogger.com/profile/10646006841687422655</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2728810436550067529.post-6080479418170259801</id><published>2011-03-07T17:31:00.000-08:00</published><updated>2011-03-07T17:55:14.905-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ipv6'/><title type='text'>Starting over with IPv6</title><content type='html'>Well, I finally decided to take the plunge, and start to learn IPv6.  I figure I might as well be the guy that waited until the last minute instead of being one of the millions that waited until AFTER the last minute.  As it turned out, it wasn't as bad as I thought it was going to be.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I got started after I saw a &lt;a href="http://www.reddit.com/r/ipv6/comments/fjc2t/whats_a_good_book_to_learn_about_ipv6/"&gt;question on Reddit looking for good reading material&lt;/a&gt;.  One of the top links was a &lt;a href="http://www.openwall.com/presentations/IPv6/"&gt;rather good primer on ipv6&lt;/a&gt;.  From there I decided to get access to an ipv6 tunnel, and work on obtaining a free IPv6 certification from &lt;a href="http://ipv6.he.net/"&gt;Hurricane Electric&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I looked at two different tunnel brokers.  First I looked at &lt;a href="http://tunnelbroker.net/"&gt;Hurricane Electric's offering&lt;/a&gt;.  Unfortunately they tunnel over Protocol 41 which can be a bit difficult to deal with behind a NAT since home routers may or may not provide you with the ability to forward non-TCP/non-UDP traffic.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;After that didn't work out, I looked at &lt;a href="http://sixxs.net/"&gt;Sixxs.net&lt;/a&gt; which ended up working out a lot better for me.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The process for dealing with Sixxs.net is a bit slow.  They are rather careful about who they give out IPv6 connectivity to and what you're able to do, so you can get bogged down a bit in the approval process.  It took me a day for my account to get approved, then another day for my tunnel and finally a third day to obtain my own subnet.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Once all was said and done, I had my FreeBSD box acting as the local end of my tunnel using AICCU.  Sixxs was routing my own personal /48 network to the FreeBSD box which was then using &lt;a href="http://www.litech.org/radvd/"&gt;radvd&lt;/a&gt; to announce the route on my local network.  My Mac, Android and Linux devices were all able to autodetect their new IPv6 IP address without using DHCP and used it in addition to their existing RFC1918 space IPv4 addresses in order to retrieve content.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I even got around to finally learning to use Pf in order to filter the new inbound IPv6 range.  If you try this yourself, just remember that your IPv6 range is tunneled directly to a system on your local network, and your existing firewall rules will likely do nothing to protect these IPs.  Be prepared to enact IPv6 filtering rules ASAP.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Its definitely worth the time and effort to learn this stuff.  You get to join a relatively small set of people who have hands on knowledge with IPv6 networking so you'll be getting a leg up on the competition.  Besides, its all so new you'll get an opportunity to find all of those devices that don't handle IPv6 quite right.  What else could you want as a security guy?&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2728810436550067529-6080479418170259801?l=fnsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fnsecurity.blogspot.com/feeds/6080479418170259801/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fnsecurity.blogspot.com/2011/03/starting-over-with-ipv6.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2728810436550067529/posts/default/6080479418170259801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2728810436550067529/posts/default/6080479418170259801'/><link rel='alternate' type='text/html' href='http://fnsecurity.blogspot.com/2011/03/starting-over-with-ipv6.html' title='Starting over with IPv6'/><author><name>G.D. Fuego</name><uri>http://www.blogger.com/profile/10646006841687422655</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2728810436550067529.post-7809872944799184223</id><published>2010-11-19T07:50:00.000-08:00</published><updated>2010-11-19T08:00:12.732-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Invisible IP Addresses</title><content type='html'>I stumbled across something interesting the other day.  I was working on a webserver which was configured to listen to traffic on a specific IP address defined within the Apache configuration.  Oddly, this IP address did not show up in ifconfig, but the box WAS serving traffic for it.  Even an ifconfig -a failed to show the IP.  My only theory was that since the interface was brought down AFTER Apache started listening to that IP, it was somehow still wedged up.  &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So I confirmed the network init scripts, and rebooted the box.  After the reboot, the device once again began listening to this "unconfigured" IP.  As it turns out, this was due to how the interface was being configured.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;/sbin/ip addr add 10.1.8.2/8 dev eth0:1&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;# ping 10.1.8.2 -c 1&lt;/div&gt;&lt;div&gt;PING 10.1.8.2 (10.1.8.2) 56(84) bytes of data.&lt;/div&gt;&lt;div&gt;64 bytes from 10.1.8.2: icmp_req=1 ttl=64 time=0.036 ms&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;--- 10.1.8.2 ping statistics ---&lt;/div&gt;&lt;div&gt;1 packets transmitted, 1 received, 0% packet loss, time 0ms&lt;/div&gt;&lt;div&gt;rtt min/avg/max/mdev = 0.036/0.036/0.036/0.000 ms&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;# ifconfig eth0:1&lt;/div&gt;&lt;div&gt;eth0:1    Link encap:Ethernet  HWaddr 00:25:64:c2:2f:6d  &lt;/div&gt;&lt;div&gt;          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;/div&gt;&lt;div&gt;          Interrupt:21 Memory:febe0000-fec00000 &lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;# ip addr list&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;2: eth0: &lt;broadcast,multicast,up,lower_up&gt; mtu 1500 qdisc pfifo_fast state UP qlen 1000&lt;/div&gt;&lt;div&gt;    link/ether 00:25:64:c2:2f:6d brd ff:ff:ff:ff:ff:ff&lt;/div&gt;&lt;div&gt;    inet 192.168.1.57/24 brd 192.168.1.255 scope global eth0&lt;/div&gt;&lt;div&gt;    inet 10.1.8.2/8 scope global secondary eth0&lt;/div&gt;&lt;div&gt;    inet6 fe80::225:64ff:fec2:2f6d/64 scope link &lt;/div&gt;&lt;div&gt;       valid_lft forever preferred_lft forever&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Apparently that if you add an additional IP address to an interface using ip addr, it does not show up in ifconfig unless you add a label to it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;/sbin/ip addr add 10.1.8.3/8 dev eth0:2 label eth0:2&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;# ifconfig eth0:2&lt;/div&gt;&lt;div&gt;eth0:2    Link encap:Ethernet  HWaddr 00:25:64:c2:2f:6d  &lt;/div&gt;&lt;div&gt;          inet addr:10.1.8.3  Bcast:0.0.0.0  Mask:255.0.0.0&lt;/div&gt;&lt;div&gt;          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;/div&gt;&lt;div&gt;          Interrupt:21 Memory:febe0000-fec00000 &lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Seems like an interesting way to hide an IP address on a system.  Most people I know use ifconfig rather than "ip addr list" to get a list of IP addresses on a box.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2728810436550067529-7809872944799184223?l=fnsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fnsecurity.blogspot.com/feeds/7809872944799184223/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fnsecurity.blogspot.com/2010/11/invisible-ip-addresses.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2728810436550067529/posts/default/7809872944799184223'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2728810436550067529/posts/default/7809872944799184223'/><link rel='alternate' type='text/html' href='http://fnsecurity.blogspot.com/2010/11/invisible-ip-addresses.html' title='Invisible IP Addresses'/><author><name>G.D. Fuego</name><uri>http://www.blogger.com/profile/10646006841687422655</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2728810436550067529.post-6546604258490503960</id><published>2010-08-19T10:21:00.000-07:00</published><updated>2010-08-19T10:30:30.960-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSL'/><title type='text'>SSL Chaining - The RFC</title><content type='html'>Quick follow-up on gdfuego's post.&lt;br /&gt;&lt;br /&gt;From &lt;a href="http://tools.ietf.org/html/rfc5246#section-7.4.2"&gt;RFC 5246 - The Transport Layer Security (TLS) Protocol Version 1.2&lt;/a&gt; (Section 7.4.2):&lt;br /&gt;&lt;br /&gt;&lt;pre class="newpage"&gt;   certificate_list&lt;br /&gt;   This is a sequence (chain) of certificates.  The sender's&lt;br /&gt;   certificate MUST come first in the list.  Each following&lt;br /&gt;   certificate MUST directly certify the one preceding it.  Because&lt;br /&gt;   certificate validation requires that root keys be distributed&lt;br /&gt;   independently, the self-signed certificate that specifies the root&lt;br /&gt;   certificate authority MAY be omitted from the chain, under the&lt;br /&gt;   assumption that the remote end must already possess it in order to&lt;br /&gt;   validate it in any case.&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;There's no reason why a web server can't infer the order of the chain from Issuer and Subject relationships. However, there's no guarantee that any given server will do this for you unless they state this as a feature.&lt;br /&gt;&lt;br /&gt;The key thing is that it &lt;em&gt;is&lt;/em&gt; part of the protocol that the certs be provided already in order.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2728810436550067529-6546604258490503960?l=fnsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fnsecurity.blogspot.com/feeds/6546604258490503960/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fnsecurity.blogspot.com/2010/08/ssl-chaining-rfc.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2728810436550067529/posts/default/6546604258490503960'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2728810436550067529/posts/default/6546604258490503960'/><link rel='alternate' type='text/html' href='http://fnsecurity.blogspot.com/2010/08/ssl-chaining-rfc.html' title='SSL Chaining - The RFC'/><author><name>crunge</name><uri>http://www.blogger.com/profile/16080863145091513828</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2728810436550067529.post-8288416055290655258</id><published>2010-08-19T08:30:00.000-07:00</published><updated>2010-08-19T08:49:48.186-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSL'/><title type='text'>Yes Virginia, SSL Chain Ordering Does Matter</title><content type='html'>If you've ever deployed an SSL certificate from a major SSL vendor, you've probably seen mention of chain/intermediate SSL certificates.  These certs are available for download when you retrieve your newly signed cert.  But the big question is, are you doing the right thing with them?&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;h2&gt;A bit of background&lt;/h2&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;All web browsers out there ship with a set of root certificates.  These are certificate owned by certificate authorities for the purpose of signing SSL certs.  Any form of public key cryptography requires some form of security public key distribution, and the way SSL handles this is through these bundled root certs.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Root certs are dangerous though.  If someone was to compromise your root cert, you'd need to "revoke" it, which in this case essentially means getting it removed from every browser on the Internet.  You'd also have to get them a replacement, which is a similarly daunting task.  Due to this, the authorities out there typically use their root certs to create a subordinate root.  This is a certificate authority which is granted the right to sign other certificates by the root cert within your browser.  Replacing a subordinate is a LOT easier as they can sign additional subordinates as desires, and they can provide an online revocation method in case of compromise.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So root certs typically sign subordinates, and subordinates sign your cert.  Note that there are some exceptions to this.  For example, Thawte signs all their certs with their root.  You can also pay extra to other CAs for a root signed cert if you have a reason to need one.  Last time I looked at a price for something like that, it was around $3000 from a middle of the road CA.  God knows what someone like Verisign would charge.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;h2&gt;What this means&lt;/h2&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So you bought a signed cert, and you're loading it on your webserver.  Browsers try to validate this cert, but it is not signed by one of their trusted roots.  In order to validate your cert, they need to have a copy of the public cert for the subordinate root.  This certificate is typically called either a chain cert or an intermediate.  And now we're back to where I started.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In order for the browser to get a copy of this chain, your webserver should be configured to send the intermediate after your certificate.  Then the browser can follow the chain back to the root that it originally trusted.  If you leave this out, browsers will tend to fail to validate your cert.  Note that these failures may be intermittent and I believe some browsers will actually cache chain certs.  So if someone previously visited a website who's cert is signed by the said chain, they may not get an error.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In Apache, you specify the file with the certificate chain using the SSLCertificateChainFile variable in mod_ssl.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;h2&gt;Multiple Intermediates&lt;/h2&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And here's where things go to hell.  You can have a certificate signed by an subordinate signed by a subordinate signed by a root.   Or a longer chain than that.  You handle this case by including ALL of the chain certs within the file specified by SSLCertificateChainFile.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The place where people screw up is with the ordering of this file.  The certificates should be specified in order by who signed what.  So if you public cert is signed by sub2 which was signed by sub1 which was signed by root, your chain file should have sub2 and then sub1.  If you screw up the ordering, some browsers will report a problem while others do not.  In fact, I find that while FireFox and IE don't care about ordering, the browser on Android phones do, which can be rather confusing to server admins.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;h2&gt;Detecting Problems&lt;/h2&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There's an easy way to make sure that you got the ordering right:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;openssl s_client -showcerts -connect server:443&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Openssl will print the certs in the order that they were recieved.  You can ignore the certs and just look at the descriptions above them.  Each cert should have an "s" line and an "i" line.  This signifies the "Subject" and the "Issuer" of the cert.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The first subject should be your website.  The first issuer is the CA that signed your cert.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The next subject should match the issuer line of the previous cert.  The next subject should match the issuer line of the previous cert.  All the way to the end.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If they're out of order, fix em.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2728810436550067529-8288416055290655258?l=fnsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fnsecurity.blogspot.com/feeds/8288416055290655258/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fnsecurity.blogspot.com/2010/08/yes-virginia-ssl-chain-ordering-does.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2728810436550067529/posts/default/8288416055290655258'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2728810436550067529/posts/default/8288416055290655258'/><link rel='alternate' type='text/html' href='http://fnsecurity.blogspot.com/2010/08/yes-virginia-ssl-chain-ordering-does.html' title='Yes Virginia, SSL Chain Ordering Does Matter'/><author><name>G.D. Fuego</name><uri>http://www.blogger.com/profile/10646006841687422655</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2728810436550067529.post-1138352677689083600</id><published>2010-04-23T13:02:00.000-07:00</published><updated>2010-04-23T13:04:59.310-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='blippy'/><title type='text'>Blippy exposes credit card info</title><content type='html'>&lt;div&gt;Apparently Blippy &lt;a href="http://mashable.com/2010/04/23/blippy-credit-card-numbers/"&gt;accidentally leaked credit card information&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you're not familiar with Blippy, they're a social networking site that allows you to link your credit card to their site, and they automatically publish information about when you buy things and what you're buying.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I mean, what could go wrong?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2728810436550067529-1138352677689083600?l=fnsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fnsecurity.blogspot.com/feeds/1138352677689083600/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fnsecurity.blogspot.com/2010/04/blippy-exposes-credit-card-info.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2728810436550067529/posts/default/1138352677689083600'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2728810436550067529/posts/default/1138352677689083600'/><link rel='alternate' type='text/html' href='http://fnsecurity.blogspot.com/2010/04/blippy-exposes-credit-card-info.html' title='Blippy exposes credit card info'/><author><name>G.D. Fuego</name><uri>http://www.blogger.com/profile/10646006841687422655</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2728810436550067529.post-4869889987124375645</id><published>2009-12-31T09:26:00.000-08:00</published><updated>2010-01-03T07:35:31.920-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MITM routers'/><title type='text'>Man-In-The-Middle Attacks - Part 2</title><content type='html'>Ok, so last time we talked about MITM attacks on a local network.  Its a pretty trivial attack that is hard that can be difficult to protect against.  That being said, your attacker would need to have access to your local network in order to pull it off.  This could be an issue on a corporate network, campus network or open wireless network, but you should be pretty safe at home (your wireless is protected, right?).&lt;br /&gt;&lt;br /&gt;Once the packets leave your network these attacks are a lot less feasible.  Competent broadband providers should provide protections against this form of attack on their networks through strict MAC address and IP address bindings to your local cable/dsl modem.  If they don't, then they're probably incompetent in other ways as well.  Grab yourself some extra IPs while you're there.&lt;br /&gt;&lt;br /&gt;After the connection between your house and their equipment you should getting into the realm of routers... Real routers, not the dinky Linksys box you have at your house.  Rackmount jobs put out by Cisco, Juniper and others.  These devices are setup with point to point long-haul connections and peering setups with other network providers.  Your not going to be able to do mac level spoofing on the network connection of one of these devices.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;One quick disclaimer.  In the past I have been responsible for various types of managed switches, but I have never been responsible for high end routing gear.  I have read about various attacks on them, but I lack the real world experience to provide anything in depth on the topic.  If anything below is incorrect somehow, please let me know and I'll correct it.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In our previous example we looked a system's routing table.  You saw a route which sent any local traffic to the local LAN and a default route which sent all other traffic to a dedicated router.  ISP routers also have routing tables, but they are MUCH more complex and are remotely updated regularly via protocols such as &lt;a href="http://en.wikipedia.org/wiki/Border_Gateway_Protocol"&gt;BGP&lt;/a&gt;.  BGP feeds from trusted sources are combined with statically defined routes in order to create cost based routing tables.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;How a MITM attack would work&lt;/h3&gt;If you're looking to perform a man in the middle attack at this layer you would essentially need to find a way to manipulate the routing tables on the router.  If you managed to pull this off you'd be able to direct traffic to an IP address to a different network which could then answer the requests.  For example, if you managed to do this to a Comcast router you could cause some portion of their users to hit your systems when they make a request for 66.249.91.104 (one of the IPs for Google).&lt;br /&gt;&lt;h4&gt;Own the router&lt;/h4&gt;The "simplest" way to manipulate the router would be to get remote administrative access to it.  This could mean brute forcing the telnet/SSH password or SSH key, using exploit code (no where near as easy to find as exploit code for user OS systems) or through physical access means if you happen to have the ability to walk up to one of the devices.&lt;br /&gt;&lt;h4&gt;Own a peer&lt;/h4&gt;Routers establish BGP sessions with other trusted systems in order to obtain updates to their routing tables.  If you can find a way to manipulate that system then you can leverage that trust relationship.  BGP sessions can be established with Unix or Windows servers in addition to other routers so you may have better luck hitting the peer than you would the router itself.  Even if you can own a system on the same network as the peer you may be able to leverage LAN MITM techniques to hijack the traffic.&lt;br /&gt;&lt;h3&gt;Conclusion&lt;/h3&gt;Attempting to perform a MITM attack at this level is much harder.  It would require a higher level of skill on the part of the attacker and barring a newly discovered vulnerability it would require that the network admin (or someone they are trusting) to make a mistake.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2728810436550067529-4869889987124375645?l=fnsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fnsecurity.blogspot.com/feeds/4869889987124375645/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fnsecurity.blogspot.com/2009/12/man-in-middle-attacks-part-2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2728810436550067529/posts/default/4869889987124375645'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2728810436550067529/posts/default/4869889987124375645'/><link rel='alternate' type='text/html' href='http://fnsecurity.blogspot.com/2009/12/man-in-middle-attacks-part-2.html' title='Man-In-The-Middle Attacks - Part 2'/><author><name>G.D. Fuego</name><uri>http://www.blogger.com/profile/10646006841687422655</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2728810436550067529.post-1328571799785708878</id><published>2009-12-21T20:07:00.000-08:00</published><updated>2009-12-24T07:46:59.169-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mitm lan'/><title type='text'>Preventing Man-In-The-Middle (MITM) Attacks</title><content type='html'>Occasionally people pop into the channel asking how to prevent man in the middle attacks.  In fact, one guy popped in several times today under different screen names and asked the question over and over again.&lt;br /&gt;&lt;br /&gt;Well, the short answer is that you can't.  Man in the Middle attacks are a general concept which can refer to any number of specific attacks all of which require different techniques to deal with.  This question would be a lot like asking someone how to prevent theft.  The techniques you use to stop someone from stealing your wallet won't help protect your car, your identity or your data.&lt;br /&gt;&lt;br /&gt;For a longer answer we can look at how networking actually works, and then look at the potential places where man in the middle attacks may occur and what you can do about them.  This is a rather broad topic, so for now we're just going to talk about the LAN and we'll add the rest in later posts.&lt;br /&gt;&lt;br /&gt;Lets start with a home LAN using tcp/ip for communications.  You have multiple computers plugged into an ethernet hub given IP addresses within the 192.168.1.0/24 network.  Computer1 is 192.168.1.2, Computer2 is 192.168.1.3 and Computer3 is 192.168.1.57.&lt;br /&gt;&lt;br /&gt;Each system has a routing table defined (accessible in Linux by running &lt;i&gt;netstat -rn&lt;/i&gt;.  For example:&lt;br /&gt;&lt;pre&gt;Kernel IP routing table&lt;br /&gt;Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface&lt;br /&gt;192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0&lt;br /&gt;0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 eth0&lt;/pre&gt;This routing table says that for a destination of 192.168.1.0 with a netmask of 255.255.255.0 (192.168.1.0-192.168.1.255) use a gateway of 0.0.0.0.  This means that the traffic is local and you send it to the local network.&lt;br /&gt;&lt;br /&gt;For traffic destined to 0.0.0.0 with a netmask of 0.0.0.0 (All other traffic), you send the traffic to 192.168.1.1.  This address is known as a default gateway.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Communication within the LAN&lt;/h3&gt;Lets say that Computer1 has a webserver running on it that Computer2 would like to access.  Computer2 will therefor send a SYN packet to 192.168.1.2 on port 80.  In order to send this packet Computer2 will first look at its local routing tables in order to determine what is the proper method to send traffic to 192.168.1.2.  It will find that both computers are on the same LAN, and will send out an &lt;a href="http://en.wikipedia.org/wiki/Address_Resolution_Protocol"&gt;ARP Request&lt;/a&gt; for the address.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;23:21:04.906254 arp who-has 192.168.1.2 tell 192.168.1.3&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;192.168.1.1 then sees this ARP request since they're connected via that HUB and will respond with its own MAC address.&lt;br /&gt;&lt;br /&gt;23:21:10.952260 arp reply 192.168.1.2 is-at 00:11:22:33:44:55&lt;br /&gt;&lt;br /&gt;192.168.1.2 then stores this IP to MAC address mapping in its local ARP cache for a short time, and is able to use this lookup table to send out Ethernet frames to the appropriate network card.&lt;br /&gt;&lt;br /&gt;Responses from 192.168.1.2 to 192.168.1.3 then go through the same ARP lookup process in the opposite direction.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Communication outside the LAN&lt;/h3&gt;Communication to systems outside of the local LAN work slightly different.  Traffic outside of the network is sent to your default gateway (192.168.1.1) which then had additional routing rules defined for what to do with that traffic.  Sending the traffic to 192.168.1.1 does follow the same ARP based traffic model that machine to machine communication follows.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;The Problems&lt;/h3&gt;There are a few problems that could occur at this point.&lt;br /&gt;&lt;h4&gt;Passive Sniffing&lt;/h4&gt;Since the network was setup with a HUB, all network traffic is broadcast out to all ports.  This means that any system could easily listen to all network traffic by turning its network card into promiscuous mode and using a packet sniffer like wireshark, tcpdump or any other libpcap based software.&lt;br /&gt;&lt;br /&gt;The security of certain protocols depend on packets being sent out with a secret of sorts that no one else should know.  Being able to sniff these secrets means that an attacker can send back a spoofed response which is then believed to be legitimate.&lt;br /&gt;&lt;br /&gt;Two main examples of this come to mind:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;DNS: DNS requests use a combination of a source port and query IDs to validate the response sent back from a DNS server.  If you can listen in on the traffic you can send spoofed responses back to either the client or a recursive server depending on who's traffic you're listening to.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;TCP: TCP itself uses a sequence number in its three step handshake in order to initially setup a connection.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Passive sniffing is one of the easier problems to solve.  Rather than a HUB, use a Switch.  Switches only send broadcast traffic and traffic destined to the appropriate MAC address to a specific port, making passive sniffing much more difficult.  Note that there are still attacks that allow for this type of sniffing either through ARP cache poisoning and CAM table overflows (sending so many MAC addresses that the switch essentially flips into HUB mode).  Switches also provide better performance as an added bonus.&lt;br /&gt;&lt;br /&gt;If you're looking at wireless networks rather than wired you can expect behavior along the lines of a hub if you're running without encryption or if you're using WEP.  Using WPA/WPA2 behaves more like a switch due to the use of per-user keys, although there may be key recovery attacks if you're running in pre-shared key mode.&lt;br /&gt;&lt;h4&gt;Rogue DHCP servers&lt;/h4&gt;There are two main methods for systems to be given their IP address in the first place.  Servers are typically given a static IP address which is manually configured on the system.  User systems on the other hand obtain an IP address and other settings like DNS servers, gateways, etc via the &lt;a href="http://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol"&gt;Dynamic Host Configuration Protocol&lt;/a&gt; or DHCP.&lt;br /&gt;&lt;br /&gt;DHCP works by a new client sending out a DHCP request via UDP broadcast to the local network.  A locally configured DHCP server will see the request and will respond with a DHCP response packet including the necessary networking configuration details.&lt;br /&gt;&lt;br /&gt;Since DHCP packets are broadcast and DHCP isn't authenticated in any way, a rogue DHCP server could be installed on a network which will attempt to answer the DHCP request as well.  Whichever server's packet is received first will be used by the client system.&lt;br /&gt;&lt;br /&gt;The malicious server could provide the client system with a new default gateway, allowing for each man in the middle attacks.  A malicious DNS server in the response can also be sent providing for DNS based attacks (to be covered later).&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;ARP poisoning&lt;/h4&gt;Since ARP traffic is sent via broadcast messages, all machines attached to the hub will see it.  If 192.168.1.57 sees the ARP request, it can try to respond with its own MAC address before the actual machine can.  Alternatively it can attempt to send out an unsolicited response using a technique known as a gratuitous arp.  In the case of traffic to 192.168.1.1 (the default gateway) you can essentially hijack ALL traffic destined to the outside of the network through this technique.&lt;br /&gt;&lt;br /&gt;Fixing ARP poisoning attacks is rather difficult.  Using static arp tables on systems can help quite a bit, but can be a maintenance nightmare.  Port security can help by limiting the number of MAC addresses allowed on a given port.  This more helps against attacks where you try to steal someone else's MAC address rather than trying to steal their IP.  Otherwise using a tool like ARPWatch will allow you to detect these sorts of attacks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2728810436550067529-1328571799785708878?l=fnsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fnsecurity.blogspot.com/feeds/1328571799785708878/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fnsecurity.blogspot.com/2009/12/preventing-man-in-middle-mitm-attacks.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2728810436550067529/posts/default/1328571799785708878'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2728810436550067529/posts/default/1328571799785708878'/><link rel='alternate' type='text/html' href='http://fnsecurity.blogspot.com/2009/12/preventing-man-in-middle-mitm-attacks.html' title='Preventing Man-In-The-Middle (MITM) Attacks'/><author><name>G.D. Fuego</name><uri>http://www.blogger.com/profile/10646006841687422655</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2728810436550067529.post-5271503170281191655</id><published>2009-11-14T15:03:00.000-08:00</published><updated>2009-11-14T16:58:54.978-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='wireless'/><title type='text'>Wireless Security</title><content type='html'>We often get people coming into the ##security chatroom asking questions securing a wireless network and what the various technologies involved actually mean and which ones are worth pursuing.&lt;br /&gt;&lt;br /&gt;Here are the main technologies involved:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;MAC Filtering&lt;/li&gt;&lt;li&gt;SSID hiding&lt;/li&gt;&lt;li&gt;WEP&lt;/li&gt;&lt;li&gt;WPA&lt;/li&gt;&lt;li&gt;WPA2&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;MAC Filtering&lt;/h3&gt;&lt;p&gt;Most wireless access points (WAP) offer the MAC filtering option.  This option allows you to provide the access point with a list of Machine Access Control (MAC) addresses which are the only devices that are allowed to talk on the network. &lt;/p&gt;&lt;p&gt;All network cards including wireless cards are shipped from the vendor with a pre-assigned MAC address.  A MAC address is a 48 bit number typically represented as 12 hex numbers broken into sets of 2.  For example, 11:22:33:44:aa:bb.  The first 6 hex digits represent the vendor, and the vendor is responsible for making sure that the final 6 hex digits are unique enough that the chances of a network seeing two devices with the same MAC address is very very slim.&lt;/p&gt;&lt;p&gt;So this MAC filtering feature is designed to allow you to specify only the network devices you want to be allowed on your network.  Sounds perfect right?  Unfortunately no.  There are two big problems with MAC filtering:&lt;/p&gt;&lt;h4&gt;Network Sniffing&lt;/h4&gt;Wireless networks broadcast over radio waves which any device within a certain area can receive.  If MAC filtering worked perfectly it would only prevent other computers from &lt;span style="font-style: italic;"&gt;talking&lt;/span&gt; on your network.  It would do nothing to prevent someone from &lt;span style="font-style: italic;"&gt;listening&lt;/span&gt; to your network.  Anyone within the area would be able to listen to any unencrypted traffic on your network, snarfing passwords, reading your chats, etc.&lt;br /&gt;&lt;h4&gt;MAC Impersonation&lt;/h4&gt;&lt;p&gt;The bigger problem with MAC filtering is that the MAC address defined on a network device at the factory is more of a suggestion than anything else.  Nothing on the device prevents the MAC address from being changed.  Linux makes it incrediably easy to change your MAC address, and other operating systems likely have methods for changing it as well.&lt;/p&gt;&lt;p&gt;So if you have someone malicious in your neighborhood, all they need to do is passively listen to your network, determine which MAC addresses are allowed to talk, change their MAC address to match that device and then talk away.&lt;/p&gt;&lt;p&gt;At best MAC address filtering will keep out casual internet leeches.  At worst it'll make your network difficult to manage and give you a false sense of security and keep you from implementing something that will actually secure your network.&lt;br /&gt;&lt;/p&gt;&lt;h3&gt;SSID Hiding&lt;/h3&gt;&lt;p&gt;A Service Set Identifier or SSID is the name that you provide your network.  Some people leave it on their vendor default (like linksys) while others try to come up with clever names from their network in order to prevent collisions.  Setting a unique name for your network is a good idea for a number of reasons.  You don't need to worry about accidental naming collisions putting you on the wrong network, and its less likely that you computer will automatically join a potentially hostile network.  There's also an additional reason that we'll get to when we talk about WPA/WPA2.&lt;/p&gt;&lt;p&gt;When wireless access points talk about SSID hiding what they're talking about is the SSID beacon feature of the 802.11 protocol.  In order to join a wireless network, you need to know the network name.  Wireless access points can optionally send out these beacon packets which include the name of the network.  These beacons are what populate the list of available networks that your OS displays to you.&lt;/p&gt;&lt;p&gt;The idea of SSID hiding is that if you don't send out the SSID in the beacons then users will need to already know the name of your network in order to join it.  This effectively turns your SSID into a password or perhaps just a secret handshake.&lt;/p&gt;This falls down however because the beacon packets aren't the only time the SSID is sent in the clear.  They are also sent in probe responses that occur automatically when a legitimate user joins the network.&lt;p&gt;&lt;/p&gt;&lt;p&gt;SSID hiding ends up falling into the same category as MAC filtering.  At best it keeps casual leeches of your network, and at worst it makes managing your network difficult.&lt;/p&gt;&lt;h3&gt;WEP&lt;/h3&gt;&lt;p&gt;Now we get into actual encryption for protecting the network.  Unfortunately its weak crypto.  It uses an older cipher called RC4, and it uses it poorly.  Due to replay attacks, WEP keys can be recovered in 10 minutes or so.&lt;/p&gt;&lt;p&gt;Crunge (a regular in ##security) explained the issue recently on &lt;a href="http://clinicallyawesome.com/post/238170993/wep-weakness-explained"&gt;his blog&lt;/a&gt;.&lt;/p&gt;&lt;h3&gt;WPA&lt;/h3&gt;&lt;p&gt;WPA was a big improvement over WEP.  It still used the RC4 algorithm in order to maintain compatibility with existing hardware, but it used it much better.  WPA uses 48 bit initialization vectors (IVs) rather than the 24 bits used by WEP.  It also used a form of automatic key rotation known as Temporal Key Integrity Protocol or TKIP as well as a message integrity code (MIC) in order to prevent the replay attacks.&lt;/p&gt;&lt;p&gt;WPA also allowed for multiple forms of authentication.   You could have a single password shared among users called a Pre-Shared Key (PSK).  This mode is known as WPA-Personal.  You could also tie into a RADIUS server in order to implement other forms of authentication, including x509 certificate based auth (SSL client certs).  This mode is known as WPA-Enterprise.&lt;/p&gt;&lt;p&gt;WPA Enterprise is much stronger than WPA Personal and is STRONGLY recommended over a pre-shared key for a corporate environment.  For a home environment, pre-shared keys are fine as long as your password is strong and your SSID is unique (I told you I'd bring the SSID back up).&lt;/p&gt;&lt;p&gt;Whenever you have a password involved your network will be vulnerable to brute force attacks.  These are essentially attempts to either run through a dictionary of words to see if any of them are your password, or possibly just randomly try every password of X letters (6, 7, 8?).  If your password is cat then the strength of the actual crypto will not help you.&lt;/p&gt;&lt;p&gt;Trying each and every password takes a while.  Unfortunately WPA Personal is vulnerable to offline cracking attempts.  If an attacker captures the right packet (yes, a single packet) on your network, they can try again and again to guess your password without you ever seeing anything.  To make matters worse, there are Rainbow tables out there which allow someone to take that packet and look up what password was previously used to generate a packet like that one.  Here's where the SSID matters.  The password is combined with the SSID in order to generate this packet.  That means that people need to generate separate rainbow tables for each SSID name.  If your SSID is linksys then getting a rainbow table is easy.  If your SSID is lsdfjklh23ljk123, then it most likely doesn't exist and they will need to use a time consuming technique to break in.&lt;br /&gt;&lt;/p&gt;&lt;p&gt; Recently weaknesses have been found in the TKIP protocol which makes cracking the network even easier.  Due to this, moving to WPA2 is highly recommended.&lt;/p&gt;&lt;h3&gt;WPA2&lt;/h3&gt;&lt;p&gt;WPA2 functions much like WPA except it replaces the RC4 based TKIP with the AES based CCMP.  CCMP is much stronger than TKIP, and is not vulnerable to the recent weaknesses found in it.  Older hardware may not support CCMP properly, but this becomes less of an issue as people replace aging hardware.&lt;/p&gt;&lt;p&gt;It comes in the same personal and enterprise editions, and the same brute force attacks apply to weak passwords.&lt;/p&gt;&lt;p&gt;Most wireless access points can be configured to support both WPA and WPA2 at once in order to support both classes of devices.  One thing to note there is that this configuration will slightly weaken security for your WPA2 devices.  Networks contain both unicast (this packet is for you) and broadcast (this packet is for everyone) traffic.  With WPA/WPA2 networks the user is provided a unqiue encryption key for their unicast traffic and a shared group key (GTK) for the broadcast traffic.  In order to avoid doubling the amount of broadcast traffic both TKIP and CCMP users are provided a TKIP GTK if WPA is enabled on the access point. &lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;h3&gt;Conclusion&lt;/h3&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Use WPA2 if you can, WPA if you have to.  WEP is better than nothing.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Pre-shared keys are fine if you're a home user.  Use Enterprise if you're in a corporate environment and need to protect anything of value.  Or if you're an ambitious home user.&lt;/p&gt;&lt;p&gt;Mac filtering or SSID hiding provide little value and can be a management nightmare for any network with a good number of users.&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2728810436550067529-5271503170281191655?l=fnsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fnsecurity.blogspot.com/feeds/5271503170281191655/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fnsecurity.blogspot.com/2009/11/wireless-security.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2728810436550067529/posts/default/5271503170281191655'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2728810436550067529/posts/default/5271503170281191655'/><link rel='alternate' type='text/html' href='http://fnsecurity.blogspot.com/2009/11/wireless-security.html' title='Wireless Security'/><author><name>G.D. Fuego</name><uri>http://www.blogger.com/profile/10646006841687422655</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2728810436550067529.post-4224481575962311614</id><published>2009-10-14T19:56:00.000-07:00</published><updated>2009-10-14T20:26:00.124-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='pastebin hacking'/><title type='text'>The evils of Pastebin</title><content type='html'>First post! (Thanks electr0n)&lt;br /&gt;&lt;br /&gt;So in case you've been in a cave recently, there was recently some big news regarding a large number of stolen Hotmail passwords being &lt;a href="http://news.cnet.com/8301-17939_109-10367348-2.html"&gt;found on Pastebin&lt;/a&gt;.  This revealed to people that there was a large scale rather successful hack of some sort against a number of webmail services.  If you haven't yet, be sure to change your webmail password just in case.&lt;br /&gt;&lt;br /&gt;This made me wonder what else could be found on pastebin though, so I did some searching.  What I found would probably surprise a lot of people.&lt;br /&gt;&lt;br /&gt;The first thing I stumbled across was &lt;a href="http://www.google.com/search?q=site%3Apastebin.ca+ssn+cvv"&gt;Credit Card numbers, SSNs and other personally identifiable information (PII)&lt;/a&gt;.  It looks like someone has been using pastebin.ca as a dumping ground for carding information.  Same with pastebin.com, and probably a number of other pastebin sites out there.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.google.com/search?q=site%3Apastebin.ca+password+myspace"&gt;Username and password combinations&lt;/a&gt; for Myspace and other sites can be found as well.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.google.com/search?q=site%3Apastebin.ca+%22BEGIN+RSA+PRIVATE+KEY%22"&gt;SSL Private keys&lt;/a&gt; are always fun.  Especially combined with the &lt;a href="http://www.google.com/search?q=site%3Apastebin.ca+%22BEGIN+RSA+PRIVATE+KEY%22+%22BEGIN+CERTIFICATE%22+%22END+CERTIFICATE%22"&gt;public cert&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Heck, just look around at Johnny Long's &lt;a href="http://johnny.ihackstuff.com/ghdb/"&gt;Google Hacking Database&lt;/a&gt;, and apply what you find to a pastebin site.  You're bound to find something interesting.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2728810436550067529-4224481575962311614?l=fnsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fnsecurity.blogspot.com/feeds/4224481575962311614/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fnsecurity.blogspot.com/2009/10/evils-of-pastebin.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2728810436550067529/posts/default/4224481575962311614'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2728810436550067529/posts/default/4224481575962311614'/><link rel='alternate' type='text/html' href='http://fnsecurity.blogspot.com/2009/10/evils-of-pastebin.html' title='The evils of Pastebin'/><author><name>G.D. Fuego</name><uri>http://www.blogger.com/profile/10646006841687422655</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
