<?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-297187840164530151</id><updated>2012-01-29T18:07:20.152-05:00</updated><category term='novasec'/><category term='sguil'/><category term='technology'/><category term='obfuscation'/><category term='tcpdump'/><category term='javascript'/><category term='inline'/><category term='documentation'/><category term='perl'/><category term='blackhat'/><category term='malware'/><category term='community'/><category term='passive'/><category term='risk'/><category term='osx'/><category term='vulnerabilities'/><category term='rhel'/><category term='session data'/><category term='encryption'/><category term='bad hack'/><category term='bridging'/><category term='ldap'/><category term='analysis'/><category term='tuning'/><category term='freebsd'/><category term='bleeding rules'/><category term='training'/><category term='scripts'/><category term='snort'/><category term='reporting'/><category term='linux'/><category term='reading'/><category term='visualization'/><category term='incident response'/><category term='mysql'/><category term='kubuntu'/><category term='vmware'/><category term='afterglow'/><category term='cloud'/><category term='forensics'/><category term='openpacket'/><category term='MMAP'/><category term='slackware'/><category term='nsm'/><category term='exploits'/><category term='dns'/><category term='wireless'/><category term='sancp'/><category term='snort_inline'/><category term='ids'/><category term='libpcap'/><category term='shmoocon'/><category term='ubuntu'/><category term='defcon'/><category term='system administration'/><title type='text'>Eating Security</title><subtitle type='html'>Small servings of digital security, incident response, NSM, and system administration.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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>82</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-297187840164530151.post-7782032445449899732</id><published>2012-01-04T10:45:00.001-05:00</published><updated>2012-01-04T10:45:50.413-05:00</updated><title type='text'>Flocon 2012</title><content type='html'>&lt;a href="http://www.cert.org/flocon/" target="_blank"&gt;Flocon 2012&lt;/a&gt; is January 9-12, which is next week. It's fairly late, but I believe registration is still open. The &lt;a href="http://www.cert.org/flocon/schedule/all.html" target="_blank"&gt;schedule&lt;/a&gt; includes speakers from many organizations and looks quite interesting. I will be attending and am looking forward to it. &lt;br /&gt;&lt;br /&gt;Happy New Year!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-7782032445449899732?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/7782032445449899732/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2012/01/flocon-2012.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/7782032445449899732'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/7782032445449899732'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2012/01/flocon-2012.html' title='Flocon 2012'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-4575426199298047719</id><published>2011-09-14T18:32:00.003-04:00</published><updated>2011-09-17T20:21:19.872-04:00</updated><title type='text'>Recent Advances in Intrusion Detection 2011</title><content type='html'>&lt;br /&gt;For anyone still following despite my infrequent posting, I will be going to the &lt;a href="http://www.raid2011.org/"&gt;International Symposium on Recent Advances in Intrusion Detection&lt;/a&gt; next week. I haven't made time to attend a conference in quite a while, so I'm looking forward to it.&lt;br /&gt;&lt;br /&gt;If anyone that knows me is attending and interested in getting together, let me know. If you know me either online or in meatspace, hopefully that means you know how to reach me.&lt;br /&gt;&lt;br /&gt;This post doubled my number of blog posts to date for 2011. The most likely next post will be covering anything interesting from the conference. Beyond that, I don't anticipate much posting activity in the near future for a number of reasons.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-4575426199298047719?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/4575426199298047719/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2011/09/recent-advances-in-intrusion-detection.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/4575426199298047719'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/4575426199298047719'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2011/09/recent-advances-in-intrusion-detection.html' title='Recent Advances in Intrusion Detection 2011'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-4893446618169485850</id><published>2011-02-28T21:01:00.006-05:00</published><updated>2011-03-05T11:44:09.734-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='visualization'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='wireless'/><category scheme='http://www.blogger.com/atom/ns#' term='tcpdump'/><title type='text'>Using ettercap for ARP poisoning</title><content type='html'>&lt;a href="http://ettercap.sourceforge.net/"&gt;Ettercap&lt;/a&gt; is certainly nothing new, and there is plenty of documentation around to see how to use it, but I was sitting here goofing around and decided to record my results. I am not advocating this type of thing on a public network, and ARP poisoning or other attacks often fall afoul of terms of service for public and private networks, and may even be illegal in some jurisdictions.&lt;br /&gt;&lt;br /&gt;First, I looked at my default route.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;$ route -n&lt;br /&gt;Kernel IP routing table&lt;br /&gt;Destination&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Gateway&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Genmask&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Flags Metric Ref&amp;nbsp;&amp;nbsp;&amp;nbsp; Use Iface&lt;br /&gt;10.71.0.0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.0.0.0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 255.255.255.0&amp;nbsp;&amp;nbsp; U&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 wlan0&lt;br /&gt;0.0.0.0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10.71.0.1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.0.0.0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UG&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 wlan0&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: inherit;"&gt;To sniff the whole subnet, I'll want to do some ARP poisoning to send all traffic to/from the default route through my system.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;$ sudo ettercap -i wlan0 -T -M arp:remote /10.71.0.1/ //&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You can also use "// //" to designate ARP poisoning no matter what source and destination ettercap sees. The "-T" tells ettercap to use the text interface, which is still interactive. There is also a curses-based interface, "-C", and GTK with "-G" though it has always seemed less reliable to me than the others. The curses interface is actually pretty nice.&lt;br /&gt;&lt;br /&gt;Once you run the command, ettercap should enumerate hosts and you will start seeing a bunch of traffic information scrolling through your console. How do we know if it's actually working? If you see non-broadcast traffic destined for other hosts, it will be obvious and you will know you're successfully sniffing all the traffic.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/-QeGCwWwD2ho/TWQ7e8ZluFI/AAAAAAAAAH8/ZsdsmG5Uusc/s1600/etherape-ettercap-scaled.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="193" src="http://1.bp.blogspot.com/-QeGCwWwD2ho/TWQ7e8ZluFI/AAAAAAAAAH8/ZsdsmG5Uusc/s320/etherape-ettercap-scaled.png" width="320" /&gt;&lt;/a&gt;Another fun way is by opening etherape to see a realtime visualization of the traffic. If you are seeing typical non-broadcast traffic like HTTP, HTTPS, that's an indicator that you're successfully ARP poisoning. You can also get a quick idea if there are particular hosts getting a lot of traffic activity. I've seen the typical sites like Facebook, Amazon, Akamai, and LLNW, but also more interesting sites that are easily identifiable as VPN concentrators, banks, and more.&lt;br /&gt;&lt;br /&gt;You can also of course use various tools including ettercap with the "-w" option to write traffic to a file and review at my leisure to look for interesting data. Ettercap also has an interesting utility to automatically grab usernames and passwords. From the man page:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -L, --log &lt;logfile&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Log&amp;nbsp; all&amp;nbsp; the packets to binary files. These files can be parsed&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by etterlog(8) to extract human readable data. With this option,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; all&amp;nbsp; packets&amp;nbsp; sniffed&amp;nbsp; by ettercap will be logged, together with&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; all the passive info (host info + user &amp;amp; pass) it&amp;nbsp; can&amp;nbsp; collect.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Given&amp;nbsp; a LOGFILE, ettercap will create LOGFILE.ecp (for packets)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and LOGFILE.eci (for the infos).&lt;/logfile&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you didn't run this with ettercap originally, you can also run it on a saved packet capture.&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;$ ettercap -r hotel.raw -L hotel&lt;br /&gt;&lt;br /&gt;ettercap NG-0.7.3 copyright 2001-2004 ALoR &amp;amp; NaGA&lt;br /&gt;&lt;br /&gt;Please select an User Interface&lt;br /&gt;&lt;br /&gt;$ ls hotel*&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;hotel.eci&amp;nbsp; hotel.ecp&amp;nbsp; hotel.raw&lt;br /&gt;&lt;br /&gt;$ etterlog -a hotel.eci &lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;br /&gt;etterlog NG-0.7.3 copyright 2001-2004 ALoR &amp;amp; NaGA&lt;br /&gt;&lt;br /&gt;Log file version&amp;nbsp;&amp;nbsp;&amp;nbsp; : NG-0.7.3&lt;br /&gt;Timestamp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : Wed Feb 16 14:20:57 2010&lt;br /&gt;Type&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : LOG_INFO&lt;br /&gt;&lt;br /&gt;Number of hosts (total)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 248&lt;br /&gt;&lt;br /&gt;Number of local hosts&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 30&lt;br /&gt;Number of non local hosts&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 0&lt;br /&gt;Number of gateway&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 0&lt;br /&gt;&lt;br /&gt;Number of discovered services : 240&lt;br /&gt;Number of accounts captured&amp;nbsp;&amp;nbsp; : 4&lt;/div&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;$ etterlog -p hotel.eci&lt;br /&gt;&lt;br /&gt;74.125.93.191 &amp;nbsp; TCP 80&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; USER: fakeuser &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PASS: fakepasswd&lt;/div&gt;&lt;br /&gt;I changed the data above and of course most sites these days are hopefully forcing encrypted logins.&lt;br /&gt;&lt;br /&gt;These days, many sites can be hosted on one IP or virtual server. If you're not catching the DNS or HTTP request specifically before the login that was captured, the easiest way to determine which site on a specific IP was being visited would be opening up the packet capture with a tool like Wireshark, using a filter for the IP, then looking at the actual web traffic for the site's name. Looking in Wireshark, I can see the GET immediately after the TCP handshake.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;GET /members/bbs/showthread.php HTTP/1.1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Host: www.fakedomain.com&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: inherit;"&gt;This really just scratches the surface of what you can do with ettercap and other network tools. ARP poisoning still works, particularly on public networks, and many people log in to many services that can be easily compromised through sniffing (I write while sitting in an airport on public WiFi logged into my blogger account).&lt;/span&gt; A relatively recent high profile example was when the Metasploit site was &lt;a href="http://www.zdnet.com/blog/security/metasploit-projects-site-hijacked-through-arp-poisoning/1242"&gt;briefly hijacked&lt;/a&gt; by successful ARP poisoning.&lt;br /&gt;&lt;br /&gt;There are numerous other attacks besides sniffing that could succeed when ARP poisoning, many involving redirecting traffic or injecting malicious content. For instance, you can use something like &lt;a href="http://www.thoughtcrime.org/software/sslstrip/"&gt;sslstrip&lt;/a&gt; to redirect all HTTPS traffic to HTTP, grabbing credentials in the process. You could also inject content directly using etterfilter.&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;DESCRIPTION&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The etterfilter utility is used to compile&amp;nbsp; source&amp;nbsp; filter&amp;nbsp; files&amp;nbsp; into&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; binary&amp;nbsp; filter&amp;nbsp; files that can be interpreted by the JIT interpreter in&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; the ettercap(8) filter engine. You have to compile your filter&amp;nbsp; scripts&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; in&amp;nbsp; order&amp;nbsp; to&amp;nbsp; use&amp;nbsp; them&amp;nbsp; in&amp;nbsp; ettercap. All syntax/parse errors will be&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; checked at compile time, so you will&amp;nbsp; be&amp;nbsp; sure&amp;nbsp; to&amp;nbsp; produce&amp;nbsp; a&amp;nbsp; correct&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; binary filter for ettercap.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://lh6.googleusercontent.com/-rGb2zngR_-A/TWxLl0ICbsI/AAAAAAAAAIA/oYrPaG0oN4g/s1600/pwned.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;/a&gt;&lt;a href="https://lh6.googleusercontent.com/-rGb2zngR_-A/TWxLl0ICbsI/AAAAAAAAAIA/oYrPaG0oN4g/s1600/pwned.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://lh6.googleusercontent.com/-rGb2zngR_-A/TWxLl0ICbsI/AAAAAAAAAIA/oYrPaG0oN4g/s1600/pwned.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;Using etterfilter you can inject new packets, replace data in packets, and more. If someone is visiting what they consider a known safe site, replacing data or injecting malicious packets can be quite successful. At a previous job, we had a non-production network for attack and defend fun, and with etterfilter I was able to &lt;a href="http://www.irongeek.com/i.php?page=security/ettercapfilter"&gt;replace all image requests&lt;/a&gt; by one of my colleagues' browser and instead have it request the image to the left.&lt;br /&gt;&lt;br /&gt;Although my example above is obviously on a wireless network as shown by using the wlan0 interface, you can easily perform ARP poisoning on a local wired segment. There are also a number of ways to help detect or prevent poisoning with your network appliances or software.&lt;br /&gt;&lt;br /&gt;Finally, ettercap also has a number of interesting plugins available.&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;$ ettercap -P list&lt;br /&gt;&lt;br /&gt;ettercap NG-0.7.3 copyright 2001-2004 ALoR &amp;amp; NaGA&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Available plugins :&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arp_cop&amp;nbsp; 1.1&amp;nbsp; Report suspicious ARP activity&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; autoadd&amp;nbsp; 1.2&amp;nbsp; Automatically add new victims in the target range&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; chk_poison&amp;nbsp; 1.1&amp;nbsp; Check if the poisoning had success&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dns_spoof&amp;nbsp; 1.1&amp;nbsp; Sends spoofed dns replies&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dos_attack&amp;nbsp; 1.0&amp;nbsp; Run a d.o.s. attack against an IP address&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dummy&amp;nbsp; 3.0&amp;nbsp; A plugin template (for developers)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; find_conn&amp;nbsp; 1.0&amp;nbsp; Search connections on a switched LAN&lt;br /&gt;&amp;nbsp;&amp;nbsp; find_ettercap&amp;nbsp; 2.0&amp;nbsp; Try to find ettercap activity&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; find_ip&amp;nbsp; 1.0&amp;nbsp; Search an unused IP address in the subnet&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; finger&amp;nbsp; 1.6&amp;nbsp; Fingerprint a remote host&lt;br /&gt;&amp;nbsp;&amp;nbsp; finger_submit&amp;nbsp; 1.0&amp;nbsp; Submit a fingerprint to ettercap's website&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gre_relay&amp;nbsp; 1.0&amp;nbsp; Tunnel broker for redirected GRE tunnels&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gw_discover&amp;nbsp; 1.0&amp;nbsp; Try to find the LAN gateway&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; isolate&amp;nbsp; 1.0&amp;nbsp; Isolate an host from the lan&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; link_type&amp;nbsp; 1.0&amp;nbsp; Check the link type (hub/switch)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pptp_chapms1&amp;nbsp; 1.0&amp;nbsp; PPTP: Forces chapms-v1 from chapms-v2&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pptp_clear&amp;nbsp; 1.0&amp;nbsp; PPTP: Tries to force cleartext tunnel&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pptp_pap&amp;nbsp; 1.0&amp;nbsp; PPTP: Forces PAP authentication&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pptp_reneg&amp;nbsp; 1.0&amp;nbsp; PPTP: Forces tunnel re-negotiation&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rand_flood&amp;nbsp; 1.0&amp;nbsp; Flood the LAN with random MAC addresses&lt;br /&gt;&amp;nbsp; remote_browser&amp;nbsp; 1.2&amp;nbsp; Sends visited URLs to the browser&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; reply_arp&amp;nbsp; 1.0&amp;nbsp; Simple arp responder&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; repoison_arp&amp;nbsp; 1.0&amp;nbsp; Repoison after broadcast ARP&lt;br /&gt;&amp;nbsp;&amp;nbsp; scan_poisoner&amp;nbsp; 1.0&amp;nbsp; Actively search other poisoners&lt;br /&gt;&amp;nbsp; search_promisc&amp;nbsp; 1.2&amp;nbsp; Search promisc NICs in the LAN&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; smb_clear&amp;nbsp; 1.0&amp;nbsp; Tries to force SMB cleartext auth&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; smb_down&amp;nbsp; 1.0&amp;nbsp; Tries to force SMB to not use NTLM2 key auth&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stp_mangler&amp;nbsp; 1.0&amp;nbsp; Become root of a switches spanning tree&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-4893446618169485850?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/4893446618169485850/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2011/02/using-ettercap-for-arp-poisoning.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/4893446618169485850'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/4893446618169485850'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2011/02/using-ettercap-for-arp-poisoning.html' title='Using ettercap for ARP poisoning'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-QeGCwWwD2ho/TWQ7e8ZluFI/AAAAAAAAAH8/ZsdsmG5Uusc/s72-c/etherape-ettercap-scaled.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297187840164530151.post-5968311082623890349</id><published>2010-12-02T21:30:00.000-05:00</published><updated>2010-12-02T21:30:08.259-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='system administration'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='slackware'/><title type='text'>Using slackbuilds.org to create Slackware packages</title><content type='html'>Sorry for the long posting hiatus but don't expect it to end. I just don't have a lot of time or material to devote to the blog right now.&lt;br /&gt;&lt;br /&gt;I recently wanted to upgrade Postfix on my Slackware mail server. I used to use packages from LinuxPackages.net for unofficial packages, but the site has gotten less active and always had a reputation for varying package quality. My preference is using the &lt;a href="http://slackbuilds.org/"&gt;SlackBuilds&lt;/a&gt; to build my own packages. It's fairly simple to download their build script, edit as needed, then build a Slackware package from source.&lt;br /&gt;&lt;br /&gt;Since Postfix is not available from Slackware official repositories, I downloaded the &lt;a href="http://slackbuilds.org/repository/13.1/network/postfix/"&gt;SlackBuild files&lt;/a&gt; and then the Postfix source.&lt;br /&gt;&lt;pre&gt;$ wget http://postfix.cs.utah.edu/source/official/postfix-2.6.8.tar.gz &lt;br /&gt;$ wget http://slackbuilds.org/slackbuilds/13.1/network/postfix.tar.gz&lt;br /&gt;$ tar xvzf postfix.tar.gz&lt;br /&gt;$ ls postfix/&lt;br /&gt;README     postfix-2.6.8.tar.gz  postfix.info  slack-desc&lt;br /&gt;doinst.sh  postfix.SlackBuild*   rc.postfix&lt;/pre&gt;I am using Cyrus-SASL, so it was important for me to note the following from the SlackBuild Postfix page.&lt;br /&gt;&lt;blockquote&gt;This script builds postfix with support for Dovecot SASL but does not&lt;br /&gt;include any support for Cyrus-SASL. If you need to enable support for&lt;br /&gt;Cyrus see SASL_README in the source code.&lt;/blockquote&gt;I also noted the following from the postfix.SlackBuild file itself.&lt;br /&gt;&lt;pre&gt;# Postfix unfortunately does not use a handy ./configure script so you&lt;br /&gt;# must generate the makefiles using (what else?) "make makefiles". The&lt;br /&gt;# following includes support for TLS and SASL. It should automatically&lt;br /&gt;# find PCRE and DB3 support. The docs have information for adding&lt;br /&gt;# additional support such as MySQL or LDAP.&lt;/pre&gt;I changed the "make makefile" lines from:&lt;br /&gt;&lt;pre&gt;make makefiles \&lt;br /&gt;  CCARGS='-DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\"dovecot\" -DUSE_TLS' \&lt;br /&gt;  AUXLIBS="-lssl -lcrypto"&lt;/pre&gt;to:&lt;br /&gt;&lt;pre&gt;make makefiles CCARGS="-DUSE_SASL_AUTH -DUSE_CYRUS_SASL -DHAS_PCRE \&lt;br /&gt;                 -I/usr/local/include/sasl -I/usr/include" \&lt;br /&gt;                 AUXLIBS="-L/usr/local/lib -lsasl2 -L/usr/lib -lpcre"&lt;/pre&gt;This added Cyrus-SASL support and also fixed a problem I was having with it finding PCRE. I also changed the VERSION variable to 2.6.8 since the postfix.SlackBuild file was for 2.6.1. After the changes, all I have to do is run the postfix.SlackBuild file then use "upgradepkg" on the resulting postfix-2.6.8-iX86-1_SBo.tgz package. (Note that official packages use xz for compression now, not gzip, so they will have the extension txz).&lt;br /&gt;&lt;br /&gt;The next package I will create using SlackBuilds is cyrus-imapd since it also is not included in Slackware. Cyrus-SASL actually has an official package, but I I've been running Cyrus for so long that I have always installed it from source. I don't remember if that is because it wasn't available as a package back in the day or just because I was using some non-standard options.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-5968311082623890349?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/5968311082623890349/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2010/12/using-slackbuildsorg-to-create.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/5968311082623890349'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/5968311082623890349'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2010/12/using-slackbuildsorg-to-create.html' title='Using slackbuilds.org to create Slackware packages'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-777408021934493591</id><published>2010-03-14T14:37:00.006-04:00</published><updated>2010-06-12T18:27:20.521-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='system administration'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='slackware'/><title type='text'>March Slackware-current: libblkid.so.1</title><content type='html'>&amp;nbsp;The Slackware-current updates from March 1, 2010, included updates to both the e2fsprogs package and the util-linux-ng package. An important thing to note is that libblkid was moved out of e2fsprogs and into util-linux-ng. If you search the web for libblkid.so.1, slackpkg, util-linux-ng, and e2fsprogs, you will see various forum posts about not being able to boot. This is because libblkid.so.1 is required to mount and the updates included a new kernel, which meant a lot of people updated then rebooted without having util-linux-ng installed.&amp;nbsp; Booting without the library will get you error messages about libblkid.so.1 not being found when the system tries to mount the drives.&lt;br /&gt;&lt;pre&gt;$ man libblkid&lt;br /&gt;LIBBLKID(3)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LIBBLKID(3)&lt;br /&gt;&lt;br /&gt;NAME&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; libblkid - block device identification library&lt;br /&gt;&lt;br /&gt;SYNOPSIS&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #include &lt;blkid blkid.h=""&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cc file.c -lblkid&lt;br /&gt;&lt;br /&gt;DESCRIPTION&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The&amp;nbsp; libblkid&amp;nbsp; library&amp;nbsp; is used to identify block devices (disks) as to&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; their content (e.g.&amp;nbsp; filesystem type) as well as extracting&amp;nbsp; additional&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; information&amp;nbsp; such&amp;nbsp; as&amp;nbsp; filesystem&amp;nbsp; labels/volume&amp;nbsp; names, unique identi-&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fiers/serial numbers, etc.&lt;/blkid&gt;&amp;nbsp;&lt;/pre&gt;If you don't already have util-linux-ng installed then make sure to install it before rebooting since the update to e2fsprogs will remove libblkid.&lt;br /&gt;&lt;pre&gt;$ sudo slackpkg update&lt;br /&gt;---snip---&lt;br /&gt;$ sudo slackpkg install util-linux-ng&lt;br /&gt;---snip---&lt;br /&gt;$ sudo slackpkg install-new&lt;br /&gt;---snip---&lt;br /&gt;$ sudo slackpkg upgrade-all&lt;/pre&gt;If you get stuck because you ran upgrade-all, don't have util-linux-ng installed, then rebooted for the kernel update, you can boot to the Slackware install CD or DVD so you can install the old version of e2fsprogs or the new util-linux-ng. This will allow you to boot normally then fix whatever is needed, such as installing the new util-linux-ng and/or upgrading e2fsprogs.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-777408021934493591?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/777408021934493591'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/777408021934493591'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2010/03/march-slackware-current-updates.html' title='March Slackware-current: libblkid.so.1'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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></entry><entry><id>tag:blogger.com,1999:blog-297187840164530151.post-6452062182506316550</id><published>2010-03-13T15:11:00.004-05:00</published><updated>2010-03-14T14:44:20.283-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='system administration'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='slackware'/><category scheme='http://www.blogger.com/atom/ns#' term='sguil'/><title type='text'>Customizing Slackware Tcl Package for Sguil</title><content type='html'>Most distributions these days are configuring their Tcl packages with &lt;tt&gt;--enable-threads&lt;/tt&gt; as a default. Slackware-current switched some months back with the following in the ChangeLog.txt.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;+--------------------------+&lt;br /&gt;Mon Dec  7 02:13:13 UTC 2009&lt;br /&gt;d/ruby-1.9.1_p243-i486-3.txz:  Rebuilt.&lt;br /&gt;  Added an explicit --enable-pthread.  This is mostly to make sure that we get&lt;br /&gt;  the expected option set from future releases of Ruby -- it appears that not&lt;br /&gt;  only is --enable-pthread the default in ruby-1.9.1, but trying to use&lt;br /&gt;  --disable-pthread doesn't work.  Furthermore, Ruby and Tcl/Tk no longer work&lt;br /&gt;  together unless both Ruby and Tcl/Tk are compiled with thread support.&lt;br /&gt;  Compiling Tcl/Tk with thread support has caused some problems in the past.&lt;br /&gt;  If a threaded Tcl app tries to fork(), it will hang, but by now most affected&lt;br /&gt;  Tcl apps (such as eggdrop) should have patches available.&lt;br /&gt;  Anyway, this should fix the issues with Ruby and Tk.  Please test it, and&lt;br /&gt;  report any other problems that arise.&lt;br /&gt;tcl/tcl-8.5.8-i486-1.txz:  Upgraded.&lt;br /&gt;  Compiled using --enable-threads, since Ruby requires it to work with Tk.&lt;br /&gt;tcl/tclx-8.4-i486-3.txz:  Rebuilt.&lt;br /&gt;  Recompiled using --enable-threads.&lt;br /&gt;tcl/tix-8.4.3-i486-2.txz:  Rebuilt.&lt;br /&gt;  Recompiled using --enable-threads.&lt;br /&gt;tcl/tk-8.5.8-i486-1.txz:  Upgraded.&lt;br /&gt;  Compiled using --enable-threads, since Ruby requires it to work with Tk.&lt;/pre&gt;&lt;pre&gt;+--------------------------+ &lt;/pre&gt;The Sguil daemon &lt;a href="http://nsmwiki.org/Sguil_FAQ#Sguild_complains_about_threading_issues.2C_then_dies" target="_blank"&gt;will not work with threaded Tcl&lt;/a&gt;, so to fix this you need to build a package for the distribution of your choice with the &lt;tt&gt;--disable-threads&lt;/tt&gt; configure option. In Slackware and most other distributions, it is fairly simple to customize a package.&lt;br /&gt;&lt;br /&gt;Download Tcl from the &lt;a href="ftp://ftp.slackware.com/pub/slackware/slackware-current/source/tcl/tcl/" target="_blank"&gt;source directory&lt;/a&gt; on the Slackware mirror of your choice. It should include a slack-desc file, a tcl.SlackBuild file, and the Tcl source. Modify the tcl.SlackBuild file to replace &lt;tt&gt;--enable-threads&lt;/tt&gt; with &lt;tt&gt;--disable-threads&lt;/tt&gt;.&lt;br /&gt;&lt;pre&gt;./configure \&lt;br /&gt;&amp;nbsp; --prefix=/usr \&lt;br /&gt;&amp;nbsp; --libdir=/usr/lib${LIBDIRSUFFIX} \&lt;br /&gt;&amp;nbsp; --enable-shared \&lt;br /&gt;&amp;nbsp; --disable-threads \&lt;br /&gt;&amp;nbsp; --enable-man-symlinks \&lt;br /&gt;&amp;nbsp; --enable-man-compression=gzip \&lt;br /&gt;&amp;nbsp; ${CONFARGS} \&lt;br /&gt;&amp;nbsp; --build=$ARCH-slackware-linux&lt;/pre&gt;You may also want to modify the slack-desc to note that this is a non-threaded version. Then build the new package.&lt;br /&gt;&lt;pre&gt;$ sh tcl.SlackBuild&lt;br /&gt;---snip--- &lt;br /&gt;Slackware package /tmp/tcl-8.5.8-i486-1.txz created.&lt;/pre&gt;As you see, the package will get written to /tmp by default. Now replace the threaded version with the new non-threaded version.&lt;br /&gt;&lt;pre&gt;$ sudo upgradepkg --reinstall /tmp/tcl-8.5.8-i486-1.txz&lt;br /&gt;+==============================================================================&lt;br /&gt;| Upgrading tcl-8.5.8-i486-1 package using /tmp/tcl-8.5.8-i486-1.txz&lt;br /&gt;+==============================================================================&lt;br /&gt;&lt;br /&gt;Pre-installing package tcl-8.5.8-i486-1...&lt;br /&gt;&lt;br /&gt;Removing package /var/log/packages/tcl-8.5.8-i486-1-upgraded-2010-03-13,20:03:22...&lt;br /&gt;&lt;br /&gt;Verifying package tcl-8.5.8-i486-1.txz.&lt;br /&gt;Installing package tcl-8.5.8-i486-1.txz:&lt;br /&gt;PACKAGE DESCRIPTION:&lt;br /&gt;# tcl (Tool Command Language)&lt;br /&gt;#&lt;br /&gt;# Tcl, developed by Dr. John Ousterhout, is a simple to use text-based&lt;br /&gt;# script language with many built-in features which make it especially&lt;br /&gt;# nice for writing interactive scripts.&lt;br /&gt;#&lt;br /&gt;# This is a version customized by nr that uses --disable-threads.&lt;br /&gt;#&lt;br /&gt;Executing install script for tcl-8.5.8-i486-1.txz.&lt;br /&gt;Package tcl-8.5.8-i486-1.txz installed.&lt;br /&gt;&lt;br /&gt;Package tcl-8.5.8-i486-1 upgraded with new package /tmp/tcl-8.5.8-i486-1.txz.&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-6452062182506316550?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/6452062182506316550/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2010/03/customizing-slackware-tcl-package-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/6452062182506316550'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/6452062182506316550'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2010/03/customizing-slackware-tcl-package-for.html' title='Customizing Slackware Tcl Package for Sguil'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-8001426212356404484</id><published>2010-01-01T14:15:00.002-05:00</published><updated>2010-01-01T14:59:21.604-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='reading'/><title type='text'>Security News and Reporting Gets a New Blog</title><content type='html'>Brian Krebs announced on 24 December that his last day at&amp;nbsp;&lt;a href="http://voices.washingtonpost.com/securityfix/2009/12/farewell_2009_and_the_washingt.html" target="_blank"&gt; The Washington Post Company would be 31 December&lt;/a&gt;. Krebs will continue to blog at &lt;a href="http://www.krebsonsecurity.com/" target="_blank"&gt;Krebs on Security&lt;/a&gt;. He has a good history of security reporting, and generally concentrates on investigative reporting and analysis.&lt;br /&gt;&lt;br /&gt;He notes:&lt;br /&gt;&lt;blockquote&gt;With a few exceptions, I will continue to eschew chasing the security story-of-the day, as there are plenty of sites you can go for that. My focus will remain on publishing information and reporting that you won’t find anywhere else – and with a minimum of editorializing.&lt;br /&gt;&lt;/blockquote&gt;I see this as a good description of his work and his first story, &lt;a href="http://www.krebsonsecurity.com/2009/12/virus-scanners-for-virus-authors/" target="_blank"&gt;Virus Scanners for Virus Authors&lt;/a&gt;, is a good example of the type of reporting he has handled over recent years.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-8001426212356404484?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/8001426212356404484/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2010/01/security-news-and-reporting-gets-new.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/8001426212356404484'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/8001426212356404484'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2010/01/security-news-and-reporting-gets-new.html' title='Security News and Reporting Gets a New Blog'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-3629858719672821383</id><published>2009-11-19T06:18:00.013-05:00</published><updated>2009-11-19T14:19:29.875-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vulnerabilities'/><category scheme='http://www.blogger.com/atom/ns#' term='risk'/><title type='text'>SNAFU: Peer-to-peer and Sensitive Information</title><content type='html'>A lot of people noticed the recent &lt;a href="http://www.washingtonpost.com/wp-dyn/content/article/2009/10/30/AR2009103001959_pf.html" target="_blank"&gt;Congressional ethics probe&lt;/a&gt; that was disclosed because a junior staff member put a sensitive document on her computer at home. Not surprisingly, her computer also had file-sharing software installed and she inadvertently was sharing the document on a peer-to-peer network. Some are calling for &lt;a href="http://www.washingtonpost.com/wp-dyn/content/article/2009/10/30/AR2009103003749_pf.html" target="_blank"&gt;a review of congressional cybersecurity policies&lt;/a&gt; after the breach. One thing to remember is that this sort of thing is not unique, new or surprising.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blog.vorant.com/" target="_blank"&gt;David Bianco&lt;/a&gt; &lt;a href="http://blog.vorant.com/2006/06/laptop-encryption-i-have-better-idea.html" target="_blank"&gt;wrote about a similar topic in 2006&lt;/a&gt; and covers the important points, though I would add that the problem also extends to personal systems, not just mobile devices. Whether the vulnerability is a mobile device that is easily lost or stolen (laptop, smart-phone, music player, etc), or a personal system running software that would never be allowed in a work environment, don't put sensitive information on systems that are difficult to control.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-3629858719672821383?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/3629858719672821383/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2009/11/snafu-peer-to-peer-and-sensitive.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/3629858719672821383'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/3629858719672821383'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2009/11/snafu-peer-to-peer-and-sensitive.html' title='SNAFU: Peer-to-peer and Sensitive Information'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-1485012224088058644</id><published>2009-11-17T08:12:00.003-05:00</published><updated>2009-12-13T15:31:15.929-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='community'/><category scheme='http://www.blogger.com/atom/ns#' term='training'/><title type='text'>SANS WhatWorks in Incident Detection Summit 2009</title><content type='html'>I am scheduled to be a part of several discussion panels at the &lt;a href="http://www.sans.org/incident-detection-summit-2009/" target="_blank"&gt;SANS WhatWorks in Incident Detection Summit 2009&lt;/a&gt; on 9-10 December. There are a lot of good speakers participating and the &lt;a href="http://www.sans.org/incident-detection-summit-2009/agenda.php" target="_blank"&gt;agenda will cover many topics related to incident detection&lt;/a&gt;. I believe there is still space available for anyone that is interested in attending.&lt;br /&gt;&lt;br /&gt;From SANS: &lt;br /&gt;&lt;blockquote&gt;Following the success of the 2008 and 2009 editions of the SANS WhatWorks in Forensics and Incident Response Summits, SANS is teaming with &lt;a href="http://taosecurity.blogspot.com/" target="_blank"&gt;Richard Bejtlich&lt;/a&gt; to create a practioner-focused event dedicated to incident detection operations. The SANS Incident Detection Summit will share tools, tactics, and techniques practiced by more than 40 of the world's greatest incident detectors in two full days of content consisting of keynotes, expert briefings, and dynamic panels.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.sans.org/incident-detection-summit-2009/" target="_blank"&gt;http://www.sans.org/incident-detection-summit-2009/&lt;/a&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-1485012224088058644?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/1485012224088058644/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2009/11/sans-whatworks-in-incident-detection.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/1485012224088058644'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/1485012224088058644'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2009/11/sans-whatworks-in-incident-detection.html' title='SANS WhatWorks in Incident Detection Summit 2009'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-3886546325628606526</id><published>2009-10-19T22:23:00.007-04:00</published><updated>2009-10-21T09:11:54.492-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='osx'/><title type='text'>Hackintosh Dell Mini 9</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_-apeuUdIHjI/St0k_zD4cNI/AAAAAAAAAHk/4Um0OFU_v50/s1600-h/hackintosh9.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_-apeuUdIHjI/St0k_zD4cNI/AAAAAAAAAHk/4Um0OFU_v50/s400/hackintosh9.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;I have been playing with a Dell Mini 9 running Mac OS 10.5.8 for the past couple days. It's pretty nice for a tiny laptop. There are a few guides on the Internet showing how to set it up, including one on &lt;a href="http://www.mydellmini.com/forum/mac-os-x-guides/3743-how-install-mac-os-x-dellefi-method.html" target="_blank"&gt;mydellmini.com&lt;/a&gt; and another on &lt;a href="http://gizmodo.com/5156903/how-to-hackintosh-a-dell-mini-9-into-the-ultimate-os-x-netbook" target="_blank"&gt;Gizmodo&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;If you want a small laptop running Mac OSX, this is a pretty cool. The Dell outlet sometimes still has these laptops, but remember to factor in that they are old and need a larger SSD. Also take into account that installing even a retail copy of OSX on non-Apple hardware may violate their EULA.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&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/297187840164530151-3886546325628606526?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/3886546325628606526/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2009/10/hackintosh-dell-mini-9.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/3886546325628606526'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/3886546325628606526'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2009/10/hackintosh-dell-mini-9.html' title='Hackintosh Dell Mini 9'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_-apeuUdIHjI/St0k_zD4cNI/AAAAAAAAAHk/4Um0OFU_v50/s72-c/hackintosh9.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297187840164530151.post-4937585568695781804</id><published>2009-10-12T02:55:00.005-04:00</published><updated>2009-10-13T08:54:20.002-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sguil'/><category scheme='http://www.blogger.com/atom/ns#' term='bad hack'/><title type='text'>Adding GeoIP to the Sguil Client</title><content type='html'>This is a post I meant to publish months ago, but for some reason slipped off my radar. I was reading the Sguil &lt;a href="http://nsmwiki.org/Sguil_Feature_Wish_List" target="_blank"&gt;wishlist&lt;/a&gt; on &lt;a href="http://nsmwiki.org/Main_Page" target="_blank"&gt;NSMWiki&lt;/a&gt; and saw something that looked simple to implement. Here are a couple diffs I created after adding a menu item for GeoIP in sguil.tk and a proc for it in lib/extdata.tcl. All I did was copy the existing DShield proc and menu items, then edit as needed to change the URL and menu listings.&lt;br /&gt;&lt;br /&gt;I think it should work and I downloaded a pristine copy of the files before running diff since I've &lt;a href="http://eatingsecurity.blogspot.com/2007/10/sguil-070-client-and-netbios-names.html" target="_blank"&gt;hacked Sguil files previously&lt;/a&gt;, but no warranty is assumed or implied, et cetera.&lt;br /&gt;&lt;br /&gt;Ideally, I would love to help out and tackle some of the other items on the wishlist. My time constraints make it hard, but at least I now have a &lt;a href="http://nsmwiki.org/Sguil_FAQ#Seriously.__Why_Tcl.3F" target="_blank"&gt;Tcl book&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;sguil.tk&lt;br /&gt;&lt;pre&gt;2865a2866&lt;br /&gt;&amp;gt; .ipQueryMenu add cascade -label "GeoIP Lookup" -menu $ipQueryMenu.geoIPMenu&lt;br /&gt;2873a2875,2876&lt;br /&gt;&amp;gt; menu $ipQueryMenu.geoIPMenu -tearoff 0 -background $SELECTBACKGROUND -foreground $SELECTFOREGROUND \&lt;br /&gt;&amp;gt; -activeforeground $SELECTBACKGROUND -activebackground $SELECTFOREGROUND&lt;br /&gt;2917a2921,2922&lt;br /&gt;&amp;gt; $ipQueryMenu.geoIPMenu add command -label "SrcIP" -command "GetGeoIP srcip"&lt;br /&gt;&amp;gt; $ipQueryMenu.geoIPMenu add command -label "DstIP" -command "GetGeoIP dstip"&lt;/pre&gt;lib/extdata.tcl&lt;br /&gt;&lt;pre&gt;211a212,243&lt;br /&gt;&amp;gt; proc GetGeoIP { arg } {&lt;br /&gt;&amp;gt;&lt;br /&gt;&amp;gt;     global DEBUG BROWSER_PATH CUR_SEL_PANE ACTIVE_EVENT MULTI_SELECT&lt;br /&gt;&amp;gt;&lt;br /&gt;&amp;gt;     if { $ACTIVE_EVENT &amp;amp;&amp;amp; !$MULTI_SELECT} {&lt;br /&gt;&amp;gt;&lt;br /&gt;&amp;gt;         set selectedIndex [$CUR_SEL_PANE(name) curselection]&lt;br /&gt;&amp;gt;&lt;br /&gt;&amp;gt;         if { $arg == "srcip" } {&lt;br /&gt;&amp;gt;             set ipAddr [$CUR_SEL_PANE(name) getcells $selectedIndex,srcip]&lt;br /&gt;&amp;gt;         } else {&lt;br /&gt;&amp;gt;             set ipAddr [$CUR_SEL_PANE(name) getcells $selectedIndex,dstip]&lt;br /&gt;&amp;gt;         }&lt;br /&gt;&amp;gt;&lt;br /&gt;&amp;gt;         if {[file exists $BROWSER_PATH] &amp;amp;&amp;amp; [file executable $BROWSER_PATH]} {&lt;br /&gt;&amp;gt;&lt;br /&gt;&amp;gt;             # Launch browser&lt;br /&gt;&amp;gt;             exec $BROWSER_PATH http://www.geoiptool.com/?IP=$ipAddr &amp;amp;&lt;br /&gt;&amp;gt;&lt;br /&gt;&amp;gt;         } else {&lt;br /&gt;&amp;gt;&lt;br /&gt;&amp;gt;             tk_messageBox -type ok -icon warning -message\&lt;br /&gt;&amp;gt;               "$BROWSER_PATH does not exist or is not executable. Please update the BROWSER_PATH variable\&lt;br /&gt;&amp;gt;               to point your favorite browser."&lt;br /&gt;&amp;gt;             puts "Error: $BROWSER_PATH does not exist or is not executable."&lt;br /&gt;&amp;gt;&lt;br /&gt;&amp;gt;         }&lt;br /&gt;&amp;gt;&lt;br /&gt;&amp;gt;     }&lt;br /&gt;&amp;gt;&lt;br /&gt;&amp;gt; }&lt;br /&gt;&amp;gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-4937585568695781804?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/4937585568695781804/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2009/04/adding-geoip-to-sguil-client.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/4937585568695781804'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/4937585568695781804'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2009/04/adding-geoip-to-sguil-client.html' title='Adding GeoIP to the Sguil Client'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-3047201144947115735</id><published>2009-09-15T05:28:00.005-04:00</published><updated>2009-09-16T23:31:15.105-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='system administration'/><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='rhel'/><title type='text'>MySQL replication on RHEL</title><content type='html'>I recently configured MySQL for replication after first enabling SSL connections between the two systems that would be involved with replication. I have to say that MySQL documentation is excellent and all these notes are simply based on what is available on the MySQL site. I have included links to as many of the relevant sections of the documentation as possible.&lt;br /&gt;&lt;br /&gt;For reference, here is the MySQL manual on enabling SSL: &lt;a href="http://dev.mysql.com/doc/refman/5.0/en/secure-using-ssl.html" target="_blank"&gt;5.5.7.2. Using SSL Connections&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Before beginning, it is a good idea to create a directory for the SSL output files and make sure all the files end up there.&lt;br /&gt;&lt;br /&gt;MySQL’s RHEL5 packages from mysql.com support SSL by default, but to check you can run:&lt;br /&gt;&lt;br /&gt;&lt;hr align="center" color="blue" width="100%" /&gt;&lt;pre&gt;$ mysqld --ssl --help&lt;br /&gt;mysqld  Ver 5.0.67-community-log for redhat-linux-gnu on i686 (MySQL Community Edition (GPL))Copyright (C) 2000 MySQL AB, by Monty and others&lt;br /&gt;This software comes with ABSOLUTELY NO WARRANTY. This is free software,&lt;br /&gt;and you are welcome to modify and redistribute it under the GPL license&lt;br /&gt;&lt;br /&gt;Starts the MySQL database server&lt;br /&gt;&lt;br /&gt;Usage: mysqld [OPTIONS]&lt;br /&gt;&lt;br /&gt;For more help options (several pages), use mysqld --verbose --help&lt;/pre&gt;&lt;hr align="center" color="blue" width="100%" /&gt;&lt;br /&gt;The command will &lt;a href="http://dev.mysql.com/doc/refman/5.0/en/secure-using-ssl.html" target="_blank"&gt;create an error&lt;/a&gt; if there is no SSL support.&lt;br /&gt;&lt;br /&gt;Next, check that the MySQL server has SSL enabled. The below output means that the server supports SSL but it is not enabled. Enabling it can be done at the command line or in the configuration file, which will be detailed later.&lt;br /&gt;&lt;br /&gt;&lt;hr align="center" color="blue" width="100%" /&gt;&lt;pre&gt;$ mysql -u username -p -e"show variables like 'have_ssl'"&lt;br /&gt;Enter password:&lt;br /&gt;+---------------+----------+&lt;br /&gt;| Variable_name | Value    |&lt;br /&gt;+---------------+----------+&lt;br /&gt;| have_ssl      | DISABLED |&lt;br /&gt;+---------------+----------+&lt;/pre&gt;&lt;hr align="center" color="blue" width="100%" /&gt;&lt;br /&gt;Documentation on setting up certificates:&lt;br /&gt;&lt;a href="http://dev.mysql.com/doc/refman/5.0/en/secure-create-certs.html" target="_blank"&gt;5.5.7.4. Setting Up SSL Certificates for MySQL&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;First, generate the CA key and CA certificate:&lt;br /&gt;&lt;br /&gt;&lt;hr align="center" color="blue" width="100%" /&gt;&lt;pre&gt;$ openssl genrsa 2048 &amp;gt; mysql-ca-key.pem&lt;br /&gt;Generating RSA private key, 2048 bit long modulus&lt;br /&gt;............................................+++&lt;br /&gt;............+++&lt;br /&gt;&lt;br /&gt;$ openssl req -new -x509 -nodes -days 356 -key mysql-ca-key.pem &amp;gt; mysql-ca-cert.pem&lt;br /&gt;You are about to be asked to enter information that will be incorporated&lt;br /&gt;into your certificate request.&lt;br /&gt;What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;There are quite a few fields but you can leave some blank&lt;br /&gt;For some fields there will be a default value,&lt;br /&gt;If you enter '.', the field will be left blank.&lt;br /&gt;-----&lt;br /&gt;Country Name (2 letter code) [GB]:US&lt;br /&gt;State or Province Name (full name) [Berkshire]:California&lt;br /&gt;Locality Name (eg, city) [Newbury]:Burbank&lt;br /&gt;Organization Name (eg, company) [My Company Ltd]:Acme Road Runner Traps&lt;br /&gt;Organizational Unit Name (eg, section) []:Acme IRT&lt;br /&gt;Common Name (eg, your name or your server's hostname) []:mysql.acme.com&lt;br /&gt;Email Address []:acme-irt@acme.com&lt;/pre&gt;&lt;hr align="center" color="blue" width="100%" /&gt;&lt;br /&gt;Create the server certificate:&lt;br /&gt;&lt;br /&gt;&lt;hr align="center" color="blue" width="100%" /&gt;&lt;pre&gt;$ openssl req -newkey rsa:2048 -days 365 -nodes -keyout mysql-server-key.pem &amp;gt;&lt;br /&gt;mysql-server-req.pem&lt;br /&gt;&lt;br /&gt;Generating a 2048 bit RSA private key&lt;br /&gt;.............................+++&lt;br /&gt;.............................................................+++&lt;br /&gt;writing new private key to 'mysql-server-key.pem'&lt;br /&gt;-----&lt;br /&gt;You are about to be asked to enter information that will be incorporated&lt;br /&gt;into your certificate request.&lt;br /&gt;What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;There are quite a few fields but you can leave some blank&lt;br /&gt;For some fields there will be a default value,&lt;br /&gt;If you enter '.', the field will be left blank.&lt;br /&gt;-----&lt;br /&gt;Country Name (2 letter code) [GB]:US&lt;br /&gt;State or Province Name (full name) [Berkshire]:California&lt;br /&gt;Locality Name (eg, city) [Newbury]:Burbank&lt;br /&gt;Organization Name (eg, company) [My Company Ltd]:Acme Road Runner Traps&lt;br /&gt;Organizational Unit Name (eg, section) []:Acme IRT&lt;br /&gt;Common Name (eg, your name or your server's hostname) []:mysql.acme.com&lt;br /&gt;Email Address []:acme-irt@acme.com&lt;br /&gt;&lt;br /&gt;Please enter the following 'extra' attributes&lt;br /&gt;to be sent with your certificate request&lt;br /&gt;A challenge password []:&lt;br /&gt;&lt;br /&gt;$ openssl x509 -req -in mysql-server-req.pem -days 356 -CA mysql-ca-cert.pem -CAkey mysql-ca-key.pem&lt;br /&gt;-set_serial 01 &amp;gt; mysql-server-cert.pem&lt;br /&gt;Signature ok&lt;br /&gt;subject=/C=US/ST=California/L=Burbank/O=Acme Road Runner Traps/OU=Acme IRT/CN=&lt;br /&gt;mysql.acme.com/emailAddress=acme-irt@acme.com&lt;br /&gt;Getting CA Private Key&lt;/pre&gt;&lt;hr align="center" color="blue" width="100%" /&gt;&lt;br /&gt;Finally, create the client certificate:&lt;br /&gt;&lt;br /&gt;&lt;hr align="center" color="blue" width="100%" /&gt;&lt;pre&gt;$ openssl req -newkey rsa:2048 -days 356 -nodes -keyout mysql-client-key.pem &amp;gt;&lt;br /&gt;mysql-client-req.pem&lt;br /&gt;Generating a 2048 bit RSA private key&lt;br /&gt;................+++&lt;br /&gt;.................+++&lt;br /&gt;writing new private key to 'mysql-client-key.pem'&lt;br /&gt;-----&lt;br /&gt;You are about to be asked to enter information that will be incorporated&lt;br /&gt;into your certificate request.&lt;br /&gt;What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;There are quite a few fields but you can leave some blank&lt;br /&gt;For some fields there will be a default value,&lt;br /&gt;If you enter '.', the field will be left blank.&lt;br /&gt;-----&lt;br /&gt;Country Name (2 letter code) [GB]:US&lt;br /&gt;State or Province Name (full name) [Berkshire]:California&lt;br /&gt;Locality Name (eg, city) [Newbury]:Burbank&lt;br /&gt;Organization Name (eg, company) [My Company Ltd]:Acme Road Runner Traps&lt;br /&gt;Organizational Unit Name (eg, section) []:Acme IRT&lt;br /&gt;Common Name (eg, your name or your server's hostname) []:mysql.acme.com&lt;br /&gt;Email Address []:acme-irt@acme.com&lt;br /&gt;&lt;br /&gt;Please enter the following 'extra' attributes&lt;br /&gt;to be sent with your certificate request&lt;br /&gt;A challenge password []:&lt;br /&gt;&lt;br /&gt;$ openssl x509 -req -in mysql-client-req.pem -days 356 -CA mysql-ca-cert.pem&lt;br /&gt;-CAkey mysql-ca-key.pem -set_serial 01 &amp;gt; mysql-client-cert.pem&lt;br /&gt;Signature ok&lt;br /&gt;subject=/C=US/ST=California/L=Burbank/O=Acme Road Runner Traps/OU=Acme&lt;br /&gt;IRT/CN=mysql.acme.com/emailAddress=acme-irt@acme.com&lt;br /&gt;Getting CA Private Key&lt;br /&gt;&lt;br /&gt;[nr@mysqld mysqlcerts]$ ls&lt;br /&gt;mysql-ca-cert.pem      mysql-client-key.pem   mysql-server-key.pem&lt;br /&gt;mysql-ca-key.pem       mysql-client-req.pem   mysql-server-req.pem&lt;br /&gt;mysql-client-cert.pem  mysql-server-cert.pem&lt;/pre&gt;&lt;hr align="center" color="blue" width="100%" /&gt;&lt;br /&gt;To enable SSL when starting mysqld, the following should be in /etc/my.cnf under the [mysqld] section. For this example, I put the files in &lt;tt&gt;/etc/mysql/openssl&lt;/tt&gt;:&lt;br /&gt;&lt;br /&gt;&lt;hr align="center" color="blue" width="100%" /&gt;&lt;pre&gt;ssl-ca="/etc/mysql/openssl/mysql-ca-cert.pem"&lt;br /&gt;ssl-cert="/etc/mysql/openssl/mysql-server-cert.pem"&lt;br /&gt;ssl-key="/etc/mysql/openssl/mysql-server-key.pem"&lt;/pre&gt;&lt;hr align="center" color="blue" width="100%" /&gt;&lt;br /&gt;To use any client, for instance mysql from the command line  or the GUI MySQL Administrator, copy the client cert and key to a dedicated folder on the local box along with ca-cert. You will have to configure the client to use the client certificate, client key, and CA certificate.&lt;br /&gt;&lt;br /&gt;To connect with the mysql client using SSL, copy the client certificates to a folder, for instance /etc/mysql, then under the [client] section in /etc/my.cnf:&lt;br /&gt;&lt;br /&gt;&lt;hr align="center" color="blue" width="100%" /&gt;&lt;pre&gt;ssl-ca="/etc/mysql/openssl/mysql-ca-cert.pem"&lt;br /&gt;ssl-cert="/etc/mysql/openssl/mysql-client-cert.pem"&lt;br /&gt;ssl-key="/etc/mysql/openssl/mysql-client-key.pem"&lt;/pre&gt;&lt;hr align="center" color="blue" width="100%" /&gt;&lt;br /&gt;In MySQL Administrator, the following is an example you would put into the Advanced Parameters section if you want to connect using SSL.&lt;br /&gt;&lt;br /&gt;&lt;hr align="center" color="blue" width="100%" /&gt;&lt;pre&gt;SSL_CA U:/keys/mysql-ca-cert.pem&lt;br /&gt;SSL_CERT U:/keys/mysql-client-cert.pem&lt;br /&gt;SSL_KEY U:/keys/mysql-client-key.pem&lt;br /&gt;USE_SSL Yes&lt;/pre&gt;&lt;hr align="center" color="blue" width="100%" /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Replication&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Before configuring replication, I made sure to review the &lt;a href="http://dev.mysql.com/doc/refman/5.0/en/replication.html" target="_blank"&gt;MySQL replication documentation&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://dev.mysql.com/doc/refman/5.0/en/replication-howto-repuser.html" target="_blank"&gt;16.1.1.1. Creating a User for Replication&lt;/a&gt;&lt;br /&gt;Because MySQL stores the replication user’s name and password using plain text in the master.info file, it’s recommended to create a dedicated user that only has the REPLICATION SLAVE privilege. The replication user needs to be created on the master so the slaves can connect with that user.&lt;br /&gt;&lt;br /&gt;&lt;hr align="center" color="blue" width="100%" /&gt;&lt;pre&gt;GRANT REPLICATION SLAVE ON *.* TO 'repl'@'192.168.1.50' IDENTIFIED BY ‘password’;&lt;/pre&gt;&lt;hr align="center" color="blue" width="100%" /&gt;&lt;br /&gt;&lt;a href="http://dev.mysql.com/doc/refman/5.0/en/replication-howto-masterbaseconfig.html" target="_blank"&gt;16.1.1.2. Setting the Replication Master Configuration&lt;/a&gt;&lt;br /&gt;Edit my.cnf to uncomment the “log-bin” line. Also uncomment “server-id = 1”. The server-id can be anything between 1 and 2^32 but must be unique.&lt;br /&gt;&lt;br /&gt;Also add “expire_logs_days” to my.cnf. If you don’t, the binary logs could fill up the disk partition because they are not deleted by default!&lt;br /&gt;&lt;br /&gt;&lt;hr align="center" color="blue" width="100%" /&gt;&lt;pre&gt;expire_log_days = 4&lt;/pre&gt;&lt;hr align="center" color="blue" width="100%" /&gt;&lt;br /&gt;&lt;a href="http://dev.mysql.com/doc/refman/5.0/en/replication-howto-slavebaseconfig.html" target="_blank"&gt;16.1.1.3. Setting the Replication Slave Configuration&lt;/a&gt;&lt;br /&gt;Set server-id to something different from the master in &lt;tt&gt;my.cnf&lt;/tt&gt;. Although not required, enabling binary logging on the slave is also recommended for backups, crash recovery, and in case the slave will also be a master to other systems.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://dev.mysql.com/doc/refman/5.0/en/replication-howto-masterstatus.html" target="_blank"&gt;16.1.1.4. Obtaining the Master Replication Information&lt;/a&gt;&lt;br /&gt;I flush the tables to disk and lock them to temporarily prevent changes. &lt;br /&gt;&lt;br /&gt;&lt;hr align="center" color="blue" width="100%" /&gt;&lt;pre&gt;# mysql -u root -p -A dbname&lt;br /&gt;mysql&amp;gt; FLUSH TABLES WITH READ LOCK;&lt;br /&gt;Query OK, 0 rows affected (0.00 sec)&lt;/pre&gt;&lt;hr align="center" color="blue" width="100%" /&gt;&lt;br /&gt;If the slave already has data from master, then you may want to copy over data manually to simplify things, &lt;a href="http://dev.mysql.com/doc/refman/5.0/en/replication-howto-rawdata.html" target="_blank"&gt;16.1.1.6. Creating a Data Snapshot Using Raw Data Files&lt;/a&gt;. However, you can also use mysqldump, as shown in &lt;a href="http://dev.mysql.com/doc/refman/5.0/en/replication-howto-mysqldump.html" target="_blank"&gt;Section 16.1.1.5, “Creating a Data Snapshot Using mysqldump”&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Once the data is copied over to the slave, I get the current log position.&lt;br /&gt;&lt;br /&gt;&lt;hr align="center" color="blue" width="100%" /&gt;&lt;pre&gt;Mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;+------------------+----------+--------------+------------------+&lt;br /&gt;| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;+------------------+----------+--------------+------------------+&lt;br /&gt;| mysql-bin.000002 | 16524487 |              |                  |&lt;br /&gt;+------------------+----------+--------------+------------------+ &lt;br /&gt;1 row in set (0.00 sec)&lt;br /&gt;&lt;br /&gt;mysql&amp;gt; UNLOCK TABLES;&lt;/pre&gt;&lt;hr align="center" color="blue" width="100%" /&gt;&lt;a href="http://dev.mysql.com/doc/refman/5.0/en/replication-howto-slaveinit.html" target="_blank"&gt;&lt;br /&gt;16.1.1.10. Setting the Master Configuration on the Slave&lt;/a&gt;&lt;br /&gt;Finally, configure the slave. The log file and log position tell the slave where to begin replication. All changes after that log position will be replicated to the slave.&lt;br /&gt;&lt;br /&gt;&lt;hr align="center" color="blue" width="100%" /&gt;&lt;pre&gt;mysql&amp;gt; CHANGE MASTER TO&lt;br /&gt;-&amp;gt;     MASTER_HOST=’192.168.1.50’,&lt;br /&gt;-&amp;gt;     MASTER_USER=’repl’,&lt;br /&gt;-&amp;gt;     MASTER_PASSWORD='replication_password',&lt;br /&gt;-&amp;gt;     MASTER_LOG_FILE=’ mysql-bin.000002’,&lt;br /&gt;-&amp;gt;     MASTER_LOG_POS=16524487,&lt;br /&gt;-&amp;gt;     MASTER_SSL=1,&lt;br /&gt;-&amp;gt;     MASTER_SSL_CA = '/etc/mysql/openssl/mysql-ca-cert.pem',&lt;br /&gt;-&amp;gt;     MASTER_SSL_CAPATH='/etc/mysql/openssl/',&lt;br /&gt;-&amp;gt;     MASTER_SSL_CERT = '/etc/mysql/openssl/mysql-server-cert.pem',&lt;br /&gt;-&amp;gt;     MASTER_SSL_KEY = '/etc/mysql/openssl/mysql-server-key.pem';&lt;br /&gt;Query OK, 0 rows affected (0.74 sec)  &lt;br /&gt;&lt;br /&gt;mysql&amp;gt; START SLAVE;&lt;/pre&gt;&lt;hr align="center" style="color: blue;" width="100%" /&gt;&lt;br /&gt;Replication can start!&lt;br /&gt;The slave status can be checked via the following command:&lt;br /&gt;&lt;br /&gt;&lt;hr align="center" style="color: blue;" width="100%" /&gt;&lt;pre&gt;mysql&amp;gt; show slave status;&lt;/pre&gt;&lt;hr align="center" style="color: blue;" width="100%" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-3047201144947115735?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/3047201144947115735/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2009/09/mysql-replication-on-rhel.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/3047201144947115735'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/3047201144947115735'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2009/09/mysql-replication-on-rhel.html' title='MySQL replication on RHEL'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-7598902136352239110</id><published>2009-09-06T01:00:00.003-04:00</published><updated>2009-09-08T07:35:57.723-04:00</updated><title type='text'>Two years</title><content type='html'>It has been two years since I started this blog. Here is a quick recap of notable posts that consistently get a substantial number of page views.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;IR/NSM:&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://eatingsecurity.blogspot.com/2009/04/building-ir-team-people.html" target="_blank"&gt;Building an IR Team: People&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://eatingsecurity.blogspot.com/2009/06/building-ir-team-organization.html" target="_blank"&gt;Building an IR Team: Organization&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://eatingsecurity.blogspot.com/2007/09/transparent-bridging-mmap-pcap-and.html" target="_blank"&gt;Transparent Bridging, MMAP pcap, and Snort Inline&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://eatingsecurity.blogspot.com/2007/11/snort-performance-and-memory-map-pcap.html" target="_blank"&gt;Snort Performance and Memory Map Pcap on RHEL&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://eatingsecurity.blogspot.com/2007/10/upgrading-to-snort-280.html" target="_blank"&gt;Upgrading to Snort 2.8.0&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://eatingsecurity.blogspot.com/2008/05/snort-281-changes-and-upgrading.html" target="_blank"&gt;Snort 2.8.1 changes and upgrading&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://eatingsecurity.blogspot.com/2008/10/snort-shared-object-rules-with-sguil.html" target="_blank"&gt;Snort shared object rules with Sguil&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://eatingsecurity.blogspot.com/2008/01/javascript-decoding-and-more.html" target="_blank"&gt;JavaScript decoding and more&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://eatingsecurity.blogspot.com/2008/09/modified-pulling-ip-addresses-from.html" target="_blank"&gt;Querying Session Data Based on Snort Rule IPs&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;System Administration:&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://eatingsecurity.blogspot.com/2008/09/setting-up-openldap-for-centralized.html" target="_blank"&gt;Setting up OpenLDAP for centralized accounts&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://eatingsecurity.blogspot.com/2008/10/openldap-continued.html" target="_blank"&gt;OpenLDAP continued&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://eatingsecurity.blogspot.com/2008/11/openldap-security.html" target="_blank"&gt;OpenLDAP Security&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://eatingsecurity.blogspot.com/2008/03/using-parted-and-lvm2-for-large.html" target="_blank"&gt;Using parted and LVM2 for large partitions&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;a href="http://eatingsecurity.blogspot.com/2007/09/querying-session-data-based-on-snort.html" target="_blank"&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-7598902136352239110?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/7598902136352239110/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2009/08/two-years.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/7598902136352239110'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/7598902136352239110'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2009/08/two-years.html' title='Two years'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-6788378378354338916</id><published>2009-07-15T05:19:00.007-04:00</published><updated>2009-07-15T07:18:32.883-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='documentation'/><category scheme='http://www.blogger.com/atom/ns#' term='incident response'/><title type='text'>Building an IR Team: Documentation</title><content type='html'>My third post on building an Incident Response (IR) team covers documentation. The first post was &lt;a href="http://eatingsecurity.blogspot.com/2009/04/building-ir-team-people.html" target="_blank"&gt;Building an IR Team: People&lt;/a&gt;, followed by &lt;a href="http://eatingsecurity.blogspot.com/2009/06/building-ir-team-organization.html" target="_blank"&gt;Building an IR Team: Organization&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Good documentation promotes good communication and effective analysts. Documentation is not sexy, and can even be downright annoying to create and maintain, but it is absolutely crucial. Making it as painless and useful as possible will be a huge benefit to the IR team.&lt;br /&gt;&lt;br /&gt;Since documentation and communication are so intertwined, I had planned on making one post to cover both topics. However, the amount of material I have for documentation made me decide to do a future post, &lt;span style="font-style: italic;"&gt;Building an IR Team: Communication&lt;/span&gt;, and concentrate on keeping this post to a more digestible size.&lt;br /&gt;&lt;br /&gt;There are quite a few different areas where a Computer Incident Response Team (CIRT) will need good documentation.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Incident Tracking&lt;/span&gt;&lt;br /&gt;Since I am writing about computer IR teams, it is obvious that the teams will be dealing with digital security incidents. For an enterprise, you will almost certainly need a database back-end for your incidents. Even smaller environments may find it best to use a database to track incidents.You will need some sort of incident tracking system for many reasons, including but not necessarily limited to the following. &lt;ul&gt;&lt;li&gt;Tracking of incident status and primary responder(s)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Incident details&lt;/li&gt;&lt;li&gt;Response details and summary&lt;/li&gt;&lt;li&gt;Trending, statistics and other analysis&lt;/li&gt;&lt;/ul&gt;Tracking the status and who is responsible for specific incidents is one of the primary reasons for incident tracking. Some off-the-shelf software can support incident tracking, for instance help desk ticketing software or other tasking software. This type of software will certainly support the basic needs like status (assigned, in progress, open, closed, etc) and who the incident is assigned to.&lt;br /&gt;&lt;br /&gt;However, off-the-shelf software may not have great support for the incident details. A great example is IP addresses and ports. Logging IP addresses, names of systems, ports if applicable, and what type of vulnerability was exploited can be extremely useful for trending, statistics, and historical analysis. A field for IP addresses can probably be more easily be queried than a full text field that contains IP addresses. If I see that a particular IP address successfully attacked two systems in the previous shift, or a particular type of exploit was used successfully on two systems, I want to be able to quickly check and see how many times it happened in the past week. I also want to be able to pull that data out and use it to query my NSM data to see if there was similar activity that garnered no response from analysts.&lt;br /&gt;&lt;br /&gt;Reponse details can be thought of as a log that is updated throughout the incident, from discovery to resolution. Having the details to look back on is extremely useful. You can use the details for a technical write-up, an executive summary, to recreate incidents in a lab environment, for training, lessons learned, and more. My general thought process is that the longer it takes to document an incident, the more likely the documentation is to be useful.&lt;br /&gt;&lt;br /&gt;Trending and statistical analysis can be used to help guide future response and look back at previous activity for anything that was missed, as I already mentioned. It is also extremely useful for reports to management that can also be used to help gain political capital within the organization. What do I mean by political capital?&lt;br /&gt;&lt;br /&gt;Say you have noticed anecdotally that you are getting owned by web servers over HTTP, but the malicious sites are usually known to be malicious, for instance when searching Google or using a anti-malware toolbar. Your company has no web proxy and you recommend one with the understanding that most of the malicious sites would be blocked by the web proxy. The problem is that the networking group does not want to re-engineer or reconfigure, and upper management does not think it is worth the money. With a thorough report and analysis using the information from incident tracking, and by using that data to show the advantages of the proxy solution, you could provide the CIRT or SOC management the political capital they need to get things moving when faced with other parts of the company that resist.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Standard Operating Procedures (SOP)&lt;/span&gt;&lt;br /&gt;Although analysts performing IR need to be able to adapt and the tasks can be fluid, a SOP is still important for a CIRT. A SOP can cover a lot of material, including IR procedures, notification and contact information, escalation procedures, job functions, hours of operation, and more. A good SOP might even include the CIRT mission statement and other background to help everyone understand the underlying purpose and mission of the group.&lt;br /&gt;&lt;br /&gt;The main goal of a SOP should be to document and detail all the standard or repetitive procedures, and it can even provide guidance on what to do if presented with a situation that is not covered in the SOP. As an example, a few bullet points of sections that might be needed in a SOP are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Managing routine malware incidents&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Analyzing short term trends&lt;/li&gt;&lt;li&gt;Researching new exploits and malicious activity&lt;/li&gt;&lt;li&gt;Overview of security functions and tools, e.g. NSM&lt;br /&gt;&lt;/li&gt;&lt;li&gt;More detailed explanation and basic usage information for important tools, e.g. how to connect to Sguil and who are the administrators of the system&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Although a SOP will not cover every situation, the goal should be to make the team more efficient and provide a reference for tasks or procedures that are used repeatedly. I'm not a fan of hand-holding and like analysts to try and figure things out on their own, so I don't mind if analysts use different methods as long as the end results are consistent in both accuracy and format.&lt;br /&gt;&lt;br /&gt;I also like analysts to think about the most efficient way to analyze an incident. Some may gather information and investigate using slightly different methodology, but each analyst should understand that something simple should be checked before something that takes a lot of time, particularly when the value of the information returned will be roughly equal. The analysis should use what my boss likes to call the "&lt;a href="http://eatingsecurity.blogspot.com/2009/07/does-it-make-sense-test.html" target="_blank"&gt;Does it make sense?&lt;/a&gt;" test. Gathering some of the simplest and most straightforward information first will usually point you in the right direction, and a SOP can help show how to do this.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Knowledge Base&lt;/span&gt;&lt;br /&gt;A knowledge base can take many different forms and contains different types of information than SOP, though there also may be overlap. There are specific knowledge base applications, wikis, simple log applications, and even ticketing or tasking systems that provide some functionality for an integrated knowledge base. A knowledge base will often contain technical information, technical references, HOWTOs, white papers, troubleshooting tips, and various other types of notes and information.&lt;br /&gt;&lt;br /&gt;One of my favorite options for a knowledge base is a wiki. You can see various open knowledge bases that are using wikis, for instance &lt;a href="http://nsmwiki.org/Main_Page" target="_blank"&gt;NSMWiki&lt;/a&gt; and &lt;a href="http://doc.emergingthreats.net/" target="_blank"&gt;Emerging Threats Documentation Wiki&lt;/a&gt;, but if you want organization- and job-specific knowledge bases then you will also need something to hold the information for your CIRT.&lt;br /&gt;&lt;br /&gt;The reason I pick those two wikis as examples is because they contain some of the exact type of information that is useful in a knowledge base for your CIRT. The main difference is that your knowledge will be specific to your organization. One good example are wiki entries for specific IDS rules as they pertain to your network, in other words an internal version of the Emerging Threats rule wiki. There may be shortcuts to take with regard to investigating specific rules or other network activity to quickly determine the nature of the traffic, and a wiki is a good place to keep that information.&lt;br /&gt;&lt;br /&gt;Similarly, documentation on setting up a NSM device, tuning, or maintenance can be very effectively stored and edited on a wiki. The ease of collaboration with a wiki helps keep the documentation useful and up to date. If properly organized, someone could easily find information needed to keep the team running smoothly. Some example of documentation I have found useful when put it in a wiki:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;How to troubleshoot common problems on a NSM sensor &lt;/li&gt;&lt;li&gt;How to build and configure a NSM sensor&lt;/li&gt;&lt;li&gt;How to update and tune IDS rules&lt;br /&gt;&lt;/li&gt;&lt;li&gt;List and overview of scripts available to assist incident response &lt;/li&gt;&lt;li&gt;Overviews of each available IR tool&lt;/li&gt;&lt;li&gt;More detailed descriptions and usage examples of IR tools&lt;/li&gt;&lt;li&gt;Example IR walk-throughs using previously resolved incidents&lt;/li&gt;&lt;li&gt;Links to external resources, e.g. blogs, wikis, manuals, and vendor sites&lt;/li&gt;&lt;/ul&gt;One of the best ways I can think of to effectively communicate the usefulness of both a knowledge base and a SOP to senior technical personnel is by pointing out that better documentation makes it less likely that you are needed for help. Additionally, it is much faster to resolve an issue for another analyst if you can do something like refer the analyst to step-by-step instructions in the knowledge base. If you want fewer calls during off hours, make sure the analysts have the documentation they need.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Shift Logs&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;In an environment with multiple shifts, it is important to keep shift logs of notable activity, incidents, and any other information that needs to be passed to other shifts. Although I will also discuss this in &lt;span style="font-style: italic;"&gt;Building an IR Team: Communication&lt;/span&gt;, the usefulness of connecting the shifts with a dedicated log is apparent. Given the amount of email and incident tickets that are generated in an environment that requires 24x7 monitoring, having a shift log to quickly summarize important and ongoing event helps separate the wheat from the chaff.&lt;br /&gt;&lt;br /&gt;Since my feeling is that shift logs should be terse and quick to parse, what to use for logging may not be crucial. The first examples that come to my mind are software designed for shift logs, forum software, or blogging software. The main features needed are individual accounts to show who is posting, timestamps, and an effective search feature. Anything else is a bonus, though it may depend on exactly what you want analysts logging and what is being used to handle incident tracking.&lt;br /&gt;&lt;br /&gt;One thing that is quite useful with the shift log is a summary post at the end of each shift, and then the analysts should verbally go over the summary at the shift change. This can help make sure the most significant entries are not missed and it gives the chance for the oncoming shift to ask questions before the outgoing shift leaves for the day.&lt;br /&gt;&lt;br /&gt;As usual, I can't cover everything on the topic, but my goal is to provide a reference and get the gears turning. The need for good documentation exists and documentation is important to use to the IR team's advantage.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-6788378378354338916?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/6788378378354338916/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2009/07/building-ir-team-documentation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/6788378378354338916'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/6788378378354338916'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2009/07/building-ir-team-documentation.html' title='Building an IR Team: Documentation'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-98064596469496672</id><published>2009-07-07T21:01:00.003-04:00</published><updated>2009-07-08T12:28:06.819-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='nsm'/><category scheme='http://www.blogger.com/atom/ns#' term='training'/><category scheme='http://www.blogger.com/atom/ns#' term='incident response'/><title type='text'>The "Does it make sense?" test</title><content type='html'>I was composing the next installment of my series on &lt;a href="http://eatingsecurity.blogspot.com/2009/06/building-ir-team-organization.html" target="_blank"&gt;building&lt;/a&gt; an &lt;a href="http://eatingsecurity.blogspot.com/2009/04/building-ir-team-people.html" target="_blank"&gt;incident response team&lt;/a&gt; and started to include this, but then decided it deserves a separate entry.&lt;br /&gt;&lt;br /&gt;Some time ago, my boss came up with what he calls the "Does it make sense?" test as a cheat-sheet for help training new analysts and to use as a quick reference. When we refer to traffic making sense, we are asking whether the traffic is normal for the network.&lt;br /&gt;&lt;br /&gt;This is very simple and covers some of the quickest ways an analyst can investigate a possible incident. Consider it a way to triage possible NSM activity or incidents. Using something like this can easily eliminate a lot of unnecessary and time-consuming analysis, or point out when the extra analysis is needed.&lt;br /&gt;&lt;br /&gt;The "does it make sense" test:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Determine the direction of the network traffic.&lt;/li&gt;&lt;li&gt;Determine the IP addresses involved.&lt;/li&gt;&lt;li&gt;Determine the locations of the systems (e.g. internal, external, VPN, whois, GeoIP).&lt;/li&gt;&lt;li&gt;Determine the functions of the systems involved (e.g. web server, mail server, workstation).&lt;/li&gt;&lt;li&gt;Determine protocols involved and whether they are "normal" protocols and ports that should be seen between the systems.&lt;/li&gt;&lt;li&gt;When applicable, look at the packet capture and compare it to the signature/rule.&lt;/li&gt;&lt;li&gt;Use historical queries on NSM systems and searches of documentation to determine past events that may be related to the current one.&lt;/li&gt;&lt;/ol&gt;Based on the above knowledge, does the traffic that caused the alert make sense or is it abnormal? Simple examples:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;A file server sending huge amounts of SMTP traffic over port 25 probably does not make sense, whether because of malicious activity or a misconfiguration.&lt;/li&gt;&lt;li&gt;Someone connecting to a workstation on port 21 with FTP probably does not make sense.&lt;/li&gt;&lt;li&gt;A DNS server sending and receiving traffic to another DNS server over port 53 does make sense. However, an analysis of the alert and the DNS traffic may still be needed to verify whether the traffic is malicious or not.&lt;/li&gt;&lt;/ol&gt;Remember, traffic that makes sense and is normal on one network may not be normal on another network. Having a good baseline of your network traffic is extremely important before you can accurately determine what traffic makes sense and what traffic does not makes sense. Even traffic that does not make sense is not automatically malicious.&lt;br /&gt;&lt;br /&gt;Also remember, traffic that makes sense is not always friendly. A good attacker will make his network traffic look like it fits in with the the baseline traffic, making the traffic less likely to stick out.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-98064596469496672?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/98064596469496672/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2009/07/does-it-make-sense-test.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/98064596469496672'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/98064596469496672'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2009/07/does-it-make-sense-test.html' title='The &quot;Does it make sense?&quot; test'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-6998991248449188790</id><published>2009-06-30T16:44:00.001-04:00</published><updated>2009-06-30T16:50:47.550-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='exploits'/><category scheme='http://www.blogger.com/atom/ns#' term='risk'/><title type='text'>Exploiting the brain</title><content type='html'>In some interesting science news, &lt;a href="http://news.bbc.co.uk/2/hi/health/8116321.stm" target="_blank"&gt;talking into a person's right ear&lt;/a&gt; is apparently a good idea if you want the person to be receptive to what you're saying.&lt;br /&gt;&lt;blockquote&gt;If you want to get someone to do something, ask them in their right ear, say scientists.&lt;p&gt;Italian researchers found people were better at processing information when requests were made on that side in three separate tests. &lt;/p&gt;&lt;p&gt;They believe this is because the left side of the brain, which is known to be better at processing requests, deals with information from the right ear. &lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;The article also states that what is heard through the right ear gets sent to "a slightly more amenable part of the brain." Even when you know about something like this, it is probably difficult or even impossible to consciously over-ride the differences between hearing something in the right ear versus the left ear.&lt;/p&gt;&lt;p&gt;Looking at this through a security mindset, a threat could be someone that knows how to exploit this behavior, and to reduce the vulnerability could require actively training yourself to overcome standard neuroscience. This type of knowledge can even be applied directly to something like a penetration test that includes social engineering in the rules of engagement.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Next time you ask for a raise, make sure you're to the right of your boss.&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/297187840164530151-6998991248449188790?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/6998991248449188790/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2009/06/exploiting-brain.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/6998991248449188790'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/6998991248449188790'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2009/06/exploiting-brain.html' title='Exploiting the brain'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297187840164530151.post-8069957067609911522</id><published>2009-06-25T05:02:00.003-04:00</published><updated>2009-06-25T07:55:23.219-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='nsm'/><category scheme='http://www.blogger.com/atom/ns#' term='incident response'/><title type='text'>Building an IR Team: Organization</title><content type='html'>This is my second post in a planned series. The first is called &lt;a href="http://eatingsecurity.blogspot.com/2009/04/building-ir-team-people.html" target="_blank"&gt;Building an IR Team: People&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;How to organize an Computer Incident Response Team (CIRT) is a difficult and complex topic. Although there may be best practices or sensible guidelines, a lot will be dictated by the size of your team, the type and size of network environment, management, company policies and the abilities of analysts. I also believe that network security monitoring (NSM) and incident response (IR) are so intertwined that you really should talk about them and organize them together.&lt;br /&gt;&lt;br /&gt;A few questions that come to mind when thinking of organization and hierarchy of the team:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Will you only be doing IR, or will you be responsible for additional security operations and security engineering?&lt;br /&gt;&lt;/li&gt;&lt;li&gt;What is the minimal amount of staffing you need to cover your hours of operation? What other coverage requirements do you have dictated by management, policies, or plain common sense?&lt;/li&gt;&lt;li&gt;How will the size of your team effect your hierarchy and organization?&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Since being understaffed is the norm, how can you organize to improve efficiency without hurting the quality of work?&lt;/li&gt;&lt;li&gt;Can you train individuals or groups so you have redundancy in key job functions?&lt;/li&gt;&lt;li&gt;Referencing both physical and logical organization of the team, will they be centralized or distributed?&lt;/li&gt;&lt;li&gt;What is your budget? (Richard Bejtlich has had a number of posts about how much to spend on digital security, including &lt;a href="http://taosecurity.blogspot.com/2009/06/how-much-to-spend-on-digital-security.html" target="_blank"&gt;one recently&lt;/a&gt;).&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;IR and other Security Operations&lt;/span&gt;&lt;br /&gt;The first question really needs to be answered before you start answering all the rest. There are two basic models I have seen when organizing a response team. The simpler model is to have a response team that only performs incident response, often along with NSM or working directly with the NSM team. Even if the response team does not do the actual first tier NSM, the NSM team usually will function as a lower tier that escalates possible incidents to the IR team.&lt;br /&gt;&lt;br /&gt;The more complex, but possibly more common, model is to have incident responders and NSM teams that also perform a number of other duties. I mentioned both security operations and security engineering in the bullet point. Examples of security operations and engineering could be penetration testing, vulnerability assessment, malware analysis, NSM sensor deployment, NSM sensor tuning, firewall change reviews or management, and more. The reason I say this model may be more common is the bottom line, money. It is also difficult to discretely define all these job duties without any overlap.&lt;br /&gt;&lt;br /&gt;There are advantages and disadvantages to each model. For dedicated incident responders, advantages compared to the alternative include:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Specialization can promote higher levels of expertise.&lt;/li&gt;&lt;li&gt;Duties, obligations, procedures and priorities are clearer.&lt;/li&gt;&lt;li&gt;Documentation can probably be simplified.&lt;/li&gt;&lt;li&gt;IR may be more effective overall.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Disadvantages can include:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Money. If incident responders perform a narrow set of duties, you will probably need more total personnel to complete the same tasks.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Less flexibility with personnel.&lt;/li&gt;&lt;li&gt;Limiting duties exclusively to incident response may result in more burn-out. Although not a given, many people like the variety that comes with a wider range of duties.&lt;/li&gt;&lt;/ul&gt;Advantages of having incident responders also perform other security operations and engineering:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Money.&lt;/li&gt;&lt;li&gt;A better understanding of incident response can produce better engineering. A great example is tuning NSM sensors, where an engineer that does the tuning has a much better understanding of feedback and even sees the good and bad firsthand if the same person is also doing NSM or IR.&lt;/li&gt;&lt;li&gt;Similarly, other projects can promote a better understanding of the network, systems and security operations that may promote more efficient and accurate IR.&lt;/li&gt;&lt;/ul&gt;Disadvantages:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Conflicting priorities between IR and other projects.&lt;/li&gt;&lt;li&gt;More complex operating procedures.&lt;/li&gt;&lt;li&gt;Burn-out due to workload. (Yes, I listed burn-out as a disadvantage of both models).&lt;/li&gt;&lt;li&gt;Less specialization in IR will probably reduce effectiveness.&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;Staffing&lt;/span&gt;&lt;br /&gt;Before deciding on the number of analysts you need for NSM and IR, you have to come to a decision on what hours you will maintain. This question is probably easier for smaller operations that don't have as much flexibility. If there is no budget for anything other than normal business hours, it is definitely easier to staff IR and security operations in general. Once you get to an enterprise or other organization that maintains some 24x7 presence, it starts getting stickier.&lt;br /&gt;&lt;br /&gt;If you will have more than one shift, you will obviously have to decide the hours for each shift. It is important to build a slight overlap into the shifts so information can be passed from the shift that is ending to the shift that is starting. Both verbal and written communication, namely some kind of shift log, is important so any ongoing incidents, trends or other significant activity are not dropped. I will get into more detail when I write a future post, tentatively titled &lt;i&gt;Building an IR Team: Communication and Documentation&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;Organizing so each shift has the right people is significant. Obviously, the third shift will generally be seen as less desirable. Usually someone that is willing to work the third shift is trying to get into the digital security field, already has a day job, or is going to school. It is fine line between finding someone that will do a good job on the third shift but not immediately start looking for another job that has better hours, so you have to get a clear understanding of why people want to work the third shift and how long you expect them to stay on that shift. It can help to leave opportunities for third shift analysts to move to another shift since that can allow enough flexibility to keep the stand-outs rather than losing them to another job with more desirable hours.&lt;br /&gt;&lt;br /&gt;I am not a big fan of rotating shifts. Though a lot of places seem to implement shifts by having everyone eventually rotate through each shift, I think it does not promote stability or employee satisfaction as much as each person having a dedicated shift.&lt;br /&gt;&lt;br /&gt;Staffing can also be influenced by policy or outside factors. Businesses, government and military all will have certain information security requirements that must be met, and some of those requirements may influence your staffing levels or hours of operation.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Hierarchy&lt;/span&gt;&lt;br /&gt;If you only have one or two analysts, you probably won't need to put much thought into your hierarchy. If you have a 24x7 operation with a number of analysts, you definitely need some sort of defined hierarchy and escalation procedures to define NSM and IR duties. Going back to the section on other security operations, you may also need to define how other duties fit into the hierarchy, procedures and priorities for analysts that handle NSM, IR, and/or additional duties.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_-apeuUdIHjI/SkNlEEaur1I/AAAAAAAAAHU/tYecB0aqAnc/s1600-h/org-chart.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 399px; height: 400px;" src="http://4.bp.blogspot.com/_-apeuUdIHjI/SkNlEEaur1I/AAAAAAAAAHU/tYecB0aqAnc/s400/org-chart.png" alt="" id="BLOGGER_PHOTO_ID_5351231902826016594" border="0" /&gt;&lt;/a&gt;At left is an example of an organizational chart when the IR Team also has other duties and operates in a 24x7 environment. In addition to rotating through NSM and IR duties, each analyst is a member of a team. This is just an example to show the thought process on hierarchy. There are certainly other operational security needs that I mentioned, may merit a dedicated team, but are not included in my example, for instance forensics or vulnerability assessment.&lt;br /&gt;&lt;br /&gt;Each team has a senior analyst as the lead, and the senior analysts can also double as IR leads. It is crucial that every shift have a lead to define a hierarchy and prevent any misunderstandings about the chain of command and responsibilities.&lt;br /&gt;&lt;br /&gt;For this example, let us say that your organizational requirements state two junior analysts per shift doing NSM and IR. You could create a schedule to rotate each junior analyst through the NSM/IR schedule, which means monitoring the security systems, answering the phone, responding to emails, investigating activity, and coordinating IR for the more basic incidents. You would also probably want one senior analyst designated as the lead for the day. The senior analyst can provide quality assurance, handle anything that needs to be escalated, do more in-depth IR, and task and coordinate the junior analysts. The senior analyst can also decide that the NSM and IR workloads require temporarily pulling people off their project or team tasks to bolster NSM or IR. Finally, it may be a good idea to have the senior analyst designated as the one coordinating and communicating with management.&lt;br /&gt;&lt;br /&gt;While the senior analysts need to excel at both the technical duties and management, the shift leads need to facilitate communication between everyone on that particular shift, management, and other shifts. Though it is helpful if the shift lead is strong in a technical sense, I do not think the shift lead necessarily has to be the strongest technical person on the shift. He or she needs to be able to handle communication, escalation, delegation, and prioritization to keep both the shift members and management happy with each other. The shift lead is basically responsible for making sure the shift is happy and making sure the CIRT is getting what it needs from the shift.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_-apeuUdIHjI/SjvD0qAn42I/AAAAAAAAAHE/bwIB0A7tSlo/s1600-h/org-chart-simple.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 341px; height: 400px;" src="http://3.bp.blogspot.com/_-apeuUdIHjI/SjvD0qAn42I/AAAAAAAAAHE/bwIB0A7tSlo/s400/org-chart-simple.png" alt="" id="BLOGGER_PHOTO_ID_5349084291830113122" border="0" /&gt;&lt;/a&gt;The next diagram shows a group that is dedicated only to NSM and IR. Obviously, this model is much easier to organize and manage since the tasks are much narrower. Note that, even with this model where everyone is dedicated to NSM and IR without additional duties, proper NSM and IR may call for things like malware analysis, certainly forensics for IR, or giving feedback about the security systems' effectiveness to dedicated engineers.&lt;br /&gt;&lt;br /&gt;As one last aside regarding the different models, I have to stress that vulnerability assessment and reporting is one of the biggest time sinks I have ever seen in a security operation. If you can only separate one task away from your NSM and IR team to another team, I strongly suggest it be vulnerability assessment. There are certainly a lot of arguments about how much or how little vulnerability assessment you should be doing in any organization, but most organizations do have requirements for it. As such, it is a good idea to have a separate vulnerability assessment team whenever possible because of the number of work-hours the process requires. Note that penetration testing is clearly distinct from vulnerability assessment, and requires a whole different type of person with a different set of skills.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Redundancy&lt;/span&gt;&lt;br /&gt;Ideally, you want to minimize what some call "knowledge hoarding" on your team. If someone is excellent at a job, you need that person to share knowledge, not squirrel it away. Some think knowledge hoarding provides job security, but a good manager will recognize that an analyst that shares knowledge is much better than one that does not. From personal experience, I can also say that mentoring, training and sharing knowledge is a great way to reduce the number of calls you get during non-working hours. If I do not want to be bothered at home, I do my best to document and share everything I know so the knowledge is easily accessible even when I am not there.&lt;br /&gt;&lt;br /&gt;Sharing knowledge provides redundancy and flexibility. That flexibility can also spread the workload more evenly when you have some people swamped with work and others underutilized. If someone is sick or too busy for a particular task, you do not want to be stuck with no redundancy. I suppose this is true of most jobs, but it can be a huge problem in IR. As an example, if a particular person is experienced at malware analysis and has automated the process without sharing the knowledge, someone else called on to do the work in a pinch will be much less efficient and may even try to manually perform tasks that have already been automated.&lt;br /&gt;&lt;br /&gt;Certainly most groups of incident responders will have standouts that simply can't be replaced easily, but you should do your best to make sure every job function has redundancy and that every senior analyst has what you could call at least one understudy.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Distribution of Resources&lt;/span&gt;&lt;br /&gt;If you are in a business that has multiple locations or it is a true enterprise, one thing to consider is the physical and logical distribution of your incident response team. Being physically located in one place can be helpful to communication and working relationships. Being geographically distributed can be more conducive to work schedules if the business spans many timezones. One thing that can greatly increase morale is providing as many tools as possible to do remote IR. Sending a team to the field for IR may be needed sometimes, but reducing the burden or even allowing work from home is a sure way to make your team happier.&lt;br /&gt;&lt;br /&gt;Regardless, an IR team needs people in the field that can assist them when needed. Depending on the technical level of those field representatives, the duties may be as simple as unplugging a network cable or as advanced as starting initial data collection with a memory and disk capture. Most IR teams will need to have a good working relationship with support and networking personnel to help facilitate the proper response procedures.&lt;br /&gt;&lt;br /&gt;I only touched on some of the possibilities for organizing both NSM and IR teams. As with anything, thought and planning will help make the organization more successful and efficient. The key is to reach a practical equilibrium given the resources you have to work with.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-8069957067609911522?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/8069957067609911522/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2009/06/building-ir-team-organization.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/8069957067609911522'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/8069957067609911522'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2009/06/building-ir-team-organization.html' title='Building an IR Team: Organization'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_-apeuUdIHjI/SkNlEEaur1I/AAAAAAAAAHU/tYecB0aqAnc/s72-c/org-chart.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297187840164530151.post-5105854378076162506</id><published>2009-05-09T17:38:00.004-04:00</published><updated>2009-05-12T08:17:47.858-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='nsm'/><category scheme='http://www.blogger.com/atom/ns#' term='malware'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><category scheme='http://www.blogger.com/atom/ns#' term='sguil'/><title type='text'>Extracting emails from archived Sguil transcripts</title><content type='html'>Here is a Perl script I wrote to extract emails and attachments from archived Sguil transcripts. It's useful for grabbing suspicious attachments for analysis.&lt;br /&gt;&lt;br /&gt;In Sguil, whenever you view a transcript it will archive the packet capture on the Sguil server. You can then easily use that packet capture to pull out data with tools like tcpxtract or tcpflow along with Perl's MIME::Parser in this case. The MIME::Parser code is modified from &lt;a href="http://blog.vorant.com/2006/06/extracting-email-attachements-from.html" target="_blank"&gt;David Bianco's blog&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;As always with Perl or other scripts, I welcome constructive feedback. The first regular expression is fairly long and may scroll off the page, so make sure you get it all if you copy it.&lt;br /&gt;&lt;pre&gt;#!/usr/bin/perl&lt;br /&gt;&lt;br /&gt;# by nr&lt;br /&gt;#   2009-05-04&lt;br /&gt;# A perl script to read tcpflow output files of SMTP traffic.&lt;br /&gt;# Written to run against a pcap archived by Sguil after viewing the transcript.&lt;br /&gt;#   2009-05-07&lt;br /&gt;# Updated to use David Bianco's code with MIME::Parser.&lt;br /&gt;# http://blog.vorant.com/2006/06/extracting-email-attachements-from.html&lt;br /&gt;&lt;br /&gt;use strict;&lt;br /&gt;use MIME::Parser;&lt;br /&gt;&lt;br /&gt;my $fileName; # var for tcpflow output file that we need to read&lt;br /&gt;my $outputDir = "/var/tmp"; # directory for email+attachments output&lt;br /&gt;&lt;br /&gt;if (@ARGV != 1) {&lt;br /&gt;    print "\nOnly one argument allowed. Usage:\n";&lt;br /&gt;    die "./emailDecode.pl /path/archive/192.168.1.13\:62313_192.168.1.8\:25-6.raw\n\n";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$ARGV[0] =~ m&lt;br /&gt;    /.+\/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}):(\d{1,5})_(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}):(25)-\d{1,3}\.raw/&lt;br /&gt;    or die "\nIncorrect file name format or dst port is not equal to 25. Try again.\n\n";&lt;br /&gt;&lt;br /&gt;system("tcpflow -r $ARGV[0]"); # run tcpflow w/argument for path to sguil pcap&lt;br /&gt;&lt;br /&gt;my $srcPort = sprintf("%05d", $2); # pad srcPort with zeros&lt;br /&gt;my $dstPort = sprintf("%05d", $4); # pad dstPort with zeros&lt;br /&gt;&lt;br /&gt;# Put the octest and ports into array to manipulate into tcpflow fileName&lt;br /&gt;my @octet = split(/\./, "$1\." . "$srcPort\." . "$3\." . "$dstPort");&lt;br /&gt;&lt;br /&gt;foreach my $octet(@octet) {&lt;br /&gt;    my $octetLength = length($octet); # get string length&lt;br /&gt;    if ($octetLength &amp;lt; 5) { # if not a port number&lt;br /&gt;        $octet = sprintf("%03d", $octet); # pad with zeros&lt;br /&gt;    }&lt;br /&gt;    $fileName = $fileName . "$octet\."; # concatenate into fileName&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$fileName =~  s/(.+\d{5})\.(.+\d{5})\./$1-$2/; # replace middle dot with hyphen&lt;br /&gt;my $unusedFile = "$2-$1"; # this is the other tcpflow output file&lt;br /&gt;&lt;br /&gt;# open the file and put it in array&lt;br /&gt;open INFILE, "&amp;lt;$fileName" or die "Unable to open $fileName $!\n";&lt;br /&gt;my @email = &amp;lt;INFILE&amp;gt;;&lt;br /&gt;close INFILE;&lt;br /&gt;&lt;br /&gt;my $count = 0;&lt;br /&gt;# skip extra data at beginning&lt;br /&gt;foreach my $email(@email) {&lt;br /&gt;    if ($email =~ m/^Received:/i) {&lt;br /&gt;        last;&lt;br /&gt;    }&lt;br /&gt;    else {&lt;br /&gt;        delete @email[$count];&lt;br /&gt;        $count ++;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;my $parser = new MIME::Parser;&lt;br /&gt;$parser-&amp;gt;output_under("$outputDir");&lt;br /&gt;my $entity = $parser-&amp;gt;parse_data(\@email); # parse the tcpflow data&lt;br /&gt;$entity-&amp;gt;dump_skeleton; # be verbose when dumping&lt;br /&gt;&lt;br /&gt;unlink($fileName, $unusedFile); # delete tcpflow output files&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-5105854378076162506?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/5105854378076162506/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2009/05/extracting-emails-from-archived-sguil.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/5105854378076162506'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/5105854378076162506'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2009/05/extracting-emails-from-archived-sguil.html' title='Extracting emails from archived Sguil transcripts'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-4435241901201766399</id><published>2009-05-07T21:44:00.010-04:00</published><updated>2009-05-08T09:37:16.859-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='malware'/><category scheme='http://www.blogger.com/atom/ns#' term='risk'/><title type='text'>Do we need anti-virus software?</title><content type='html'>My friend Richard has &lt;a href="http://taosecurity.blogspot.com/2009/05/highlights-from-2009-verizon-data.html" target="_blank"&gt;a good post&lt;/a&gt; about &lt;a href="http://www.verizonbusiness.com/products/security/risk/databreach/" target="_blank"&gt;Verizon's&lt;/a&gt; &lt;a href="http://www.verizonbusiness.com/resources/security/reports/2009_databreach_rp.pdf"&gt;2009 Data Breach Report&lt;/a&gt;. One of his last comments really struck me since it is something I have seen firsthand again and again.&lt;br /&gt;&lt;blockquote&gt;Most companies are probably relying on their anti-virus software to save them. This is too bad, because the explosion in customized malware means it probably won't.&lt;/blockquote&gt;Anti-virus software just does not work against most recent malware. The table from the Verizon report shows a drastic upswing in customized malware and my experience tells me that doesn't tell half the story. Even only small changes will often evade anti-virus software.&lt;br /&gt;&lt;br /&gt;I'm not saying anything new here. Anyone that does penetration tests, reverse engineers malware, writes exploits, or is involved with information security in a number of ways already knows that anti-virus software is terrible at detecting new malware. I have even &lt;a href="http://eatingsecurity.blogspot.com/2008/04/defcon-16-race-to-zero.html" target="_blank"&gt;written&lt;/a&gt; about it before and &lt;a href="http://eatingsecurity.blogspot.com/2008/11/commodity-malware-versus-custom.html" target="_blank"&gt;pointed out that more subtle methods of exploitation aren't always necessary&lt;/a&gt; because of the effectiveness of commodity malware.&lt;br /&gt;&lt;br /&gt;My question is, do we really need anti-virus software?&lt;br /&gt;&lt;br /&gt;When you take into account the amount of resources spent running anti-virus in the enterprise, is it a good investment in risk reduction? We pay for hours worked to setup the anti-virus infrastructure, update, and troubleshoot. If you are in an enterprise, you're paying for the software, not using a free alternative. You're probably paying for support and also paying for hardware.&lt;br /&gt;&lt;br /&gt;What does it get you? I find malware on a weekly basis, sometimes daily, that is not detected by the major vendors. I submit the malware to some of these vendors and places like VirusTotal, but the responses from anti-virus vendors are inconsistent at best. Even after definitions are updated, I'll then run across malware that is obviously just an altered version of the previous but is once again not detected.&lt;br /&gt;&lt;br /&gt;I don't pretend to have the answers, but I do wonder if all the resources spent on anti-virus by a business, particularly large or enterprise businesses, might be better spent somewhere else. Is it really worth tens or hundreds of thousands of dollars in software, hours, and hardware to make sure old malware is detected? If not, how much is it worth? Does the occasional quick response to emerging malware make it more worthwhile? If you have enough influence on the vendor, does being able to contact them directly to help protect against a specific attack make it more valuable?&lt;br /&gt;&lt;br /&gt;Anti-virus software is too ingrained in corporate culture to think it is realistic that companies will stop using it altogether, but we need to keep asking these types of questions.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-4435241901201766399?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/4435241901201766399/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2009/05/do-we-need-anti-virus-software.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/4435241901201766399'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/4435241901201766399'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2009/05/do-we-need-anti-virus-software.html' title='Do we need anti-virus software?'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297187840164530151.post-7260771550356594177</id><published>2009-04-28T04:30:00.007-04:00</published><updated>2009-05-07T14:44:49.393-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='nsm'/><category scheme='http://www.blogger.com/atom/ns#' term='training'/><category scheme='http://www.blogger.com/atom/ns#' term='incident response'/><title type='text'>Building an IR Team: People</title><content type='html'>For some time I have been thinking about a series of posts about building an incident response team. I started in security as part of a very small Computer Incident Response Team (CIRT) that handled network security monitoring (NSM) and the ensuing security incidents. Although we were small, we had a very good core of people that helped us succeed and grow, probably well beyond anything we had imagined. We grew from a handful of people to four or five times our original size. While there were undoubtedly setbacks, we constantly got better and more efficient as the team grew.&lt;br /&gt;&lt;br /&gt;As the first in this series, I definitely want to concentrate on people. I don't care what fancy tools, enormous budget, buy-in from management, or whatever else you have. If you don't have the right people, you'll have serious problems succeeding. Most of this is probably not unique to a response team, information security, or information technology.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Hiring&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Of course, hiring is where it all starts. What do you look for in a candidate for an incident response team? Here are some of the things I look for.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Initiative: The last thing I want is someone that constantly needs hand-holding. Certainly people need help sometimes, and sharing knowledge and mentoring are huge, but you have to be able to work through the bumps and find solutions. A NSM operation or CIRT is not a help desk. Although you can have standard procedures, you have to be flexible, adapt, do a lot of research, and teach yourself whenever possible.&lt;/li&gt;&lt;li&gt;Drive: Most people who are successful in security seem to think of it as more than a job. They spend free time hacking away at tools, breaking things, fixing things, researching, reading, and more. I don't believe this kind of drive has to be all-consuming, because I certainly have plenty of outside interests. However, generally speaking there is plenty of time to be interested in information security outside of work while still having a life. I, and undoubtedly many successful security professionals, enjoy spending time reading, playing with new tools, and more. Finding this type of person is not actually difficult, but it can take some patience. Local security groups or mailing lists are examples of places to look for analysts to add to a team. Even if they have little work experience, by going to a group meeting or subscribing to mailing lists, they are already demonstrating some drive and initiative.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Communication skills: Although this may be more important for a senior analyst, being able to write and speak well is crucial. Knowing your audience is one of the most important skills. For instance, if you are writing a review of a recent incident that includes lessons learned, the end product will be different depending whether the review is for management or the incident responders on the team. Documentation, training, and reporting are other examples where good writing and speaking skills are important. I think good communication skills are underrated by many people in the field and IT in general, but the higher you look the better the chance you will find someone that realizes the importance of effective communication.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Background: Most of the successful NSM analysts and incident responders I know have a background in one or more of three core areas; networking, programming, or system administration. A person from each background will often have different strengths, so understanding the likely strengths of each background can go a long way toward filling a missing need on the team. You do not have to come from one of these backgrounds, it is just relatively common for the good analysts I know to have backgrounds in these areas.&lt;/li&gt;&lt;li&gt;The wrong candidate in the wrong position: Do not be scared to turn down people that are wrong for the job. That seems obvious, but it is worth emphasizing. Along the same lines, if someone is not working out, take steps to correct the problems if possible, but do not be afraid to get rid of a person that is not right for the job. Try to understand exactly what you are looking for and where in the organization the person is most likely to excel.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;Experience versus Potential&lt;/span&gt;&lt;br /&gt;When filling a senior position, experience is definitely important. However, when filling a junior position I think automatically giving a lot of weight to information security experience can be a mistake. The last thing I want to do is hire someone who has experience but is overly reliant on technology rather than critical thinking skills. I don't mean to denigrate or automatically discount junior analysts that have experience, I just mean that I'd rather have someone with a lot of potential that needs a little more training in the beginning than what some would call a "scope dope", someone whose experience is looking at IDS alerts and taking them at face value with little correlation or investigation. If you have both experience and potential, great!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Training&lt;/span&gt;&lt;br /&gt;Information security covers a huge range of topics, requires a wide range of skills, and changes quickly. Good analysts will want training, and if you don't give it to them you will wind up with a bunch of people that don't care about increasing their knowledge and skills as the ones that do want to learn look for greener pastures.&lt;br /&gt;&lt;br /&gt;There are many different types of training in addition to what most people think of first, which is usually formal classes. Senior analysts mentoring junior analysts can be one of the most useful types of training because it is very adaptable and can be very environment-specific. "Brown-bag" sessions where people get together over lunch and analyze a recent incident or learn how to more efficiently investigate incidents can also work well. Finally, when someone researches and learns new things on one's own or with coworkers as mentioned previously, that is also an excellent form of training. Load up a lab, attack it, and look at the traffic and resulting state of the systems.&lt;br /&gt;&lt;br /&gt;Finally, do not forget about both undergraduate and graduate degrees. Though you may not consider them training, most people want to have the option open to either finish a degree or get an advanced degree in their off hours. There are a huge number of ways to provide training.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;People versus Technology&lt;/span&gt;&lt;br /&gt;Analysts are not the only ones that can overly rely on technology. Management will often take the stance that paying a bunch of money for tools and subscriptions means two things. One, that the systems must be what they need and will do all the work for them. Two, that the money means that the selling company has the systems optimally designed and configured for your environment. Just because you pay five or six digits for an IPS, IDS, anomaly detection, or forensics tools does not mean that you can presume a corresponding decrease in the amount you need to spend on people. Any tool is worthless without the right people using it.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Turnover, Retention, Mobility, and Having Fun&lt;/span&gt;&lt;br /&gt;Creating and continuing a successful response team is to make sure the people you want to keep remain happy. There are a lot of things you need to retain the right people, including competitive pay, decent benefits, a chance for promotion, and a good work environment. Honestly, I think work environment is probably the most important factor. I know many analysts I have worked with receive offers of more money, but a good work environment has usually kept them from leaving. My boss has always said that the right environment is worth $X dollars to him, and I feel the same way. Effective and enjoyable coworkers, management that listens, and all the little things are not worth giving up without substantial reasons. Some opportunities are impossible to pass up, but having an enjoyable work environment and management that "gets it" goes a long way towards reducing turnover.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Bottom Line&lt;/span&gt;&lt;br /&gt;I believe getting a good group assembled is the most important thing to have an effective response team. Obviously, I kept the focus of this post relatively broad. I would love to see comments with additional input. I hope to post additional material about building a response team in the near future, possibly covering organizing the team, dealing with growth, and a few other topics.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-7260771550356594177?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/7260771550356594177/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2009/04/building-ir-team-people.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/7260771550356594177'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/7260771550356594177'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2009/04/building-ir-team-people.html' title='Building an IR Team: People'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-4099118972292440640</id><published>2009-04-10T05:18:00.004-04:00</published><updated>2009-04-14T22:32:12.594-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='snort'/><category scheme='http://www.blogger.com/atom/ns#' term='ids'/><title type='text'>Upgrading to Snort 2.8.4</title><content type='html'>Hopefully, everyone running Snort has been &lt;a href="http://vrt-sourcefire.blogspot.com/2009/04/snort-284-is-nigh.html" target="_blank"&gt;paying attention&lt;/a&gt; and noticed that &lt;a href="http://www.snort.org/pub-bin/snortnews.cgi#864" target="_blank"&gt;Snort 2.8.4&lt;/a&gt; was released on 07 April and the corresponding &lt;a href="http://www.snort.org/pub-bin/snortnews.cgi#865" target="_blank"&gt;new rule sets&lt;/a&gt; were released on 08 April. If you pay for Snort rules, the new netbios.rules will not work with Snort versions prior to 2.8.4, so you need to upgrade.&lt;br /&gt;&lt;br /&gt;Upgrading was mostly painless just to get Snort running, though the dcerpc2 preprocessor settings definitely may require tweaking beyond the defaults. Generally, when I'm upgrading and there is something like a new preprocessor, I will start by getting Snort upgraded and successfully running with the defaults for the preprocessor, then will tune the settings as needed after I'm sure the new version is working.&lt;br /&gt;&lt;br /&gt;The first thing to do after downloading and extracting is read the RELEASENOTES and also any applicable READMEs. Since the dcerpc2 preprocessor is new, the README.dcerpc2 may be of particular interest. A lot of people don't realize how much documentation is included.&lt;br /&gt;&lt;pre&gt;$ wget http://www.snort.org/dl/snort-2.8.4.tar.gz&lt;br /&gt;$ tar xzf snort-2.8.4.tar.gz&lt;br /&gt;$ cd snort-2.8.4/doc&lt;br /&gt;$ ls&lt;br /&gt;AUTHORS               README.alert_order            README.ppm&lt;br /&gt;BUGS                  README.asn1                   README.sfportscan&lt;br /&gt;CREDITS               README.csv                    README.ssh&lt;br /&gt;INSTALL               README.database               README.ssl&lt;br /&gt;Makefile.am           README.dcerpc                 README.stream5&lt;br /&gt;Makefile.in           README.dcerpc2                README.tag&lt;br /&gt;NEWS                  README.decode*                README.thresholding&lt;br /&gt;PROBLEMS              README.decoder_preproc_rules  README.variables&lt;br /&gt;README                README.dns                    README.wireless&lt;br /&gt;README.ARUBA          README.event_queue            TODO&lt;br /&gt;README.FLEXRESP       README.flowbits               USAGE&lt;br /&gt;README.FLEXRESP2      README.frag3                  WISHLIST&lt;br /&gt;README.INLINE         README.ftptelnet              faq.pdf&lt;br /&gt;README.PLUGINS        README.gre                    faq.tex&lt;br /&gt;README.PerfProfiling  README.http_inspect           generators&lt;br /&gt;README.SMTP           README.ipip                   snort_manual.pdf&lt;br /&gt;README.UNSOCK         README.ipv6                   snort_manual.tex&lt;br /&gt;README.WIN32          README.pcap_readmode          snort_schema_v106.pdf&lt;/pre&gt;The following is the default configuration as listed in the README.dcerpc2.&lt;br /&gt;&lt;pre&gt;preprocessor dcerpc2_server: default, policy WinXP, \&lt;br /&gt;     detect [smb [139,445], tcp 135, udp 135, rpc-over-http-server 593], \&lt;br /&gt;     autodetect [tcp 1025:, udp 1025:, rpc-over-http-server 1025:], \&lt;br /&gt;     smb_max_chain 3&lt;/pre&gt;For some environments, it may be useful to turn off the preprocessor alerts or turn them off for specific systems.&lt;br /&gt;&lt;pre&gt;preprocessor dcerpc2: memcap 102400, events none&lt;/pre&gt;Or:&lt;br /&gt;&lt;pre&gt;preprocessor dcerpc2_server: default, policy WinXP, \&lt;br /&gt;     detect [smb [139,445], tcp 135, udp 135, rpc-over-http-server 593], \&lt;br /&gt;     autodetect [tcp 1025:, udp 1025:, rpc-over-http-server 1025:], \&lt;br /&gt;     smb_max_chain 3&lt;br /&gt;preprocessor dcerpc2_server: net $SCANNERS, detect none&lt;/pre&gt;No matter what, the dcerpc configuration should be removed from the snort.conf and replaced with a dcerpc2 configuration for Snort 2.8.4.&lt;br /&gt;&lt;br /&gt;After that, I'll configure and install Snort.&lt;br /&gt;&lt;pre&gt;$  ./configure --enable-dynamicplugin --enable-inline --enable-perfprofiling&lt;br /&gt;$ make&lt;br /&gt;$ sudo /etc/rc.d/rc.snort-inline stop&lt;br /&gt;$ sudo make install&lt;br /&gt;$ which snort&lt;br /&gt;/usr/local/bin/snort&lt;br /&gt;$ snort -V&lt;br /&gt;&lt;br /&gt;      ,,_     -*&gt; Snort! &lt;*-&lt;br /&gt;     o"  )~   Version 2.8.4 (Build 26) inline&lt;br /&gt;      ''''    By Martin Roesch &amp;amp; The Snort Team: http://www.snort.org/team.html&lt;br /&gt;              Copyright (C) 1998-2009 Sourcefire, Inc., et al.              &lt;br /&gt;              Using PCRE version: 7.7 2008-05-07      &lt;br /&gt;&lt;br /&gt;$ sudo /etc/rc.d/rc.snort-inline start    &lt;br /&gt;Starting snort-inline    &lt;br /&gt;Initializing Inline mode    &lt;br /&gt;building cached socket reset packets&lt;/pre&gt;Although the old netbios.rules will still work with the new version, it's also time to &lt;a href="http://vrt-sourcefire.blogspot.com/2009/04/rule-release-for-today-april-8th-2009.html" target="_blank"&gt;update to the latest rules&lt;/a&gt; to take advantage of the smaller number of netbios.rules. Note that this only applies for subscription rules since the free ones won't reflect the changes for 30 days.&lt;br /&gt;&lt;br /&gt;Some of the rules in the new netbios.rules file have SIDs that were unchanged, so I decided to re-enable any of those that I had previously disabled in my oinkmaster.conf. I can always disable them again, but with the new preprocessor and possible changes to the remaining SIDs, I decided it was best to reevaluate them.&lt;br /&gt;&lt;br /&gt;Since I'm also using precompiled &lt;a href="http://eatingsecurity.blogspot.com/2008/10/snort-shared-object-rules-with-sguil.html" target="_blank"&gt;shared object rules&lt;/a&gt;, I also update from the ones compiled for 2.8.3.2 to the ones compiled for 2.8.4. I keep the rule stubs in a directory along with symlinks to the corresponding SO files, so I simply remove the symlink and recreate it to the new SO rules.&lt;br /&gt;&lt;pre&gt;$ rm /etc/snort/so_rules/*so&lt;br /&gt;$ ln -s /etc/snort/so_rules/precompiled/CentOS-5.0/i386/2.8.4/*so /etc/snort/so_rules/&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-4099118972292440640?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/4099118972292440640/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2009/04/upgrading-to-snort-284.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/4099118972292440640'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/4099118972292440640'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2009/04/upgrading-to-snort-284.html' title='Upgrading to Snort 2.8.4'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-7086204317539308432</id><published>2009-04-09T04:30:00.004-04:00</published><updated>2009-05-10T00:07:48.089-04:00</updated><title type='text'>Watching the watchers</title><content type='html'>The &lt;span style="font-style: italic;"&gt;Washington Post&lt;/span&gt; had an article on the Federal Page about &lt;a href="http://www.washingtonpost.com/wp-dyn/content/article/2009/04/08/AR2009040803841_pf.html" target="_blank"&gt;falsified security clearance checks&lt;/a&gt;.&lt;br /&gt;&lt;blockquote&gt;Half a dozen investigators conducting security-clearance checks for the federal government have been accused of lying in the reports they submitted to the Office of Personnel Management, which handles about 90 percent of the background inquiries for more than 100 agencies.  &lt;p&gt;Federal authorities said they do not think that anyone who did not deserve a job or security clearance received one or that investigators intentionally helped people slip through the screening. Instead, law enforcement officials said, the investigators lied about interviews they never conducted because they were overworked, cutting corners, trying to impress their bosses or, in the case of one contractor, seeking to earn more money by racing through the checks. &lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;This is not particularly surprising, especially when you consider that the article reports a 22 percent increase in security checks since 2006. Presumably, the personnel and budget allocations did not get a corresponding 22 percent increase. Even before 2006, there were &lt;a href="http://www.govexec.com/story_page_pf.cfm?articleid=28604&amp;amp;printerfriendlyvers=1" target="_blank"&gt;plenty of reports&lt;/a&gt; about the backlog for security investigations. Factor in the increase in investigations and you have a situation ripe for abuse through shortcuts.&lt;br /&gt;&lt;br /&gt;The problem shows the importance of management and quality assurance. Through the fairly simple process of sending follow-up questionnaires to 20 percent of those that were interviewed, OPM was able to identify falsified interviews and investigations. GAO also has determined that 90 percent of a sampling of reports were missing at least one required document. These seem like fairly easy and accurate ways to determine whether the investigations were being completed properly.&lt;br /&gt;&lt;br /&gt;Fixing the problem is another matter, but you can't fix a problem until you've identified it. Prosecuting the responsible investigators, reviewing allocation of funds and personnel, and changing compensation structure are all just a few things that may help reduce the amount of fraud.&lt;br /&gt;&lt;br /&gt;The personnel problem immediately jumps out when you see the numbers in the article, which lists 1380 staff investigators and 5400 contractors doing 2 million investigations last year. You have to assume that even the most basic clearance requires a minimum of a credit check, criminal background check, employment history check, and some type of interview. I don't know how 292 investigations per investigator per year could possibly be exhaustive enough to provide the needed information.&lt;br /&gt;&lt;br /&gt;It also seems to demonstrate that the number of people requiring clearances is excessive, which is really a whole different discussion.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-7086204317539308432?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/7086204317539308432/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2009/04/watching-watchers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/7086204317539308432'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/7086204317539308432'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2009/04/watching-watchers.html' title='Watching the watchers'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-8819169393994534354</id><published>2009-03-26T05:23:00.003-04:00</published><updated>2009-03-26T17:13:22.725-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='system administration'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='slackware'/><title type='text'>Slackware-current updates and Nvidia driver</title><content type='html'>I recently updated a desktop running Slackware-current to the latest packages released up to 24-Mar-2009. There were a few minor issues. The first is that, if using slackpkg to upgrade, I had to upgrade the findutils package before everything else or slackpkg would no longer work properly.&lt;br /&gt;&lt;pre&gt;# slackpkg update&lt;br /&gt;# slackpkg upgrade findutils&lt;br /&gt;# slackpkg upgrade-all&lt;/pre&gt;The second was that I couldn't install the Nvidia driver for the new 2.6.28.8 kernel package because it was failing.&lt;br /&gt;&lt;pre&gt;ERROR: The 'cc' sanity check failed:&lt;br /&gt;&lt;br /&gt;   The C compiler 'cc' does not appear able to&lt;br /&gt;   create executables. Please make sure you have&lt;br /&gt;   your Linux distribution's gcc and libc development&lt;br /&gt;   packages installed.&lt;/pre&gt;It turns out that gcc-4.3.3 in slackware-current depends on mpfr.&lt;br /&gt;&lt;pre&gt;# slackpkg info mpfr&lt;br /&gt;&lt;br /&gt;PACKAGE NAME:  mpfr-2.3.1-i486-1.tgz&lt;br /&gt;PACKAGE LOCATION:  ./slackware/l&lt;br /&gt;PACKAGE SIZE (compressed):  348 K&lt;br /&gt;PACKAGE SIZE (uncompressed):  930 K&lt;br /&gt;PACKAGE DESCRIPTION:&lt;br /&gt;mpfr: mpfr (Multiple-Precision Floating-Point Reliable Library)&lt;br /&gt;mpfr:&lt;br /&gt;mpfr: The MPFR library is a C library for multiple-precision floating-point&lt;br /&gt;mpfr: computations with exact rounding (also called correct rounding).&lt;br /&gt;mpfr: It is based on the GMP multiple-precision library.&lt;br /&gt;mpfr: The main goal of MPFR is to provide a library for multiple-precision&lt;br /&gt;mpfr: floating-point computation which is both efficient and has&lt;br /&gt;mpfr: well-defined semantics.  It copies the good ideas from the&lt;br /&gt;mpfr: ANSI/IEEE-754 standard for double-precision floating-point arithmetic&lt;br /&gt;mpfr: (53-bit mantissa).&lt;br /&gt;mpfr:&lt;br /&gt;&lt;br /&gt;# slackpkg install mpfr&lt;/pre&gt;After installing mpfr, I was able to compile the Nvidia module for the running kernel.&lt;br /&gt;&lt;br /&gt;Finally, kdeinit4 was failing with an error about loading the libstreamanalyzer.so.0 and libqimageblitz.so shared libraries. I fixed this by installing strigi and qimageblitz.&lt;br /&gt;&lt;pre&gt;# slackpkg info strigi&lt;br /&gt;&lt;br /&gt;PACKAGE NAME:  strigi-0.6.3-i486-1.tgz&lt;br /&gt;PACKAGE LOCATION:  ./slackware/l&lt;br /&gt;PACKAGE SIZE (compressed):  904 K&lt;br /&gt;PACKAGE SIZE (uncompressed):  2570 K&lt;br /&gt;PACKAGE DESCRIPTION:&lt;br /&gt;strigi: strigi (fast and light desktop search engine)&lt;br /&gt;strigi:&lt;br /&gt;strigi: Strigi is a fast and light desktop search engine.  It can handle a&lt;br /&gt;strigi: large range of file formats such as emails, office documents, media&lt;br /&gt;strigi: files, and file archives.  It can index files that are embedded in&lt;br /&gt;strigi: other files.  This means email attachments and files in zip files&lt;br /&gt;strigi: are searchable as if they were normal files on your harddisk.&lt;br /&gt;strigi:&lt;br /&gt;strigi: Homepage:  http://strigi.sourceforge.net/&lt;br /&gt;strigi:&lt;br /&gt;&lt;br /&gt;# slackpkg info qimageblitz&lt;br /&gt;&lt;br /&gt;PACKAGE NAME:  qimageblitz-r900905-i486-1.tgz&lt;br /&gt;PACKAGE LOCATION:  ./slackware/l&lt;br /&gt;PACKAGE SIZE (compressed):  82 K&lt;br /&gt;PACKAGE SIZE (uncompressed):  240 K&lt;br /&gt;PACKAGE DESCRIPTION:&lt;br /&gt;qimageblitz: QImageBlitz (Graphical effect and filter library for KDE4)&lt;br /&gt;qimageblitz:&lt;br /&gt;qimageblitz: Blitz is a graphical effect and filter library for KDE4.0 that&lt;br /&gt;qimageblitz: contains many improvements over KDE 3.x's kdefx library&lt;br /&gt;qimageblitz: including bugfixes, memory and speed improvements, and MMX/SSE&lt;br /&gt;qimageblitz: support.&lt;br /&gt;qimageblitz:&lt;br /&gt;&lt;br /&gt;# slackpkg install strigi qimageblitz&lt;/pre&gt;After those minor issues, I had KDE4 up and running with the latest Nvidia driver.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-8819169393994534354?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/8819169393994534354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2009/03/slackware-current-updates-and-nvidia.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/8819169393994534354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/8819169393994534354'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2009/03/slackware-current-updates-and-nvidia.html' title='Slackware-current updates and Nvidia driver'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-9056150393564250442</id><published>2009-02-12T04:01:00.002-05:00</published><updated>2009-02-12T06:12:56.168-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='snort'/><title type='text'>Snort 2.8.4 has a new DCE/RPC preprocessor</title><content type='html'>According to the &lt;a href="http://vrt-sourcefire.blogspot.com/"&gt;VRT blog&lt;/a&gt;, Snort 2.8.4 is going to have a &lt;a href="http://vrt-sourcefire.blogspot.com/2009/02/important-snort-rule-changes-and-new.html"&gt;new DCE/RPC 2 preprocessor&lt;/a&gt;. The &lt;a href="http://marc.info/?l=snort-users&amp;amp;m=123436537117895&amp;amp;w=2"&gt;README.dcerpc2&lt;/a&gt; was not included in the first release candidate for 2.8.4, but a follow-up on the snort-users list included &lt;a href="http://marc.info/?l=snort-users&amp;amp;m=123436537117895&amp;amp;q=p3"&gt;it&lt;/a&gt;. The README covers a lot of information, and is definitely useful to understand the changes and configuration options.&lt;br /&gt;&lt;br /&gt;These changes look to be an improvement, but they also have the potential to cause a lot of work and heartache in the short term for Emerging Threats and Snort users. From the VRT blog:&lt;br /&gt;&lt;blockquote&gt;This preprocessor handles all the decoding functions that were previously taken care of using rules and flowbits in a lot of those rules. The upshot is that the number of netbios rules released for any vulnerability that can be exploited over dcerpc is going to be reduced greatly. The number of netbios rules previously released is also going to be reduced in a similar manner.&lt;br /&gt;&lt;br /&gt;The downside is that this functionality is only available in Snort 2.8.4 with the dcerpc2 preprocessor. There is no backwards compatibility. Also, a number of netbios rules will be deleted and replaced.&lt;/blockquote&gt;Snort users are going to have to make sure to properly configure the new version. I know from the snort-users mailing list that far too many people use old versions of Snort, so this causes them problems. Realistically, there is usually no reason to use older versions rather than the latest stable release.&lt;br /&gt;&lt;br /&gt;Emerging Threats distributes quite a few NetBIOS rules, so I'm sure the new preprocessor will also have an effect on Emerging Threats rules. I seriously doubt that either VRT or Emerging Threats wants to maintain a set of rules for 2.8.4 and above, plus another set for older versions. If I'm interpreting Nigel's blog post correctly, it seems that VRT is going to force the issue by only issuing new and updated NetBIOS rules for 2.8.4 and above. Assuming the improvements in the preprocessor are as stated, I think that is the right choice, but lots of users are going to complain.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-9056150393564250442?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/9056150393564250442/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2009/02/snort-284-has-new-dcerpc-preprocessor.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/9056150393564250442'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/9056150393564250442'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2009/02/snort-284-has-new-dcerpc-preprocessor.html' title='Snort 2.8.4 has a new DCE/RPC preprocessor'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-2838388808606334753</id><published>2009-02-08T16:09:00.022-05:00</published><updated>2009-02-12T21:33:23.719-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='shmoocon'/><category scheme='http://www.blogger.com/atom/ns#' term='technology'/><category scheme='http://www.blogger.com/atom/ns#' term='exploits'/><category scheme='http://www.blogger.com/atom/ns#' term='wireless'/><title type='text'>Shmoocon 2009 Notes</title><content type='html'>I attended &lt;a href="http://shmoocon.org/"&gt;Shmoocon V&lt;/a&gt; over the weekend and had a good time as usual. There are always interesting people, the usual suspects, and some good talks. I think Shmoocon is still a great conference for the money. The bags given to attendees this year were by far the best of the four years I've been. There were some very good entries to the &lt;a href="http://shmoocon.org/barcode.html"&gt;Barcode Shmarcode&lt;/a&gt; contest and I also saw some entertaining runs through the lockpick contest.&lt;br /&gt;&lt;br /&gt;These notes do not include every time slot.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Friday&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1500: &lt;/span&gt;Bruce Potter started the con with his opening remarks. He said that Shmoocon added around 500 tickets this year, bringing the total number of attendees above 1600. To have enough space, they had to add another room down the hall from the main area. The satellite room was out of sight of the main area, but not too difficult to find. Potter said that moving to the next larger space available instead of adding the one room would have been overkill and cost too much for the number of attendees.&lt;br /&gt;&lt;br /&gt;One of the things I really like about Shmoocon is their involvement in charities. As usual, tshirt proceeds went to charities, in this case the buyer's choice between the &lt;a href="http://www.eff.org/"&gt;EFF&lt;/a&gt; and Johnny Long's &lt;a href="http://ihackcharities.org/HFC/Hackers_For_Charity.html"&gt;Hackers for Charity&lt;/a&gt;. Shmoocon also had a raffle with proceeds going to &lt;a href="http://www.covenanthouse.org/"&gt;Covenant House&lt;/a&gt;, as did the proceeds from the &lt;a href="http://shmoocon.org/arcade.html"&gt;Hacker Arcade&lt;/a&gt;. It is nice to see Bruce and other Shmoocon organizers promoting charity among their peers.&lt;br /&gt;&lt;br /&gt;Potter often will make a small comparison between Shmoocon and other conferences, and this year he mentioned other conferences charging large amounts for training. Conversely, at Shmoocon if you want to learn something in a non-classroom environment, you can try to participate in Shmoocon &lt;a href="http://shmoocon.org/labs.html"&gt;Labs&lt;/a&gt; to help build a functional enterprise-like environment rather than just slapping together a simple wireless network. As an example, this year they had an open wireless network, a WPA-enabled wireless network, and third using RADIUS. All attendees are welcome to walk through the room serving as their NOC and ask questions.&lt;br /&gt;&lt;br /&gt;I really like The Shmoo Group's philosophy when it comes to running a conference. They try to be very transparent and take feedback, don't overcharge, and just generally want everyone to have a great time while still providing good technical content. It's a really attendee-friendly conference, right down to the &lt;a href="http://shmoocon.org/presentations-all.html#0wn"&gt;0wn the Con&lt;/a&gt; talk near the end.&lt;br /&gt;&lt;br /&gt;Finally, Potter went on a rant about how security isn't working. Nothing to see here, move along. ;)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1600: &lt;/span&gt;The first technical talk I heard was Matt Davis and Ethan O'Toole presenting &lt;a href="http://shmoocon.org/presentations-all.html#openvulture"&gt;Open Vulture - Scavenging the Friendly Skies Open Source UAV Platform&lt;/a&gt;. Open Vulture is a software application and library designed to control unmanned vehicles. It was a neat talk though not a topic I know much about. Some of the possible uses for this would be controlling an unmanned vehicle to sniff wireless networks or take photos. They even have a GPS navigation module.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Saturday&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Saturday is always the meat of the conference since it is the only full day and most people haven't been there long enough for the late nights to catch up to them.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1000: &lt;/span&gt;I enjoyed &lt;a href="http://www.matthewneely.com/"&gt;Matt Neely&lt;/a&gt;'s presentation, &lt;a href="http://shmoocon.org/presentations-all.html#radiorecon"&gt;Radio Reconnaisance in Penetration Testing&lt;/a&gt;. Matt had a lot of practical advice for radio reconnaisance, including recommending some relatively inexpensive hand-held scanners, the &lt;a href="http://www.aorusa.com/hand.html"&gt;AOR 8200&lt;/a&gt;, Uniden Bearcat  &lt;a href="http://www.uniden.com/products/productdetail.cfm?product=BCD396T"&gt;BCD396T&lt;/a&gt;, and the Uniden Bearcat &lt;a href="http://www.uniden.com/products/productdetail.cfm?product=SC230"&gt;SC230&lt;/a&gt;, which also happens to be a good choice for NASCAR. He pointed out what features to look for in scanners, for example channel memory.&lt;br /&gt;&lt;br /&gt;His anecdotes from penetration tests included sniffing wireless headsets from blocks away, even when the phone is hung up. Apparently, many wireless headsets transmit constantly even if on the cradle, effectively functioning like a bug for eavesdropping. He has also used video converters when sniffing video.&lt;br /&gt;&lt;br /&gt;When testing a client's casino, he visually scouted the location to help identify their hand-held radios, and then was able to get information from casino security through their radio communications, including their radio link to the police. He got a ton of information useful for social engineering and more, like guard names, the dispatcher's name, times of shift changes, and the lingo used by the guards.&lt;br /&gt;&lt;br /&gt;At another client site, he noticed people using wireless headsets and got those added to the rules of engagement. Once they were added, he was able to eavesdrop on calls to the help desk for password resets, people calling their voicemail, and found that the headsets would keep transmitting even when the phone was hung up. Matt was able to get passwords, voicemail passwords, and assorted Personally Identifiable Information (PII) that was sensitive or could be used for social engineering. Rules of engagement and adhering to applicable laws are very important if you don't want to end up in jail after eavesdropping on voice communications.&lt;br /&gt;&lt;br /&gt;I also talked to Neely the next day regarding learning about RF for a personal project I am interested in. He was very helpful and nice, just like most Shmoocon presenters I've ever spoken with. Hopefully, I will have time to start learning more about RF and playing around with it for a "fun" project.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1100:&lt;/span&gt; Next, I attended &lt;a href="http://shmoocon.org/presentations-all.html#fail2"&gt;Fail 2.0: Further Musings on Attacking Social Networks&lt;/a&gt; presented by &lt;a href="http://www.linkedin.com/pub/2/198/200"&gt;Nathan Hamiel&lt;/a&gt; and &lt;a href="http://www.linkedin.com/in/shawnmoyer"&gt;Shawn Moyer&lt;/a&gt;. Their talk was fun and definitely relevant. Their main focus was that "social engineering + vulnerabilities in social networks = ROI". They pointed out a number of ways to manipulate various social networking sites, including malicious code like IMG to CSRF, CSS javascript hijacking, and request forgeries (POST to GET).&lt;br /&gt;&lt;br /&gt;One good anecdote was getting permission from &lt;a href="http://www.ranum.com/"&gt;Marcus Ranum&lt;/a&gt; to make a phony profile in his name and then using it to socially engineer others, particularly security professionals, on a social networking site. They actually got Ranum's sister to attempt to contact them through the phony profile.&lt;br /&gt;&lt;br /&gt;Hamiel and Moyer demonstrated technical tricks to force someone to "friend" you and also posting a comment with code that will force the user to log out, effectively denial-of-servicing the person off his or her own profile. They also told anecdotes about posing as a recruiter, joining groups on LinkedIn so they could more easily build up a lot of connections, then looking for candidates with government security clearances and getting many responses to their inquiries.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1400: &lt;/span&gt;I skipped the 1200 talks to have a long lunch with some friends, then attended Jay Beale's &lt;a href="http://shmoocon.org/presentations-all.html#mitm"&gt;Man in the Middling Everything with the Middler&lt;/a&gt;. The talk had a very slow start because of audience interaction, particularly involving &lt;a href="http://shmoocon.org/presentations-all.html#shmooball"&gt;Shmooballs and launchers&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Jay Beale's &lt;a href="http://www.inguardians.com/"&gt;Middler&lt;/a&gt; is a tool to help leverage man-in-the-middle attacks, including injecting javascript, temporary or permanent redirects, session hijacking, and more. It seems like a neat tool and was released to the public at his talk. Jay pointed out some dangers of mixed HTTP and HTTPS sites and their vulnerabilities to things like injected javascript, stored session keys, intercepted logout requests, and replacing HTTPS links in proxied pages with HTTP links. Although the Middler has some specific support right now for attacking social networking sites and wide area sites like Google/GMail and live.com, it uses a plugin architecture so we should expect to see more plugins targeting specific sites.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1600: &lt;/span&gt;I had heard a good talk &lt;a href="http://eatingsecurity.blogspot.com/2008/02/shmoocon-2008-notes.html"&gt;last year&lt;/a&gt; by Enno Rey and Daniel Mende, and combined with my focus on network security monitoring I definitely was interested in their presentation this year, &lt;a href="http://shmoocon.org/presentations-all.html#packets"&gt;Attacking backbone technologies&lt;/a&gt;. Their main focuses this year were BGP, MPLS, and Carrier Internet, one example of the latter being Carrier Ethernet. They were careful to point out that you really have to be part of the "old boys club" of trusted backbone providers to successfully use most of their attacks and that not just anyone would have enough access to core backbones to download their tools and use them for successful penetration testing or attacks.&lt;br /&gt;&lt;br /&gt;For BGP, they mentioned that it is mostly manually configured, thus making it susceptible to simple mistakes like the &lt;a href="http://lists.ucc.gu.uwa.edu.au/pipermail/lore/2006-August/000040.html"&gt;famed&lt;/a&gt; &lt;a href="http://www.merit.edu/mail.archives/nanog/1997-04/msg00444.html"&gt;AS7007&lt;/a&gt; incident or the &lt;a href="http://www.circleid.com/posts/82258_pakistan_hijacks_youtube_closer_look/"&gt;Youtube/Pakistan&lt;/a&gt; blocking incident. Rey and Mende also did a live demonstration using their "bgp_cli" tool to inject routes, and demonstrated how a single BGP packet signed with MD5 can be used to crack rather than brute forcing directly against a router that limits the number of attempts per second.&lt;br /&gt;&lt;br /&gt;Multiprotocol Label Switching (MPLS) is deployed on carrier backbones and uses a trusted core assumption while attacks from outside the core are not possible. Rey and Mende demonstrated their "mpls_redirect" tool to modify MPLS Layer 3 VPN labels and redirect traffic. This is possible in part because of trusting carrier insiders and can be used to send traffic to different customer networks. Rey had a great line where we called it "branching" the traffic because he was told, due to his thick German accent, he should not use the word "forked" (or "fokt" as it sounded when he said it).&lt;br /&gt;&lt;br /&gt;These two definitely are in a position to test the security of major providers from an insider perspective, which is not the norm, and they do a good job explaining some of the issues they find.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1700: &lt;/span&gt;David Kennedy's &lt;a href="http://shmoocon.org/presentations-all.html#fasttrack"&gt;Fast-Track Suite: Advanced Penetration Techniques Made Easy&lt;/a&gt; was probably the most crowded presentation I attended. One suggestion I have for getting a good seat at Shmoocon is to plan your schedule ahead and note the presentations that are likely to be crowded. If you are not changing rooms, do not get up and lose your seat, because rooms definitely end up standing room only sometimes.&lt;br /&gt;&lt;br /&gt;Kennedy was a good presenter. When you have fun on the podium, it definitely shows and keeps everyone attentive. He had a lot of audience participation as he showed a slide and said "Let's Pop a Box" each time before he used &lt;a href="http://www.thepentest.com/"&gt;Fast-Track&lt;/a&gt; to own a system. When he started to forget "Let's Pop a Box," someone from the audience would invariably ask him if he forgot something or shout "Pop a Box!" as Kennedy did a &lt;a href="http://en.wikipedia.org/wiki/Face_palm#Facepalm"&gt;face-palm&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Fast-Track itself is obviously pretty neat. He showed a variety of automated attacks against different targets that most often ended with a reverse shell back or reverse VNC back to his attacking system. He also talked about his evasion technique using Windows debug to download his stager, which is actually just a version of Windows debug without the 64k size limit.&lt;br /&gt;&lt;br /&gt;Fast-Track 4.0 includes some new features like logging and payload conversion so you can load your own payloads to deliver. Although Fast-Track has a smaller list of exploits than Metasploit, Kennedy said that he strives to make them available across as many OS versions as possible. Version 4.0 also includes a mass client attack using ARP poisoning combined with emailed links to targets. The malicious page will display a generic "loading please wait..." message as it launches a multitude of attacks, but Kennedy said that 4.1 will also include browser profiling for more targeted exploits. One really nice feature is the auto-update to update a multitude of tools included in Fast-Track. Although I didn't look into it yet, I did wonder if it had any SNMP attacks and I think a SNMP auto-own attack would be a neat and not too complicated addition if it's not there yet.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Sunday&lt;br /&gt;&lt;br /&gt;1000: &lt;/span&gt;&lt;span&gt;I really feel for anyone in this time slot. After a weekend of hacking and partying, the number of people in any room is much smaller than the number of people at 1000 on Saturday. The numbers increase as people drag themselves into the talks through the hour.&lt;br /&gt;&lt;br /&gt;I attended &lt;a href="http://shmoocon.org/presentations-all.html#blindsql"&gt;Re-Playing with (Blind) SQL Injection&lt;/a&gt; by Chema Alonso and Palako during this hour. I was starting to think I made the wrong choice because they started off slow and quite dry, but maybe they were included in the ones recovering from the previous night's festivities. By the second half, they started to have a little fun and had some funny moments, including a slide with, "Yes, we can!" Another funny moment was when they found a database username length of two and referred to it as "the most famous Microsoft SQL user..."&lt;br /&gt;&lt;br /&gt;Although we've all probably seen or read about blind SQL injection before, they did have some interesting techniques and used their Marathon Tool to ease the tedious nature of blind SQL injection. One thing I liked was their method of using timing to seperate a True answer page from a False answer page if there is no visible or code difference. Most SQL engines have slightly different supported methods to introduce time-based blind SQL injection so a response that is timed above a certain value can be considered true. Even those that don't include time-delay functions can be leveraged with by running a "heavy" query only if a "light" query first returns as true. An example of a heavy query that would slow the response after a successful light query is multiple cross-table joins.&lt;br /&gt;&lt;br /&gt;Alonso and Pakato also did a good job answering questions. They definitely seemed more comfortable by the end of their presentation.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1100: &lt;/span&gt;&lt;a href="http://www.rfidhackers.com/"&gt;Chris Paget&lt;/a&gt; is a very entertaining presenter and clearly had fun showing off his RFID reader during &lt;a href="http://shmoocon.org/presentations-all.html#edl"&gt;EDL Cloning for Under $250&lt;/a&gt;. He demonstrated how easy it is to read, clone, and write RFID cards created as part of the &lt;a href="http://www.dhs.gov/xprevprot/programs/gc_1200693579776.shtm"&gt;Western Hemisphere Travel Initiative&lt;/a&gt;. By design, these cards are supposed to be readable from 30 feet but it is trivial to read them at more than 200 feet and much longer distances, possibly around half a mile, should be possible. The cards also have no encryption or authentication.&lt;br /&gt;&lt;br /&gt;Paget was able to buy an enterprise-level card reader by Motorola on eBay. Although he needed to perform some repairs on the RFID reader, the whole sniffing setup was only around $250. The card reader has no real security mechanisms for logon and listens on port 3000.&lt;br /&gt;&lt;br /&gt;There are no federal anti-skimming laws to prevent RFID skimming/sniffing, though CA and WA states do have laws. Paget was able to grab a lot of information through war driving with his setup and pointed out that correlation means the cards can provide more than just an anonymous number. For instance, if you detect the same card tag twice you could compare it to photos to see whose face you saw twice. You could also correlate against other data like credit cards containing RFID to figure out which data belonged to which person.&lt;br /&gt;&lt;br /&gt;Eventually as RFID cards become more common, this could present more serious issues like collecting tons of RFID card data until you get one where the person's appearance is close enough that you could use his identity, or terrorists could use it to identify targets in a crowd.&lt;br /&gt;&lt;br /&gt;Paget stated that the supposed purpose for the cards was to enhance security, which clearly is a failure, and also to speed border crossings, which also has been a failure since users still have to present their cards directly. Paget believes that WHTI is broken but that RealID could be an alternative if it was revamped to fix all the serious problems. Ideally, among other recommendations, he advocates a contact smartcard rather than one that can be read remotely.&lt;br /&gt;&lt;br /&gt;Another Shmoocon in the books. Thanks to the &lt;a href="http://www.shmoo.com/"&gt;Shmoo Group&lt;/a&gt;, speakers and attendees for a good time.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-2838388808606334753?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/2838388808606334753/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2009/02/shmoocon-2009-notes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/2838388808606334753'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/2838388808606334753'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2009/02/shmoocon-2009-notes.html' title='Shmoocon 2009 Notes'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-3538865463441285533</id><published>2009-01-28T05:50:00.005-05:00</published><updated>2009-01-28T12:54:55.114-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='exploits'/><category scheme='http://www.blogger.com/atom/ns#' term='risk'/><title type='text'>Old-fashioned spying</title><content type='html'>&lt;a href="http://immunityinc.com/"&gt;Dave Aitel&lt;/a&gt;, who once worked at the NSA, had a funny email on his list that included a mention of &lt;a href="http://www.cicentre.com/spycase/DELLEMY_Saubhe_Jassim_al.html"&gt;Saubhe  Aldellemy&lt;/a&gt;, who operated a restaurant near NSA headquarters and Ft. Meade. Aldellemy was charged and apparently &lt;a href="http://www.cicentre.com/spycase/courtdoc/US_v_Al-Dellemy_plea_dec08.pdf"&gt;accepted a plea agreement&lt;/a&gt; for &lt;a href="http://www.cicentre.com/spycase/courtdoc/US_v_Al-Dellemy_criminal_info_dec08.pdf"&gt;acting as an unregistered foreign agent (PDF)&lt;/a&gt; of Iraq, which is essentially legal speak for spying on behalf of the Iraqi Intelligence Service.&lt;br /&gt;&lt;br /&gt;Using a restaurant near desirable targets is a well known method of gathering intelligence. It has been going on for decades at the least, and possibly as long as restaurants and a desire for non-public information have existed. I expect that the method was used extensively in the post-WWII and Cold War era.&lt;br /&gt;&lt;a href="http://www.irawinkler.com/"&gt;&lt;br /&gt;Ira Winkler&lt;/a&gt;, another former NSA employee, discusses the method in his book,&lt;span style="font-style: italic;"&gt; Spies Among Us&lt;/span&gt;. Winkler also mentions a related method he uses when penetration testing, which is to go into restaurants near his target and take the business cards out of the fishbowls that a restaurant will set up for free drawings. Once he finds business cards from people at the target business, it gives him information to assist in social engineering and at times, in lieu of work identification, a business card can get him onto the grounds of the target business.&lt;br /&gt;&lt;br /&gt;I suspect that spying against private entities is more attractive than it used to be, while spying against governments is still widespread. Whether it is for profit or government intelligence, you can bet that countries like the U.S.A., China, Russia, and many in the Middle East and EU all have programs like this. I also assume that at least some of the governments assist with spying against foreign corporations, not just government entities.&lt;br /&gt;&lt;br /&gt;No matter the method of intelligence gathering, spying still goes on. Any company or government with sensitive information needs to be careful about methods like this. I have been in restaurants near government agencies, military bases and large companies, and they are definitely target-rich environments. Even the most paranoid and careful employees are likely to talk about something that could be useful to outsiders, either directly or to leverage additional information.&lt;br /&gt;&lt;br /&gt;If you have information that is valuable enough, any company or entity that does not actually address the issue is asking for trouble.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-3538865463441285533?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/3538865463441285533/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2009/01/old-fashioned-spying.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/3538865463441285533'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/3538865463441285533'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2009/01/old-fashioned-spying.html' title='Old-fashioned spying'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-7958296774576931000</id><published>2009-01-07T05:33:00.004-05:00</published><updated>2009-01-09T07:41:14.311-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='forensics'/><category scheme='http://www.blogger.com/atom/ns#' term='analysis'/><category scheme='http://www.blogger.com/atom/ns#' term='reading'/><title type='text'>Harlan Carvey's memory tool round-up</title><content type='html'>&lt;a href="http://windowsir.blogspot.com/"&gt;Harlan Carvey&lt;/a&gt; has a good round-up of incident response tools for &lt;a href="http://windowsir.blogspot.com/2009/01/memory-collection-and-analysis-tools.html"&gt;collection and analysis of physical memory&lt;/a&gt;. His blog is definitely a good read for security professionals, particularly those that do any incident response or forensics. He is really good at posting his analysis processes and explaining which tools he uses for which tasks.&lt;br /&gt;&lt;br /&gt;This post is just a reminder to myself to try some of the tools on his list that I have not yet used and to look more deeply into the tools that I have used. I hope to play with a number of the tools in a lab environment.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-7958296774576931000?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/7958296774576931000/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2009/01/harlan-carveys-memory-tool-round-up.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/7958296774576931000'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/7958296774576931000'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2009/01/harlan-carveys-memory-tool-round-up.html' title='Harlan Carvey&apos;s memory tool round-up'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-3103549777080583585</id><published>2009-01-02T00:12:00.008-05:00</published><updated>2009-01-02T00:22:03.565-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='exploits'/><category scheme='http://www.blogger.com/atom/ns#' term='reading'/><title type='text'>December Dailydave; a recurring topic and 25C3</title><content type='html'>I've posted links to Dailydave quite a few times. The month of December had the last discussion &lt;sup&gt;&lt;a href="#1"&gt;*&lt;/a&gt;&lt;/sup&gt; on a &lt;a href="http://lists.immunitysec.com/pipermail/dailydave/2008-December/005445.html"&gt;recurring topic&lt;/a&gt;. It also had some &lt;a href="http://lists.immunitysec.com/pipermail/dailydave/2008-December/005474.html"&gt;good guesses beforehand&lt;/a&gt; &lt;a href="http://lists.immunitysec.com/pipermail/dailydave/2008-December/005489.html"&gt;then a discussion&lt;/a&gt; of the &lt;a href="http://www.win.tue.nl/hashclash/rogue-ca/"&gt;rogue CA attack&lt;/a&gt; that was presented at &lt;a href="http://events.ccc.de/"&gt;25C3&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;&lt;sup&gt;&lt;a name="1"&gt;*&lt;/a&gt;&lt;/sup&gt; of 2008&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-3103549777080583585?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/3103549777080583585/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2009/01/december-dailydave-recurring-topic-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/3103549777080583585'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/3103549777080583585'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2009/01/december-dailydave-recurring-topic-and.html' title='December Dailydave; a recurring topic and 25C3'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-4108221817635264408</id><published>2008-12-29T15:33:00.004-05:00</published><updated>2008-12-29T15:48:32.130-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='malware'/><title type='text'>IE exploits on the move</title><content type='html'>It looks like the &lt;a href="http://eatingsecurity.blogspot.com/2008/12/ie-vulnerability-just-one-of-many.html"&gt;previously mentioned exploits for the latest IE vulnerability, and more&lt;/a&gt;, have moved to an additional domain. Everyone is probably seeing SQL injection attempts with obfuscated code &lt;a href="http://isc.sans.org/diary.html?storyid=5464"&gt;similar to before&lt;/a&gt;, except now the referenced domain is mcuve.cn. As far as I can see, the site is hosting the same code that was hosted on the 17gamo site. A quick Google shows that a few sites have &lt;a href="http://www.google.com/search?q=mcuve.cn"&gt;already been hit&lt;/a&gt; (and at least one other person has &lt;a href="http://www.dynamoo.com/blog/2008/12/sql-injection-msngk6ru-dft6skz-and.html"&gt;already blogged it&lt;/a&gt;).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-4108221817635264408?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/4108221817635264408/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/12/ie-exploits-on-move.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/4108221817635264408'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/4108221817635264408'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/12/ie-exploits-on-move.html' title='IE exploits on the move'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-2465714465306733604</id><published>2008-12-22T06:21:00.001-05:00</published><updated>2008-12-22T07:47:53.847-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='system administration'/><category scheme='http://www.blogger.com/atom/ns#' term='scripts'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Answers to NIDS management</title><content type='html'>&lt;a href="http://geek00l.blogspot.com/"&gt;C.S. Lee&lt;/a&gt; had a post called &lt;a href="http://geek00l.blogspot.com/2008/12/nids-administration-management.html"&gt;NIDS: Administration, Management &amp;amp; Provisioning&lt;/a&gt; that asked some good questions about managing large numbers of NSM sensors. I have managed large numbers of sensors in the past, so thought I would take a shot at describing some of the ways I eased management as well as other methods I still look forward to trying. Since my post is long, I thought it better to write it here than stuff it all into a comment on geek00l's blog.&lt;br /&gt;&lt;br /&gt;A couple of things to remember; first, there are almost always ways to improve complex systems management. Second, "perfect" is the enemy of "good enough". At some point you reach the point of diminishing returns, so the cost of additional improvement of the management or administration of the systems may not be worth the reward.&lt;br /&gt;&lt;blockquote&gt;1. What tools do you use to manage all the NIDS, and why you choose them over others?&lt;br /&gt;- For example ssh, however I would like to know more about tools you use to manage massive NIDS instead of one, and the reason you choose it.&lt;/blockquote&gt;SSH is obviously going to be one way to login to systems and do certain things. If it is something that you must do consistently, then scripts or other system management methods that I will discuss later are likely more appropriate. When using SSH for a large number of systems, don't forget that SSH keys and ssh-agent are your friend. With ssh-agent, you can login to all your systems with your SSH key after entering your passphrase only once. This simplifies running scripts that require logging into or copying files to each system.&lt;br /&gt;&lt;br /&gt;Also, when I talk about using SSH along with scripts, I'm also talking about using programs that support SSH as the transport protocol, for example rsync and rdist. &lt;a href="http://expect.nist.gov/"&gt;Expect&lt;/a&gt; scripts are also a common way to roll your own centralized management of systems, but for C.S. Lee's 50+ system question, a dedicated application seems to be a better answer than only using scripts and logging in manually.&lt;blockquote&gt;2. How do you perform efficient administration securely? For examples,&lt;br /&gt;- System changes/updates&lt;br /&gt;- NIDS tools' changes/updates&lt;br /&gt;- NIDS rules' changes/updates&lt;br /&gt;- NIDS Configuration files' changes/updates&lt;br /&gt;- NIDS Policies' changes/updates&lt;/blockquote&gt;I think these types of changes and updates will require a combination of tools, and the tools could depend in part on the operating system(s). If you have multiple operating systems then it also makes the management more complex, so ideally you want to standardize on an operating system as well as keeping the release versions identical whenever possible.&lt;br /&gt;&lt;br /&gt;One thing I've &lt;a href="http://eatingsecurity.blogspot.com/2008/01/puppet-and-cfengine-for-management.html"&gt;mentioned in the past&lt;/a&gt; for system management is &lt;a href="http://reductivelabs.com/projects/puppet/"&gt;puppet&lt;/a&gt;.&lt;br /&gt;&lt;blockquote&gt;Puppet lets you centrally manage every important aspect of your system using a cross-platform specification language that manages all the separate elements normally aggregated in different files, like users, cron jobs, and hosts, along with obviously discrete elements like packages, services, and files.&lt;/blockquote&gt;Although I haven't yet had the chance to use puppet, it seems to have a good reputation. Another option is &lt;a href="http://www.cfengine.org/"&gt;cfengine&lt;/a&gt;, though most people I have talked to that have experience with both seem to prefer puppet. Change management of configuration files, cron scripts, and other files like NIDS rules can definitely be handled by one of these central management tools.&lt;br /&gt;&lt;br /&gt;Another thing to consider is whether your operating system or its vendor includes anything for these tasks. For instance, &lt;a href="http://www.redhat.com/red_hat_network/moduledetail/"&gt;Red Hat Network Satellite&lt;/a&gt; can handle a lot of centralized management, including package management. NIDS/NSM sensors often need configuration changes from the standard distribution package for certain software, so being able to roll your own packages and push them to sensors automatically can drastically reduce system management overhead.&lt;br /&gt;&lt;br /&gt;Although puppet seems to handle users, I've also written three posts about OpenLDAP for centralized management of users and groups [&lt;a href="http://eatingsecurity.blogspot.com/2008/09/setting-up-openldap-for-centralized.html"&gt;1&lt;/a&gt;, &lt;a href="http://eatingsecurity.blogspot.com/2008/10/openldap-continued.html"&gt;2&lt;/a&gt;, &lt;a href="http://eatingsecurity.blogspot.com/2008/11/openldap-security.html"&gt;3&lt;/a&gt;]. With most current Linux or BSD, once LDAP is configured it is pretty easy to manage users, groups, and even sudo. Since I've worked in environments with not just large numbers of Linux systems, but also large numbers of users, LDAP was definitely useful. With a small number of users on large number of systems, I'm not sure that it would be needed.&lt;br /&gt;&lt;br /&gt;For the security requirement, any good centralized management system better have some sort of authentication and encryption. &lt;a href="http://reductivelabs.com/trac/puppet/wiki/CertificatesAndSecurity"&gt;Puppet supports a CA and SSL&lt;/a&gt;, &lt;a href="http://www.cfengine.org/confdir/copyv2.html"&gt;cfengine supports RSA and Blowfish&lt;/a&gt; along with &lt;a href="http://www.cfengine.org/confdir/keys.html"&gt;public-private keys&lt;/a&gt;, and &lt;a href="http://www.redhat.com/red_hat_network/faq/"&gt;Red Hat Satellite suports SSL and GPG&lt;/a&gt;. Other basics including host-based firewalls like iptables can also be useful for limiting exposure and access from the network.&lt;br /&gt;&lt;br /&gt;Truthfully, I have mostly relied on home-grown scripts combined with SSH, rsync and/or rdist to push files or commands to Linux systems. However, with the number of systems I have managed, the up-front cost of implementing something like puppet, cfengine, or Satellite would be worth the long-term benefits.&lt;br /&gt;&lt;blockquote&gt;3. Which method you like to use in order to manage them, and why? For example,&lt;br /&gt;- Server pushes rules update to all the sensors(Push)&lt;br /&gt;- Sensors pull the rules update from server(Pull)&lt;/blockquote&gt;I think this question is largely moot because it will usually be determined by the management tools you are using. For instance, Red Hat runs a daemon on the individual systems that will check in either with Red Hat Network or with your local Satellite Network.&lt;br /&gt;&lt;br /&gt;When using scripts, I will usually use a push simply because I like to login to one system then run the script that will connect to all the other systems to copy files or run a command.&lt;br /&gt;&lt;blockquote&gt;3. NIDS health monitoring and self-healing&lt;br /&gt;- I'm talking about something like this, if the system is in incosistent state, operators will be notified. If certain process die, it should recover by itself.&lt;br /&gt;&lt;/blockquote&gt;The obvious answer to monitoring processes is something like &lt;a href="http://www.nagios.org/"&gt;Nagios&lt;/a&gt;, an open source solution. Nagios can also handle restarting services or processes through &lt;a href="http://nagios.sourceforge.net/docs/3_0/eventhandlers.html"&gt;event handlers&lt;/a&gt;. Realistically, any software that monitors services should have the ability to restart those services if needed. Another example of process monitoring and restarting is &lt;a href="http://eatingsecurity.blogspot.com/2008/03/using-dj-bernsteins-daemontools.html"&gt;daemontools&lt;/a&gt;, but it does not really meet monitoring needs for an enterprise and is fairly limited. There are additional choices of monitoring software, as well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-2465714465306733604?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/2465714465306733604/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/12/answers-to-nids-management.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/2465714465306733604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/2465714465306733604'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/12/answers-to-nids-management.html' title='Answers to NIDS management'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-4622713300544537133</id><published>2008-12-13T13:35:00.007-05:00</published><updated>2008-12-15T17:00:34.264-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='malware'/><title type='text'>IE vulnerability just one of many</title><content type='html'>The latest IE "&lt;a href="http://www.microsoft.com/technet/security/advisory/961051.mspx"&gt;0day&lt;/a&gt;" is making big news. The bulletin now includes IE6, IE7, and IE8 beta. Looking at &lt;a href="http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-4844"&gt;CVE-2008-4844&lt;/a&gt; will give a decent round-up of related links. &lt;a href="http://www.shadowserver.org/"&gt;Shadowserver&lt;/a&gt; has a list of &lt;a href="http://www.shadowserver.org/wiki/pmwiki.php?n=Calendar.20081210"&gt;domains known to be using exploits that attack this vulnerability&lt;/a&gt;. Microsoft has some &lt;a href="http://blogs.technet.com/swi/archive/2008/12/12/Clarification-on-the-various-workarounds-from-the-recent-IE-advisory.aspx"&gt;workarounds&lt;/a&gt; to help mitigate the vulnerability.&lt;br /&gt;&lt;br /&gt;One thing to remember is that many malicious sites do not rely on one vulnerability. Don't let one high-profile vulnerability and news of exploits in the wild make you forget about the big picture. If a site is hosting exploits against this IE vulnerability, it is very likely the site will be hosting additional exploits.&lt;br /&gt;&lt;br /&gt;One example is one of the highest profile domains hosting exploits, 17gamo[dot]com. The SQL attacks &lt;a href="http://isc.sans.org/diary.html?storyid=5464"&gt;referenced on SANS&lt;/a&gt; are injecting a URI containing this malicious domain. As mentioned on SANS diary, the javascript in the injected URI leads to additional files on the malicious site. Although the SANS diary specifically mentions the IE exploit, it doesn't mention the other exploits.&lt;br /&gt;&lt;br /&gt;Please remember the following site is malicious!&lt;br /&gt;&lt;pre&gt;$ wget -r http://www.17gamo.com/co&lt;/pre&gt;After downloading the content, I change to the correct directory and see what is there:&lt;pre&gt;$ ls co/&lt;br /&gt;14.htm     flash.htm  ihhh.html   nct.htm     real.htm   swfobject.js&lt;br /&gt;fhhh.html  ie7.htm    index.html  office.htm  real.html&lt;/pre&gt;The index file tries to open iframes containing 14.htm, flash.htm, ie7.htm, nct.htm, office.htm, real.htm and real.html. The flash.htm file then references ihhh.html and fhhh.html. We already know from the SANS diary what ie7.htm does.&lt;br /&gt;&lt;br /&gt;It was nice of the file authors to use relevant names for some of the files. The flash.htm code references both ihhh.html and fhhh.html. Both these files look like they will serve up a Flash exploit of varying names depending what version of the Flash Player is detected. Downloading a couple of the SWF files, they are the same size but diff shows that they are not identical. They all seem to produce similar results on &lt;a href="http://www.virustotal.com/analisis/9c51d97a96d8f321cd46dad9bbded3c9"&gt;Virustotal&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The office.htm file appears to be an exploit targeting &lt;a href="http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-2463"&gt;CVE-2008-2463&lt;/a&gt;, a MS Office Snapshot Viewer ActiveX vulnerability. If vulnerable, this will lead to the download of the same win.exe mentioned in the SANS diary and it looks like it will attempt to write the executable to the 'Startup' folder for All Users.&lt;br /&gt;&lt;br /&gt;I haven't looked at &lt;a href="http://www.virustotal.com/analisis/ca4682f2b8d52548da474ecfdbb6ba99"&gt;real.htm&lt;/a&gt;, &lt;a href="http://www.virustotal.com/analisis/d7ebd9b471885ebb5bebed33c4b86287"&gt;real.html&lt;/a&gt;, &lt;a href="http://www.virustotal.com/analisis/0fc3e619cb614e2cd0a8819499c7298f"&gt;nct.htm&lt;/a&gt; or &lt;a href="http://www.virustotal.com/analisis/46c702cfc8aa878f7abf102f9144a69a"&gt;14.htm&lt;/a&gt; yet.&lt;br /&gt;&lt;br /&gt;This is all just to point out that most malicious sites these days will run a number of attacks against web clients, so just because one failed doesn't mean the others did the same. I saw a system get hit by the ie7.htm exploit without immediately downloading the win.exe from steoo[dot]com, yet it did run one of the malicious SWF files.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-4622713300544537133?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/4622713300544537133/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/12/ie-vulnerability-just-one-of-many.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/4622713300544537133'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/4622713300544537133'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/12/ie-vulnerability-just-one-of-many.html' title='IE vulnerability just one of many'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-5737927653221564258</id><published>2008-12-04T05:40:00.007-05:00</published><updated>2008-12-04T14:23:16.903-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cloud'/><category scheme='http://www.blogger.com/atom/ns#' term='technology'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>ArsTechnica Ovatio Awards posted</title><content type='html'>&lt;a href="http://arstechnica.com/index.ars"&gt;ArsTechnica&lt;/a&gt; has some year-end awards, the &lt;a href="http://arstechnica.com/articles/culture/ars-awards-2008.ars"&gt;Ovatio Awards&lt;/a&gt;, online. With any type of awards like this, there will be plenty of arguments about what is missed and what should not be on the list.&lt;br /&gt;&lt;br /&gt;I find it interesting that none of the &lt;a href="http://arstechnica.com/articles/culture/ars-awards-2008.ars/2"&gt;Year's Biggest Stories&lt;/a&gt; section includes anything directly related to security. If I was making a list (maybe I will?), I can think of a number of important stories related to security that had or will continue to have a huge impact. They did choose "cloud computing" as &lt;a href="http://arstechnica.com/articles/culture/ars-awards-2008.ars/3"&gt;Buzzword of the Year&lt;/a&gt;, which I think is a good choice and is definitely &lt;a href="http://rationalsecurity.typepad.com/blog/cloud-security/"&gt;a big topic&lt;/a&gt; on &lt;a href="http://cloudsecurity.org/"&gt;security blogs&lt;/a&gt; recently.&lt;br /&gt;&lt;br /&gt;I can't say I understand the choice of PlayStation 3 as &lt;a href="http://arstechnica.com/articles/culture/ars-awards-2008.ars/5"&gt;Product of the Year&lt;/a&gt;, but I haven't been a serious gamer for years, which may explain why I own a Wii. In addition to being launched more than two years ago, the PS3 doesn't seem particularly innovative and the price makes it a tough buy for a lot of people. Still, ArsTechnica is fairly focused on gaming so it may make some amount of sense. It will definitely get a lot of page views and some &lt;a href="http://episteme.arstechnica.com/eve/forums?a=tpc&amp;amp;s=50009562&amp;amp;f=174096756&amp;amp;m=115002195931&amp;amp;r=115002195931"&gt;comments in their forum&lt;/a&gt;!&lt;br /&gt;&lt;br /&gt;The &lt;a href="http://arstechnica.com/articles/culture/ars-awards-2008.ars/6"&gt;Hardware Trend of the Year&lt;/a&gt;, netbooks, is definitely a good pick. Really, it seems like this is something customers have wanted for years and companies just didn't realize that there would be a big market even where traditional laptop sales were strong. I know that my laptop philosophy has light weight higher on my priorities list than performance. I don't mind a laptop as a desktop replacement around the house, but I sure don't want to travel with it if I have a lighter option.&lt;br /&gt;&lt;br /&gt;The pick of OpenSUSE as a &lt;a href="http://arstechnica.com/articles/culture/ars-awards-2008.ars/7"&gt;Linux Distro of the Year&lt;/a&gt; surprises me, but that may just show that I haven't used it in years. It may not have been part of their criteria, but if I had to pick a distribution with the most community and end-user impact, I would definitely have to say Ubuntu. There is no other distribution besides possibly Red Hat that has had as much name recognition among my non-technical friends and acquaintances. My 91-year-old neighbor even tried running Ubuntu on a live CD for a while because he was thinking of ditching Windows.&lt;br /&gt;&lt;br /&gt;I enjoy reading year-end articles like the one posted at ArsTechnica because it gets me thinking about the topics I thought were important or significant over the past year.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-5737927653221564258?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/5737927653221564258/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/12/arstechnica-ovatio-awards-posted.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/5737927653221564258'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/5737927653221564258'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/12/arstechnica-ovatio-awards-posted.html' title='ArsTechnica Ovatio Awards posted'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-4783492089625187858</id><published>2008-11-20T19:21:00.012-05:00</published><updated>2008-11-21T10:12:15.924-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='malware'/><title type='text'>Commodity malware versus custom exploits</title><content type='html'>In my post about &lt;a href="http://eatingsecurity.blogspot.com/2008/11/tis-season-for-e-card-trojans.html"&gt;e-card Trojans&lt;/a&gt;, I mentioned that I hoped to flesh out my thoughts on malware as compared to more customized exploits. As we all should know from numerous stories, &lt;a href="http://www.avertlabs.com/research/blog/index.php/2008/11/14/exploit-ms08-067-bundled-in-commercial-malware-kit/"&gt;commodity&lt;/a&gt; &lt;a href="http://www.infoworld.com/article/08/01/14/New-malware-toolkit-thwarts-AV_1.html"&gt;malware&lt;/a&gt; is &lt;a href="http://news.bbc.co.uk/2/hi/technology/7719281.stm"&gt;big business&lt;/a&gt;. Malware is increasingly used to &lt;a href="http://www.usatoday.com/tech/news/surveillance/2008-11-11-thieves-cyber-corporate-data_N.htm"&gt;steal information to turn a profit&lt;/a&gt;, and is likely being used to &lt;a href="http://www.guardian.co.uk/world/2008/nov/20/america-china-hacking-security-obama"&gt;target information that is valuable in other ways&lt;/a&gt;. So my question is, in a world where &lt;a href="http://www.scmagazineus.com/Militarys-ban-of-USB-thumb-drives-highlights-security-risks/article/121326/"&gt;the U.S. military has to ban&lt;/a&gt; &lt;a href="http://www.avertlabs.com/research/blog/index.php/2008/11/20/the-rise-in-autorun-based-malware/"&gt;USB drives&lt;/a&gt; &lt;a href="http://blog.wired.com/defense/2008/11/army-bans-usb-d.html"&gt;to combat malware&lt;/a&gt;, how much trouble are customized private exploits actually worth?&lt;br /&gt;&lt;br /&gt;There are certainly advantages to customized private exploits, but when a spammer only needs &lt;a href="http://news.bbc.co.uk/2/hi/technology/7719281.stm"&gt;one response for every 12.5 million emails sent&lt;/a&gt; to be profitable, it seems that the economics of the situation may favor the lower cost of slightly modifying malware to bypass anti-virus software and then blasting away with malicious emails, advertisements, and other links.&lt;br /&gt;&lt;br /&gt;A customized exploit that is only being used by a small number of people should obviously be more difficult to detect. However, when anti-virus and traditional IDS rely so thoroughly on signatures of known activity, the question is really about how difficult the attacker needs detection to be. In many cases, it may not be worth using a skilled attacker to craft a specific exploit when said attacker could be increasing the efficiency of more voluminous attacks.&lt;br /&gt;&lt;br /&gt;Of course, this is not really an 'either' 'or' situation. Both types of attacks can effectively be used, and when combined they are probably both more effective. Sow mass confusion and panic with widespread malware attacks while performing more targeted attacks for particularly desirable information. Those playing defense will likely be busy scurrying after the malware while the targeted attacks fly in under the radar, especially in these economic times where security operations may be suffering from budget cuts.&lt;br /&gt;&lt;br /&gt;I also don't mean to downplay the skill it takes to enumerate network services and write a custom exploit for one or more of those services on the spot. Relatively few people can do that, I am certainly not one of them, and in many cases it is virtually undetectable. At the same time, I often feel that those talented exploit writers and penetration testers give too little credit to the effectiveness of common malware. It seems to me that commodity malware has become quite effective at generating revenue and stealing information.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-4783492089625187858?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/4783492089625187858/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/11/commodity-malware-versus-custom.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/4783492089625187858'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/4783492089625187858'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/11/commodity-malware-versus-custom.html' title='Commodity malware versus custom exploits'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-4051174653495592524</id><published>2008-11-17T09:07:00.014-05:00</published><updated>2008-11-18T23:43:24.219-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='nsm'/><category scheme='http://www.blogger.com/atom/ns#' term='malware'/><category scheme='http://www.blogger.com/atom/ns#' term='sguil'/><title type='text'>'Tis the season for E-card Trojans</title><content type='html'>IP addresses and hostnames have been changed. Anyway, this is from a few days ago and it looks like the malware is no longer on the server. A user received an email with a link to a supposed holiday card...&lt;br /&gt;&lt;pre&gt;Src IP:         10.1.1.18       (Unknown)&lt;br /&gt;Dst IP:         192.168.31.250  (Unknown)&lt;br /&gt;Src Port:               1461&lt;br /&gt;Dst Port:               80&lt;br /&gt;OS Fingerprint: 10.1.1.18:1461 - Windows XP SP1+, 2000 SP3 (2)&lt;br /&gt;OS Fingerprint:   -&gt; 192.168.31.250:80 (distance 7, link: ethernet/modem)&lt;br /&gt;&lt;br /&gt;SRC: GET /ecard.exe HTTP/1.0&lt;br /&gt;SRC: Accept: */*&lt;br /&gt;SRC: Accept-Language: en-us&lt;br /&gt;SRC: User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1; .NET CLR 1.&lt;br /&gt;1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)&lt;br /&gt;SRC: Host: fakeurl.info&lt;br /&gt;SRC: Connection: Keep-Alive&lt;br /&gt;SRC:&lt;br /&gt;SRC:&lt;br /&gt;DST: HTTP/1.1 200 OK&lt;br /&gt;DST: Date: Wed, 12 Nov 2008 11:41:08 GMT&lt;br /&gt;DST: Server: Apache/1.3.36 (Unix) mod_jk/1.2.14 mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_b&lt;br /&gt;wlimited/1.4 PHP/4.3.9 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.27 OpenSSL/0.9.7a&lt;br /&gt;DST: Last-Modified: Wed, 12 Nov 2008 10:14:10 GMT&lt;br /&gt;DST: ETag: "944cd-8688-491aac72"&lt;br /&gt;DST: Accept-Ranges: bytes&lt;br /&gt;DST: Content-Length: 34440&lt;br /&gt;DST: Content-Type: application/octet-stream&lt;br /&gt;DST: Connection: Keep-Alive&lt;br /&gt;DST:&lt;br /&gt;DST:&lt;br /&gt;DST: MZ..............@.......@........L.!........................@...PE..L...UB.I...............&lt;br /&gt;..........p................@.......................... .........................................&lt;br /&gt;................................................................................................&lt;br /&gt;.............................UPX0.....p..............................UPX1.......................&lt;br /&gt;.........@...UPX2................................@..............................................&lt;br /&gt;3.03.UPX!&lt;/pre&gt;The above is part of a Sguil transcript. I downloaded the file, took a brief look, then submitted it to VirusTotal.&lt;br /&gt;&lt;pre&gt;$ cd malware&lt;br /&gt;$ wget http://fakeurl.info/ecard.exe&lt;br /&gt;---snip---&lt;br /&gt;$ strings -n 3 -a ecard.exe | less&lt;br /&gt;UPX0&lt;br /&gt;UPX1&lt;br /&gt;UPX2&lt;br /&gt;3.03&lt;br /&gt;UPX!&lt;br /&gt;---snip---&lt;br /&gt;XPTPSW&lt;br /&gt;KERNEL32.DLL&lt;br /&gt;LoadLibraryA&lt;br /&gt;GetProcAddress&lt;br /&gt;VirtualProtect&lt;br /&gt;VirtualAlloc&lt;br /&gt;VirtualFree&lt;br /&gt;ExitProcess&lt;/pre&gt;This is pretty &lt;a href="http://www.virustotal.com/analisis/4a3627639cd9a27e435df767331a0062"&gt;run-of-the-mill malware&lt;/a&gt; that will get detected by &lt;a href="http://doc.emergingthreats.net/2006434"&gt;Emerging Threats SID 2006434&lt;/a&gt; when the executable is downloaded, but I guess people still fall for it. As Shirkdog so &lt;a href="http://www.shirkdog.us/blog.html#b09_15_2006"&gt;eloquently stated&lt;/a&gt;:&lt;br /&gt;&lt;blockquote&gt;Do not click on unsolicited URLs, including those received in email, instant messages, web forums, or internet relay chat (IRC) channels.&lt;br /&gt;&lt;br /&gt;People will never get it through their skulls that they SHOULD NOT click links. It is the reason we are all employed, because the user will always be there.&lt;/blockquote&gt;It's always amazing how few anti-virus engines will catch known malware. A system compromised this way also brings to my mind a comparison between common malware and novel or custom exploits that are not widely available. I plan to flesh out thoughts comparing the two at a later date.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-4051174653495592524?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/4051174653495592524/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/11/tis-season-for-e-card-trojans.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/4051174653495592524'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/4051174653495592524'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/11/tis-season-for-e-card-trojans.html' title='&apos;Tis the season for E-card Trojans'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-5691128999136303908</id><published>2008-11-13T05:01:00.004-05:00</published><updated>2008-11-13T05:01:00.550-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='system administration'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='encryption'/><category scheme='http://www.blogger.com/atom/ns#' term='ldap'/><title type='text'>OpenLDAP Security</title><content type='html'>Since I have been doing a lot of system administration blogging lately and not much on security, I decided I should post something related to security even if it is still in reference to system configuration and administration. Despite being years old, many of the pages I found about LDAP and security were still pertinent, for example &lt;a href="http://www.skills-1st.co.uk/papers/security-with-ldap-jan-2002/security-with-ldap.html"&gt;Security with LDAP&lt;/a&gt;. The &lt;a href="http://www.openldap.org/"&gt;OpenLDAP&lt;/a&gt; documentation has a whole section titled &lt;a href="http://www.openldap.org/doc/admin24/security.html"&gt;Security Considerations&lt;/a&gt; in addition to other sections throughout that address security.&lt;br /&gt;&lt;br /&gt;The &lt;a href="http://en.wiktionary.org/wiki/TLDR"&gt;TLDR&lt;/a&gt; version of this post is that some of the defaults for &lt;a href="http://www.openldap.org/"&gt;OpenLDAP&lt;/a&gt; may not be secure, it is easy to make other configuration mistakes, and you should make sure to examine configurations, permissions, ACLs, and schemas with security in mind. Different distributions can have different defaults. If you are using LDAP for account information in particular, you need to be careful.&lt;br /&gt;&lt;br /&gt;I will go over some specifics that I noticed, but I certainly won't cover everything. OpenLDAP can be configured to get a similar level of protection for account information compared to the standard Unix/Linux shadow files and actually makes some security-related tasks easier for an administrator, such as disabling accounts or enforcing password policies.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Encryption of Data and Authentication&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;The first and most obvious problem is that the default OpenLDAP configuration does not encrypt network activity. Whether you're using LDAP for account information or not, it is very likely that most people will not want their LDAP traffic going over the network unencrypted. OpenLDAP has &lt;a href="http://www.openldap.org/doc/admin24/tls.html"&gt;support for TLS&lt;/a&gt; that makes it relatively easy to implement. Also important to note is that, though network activity is not protected by default, the &lt;a href="http://www.openldap.org/doc/admin24/sasl.html"&gt;minimum recommended authentication mechanism is SASL DIGEST-MD5&lt;/a&gt;.&lt;br /&gt;&lt;blockquote&gt;The DIGEST-MD5 mechanism is the mandatory-to-implement authentication mechanism for LDAPv3. Though DIGEST-MD5 is not a strong authentication mechanism in comparison with trusted third party authentication systems (such as &lt;term&gt;Kerberos&lt;/term&gt; or public key systems), it does offer significant protections against a number of attacks.&lt;br /&gt;&lt;/blockquote&gt;Another option, Kerberos, is also "&lt;a href="http://www.openldap.org/doc/admin24/install.html#%7B%7BTERM%5Bexpand%5DKerberos%7D%7D"&gt;highly recommended&lt;/a&gt;" for strong authentication services.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Passwords&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When using OpenLDAP with nss_ldap and centralized accounts, if you're storing passwords in LDAP they should be stored as hashes, not plain text. This seems obvious, but it's important to understand how to generate the hashes with the 'slappasswd' command and then use 'ldapadd', 'ldapmodify' or a GUI LDAP management tool to put the hashes into LDAP. This is done when creating or altering accounts. The 'passwd' command will hash passwords automatically when users change their own passwords.&lt;br /&gt;&lt;br /&gt;Different distributions have different default ACLs, but RHEL for example allows anonymous reads of LDAP by default and allows authenticated users read access to everything in another sample ACL included in the openldap-servers package. If you're going to store account information and passwords with LDAP, the access controls need to be changed to prevent both anonymous and authenticated users from viewing password hashes. As we all should know, all it takes to crack a password hash is an appropriate tool and processing time. Depending on the attacker's computing power, the password hashing algorithm and the actual password, cracking passwords can be extremely fast or very slow.&lt;br /&gt;&lt;br /&gt;OpenLDAP supports a number of hashing algorithms and the default is to use {SSHA}, which is SHA-1 with a seed.&lt;br /&gt;&lt;dl compact="compact"&gt;&lt;blockquote&gt;&lt;dl compact="compact"&gt;&lt;dt&gt;&lt;b&gt;-h&lt;/b&gt; &lt;i&gt;scheme&lt;/i&gt; &lt;/dt&gt;&lt;dd&gt;If -h is specified, one of the following RFC 2307 schemes may be specified: &lt;i&gt;{CRYPT}&lt;/i&gt;, &lt;i&gt;{MD5}&lt;/i&gt;, &lt;i&gt;{SMD5}&lt;/i&gt;, &lt;i&gt;{SSHA}&lt;/i&gt;, and &lt;i&gt;{SHA}&lt;/i&gt;. The default is &lt;i&gt;{SSHA}&lt;/i&gt;. &lt;p&gt;Note that scheme names may need to be protected, due to &lt;b&gt;{&lt;/b&gt; and &lt;b&gt;}&lt;/b&gt;, from expansion by the user's command interpreter. &lt;/p&gt;&lt;p&gt;&lt;b&gt;{SHA}&lt;/b&gt; and &lt;b&gt;{SSHA}&lt;/b&gt; use the SHA-1 algorithm (FIPS 160-1), the latter with a seed. &lt;/p&gt;&lt;p&gt;&lt;b&gt;{MD5}&lt;/b&gt; and &lt;b&gt;{SMD5}&lt;/b&gt; use the MD5 algorithm (RFC 1321), the latter with a seed. &lt;/p&gt;&lt;p&gt;&lt;b&gt;{CRYPT}&lt;/b&gt; uses the &lt;i&gt;&lt;b&gt;crypt&lt;/b&gt;(3)&lt;/i&gt;. &lt;/p&gt;&lt;p&gt;&lt;b&gt;{CLEARTEXT}&lt;/b&gt; indicates that the new password should be added to userPassword as clear text.&lt;br /&gt;&lt;/p&gt;&lt;/dd&gt;&lt;/dl&gt;&lt;/blockquote&gt;&lt;/dl&gt;&lt;pre&gt;&lt;/pre&gt; This is fine when setting initial passwords, but you should note that the 'passwd' command on Linux systems will generally use MD5 or the 'crypt' function instead of SHA1, depending on system configuration.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;ACL Problems&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;There can also be problems related to Access Control Lists for slapd. Red Hat's default configuration allows anonymous reads. Ubuntu's slapd.conf seems to have a much more secure default ACL. Below is RHEL5's default, which allows anonymous reads, user reads, but only the rootdn to write.&lt;br /&gt;&lt;pre&gt;access to * by * read&lt;br /&gt;&lt;/pre&gt;The following is a sample configuration that is also included in the default slapd.conf on RHEL5, though it is commented out in favor of the above ACL. The danger with the following is that users still can read everything as well as write their own entries.&lt;br /&gt;&lt;pre&gt;access to *&lt;br /&gt;  by self write&lt;br /&gt;  by users read&lt;br /&gt;  by anonymous auth&lt;/pre&gt;Allowing users 'self write' to change their own entries is obviously a big problem if you're using LDAP for account information. Any user can change his own uidNumber or gidNumber to become uid 0, gid 0, gid 10 (wheel), etc. Not good!&lt;br /&gt;&lt;br /&gt;To authenticate with nss_ldap, OpenLDAP must allow some sort of read access. Without anonymous reads, users can't authenticate unless there is a proxy user with read access. The proxy user's binddn and password must be in /etc/ldap.conf and /etc/openldap/ldap.conf in plain text and the files are world readable. This is somewhat mitigated because the ldap.conf files can only be accessed by authenticated users logged into the system, so if an attacker already gained access to the system the proxyuser password is a fairly trivial concern in the big scheme of things.&lt;br /&gt;&lt;br /&gt;Another file with a plain text password is /etc/ldap.secret. This file must contain the rootdn password in plain text, but is again somewhat mitigated with file permissions. The permissions for the file must be set to 600 so only root can read the file, so the obvious way an attacker will get the rootdn password from the file is if he already has root privileges on that particular system. However, with the rootdn password the attacker could wreak havoc on all the LDAP entries, including all the account information stored in LDAP.&lt;br /&gt;&lt;br /&gt;To prevent users from viewing the password hashes of others, two things are required. First, change the ACL in slapd.conf. Something like this would allow users to change their own passwords, but not any other attributes and not view other users' hashes. You can hide additional attributes from authenticated users if needed.&lt;br /&gt;&lt;pre&gt;access to attrs=userpassword&lt;br /&gt;  by anonymous auth&lt;br /&gt;  by self write&lt;br /&gt;  by * none&lt;br /&gt;&lt;br /&gt;access to *&lt;br /&gt;  by self read&lt;br /&gt;  by users read&lt;br /&gt;  by anonymous auth&lt;/pre&gt;Another important thing to do is put users in the objectclass 'shadowAccount', which is in the NIS schema along with the objectclass 'posixAccount' that stores most account information. This will prevent password hashes from displaying when using 'getent passwd'. This is similar to shadow passwords on the local system, which move the password hashes from the world-readable /etc/passwd to /etc/shadow, which is only readable by root. The 'getent' commands will fetch both local and LDAP information.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Password Policy Overlay&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;The &lt;a href="http://www.openldap.org/doc/admin24/overlays.html#Password%20Policies"&gt;password policy overlay&lt;/a&gt; for OpenLDAP allows password policies to be enforced on OpenLDAP accounts. Quoting from the documentation:&lt;br /&gt;&lt;blockquote&gt;The key abilities of the password policy overlay are as follows: &lt;ul&gt;&lt;li&gt;Enforce a minimum length for new passwords &lt;/li&gt;&lt;li&gt;Make sure passwords are not changed too frequently &lt;/li&gt;&lt;li&gt;Cause passwords to expire, provide warnings before they need to be changed, and allow a fixed number of 'grace' logins to allow them to be changed after they have expired &lt;/li&gt;&lt;li&gt;Maintain a history of passwords to prevent password re-use &lt;/li&gt;&lt;li&gt;Prevent password guessing by locking a password for a specified period of time after repeated authentication failures &lt;/li&gt;&lt;li&gt;Force a password to be changed at the next authentication &lt;/li&gt;&lt;li&gt;Set an administrative lock on an account &lt;/li&gt;&lt;li&gt;Support multiple password policies on a default or a per-object basis. &lt;/li&gt;&lt;li&gt;Perform arbitrary quality checks using an external loadable module. This is a non-standard extension of the draft RFC.&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;Particularly for people that have specific company requirements for password policies, this overlay will do just about everything except complexity checking. For complexity checking, it's fairly easy to enable and configure pam_cracklib on each client. As far as I know, since only the hash crosses the wire when authenticating or changing passwords, it is not possible to centrally enforce complexity requirements.&lt;br /&gt;&lt;br /&gt;Personally, for password expiration I prefer not to allow any grace logins, thereby enforcing a lockout if the password expires. As long as the policy is set to provide ample warning, this shouldn't cause problems. Consider if you allow some number of 'grace' logins after the password expires and for some reason a user does not login for an extended period of time. The account could conceivably remain active for as long as it takes to brute force the password rather than being disabled once the password expires.&lt;br /&gt;&lt;br /&gt;Another password policy overlay feature is temporary lockouts after failed authentication. For instance, you could set a lockout after &lt;span style="font-style: italic;"&gt;x&lt;/span&gt; login attempts in &lt;span style="font-style: italic;"&gt;y&lt;/span&gt; seconds. The lockout can be &lt;span style="font-style: italic;"&gt;z&lt;/span&gt; seconds. I don't know what the maximum number of seconds the overlay or OpenLDAP will accept, but it can definitely be zero up to months in seconds if needed for some fields like &lt;tt&gt;pwdMaxAge&lt;/tt&gt;.&lt;br /&gt;&lt;br /&gt;When enabing 'pwdReset' to require an immediate password change, I eventually found that the following line must be uncommented in slapd.conf.&lt;pre&gt;pam_lookup_policy yes&lt;/pre&gt;After doing this, you can set 'pwdReset: TRUE' when generating temporary passwords, then the user will be required to change passwords immediately when logging in.&lt;br /&gt;&lt;br /&gt;From my testing, the password policy overlay is definitely superior to the shadow password options within the nis.schema that comes with OpenLDAP. The biggest problem with the password policy overlay is that some distributions may not include it in the distribution's package for the OpenLDAP server, requiring compiling with support for the overlay instead of a standard OpenLDAP package from your distribution of choice.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Post Script&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I have two previous posts about OpenLDAP. I would love to get any comments on what could be added or any mistakes that could be corrected.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://eatingsecurity.blogspot.com/2008/09/setting-up-openldap-for-centralized.html"&gt;Setting up OpenLDAP for centralized accounts&lt;/a&gt;&lt;br /&gt;&lt;a href="http://eatingsecurity.blogspot.com/2008/10/openldap-continued.html"&gt;OpenLDAP continued&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-5691128999136303908?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/5691128999136303908/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/11/openldap-security.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/5691128999136303908'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/5691128999136303908'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/11/openldap-security.html' title='OpenLDAP Security'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297187840164530151.post-5027389082262428344</id><published>2008-11-01T13:45:00.008-04:00</published><updated>2008-11-02T15:14:17.255-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='shmoocon'/><category scheme='http://www.blogger.com/atom/ns#' term='community'/><title type='text'>Shmoocon 2009 tickets</title><content type='html'>Tickets for &lt;a href="http://shmoocon.org/"&gt;Shmoocon 2009&lt;/a&gt; went on sale at noon EDT today. All the "Early Bird" tickets for $100 went quickly but there are still some "Open Registration" for $175 and "I Love Shmoocon" for $300.&lt;br /&gt;&lt;br /&gt;I like the way Shmoocon sells their tickets using three different rounds with three different price points in each round. Here is &lt;a href="https://www.shmoocon.org/cart/"&gt;their chart&lt;/a&gt; with dates of sales. Noon is always the start time. Shmoocon itself is February 6 - 8.&lt;br /&gt;&lt;br /&gt;&lt;table colspan="0" cellspan="0" border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;Date Tickets to be Sold&lt;/th&gt; &lt;th&gt; Early Bird&lt;/th&gt; &lt;th&gt; Open Registration&lt;/th&gt; &lt;th&gt; I love ShmooCon&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; November 1, 2008&lt;/td&gt; &lt;td&gt;200&lt;/td&gt; &lt;td&gt;300&lt;/td&gt; &lt;td&gt;10&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;December 1, 2008&lt;/td&gt; &lt;td&gt;200&lt;/td&gt; &lt;td&gt;300&lt;/td&gt; &lt;td&gt;20&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;January 1, 2009&lt;/td&gt; &lt;td&gt;100&lt;/td&gt; &lt;td&gt;100&lt;/td&gt; &lt;td&gt;20&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;One really cool contest I noticed this year is &lt;a href="http://shmoocon.org/barcode.html"&gt;Barcode Shmarcode&lt;/a&gt;. The Shmoocon ticket has always been simply a barcode they email to you after you purchase. This year, they want people to modify their barcodes to be unique and awesome while still scanning properly. They'll grade on originality, best use of theme, best use of materials, and most error free scan. I look forward to seeing the results.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-5027389082262428344?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/5027389082262428344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/11/shmoocon-2009-tickets.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/5027389082262428344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/5027389082262428344'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/11/shmoocon-2009-tickets.html' title='Shmoocon 2009 tickets'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-8782533777295111375</id><published>2008-10-29T16:36:00.004-04:00</published><updated>2008-11-01T16:28:52.448-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='nsm'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='snort'/><category scheme='http://www.blogger.com/atom/ns#' term='rhel'/><category scheme='http://www.blogger.com/atom/ns#' term='sguil'/><title type='text'>Snort shared object rules with Sguil</title><content type='html'>More and more &lt;a href="http://www.snort.org/pub-bin/downloads.cgi"&gt;Sourcefire VRT Snort rules&lt;/a&gt; are being released in the shared object (SO) rules format. As examples, Sourcefire released rules on 14 October that were designed to detect attacks targeting &lt;a href="http://www.microsoft.com/technet/security/Bulletin/ms08-057.mspx"&gt;MS08-057&lt;/a&gt;, &lt;a href="http://www.microsoft.com/technet/security/Bulletin/ms08-058.mspx"&gt;MS08-058&lt;/a&gt;, &lt;a href="http://www.microsoft.com/technet/security/Bulletin/ms08-059.mspx"&gt;MS08-059&lt;/a&gt;, &lt;a href="http://www.microsoft.com/technet/security/Bulletin/ms08-060.mspx"&gt;MS08-060&lt;/a&gt;, &lt;a href="http://www.microsoft.com/technet/security/Bulletin/ms08-062.mspx"&gt;MS08-062&lt;/a&gt;, &lt;a href="http://www.microsoft.com/technet/security/Bulletin/ms08-063.mspx"&gt;MS08-063&lt;/a&gt; and &lt;a href="http://www.microsoft.com/technet/security/Bulletin/ms08-065.mspx"&gt;MS08-065&lt;/a&gt; vulnerabilities. On 23 October, Sourcefire released rules related to &lt;a href="http://www.microsoft.com/technet/security/Bulletin/ms08-067.mspx"&gt;MS08-067&lt;/a&gt;, a vulnerability that has garnered a lot of attention.&lt;br /&gt;&lt;br /&gt;It looks like all these recently released rules are SO rules. It is easy to tell a SO rule from a traditional Snort rule using the Generator ID, because SO rules use GID 3 while the old rule format uses GID 1.&lt;br /&gt;&lt;br /&gt;Because Sourcefire is issuing all these rules in SO format, if you don't want to miss rules for recent vulnerabilities it is definitely important to test and implement the new format and keep the rules updated. When I implemented the rules in production, I used &lt;a href="http://searchsecuritychannel.techtarget.com/tip/0,289483,sid97_gci1299181,00.html"&gt;How to use shared object rules in Snort&lt;/a&gt; by &lt;a href="http://taosecurity.blogspot.com/"&gt;Richard Bejtlich&lt;/a&gt; as a guide for adding shared object rules to Snort. It seems fairly complete and I was able to get the precompiled rules working on RHEL/CentOS.&lt;br /&gt;&lt;br /&gt;Unfortunately, getting the rules working and updating them is not as simple and certainly not identical to updating rules that use the old format. Oinkmaster will edit the stub files to enable and disable the SO rules, but it requires running Oinkmaster a second time with a separate configuration file. From the &lt;a href="http://oinkmaster.cvs.sourceforge.net/oinkmaster/oinkmaster/FAQ?view=markup"&gt;Oinkmaster FAQ&lt;/a&gt;:&lt;br /&gt;&lt;pre&gt;&lt;blockquote&gt;Q34: Can Oinkmaster update the shared object rules (so_rules)?&lt;br /&gt;&lt;span class="hl line"&gt;  &lt;/span&gt;&lt;br /&gt;&lt;span class="hl line"&gt;&lt;/span&gt;A34: Yes, but you have to run Oinkmaster separately with its own&lt;br /&gt;&lt;span class="hl line"&gt;&lt;/span&gt;     configuration file. Copy your regular oinkmaster.conf file&lt;br /&gt;&lt;span class="hl line"&gt;&lt;/span&gt;     to oinkmaster-so-rules.conf (or create a new one) and set&lt;br /&gt;     "rules_dir = so_rules". Then run Oinkmaster with&lt;br /&gt;     -C &amp;lt;path tooinkmaster-so-rules.conf&amp;gt; and use an output directory&lt;br /&gt;     (-o &amp;lt;dir&amp;gt;) different than your regular rules directory. This is&lt;br /&gt;     important as the "rules" and "so_rules" directories contains&lt;br /&gt;     files with identical filenames. See the Snort documentation on how&lt;br /&gt;     to use shared object rules. The shared object rules are currently&lt;br /&gt;     disabled by default so you have to use "enablesid" or "modifysid"&lt;br /&gt;     to activate the ones you want to use.&lt;path&gt;&lt;/path&gt;&lt;/blockquote&gt;&lt;/pre&gt;To update my rules, I first download  the rules and run Oinkmaster to update my GID 1 rules. Then I extract the so_rules so I can run Snort with the '--dump-dynamic-rules' option. This will generate the required stub files, but they will not contain any changes you made to enable or disable specific rules. To change which are enabled or disabled, I run Oinkmaster again with the oinkmaster-so-rules.conf.&lt;br /&gt;&lt;br /&gt;For Sguil to properly show the rule msg in the 'Event Message' column on the client, you must generate a new gen-msg.map file. &lt;a href="http://blog.vorant.com/"&gt;David Bianco&lt;/a&gt; gave me a couple shell commands, one of which uses 'create-sidmap.pl' from the Oinkmaster contrib directory, to update the gen-msg.map file.&lt;br /&gt;&lt;pre&gt;create-sidmap.pl ruledir/so_rules | perl -ne 'm/(\d+) \|\| ([^\|]+) \|\|/g; print "3 || $1 || $2\n";' &gt; ruledir/so_rules/gen-msg.map&lt;br /&gt;&lt;br /&gt;cat ruledir/gen-msg.map ruledir/so_rules/gen-msg.map | sort -n | uniq &gt; ruledir/so_rules/gen-msg-merged.map&lt;/pre&gt;After you check that the new file is correct, it can be moved to overwrite the old gen-msg.map. The alert name will be found based on the GID and SID, so without the update you would only see the numerical GID and SID when viewing alerts in Sguil instead of the actual text of the alert message.&lt;br /&gt;&lt;br /&gt;One last thing to do is get the "Show Rule" checkbox in Sguil to show the rule stub when viewing SO rules. A quick temporary fix is fairly simple. Either rename and place all the rule stub files in the directory on your sguild server with all the other rules, or use a symbolic link. Either way, you have to use alternate names since the SO rules stub files use the same naming scheme as the standard rule files.&lt;br /&gt;&lt;br /&gt;Once that is done, it just requires a simple change to 'extdata.tcl' in the 'lib' directory of the Sguil client. Change the following line:&lt;br /&gt;&lt;pre&gt; if { $genID != "1" } {&lt;/pre&gt;to&lt;br /&gt;&lt;pre&gt; if { $genID != "1" &amp;amp;&amp;amp; $genID != "3" } {&lt;/pre&gt;David Bianco pointed out that there is nothing to prevent SO rules and standard rules from sharing a SID since they have a different GID, so the above solution could get the wrong rule message if there are identical SIDs. He said he will probably add code to look in the ruledir for GID 1, and look in ruledir/so_rules for GID 3. This is definitely the better way and not too complicated, so hopefully Sguil CVS will have the code added in the near future.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-8782533777295111375?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/8782533777295111375/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/10/snort-shared-object-rules-with-sguil.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/8782533777295111375'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/8782533777295111375'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/10/snort-shared-object-rules-with-sguil.html' title='Snort shared object rules with Sguil'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297187840164530151.post-6571410833839430487</id><published>2008-10-06T05:30:00.006-04:00</published><updated>2008-10-09T20:39:00.012-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='system administration'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='rhel'/><category scheme='http://www.blogger.com/atom/ns#' term='ldap'/><title type='text'>OpenLDAP continued</title><content type='html'>After &lt;a href="http://eatingsecurity.blogspot.com/2008/09/setting-up-openldap-for-centralized.html"&gt;initially configuring, setting up and testing LDAP&lt;/a&gt;, I still had a lot to resolve. Issues included password maintenance, 'sudo' only looking in the local sudoers files, adding a sudoers file to LDAP, setting up groups, replication of the LDAP database, and configuring fail-over.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="#passwords"&gt;Passwords&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="#groups"&gt;LDAP Groups&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="#sudo"&gt;sudo&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="#replication"&gt;Replication&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="#management"&gt;LDAP Management&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;The &lt;a href="http://www.openldap.org/doc/"&gt;OpenLDAP Administrator's Guides&lt;/a&gt; are extensive and useful, so don't forget to refer to the documentation for initial setup and more advanced topics.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;a name="passwords"&gt;Passwords&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;OpenLDAP has a default schema, nis.schema, that contains definitions for both Posix accounts and shadow accounts. By including the object class 'shadowAccount' when creating users, it allows defining some password requirements in LDAP.&lt;br /&gt;&lt;pre&gt;shadowMin: 0&lt;br /&gt;shadowMax: 180&lt;br /&gt;shadowWarning: 14&lt;br /&gt;shadowInactive: 30&lt;br /&gt;shadowExpire: -1&lt;/pre&gt;They are mostly self-explanatory and correspond to local 'passwd' or 'chage' options. On my setup, I also was able to make users change passwords on first login. I tried both 'passwd' and 'chage' to do this, but neither recognized the LDAP accounts when used with options to expire passwords. I can only assume that defining the 'shadowAccount' variables caused the behavior requiring an initial password change, because new users were not forced to change passwords prior to defining the shadow variables. I will edit this with updates if I figure out exactly how to require a password change at initial logon when using LDAP accounts.&lt;br /&gt;&lt;br /&gt;Changing passwords with OpenLDAP works the same as local accounts. Simply use 'passwd', enter current LDAP password, then the new password.&lt;br /&gt;&lt;br /&gt;Although I have various password requirements set using cracklib in &lt;tt&gt;/etc/pam.d/system-auth&lt;/tt&gt; on RHEL, the checks did not seem to be run when changing LDAP user passwords. After reading the manual for pam_cracklib, I saw that some of my settings were not correct. After correcting the settings, pam_cracklib started enforcing my password complexity requirements. Note that pam_cracklib must be configured on each local system even when the passwords are stored in LDAP. Below is an example configuration from the pam_cracklib manual.&lt;br /&gt;&lt;pre&gt; password  required pam_cracklib.so \&lt;br /&gt;                       dcredit=-1 ucredit=-1 ocredit=-1 lcredit=0 minlen=8&lt;/pre&gt;OpenLDAP also has a &lt;a href="http://www.openldap.org/doc/admin24/overlays.html#Password%20Policies"&gt;password policy overlay&lt;/a&gt;, but it does not appear to include enforcement of password complexity. It will enforce password reuse policy, password expiration, and other similar policies. It is not available in OpenLDAP 2.2, but at least on RHEL5 with OpenLDAP 2.3 the password policy overlay seems to be included as a schema.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;&lt;a name="groups"&gt;LDAP Groups&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Just as LDAP allows you to centralize user accounts, you can also use it to centralize groups or add LDAP groups in addition to local groups. As with any bulk additions to LDAP, you can use a ldif file to add the groups. For example, the following could be used to add a group called "analysts" and a group called "sr_analysts". The "Group" OU must exist prior to adding these groups, or you can add the Group OU from the same file as long as it comes before the groups that will be within the OU.&lt;br /&gt;&lt;pre&gt;dn: cn=sr_analysts,ou=Group,dc=security,dc=test,dc=com&lt;br /&gt;objectClass: top&lt;br /&gt;objectClass: posixGroup&lt;br /&gt;gidNumber: 1010&lt;br /&gt;cn: sr_analysts&lt;br /&gt;memberUid: nexample&lt;br /&gt;memberUid: nother&lt;br /&gt;&lt;br /&gt;dn: cn=analysts,ou=Group,dc=security,dc=test,dc=com&lt;br /&gt;objectClass: top&lt;br /&gt;objectClass: posixGroup&lt;br /&gt;gidNumber: 1011&lt;br /&gt;cn: analysts&lt;br /&gt;memberUid: luser&lt;br /&gt;&lt;/pre&gt;To add the groups and test:&lt;br /&gt;&lt;pre&gt;$ ldapadd -x -D "cn=Manager,dc=security,dc=test,dc=com" -W -f groups.ldif&lt;br /&gt;Enter LDAP Password:&lt;br /&gt;adding new entry "cn=sr_analysts,ou=groups,dc=security,dc=test,dc=com"&lt;br /&gt;&lt;br /&gt;adding new entry "cn=analysts,ou=groups,dc=security,dc=test,dc=com"&lt;br /&gt;&lt;br /&gt;$ getent group&lt;br /&gt;----- snip -----&lt;br /&gt;sr_analysts:x:1010:nexample,nother&lt;br /&gt;analysts:x:1011:luser&lt;br /&gt;&lt;/pre&gt;&lt;span style="font-weight: bold;"&gt;&lt;a name="sudo"&gt;sudo&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The version of 'sudo' provided in RHEL/CentOS v4 is not compiled for LDAP, while in RHEL/CentOS v5 the package was built using &lt;tt&gt;--with-ldap&lt;/tt&gt;.&lt;br /&gt;&lt;pre&gt;$ ldd $(type -p sudo) | grep ldap&lt;br /&gt;libldap-2.3.so.0 =&gt; /usr/lib/libldap-2.3.so.0&lt;/pre&gt;Whether you need to compile or build a 'sudo' RPM with LDAP support on RHEL4 may depend on how complex your 'sudoers' needs to be. If you only need to add support for certain people to be in the wheel group then you can easily rely on the standard RHEL/CentOS v4 'sudo' by uncommenting wheel in the local 'sudoers' file and creating the needed LDAP user accounts with &lt;tt&gt;gidNumber: 10&lt;/tt&gt;, which is the default for the wheel group on RHEL. As long as the local system has wheel with GID of 10 then the LDAP account will be seen as a local sudoer on the system. If 'sudo' needs are more complex, it may be worth creating a custom RPM for 'sudo' using &lt;tt&gt;--with-ldap&lt;/tt&gt;. I have not tried this with 'sudo', but I have downloaded RHEL5 source RPMs for other software and successfully built a RPM for RHEL4.&lt;br /&gt;&lt;br /&gt;If using LDAP on RHEL5, it definitely makes sense to move the 'sudoers' to LDAP. Since the purpose of groups is to ease system administration by grouping users logically, it makes sense to create a 'sudoers' LDAP container and then allow groups to perform 'sudo' commands rather than adding and removing individual accounts.&lt;br /&gt;&lt;br /&gt;Prior to adding 'sudoers' and related information into LDAP, I had to add 'schema.OpenLDAP', which is included with the 'sudo' source, to my schema directory and include it in my 'slapd.conf'. I also renamed it to 'sudo.schema'.&lt;br /&gt;&lt;br /&gt;After adding the schema, I used another file from the 'sudo' source, README.LDAP, as an example for creating the following ldif file. I tried using &lt;tt&gt;sudoOption: env_keep&lt;/tt&gt;, but kept getting errors saying the option was not recognized despite the examples I've seen showing its use.&lt;br /&gt;&lt;pre&gt;dn: ou=SUDOers,ou=role,dc=security,dc=test,dc=com&lt;br /&gt;objectClass: top&lt;br /&gt;objectClass: organizationalUnit&lt;br /&gt;ou: SUDOers&lt;br /&gt;&lt;br /&gt;dn: cn=defaults,ou=SUDOers,ou=role,dc=security,dc=test,dc=com&lt;br /&gt;objectClass: top&lt;br /&gt;objectClass: sudoRole&lt;br /&gt;cn: defaults&lt;br /&gt;description: Default sudo options go here&lt;br /&gt;sudoOption: requiretty&lt;br /&gt;sudoOption: env_reset&lt;br /&gt;&lt;br /&gt;dn: cn=analyst_script,ou=SUDOers,ou=role,dc=security,dc=test,dc=com&lt;br /&gt;objectClass: top&lt;br /&gt;objectClass: sudoRole&lt;br /&gt;cn: analyst_script&lt;br /&gt;sudoUser: %analysts&lt;br /&gt;sudoHost: ALL&lt;br /&gt;sudoCommand: /path/to/script&lt;br /&gt;sudoOption: !authenticate&lt;br /&gt;&lt;br /&gt;dn: cn=sr_analysts_all,ou=SUDOers,ou=role,dc=security,dc=test,dc=com&lt;br /&gt;objectClass: top&lt;br /&gt;objectClass: sudoRole&lt;br /&gt;cn: sr_wheel&lt;br /&gt;sudoUser: %sr_analysts&lt;br /&gt;sudoHost: ALL&lt;br /&gt;sudoCommand: ALL&lt;br /&gt;&lt;/pre&gt;Those in the &lt;tt&gt;analysts&lt;/tt&gt; LDAP group will be able to run &lt;tt&gt;/path/to/script&lt;/tt&gt; with no password while those in the &lt;tt&gt;sr_analysts&lt;/tt&gt; group can run all commands but a password is required. As another example, changing &lt;tt&gt;sudoUser&lt;/tt&gt; to '%wheel' would allow all accounts in the 'wheel' group to execute &lt;tt&gt;sudoCommand&lt;/tt&gt;. The 'cn' for the 'sudoRole' does not have to correspond to anything, but it makes sense to name it something that reflects what the role is for.&lt;br /&gt;&lt;br /&gt;The percent sign for 'sudoUser' is only used in front of  group names, not users, the same syntax as the local 'sudoers' file.&lt;br /&gt;&lt;br /&gt;Finally, don't forget to modify &lt;tt&gt;/etc/ldap.conf&lt;/tt&gt; to include &lt;tt&gt;sudoers_base&lt;/tt&gt; and &lt;tt&gt;sudoers_debug&lt;/tt&gt;. Debug can normally be set to '0' but setting it to '2' for troubleshooting is extremely useful. The following shows the output of &lt;tt&gt;sudo -l&lt;/tt&gt; with &lt;tt&gt;sudoers_debug 2&lt;/tt&gt;. It is the result of the wheel group being in both the local and LDAP sudoers.&lt;br /&gt;&lt;pre&gt;[nr@ldap ~]$ sudo -l&lt;br /&gt;LDAP Config Summary&lt;br /&gt;===================&lt;br /&gt;host         192.168.1.10&lt;br /&gt;port         389&lt;br /&gt;ldap_version 3&lt;br /&gt;sudoers_base ou=SUDOers,ou=roles,dc=security,dc=test,dc=com&lt;br /&gt;binddn       cn=proxyuser,ou=roles,dc=security,dc=test,dc=com&lt;br /&gt;bindpw       PASSWORD&lt;br /&gt;ssl          start_tls&lt;br /&gt;===================&lt;br /&gt;ldap_set_option(LDAP_OPT_X_TLS_REQUIRE_CERT,0x00)&lt;br /&gt;ldap_init(192.168.1.10,389)&lt;br /&gt;ldap_set_option(LDAP_OPT_PROTOCOL_VERSION,0x03)&lt;br /&gt;ldap_start_tls_s() ok&lt;br /&gt;ldap_bind() ok&lt;br /&gt;found:cn=defaults,ou=SUDOers,ou=roles,dc=security,dc=test,dc=com&lt;br /&gt;ldap sudoOption: 'requiretty'&lt;br /&gt;ldap sudoOption: 'env_reset'&lt;br /&gt;ldap search '(|(sudoUser=nr)(sudoUser=%wheel)(sudoUser=%wheel)(sudoUser=%sr_analysts)(sudoUser=ALL))'&lt;br /&gt;found:cn=analyst_script,ou=SUDOers,ou=roles,dc=security,dc=test,dc=com&lt;br /&gt;ldap sudoHost 'ALL' ... MATCH!&lt;br /&gt;found:cn=sr_analysts_all,ou=SUDOers,ou=roles,dc=security,dc=test,dc=com&lt;br /&gt;ldap sudoHost 'ALL' ... MATCH!&lt;br /&gt;ldap search 'sudoUser=+*'&lt;br /&gt;user_matches=-1&lt;br /&gt;host_matches=-1&lt;br /&gt;sudo_ldap_check(50)=0x02&lt;br /&gt;Password:&lt;br /&gt;User nr may run the following commands on this host:&lt;br /&gt;(ALL) ALL&lt;br /&gt;&lt;br /&gt;LDAP Role: sr_analysts_all&lt;br /&gt;Commands:&lt;br /&gt;ALL&lt;span style="font-family:Georgia,serif;"&gt;&lt;/span&gt;&lt;/pre&gt;Also note that the OpenLDAP Administrator's Guide has an overlay for &lt;a href="http://www.openldap.org/doc/admin24/overlays.html#Dynamic%20Lists"&gt;dynamic lists&lt;/a&gt;, which includes the functions available in the deprecated dynamic groups overlay.&lt;br /&gt;&lt;a name="replication"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;Replication&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Replication and fail-over are both relatively simple to configure on the OpenLDAP server. Replication either uses 'slurpd' or 'Syncrepl', depending on the &lt;a href="http://www.openldap.org/doc/admin24/replication.html#Replacing%20Slurpd"&gt;OpenLDAP version&lt;/a&gt;. For replication with 'slurpd', the &lt;tt&gt;replogfile&lt;/tt&gt; , &lt;tt&gt;replica host&lt;/tt&gt; or &lt;tt&gt;replica uri&lt;/tt&gt;, &lt;tt&gt;binddn&lt;/tt&gt;, &lt;tt&gt;bindmethod&lt;/tt&gt;, and &lt;tt&gt;credentials&lt;/tt&gt; variables need to be set in &lt;tt&gt;slapd.conf&lt;span style="font-family:Georgia,serif;"&gt;. &lt;/span&gt;&lt;/tt&gt;Because a 'binddn' and password ('credentials') need to be used for replication, the binddn and password also have to be added to LDAP before replication will work.&lt;br /&gt;&lt;br /&gt;Once the primary server is prepared, slapd needs to be stopped or set to read-only so the existing OpenLDAP database files can be manually copied over to the server receiving the replications. Configuration files on the receiving server also need to be edited, though I was able to just copy my 'slapd.conf' and schemas. The only changes needed to 'slapd.conf' were to remove all the replication directives and replace them with the 'updatedn' that was identical to the replication 'binddn' on the primary server. I also had to make sure that 'binddn' was allowed 'write' so it could add the replicated data. If not, you will get &lt;tt&gt;Error: insufficent access&lt;/tt&gt; when trying to replicate.&lt;br /&gt;&lt;br /&gt;Once the configuration files and database files are copied to the secondary server, 'slapd' needs to be (re)started on both systems. Then 'slurpd' needs to be started so it can periodically check the log file for changes that can be pushed. On RHEL, the 'ldap' init script handles stops, starts, and restarts for both 'slapd' and 'slurpd' at the same time rather than having separate scripts, so &lt;tt&gt;service ldap restart&lt;/tt&gt; would restart both daemons.&lt;br /&gt;&lt;br /&gt;For failover, the LDAP clients' &lt;tt&gt;host&lt;/tt&gt; variable can have a list of hosts separated by spaces, and &lt;tt&gt;bind_timelimit&lt;/tt&gt; is used to determine when the client fails over to the next server. If the first server is unreachable, the client will go on to the next one in the list of hosts.&lt;br /&gt;&lt;br /&gt;&lt;a name="management"&gt;&lt;span style="font-weight: bold;"&gt;LDAP Management&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Although using LDIF files is fine at first, managing LDAP entries can become a chore from the command line. The 'sudo' README has a few recommendations that I quote below.&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;Doing a one-time bulk load of your ldap entries is fine.  However what if you&lt;br /&gt;need to make minor changes on a daily basis?  It doesn't make sense to delete&lt;br /&gt;and re-add objects.  (You can, but this is tedious).&lt;br /&gt;&lt;br /&gt;I recommend using any of the following LDAP browsers to administer your SUDOers.&lt;br /&gt;* GQ - The gentleman's LDAP client - Open Source - I use this a lot on Linux&lt;br /&gt;and since it is Schema aware, I don't need to create a sudoRole template.&lt;br /&gt;http://biot.com/gq/&lt;br /&gt;&lt;br /&gt;* LDAP Browser/Editor - by Jarek Gawor - I use this a lot on Windows&lt;br /&gt;and Solaris.  It runs anywhere in a Java Virtual Machine including&lt;br /&gt;web pages.  You have to make a template from an existing sudoRole entry.&lt;br /&gt;http://www.iit.edu/~gawojar/ldap&lt;br /&gt;http://www.mcs.anl.gov/~gawor/ldap&lt;br /&gt;http://ldapmanager.com&lt;br /&gt;&lt;br /&gt;* Apache Directory Studio - Open Source - an Eclipse-based LDAP&lt;br /&gt;development platform.  Includes an LDAP browser, and LDIF editor,&lt;br /&gt;a schema editor and more.&lt;br /&gt;http://directory.apache.org/studio&lt;br /&gt;&lt;br /&gt;There are dozens of others, some Open Source, some free, some not.&lt;/pre&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-6571410833839430487?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/6571410833839430487/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/10/openldap-continued.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/6571410833839430487'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/6571410833839430487'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/10/openldap-continued.html' title='OpenLDAP continued'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297187840164530151.post-4961307556803443775</id><published>2008-09-19T05:13:00.025-04:00</published><updated>2008-09-29T14:54:05.934-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='system administration'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='rhel'/><category scheme='http://www.blogger.com/atom/ns#' term='ldap'/><title type='text'>Setting up OpenLDAP for centralized accounts</title><content type='html'>I recently decided to move to centralized account management on some RHEL systems. There are a number of ways to do this, including &lt;a href="http://www.linux-nis.org/" target="_blank"&gt;NIS&lt;/a&gt;, &lt;a href="http://tldp.org/HOWTO/html_single/Kerberos-Infrastructure-HOWTO/" target="_blank"&gt;kerberos&lt;/a&gt;, Active Directory, &lt;a href="http://www.openldap.org/" target="_blank"&gt;LDAP&lt;/a&gt;, or some combination thereof. Ease of configuration, administrative overhead, and security were the top priorities. I chose LDAP because it is relatively simple and has some support for authentication, encryption, and password hashing. There are definitely security issues, but I plan a separate post to specifically address LDAP security.&lt;br /&gt;&lt;br /&gt;This document:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="#server"&gt;Server configuration&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="#client"&gt;Client configuration&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="#testing"&gt;Testing, using and modifying LDAP&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="#tls"&gt;TLS&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="#administrivia"&gt;Administrivia&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;External resources:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.2/html/Deployment_Guide/s1-ldap-quickstart.html" target="_blank"&gt;Red Hat LDAP deployment guide&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.openldap.org/doc/admin/quickstart.html" target="_blank"&gt;OpenLDAP quick start&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.tldp.org/HOWTO/LDAP-HOWTO/index.html" target="_blank"&gt;TLDP LDAP Howto&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://tldp.org/HOWTO/archived/LDAP-Implementation-HOWTO/index.html" target="_blank"&gt;TLDP LDAP Implementation Howto&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.skills-1st.co.uk/papers/security-with-ldap-jan-2002/security-with-ldap.html" target="_blank"&gt;Security with LDAP&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;&lt;a name="server"&gt;Server configuration&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;First, I install the needed software on the server. Use yum for RHEL/CentOS v5 and up2date for v4. Once the software was installed, I generated a hashed password for LDAP's root user. There are a number of hashing schemes to choose from in the 'slappasswd' manual.&lt;br /&gt;&lt;pre&gt;# yum install openldap-servers openldap-clients openldap&lt;br /&gt;# cd /etc/openldap/&lt;br /&gt;# slappasswd&lt;/pre&gt;After typing in the password twice, you'll get a hash that should be pasted into &lt;tt&gt;/etc/openldap/slapd.conf&lt;/tt&gt;, along with some other edits.&lt;br /&gt;&lt;pre&gt;suffix "dc=security,dc=test,dc=com"&lt;br /&gt;rootdn "cn=Manager,dc=security,dc=test,dc=com"&lt;br /&gt;rootpw {SSHA}&lt;i&gt;hashed_password&lt;/i&gt;&lt;/pre&gt;The default access control policy of allowing anonymous reads with Manager getting write access will need to be changed. Users need write access to their own passwords for 'passwd' to work, anonymous users should only be able to authenticate, and I will let authenticated users read everything but passwords. There are some problems with the default and example configurations in the slapd.conf comments. The following is what I used to enforce saner settings. The rootdn always has write access to everything. I will update if needed since I am still playing with OpenLDAP's access controls.&lt;br /&gt;&lt;pre&gt;access to attrs=userpassword&lt;br /&gt;by anonymous auth&lt;br /&gt;by self write&lt;br /&gt;by * none&lt;br /&gt;&lt;br /&gt;access to *&lt;br /&gt;by self read&lt;br /&gt;by users read&lt;br /&gt;by anonymous auth&lt;/pre&gt;Once the basic server configuration is done, I start the LDAP daemon.&lt;br /&gt;&lt;pre&gt;service ldap start&lt;/pre&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;a name="client"&gt;Client configuration&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;pre&gt;yum install authconfig openldap-clients nss_ldap&lt;/pre&gt;Configuring the client is somewhat confusing because Red Hat and many other distributions have two &lt;tt&gt;ldap.conf&lt;/tt&gt; files. The one needed by nss_ldap is in &lt;tt&gt;/etc&lt;/tt&gt; and OpenLDAP's client configuration file is in &lt;tt&gt;/etc/openldap&lt;/tt&gt;.&lt;br /&gt;&lt;br /&gt;I edited &lt;tt&gt;/etc/ldap.conf&lt;/tt&gt; and &lt;tt&gt;/etc/openldap/ldap.conf&lt;/tt&gt; for &lt;tt&gt;host&lt;/tt&gt;, &lt;tt&gt;base&lt;/tt&gt;, and the &lt;tt&gt;binddn&lt;/tt&gt; and &lt;tt&gt;bindpw&lt;/tt&gt; of proxyuser. proxyuser will be used for read access by nss_ldap since anonymous reads are disallowed. I also added Manager as &lt;tt&gt;rootbinddn&lt;/tt&gt;, which requires creating &lt;tt&gt;/etc/ldap.secret&lt;/tt&gt; with the plain text password, owned by root, and chmod 600. Both ldap.conf files need to be chmod 644.&lt;br /&gt;&lt;br /&gt;OpenLDAP's client configuration file is much smaller and only needs a few changes. Most of the settings are the same though I did notice the TLS directives are different.&lt;br /&gt;&lt;br /&gt;Next, I ran 'authconfig' or 'authconfig-tui' to edit &lt;tt&gt;/etc/pam.d/system-auth&lt;/tt&gt;. From the menu, I selected to use LDAP Authentication and use LDAP for user information. Enabling LDAP Authentication will make local accounts unusable when LDAP is down! The server and base can be set here or manually edited in a &lt;tt&gt;ldap.conf&lt;/tt&gt; file. 'authconfig' will edit &lt;tt&gt;/etc/nsswitch.conf&lt;/tt&gt; to add ldap.&lt;br /&gt;&lt;pre&gt;&lt;tt&gt;passwd:     files ldap&lt;br /&gt;shadow:     files ldap&lt;br /&gt;group:      files ldap&lt;/tt&gt;&lt;/pre&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;a name="testing"&gt;Testing, using and modifying LDAP&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Note that it is easier to test first using the default slapd.conf access controls that allows anonymous users to read rather than the controls above that I am testing. The below search is performed without authenticating.&lt;br /&gt;&lt;pre&gt;&lt;tt&gt;# ldapsearch -x -b '' -s base '(objectclass=*)' namingContexts&lt;br /&gt;# extended LDIF&lt;br /&gt;#&lt;br /&gt;# LDAPv3&lt;br /&gt;# base &lt;&gt; with scope base&lt;br /&gt;# filter: (objectclass=*)&lt;br /&gt;# requesting: namingContexts&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;dn:&lt;br /&gt;namingContexts: dc=security,dc=test,dc=com&lt;br /&gt;&lt;br /&gt;# search result&lt;br /&gt;search: 2&lt;br /&gt;result: 0 Success&lt;br /&gt;&lt;br /&gt;# numResponses: 2&lt;br /&gt;# numEntries: 1&lt;/tt&gt;&lt;/pre&gt;Now that it's working, I need to create an ldif (LDAP Data Interchange Format) file that will hold information to be put into LDAP. It includes a proxy user account that will have read access to LDAP using a password. You can use slappasswd to generate hashes for the password fields in the ldif. Note that my test user in the below LDIF is in the wheel group.&lt;br /&gt;&lt;pre&gt;&lt;tt&gt;dn: dc=security,dc=test,dc=com&lt;br /&gt;objectclass: top&lt;br /&gt;objectclass: organization&lt;br /&gt;objectclass: dcObject&lt;br /&gt;o: NR Test Group&lt;br /&gt;dc: security&lt;br /&gt;&lt;br /&gt;dn: ou=groups,dc=security,dc=test,dc=com&lt;br /&gt;objectclass: organizationalUnit&lt;br /&gt;ou: groups&lt;br /&gt;&lt;br /&gt;dn: ou=people,dc=security,dc=test,dc=com&lt;br /&gt;objectclass: organizationalUnit&lt;br /&gt;ou: people&lt;br /&gt;&lt;br /&gt;dn: ou=role,dc=security,dc=test,dc=com&lt;br /&gt;objectclass: organizationalUnit&lt;br /&gt;ou: role&lt;br /&gt;&lt;br /&gt;dn: cn=proxyuser,ou=role,dc=security,dc=test,dc=com&lt;br /&gt;cn: proxyuser&lt;br /&gt;objectclass: top&lt;br /&gt;objectclass: person&lt;br /&gt;objectclass: posixAccount&lt;br /&gt;objectclass: shadowAccount&lt;br /&gt;uid: proxyuser&lt;br /&gt;uidNumber: 1001&lt;br /&gt;gidNumber: 100&lt;br /&gt;homeDirectory: /home&lt;br /&gt;loginShell: /sbin/nologin&lt;br /&gt;userpassword: don't use plain text&lt;br /&gt;sn: proxyuser&lt;br /&gt;description: Account for read-only access&lt;br /&gt;&lt;br /&gt;dn: cn=N R,dc=security,dc=test,dc=com&lt;br /&gt;cn: N R&lt;br /&gt;objectclass: top&lt;br /&gt;objectclass: person&lt;br /&gt;objectclass: posixAccount&lt;br /&gt;objectclass: shadowAccount&lt;br /&gt;uid: nr&lt;br /&gt;uidNumber: 1002&lt;br /&gt;gidNumber: 10&lt;br /&gt;homeDirectory: /home/nr&lt;br /&gt;loginShell: /bin/bash&lt;br /&gt;userpassword: don't use plain text&lt;br /&gt;sn: R&lt;/tt&gt;&lt;/pre&gt;To load the information from the file into LDAP. Add '-ZZ' to issue StartTLS from any of the ldap* commands:&lt;br /&gt;&lt;pre&gt;&lt;tt&gt;ldapadd -x -ZZ -D "cn=Manager,dc=security,dc=test,dc=com" -W -f ldapinfo.ldif&lt;/tt&gt;&lt;/pre&gt;If there are errors, they should give a hint about the reason. Once the command succeeded, I did a search to display all the information.&lt;br /&gt;&lt;pre&gt;&lt;tt&gt;ldapsearch -x -ZZ -D "cn=Manager,dc=security,dc=test,dc=com" -W -b "dc=security,dc=test,dc=com"&lt;/tt&gt;&lt;/pre&gt;You can also specify search terms.&lt;br /&gt;&lt;pre&gt;&lt;tt&gt;ldapsearch -x -ZZ -D "cn=Manager,dc=security,dc=test,dc=com" -W -b "dc=security,dc=test,dc=com" "cn=proxyus*" uidNumber&lt;br /&gt;Enter LDAP Password:&lt;br /&gt;# extended LDIF&lt;br /&gt;#&lt;br /&gt;# LDAPv3&lt;br /&gt;# base &lt;dc=security,dc=test,dc=com&gt; with scope sub&lt;br /&gt;# filter: cn=proxyu*&lt;br /&gt;# requesting: uidNumber&lt;br /&gt;&lt;br /&gt;# proxyuser, role, security.test.com&lt;br /&gt;dn: cn=proxyuser,ou=role,dc=security,dc=test,dc=com&lt;br /&gt;uidNumber: 1001&lt;br /&gt;&lt;br /&gt;# search result&lt;br /&gt;search: 3&lt;br /&gt;result: 0 Success&lt;br /&gt;&lt;br /&gt;# numResponses: 2&lt;br /&gt;# numEntries: 1&lt;br /&gt;&lt;/dc=security,dc=test,dc=com&gt;&lt;/tt&gt;&lt;/pre&gt;Once the clients are configured with LDAP and working properly, creating an account in LDAP will allow that account to SSH to all systems functioning as LDAP clients. Before trying to authenticate to systems other than the LDAP server, I setup TLS.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;a name="tls"&gt;TLS&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Right now, without any encryption, password hashes and a ton of other information would be streaming through the network if I was not using a local client. To check, I ran 'tcpdump' on the loopback and searched LDAP again.&lt;br /&gt;&lt;pre&gt;&lt;tt&gt;tcpdump -v -i lo -X -s 0&lt;/tt&gt;&lt;/pre&gt;The results of the search could clearly be seen in the traffic as shown from the following snippet (with the hash removed).&lt;br /&gt;&lt;pre&gt;&lt;tt&gt;LoginShell1..    /bin/bash08..userPassword1(.&amp;amp;{SSHA}&lt;/tt&gt;&lt;/pre&gt;The process for configuring TLS is addressed in &lt;a href="http://kbase.redhat.com/faq/FAQ_103_12988.shtm" target="_blank"&gt;Red Hat's FAQ&lt;/a&gt;. For &lt;tt&gt;/etc/openldap/slapd.conf&lt;/tt&gt; I used the following:&lt;br /&gt;&lt;pre&gt;&lt;tt&gt;TLSCertificateFile /etc/pki/tls/certs/slapd.pem&lt;br /&gt;TLSCertificateKeyFile /etc/pki/tls/certs/slapd.pem&lt;/tt&gt;&lt;/pre&gt;If not requiring certificate checks because of self-signing, &lt;tt&gt;/etc/openldap/ldap.conf&lt;/tt&gt; will need &lt;tt&gt;TLS_REQCERT allow&lt;/tt&gt; and according to the comments &lt;tt&gt;/etc/ldap.conf&lt;/tt&gt; is set to default of &lt;tt&gt;tls_checkpeer no&lt;/tt&gt;. I still needed to explicitly set &lt;tt&gt;tls_checkpeer no&lt;/tt&gt; to fix a problem with sudo not finding the uid in the passwd file. Both client configuration files need  &lt;tt&gt;ssl start_tls&lt;/tt&gt; entries.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;&lt;a name="administrivia"&gt;Administrivia&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There are other things to consider when using LDAP accounts to login with SSH. For instance, I edited &lt;tt&gt;/etc/pam.d/sshd&lt;/tt&gt; to have user home directories created when users log in the first time with SSH on a particular system:&lt;br /&gt;&lt;pre&gt;&lt;tt&gt;#%PAM-1.0&lt;br /&gt;auth       required     pam_stack.so service=system-auth&lt;br /&gt;auth       required     pam_nologin.so&lt;br /&gt;account    required     pam_stack.so service=system-auth&lt;br /&gt;password   required     pam_stack.so service=system-auth&lt;br /&gt;session    required     pam_stack.so service=system-auth&lt;br /&gt;session    required     pam_mkhomedir.so skel=/etc/skel/ umask=0077&lt;br /&gt;session    required     pam_loginuid.so&lt;/tt&gt;&lt;/pre&gt;For this to work, you will also need to have &lt;tt&gt;UsePAM yes&lt;/tt&gt; in your sshd_config. On RHEL, you can tell if you are getting errors related to PAM not being enabled in sshd_config.&lt;br /&gt;&lt;pre&gt;# tail -n 1 /var/log/secure&lt;br /&gt;Sep 18 17:11:58 slapd sshd[24274]: fatal: PAM: pam_open_session(): Module is unknown&lt;/pre&gt;At one point in the process, I was getting an error at login:&lt;br /&gt;&lt;pre&gt;&lt;tt&gt;id: cannot find name for user ID 1002&lt;br /&gt;[I have no name!@slapd ~]$ &lt;/tt&gt;&lt;/pre&gt;To fix this, I checked the permissions of &lt;tt&gt;/etc/ldap.conf&lt;/tt&gt; and also made sure the proxyuser was working properly. Without LDAP read permissions, the user name can't be mapped to the user ID. Since I am denying anonymous reads, I have to make sure proxyuser is set up properly.&lt;br /&gt;&lt;br /&gt;You may need to modify iptables rules to allow linux systems to connect on 389. Using TLS will not change the port by default.&lt;br /&gt;&lt;br /&gt;There is a Red Hat FAQ about &lt;a href="http://kbase.redhat.com/faq/FAQ_80_12975.shtm" target="_blank"&gt;getting sudo to work with LDAP&lt;/a&gt;. It will not necessarily work out of the box with LDAP users and groups.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-4961307556803443775?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/4961307556803443775/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/09/setting-up-openldap-for-centralized.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/4961307556803443775'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/4961307556803443775'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/09/setting-up-openldap-for-centralized.html' title='Setting up OpenLDAP for centralized accounts'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297187840164530151.post-8107021136884104198</id><published>2008-09-12T20:22:00.004-04:00</published><updated>2008-09-13T02:55:32.454-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='risk'/><category scheme='http://www.blogger.com/atom/ns#' term='wireless'/><title type='text'>Grass is green, sky is blue, news at 11</title><content type='html'>&lt;a href="http://www.darkreading.com/document.asp?doc_id=163671"&gt;&lt;span style="font-style: italic;"&gt;Study: Hotel Networks Put Corporate Users at Risk&lt;/span&gt;&lt;/a&gt;. You think?&lt;br /&gt;&lt;br /&gt;Is it any surprise that most hotels use unencrypted or weak encryption for wireless? Is it any surprise that a substantial number still use hubs instead of switched networks?&lt;br /&gt;&lt;br /&gt;It would surprise me more if hotels consistently worried about security for their guests' networks. If only 21 percent of hotels had reports of "wrongdoing" on their guest networks, that means the percentage of guests that report attacks is actually much lower. There is little financial incentive for the hotels to upgrade hardware and configure networks to prevent malicious activity. Most road warriors are more worried about convenience than security.&lt;br /&gt;&lt;br /&gt;I bet encryption on hotel wireless networks causes more complaints than unencrypted wireless.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-8107021136884104198?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/8107021136884104198/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/09/grass-is-green-sky-is-blue-news-at-11.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/8107021136884104198'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/8107021136884104198'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/09/grass-is-green-sky-is-blue-news-at-11.html' title='Grass is green, sky is blue, news at 11'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-441215004966244016</id><published>2008-09-09T21:03:00.007-04:00</published><updated>2008-09-12T20:53:20.760-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cloud'/><category scheme='http://www.blogger.com/atom/ns#' term='risk'/><title type='text'>My take on cloud computing</title><content type='html'>I heard an &lt;a href="http://www.npr.org/templates/story/story.php?storyId=94407506"&gt;interesting story&lt;/a&gt; about &lt;a href="http://www.google.com/chrome"&gt;Google's Chrome browser&lt;/a&gt; on NPR's &lt;a href="http://www.npr.org/templates/rundowns/rundown.php?prgId=3"&gt;Morning Edition&lt;/a&gt; for 09 September. While it was billed as a review of Chrome, the first question asked by host Renee Montagne to commentator Mario Armstrong was how Google planned to make money with a browser. This led to some discussion of the browser becoming the computer, part of what is sometimes known as &lt;a href="http://en.wikipedia.org/wiki/Cloud_computing"&gt;cloud computing&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The first way noted by Mr. Armstrong to make money on a free browser was of course through advertising. The holy grail of advertising these days seems to be targeted ads. For example, search terms, cookies, browser history and email contents can provide a lot of context to be used for targeting ads. This type of information can certainly be used for unintended purposes, not just targeting ads or selling anonymized user data.&lt;br /&gt;&lt;br /&gt;The second answer on how to make money from a browser, more significant from a security perspective, was to build a customer base in anticipation of services moving to the cloud. Cloud computing and security has been discussed quite a bit by others [Examples: &lt;a href="http://cloudsecurity.org/"&gt;1&lt;/a&gt;,&lt;a href="http://taosecurity.blogspot.com/2008/06/old-school-layer-2-hacking.html"&gt;2&lt;/a&gt;,&lt;a href="http://www.networkworld.com/columnists/2006/021306faceoffyes.html"&gt;3&lt;/a&gt;,&lt;a href="http://taosecurity.blogspot.com/2008/07/hint-of-visibility-in-cloud.html"&gt;4&lt;/a&gt;]. Mr. Armstrong went on to discuss three important facets of a browser, particularly in relation to cloud computing. To paraphrase from the NPR story:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Speed - If you are going to move applications to the cloud, the browser better be fast enough to compare with a local application.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Stability - No matter if an application is in the cloud or local, users and developers don't like their applications to crash. If the application runs in a browser, the browser needs to be stable.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Security - Moving applications to the cloud obviously means that you're moving data through and to the cloud, dramatically changing a number of security implications.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;My take on moving applications to the cloud is that it is useful but over-hyped, just like lots of "&lt;a href="http://rationalsecurity.typepad.com/blog/2008/09/the-most-overus.html"&gt;next generation&lt;/a&gt;" technology. There are just too many drawbacks for most of us to move all our applications to the cloud. I don't think it's likely that the browser or the cloud will ever become the computer, just like the computer will never be disassociated from the cloud.&lt;br /&gt;&lt;br /&gt;Regardless of whether you buy into the hype, cloud security is an issue because users will make decisions on their own. Google's applications are an excellent example. Their search, calendar, documents, and &lt;a href="http://www.google.com/intl/en/options/"&gt;more&lt;/a&gt; have potential to put sensitive company or personal information in the cloud. Google documents makes it so easy to share documents with my coworkers! Google Desktop makes it so easy to find and keep track of my files! What do you mean we already have a way to do that? What do you mean we aren't allowed to store those documents on the Internet?&lt;br /&gt;&lt;br /&gt;Just to make sure I'm not singling out Google, another instance of cloud computing is &lt;a href="http://aws.amazon.com/ec2"&gt;Amazon's Elastic Compute Cloud&lt;/a&gt; (EC2), which basically allows you to build a virtual machine in Amazon's cloud and then pay for processor time. EC2 is a great example of cloud computing allowing flexibility and computing power without breaking the bank. You can run any number of "small" to "High-CPU very large" instances, scaling resources as needed and starting at only $0.10 per hour per instance!&lt;br /&gt;&lt;br /&gt;This scenario was mentioned by someone else, but consider the security implications of putting information in Amazon's cloud, for instance using EC2 to crack a Windows SAM during a security assessment. Sure, you could easily come up with an accurate quote for the EC2 computing time to crack a SAM, but it would be important to disclose the use of EC2 to the customer. If you're using Amazon's processing capability, how are you going to make sure the data stays secure as it floats somewhere in their cloud? How many new avenues of attack have you introduced by using cloud computing? Is it even possible to quantify these risks with the amount of information you have about their cloud?&lt;br /&gt;&lt;br /&gt;There are security issues with cloud computing even if the data is not explicitly sensitive like a Windows SAM. Data to be crunched? Video to be rendered? Documents to be stored? Is your data worth money? Who will protect the data and how?&lt;br /&gt;&lt;br /&gt;Cloud computing is here in varying degrees depending on your organization, but using it means giving up some amounts of control over your data. Whether the convenience of the cloud is worth it is definitely a risk versus reward issue, and a lot of the risk depends on the sensitivity of the data.&lt;br /&gt;&lt;br /&gt;Edit: &lt;a href="http://www.infoworld.com/article/08/09/12/Cloud_computing_may_draw_government_action_1.html"&gt;InfoWorld posted an article&lt;/a&gt; about government concerns with cloud computing, particularly who owns data that is stored in the cloud, whether law enforcement should have a lower threshold for gaining access to data in the cloud, and whether government should embrace cloud computing for its needs.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-441215004966244016?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/441215004966244016/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/09/my-take-on-cloud-computing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/441215004966244016'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/441215004966244016'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/09/my-take-on-cloud-computing.html' title='My take on cloud computing'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-4831136458290880055</id><published>2008-09-05T22:03:00.001-04:00</published><updated>2008-09-05T22:59:41.041-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><category scheme='http://www.blogger.com/atom/ns#' term='sguil'/><category scheme='http://www.blogger.com/atom/ns#' term='sancp'/><title type='text'>Modified: Pulling IP addresses from Snort rules</title><content type='html'>This is a modification of &lt;a href="http://eatingsecurity.blogspot.com/2007/09/pulling-ip-addresses-and-ranges-from.html"&gt;another script I wrote&lt;/a&gt; to pull IP addresses from Snort rules. Since the last time I posted it, I added support for multiple rules files and also automatically insert the IP addresses into the database. After that, I can run a query to compare the IP addresses with sancp data to see what systems connected or attempted connections to the suspicious hosts.&lt;br /&gt;&lt;br /&gt;I think this version will only work with MySQL 5.x, not 4.x, because of the section that adds the IP addresses to the database. In the older versions, the IP addresses had to be added manually. Note that the table used for the $tablename variable is not part of the Sguil database schema and must be created before running the script. Make sure not to use a table that is part of the Sguil DB schema because this script deletes all data from the table!&lt;br /&gt;&lt;br /&gt;The script is fairly slow since it expands CIDR blocks to individual IP addresses and then puts them in the database one by one. If anyone has ideas for a more efficient method, I'd love to hear it, but since I'm using Sguil I need to be able to compare the suspicious IP addresses with individual IP addresses in the Sguil sancp table.&lt;br /&gt;&lt;pre&gt;#&lt;br /&gt;# Script to pull IP address from Snort rules file&lt;br /&gt;# by nr&lt;br /&gt;# 2007-08-30&lt;br /&gt;# 2007-09-14 Added CIDR expansion&lt;br /&gt;# 2007-12-19 Added support for multiple rule files&lt;br /&gt;# 2008-05-22 Added MySQL support to insert and convert IPs&lt;br /&gt;&lt;br /&gt;use strict;&lt;br /&gt;use Mysql;&lt;br /&gt;&lt;br /&gt;my $dir = "/nsm/rules"; # rules directory&lt;br /&gt;my @rulefile = qw( emerging-compromised.rules emerging-rbn.rules );&lt;br /&gt;my @rule; # unprocessed rules&lt;br /&gt;&lt;br /&gt;foreach my $rulefile(@rulefile) {&lt;br /&gt;    # Open file to read&lt;br /&gt;    die "Can't open rulefile.\n" unless open RULEFILE, "&lt;", "$dir/$rulefile";&lt;br /&gt;    chomp(@rule = (@rule,&amp;lt;RULEFILE&amp;gt;)&lt;rulefile&gt;); # put each rules into array&lt;br /&gt;    close RULEFILE; # close current rule file&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;# Open mysql connection&lt;br /&gt;my $host = "localhost";&lt;br /&gt;my $database = "sguildb";&lt;br /&gt;my $tablename = "suspicious_hosts";&lt;br /&gt;my $colname = "dst_ip";&lt;br /&gt;my $user = "sguil";&lt;br /&gt;my $pw = "PASSWORD";&lt;br /&gt;&lt;br /&gt;# perl mysql connect()&lt;br /&gt;my $sql_connect = Mysql-&gt;connect($host, $database, $user, $pw);&lt;br /&gt;&lt;br /&gt;# clear out old IP addresses first&lt;br /&gt;my $sql_delete = "DELETE FROM $tablename";&lt;br /&gt;my $execute = $sql_connect-&gt;query($sql_delete) or die "$!";&lt;br /&gt;&lt;br /&gt;# For each rule&lt;br /&gt;foreach my $rule (@rule) {&lt;br /&gt;    # Match only rules with IP addresses so we don't get comments etc&lt;br /&gt;    # This string match does not check for validity of IP addresses&lt;br /&gt;    if ( $rule =~ /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/ ) {&lt;br /&gt;        $rule =~ s/.*\[//g; # Remove [ character and before&lt;br /&gt;        $rule =~ s/\].*//g; # Remove ] character and after&lt;br /&gt;        # Split the remaining data using the commas&lt;br /&gt;        # and put it into ip_address array&lt;br /&gt;        my @ip_address = split /\,/, $rule;&lt;br /&gt;&lt;br /&gt;        # For each IP address in array&lt;br /&gt;        foreach my $ip_address (@ip_address) {&lt;br /&gt;&lt;br /&gt;            # Match on slash&lt;br /&gt;            if ( $ip_address =~ /.*\/.*/ ) {&lt;br /&gt;&lt;br /&gt;                # Expand CIDR to all IP addresses in range modified from&lt;br /&gt;                # http://www.perlmonks.org/?displaytype=print;node_id=190497&lt;br /&gt;                use NetAddr::IP;&lt;br /&gt;                my $newip = new NetAddr::IP($ip_address);&lt;br /&gt;&lt;br /&gt;                # While less than broadcast address&lt;br /&gt;                while ( $newip &lt; $newip-&gt;broadcast) {&lt;br /&gt;                    # Strip trailing slash and netmask from IP&lt;br /&gt;                    my $temp_ip = $newip;&lt;br /&gt;                    $temp_ip =~ s/\/.*//g;&lt;br /&gt;                    # sql statement to insert IP&lt;br /&gt;                    my $sql_statement = "INSERT INTO $tablename SET $colname = INET_ATON('$temp_ip')";&lt;br /&gt;                    # execute statement&lt;br /&gt;                    my $execute = $sql_connect-&gt;query($sql_statement); # Run statement&lt;br /&gt;                    $newip ++; # Increment to next IP&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;            # For non-CIDR, simply print IP&lt;br /&gt;            else {&lt;br /&gt;                # sql statement to insert IP&lt;br /&gt;                my $sql_statement = "INSERT INTO $tablename SET $colname = INET_ATON('$ip_address')";&lt;br /&gt;                # execute statement. maybe make this a function or otherwise clean&lt;br /&gt;                # since it is repeated inside the if&lt;br /&gt;                my $execute = $sql_connect-&gt;query($sql_statement); # Run statement&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/rulefile&gt;&lt;/pre&gt;To search for connections or attempted connections to the suspicious IP addresses, you could use a query like the following. Obviously, the query should change based on criteria like the the ports that interest you, time of activity, protocol, etc.&lt;br /&gt;&lt;pre&gt;SELECT sancp.sid,INET_NTOA(sancp.src_ip),sancp.src_port,INET_NTOA(sancp.dst_ip),sancp.dst_port, \&lt;br /&gt;sancp.start_time FROM sancp INNER JOIN suspicious_hosts ON (sancp.dst_ip = suspicious_hosts.dst_ip) WHERE \&lt;br /&gt;sancp.start_time &gt;= DATE_SUB(UTC_DATE(),INTERVAL 24 HOUR) AND sancp.dst_port = '80';&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-4831136458290880055?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/4831136458290880055/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/09/modified-pulling-ip-addresses-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/4831136458290880055'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/4831136458290880055'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/09/modified-pulling-ip-addresses-from.html' title='Modified: Pulling IP addresses from Snort rules'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-7931226926503073993</id><published>2008-08-29T19:38:00.004-04:00</published><updated>2008-08-29T20:08:52.825-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='dns'/><category scheme='http://www.blogger.com/atom/ns#' term='snort'/><title type='text'>Snort DNS preprocessor</title><content type='html'>&lt;a href="http://www.nersc.gov/%7Escottc/"&gt;Scott Campbell&lt;/a&gt; of &lt;a href="http://www.nersc.gov/"&gt;NERSC&lt;/a&gt; posted to the &lt;a href="http://sourceforge.net/mailarchive/forum.php?thread_name=48B7FF19.7%40lbl.gov&amp;amp;forum_name=snort-devel"&gt;snort-devel&lt;/a&gt; mailing list today about his &lt;a href="http://www.nersc.gov/%7Escottc/software/snort/index.html"&gt;DNS preprocessor&lt;/a&gt; that is designed to detect DNS cache poisoning and DNS fast flux. His write-up on both features looks interesting and I hope to play with the preprocessor on my lab setup. Note that he recommends not running this in production because it is an early beta.&lt;br /&gt;&lt;br /&gt;For full details check his write-up, but the following quotes explain that the preprocessor is checking three basic conditions for DNS cache poisoning:&lt;br /&gt;&lt;blockquote&gt;&lt;ul&gt;&lt;li&gt;Multiple responses to a query where the DNS server IP and query name match, but the transaction ID varies.&lt;/li&gt;&lt;li&gt;Multiple responses to a query where the DNS server IP, query name and transaction ID match.&lt;/li&gt;&lt;li&gt;Unexpected responses where there is no observed question.&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;The explanation of fast flux detection is a little more involved, and he also mentions that it will detect sites that are designed to behave in a similar way as fast flux, for example ntp.pool.org and chat.freenode.net.&lt;br /&gt;&lt;br /&gt;If I get the chance to play with the preprocessor, I will definitely document my experience.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-7931226926503073993?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/7931226926503073993/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/08/snort-dns-preprocessor.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/7931226926503073993'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/7931226926503073993'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/08/snort-dns-preprocessor.html' title='Snort DNS preprocessor'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-6992913748833421505</id><published>2008-08-02T17:34:00.004-04:00</published><updated>2008-08-02T17:41:41.722-04:00</updated><title type='text'>July Dailydave</title><content type='html'>The &lt;a href="http://lists.immunitysec.com/mailman/listinfo/dailydave"&gt;Dailydave mailing list&lt;/a&gt; was full of interesting and fun posts during the &lt;a href="http://lists.immunitysec.com/pipermail/dailydave/2008-July/thread.html"&gt;month of July&lt;/a&gt;. The "Immunity Certified Network Offense Professional" thread and all the threads about &lt;a href="http://www.doxpara.com/"&gt;Dan Kaminsky&lt;/a&gt;'s DNS cache poisoning were interesting. That said, the cache poisoning has certainly not been under-analyzed and I'm happy to read about other topics at this point.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-6992913748833421505?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/6992913748833421505/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/08/july-dailydave.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/6992913748833421505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/6992913748833421505'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/08/july-dailydave.html' title='July Dailydave'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-4476617570667037557</id><published>2008-06-16T19:28:00.033-04:00</published><updated>2008-06-27T20:06:18.622-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='visualization'/><category scheme='http://www.blogger.com/atom/ns#' term='session data'/><category scheme='http://www.blogger.com/atom/ns#' term='sguil'/><category scheme='http://www.blogger.com/atom/ns#' term='sancp'/><category scheme='http://www.blogger.com/atom/ns#' term='afterglow'/><title type='text'>Using afterglow to make pretty pictures</title><content type='html'>I recently had a need to visualize some network connections and thought there were probably plenty of existing tools to draw me a picture based on data in a CSV file since Sguil can export query results to a CSV. MySQL can also output to a CSV file, so the following could be scripted even more easily on a sguild server than a client. The client requires more manual steps, but I decided to try it that way first.&lt;br /&gt;&lt;br /&gt;&lt;a style="" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_-apeuUdIHjI/SFhEhhOLrbI/AAAAAAAAAEY/WZ0fPhiQCJw/s1600-h/sancpquery_p0.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://4.bp.blogspot.com/_-apeuUdIHjI/SFhEhhOLrbI/AAAAAAAAAEY/WZ0fPhiQCJw/s320/sancpquery_p0.gif" alt="" id="BLOGGER_PHOTO_ID_5212991911325576626" border="0" /&gt;&lt;/a&gt;&lt;a href="http://geek00l.blogspot.com/"&gt;C.S. Lee&lt;/a&gt; recommended trying &lt;a href="http://afterglow.sourceforge.net/"&gt;afterglow&lt;/a&gt;. Looking at his blog, I saw that he had a short &lt;a href="http://geek00l.blogspot.com/2007/09/ubuntu-afterglow.html"&gt;write-up on afterglow&lt;/a&gt;. I followed similar steps to install everything that was needed.&lt;br /&gt;&lt;pre&gt;$ sudo apt-get install libgraphviz-perl libtext-csv-perl&lt;br /&gt;Reading package lists... Done&lt;br /&gt;Building dependency tree&lt;br /&gt;Reading state information... Done&lt;br /&gt;The following extra packages will be installed:&lt;br /&gt;graphviz libio-pty-perl libipc-run-perl&lt;br /&gt;libparse-recdescent-perl&lt;br /&gt;libversion-perl libxml-twig-perl&lt;br /&gt;Suggested packages:&lt;br /&gt;graphviz-doc msttcorefonts libunicode-map8-perl&lt;br /&gt;libunicode-string-perl&lt;br /&gt;xml-twig-tools&lt;br /&gt;Recommended packages:&lt;br /&gt;libtie-ixhash-perl libxml-xpath-perl&lt;br /&gt;The following NEW packages will be installed:&lt;br /&gt;graphviz libgraphviz-perl libio-pty-perl libipc-run-perl&lt;br /&gt;libparse-recdescent-perl libversion-perl libxml-twig-perl&lt;br /&gt;libtext-csv-perl&lt;/pre&gt;Next, I downloaded the afterglow source and extracted it.&lt;br /&gt;&lt;pre&gt;$ tar xvzf afterglow-1.5.9.tar.gz&lt;/pre&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_-apeuUdIHjI/SFhFC2JFnOI/AAAAAAAAAEg/QVsK90omMEM/s1600-h/sancpquery_p1.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://3.bp.blogspot.com/_-apeuUdIHjI/SFhFC2JFnOI/AAAAAAAAAEg/QVsK90omMEM/s320/sancpquery_p1.gif" alt="" id="BLOGGER_PHOTO_ID_5212992483877035234" border="0" /&gt;&lt;/a&gt;For these examples, I connected to the Sguil demo server and exported one sancp query result. Afterglow expects three columns, which include the source IP, destination IP, and destination port. This is where running queries on the sguild server could make more sense since I could just select src_ip, dst_ip and dst_port and write the results to a CSV file. With results from the Sguil client, I have to take the CSV and remove everything but the desired columns.&lt;br /&gt;&lt;br /&gt;To remove the other columns, I used sed. Perl or awk would work fine, too, and it is pretty easy to script. Here is an example I used without scripting. I am writing to a new file so I keep the original file intact. If you exported from Sguil and included the column names on the first line, the following command will delete the first and last lines to clean up the data before removing the extra columns.&lt;br /&gt;&lt;pre&gt;$ sed '1d' sancpquery_1.csv |  sed 's/^\([^,]*,[^,]*,[^,]*,[^,]*,\)\([^,]*,\)\([^,]*,\)&lt;br /&gt;\([^,]*,[^,]*\)\(,[^,]*,[^,]*,[^,]*,[^,]*\)/\2\4/' &gt; sancpquery_1_3col.csv&lt;br /&gt;&lt;/pre&gt;With a CSV exported from the results of a sancp query, that will leave you with the required three columns. Next, from the directory where I extracted afterglow, I can feed it the CSV. The results are using different values for "-p", zero being the default. Values of "-p 1" and "-p 3" made identical images.&lt;br /&gt;&lt;pre&gt;$ cat /home/nr/sancpquery_1_3col.csv | src/perl/graph/afterglow.pl -v -p 0 -e 1.5&lt;br /&gt;-c src/perl/parsers/color.properties | neato -Tgif -o ~/sancpquery_p0.gif&lt;/pre&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_-apeuUdIHjI/SFhFmsQ1KnI/AAAAAAAAAEo/T5a769p-yuU/s1600-h/sancpquery_p2.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://2.bp.blogspot.com/_-apeuUdIHjI/SFhFmsQ1KnI/AAAAAAAAAEo/T5a769p-yuU/s320/sancpquery_p2.gif" alt="" id="BLOGGER_PHOTO_ID_5212993099700447858" border="0" /&gt;&lt;/a&gt;Afterglow is an interesting tool. I can definitely see how it could help when looking at data on a spreadsheet isn't enough to visualize where and systems were connecting and on which ports. I can definitely think of some more features that might be useful, like showing timestamps or time ranges on connections, or even animating the images to show a sequence of events, but adding features could also make it unnecessarily complex.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-4476617570667037557?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/4476617570667037557/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/06/using-afterglow-to-make-pretty-pictures.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/4476617570667037557'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/4476617570667037557'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/06/using-afterglow-to-make-pretty-pictures.html' title='Using afterglow to make pretty pictures'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_-apeuUdIHjI/SFhEhhOLrbI/AAAAAAAAAEY/WZ0fPhiQCJw/s72-c/sancpquery_p0.gif' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297187840164530151.post-4803091713052089577</id><published>2008-05-23T22:51:00.001-04:00</published><updated>2008-05-24T00:07:05.515-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='snort'/><category scheme='http://www.blogger.com/atom/ns#' term='rhel'/><category scheme='http://www.blogger.com/atom/ns#' term='ids'/><title type='text'>Snort 2.8.1 changes and upgrading</title><content type='html'>Snort 2.8.1 has been out since April, so this post is a little late. I wanted to upgrade some Red Hat/CentOS systems from Snort 2.8.0.2 to 2.8.1. When I write RHEL or Red Hat, it will include CentOS since what is applies to one should apply to the other.&lt;br /&gt;&lt;br /&gt;I quickly found that the upgrade on RHEL4 was not exactly straightforward because the version of pcre used on RHEL4 is pcre 4.5, which is years old. Snort 2.8.1 requires at least pcre 6.0. For reference, RHEL5 is using pcre 6.6.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;PCRE Changes&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I had assumed an upgrade from 2.8.0.2 to 2.8.1 was minor, but the pcre change indicated there were definitely significant changes between versions. A few of the pcre changes made it into the Snort ChangeLog, and there is more in the Snort manual. I also had a brief discussion about the pcre changes with a few SourceFire developers that work on Snort and some other highly technical Snort users.&lt;br /&gt;&lt;br /&gt;The most significant changes seems to be adding limits to pcre matching to help prevent performance problems and denial of service through pcre overload. At regular expression compile time, there will be a maximum number of state changes that can be passed and on evaluation libpcre will only change states that many times. There is a global config option that sets the maximum number of state changes and the limit can also be disabled per regular expression if needed.&lt;br /&gt;&lt;br /&gt;The &lt;a href="http://www.snort.org/docs/snort_htmanuals/htmanual_281/node48.html"&gt;related configuration options&lt;/a&gt; for snort.conf are &lt;tt&gt;pcre_match_limit&lt;/tt&gt;:&lt;br /&gt;&lt;blockquote&gt;Restricts the amount of backtracking a given PCRE option. For example, it will limit the number of nested repeats within a pattern. A value of -1 allows for unlimited PCRE, up to the PCRE library compiled limit (around 10 million). A value of 0 results in no PCRE evaluation. The snort default value is 1500.&lt;/blockquote&gt;and &lt;tt&gt;pcre_match_limit_recursion&lt;/tt&gt;:&lt;br /&gt;&lt;blockquote&gt;Restricts the amount of stack used by a given PCRE option. A value of -1 allows for unlimited PCRE, up to the PCRE library compiled limit (around 10 million). A value of 0 results in no PCRE evaluation. The snort default value is 1500. This option is only useful if the value is less than the &lt;tt&gt;pcre_match_limit&lt;/tt&gt; &lt;/blockquote&gt;The main discussion between the SourceFire folks and everyone else was whether it was wise to have the limits turned on by default and where the default of 1500 came from. I think leaving the pcre limits on by default makes sense because those that don't fiddle much with the Snort configuration probably need the protection of the limits more than someone that would notice when Snort performance was suffering.&lt;br /&gt;&lt;br /&gt;The argument against having the limits on by default is that it could make certain rules ineffective. By cutting short the pcre, the rule may not trigger on traffic that should cause a Snort alert. I suspect that not many rules will hit the default pcre limit.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Other Changes Included in Snort 2.8.1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;From the release notes:&lt;br /&gt;&lt;pre&gt;[*] New Additions&lt;br /&gt;* Target-Based support to allow rules to use an attribute table&lt;br /&gt;  describing services running on various hosts on the network.&lt;br /&gt;  Eliminates reliance on port-based rules.&lt;br /&gt;&lt;br /&gt;* Support for GRE encapsulation for both IPv4 &amp;amp; IPv6.&lt;br /&gt;&lt;br /&gt;* Support for IP over IP tunneling for both IPv4 &amp;amp; IPv6.&lt;br /&gt;&lt;br /&gt;* SSL preprocessor to allow ability to not inspect encrypted traffic.&lt;br /&gt;&lt;br /&gt;* Ability to read mulitple PCAPs from the command line.&lt;br /&gt;&lt;/pre&gt;The &lt;a href="http://www.snort.org/docs/snort_htmanuals/htmanual_281/node135.html"&gt;SSL/TLS preprocessor&lt;/a&gt; helps performance by allowing Snort to ignore encrypted traffic rather than inspecting it. I haven't looked at the target-based support yet, but it definitely sounds interesting.&lt;br /&gt;&lt;br /&gt;I also noticed something from 2007-12-10 in the ChangeLog:&lt;br /&gt;&lt;pre&gt; * configure.in:&lt;br /&gt;       Add check for Phil Woods pcap so that pcap stats are computed&lt;br /&gt;       correctly.  Thanks to John Hally for bringing this to our&lt;br /&gt;       attention.&lt;/pre&gt;That should be good for those running Phil Wood's pcap who may not have been seeing accurate statistics about packet loss.&lt;br /&gt;&lt;br /&gt;A last note of interest about Snort 2.8.1 is that it fixes a vulnerability related to &lt;a href="http://www.securityfocus.com/archive/1/492415/30/0/threaded"&gt;improper reassembly of fragmented IP packets&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Upgrading&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Upgrading on RHEL5 was pretty simple, but upgrading on RHEL4 required downloading the source RPM for the pcre included with RHEL5 and building a RPM for RHEL4.&lt;br /&gt;&lt;br /&gt;First, I installed compilers and the rpm-build package and the RPM source package for pcre-6.6. (Note that I'm using CentOS4 in the example, but the procedures for Red Hat should be nearly identical except for URLs). Next I built the pcre-6.6 RPMs and installed both pcre and pcre-devel.&lt;br /&gt;&lt;pre&gt;# up2date -i cpp gcc gcc-c++ rpm-build&lt;br /&gt;# rpm -Uvh http://isoredirect.centos.org/centos/5/updates/SRPMS/pcre-6.6-2.el5_1.7.src.rpm&lt;br /&gt;$ rpmbuild -bb /usr/src/redhat/SPECS/pcre.spec&lt;br /&gt;# rpm -U /usr/src/redhat/RPMS/i386/pcre-*rpm&lt;br /&gt;# rpm -q pcre pcre-devel&lt;br /&gt;pcre-6.6-2.7&lt;br /&gt;pcre-devel-6.6-2.7&lt;/pre&gt;Now I can configure, make and make install Snort as usual. The snort.conf file will also need to be updated to reflect new options like the SSL/TLS preprocessor and non-default pcre checks. Note that the README.ssl also recommends changes to the stream5 preprocessor based on the SSL configuration.&lt;br /&gt;&lt;pre&gt;$ ./configure --enable-dynamicplugin --enable-stream4udp --enable-perfprofiling&lt;br /&gt;$ make&lt;br /&gt;# make install&lt;/pre&gt;If you are building on a production box instead of a development box, some would recommend removing the compilers afterwards.&lt;br /&gt;&lt;br /&gt;Here is an example of a SSL/TLS and stream5 configuration using default ports. By adding the default SSL/TLS ports to stream5_tcp settings, you also have to enumerate the default stream5_tcp ports or they will not be included. I bolded the default SSL/TLS ports, and the rest are default stream5_tcp ports:&lt;br /&gt;&lt;pre&gt;preprocessor stream5_global: track_tcp yes, track_udp yes, track_icmp yes&lt;br /&gt;preprocessor stream5_tcp: policy first, ports both 21 23 25 42 53 80 \&lt;br /&gt;     110 111 135 136 137 139 143 &lt;span style="font-weight: bold;"&gt;443&lt;/span&gt; 445 &lt;span style="font-weight: bold;"&gt;465&lt;/span&gt; 513 &lt;span style="font-weight: bold;"&gt;563&lt;/span&gt; &lt;span style="font-weight: bold;"&gt;636&lt;/span&gt; \&lt;br /&gt;     &lt;span style="font-weight: bold;"&gt;989&lt;/span&gt; &lt;span style="font-weight: bold;"&gt;992&lt;/span&gt; &lt;span style="font-weight: bold;"&gt;993&lt;/span&gt; &lt;span style="font-weight: bold;"&gt;994&lt;/span&gt; &lt;span style="font-weight: bold;"&gt;995&lt;/span&gt; 1433 1521 3306&lt;br /&gt;preprocessor stream5_udp&lt;br /&gt;preprocessor stream5_icmp&lt;br /&gt;preprocessor ssl: \&lt;br /&gt;     noinspect_encrypted&lt;/pre&gt;I have tested to make sure Snort runs with this configuration for these preprocessors, but don't just copy it without checking my work. It is simply an example after reading the related README documentation. Note that the Stream 5 TCP Policy Reassembly Ports output to your message log when starting Snort will be truncated after the first 20 ports but all the ports listed will be included by Stream 5.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-4803091713052089577?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/4803091713052089577/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/05/snort-281-changes-and-upgrading.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/4803091713052089577'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/4803091713052089577'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/05/snort-281-changes-and-upgrading.html' title='Snort 2.8.1 changes and upgrading'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-3166685763341277775</id><published>2008-05-16T21:23:00.012-04:00</published><updated>2008-05-16T21:59:14.819-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><category scheme='http://www.blogger.com/atom/ns#' term='reporting'/><category scheme='http://www.blogger.com/atom/ns#' term='sguil'/><title type='text'>Query sguildb for alert name then do name lookup</title><content type='html'>I wrote a Perl script to query for a specific alert name and then get the NetBIOS or DNS name of the systems that triggered the alert. This script is useful to me mainly as an automated reporting tool. An example would be finding a list of systems associated with a specific spyware alert that is auto-categorized within Sguil. The alert will never show up in the RealTime alerts but I use the script to get a daily email on the systems triggering the alert.&lt;br /&gt;&lt;br /&gt;Some alerts aren't important enough to require a real-time response but may need remediation or at least to be included in statistics. I don't know if this would be useful for others as it is written, but parts of it might be.&lt;br /&gt;&lt;br /&gt;As always with Perl, I welcome suggestions for improvement since I'm by no means an expert. (By the way, does anyone else have problems with Blogger formatting when using &amp;lt;pre&amp;gt; tags?)&lt;br /&gt;&lt;pre&gt;#!/usr/bin/perl&lt;br /&gt;#&lt;br /&gt;# by nr&lt;br /&gt;# 2008-05-11&lt;br /&gt;#   Script to query db for a specific alert&lt;br /&gt;#   and do name lookup based on source IP address in results&lt;br /&gt;&lt;br /&gt;use strict;&lt;br /&gt;&lt;br /&gt;# Requires MySQL, netbios and DNS modules&lt;br /&gt;use Mysql;&lt;br /&gt;use Net::NBName;&lt;br /&gt;use Net::DNS;&lt;br /&gt;&lt;br /&gt;my $host = "localhost";&lt;br /&gt;my $database = "sguildb";&lt;br /&gt;my $tablename = "event";&lt;br /&gt;my $user = "sguil";&lt;br /&gt;my $pw = "PASSWORD";&lt;br /&gt;my $alert = 'ALERT NAME Here';&lt;br /&gt;&lt;br /&gt;# Set the query&lt;br /&gt;my $sql_query = "SELECT INET_NTOA(src_ip) as src_ip,count(signature) as count FROM $tablename \&lt;br /&gt;    WHERE $tablename.timestamp &gt; DATE_SUB(UTC_DATE(),INTERVAL 24 HOUR) AND $tablename.signature \&lt;br /&gt;    = '$alert' GROUP BY src_ip";&lt;br /&gt;&lt;br /&gt;# perl mysql connect()&lt;br /&gt;my $sql_connect = Mysql-&gt;connect($host, $database, $user, $pw);&lt;br /&gt;&lt;br /&gt;print "\"$alert\" alerts in the past 24 hours: \n\n";&lt;br /&gt;print "Count    IP Address  Hostname\n\n";&lt;br /&gt;&lt;br /&gt;my $execute = $sql_connect-&gt;query($sql_query); # Run query&lt;br /&gt;&lt;br /&gt;# Fetch query results and loop&lt;br /&gt;while (my @result = $execute-&gt;fetchrow) {&lt;br /&gt;    my @hostname; # 1st element of this array is used later for name queries&lt;br /&gt;    my $ipresult = $result[0]; # Set IP using query result&lt;br /&gt;    my $count = $result[1]; # Set alert count using query result&lt;br /&gt;    my $nb_query = Net::NBName-&gt;new; # Setup new netbios query&lt;br /&gt;    my $nb = $nb_query-&gt;node_status($result[0]);&lt;br /&gt;    # If there is an answer to netbios query&lt;br /&gt;    if ($nb) {&lt;br /&gt;        my $nbresults = $nb-&gt;as_string; # Get query result&lt;br /&gt;        # Split at &amp;lt; will make $hostname[0] the netbios name&lt;br /&gt;        # Is there a better way to do this using a substitution?&lt;br /&gt;        @hostname = split /&amp;lt;/, $nbresults;&lt;br /&gt;    } else {&lt;br /&gt;        # Do a reverse DNS lookup if no netbios response&lt;br /&gt;        # May want to add checks to make sure external IPs are ignored&lt;br /&gt;        my $res = Net::DNS::Resolver-&gt;new;&lt;br /&gt;        my $namequery = $res-&gt;query("$result[0]","PTR");&lt;br /&gt;        if ($namequery) {&lt;br /&gt;            my $dnsname = ($namequery-&gt;answer)[0];&lt;br /&gt;            $hostname[0] = $dnsname-&gt;rdatastr;&lt;br /&gt;        } else {&lt;br /&gt;            $hostname[0] = "UNKNOWN"; # If no reverse DNS result&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;format STDOUT =&lt;br /&gt;@&gt;&gt;&gt;    @&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; @*&lt;br /&gt;$count, $ipresult,      $hostname[0]&lt;br /&gt;.&lt;br /&gt;    write;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-3166685763341277775?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/3166685763341277775/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/05/query-sguildb-for-alert-name-then-do.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/3166685763341277775'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/3166685763341277775'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/05/query-sguildb-for-alert-name-then-do.html' title='Query sguildb for alert name then do name lookup'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-5096903886669209394</id><published>2008-04-30T19:07:00.001-04:00</published><updated>2008-05-05T08:51:25.616-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='forensics'/><category scheme='http://www.blogger.com/atom/ns#' term='novasec'/><title type='text'>NoVASec: Memory Forensics</title><content type='html'>&lt;a href="http://taosecurity.blogspot.com/"&gt;Richard Bejtlich&lt;/a&gt; arranged a &lt;a href="http://novasec.blogspot.com/"&gt;NoVASec&lt;/a&gt; meeting on memory forensics for Thursday, April 24.  &lt;a href="http://volatility.tumblr.com/"&gt;Aaron Walters&lt;/a&gt; of &lt;a href="http://www.volatilesystems.com/"&gt;Volatile Systems&lt;/a&gt; was the scheduled speaker. &lt;a href="http://www.gmgsystemsinc.com/fau/"&gt;George Garner&lt;/a&gt; of &lt;a href="http://www.gmgsystemsinc.com/knttools/"&gt;GMG Systems, Inc.&lt;/a&gt;, also showed up, so we were lucky enough to get two speakers for the price of one. (If you aren't aware, NoVASec is actually free). Aaron primarily talked about performing forensics and analysis on memory dumps, and afterwards Richard asked George to come up from the audience and talk about the challenges of actually acquiring the memory dumps.&lt;br /&gt;&lt;br /&gt;Both Aaron and George were very knowledgeable and had a lot of interesting things to discuss. In fact, most of us didn't leave until after 22:00 so there was a good two and a half hours of technical discussion. It wouldn't do them justice for me to try and recap their talks, but I will mention a couple brief thoughts I jotted down while listening. If I'm getting anything wrong here, someone please pipe up and let me know.&lt;br /&gt;&lt;br /&gt;First is that I saw some parallels between points mentioned by Aaron and Network Security Monitoring. Aaron stated that a live response on a system requires some trust of the system's operating system, is obtrusive, and is unverifiable. Dumping the RAM and performing an analysis using a trusted system helps mitigate these problems though I don't think he meant it solves them completely. Similarly, in NSM we use information that is gathered by our most trustworthy systems, network sensors that allow limited access, rather than trusting what we find on the host. In forensics and NSM, steps are taken to increase the trustworthiness and verifiability of information that is gathered.&lt;br /&gt;&lt;br /&gt;Second, Aaron and George both seemed to agree that acquiring memory contents is not easy. Not only can it be difficult, but even a successful acquisition has issues. George pointed out that if you don't isolate the system, an attacker could be altering the system or memory as you acquire it. He also pointed out that dumping the memory is actually sampling, not an image, because the RAM contents are always changing even on a system that has been isolated from the network. One memory dump is just one sample of what resided in memory at a given time. More evidence and more sampling will increase the reliability of the evidence attained. Also, gathering evidence from multiple sources, for instance hard drive forensics, memory forensics and NSM, increases the probability evidence will be accurate and verifiable.&lt;br /&gt;&lt;br /&gt;There was also some discussion of PCI and video devices as they relate to both exploiting systems and memory forensics. Acquiring memory can be an issue on systems using PAE since reading from the space used by PCI devices can crash the system. On the exploit side, the GPU and RAM on video cards can be used to help facilitate attacks, as can certain PCI devices. There is a lot of interesting work going on in this field, and George even mentioned that he has been working on tools for acquiring the contents of memory from video cards.&lt;br /&gt;&lt;br /&gt;It was an excellent meeting.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-5096903886669209394?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/5096903886669209394/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/04/novasec-memory-forensics.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/5096903886669209394'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/5096903886669209394'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/04/novasec-memory-forensics.html' title='NoVASec: Memory Forensics'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-9097647380133036302</id><published>2008-04-27T17:17:00.001-04:00</published><updated>2008-04-27T22:40:38.254-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='malware'/><category scheme='http://www.blogger.com/atom/ns#' term='defcon'/><title type='text'>Defcon 16 Race to Zero</title><content type='html'>There have been articles about &lt;a href="http://www.defcon.org/"&gt;Defcon&lt;/a&gt;'s &lt;a href="http://www.racetozero.net/"&gt;Race to Zero&lt;/a&gt; since it was announced. I first read about it on the Daily Dave mailing list when the announcement was posted a couple days ago on 27 April. Apparently, some vendors and media are unhappy and criticizing the competition. While this is not surprising, it strikes me as pointless to complain about a competition that is just demonstrating what can be and already is done in the wild.&lt;br /&gt;&lt;br /&gt;From the Race to Zero site:&lt;br /&gt;&lt;blockquote type="cite"&gt;The event involves contestants being given a sample set of viruses and malcode to modify and upload through the contest portal. The portal passes the modified samples through a number of antivirus engines and determines if the sample is a known threat. The first team or individual to pass their sample past all antivirus engines undetected wins that round. Each round increases in complexity as the contest progresses.&lt;br /&gt;&lt;/blockquote&gt;Anyone that has submitted real malware samples to a service like VirusTotal already knows how pitiful and inconsistent anti-virus software is at detecting malware, particularly if it is new or newly modified. There is a reason we see so many variants of the same malware, and it's not because anti-virus is so effective that malware authors have to completely rewrite their code.&lt;br /&gt;&lt;blockquote type="cite"&gt;&lt;ol&gt;&lt;li&gt;Reverse engineering and code analysis is fun.&lt;/li&gt;&lt;li&gt;Not all antivirus is equal, some products are far easier to circumvent than others. Poorly performing antivirus vendors should be called out.&lt;/li&gt;&lt;li&gt;The majority of the signature-based antivirus products can be easily circumvented with a minimal amount of effort.&lt;/li&gt;&lt;li&gt;The time taken to modify a piece of known malware to circumvent a good proportion of scanners is disproportionate to the costs of antivirus protection and the losses resulting from the trust placed in it.&lt;/li&gt;&lt;li&gt;Signature-based antivirus is dead, people need to look to heuristic, statistical and behaviour based techniques to identify emerging threats&lt;/li&gt;&lt;li&gt;Antivirus is just part of the larger picture, you need to look at controlling your endpoint devcies [sic] with patching, firewalling and sound security policies to remain virus free.&lt;/li&gt;&lt;/ol&gt;&lt;/blockquote&gt;Although I have very limited and basic experience reverse engineering malware, it does seem fun and interesting. I also totally agree that vendors need to be called out.&lt;br /&gt;&lt;br /&gt;Heuristic, statistical and behavior-based techniques may indeed help, but point number six seems equally important. I don't really know what the best solution is, but hopefully some vendors will eventually realize that their methods and models need to change to become more proactive instead of reactive.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-9097647380133036302?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/9097647380133036302/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/04/defcon-16-race-to-zero.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/9097647380133036302'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/9097647380133036302'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/04/defcon-16-race-to-zero.html' title='Defcon 16 Race to Zero'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-1957323396168125563</id><published>2008-04-09T17:23:00.002-04:00</published><updated>2008-04-23T21:03:14.015-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='nsm'/><category scheme='http://www.blogger.com/atom/ns#' term='openpacket'/><category scheme='http://www.blogger.com/atom/ns#' term='community'/><category scheme='http://www.blogger.com/atom/ns#' term='passive'/><title type='text'>PADS signatures, NSMWiki, OpenPacket</title><content type='html'>I added a few &lt;a href="http://nsmwiki.org/PADS"&gt;PADS signatures&lt;/a&gt; to the &lt;a href="http://nsmwiki.org/Main_Page"&gt;NSMWiki&lt;/a&gt;. Anyone else that has some should definitely contribute since the standard signature set is fairly small and has a huge potential for improvement. I'm sure that any other useful contributions to NSMWiki are also appreciated.&lt;br /&gt;&lt;br /&gt;Richard Bejtlich &lt;a href="http://taosecurity.blogspot.com/2008/04/openpacketorg-10-is-live.html"&gt;posted&lt;/a&gt; about &lt;a href="http://www.openpacket.org/"&gt;OpenPacket&lt;/a&gt; being online. I think the idea is great and there is a strong community of people that have signed on to help him with various aspects of the site.&lt;br /&gt;&lt;blockquote&gt;OpenPacket.org is a Web site whose mission is to provide a centralized repository of network traffic traces for researchers, analysts, and other members of the digital security community.&lt;/blockquote&gt;For anyone just starting out in digital security or looking to get into the field, I strongly encourage you to participate in the security community as a whole. The number of ways to participate are too numerous for me to list, but there is definitely a lot to be learned from others who are more experienced, less experienced, or just have different types of experience. Just reading blogs, news, mailing lists and other sites can be enlightening, and once you get your feet wet you may find yourself contributing in short order.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-1957323396168125563?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/1957323396168125563/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/04/pads-signatures-nsmwiki-openpacket.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/1957323396168125563'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/1957323396168125563'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/04/pads-signatures-nsmwiki-openpacket.html' title='PADS signatures, NSMWiki, OpenPacket'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-1285318959619962236</id><published>2008-03-27T21:17:00.001-04:00</published><updated>2008-03-28T11:29:31.197-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='nsm'/><category scheme='http://www.blogger.com/atom/ns#' term='sguil'/><title type='text'>Upgrading from Sguil 0.7.0 CVS to RELEASE</title><content type='html'>Sguil 0.7.0 &lt;a href="http://article.gmane.org/gmane.comp.security.sguil.general/1561"&gt;was released&lt;/a&gt; this week. The upgrade from 0.6.1 takes a little more effort because of the change to multiple agents, but since I was already running 0.7.0 from CVS, upgrading was fairly easy.&lt;br /&gt;&lt;br /&gt;The &lt;a href="http://www.vorant.com/nsmwiki/Sguil"&gt;Sguil overview page&lt;/a&gt; at NSMWiki notes some of the differences between 0.6.1 and 0.7.0. It also has some nifty diagrams someone (***cough***me***cough***) contributed that may help people visualize the data flow in Sguil 0.7.0.&lt;br /&gt;&lt;br /&gt;Here is how I upgraded from CVS to the release version.&lt;br /&gt;&lt;br /&gt;First, I pre-staged the systems by copying the appropriate Sguil components to each system. Then I shut down the agents on all sensors and stop sguild on the server.&lt;br /&gt;&lt;br /&gt;Looking in my sguild directory, there is not that much that will actually need to be replaced.&lt;br /&gt;&lt;pre&gt;$ ls /etc/sguild/&lt;br /&gt;CVS/                  certs/    sguild*        sguild.email    sguild.users&lt;br /&gt;archive_sguildb.tcl*  contrib/  sguild.access  sguild.queries  sql_scripts/&lt;br /&gt;autocat.conf          lib/      sguild.conf    sguild.reports  xscriptd*&lt;/pre&gt;I start by making a backup of this whole directory. The files or directories that I don't want to lose are:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;sguild.conf:&lt;/span&gt; sguild configuration file&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;sguild.users:&lt;/span&gt; sguild's user and password hash file&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;sguild.reports:&lt;/span&gt; I have some custom reports, including some based on the &lt;a href="http://www.vorant.com/nsmwiki/Reporting_and_Data_Mining"&gt;reporting and data mining page&lt;/a&gt; of NSMWiki.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;autocat.conf:&lt;/span&gt; used to automatically categorize alerts based on specific criteria, and most people that have done any tuning will hopefully have taken advantage of autocat.conf&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;certs/&lt;/span&gt;: sguild cert directory&lt;br /&gt;&lt;br /&gt;Some people may also have added standard global queries in sguild.queries, or access controls in sguild.access. These are all basically configuration files, so if you have changed them you may want to keep them or include the changes in the new files.&lt;br /&gt;&lt;br /&gt;After deciding what I need to keep, I upgrade the server.&lt;br /&gt;&lt;pre&gt;$ mv -v /etc/sguild/server ~/sguild-old&lt;br /&gt;$ cp -R ~/src/sguil-0.7.0/server /etc/sguild/&lt;br /&gt;$ cp -R ~/sguild-old/certs /etc/sguild/server/&lt;br /&gt;$ cp ~/sguild-old/sguild.users /etc/sguild/server/&lt;br /&gt;$ cp ~/sguild-old/sguild.conf /etc/sguild/server/&lt;br /&gt;$ cp ~/sguild-old/sguild.reports /etc/sguild/server/&lt;br /&gt;$ cp ~/sguild-old/autocat.conf /etc/sguild/server/&lt;/pre&gt;Then I edit my sguild init script to remove "-o" and "-s" since encryption is now required instead of optional. The new version of sguild and the agents will give errors if you start them without removing the switches.&lt;br /&gt;&lt;br /&gt;I start sguild and see that it is working, so next is the sensor. On the sensor, I backed up the conf files first.&lt;br /&gt;&lt;pre&gt;$ cp -v /etc/sguil-0.7.0/sensor/*.conf ~/&lt;br /&gt;$ rm -Rf /etc/sguil-0.7.0/sensor/&lt;br /&gt;$ cp ~/src/sguil-0.7.0/sensor /etc/sguil-0.7.0/&lt;br /&gt;$ cp ~/*.conf /etc/sguil-0.7.0/sensor/&lt;/pre&gt;Then, I edited all the agent init scripts to remove the "-o" switch. The agents are pads, pcap, sancp and snort. Now I can reconnect the agents to the server and the only thing left to do is upgrade my client. For the client upgrade, I replace everything except the sguil.conf file. If I made any modifications to my client, I would also need to incorporate those into the new client.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-1285318959619962236?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/1285318959619962236/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/03/upgrading-from-sguil-070-cvs-to-release.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/1285318959619962236'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/1285318959619962236'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/03/upgrading-from-sguil-070-cvs-to-release.html' title='Upgrading from Sguil 0.7.0 CVS to RELEASE'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-9043971514272081197</id><published>2008-03-21T16:25:00.006-04:00</published><updated>2008-03-21T17:06:49.551-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='nsm'/><category scheme='http://www.blogger.com/atom/ns#' term='snort'/><category scheme='http://www.blogger.com/atom/ns#' term='ids'/><category scheme='http://www.blogger.com/atom/ns#' term='sguil'/><category scheme='http://www.blogger.com/atom/ns#' term='passive'/><title type='text'>Passive Tools</title><content type='html'>I love passive tools, what I like to think of as the "M" in NSM.&lt;br /&gt;&lt;br /&gt;I recently posted about &lt;a href="http://eatingsecurity.blogspot.com/2008/03/testing-pads.html"&gt;PADS&lt;/a&gt;. &lt;a href="http://sguil.sourceforge.net/"&gt;Sguil&lt;/a&gt; also uses &lt;a href="http://lcamtuf.coredump.cx/p0f.shtml"&gt;p0f&lt;/a&gt; for operating system fingerprinting, and &lt;a href="http://www.metre.net/sancp.html"&gt;sancp&lt;/a&gt; for session-logging.&lt;br /&gt;&lt;br /&gt;Even the IDS and &lt;a href="http://www.snort.org/dl/daemonlogger/"&gt;packet-logging&lt;/a&gt; components of Sguil are passive. There are plenty of other good passive tools available.&lt;br /&gt;&lt;br /&gt;You can learn a lot just by listening.&lt;br /&gt;&lt;br /&gt;You can also run &lt;a href="http://snort.org/"&gt;Snort&lt;/a&gt; inline and active, which goes a little beyond monitoring, for better or worse.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-9043971514272081197?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/9043971514272081197/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/03/passive-tools.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/9043971514272081197'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/9043971514272081197'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/03/passive-tools.html' title='Passive Tools'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-7517758118053470670</id><published>2008-03-18T20:25:00.007-04:00</published><updated>2008-03-20T08:17:29.730-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='system administration'/><category scheme='http://www.blogger.com/atom/ns#' term='snort'/><category scheme='http://www.blogger.com/atom/ns#' term='sguil'/><title type='text'>Using DJ Bernstein's daemontools</title><content type='html'>I use &lt;a href="http://cr.yp.to/djb.html"&gt;DJ Bernstein&lt;/a&gt;'s &lt;a href="http://cr.yp.to/daemontools.html"&gt;daemontools&lt;/a&gt; to monitor Barnyard, making sure the barnyard process will restart if it dies for any reason. &lt;a href="http://sourceforge.net/projects/barnyard"&gt;Barnyard&lt;/a&gt; is an output spooler for Snort and is probably the the least stable of all the software that is used when running Sguil. When Barnyard encounters errors and exits, it needs to be restarted.&lt;br /&gt;&lt;br /&gt;Daemontools is useful because it will watch a process and restart it when needed. For anyone that has used other DJ Bernstein software like &lt;a href="http://cr.yp.to/djbdns.html"&gt;djbdns&lt;/a&gt; or &lt;a href="http://cr.yp.to/qmail/var-qmail.html"&gt;qmail&lt;/a&gt;, you may also have used daemontools. I think daemontools has a reputation as difficult to install and configure, but I've used it on a number of systems with barnyard or djbdns without any major issues. (As for qmail, I prefer &lt;a href="http://www.postfix.org/"&gt;postfix&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;Here is how I installed it, which only has one small change from the &lt;a href="http://cr.yp.to/daemontools/install.html"&gt;install instructions&lt;/a&gt;.&lt;br /&gt;&lt;pre&gt;mkdir -p /package&lt;br /&gt;chmod 1755 /package&lt;br /&gt;tar xzvpf install/daemontools-0.76.tar.gz -C /package/&lt;br /&gt;cd /package/admin/daemontools-0.76/&lt;br /&gt;&lt;/pre&gt;Before running the install script, note the "errno" section on DJ Bernstein's &lt;a href="http://cr.yp.to/docs/unixport.html"&gt;Unix portability notes&lt;/a&gt;. On Linux, since I'm installing from source I need to replace one line in the &lt;tt&gt;src/error.h&lt;/tt&gt; file, as shown in this patch snippet.&lt;br /&gt;&lt;pre&gt;-extern int errno;&lt;br /&gt;+#include &amp;lt;errno.h&amp;gt;&lt;errno.h&gt;&lt;br /&gt;&lt;/errno.h&gt;&lt;/pre&gt;After changing error.h, I can run the installer.&lt;br /&gt;&lt;pre&gt;./package/install&lt;/pre&gt;I configure daemontools to work with barnyard.&lt;br /&gt;&lt;pre&gt;mkdir /etc/barnyard&lt;br /&gt;vim /etc/barnyard/run&lt;/pre&gt;The "run" file simply is a script that runs barnyard. For example, the contents of mine:&lt;br /&gt;&lt;pre&gt;#!/bin/sh&lt;br /&gt;exec /bin/barnyard -c /etc/snort/barnyard.conf -d /nsm -f unified.log \&lt;br /&gt;-w /nsm/waldo.file -a /nsm/by_archive&lt;/pre&gt;Next, I link the new barnyard directory to make it a subdirectory of daemontool's service directory.&lt;br /&gt;&lt;pre&gt;ln -s /etc/barnyard /service/barnyard&lt;/pre&gt;When installing, daemontools automatically adds this entry to &lt;tt&gt;/etc/inittab&lt;/tt&gt;:&lt;br /&gt;&lt;pre&gt;SV:123456:respawn:/command/svscanboot&lt;/pre&gt;svscanboot starts a svscan process that then starts a &lt;a href="http://cr.yp.to/daemontools/supervise.html"&gt;supervise&lt;/a&gt; process for each subdirectory, which in this case would only be the barnyard directory. I can have the inittab file re-parsed with &lt;tt&gt;telinit q&lt;/tt&gt; after daemontools is installed rather than rebooting.&lt;br /&gt;&lt;br /&gt;If the barnyard process dies, daemontools will automatically try and restart it based on the contents of the "run" file.&lt;br /&gt;&lt;br /&gt;Now, even if I kill the barnyard process on purpose then it will be restarted automatically. If I need to manage the process, I can use the &lt;a href="http://cr.yp.to/daemontools/svc.html"&gt;&lt;tt&gt;svc&lt;/tt&gt; command&lt;/a&gt;. For instance, to send barnyard a HUP or a KILL:&lt;br /&gt;&lt;pre&gt;svc -h /service/barnyard&lt;br /&gt;svc -k /service/barnyard&lt;br /&gt;&lt;/pre&gt;To add another process for daemontools to manage, just create a directory, create a run file, then link the new directory to daemontools' service directory.&lt;br /&gt;&lt;pre&gt;mkdir /etc/someprocess&lt;br /&gt;vim /etc/someprocess/run&lt;br /&gt;ln -s /etc/someprocess /service/someprocess&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-7517758118053470670?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/7517758118053470670/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/03/using-dj-bernsteins-daemontools.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/7517758118053470670'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/7517758118053470670'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/03/using-dj-bernsteins-daemontools.html' title='Using DJ Bernstein&apos;s daemontools'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297187840164530151.post-3903477773462671390</id><published>2008-03-08T21:43:00.018-05:00</published><updated>2008-03-21T17:08:04.764-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='nsm'/><category scheme='http://www.blogger.com/atom/ns#' term='passive'/><title type='text'>Testing PADS</title><content type='html'>Before putting &lt;a href="http://passive.sourceforge.net/"&gt;PADS&lt;/a&gt; into production in a new environment, here is how I tested it.&lt;br /&gt;&lt;br /&gt;First, I installed the version needed for integration with Sguil by applying the &lt;a href="http://www.vorant.com/files/pads.patch"&gt;pads.patch&lt;/a&gt;. Note that there is also a &lt;a href="http://www.vorant.com/downloads.html"&gt;PADS VLAN patch&lt;/a&gt;. The patching and installing is described in the &lt;a href="http://www.vorant.com/nsmwiki/Sguil_on_RedHat_HOWTO#PADS"&gt;NSMWiki&lt;/a&gt;, but I didn't need to change LDFLAGS or CFLAGS for my installation.&lt;br /&gt;&lt;pre&gt;$ patch -p0 &lt; ../patches/pads.patch&lt;br /&gt;$ ./configure &lt;br /&gt;$ make &lt;br /&gt;$ sudo make install&lt;/pre&gt;Now I can test it.&lt;br /&gt;&lt;pre&gt;# pads -i bridge0 -n 192.168.1.0/24&lt;br /&gt;pads - Passive Asset Detection System&lt;br /&gt;v1.2 - 06/17/05&lt;br /&gt;Matt Shelton &lt;matt@mattshelton.com&gt;&lt;br /&gt;&lt;br /&gt;[-] Processing Existing assets.csv&lt;br /&gt;[-] WARNING:  pcap_lookupnet (bridge0: no IPv4 address assigned)&lt;br /&gt;[-] Filter:  (null)&lt;br /&gt;[-] Listening on interface bridge0&lt;br /&gt;&lt;br /&gt;[*] Asset Found:  Port - 80 / Host - 192.168.1.3 / Service - www / Application - Apache 2.2.8 (Unix)&lt;br /&gt;[*] Asset Found:  Port - 25 / Host - 192.168.1.3 / Service - smtp / Application - Generic SMTP - Possible Postfix (localhost.localdomain)&lt;/matt@mattshelton.com&gt;&lt;/pre&gt;Now I try without defining a network.&lt;br /&gt;&lt;pre&gt;# pads -i bridge0 -c /usr/local/etc/pads.conf&lt;br /&gt;pads - Passive Asset Detection System&lt;br /&gt;v1.2 - 06/17/05&lt;br /&gt;Matt Shelton &lt;matt@mattshelton.com&gt;&lt;br /&gt;&lt;br /&gt;[-] WARNING:  pcap_lookupnet (bridge0: no IPv4 address assigned)&lt;br /&gt;[-] Filter:  (null)&lt;br /&gt;[-] Listening on interface bridge0&lt;br /&gt;&lt;br /&gt;[*] Asset Found:  Port - 80 / Host - 64.233.179.191 / Service - www / Application - GFE/1.3&lt;/matt@mattshelton.com&gt;&lt;/pre&gt;The Google IP address pops up while I'm logged in and editing this post. When you run PADS, you don't want to monitor all traffic or you'll be detecting services on systems outside your network.&lt;br /&gt;&lt;br /&gt;Once I began testing PADS, I realized that I needed to add some signatures because I had some unknown services. This signature that comes with PADS was the one that detected the SMTP from the first test.&lt;br /&gt;&lt;pre&gt;smtp,v/Generic SMTP - Possible Postfix//$1/,220 ([-.\w]+) ESMTP\r\n&lt;/pre&gt;PADS uses PCRE to test matches.. In this signature, the match inside the () is the host and domain name, and gets printed by using $1. If there was a second match in parentheses, it could be printed with $2. The whole signature is everything after the second comma.&lt;br /&gt;&lt;br /&gt;I've already played around with adding or modifying some signatures and I'll probably post those once I get done testing in some different environments. There is an option to dump banner data to a pcap file that is useful to help write new signatures.&lt;br /&gt;&lt;pre&gt;pads -i bridge0 -c /usr/local/etc/pads.conf -d bannerdump.pcap&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-3903477773462671390?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/3903477773462671390/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/03/testing-pads.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/3903477773462671390'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/3903477773462671390'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/03/testing-pads.html' title='Testing PADS'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-1379040164777829546</id><published>2008-03-05T05:21:00.009-05:00</published><updated>2008-05-09T08:23:19.179-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='system administration'/><category scheme='http://www.blogger.com/atom/ns#' term='freebsd'/><title type='text'>make buildworld from 6.3-STABLE to 7.0-RELEASE</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.freebsd.org/"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px;" src="http://www.freebsd.org/logo/logo-reverse.png" alt="" border="0" /&gt;&lt;/a&gt; &lt;pre&gt;$ uname -r&lt;br /&gt;6.3-STABLE&lt;/pre&gt;I am updating from FreeBSD 6.3-STABLE to 7.0-RELEASE. First I ran cvsup to synchronize my source with RELENG_7_0. When I started through the steps of &lt;a href="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html"&gt;rebuilding world&lt;/a&gt;, I had problems when running &lt;tt&gt;make buildworld&lt;/tt&gt;.&lt;br /&gt;&lt;pre&gt;cc1: out of memory allocating 97582896 bytes&lt;br /&gt;&lt;br /&gt;Stop in /usr/src/gnu/usr.bin/cc/cc_int.&lt;br /&gt;*** Error code 1&lt;br /&gt;&lt;br /&gt;Stop in /usr/src/gnu/usr.bin/cc.&lt;br /&gt;*** Error code 1&lt;br /&gt;&lt;br /&gt;Stop in /usr/src.&lt;br /&gt;*** Error code 1&lt;br /&gt;&lt;br /&gt;Stop in /usr/src.&lt;br /&gt;*** Error code 1&lt;br /&gt;&lt;br /&gt;Stop in /usr/src.&lt;br /&gt;&lt;/pre&gt;I fixed it by installing ccache and editing &lt;tt&gt;/etc/make.conf&lt;/tt&gt; (see ccache-howto-freebsd.txt).&lt;br /&gt;&lt;pre&gt;cd /usr/ports/devel/ccache&lt;br /&gt;make install clean&lt;br /&gt;&lt;br /&gt;vim /etc/make.conf&lt;br /&gt;.if !defined(NOCCACHE)&lt;br /&gt;CC=/usr/local/libexec/ccache/world-cc&lt;br /&gt;CXX=/usr/local/libexec/ccache/world-c++&lt;br /&gt;.endif&lt;br /&gt;:wq&lt;br /&gt;&lt;/pre&gt;Now I can run &lt;tt&gt;make cleandir&lt;/tt&gt; and then &lt;tt&gt;make buildworld&lt;/tt&gt; in &lt;tt&gt;/usr/src&lt;/tt&gt; and don't get errors. I finish up the steps for &lt;a href="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html"&gt;rebuilding world&lt;/a&gt; after that.&lt;br /&gt;&lt;pre&gt;$ uname -r&lt;br /&gt;7.0-RELEASE&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-1379040164777829546?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/1379040164777829546/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/03/make-buildworld-from-63-stable-to-70.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/1379040164777829546'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/1379040164777829546'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/03/make-buildworld-from-63-stable-to-70.html' title='make buildworld from 6.3-STABLE to 7.0-RELEASE'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-8157453082541063330</id><published>2008-03-04T16:37:00.006-05:00</published><updated>2008-03-05T21:32:36.240-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='system administration'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Using parted and LVM2 for large partitions</title><content type='html'>I wanted to spread a partition across two RAID cards, one drive partition on each card. Here is the server's physical drive configuration.&lt;br /&gt;&lt;pre&gt;|-RAID0-|-RAID5---------|&lt;br /&gt;| 00 01 | 02 03 04 05 06|&lt;br /&gt;&lt;br /&gt;|-RAID5------------------------------------|&lt;br /&gt;| 00 01 02 03 04 05 06 07 08 09 10 11 12 13|&lt;br /&gt;&lt;/pre&gt;The second RAID5 is a few TB and fdisk won't work on partitions larger than 2TB, so I use &lt;a href="http://www.gnu.org/software/parted/index.shtml"&gt;parted&lt;/a&gt; to create a partition that fills the free space.&lt;br /&gt;&lt;pre&gt;# parted /dev/sdc&lt;br /&gt;GNU Parted 1.8.1&lt;br /&gt;Using /dev/sdc&lt;br /&gt;Welcome to GNU Parted! Type 'help' to view a list of commands.&lt;br /&gt;(parted) print&lt;br /&gt;&lt;br /&gt;Model: DELL PERC 5/E Adapter (scsi)&lt;br /&gt;Disk /dev/sdc: 3893GB&lt;br /&gt;Sector size (logical/physical): 512B/512B&lt;br /&gt;Partition Table: gpt&lt;br /&gt;&lt;br /&gt;Number  Start  End  Size  File system  Name  Flags&lt;br /&gt;&lt;br /&gt;(parted) mklabel gpt&lt;br /&gt;&lt;br /&gt;(parted) mkpart primary 0 3893G&lt;br /&gt;(parted) print&lt;br /&gt;&lt;br /&gt;Model: DELL PERC 5/E Adapter (scsi)&lt;br /&gt;Disk /dev/sdc: 3893GB&lt;br /&gt;Sector size (logical/physical): 512B/512B&lt;br /&gt;Partition Table: gpt&lt;br /&gt;&lt;br /&gt;Number  Start   End     Size    File system  Name     Flags&lt;br /&gt;1      17.4kB  3893GB  3893GB               primary&lt;br /&gt;&lt;br /&gt;(parted) quit&lt;br /&gt;&lt;/pre&gt;Then I use LVM2 to combine the two RAIDs, sdb1 and sdc1, into one logical volume.&lt;br /&gt;&lt;pre&gt;# pvcreate /dev/sdb1 /dev/sdc1&lt;br /&gt;Physical volume "/dev/sdb1" successfully created&lt;br /&gt;Physical volume "/dev/sdc1" successfully created&lt;br /&gt;# vgcreate nsm_vg /dev/sdb1 /dev/sdc1&lt;br /&gt;Volume group "nsm_vg" successfully created&lt;br /&gt;# pvscan&lt;br /&gt;PV /dev/sdb1   VG nsm_vg   lvm2 [272.25 GB / 632.00 GB free]&lt;br /&gt;PV /dev/sdc1   VG nsm_vg   lvm2 [3.54 TB / 3.54 TB free]&lt;br /&gt;Total: 2 [1.94 TB] / in use: 2 [1.94 TB] / in no VG: 0 [0   ]&lt;br /&gt;&lt;br /&gt;# lvcreate -L 3897G -n nsm_lv nsm_vg&lt;br /&gt;Logical volume "nsm_lv" created&lt;br /&gt;&lt;br /&gt;# mkfs.ext3 -m 1 /dev/nsm_vg/nsm_lv&lt;br /&gt;mke2fs 1.39 (29-May-2006)&lt;br /&gt;Filesystem label=&lt;br /&gt;OS type: Linux&lt;br /&gt;Block size=4096 (log=2)&lt;br /&gt;Fragment size=4096 (log=2)&lt;br /&gt;528482304 inodes, 1056964608 blocks&lt;br /&gt;10569646 blocks (1.00%) reserved for the super user&lt;br /&gt;First nsm block=0&lt;br /&gt;Maximum filesystem blocks=0&lt;br /&gt;32256 block groups&lt;br /&gt;32768 blocks per group, 32768 fragments per group&lt;br /&gt;16384 inodes per group&lt;br /&gt;Superblock backups stored on blocks:&lt;br /&gt;32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632,&lt;br /&gt;2654208,&lt;br /&gt;4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,&lt;br /&gt;102400000, 214990848, 512000000, 550731776, 644972544&lt;br /&gt;&lt;br /&gt;Writing inode tables: done&lt;br /&gt;Creating journal (32768 blocks): done&lt;br /&gt;Writing superblocks and filesystem accounting information: done&lt;br /&gt;&lt;br /&gt;This filesystem will be automatically checked every 34 mounts or&lt;br /&gt;180 days, whichever comes first.  Use tune2fs -c or -i to override.&lt;br /&gt;&lt;br /&gt;# mount /dev/mapper/nsm_vg-nsm_lv /nsm&lt;br /&gt;&lt;br /&gt;$ df -h&lt;br /&gt;Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;---snip---&lt;br /&gt;/dev/mapper/nsm_vg-nsm_lv&lt;br /&gt;       3.8T  196M  3.8T   1% /nsm&lt;br /&gt;&lt;/pre&gt;Now I can put the entry for mounting &lt;tt&gt;/nsm&lt;/tt&gt; into &lt;tt&gt;/etc/fstab&lt;/tt&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-8157453082541063330?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/8157453082541063330/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/03/using-parted-and-lvm2-for-large.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/8157453082541063330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/8157453082541063330'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/03/using-parted-and-lvm2-for-large.html' title='Using parted and LVM2 for large partitions'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297187840164530151.post-4508620014406637783</id><published>2008-02-17T19:53:00.015-05:00</published><updated>2008-03-21T17:07:19.698-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='shmoocon'/><title type='text'>Shmoocon 2008 Notes</title><content type='html'>I attended my third &lt;a href="http://shmoocon.org/"&gt;Shmoocon&lt;/a&gt; in a row, Shmoocon 4. As with most conferences, there were some winning talks and some that struggled. I'll have more to say about over-all quality when I discuss the "0wn the Con" session. Since I find myself with a fairly fuzzy memory about specifics of talks I attended at previous Shmoocons, this post is mainly to prevent that from happening again.&lt;br /&gt;&lt;br /&gt;I went to &lt;a href="http://toorcon.org/"&gt;H1kari&lt;/a&gt;'s talk titled "Intercepting Mobile Phone/GSM Traffic." Once again, he was talking about using &lt;a href="http://en.wikipedia.org/wiki/Field-programmable_gate_array"&gt;FPGA&lt;/a&gt;, this time to assist in breaking GSM encryption. He also had a lot of nice tidbits about weaknesses in GSM, both in implementation and design. I didn't take notes, but I seem to recall that he mentioned some broadcasts occurring in plain text and that, for some reason, the last 10 bits of the A5 key are zeroed out. (Someone correct me if I am remembering incorrectly). After he finishes computing what are basically GSM rainbow tables, H1kari was talking about cracking GSM in as little as &lt;a href="http://www.hackaday.com/2008/02/15/shmoocon-2008-intercepting-gsm-traffic/"&gt;30 seconds using 16 FPGA&lt;/a&gt; and a large amount of disk space. The rainbow tables are being computed using 68 FPGA.&lt;br /&gt;&lt;br /&gt;He didn't really address 3G other than saying it is generally superior in terms of security when compared to GSM.&lt;br /&gt;&lt;br /&gt;I wandered into the last few minutes of &lt;a href="http://deviating.net/lockpicking/"&gt;Deviant Ollam&lt;/a&gt;'s "New Countermeasures to the Bump Key Attack". Although I didn't see enough to comment on the content of the talk, he was getting a great response from the audience and seemed like an entertaining speaker.&lt;br /&gt;&lt;br /&gt;The keynote was supposed to be by &lt;a href="http://www.cs.princeton.edu/%7Efelten/"&gt;Edward Felten&lt;/a&gt; of Princeton's Center for Information Technology Policy. He apparently had the flu, so one of his graduate students, &lt;a href="http://www.cs.princeton.edu/%7Ejhalderm/"&gt;J. Alex Halderman&lt;/a&gt;, had to stand in. Halderman did quite a good job talking about their experience auditing and exploiting voting machines, especially considering what was probably short notice. Most of the information from the talk was widely circulated by the media at one point or another. The keynotes have been consistently good at Shmoocon, so I plan on getting to the keynote at any future Shmoocon I attend.&lt;br /&gt;&lt;br /&gt;On day two I attended "SIPing Your Network" by Humberto J. Abdelnur, Radu State and Olivier Festor. There was some very interesting technical content, including discussion of fuzzing, remote eavesdropping, crashing one particular phone using a single packet with an empty data field, and attacking HTTP-enabled phones with cross-site scripting and SQL injection. Their SIP fuzzer is called &lt;a href="http://kif.gforge.inria.fr/"&gt;KiF&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The presenters stated that they can remotely eavesdrop by dialing an IP phone, having it pick up with no user interaction, and then leave the phone in a state where it appears that the call is hung up but the phone will still send voice data. They had technical difficulties with a demo, and really waited too long to skip the demo and push on. They lost some of the audience as a result, but other than that I thought it was a good presentation.&lt;br /&gt;&lt;br /&gt;At the end, the presenters, who are French, had a slide with information on their SIP fuzzer's license. The presenters indicated that, since it could be classified as an attack tool and because of French law, there are some restrictive requirements including that the license agreement has to be signed and sent in by the end user via snail-mail.&lt;br /&gt;&lt;br /&gt;Jay Beale presented "They're Hacking Our Clients! Why are We Focusing Only on the Servers?" I didn't see any of his opinions as particularly surprising, but it was well presented and he was engaging. It did surprise me when a comment from the audience accused him of fear-mongering. At least in my experience, it is so simple to exploit clients and get internal access that the notion of needing a smart attacker to write a custom exploit against locked-down servers is unnecessary. At this point, I agree with what I think Beale was trying to point out, which is that security has been so focused on Internet-facing servers that clients are relatively easy to exploit and leverage in an attack.&lt;br /&gt;&lt;br /&gt;Beale talked about problems with small offices that have private information on client workstations, using the example of his dentist. This struck home for me since my friend mentioned sitting in his dentist's office once and finding their WAP wide open with the factory default administrator account and password.&lt;br /&gt;&lt;br /&gt;During the portion of the talk devoted to the difficulty with keeping Windows clients up-to-date in an enterprise, he mentioned non-standard or non-Microsoft software, and vulnerable browser plugins, Adobe Acrobat's plugin for example. It made me think of Richard Bejtlich's posts about &lt;a href="http://taosecurity.blogspot.com/2005/12/navy-installing-sun-ray-thin-clients.html"&gt;thin&lt;/a&gt; &lt;a href="http://taosecurity.blogspot.com/2006/01/army-thin-clients-last-month-i-posted.html"&gt;clients&lt;/a&gt;. Of course, thin clients present their own problems and aren't immune to all the security problems of stand-alone desktops, but they may offer advantages by reducing the burdens that are a part of updating.&lt;br /&gt;&lt;br /&gt;"VoIP Penetration Testing" by John Kindervag and Jason Ostrom was another interesting talk about voice over IP. The main focus of the presentation was Ostrom's VoIP Hopper, which is a nice pen-test tool that he used to show how insecure VoIP implementations can be. With Cisco VoIP phones, he showed how their default install has the PC-port on the back enabled, it sends out CBP packets, and it has a sticker on it with the MAC address. Some or all of these defaults can be used along with VoIP Hopper to gain access to the VoIP VLAN.&lt;br /&gt;&lt;br /&gt;"Advanced Protocol Fuzzing - What we learned when bringing Layer2 logic to SPIKE Land" by Enno Rey and Daniel Mende was a good example of two guys with a strong background in networking who decided to bring fuzzing into their area of expertise and share what they learned. Within a relatively short time, my impression was that they went from little experience fuzzing to customizing SPIKE, and they successfully did a live demonstration showing their ability to crash a Cisco 35xx-series remotely. Dave Aitel &lt;a href="http://lists.immunitysec.com/pipermail/dailydave/2008-February/004879.html"&gt;already mentioned it&lt;/a&gt; on his DailyDave mailing list. This was pretty cool stuff, and it will be interesting to see how quickly others jump into the game.&lt;br /&gt;&lt;br /&gt;"0wn the Con" with the Shmoo Group is a talk they have every year that discusses their finances, selection process for talks, methods of collaboration, and more. They also took a lot of feedback from the audience. The main thing I want to point out is that it is really hard to get both consistently good presentations and not rely on the same few presenters every year. Shmoo doesn't want the same old thing, but they want good talks, so it is a difficult balance between risk and reliability. I would say the talks are inconsistent in quality, but it is worth it in my opinion to prevent the talks or presenters from being stale, or having too many repeats from other conferences.&lt;br /&gt;&lt;br /&gt;One funny thing is that it took this long for someone to suggest making electronic feedback forms available on the Shmoocon website for each talk. Four years into it, and finally someone has the brilliant idea that people should be able to provide feedback from their laptops while they're listening to the talk instead of using a pen and paper and turning it in at the end of the conference. D'oh!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-4508620014406637783?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/4508620014406637783/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/02/shmoocon-2008-notes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/4508620014406637783'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/4508620014406637783'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/02/shmoocon-2008-notes.html' title='Shmoocon 2008 Notes'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-312608792431332646</id><published>2008-02-07T19:58:00.000-05:00</published><updated>2008-02-07T19:59:57.702-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='system administration'/><category scheme='http://www.blogger.com/atom/ns#' term='kubuntu'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>Kubuntu with Rhine-II NIC</title><content type='html'>My Windows XP system at home recently became unbootable with a system error. It's an old system running on an Iwill DVD266-Rn motherboard with dual P3 1.4GHz Tualatins. It is my desktop system designated for non-technical users. After a few brief attempts at a fix from the Windows recovery console, I decided to just install an Ubuntu variant, a fairly safe bet for non-technical users.&lt;br /&gt;&lt;br /&gt;I booted to the Ubuntu CD and first backed up all the user profiles and other data to DVD. Then I installed Kubuntu. After installation, I made a few tweaks for my user profile and installed some Firefox plugins like Flash and Java for all users. The whole install and configuration process was fairly quick and painless.&lt;br /&gt;&lt;br /&gt;I did have one issue. My network card is an onboard VIA VT6102 Rhine-II.&lt;br /&gt;&lt;pre&gt;$ lspci | grep Eth&lt;br /&gt;00:12.0 Ethernet controller: VIA Technologies, Inc. VT6102 [Rhine-II] (rev 61)&lt;/pre&gt;It kept flaking out with errors in /var/log/messages.&lt;br /&gt;&lt;pre&gt;kernel: [ 2904.217053] NETDEV WATCHDOG: eth0: transmit timed out&lt;br /&gt;kernel: [ 2904.217210] eth0: Transmit timed out, status 0003, PHY status 786d, resetting...&lt;br /&gt;kernel: [ 2904.217848] eth0: link up, 100Mbps, full-duplex, lpa 0x41E1&lt;/pre&gt;The only way the NIC would start working again was a reboot. Removing and reinserting the modules did not help.&lt;br /&gt;&lt;br /&gt;A web search revealed that this is a common problem with the NIC. Apparently, the NIC does not come back up after the hardware reset. I noticed various proposed solutions for the problem. The solutions included using "noapic" at boot time, using ethtool to disable tso (tcp segmentation offload), and playing around with IRQ settings in the system BIOS.&lt;br /&gt;&lt;br /&gt;Next, I checked the kernel log. This error was a bit more informative.&lt;br /&gt;&lt;pre&gt;kernel: [ 2064.587535] irq 11: nobody cared (try booting with the "irqpoll" option)&lt;br /&gt;&lt;/pre&gt;This message also led me to an &lt;a href="https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.22/+bug/159980"&gt;Ubuntu bug report&lt;/a&gt; where a user confirmed that irqpoll solved the problem in at least one case and also where the Ubuntu team indicated the bug does not qualify for a stable release update.&lt;br /&gt;&lt;br /&gt;Using "irqpoll" as a default option in my grub configuration seems to fix the problem for me. The NIC has been running without any error messages for about two days now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-312608792431332646?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/312608792431332646/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/02/kubuntu-with-rhine-ii-nic.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/312608792431332646'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/312608792431332646'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/02/kubuntu-with-rhine-ii-nic.html' title='Kubuntu with Rhine-II NIC'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-2543422874280414172</id><published>2008-02-06T23:54:00.000-05:00</published><updated>2008-02-07T19:54:00.685-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='snort_inline'/><category scheme='http://www.blogger.com/atom/ns#' term='inline'/><title type='text'>Inline devices and fail open</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.netoptics.com/products/product_family.asp?cid=8&amp;amp;Section=products&amp;amp;sid=&amp;amp;menuitem=8&amp;amp;network=Security"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://2.bp.blogspot.com/_-apeuUdIHjI/R6uoDF345cI/AAAAAAAAAD8/DDzhgIw5DLU/s200/BP4-CU3_thumb.jpg" alt="" id="BLOGGER_PHOTO_ID_5164406168780072386" border="0" /&gt;&lt;/a&gt;There was a post to the sguil-users mailing list asking for recommended fail-open network cards in the hopes that it would be less expensive than alternatives. &lt;a href="http://taosecurity.blogspot.com/"&gt;Richard Bejtlich&lt;/a&gt; pointed out that the &lt;a href="http://marc.info/?l=sguil-users&amp;amp;m=120024163522774&amp;amp;w=2"&gt;long-term costs and lower downtime make bypass switches worth the initial expense&lt;/a&gt;. This make a lot of sense.&lt;br /&gt;&lt;br /&gt;One thing people need to note when talking about inline devices and fail-open hardware is that many devices will only fail open in a powered off state. For example, if you're running Snort inline with a fail-open NIC and the Snort process dies, then the box will no longer pass traffic. Your link is down unless you fix the problem by restarting Snort or you shut off the system completely, which will then cause the fail-open NIC to &lt;a href="http://marc.info/?l=snort-users&amp;amp;m=114160449112245&amp;amp;w=2"&gt;cross-connect&lt;/a&gt; and pass traffic.&lt;br /&gt;&lt;br /&gt;If a system only fails open when the power is off, you still need to be aware that an operating system or application failure can take down your link if the fail-open hardware remains powered on. NetOptics has some &lt;a href="http://www.netoptics.com/products/product_family_details.asp?cid=8&amp;amp;pid=199&amp;amp;Section=products&amp;amp;menuitem=8&amp;amp;tag="&gt;bypass switches that have a heartbeat feature&lt;/a&gt; to address this problem.&lt;br /&gt;&lt;blockquote&gt;An exclusive Heartbeat feature monitors link status between the Bypass and monitoring tools for enhanced reliability. A configurable Heartbeat packet is injected into the monitor port link to help determine availability of attached monitoring tools. For instance, the Bypass Switch can automatically switch network traffic around an unresponsive IPS appliance – even if the IPS is still powered on. Once the IPS re-establishes a connection, traffic is re-routed to the monitor port for continued operation.&lt;/blockquote&gt;This is a better solution than a NIC that will only fail open when the power is off, but not all bypass switches have the feature. If anyone knows of other vendors or hardware that have a similar feature, please let me know.&lt;br /&gt;&lt;br /&gt;It's also important to know that the use of the terms "fail open" and "fail closed" &lt;a href="http://linux.about.com/cs/linux101/g/failsafelparfai.htm"&gt;is not always consistent&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-2543422874280414172?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/2543422874280414172/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/02/inline-devices-and-fail-open.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/2543422874280414172'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/2543422874280414172'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/02/inline-devices-and-fail-open.html' title='Inline devices and fail open'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_-apeuUdIHjI/R6uoDF345cI/AAAAAAAAAD8/DDzhgIw5DLU/s72-c/BP4-CU3_thumb.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297187840164530151.post-5675352229439966701</id><published>2008-01-25T23:39:00.001-05:00</published><updated>2008-02-20T06:39:12.813-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='system administration'/><category scheme='http://www.blogger.com/atom/ns#' term='freebsd'/><category scheme='http://www.blogger.com/atom/ns#' term='slackware'/><category scheme='http://www.blogger.com/atom/ns#' term='vmware'/><title type='text'>Installing VMware on Slackware</title><content type='html'>As with many Unix users, I have tried many flavors, but these days there are a small number I actually use daily. The Linux distribution that I used to really get my feet wet when I first started was Slackware. Back when I first discovered Unix-like operating systems, I researched quite a few Linux distributions. One of the things that appealed to me about Slackware was, even back then, it was considered old-school. It seemed like a good choice if I wanted to learn as much as possible about everything under the hood, so to speak.&lt;br /&gt;&lt;br /&gt;I still use it on a daily basis. Despite that, for some reason I had never installed VMware on a Slackware system. I don't believe VMware officially supports Slackware, and this can be seen pretty easily when you install it. The second question the installer asks is:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;What is the directory that contains the init directories (rc0.d/ to rc6.d/)?&lt;br /&gt;[/etc/init.d]&lt;/pre&gt;&lt;br /&gt;As many will know, the answer on Slackware is null. Slackware does not use SysV-style init by default, instead using a &lt;a href="http://www.slackware.com/config/init.php"&gt;BSD-style layout for init scripts&lt;/a&gt;. The above question assumes that you are using a system that has a directory for each run level, which isn't the case on Slackware.&lt;br /&gt;&lt;br /&gt;I assumed I could just create the empty directories and point the installer there without problems. A quick search &lt;a href="http://www.cs.ucr.edu/%7Ejbyrne/vmware.htm"&gt;confirmed my assumption&lt;/a&gt;. Using the simple for loop from that page:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ sudo mkdir /etc/init.d&lt;br /&gt;$ cd /etc/init.d&lt;br /&gt;$ for i in {0,1,2,3,4,5,6}; do sudo mkdir rc$i.d; done&lt;br /&gt;$ ls&lt;br /&gt;rc0.d  rc1.d  rc2.d  rc3.d  rc4.d  rc5.d  rc6.d&lt;/pre&gt;&lt;br /&gt;Once the install was done, I removed the init.d directory and everything below it. One other note about the &lt;span style="text-decoration: underline;"&gt; &lt;/span&gt;&lt;a href="http://www.cs.ucr.edu/%7Ejbyrne/vmware.htm"&gt;link&lt;/a&gt; is that I don't think you need to use the --compile switch with recent versions of VMware. It seemed to recognize that my Slackware generic kernel could not use the pre-built VMware modules. The only advantage to the --compile switch seems to be that it will skip the confirmation requests prior to compiling the modules, whereas running vmware-config.pl without the compile switch will ask for confirmation before compiling each module.&lt;br /&gt;&lt;br /&gt;For the record, I was using slackware-current, kernel-generic-2.6.23.12, and VMware Workstation 6.0.2.&lt;br /&gt;&lt;br /&gt;On a side note, I think my Slackware experience definitely translated well when I first tried FreeBSD. There are certainly plenty of differences, but it seems to me that going from Slackware to FreeBSD was a smaller learning curve than someone would have coming from a distribution like Ubuntu.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-5675352229439966701?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/5675352229439966701/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/01/installing-vmware-on-slackware.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/5675352229439966701'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/5675352229439966701'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/01/installing-vmware-on-slackware.html' title='Installing VMware on Slackware'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297187840164530151.post-1767846805066874883</id><published>2008-01-15T13:54:00.000-05:00</published><updated>2008-01-26T18:53:11.351-05:00</updated><title type='text'>SANS Institute Security Menaces of 2008</title><content type='html'>&lt;a href="http://www.sans.org/"&gt;SANS&lt;/a&gt; has a list of their "&lt;a href="http://www.sans.org/2008menaces/"&gt;Top 10 Cyber Security Menaces of 2008&lt;/a&gt;". Their list includes descriptions and explanations, but here are the 10 headings.&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Increasingly Sophisticated Web Site Attacks That Exploit Browser Vulnerabilities - Especially On Trusted Web Sites&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Increasing Sophistication And Effectiveness In Botnets&lt;/li&gt;&lt;li&gt; Cyber Espionage Efforts By Well Resourced Organizations Looking To Extract Large Amounts Of Data - Particularly Using Targeted Phishing&lt;/li&gt;&lt;li&gt; Mobile Phone Threats, Especially Against iPhones And Android-Based Phones; Plus VOIP&lt;/li&gt;&lt;li&gt; Insider Attacks&lt;/li&gt;&lt;li&gt; Advanced Identity Theft from Persistent Bots&lt;/li&gt;&lt;li&gt; Increasingly Malicious Spyware&lt;/li&gt;&lt;li&gt; Web Application Security Exploits&lt;/li&gt;&lt;li&gt; Increasingly Sophisticated Social Engineering Including Blending Phishing with VOIP and Event Phishing&lt;/li&gt;&lt;li&gt; Supply Chain Attacks Infecting Consumer Devices (USB Thumb Drives, GPS Systems, Photo Frames, etc.) Distributed by Trusted Organizations&lt;/li&gt;&lt;/ol&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Call me crazy, but doesn't this list basically look like more of the same? It is basically continuing trends from 2007. The people involved with the list are smart and right in the thick of things, but even the descriptions of each item constantly refer to related events that happened in 2007.&lt;br /&gt;&lt;br /&gt;On the other hand, it makes complete sense that the most successful and damaging attacks from 2007 would continue in 2008. The attacks that can't get the job done will fade away in favor of successful methods that will continue and evolve once those on defense adjust to current trends.&lt;br /&gt;&lt;br /&gt;I guess I just wish they had gone out on a limb with their look forward to 2008 rather than taking the safe bets of the current trends continuing. The only one where I think they really took a stab is blended phishing from number nine.&lt;br /&gt;&lt;br /&gt;I don't have much to say about the individual items on the list. Most of them seem on the money. The only one I might question is number five, insider attacks. They state that "insider risk has sky-rocketed", but is the risk really that much higher than it used to be? Insider attacks may be a problem and they may be costly, but I'm not sure the relative risk has sky-rocketed, particularly if you compare the successful insider attacks to successful attacks from outsiders.&lt;br /&gt;&lt;br /&gt;Anecdotally, accidental compromises by insiders seemed to get as much or more coverage recently than purposeful insider attacks. Among other things, telecommuting, portable storage, and proliferation of hand-held devices that are tied to the enterprise don't just make it easier for insider attacks, but also for accidental compromises resulting from insider carelessness. We've all seen the stories of laptops with tens of thousands of personnel records being lost or stolen as a result of poor security practices.&lt;br /&gt;&lt;br /&gt;One last note is that I'm curious who they see as their target audience for the Menaces of 2008.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-1767846805066874883?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/1767846805066874883/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/01/sans-institute-security-menaces-of-2008.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/1767846805066874883'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/1767846805066874883'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/01/sans-institute-security-menaces-of-2008.html' title='SANS Institute Security Menaces of 2008'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-6381372618995355444</id><published>2008-01-14T18:12:00.001-05:00</published><updated>2008-01-15T11:50:51.505-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='nsm'/><category scheme='http://www.blogger.com/atom/ns#' term='malware'/><category scheme='http://www.blogger.com/atom/ns#' term='obfuscation'/><title type='text'>JavaScript decoding and more</title><content type='html'>JavaScript obfuscation is pretty common. There are plenty of places to find out about how to reverse it along with basic malware analysis tips. Here is an example of obfuscated JavaScript I've seen. I will be posting a few malicious code examples in this entry, so caution is advised with any of the code or URL. If you can avoid it, I also would suggest not downloading malicious content on your production network.&lt;pre&gt;eval("\151\146\50\144\157\143\165\155\145\156\164\56\143\157\157\153\151\145\56\151\156\144\145\1&lt;br /&gt;70\117\146\50\47\117\113\47\51\75\75\55\61\51\173\15\12\164\162\171\173\166\141\162\40\145\73\15\&lt;br /&gt;12\166\141\162\40\141\144\157\75\50\144\157\143\165\155\145\156\164\56\143\162\145\141\164\145\10&lt;br /&gt;5\154\145\155\145\156\164\50\42\157\142\152\145\143\164\42\51\51\73\15\12\166\141\162\40\122\151\&lt;br /&gt;&lt;br /&gt;-- snipped --&lt;br /&gt;&lt;br /&gt;\157\162\135\42\40\46\46\40\151\75\75\42\133\157\142\152\145\143\164\40\105\162\162\157\162\135\4&lt;br /&gt;2\51\15\12\173\15\12\154\157\143\141\164\151\157\156\56\162\145\160\154\141\143\145\50\42\141\142&lt;br /&gt;\157\165\164\72\142\154\141\156\153\42\51\73\175\15\12\175\175\175")&lt;/pre&gt;How do I figure out what this exploit attempt is doing? As &lt;a href="https://isc2.sans.org/diary.html?storyid=2268"&gt;pointed out on ISC&lt;/a&gt;, there are &lt;a href="http://handlers.sans.org/dwesemann/decode/index.html"&gt;a number of ways to decode JavaScript&lt;/a&gt;&lt;script language="JavaScript"&gt; at the beginning and a closing &lt;/script&gt;. Remember the following caveat from the first link above:&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;span style="background-color: rgb(255, 204, 0);"&gt;&lt;/span&gt;&lt;blockquote&gt;For the first two methods mentioned, be mindful that you are actually running hostile code inside a potentially vulnerable web browser. Make sure to apply the usual precautions (VMWare or the like, deployed far away from any production network you might have, and keeping a keen eye on the firewall log, etc).&lt;/blockquote&gt;I chose the lazy method in this case. First, I downloaded the JavaScript file using wget. Then I made a copy, changing the file extension from .js to .html, added the script tag, and changed "eval" to "alert".&lt;br /&gt;&lt;pre&gt;&amp;lt;script language=JavaScript&amp;gt;&lt;br /&gt;alert("\151\146\50\144\157\143\165\155\145\156\164\56\143\157\157\153\151\145\56\151\156\144\145\1&lt;br /&gt;&lt;br /&gt;-- snipped --&lt;br /&gt;&lt;br /&gt;\157\165\164\72\142\154\141\156\153\42\51\73\175\15\12\175\175\175")&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;Now opening the file with a browser will show the decoded JavaScript. Please remember that the links and code in the below image are malicious and you visit them or run the code at your own risk.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_-apeuUdIHjI/R4wSCiStzcI/AAAAAAAAADs/XSjcVhXETGA/s1600-h/3332210.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_-apeuUdIHjI/R4wSCiStzcI/AAAAAAAAADs/XSjcVhXETGA/s400/3332210.png" alt="" id="BLOGGER_PHOTO_ID_5155515508206718402" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;There are a number of references to other scripts and files in the above code. There is also further obfuscation in the form of hexadecimal code. There are a number of quick ways to convert the hexadecimal to ASCII, either online or with your programming language of choice. As examples, the hexadecimal of the "Rising" variable above translates to "classid", the "Kaspersky" variable represents a specific CLSID, and the "KV2008" variable translates to "Adodb.Stream". We also see a reference to &lt;a href="http://www.microsoft.com/technet/security/Bulletin/MS06-014.mspx"&gt;MS06-014&lt;/a&gt;, and more.&lt;br /&gt;&lt;br /&gt;If you're using NSM with session data, you can see whether any systems that were subjected to the initial JavaScript exploit code then connected to any related sites after the exploit attempt, which could indicate the exploit succeeded. If you have full content packet captures, you can even see the data in the activity that followed.&lt;br /&gt;&lt;br /&gt;I also decided to download some of the files to see what I was dealing with. The .cab file in particular looked interesting. I downloaded it using wget and then unpacked it using cabextract. This revealed an executable.&lt;br /&gt;&lt;pre&gt;$ file cabfile.exe&lt;br /&gt;cabfile.exe: MS-DOS executable, MZ for MS-DOS&lt;/pre&gt;I also took a quick look with the strings command, which had a few interesting lines.&lt;br /&gt;&lt;pre&gt;$ strings -n 3 -a cabfile.exe | less&lt;br /&gt;MZKERNEL32.DLL&lt;br /&gt;LoadLibraryA&lt;br /&gt;j'Y&lt;br /&gt;GetProcAddress&lt;br /&gt;&lt;br /&gt;-- snipped --&lt;br /&gt;&lt;br /&gt;D:\FastDown\MHDropper\Release\MHDropper.pdb&lt;/pre&gt;The executable definitely doesn't look like a friendly file. Finally, the &lt;a href="http://www.virustotal.com/analisis/efec7bf906a0cdab7c74778ac41fcc3c"&gt;results from VirusTotal&lt;/a&gt; show that only 18 of the 32 engines detect it as malicious. I would say that 18 out of 32 is ineffective at best, especially considering that one large vendor's product did not detect the file as malicious.&lt;br /&gt;&lt;br /&gt;This all goes to show that you can get a lot of information with fairly basic procedures. If anyone has a critique or interesting information to add, please post a comment.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-6381372618995355444?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/6381372618995355444/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/01/javascript-decoding-and-more.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/6381372618995355444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/6381372618995355444'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/01/javascript-decoding-and-more.html' title='JavaScript decoding and more'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_-apeuUdIHjI/R4wSCiStzcI/AAAAAAAAADs/XSjcVhXETGA/s72-c/3332210.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297187840164530151.post-9174725422568024271</id><published>2008-01-07T21:54:00.000-05:00</published><updated>2008-02-08T22:26:10.392-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='shmoocon'/><category scheme='http://www.blogger.com/atom/ns#' term='blackhat'/><category scheme='http://www.blogger.com/atom/ns#' term='training'/><title type='text'>Black Hat DC and Shmoocon 2008</title><content type='html'>Since Richard is a corporate schmuck now, I see the &lt;a href="http://taosecurity.blogspot.com/2008/01/reminder-bejtlich-teaching-at-black-hat.html"&gt;only training he is offering for the year&lt;/a&gt; is at &lt;a href="http://blackhat.com/"&gt;Black Hat DC&lt;/a&gt; in February. I have heard him as a speaker at &lt;a href="http://shmoocon.org/"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;Shmoocon&lt;/span&gt;&lt;/a&gt; and in some smaller groups. I  seem to recall that he presented a snippet of &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;TCP&lt;/span&gt;/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;IP&lt;/span&gt; Weapons School at one local meet and would definitely recommend it. I think he will be ready to tweak the class to the appropriate skill level of his audience.&lt;br /&gt;&lt;br /&gt;The &lt;a href="https://commerce.blackhat.com/selection/bh_dc_2008"&gt;Black Hat training classes&lt;/a&gt; seem decent if unsurprising. &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;Metasploit&lt;/span&gt; 3.0, Reverse Engineering with IDA Pro, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;ROOTKIT&lt;/span&gt;, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;TCP&lt;/span&gt;/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;IP&lt;/span&gt; Weapons School, and Web &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;Application&lt;/span&gt; (In)Security probably would interest me the most. Instructor-led training is expensive!&lt;br /&gt;&lt;br /&gt;Speaking of &lt;a href="http://shmoocon.org/"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;Shmoocon&lt;/span&gt;&lt;/a&gt;, I plan to be there for all three days. It's an enjoyable event.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-9174725422568024271?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/9174725422568024271/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/01/black-hat-dc-and-shmoocon-2008.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/9174725422568024271'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/9174725422568024271'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/01/black-hat-dc-and-shmoocon-2008.html' title='Black Hat DC and Shmoocon 2008'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297187840164530151.post-2899110488458449628</id><published>2008-01-06T18:48:00.000-05:00</published><updated>2008-01-27T09:58:53.286-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='nsm'/><category scheme='http://www.blogger.com/atom/ns#' term='snort'/><category scheme='http://www.blogger.com/atom/ns#' term='inline'/><category scheme='http://www.blogger.com/atom/ns#' term='ids'/><title type='text'>IDS/IPS placement on home network</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_-apeuUdIHjI/R4IpJSStzUI/AAAAAAAAACs/h21s04Bt_r4/s1600-h/homenet.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://3.bp.blogspot.com/_-apeuUdIHjI/R4IpJSStzUI/AAAAAAAAACs/h21s04Bt_r4/s320/homenet.png" alt="" id="BLOGGER_PHOTO_ID_5152726163171167554" border="0" /&gt;&lt;/a&gt;A coworker was asking me about setting up Snort at home so he could get some experience breaking things.&lt;br /&gt;&lt;br /&gt;I put together some very rough diagrams with &lt;a href="http://www.gnome.org/projects/dia/"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;Dia&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;. These are just common and inexpensive solutions for running Snort at home, either in passive (IDS) or active (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;Inline&lt;/span&gt;&lt;/span&gt;) modes. These configurations are all inexpensive. At most, you require an extra hub or switch. The only one that doesn't require anything other than the network cards on the sensor is an external &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;inline&lt;/span&gt; sensor.&lt;br /&gt;&lt;br /&gt;The first is a common home network configuration. This is basically how mine was before I installed Snort.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_-apeuUdIHjI/R4IpJiStzVI/AAAAAAAAAC0/WSgGJ9kQbBw/s1600-h/homenet-external-sensor.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://4.bp.blogspot.com/_-apeuUdIHjI/R4IpJiStzVI/AAAAAAAAAC0/WSgGJ9kQbBw/s320/homenet-external-sensor.png" alt="" id="BLOGGER_PHOTO_ID_5152726167466134866" border="0" /&gt;&lt;/a&gt;The second diagram shows an external sensor. An advantage to this is that you see everything. A disadvantage is that you see everything. The management interface is inside the firewall while the bridging interfaces are outside the firewall. Seeing all the traffic isn't the only disadvantage. Some other disadvantages:&lt;ul&gt;&lt;li&gt;You can't see internal addresses to identify individual systems.&lt;/li&gt;&lt;li&gt;You need a higher performance system. This is not usually a problem on a residential service, but it should be noted that a lot more traffic will pass through system since it's not behind the firewall. You will see a ton of automated scanning and exploit attempts even if the traffic won't make it past the firewall.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Placing the sensor outside the firewall is reasonable if you want to find out just how much activity is happening on the external segment, but it can be really noisy and you lose inside visibility.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_-apeuUdIHjI/R4OGbCStzaI/AAAAAAAAADc/hKbKYkpPr5k/s1600-h/homenet-internal-sensor.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://3.bp.blogspot.com/_-apeuUdIHjI/R4OGbCStzaI/AAAAAAAAADc/hKbKYkpPr5k/s320/homenet-internal-sensor.png" alt="" id="BLOGGER_PHOTO_ID_5153110197671939490" border="0" /&gt;&lt;/a&gt;The third image is using an extra switch. In this example, you will see all traffic going through the firewall, as well as all broadcast traffic on the private network. You won't see &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;unicast&lt;/span&gt;&lt;/span&gt; traffic between internal hosts, but you will be able to identify which host is associated with any given traffic that is seen. Bridging is enabled on the sensor and you can run Snort &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;inline&lt;/span&gt;&lt;/span&gt;. This is my preferred configuration unless you have a lot of wireless traffic.&lt;br /&gt;&lt;br /&gt;The fourth diagram shows how to run Snort passively. There are two basic options. The first is a hub that will broadcast all traffic to all ports. This can hurt performance depending on how busy the internal network is. The second is with an inexpensive switch that supports port mirroring. I haven't used it, but I've seen an inexpensive &lt;a href="http://www.dell.com/content/products/productdetails.aspx/pwcnt_2708?c=us&amp;amp;cs=555&amp;amp;l=en&amp;amp;s=biz"&gt;Dell switch&lt;/a&gt; referenced that supports port mirroring. Note that it only &lt;a href="http://docs.us.dell.com/support/edocs/network/PC27xx/en/ug/PDF/UG_ENd.pdf"&gt;supports monitoring four ports (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;PDF&lt;/span&gt;&lt;/span&gt;)&lt;/a&gt; at a time. In this configuration, you can see all traffic on the local segment in addition to Internet traffic. If using a switch with a mirror, you will probably need a separate management interface. If using a hub, the management interface can also do the sniffing.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_-apeuUdIHjI/R4OGayStzZI/AAAAAAAAADU/DZzPS9aCYnc/s1600-h/homenet-hub-sensor.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://2.bp.blogspot.com/_-apeuUdIHjI/R4OGayStzZI/AAAAAAAAADU/DZzPS9aCYnc/s320/homenet-hub-sensor.png" alt="" id="BLOGGER_PHOTO_ID_5153110193376972178" border="0" /&gt;&lt;/a&gt;You could also use a hub between the modem and the firewall if you wanted to run an external passive sensor.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;EDIT&lt;/span&gt;: Based on &lt;a href="https://www.blogger.com/comment.g?blogID=297187840164530151&amp;amp;postID=2899110488458449628&amp;amp;isPopup=true"&gt;Victor's comment&lt;/a&gt;, I added one other diagram. Diagram five shows the firewall and Snort &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;inline&lt;/span&gt; on the same system. Victor uses &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;iptables&lt;/span&gt; to filter the traffic first, then traffic that passes through the firewall goes to Snort running &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;inline&lt;/span&gt;. He has separate Snort processes for the DMZ and the LAN.&lt;br /&gt;&lt;br /&gt;This configuration is slightly more complicated. There are exceptions, but the places I've worked in the past would not have considered using this type of configuration mainly because they were quite large and wanted off-the-shelf networking products rather than rolling their own firewalls or routers. It is still a useful and &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_9"&gt;usable&lt;/span&gt; configuration to learn, and setting it up would provide a lot of valuable experience.&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_-apeuUdIHjI/R5yb81345bI/AAAAAAAAAD0/f1vmpGDv9DQ/s1600-h/homenet-firewall.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://2.bp.blogspot.com/_-apeuUdIHjI/R5yb81345bI/AAAAAAAAAD0/f1vmpGDv9DQ/s320/homenet-firewall.jpg" alt="" id="BLOGGER_PHOTO_ID_5160170742615696818" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-2899110488458449628?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/2899110488458449628/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/01/idsips-placement-on-home-network.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/2899110488458449628'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/2899110488458449628'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/01/idsips-placement-on-home-network.html' title='IDS/IPS placement on home network'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_-apeuUdIHjI/R4IpJSStzUI/AAAAAAAAACs/h21s04Bt_r4/s72-c/homenet.png' height='72' width='72'/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297187840164530151.post-6649554871154948857</id><published>2008-01-03T21:58:00.001-05:00</published><updated>2008-09-23T07:41:26.761-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='system administration'/><title type='text'>Puppet and Cfengine for management</title><content type='html'>Recently I have been reading more about &lt;a href="http://eatingsecurity.blogspot.com/2007/12/managing-multiple-systems.html"&gt;managing multiple systems&lt;/a&gt;. One project I've heard good things about is &lt;a href="http://www.reductivelabs.com/projects/puppet/"&gt;Puppet&lt;/a&gt;.&lt;br /&gt;&lt;blockquote type="cite"&gt;Puppet lets you centrally manage every important aspect of your system using a cross-platform specification language that manages all the separate elements normally aggregated in different files, like users, cron jobs, and hosts, along with obviously discrete elements like packages, services, and files.&lt;/blockquote&gt;I also know another common choice is &lt;a href="http://www.cfengine.org/"&gt;Cfengine&lt;/a&gt;.&lt;br /&gt;&lt;blockquote type="cite"&gt;Cfengine is an automated suite of programs for configuring and maintaining Unix-like computers.&lt;/blockquote&gt;After reading about each project, I am leaning towards trying Puppet.&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.reductivelabs.com/projects/puppet/"&gt;&lt;br /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-6649554871154948857?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/6649554871154948857/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/01/puppet-and-cfengine-for-management.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/6649554871154948857'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/6649554871154948857'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/01/puppet-and-cfengine-for-management.html' title='Puppet and Cfengine for management'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-6116759464055593406</id><published>2008-01-03T21:36:00.000-05:00</published><updated>2008-01-04T09:37:16.589-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tuning'/><category scheme='http://www.blogger.com/atom/ns#' term='snort'/><title type='text'>Keeping Snort configuration updated</title><content type='html'>One thing that needs attention when keeping Snort tuned is updating the configuration variables in snort.conf when changes are made to the network. I recently noticed an alert was firing on legitimate DNS traffic because a new mail server was not in $SMTP_SERVERS. It's easy enough to add the IP to the SMTP_SERVERS variable.&lt;br /&gt;&lt;br /&gt;In some cases, you may want that variable to hold other ones. For instance, a big company like &lt;a href="http://www.nbc.com/30_Rock/bios/alec_baldwin.shtml"&gt;GE&lt;/a&gt; might have many different sites or logical networks. It may be useful to separate the SMTP servers logically in the Snort.conf if the sensor is going to see the traffic from more than one site:&lt;br /&gt;&lt;pre&gt;var EAST_COAST_TV_SMTP [192.168.1.1, 192.168.1.2]&lt;br /&gt;var MICROWAVE_PROGRAMMING_SMTP [192.168.2.1,192.168.2.2]&lt;br /&gt;var SMTP_SERVERS [$EAST_COAST_TV_SMTP,$MICROWAVE_PROGRAMMING_SMTP]&lt;br /&gt;&lt;/pre&gt;Note that you need the EAST_COAST_TV_SMTP and MICROWAVE_PROGRAMMING_SMTP variables set before they are used in the SMTP_SERVERS variable.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-6116759464055593406?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/6116759464055593406/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2008/01/keeping-snort-configuration-updated.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/6116759464055593406'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/6116759464055593406'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2008/01/keeping-snort-configuration-updated.html' title='Keeping Snort configuration updated'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297187840164530151.post-7836783932292689231</id><published>2007-12-26T20:38:00.000-05:00</published><updated>2007-12-29T16:36:48.822-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='nsm'/><title type='text'>Quicktime exploit, infection, and NSM</title><content type='html'>I've recently seen malware activity that will grab data from HTTP POST requests and send the data to a web server. Reliable signatures for this malware have been part of the Bleeding rules for many months.&lt;br /&gt;&lt;br /&gt;I would hope that up-to-date anti-virus will catch this. There is really no excuse for missing it, but it certainly doesn't have to be the only malicious result of the successful exploit attempts. It's always a good idea to remember that whatever method was used to compromise a system could have been used to do more than what is easily observable.&lt;br /&gt;&lt;br /&gt;Using network security monitoring (NSM), I've worked backwards from the first check-in to find the infection method was the latest &lt;a href="http://secunia.com/advisories/28092/"&gt;Quicktime&lt;/a&gt; exploits. Specifically, I've seen &lt;a href="http://docs.info.apple.com/article.html?artnum=307176"&gt;malicious QTL files&lt;/a&gt; in web traffic prior to the infection symptoms. I'm actually not positive that the most recent vulnerabilities are being exploited rather than one of the numerous older Quicktime vulnerabilities, but the timing of the activity suggests the more recent.&lt;br /&gt;&lt;br /&gt;Even with a reliable IDS signature, you still have to ask whether it is worth risking the loss of data that is in POST requests. I think it's not worth risking, particularly if there is a common external web server that can be blocked to prevent the data extrusion.&lt;br /&gt;&lt;br /&gt;There are a few ways to block data in a case like this. An inline IDS is one, but may not catch all outbound data. In this case, the signatures have an extremely low risk of blocking non-malicious traffic, but that doesn't mean they'll catch all the malicious traffic either. The signatures will accurately point out any infected systems even if configured to drop the traffic.&lt;br /&gt;&lt;br /&gt;Blocking the IP address at a firewall would work well to prevent data loss, but has two main drawbacks. First, you won't detect infected systems with your IDS, at least not based on current signatures. The TCP handshake won't even be completed, let alone the GET request that triggers the alert. Second, but much less problematic, is that you could be blocking many websites on that particular IP address. I say less problematic because it may be the case that one compromised virtual host on an IP address means you should treat the server as completely compromised, so it is best to block the IP rather than just a FQDN.&lt;br /&gt;&lt;br /&gt;Another way to block the server that is receiving the stolen POST data is with an appliance or software for filtering web traffic. The advantage here is that connection attempts may still generate IDS alerts even though the connection actually stops at the web filter rather than the external server. You can potentially block all the traffic while still generating IDS alerts to detect infected systems, depending on your web filter.&lt;br /&gt;&lt;br /&gt;If blocking connections to a web server that is known as a check-in location, NSM is very useful. Put together a script or database query that looks at your session data for repeated connection attempts to the blocked site and you'll find out if you have any systems that may be infected and trying to check-in. Session data will show each connection attempt even though there will be no responses.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-7836783932292689231?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/7836783932292689231/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2007/12/quicktime-exploit-infection-and-nsm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/7836783932292689231'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/7836783932292689231'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2007/12/quicktime-exploit-infection-and-nsm.html' title='Quicktime exploit, infection, and NSM'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-5765570657725761037</id><published>2007-12-02T19:36:00.000-05:00</published><updated>2007-12-02T20:30:23.547-05:00</updated><title type='text'>What I read</title><content type='html'>One of the things I've noticed about a lot of successful information security professionals is the large amount of reading they do. The pace and scope of the field make it very important to read.&lt;br /&gt;&lt;br /&gt;As I find one site to read, it often leads to one, two, or many other interesting sites. Reading all these sites has led to me learning a huge amount on a wide variety of topics. Even when I'm just reading opinions rather than technical content, it is often food for thought.&lt;br /&gt;&lt;br /&gt;The sites I have listed on the right represent just a portion of the regular reading I do. Some of those sites will also mention or have links to other good reading. I particularly like technical content, explanations or HOWTOs that can be used in the real world.&lt;br /&gt;&lt;br /&gt;While it's probably impossible to read too much in this field, it's definitely possible to read too little.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-5765570657725761037?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/5765570657725761037/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2007/12/what-i-read.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/5765570657725761037'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/5765570657725761037'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2007/12/what-i-read.html' title='What I read'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-7152468165095005128</id><published>2007-12-02T14:25:00.001-05:00</published><updated>2008-09-23T07:41:03.119-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='system administration'/><category scheme='http://www.blogger.com/atom/ns#' term='nsm'/><category scheme='http://www.blogger.com/atom/ns#' term='rhel'/><title type='text'>Managing multiple systems</title><content type='html'>This post is really just my thoughts and notes on managing multiple Sguil sensors. A lot of the thoughts could be applied to managing multiple UNIX-like systems in general, whether or not they are NSM systems. I would love any feedback on what other people recommend for managing Unix deployments.&lt;br /&gt;&lt;br /&gt;In the past, most Linux or FreeBSD systems I've managed have been single systems, not part of a larger group of systems. Currently, I'm actually well past the point where I should have come up with a more elegant and automated solution to managing multiple systems of similar configurations.&lt;br /&gt;&lt;br /&gt;In my current environment, I have multiple sensors with almost identical configurations. The configuration differences are minor and mainly because of different sensor locations.&lt;br /&gt;&lt;br /&gt;Most of my management amounts to patching operating systems, patching software, and updating Snort signatures. To update Snort signatures, I generally run &lt;a href="http://oinkmaster.sourceforge.net/"&gt;Oinkmaster&lt;/a&gt; on a designated system, review rule changes, disable or enable new rules as needed, then run a script to push out the updated rules and restart Snort with the new rules on each sensor.&lt;br /&gt;&lt;br /&gt;When I build new sensors, I manually install the operating system. With RHEL systems, I should really be using &lt;a href="https://www.redhat.com/docs/manuals/enterprise/RHEL-5-manual/en-US/RHEL510/Installation_Guide/ch-kickstart2.html"&gt;Kickstart&lt;/a&gt; to help automate the installation and configuration of new systems.&lt;br /&gt;&lt;br /&gt;After I install the operating system, I have a set of scripts I use to automate configuration and installation of software. These scripts are similar to David Bianco's InstantNSM except mine are much more specifically tailored for my environment and include configuration of the operating system, not just installing NSM software.&lt;br /&gt;&lt;br /&gt;User account management is another facet of system management. For NSM sensors, since access to the systems is limited to an extremely small number of people, account management is not a huge issue and I won't be getting into that aspect of system management.&lt;br /&gt;&lt;br /&gt;One site I've seen mentioned as a reference for managing numerous systems is &lt;a href="http://www.infrastructures.org/"&gt;Infrastructures.Org&lt;/a&gt;. The first thing I noticed on the Infrastructures site was the recommendation to use version control as a way of managing configuration files. This is probably obvious to a lot of people, but I never really thought of version control for that purpose. &lt;a href="http://subversion.tigris.org/"&gt;Subversion&lt;/a&gt;, &lt;a href="http://cyclic.com/"&gt;CVS&lt;/a&gt;, or your version control of choice may be useful for managing systems, not just software. Normally, when I thought version control I thought of it in reference to software projects, not system management. Another option would be something like &lt;a href="http://www.magnicomp.com/rdist/index.shtml"&gt;rdist&lt;/a&gt;, which is a program to maintain identical copies of files over multiple hosts.&lt;br /&gt;&lt;br /&gt;One other thing some people do is local software repositories. On RHEL systems this might mean a local RPM repository for software that has been customized or is not available in the official Red Hat repositories. This could also mean considering something like &lt;a href="http://www.red-hat.com/docs/manuals/RHNetwork/satellite/4.1.0/"&gt;Red Hat Satellite Server&lt;/a&gt;, depending on exactly what you want out of it. In my case, I think Satellite Server may be overkill but it certainly has &lt;a href="http://www.red-hat.com/docs/manuals/RHNetwork/satellite/4.1.0/s1-intro-sat.html"&gt;some intersting things to offer&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;There are several things I see myself needing to do to make management of my systems better. These are just places to start, and hopefully once I explore the options I will be posting my experiences.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Kickstart for OS installation, which would also probably replace some of my scripts used to configure new systems.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Modify my scripts for NSM setup to work with Kickstart if necessary.&lt;/li&gt;&lt;li&gt;Version control and automating the process of systems synchronizing files.&lt;/li&gt;&lt;li&gt;Local software repositories for customized software, including making RPMs of the modified software instead of compiling the software and then pushing it out.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-7152468165095005128?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/7152468165095005128/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2007/12/managing-multiple-systems.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/7152468165095005128'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/7152468165095005128'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2007/12/managing-multiple-systems.html' title='Managing multiple systems'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-8132431095158416745</id><published>2007-11-30T17:30:00.003-05:00</published><updated>2008-04-17T13:19:42.158-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='scripts'/><category scheme='http://www.blogger.com/atom/ns#' term='tcpdump'/><category scheme='http://www.blogger.com/atom/ns#' term='sguil'/><title type='text'>A "for" loop with tcpdump</title><content type='html'>This is the kind of post to which most people with Linux or Unix experience will say "Duh!", or even offer better ways to do what I'm doing. It's just a short shell script I use to loop through all the packet capture files on a Sguil sensor looking for specific host(s) and/or port(s). Sometimes it is easier to run a script like this and then SCP the files from the sensor to a local system instead of querying and opening the packet captures one by one using the Sguil client. This also allows more leisurely analysis without worrying about the log_packets script deleting any of the data I want to see.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://snort.org/about_snort/team.html"&gt;Nigel Houghton&lt;/a&gt; mentioned that any shell script of more than 10 or 20 lines should be rewritten in Perl. Despite his advice, I do plan to switch some of my shell scripts to Perl when I get the chance. ;)&lt;br /&gt;&lt;br /&gt;The sensorname variable works for me because my sensor uses the hostname as the sensor name. If my sensor name didn't match the actual hostname or I had multiple sensors on one host then I would have to change the variable.&lt;br /&gt;&lt;br /&gt;The BPF expression can be changed as needed. Maybe a better way would be to set it to a command line argument so you don't have to edit the file every time you run the script. The following example uses a Google IP address and port 80 for the BPF. I most often use this script to simply grab all traffic associated with one or more IP addresses.&lt;br /&gt;&lt;br /&gt;It may also be worth noting that I run the script as a user that has permissions to the packet captures.&lt;br /&gt;&lt;pre&gt;#!/bin/sh&lt;br /&gt;&lt;br /&gt;sensorname="`hostname`"&lt;br /&gt;bpfexpression="host 64.233.167.99 and port 80"&lt;br /&gt;outdir=/home/nr/scriptdump&lt;br /&gt;&lt;br /&gt;if [ ! -d $outdir]; then&lt;br /&gt;    mkdir $outdir&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;# For each dir in the dailylogs dir&lt;br /&gt;for i in $( ls /nsm/$sensorname/dailylogs/ ); do&lt;br /&gt;    # For each file in dailylogs/$i dir&lt;br /&gt;    for j in $( ls /nsm/$sensorname/dailylogs/$i ); do&lt;br /&gt;        # Run tcpdump and look for the host&lt;br /&gt;        tcpdump -r /nsm/$sensorname/dailylogs/$i/$j -w $outdir/$j.pcap $bpfexpression&lt;br /&gt;    done&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;# For each pcap&lt;br /&gt;cd $outdir&lt;br /&gt;for file in $( ls *.pcap ); do&lt;br /&gt;    # If file has size of 24, it has no data so rm file&lt;br /&gt;    if [ "`ls -l $file | awk '{print $5}'`" = "24" ]; then&lt;br /&gt;        rm -f "$file"&lt;br /&gt;    fi&lt;br /&gt;done&lt;br /&gt;&lt;/pre&gt;One of the things I like about posting even a simple script like this is that it makes me really think about how it could be improved. For instance, it might be nice to add a variable for the write directory so it is easier to change where the output files go.&lt;br /&gt;&lt;br /&gt;Also, in Sguil the full content packet captures use the &lt;a href="http://en.wikipedia.org/wiki/Unix_time"&gt;Unix time&lt;/a&gt; in the file names. If you ever had a copy of the file where the timestamp wasn't preserved, you could still find it by looking at the epoch time in the file name. For instance, with a file named "snort.log.1194141602", the following would convert the epoch time to local time:&lt;br /&gt;&lt;pre&gt;$ date -d @1194141602&lt;br /&gt;Sat Nov  3 22:00:02 EDT 2007&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-8132431095158416745?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/8132431095158416745/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2007/11/for-loop-with-tcpdump.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/8132431095158416745'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/8132431095158416745'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2007/11/for-loop-with-tcpdump.html' title='A &quot;for&quot; loop with tcpdump'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-1385691158400153835</id><published>2007-11-29T21:43:00.000-05:00</published><updated>2007-11-29T21:49:06.204-05:00</updated><title type='text'>Origin of Eating Security</title><content type='html'>When I started this blog, I couldn't really think of a name for the blog. I figured that maybe someone else could do the job for me, so I searched the Internet for "blog name generator". I didn't really find anything useful, so then I tried searching for a &lt;a href="http://www.google.com/search?hl=en&amp;amp;q=band+name+generator&amp;amp;btnG=Google+Search"&gt;band name generator&lt;/a&gt;. I plugged the word "security" into &lt;a href="http://www.bandnamemaker.com/"&gt;the first hit&lt;/a&gt;, and that's how I ended up Eating Security.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-1385691158400153835?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/1385691158400153835/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2007/11/origin-of-eating-security.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/1385691158400153835'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/1385691158400153835'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2007/11/origin-of-eating-security.html' title='Origin of Eating Security'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297187840164530151.post-1397650924594831088</id><published>2007-11-16T21:38:00.000-05:00</published><updated>2007-11-17T22:16:54.387-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='snort'/><category scheme='http://www.blogger.com/atom/ns#' term='bleeding rules'/><title type='text'>Bleeding Edge Founder Steps Down</title><content type='html'>The founder of Bleeding Edge Threats, Matt Jonkman, has &lt;a href="http://www.bleedingthreats.net/index.php/2007/11/17/im-leaving-bleeding-threats/"&gt;stepped down&lt;/a&gt;. I don't think this could be considered anything but bad news for the project. Apparently the project now belongs to Sensory Networks, the main sponsor of the last 12 months. I believe the rules are BSD licensed, so while they are currently free, who knows what will happen in the future.&lt;br /&gt;&lt;br /&gt;I'm sure Matt Jonkman will continue to do some interesting things in the future, and it sounds like he hopes to share with the rest of us again.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-1397650924594831088?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/1397650924594831088/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2007/11/bleeding-edge-founder-steps-down.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/1397650924594831088'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/1397650924594831088'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2007/11/bleeding-edge-founder-steps-down.html' title='Bleeding Edge Founder Steps Down'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-448992360492367262</id><published>2007-11-01T17:35:00.000-04:00</published><updated>2008-01-31T21:37:37.997-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MMAP'/><category scheme='http://www.blogger.com/atom/ns#' term='libpcap'/><category scheme='http://www.blogger.com/atom/ns#' term='snort'/><category scheme='http://www.blogger.com/atom/ns#' term='rhel'/><title type='text'>Snort Performance and Memory Map Pcap on RHEL</title><content type='html'>I previously wrote about &lt;a href="http://eatingsecurity.blogspot.com/2007/09/transparent-bridging-mmap-pcap-and.html"&gt;installing Phil Wood's memory map enabled libpcap&lt;/a&gt; as an academic exercise on my home network. As Victor Julien &lt;a href="http://eatingsecurity.blogspot.com/2007/09/transparent-bridging-mmap-pcap-and.html#c2157641740777959362"&gt;pointed out to me&lt;/a&gt;, Snort in inline mode will be using ip_queue rather than the libpcap interface to the kernel. However, I have actually been using &lt;a href="http://public.lanl.gov/cpw/"&gt;mmap libpcap&lt;/a&gt; with Snort in IDS mode for quite a while to help reduce packet loss monitoring fairly high bandwidth connections. In testing, I have been able to consistently run Snort in IDS mode and a flow_depth of zero without packet loss on a link doing up to 80Mb/s. Admittedly, this is on pretty high end hardware but it is much better performance than Snort with the regular libpcap. By tuning Snort, like setting flow_depth to something more sensible than zero and disabling rules that are bad for performance, it is easy to see how Snort could be used to monitor even busier links.&lt;br /&gt;&lt;br /&gt;There are other ways to increase Snort performance, too. One is using PF_RING. Richard Fifarek has a good write-up about &lt;a href="http://synfulpacket.blogspot.com/2007/04/kernel-pfring-rpm.html"&gt;setting up PF_RING with Red Hat Enterprise Linux 4&lt;/a&gt;. Maybe I'll get around to testing PF_RING under the same circumstances as I use mmap libpcap, but I'd love to see comments from those that have done it already. I have seen a few comparisons, but not recently. The documentation for PACKET_MMAP, which can be found in the Linux kernel source, has more to say about packet capture performance.&lt;br /&gt;&lt;blockquote&gt;It's fine to use PACKET_MMAP to improve the performance of the capture process, but it isn't everything. At least, if you are capturing at high speeds (this is relative to the cpu speed), you should check if the device driver of your network interface card supports some sort of interrupt load mitigation or (even better) if it supports NAPI, also make sure it is enabled.&lt;/blockquote&gt;I haven't had a chance to play with NAPI yet, but for anyone that is interested there is a NAPI_HOWTO.txt, also in the documentation section of the Linux kernel source.&lt;br /&gt;&lt;br /&gt;One last way to improve performance is to use an architecture-specific compiler when building Snort. Although I'm not sure about other architectures, using the Intel compiler for some Intel hardware was mentioned as one of the best ways to improve performance when someone asked a SourceFire employee  at &lt;a href="http://shmoocon.org/"&gt;Shmoocon&lt;/a&gt; a couple years ago about improving Snort performance.&lt;br /&gt;&lt;br /&gt;Installing the modified libpcap and reinstalling all the software that depends on it is fairly simple on RHEL. In this case, I'm using RHEL5. Before installing the new libpcap, I stopped any processes that depended on Red Hat's official libpcap package. I removed the official Red Hat libpcap package and any other RPMs that depended on it.&lt;br /&gt;&lt;pre&gt;rpm -e libpcap tcpdump&lt;/pre&gt;Then I installed the new libpcap.&lt;br /&gt;&lt;pre&gt;tar xvzf libpcap-0.9x.20070528.tar.gz&lt;br /&gt;cd libpcap--0.9x.20070528&lt;br /&gt;./configure&lt;br /&gt;make&lt;br /&gt;make install&lt;/pre&gt;Now I can go ahead and reinstall the other software using the new libpcap. Just for kicks, the following installs libnet so I can enable flex-resp support even though I don't consider flex-resp very useful in production. Better to just put the box inline if you really need to stop traffic. TCP resets or ICMP unreachable messages leave something to be desired.&lt;br /&gt;&lt;pre&gt;cd /usr/src/Libnet-1.0.2a&lt;br /&gt;./configure --prefix=/usr/local/libnet&lt;br /&gt;make&lt;br /&gt;make install&lt;br /&gt;&lt;br /&gt;cd /usr/src/tcpdump-3.9.8/&lt;br /&gt;make clean&lt;br /&gt;./configure&lt;br /&gt;make&lt;br /&gt;make install&lt;/pre&gt;The following configure statement for Snort should work with 2.6.1.5 or 2.8.0, but I think the --enable-stream4udp is actually now a default for 2.8.0 while it was not for 2.6.x.x.&lt;br /&gt;&lt;pre&gt;cd /usr/src/snort-2.8.0&lt;br /&gt;make clean&lt;br /&gt;./configure --without-mysql --without-postgresql --without-oracle&lt;br /&gt;--without-odbc --enable-dynamicplugin --enable-flexresp --enable-stream4udp&lt;br /&gt;--enable-perfprofiling --with-libnet-libraries=/usr/local/libnet/lib&lt;br /&gt;--with-libnet-includes=/usr/local/libnet/include&lt;br /&gt;make&lt;br /&gt;make install&lt;/pre&gt;I'm using sancp for session data:&lt;br /&gt;&lt;pre&gt;cd /usr/src/sancp-1.6.1/&lt;br /&gt;make clean&lt;br /&gt;make&lt;br /&gt;./install.sh&lt;/pre&gt;Finally, I need to set PCAP_FRAMES to a value that the system can use. Finding the maximum can be trial and error, but here are some examples how to set it. One is to set it for each individual application at startup. For instance, sancp doesn't seem to like to use PCAP_FRAMES, so I put the following in the sancpd init script:&lt;br /&gt;&lt;pre&gt;export PCAP_FRAMES=0&lt;/pre&gt;On the other hand, Snort in IDS mode or packet logging mode can benefit a lot from setting PCAP_FRAMES. For instance,&lt;br /&gt;&lt;pre&gt;export PCAP_FRAMES=65535&lt;/pre&gt;As I said, it may take experimentation to find the maximum value or the value that results in the best performance. For something like tcpdump, you might want to create an alias something like:&lt;br /&gt;&lt;pre&gt;alias tcpdump='PCAP_FRAMES=65535 tcpdump'&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-448992360492367262?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/448992360492367262/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2007/11/snort-performance-and-memory-map-pcap.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/448992360492367262'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/448992360492367262'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2007/11/snort-performance-and-memory-map-pcap.html' title='Snort Performance and Memory Map Pcap on RHEL'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297187840164530151.post-8543184977179970318</id><published>2007-10-30T20:32:00.002-04:00</published><updated>2007-10-30T21:39:43.362-04:00</updated><title type='text'>Better Work Means More Work</title><content type='html'>Security is one of those fields where, the better a job you do, the more work you have to do. To some extent, all jobs are like this. If you do a terrible job, nobody is going to want to give you more work. If you do a great job, people will give you as much or more work than you can handle. However, this is not really the type of extra work I am referring to.&lt;br /&gt;&lt;br /&gt;One example of what I'm talking about is intrusion detection. The better you get at intrusion detection, the more incident response you will end up doing as a result. Getting better at security operations in general will often lead to the discovery of more intrusions as your knowledge increases, new systems are implemented, and security systems are improved. Someone who is good at penetration testing or application fuzzing may be able to find and exploit more vulnerabilities, and in the end do extra work because of that. I'm sure there are many more examples.&lt;br /&gt;&lt;br /&gt;On the other hand, better work also means you can streamline processes or reduce the number of security incidents. Increasing the depth of your defense to reduce security incidents, automating processes, more clearly mapping processes, and more efficiently achieving an objective are all possibilities to reduce the amount of work. Being better at penetration testing may mean finding more useful information about the security of your target, but you may also perform the actual penetration test more quickly.&lt;br /&gt;&lt;br /&gt;Richard Bejtlich likes to point out that &lt;a href="http://taosecurity.blogspot.com/search?q=prevention+eventually+fails"&gt;prevention eventually fails&lt;/a&gt;. I agree but would like to add that I think there will always be security incidents that are missed. Getting better at detection means more time spent on incidents, which is a good thing by the way. However, no matter how good you get at detection, I firmly believe that nobody will catch everything worth catching. There are probably exceptions, but in the type of enterprise network I'm used to dealing with, catching every single noteworthy security incident seems unlikely.&lt;br /&gt;&lt;br /&gt;Someone in operational security can also improve prevention. Just because prevention eventually fails doesn't mean it never works or should be ignored. You might think that getting better at prevention means you will have less work to do when it comes to detection and response. But better prevention generally means more work on design, testing, configuration, maintenance, documentation, and more.&lt;br /&gt;&lt;br /&gt;Anyone that does a good job will be in demand, leading to more work. With security, I also think doing a good job means you may discover more work to do along every step of the way.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-8543184977179970318?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/8543184977179970318/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2007/10/better-work-means-more-work.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/8543184977179970318'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/8543184977179970318'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2007/10/better-work-means-more-work.html' title='Better Work Means More Work'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-8378907386215126992</id><published>2007-10-23T19:34:00.000-04:00</published><updated>2007-10-23T20:19:14.847-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='snort_inline'/><category scheme='http://www.blogger.com/atom/ns#' term='snort'/><title type='text'>Upgrading to Snort 2.8.0</title><content type='html'>I finally upgraded my test sensor from Snort 2.6.1.5 to Snort 2.8.0. David &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;Bianco&lt;/span&gt; &lt;a href="http://blog.vorant.com/2007/08/snort-28-beta.html"&gt;mentioned some of the new features&lt;/a&gt; in his blog a couple of months ago, so I won't get into the differences. I am mainly documenting the things I had to do for the upgrade so I have a reference if needed at a future date.&lt;br /&gt;&lt;br /&gt;The first thing I did was look through the documentation in the "docs" directory, reading some of the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;README&lt;/span&gt; files for the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;preprocessors&lt;/span&gt;. The &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;README&lt;/span&gt;.variables file was of particular interest since Snort 2.8 allows port lists. I also looked at the snort.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;conf&lt;/span&gt; file in the "etc" directory of the source tree to see how it differed from my current configuration file.&lt;br /&gt;&lt;br /&gt;Next, I made a copy of my snort.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;conf&lt;/span&gt; from 2.6.1.5 and edited it for the changes in 2.8.0. I changed the HTTP_PORTS variable to list a few other ports besides 80, including 8080 and 8000. The &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;portvar&lt;/span&gt; variable was used in the examples of multiple HTTP_PORTS.&lt;br /&gt;&lt;pre&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;portvar&lt;/span&gt; HTTP_PORTS [80,8000,8080,8888]&lt;/pre&gt;Although I only run HTTP on port 80, the Snort web-client &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;ruleset&lt;/span&gt; and a number of Bleeding rules use the $HTTP_PORTS variable to detect attacks against web clients like Internet Explorer, Mozilla &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;Firefox&lt;/span&gt;, media players, and more. After that simple change, I configured and installed Snort.&lt;br /&gt;&lt;pre&gt;./configure --enable-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;dynamicplugin&lt;/span&gt; --enable-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;inline&lt;/span&gt; --enable-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;perfprofiling&lt;/span&gt;&lt;br /&gt;make&lt;br /&gt;make install&lt;/pre&gt;After installing, I tried to start Snort. The first problem I encountered was with my stream5 configuration. I had previously been using the stream4 and the flow &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;preprocessors&lt;/span&gt;, but when changing the configuration to use stream5 I had not removed the flow &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;preprocessor&lt;/span&gt; configuration. Stream5 handles everything that used to be handled by the combination of flow and stream4, so I removed the flow configuration. I also had to add the stream5_&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;udp&lt;/span&gt; and stream5_&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;icmp&lt;/span&gt; options.&lt;br /&gt;&lt;br /&gt;A check of the configure help will also show that --enable-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;dynamicplugin&lt;/span&gt; is the default with 2.8.0, so it should not actually be needed in the configuration command.&lt;br /&gt;&lt;br /&gt;After fixing stream5, I tried again and had one more problem. I was getting the following errors:&lt;br /&gt;&lt;pre&gt;Oct 23 19:18:52 sensor snort[3117]: /etc/snort/snort.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;conf&lt;/span&gt;(206) unknown dynamic &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;preprocessor&lt;/span&gt; "ftp_telnet"&lt;br /&gt;Oct 23 19:18:52 sensor snort[3117]: /etc/snort/snort.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_20"&gt;conf&lt;/span&gt;(210) unknown dynamic &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_21"&gt;preprocessor&lt;/span&gt; "ftp_telnet_protocol"&lt;br /&gt;Oct 23 19:18:52 sensor snort[3117]: /etc/snort/snort.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;conf&lt;/span&gt;(221) unknown dynamic &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_23"&gt;preprocessor&lt;/span&gt; "ftp_telnet_protocol"&lt;br /&gt;Oct 23 19:18:52 sensor snort[3117]: /etc/snort/snort.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_24"&gt;conf&lt;/span&gt;(226) unknown dynamic &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_25"&gt;preprocessor&lt;/span&gt; "ftp_telnet_protocol"&lt;br /&gt;Oct 23 19:18:52 sensor snort[3117]: /etc/snort/snort.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_26"&gt;conf&lt;/span&gt;(238) unknown dynamic &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_27"&gt;preprocessor&lt;/span&gt; "smtp"&lt;br /&gt;Oct 23 19:18:52 sensor snort[3117]: /etc/snort/snort.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_28"&gt;conf&lt;/span&gt;(307) unknown dynamic &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_29"&gt;preprocessor&lt;/span&gt; "&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_30"&gt;dcerpc&lt;/span&gt;"&lt;br /&gt;Oct 23 19:18:52 sensor snort[3117]: /etc/snort/snort.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_31"&gt;conf&lt;/span&gt;(313) unknown dynamic &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_32"&gt;preprocessor&lt;/span&gt; "&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_33"&gt;dns&lt;/span&gt;"&lt;br /&gt;Oct 23 19:18:52 sensor snort[3117]: FATAL ERROR: &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_34"&gt;Misconfigured&lt;/span&gt; dynamic &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_35"&gt;preprocessor&lt;/span&gt;(s)&lt;/pre&gt;This was pretty easy to fix. I just needed the proper path to the dynamic &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_36"&gt;preprocessors&lt;/span&gt;.&lt;br /&gt;&lt;pre&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_37"&gt;dynamicpreprocessor&lt;/span&gt; directory /&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_38"&gt;usr&lt;/span&gt;/local/lib/snort_&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_39"&gt;dynamicpreprocessor&lt;/span&gt;/&lt;/pre&gt;After I fixed the snort.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_40"&gt;conf&lt;/span&gt;, the next try to start Snort 2.8.0 was successful. Now that I have it installed and running with very similar settings to 2.6.1.5, it's time to dig deeper into the differences and possibly test other configuration changes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-8378907386215126992?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/8378907386215126992/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2007/10/upgrading-to-snort-280.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/8378907386215126992'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/8378907386215126992'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2007/10/upgrading-to-snort-280.html' title='Upgrading to Snort 2.8.0'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297187840164530151.post-9067547477372869714</id><published>2007-10-16T20:59:00.000-04:00</published><updated>2007-10-17T12:46:37.826-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='nsm'/><category scheme='http://www.blogger.com/atom/ns#' term='sguil'/><category scheme='http://www.blogger.com/atom/ns#' term='bad hack'/><title type='text'>Sguil 0.7.0 Client and NetBIOS Names</title><content type='html'>The previous versions of Sguil clients used a different method when doing a reverse DNS lookup. This method must have fallen back to the operating system's name lookup methods at some point, because I used to get NetBIOS names on systems that had them when there was no DNS name returned. The Sguil 0.7.0 client uses &lt;a href="http://tcllib.sourceforge.net/doc/tcllib_dns.html"&gt;tcllib's DNS client&lt;/a&gt; to resolve names, which is used to allow DNS proxying through OpenDNS or other DNS servers. However, this method is purely DNS, so any Windows system without a DNS entry would return "Unknown" as the hostname. I decided to play with the client and add NetBIOS name queries in the event the reverse DNS came up empty.&lt;br /&gt;&lt;br /&gt;The file that contains the GetHostbyAddr proc in Sguil is extdata.tcl and lives in the lib directory. From the description in the file:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;#&lt;br /&gt;# GetHostbyAddr: uses extended tcl (wishx) to get an ips hostname&lt;br /&gt;#                May move to a server func in the future&lt;br /&gt;#&lt;/pre&gt;&lt;br /&gt;The proc does a few things. First, it checks to see whether external DNS is enabled and whether an external server has been configured in sguil.conf. If an external DNS server is set, then the process will see if a HOME_NET is set. If the HOME_NET is set, it is compared to the IP being resolved. A match means that the nameserver is set to the local rather than the external. If HOME_NET is not set or the IP does not match HOME_NET, then the external nameserver is used. If external DNS is not selected in the client, then the local nameserver is used.&lt;br /&gt;&lt;br /&gt;If the name resolution returns no value, then the client displays "Unknown" as a result. Just prior to that is where I added the NetBIOS name lookup. Here is the whole GetHostbyAddr proc after I modified it, with a few comments to follow:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;proc GetHostbyAddr { ip } {&lt;br /&gt;&lt;br /&gt;   global EXT_DNS EXT_DNS_SERVER HOME_NET NETBIOS_NET&lt;br /&gt;&lt;br /&gt;   if { $EXT_DNS } {&lt;br /&gt;&lt;br /&gt;       if { ![info exists EXT_DNS_SERVER] } {&lt;br /&gt;&lt;br /&gt;           ErrorMessage "An external name server has not been configured in sguil.conf. Resolution aborted."&lt;br /&gt;           return&lt;br /&gt;&lt;br /&gt;       } else {&lt;br /&gt;&lt;br /&gt;           set nameserver $EXT_DNS_SERVER&lt;br /&gt;&lt;br /&gt;           if { [info exists HOME_NET] } {&lt;br /&gt;&lt;br /&gt;               # Loop thru HOME_NET. If ip matches any networks than use a the locally configured&lt;br /&gt;               # name server&lt;br /&gt;               foreach homeNet $HOME_NET {&lt;br /&gt;&lt;br /&gt;                   set netMask [ip::mask $homeNet]&lt;br /&gt;                   if { [ip::equal ${ip}/${netMask} $homeNet] } { set nameserver local }&lt;br /&gt;&lt;br /&gt;               }&lt;br /&gt;&lt;br /&gt;           }&lt;br /&gt;&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;   } else {&lt;br /&gt;&lt;br /&gt;       set nameserver local&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   if { $nameserver == "local" } {&lt;br /&gt;&lt;br /&gt;       set tok [dns::resolve $ip]&lt;br /&gt;&lt;br /&gt;   } else {&lt;br /&gt;&lt;br /&gt;       set tok [dns::resolve $ip -nameserver $nameserver]&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   set hostname [dns::name $tok]&lt;br /&gt;   dns::cleanup $tok&lt;br /&gt;&lt;br /&gt;   # Added hack to use NetBIOS name lookups if no DNS entry&lt;br /&gt;   if { $hostname == "" } {&lt;br /&gt;&lt;br /&gt;       # Only check NETBIOS_NET addresses for NetBIOS names&lt;br /&gt;       if { [info exists NETBIOS_NET] } {&lt;br /&gt;&lt;br /&gt;           # Loop thru NETBIOS_NET. If ip matches then do NetBIOS lookup&lt;br /&gt;           foreach netbiosNet $NETBIOS_NET {&lt;br /&gt;&lt;br /&gt;               set netMask [ip::mask $netbiosNet]&lt;br /&gt;               if { [ip::equal ${ip}/${netMask} $netbiosNet] } {&lt;br /&gt;&lt;br /&gt;                   # NetBIOS for Windows client&lt;br /&gt;                   if { $::tcl_platform(platform) == "windows" } {&lt;br /&gt;&lt;br /&gt;                       regexp {.+?(.{15})&lt;00&gt;} [ exec nbtstat -a $ip ] \&lt;br /&gt;                       dummyvar hostname }&lt;br /&gt;&lt;br /&gt;                   # NetBIOS for Unix client but you need samba client tools&lt;br /&gt;                   if { $::tcl_platform(platform) == "unix" } {&lt;br /&gt;&lt;br /&gt;                       # Match 16 chars because of trailing space w/nmblookup&lt;br /&gt;                       regexp {.+?(.{16})&lt;00&gt;} [ exec nmblookup -A $ip ] \&lt;br /&gt;                       dummyvar hostname }&lt;br /&gt;&lt;br /&gt;               }&lt;br /&gt;&lt;br /&gt;           }&lt;br /&gt;&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   if { $hostname == "" } { set hostname "Unknown" }&lt;br /&gt;   return $hostname&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;I took Bamm's check for HOME_NET and changed it to a check for NETBIOS_NET. I think people will definitely not want every IP to get a NetBIOS query if it has no DNS entry, nor will they want every IP in HOME_NET to be checked. This change means you need to add a NETBIOS_NET to sguil.conf if you want to resolve NetBIOS names.&lt;br /&gt;&lt;br /&gt;Next, I checked for the platform and either perform an nbtstat from a Windows client or an nmblookup from a Unix client.&lt;br /&gt;&lt;br /&gt;The regular expression I used to grab the result of the query is sort of weak, but functional. It simply finds the first instance of "&lt;00&gt;" and grabs the preceding 15 characters on Windows or 16 characters when doing a nmblookup on Unix. This is because the output of nmblookup has an extra space after the NetBIOS name, which can be up to 15 characters, while a 15 character name on Windows will have no trailing space. I would like to cut out any trailing whitespace using the regular expression, but I'm not sure about the best way to do it. A word boundary won't work because NetBIOS names can have characters like dashes and dots.&lt;br /&gt;&lt;br /&gt;Suggestions and feedback welcome. Is something like this useful? How can it be improved? Is there some much easier way to do this? I can barely spell TCL let alone code it, so be gentle!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Edit: &lt;/span&gt;giovani from #snort-gui gave me this regexp that should grab the NetBIOS name without including trailing whitespace. He also pointed out that having spaces between the braces and the regexp, as I did, can alter the regexp.&lt;br /&gt;&lt;pre&gt;{([^\s\n\t]+)\s*&lt;00&gt;}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-9067547477372869714?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/9067547477372869714/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2007/10/sguil-070-client-and-netbios-names.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/9067547477372869714'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/9067547477372869714'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2007/10/sguil-070-client-and-netbios-names.html' title='Sguil 0.7.0 Client and NetBIOS Names'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-7296998789602717983</id><published>2007-09-30T10:10:00.000-04:00</published><updated>2007-10-01T21:03:25.093-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='nsm'/><category scheme='http://www.blogger.com/atom/ns#' term='snort_inline'/><category scheme='http://www.blogger.com/atom/ns#' term='snort'/><category scheme='http://www.blogger.com/atom/ns#' term='sguil'/><title type='text'>Running IDS Inline</title><content type='html'>When do you run IDS inline?&lt;br /&gt;&lt;br /&gt;Although the idea of running an IDS inline to prevent attacks rather than just detect them is appealing, reality is harsh. There are a lot of problems running an IDS inline.&lt;br /&gt;&lt;br /&gt;The first and most significant problem with running IDS inline is that most people don't adequately tune IDS. This is a problem whether you run inline or passive IDS. I get the feeling that the general management view towards IDS, perpetuated by marketing, is that you should be able to drop an IDS on the network and it is ready to go. This is far from the truth. Network monitoring requires tuning all involved systems and humans to analyze the information provided by the systems.&lt;br /&gt;&lt;br /&gt;When I set up my first Snort deployment, I spent countless hours tuning and tweaking the configuration, rules, performance and more. Along the way, I added Sguil, which was useful both for more thorough analysis and more effective tuning based on those analyses. Even after all that, tuning is a daily requirement and never should stop.&lt;br /&gt;&lt;br /&gt;Every time you update rules, you should tune. Every time the network changes, you may need to tune. Every time your IDS itself is updated, you may need to tune. Every time a new attack is discovered, you may need to tune. Tuning does not and should not end unless you want your network security monitoring to become less effective over time. I would be willing to bet that a majority of inline IDS don't come close to taking full advantage of blocking features because of a lack of tuning. Passive IDS suffers from the same problem, but the results can be even worse if an inline IDS starts blocking legitimate traffic.&lt;br /&gt;&lt;br /&gt;Another problem, somewhat related to tuning, with running IDS inline is that rules are never perfect. Do you trust your enabled rules to be 100% perfect? If not, what percentage of alerts from a given rule must be accurate to make the rule acceptable in blocking mode? Even good rules will sometimes or often trigger on benign traffic.&lt;br /&gt;&lt;br /&gt;For Snort, one of the most reliable rule sets are policy violations. Both VRT rules and Bleeding rules are extremely reliable when detecting policy violations with a minimal number of alerts triggered on unrelated network traffic. Spyware rules are similarly accurate.&lt;br /&gt;&lt;br /&gt;Rules designed to detect more serious malicious activity are much less consistent. Most are simply not reliable enough to use in a mode that blocks the traffic the rule is designed to detect. That does not mean the rules are necessarily bad! Good rules still aren't perfect. This is one of many reasons why there will always be work for security analysts. IDS or other NSM systems are no substitute for the analysis that an experienced human can provide. They simply are tools to to be used by the analyst.&lt;br /&gt;&lt;br /&gt;Last, don't forget that running anything inline can seriously impact the network. If my Snort process at home dies for some reason, I can survive without Internet access until I get it restarted. This isn't always the case for businesses, so consider whether your traffic should be going through a system that fails open if there are problems. Even at home I don't queue port 22 to snort_inline because I want to be able to SSH into the box from the Internet if there are problems.&lt;br /&gt;&lt;br /&gt;The real question that has to be answered is whether the benefits of dropping traffic iare worth the risks of running inline.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-7296998789602717983?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/7296998789602717983/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2007/09/running-ids-inline.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/7296998789602717983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/7296998789602717983'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2007/09/running-ids-inline.html' title='Running IDS Inline'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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-297187840164530151.post-1826946014433724492</id><published>2007-09-21T20:44:00.000-04:00</published><updated>2007-09-22T21:26:52.856-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='nsm'/><category scheme='http://www.blogger.com/atom/ns#' term='sguil'/><title type='text'>First Impressions of Sguil 0.7.0</title><content type='html'>Since first using &lt;a href="http://sguil.sourceforge.net/"&gt;Sguil&lt;/a&gt; on version 0.5.3, I have definitely become a believer in Sguil and &lt;a href="http://www.taosecurity.com/books.html"&gt;network security monitoring&lt;/a&gt;. Sguil is much more than just a front-end for looking at Snort alerts. It integrates other features, such as session data and full content packet captures, that make security monitoring much more effective than just looking at IDS alerts.&lt;br /&gt;&lt;br /&gt;I recently upgraded my version of Sguil from the release version, 0.6.1, to the new beta version, 0.7.0. I have not even been using it for a week yet, but I do have a few first impressions.&lt;br /&gt;&lt;br /&gt;Before talking about Sguil itself, I would like to say thanks to Bamm Visscher, the original author of Sguil, Steve Halligan, a major contributor, and all the others who have contributed. I can say that it is easy to tell that Sguil is written and developed by security analysts, and it is bound to make you look smart to your bosses. Sguil has a thriving community of users and contributors that have been very active in improvements and documentation.&lt;br /&gt;&lt;br /&gt;Upgrading Sguil from 0.6.1 to 0.7.0 was less difficult than I had anticipated. Reading the &lt;a href="http://www.vorant.com/nsmwiki/Sguil_on_RedHat_HOWTO"&gt;Sguil on RedHat HOWTO&lt;/a&gt; is a good idea, even if using a different operating system or distribution. It is not necessary to follow the HOWTO but it does provide a lot of useful information to ease the installation or upgrade process.&lt;br /&gt;&lt;br /&gt;The basic procedure for upgrading was to stop sguild and sensor_agent, run the provided script to update the database, upgrade the components, and add &lt;a href="http://passive.sourceforge.net/"&gt;PADS&lt;/a&gt;. Of course, if you are doing this in a production environment then you probably would want to backup the database, sguild files on the server, and sguil files on the sensors. Since I was upgrading at home, I didn't bother backing up my database.&lt;br /&gt;&lt;br /&gt;Under the hood, communications between sensors and the Sguil server has changed. The &lt;a href="http://www.vorant.com/nsmwiki/Sguil#Architecture"&gt;network and data flow diagrams&lt;/a&gt; I contributed to the &lt;a href="http://www.vorant.com/nsmwiki/Main_Page"&gt;NSMWiki&lt;/a&gt; show the change from one sensor agent to multiple agents. One reason for this change is that it will make it easier to distribute sensor services across multiple systems, allowing people to run packet logging, Snort in IDS mode, or sancp on separate systems. I can see this being extremely useful if you are performance-limited because of old hardware, or if you monitor high-traffic environments.&lt;br /&gt;&lt;br /&gt;Another reason for the change in agents was to make it easier to add other data sources. An example of this, the only one I know of so far, is Victor Julien's &lt;a href="http://www.inliniac.net/modsec2sguil/"&gt;modsec2sguil&lt;/a&gt;. It will be interesting to see if the changes to Sguil lead to other agents to add support for other data sources. I know that David Bianco has discussed writing an &lt;a href="http://www.ossec.net/"&gt;OSSEC&lt;/a&gt; agent to add a host-based IDS as a Sguil data source.&lt;br /&gt;&lt;br /&gt;The changes to the client seem relatively minor but are useful. David Bianco already has written about added support for &lt;a href="http://blog.vorant.com/2007/09/ive-written-before-on-disguising-your.html"&gt;cloaking investigative activities in Sguil&lt;/a&gt;. Sguil 0.7.0 has added support for proxying DNS requests through a third party like OpenDNS. In fact, this feature was enabled by default when I installed my new client.&lt;br /&gt;&lt;br /&gt;Another change is &lt;a href="http://passive.sourceforge.net/"&gt;PADS&lt;/a&gt;, which will display real-time alerts to the client as new assets are detected on the network. An example of a PADS alerts is:&lt;br /&gt;&lt;pre&gt;PADS New Asset - smtp Microsoft Exchange SMTP&lt;/pre&gt;Though I like the idea of PADS a lot, it currently has some issues that definitely limit its usefulness. In its current form, Sguil's implementation of PADS has a bug where it generates alerts for external services, for instance when my home systems connect to external web or SMTP servers. The goal of PADS in the context of Sguil is really internal service detection so you can see any unusual or non-standard services on systems you are monitoring.&lt;br /&gt;&lt;br /&gt;Even once the bug is fixed, I can see it being extremely noisy on a large, diverse network. I may make a separate post in the future with ideas regarding PADS. Profiles for groups of systems and their services is definitely one idea that might be useful, but I'm not sure how hard it would be to implement. PADS has potential, but it will take some time.&lt;br /&gt;&lt;br /&gt;Another nice change in the Sguil client is the ability to click the reference URLs or SID when displaying Snort rules, opening your browser to the relevant page. This was a feature that was sorely needed and it will be nice not to need copy and paste for Snort rule references.&lt;br /&gt;&lt;br /&gt;I'm looking forward to further testing and the future release of 0.7.0.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-1826946014433724492?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/1826946014433724492/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2007/09/first-impressions-of-sguil-070.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/1826946014433724492'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/1826946014433724492'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2007/09/first-impressions-of-sguil-070.html' title='First Impressions of Sguil 0.7.0'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297187840164530151.post-4738910671181953310</id><published>2007-09-14T23:34:00.000-04:00</published><updated>2007-09-21T14:36:22.510-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='snort'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>Pulling IP Addresses and Ranges From a Snort Rule</title><content type='html'>In my &lt;a href="http://eatingsecurity.blogspot.com/2007/09/querying-session-data-based-on-snort.html"&gt;previous post&lt;/a&gt;, I included a short Perl script to pull &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;IP&lt;/span&gt; addresses from a Snort rule file. The problem with the script was that it simply stripped &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;CIDR&lt;/span&gt; notation rather than expanding to all the included &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;IP&lt;/span&gt; addresses. For instance, 10.0.0.0/28 would become 10.0.0.0. After a little searching, I found the Perl module &lt;a href="http://search.cpan.org/dist/NetAddr-IP/IP.pm"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;NetAddr&lt;/span&gt;::&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;IP&lt;/span&gt;&lt;/a&gt; that can be used to more easily manage and manipulate &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;IP&lt;/span&gt; addresses and &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;subnets&lt;/span&gt;. I also found an example of how to use the module for &lt;a href="http://www.perlmonks.org/?displaytype=print;node_id=190497"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;subnet&lt;/span&gt; expansion&lt;/a&gt;, among other things.&lt;br /&gt;&lt;br /&gt;The following modification of my previous script will not only grab all the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;IP&lt;/span&gt; addresses from the snort rule, but also expand all &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;CIDR&lt;/span&gt; addresses to the individual &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;IP&lt;/span&gt; addresses in the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;CIDR&lt;/span&gt; range.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Edit: &lt;/span&gt;If you grabbed the script before September 16, then grab it again. While I was trying to make it look pretty, I must have inadvertently altered the substitution to remove the trailing CIDR notation. The current version is corrected.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;#!/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;usr&lt;/span&gt;/bin/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;perl&lt;/span&gt;&lt;br /&gt;#&lt;br /&gt;# Script to pull &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;IP&lt;/span&gt; address from Snort rules file&lt;br /&gt;# by &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;nr&lt;/span&gt;&lt;br /&gt;# 2007-08-30&lt;br /&gt;# 2007-09-14 Added &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;CIDR&lt;/span&gt; expansion&lt;br /&gt;&lt;br /&gt;# Set &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;filenames&lt;/span&gt;&lt;br /&gt;$&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;rulefile&lt;/span&gt; = "/home/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;nr&lt;/span&gt;/bleeding-compromised.rules";&lt;br /&gt;$&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_20"&gt;ip&lt;/span&gt;_&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_21"&gt;outfile&lt;/span&gt; = "&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;iplist&lt;/span&gt;.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_23"&gt;txt&lt;/span&gt;";&lt;br /&gt;&lt;br /&gt;# Open file to read&lt;br /&gt;die "Can't open &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_24"&gt;rulefile&lt;/span&gt;.\n" unless open &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_25"&gt;RULEFILE&lt;/span&gt;, "&lt;", "$rulefile";&lt;br /&gt;# Open file to write&lt;br /&gt;die "Can't open outfile.\n" unless open IPLIST, "&gt;", "$&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_26"&gt;ip&lt;/span&gt;_&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_27"&gt;outfile&lt;/span&gt;";&lt;br /&gt;&lt;br /&gt;# Put each rule from rules file into array&lt;br /&gt;chomp(@rule = &lt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_29"&gt;RULEFILE&lt;/span&gt;&gt;);&lt;br /&gt;&lt;br /&gt;# For each rule&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_30"&gt;foreach&lt;/span&gt; $rule (@rule) {&lt;br /&gt;    # Match only rules with &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_31"&gt;IP&lt;/span&gt; addresses so we don't get comments etc&lt;br /&gt;    # This string match does not check for validity of &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_32"&gt;IP&lt;/span&gt; addresses&lt;br /&gt;    if ( $rule =~ /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/ ) {&lt;br /&gt;        # Remove everything before [ character&lt;br /&gt;        $rule =~ s/.*\[//g;&lt;br /&gt;        # Remove everything after ] character&lt;br /&gt;        $rule =~ s/\].*//g;&lt;br /&gt;        # Split the remaining data using the commas&lt;br /&gt;        # and put it into &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_33"&gt;ip&lt;/span&gt;_address array&lt;br /&gt;        @&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_34"&gt;ip&lt;/span&gt;_address = split /\,/, $rule;&lt;br /&gt;&lt;br /&gt;        # For each &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_35"&gt;IP&lt;/span&gt; address in array&lt;br /&gt;        &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_36"&gt;foreach&lt;/span&gt; $&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_37"&gt;ip&lt;/span&gt;_address (@ip_address) {&lt;br /&gt;&lt;br /&gt;            # Match on slash&lt;br /&gt;            if ( $&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_38"&gt;ip&lt;/span&gt;_address =~ /.*\/.*/ ) {&lt;br /&gt;&lt;br /&gt;                # Expand &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_39"&gt;CIDR&lt;/span&gt; to &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_40"&gt;al&lt;/span&gt;l &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_41"&gt;IP&lt;/span&gt; addresses in range modified from&lt;br /&gt;                # http://www.perlmonks.org/?displaytype=print;node_id=190497&lt;br /&gt;                use &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_42"&gt;NetAddr&lt;/span&gt;::&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_43"&gt;IP&lt;/span&gt;;&lt;br /&gt;                my $&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_44"&gt;newip&lt;/span&gt; = new &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_45"&gt;NetAddr&lt;/span&gt;::&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_46"&gt;IP&lt;/span&gt;($&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_47"&gt;ip&lt;/span&gt;_address);&lt;br /&gt;&lt;br /&gt;                # While less than broadcast address&lt;br /&gt;                while ( $&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_48"&gt;newip&lt;/span&gt; &lt; $newip-&gt;broadcast) {&lt;br /&gt;                    # Strip trailing slash and &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_49"&gt;netmask&lt;/span&gt; from &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_50"&gt;IP&lt;/span&gt;&lt;br /&gt;                    $temp_&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_51"&gt;ip&lt;/span&gt; = $&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_52"&gt;newip&lt;/span&gt;;&lt;br /&gt;                    $temp_&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_53"&gt;ip&lt;/span&gt; =~ s/\/.*//g;&lt;br /&gt;                    print &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_54"&gt;IPLIST&lt;/span&gt; "$temp_&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_55"&gt;ip&lt;/span&gt;\n";&lt;br /&gt;                    # Increment to next &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_56"&gt;IP&lt;/span&gt;&lt;br /&gt;                    $&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_57"&gt;newip&lt;/span&gt; ++;&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;            # For non-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_58"&gt;CIDR&lt;/span&gt;, simply print &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_59"&gt;IP&lt;/span&gt;&lt;br /&gt;            else {&lt;br /&gt;                print &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_60"&gt;IPLIST&lt;/span&gt; "$&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_61"&gt;ip&lt;/span&gt;_address\n";&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;# Close &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_62"&gt;filehandles&lt;/span&gt;&lt;br /&gt;close &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_63"&gt;RULEFILE&lt;/span&gt;;&lt;br /&gt;close &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_64"&gt;IPLIST&lt;/span&gt;;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;One last note. If you prefer to pass the rule file name and output file to the script at the command line every time you run it, change the $&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_65"&gt;rulefile&lt;/span&gt; and $&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_66"&gt;ip&lt;/span&gt;_&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_67"&gt;outfile&lt;/span&gt; variables to equal $&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_68"&gt;ARGV&lt;/span&gt;[0] and $&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_69"&gt;ARGV&lt;/span&gt;[1].&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-4738910671181953310?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/4738910671181953310/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2007/09/pulling-ip-addresses-and-ranges-from.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/4738910671181953310'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/4738910671181953310'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2007/09/pulling-ip-addresses-and-ranges-from.html' title='Pulling IP Addresses and Ranges From a Snort Rule'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297187840164530151.post-4244546972158443035</id><published>2007-09-10T20:49:00.000-04:00</published><updated>2007-09-22T22:08:24.143-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='session data'/><category scheme='http://www.blogger.com/atom/ns#' term='snort'/><category scheme='http://www.blogger.com/atom/ns#' term='sguil'/><category scheme='http://www.blogger.com/atom/ns#' term='sancp'/><category scheme='http://www.blogger.com/atom/ns#' term='bleeding rules'/><title type='text'>Querying Session Data Based on Snort Rule IPs</title><content type='html'>Sometimes Snort rules can contain useful information but are not practical to use in production. The Bleeding Snort rules recently added a set of rules to detect connection attempts to &lt;a href="http://www.bleedingthreats.net/index.php/2007/08/24/new-rulesed-compromised-hosts/"&gt;known compromised hosts&lt;/a&gt;. If you &lt;a href="http://www.bleedingthreats.net/rules/bleeding-compromised.rules"&gt;take a look at the rules&lt;/a&gt;, you'll see that it is essentially a large list of IP addresses that are known to be compromised.&lt;br /&gt;&lt;br /&gt;When I first ran these rules on a Snort sensor, they definitely gave me some alerts requiring action. However, the performance of the sensor really suffered, particularly as the set of IP addresses grew. Since the rules were causing packet loss, I wanted to disable them.&lt;br /&gt;&lt;br /&gt;I decided to write a script to grab the IP addresses from the Bleeding rule, then load the addresses into my database to compare with stored sancp data. If you are monitoring your network but not storing session data acquired with tools like &lt;a href="http://www.metre.net/sancp.html"&gt;sancp&lt;/a&gt; or &lt;a href="http://www.qosient.com/argus/"&gt;argus&lt;/a&gt;, you should be. In my case, I am running &lt;a href="http://sguil.sourceforge.net/"&gt;Sguil&lt;/a&gt;, which uses sancp.&lt;br /&gt;&lt;br /&gt;First, I had to write the script to grab the IP addresses. Since I just finished an introduction to Perl class in school and had many projects that required string matching, I figured that was the way to go. Since I'm a beginner, I would be more than happy if anyone can offer improvements to the following script. In particular, one thing I have not worked on yet is a method for expanding CIDR notation to individual IP addresses. The bleeding-compromised.rules do contain some networks in CIDR notation rather than just individual IP addresses, and for now the script simply strips the notation resulting in an incomplete IP list.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Edit: &lt;/span&gt;I posted an &lt;a href="http://eatingsecurity.blogspot.com/2007/09/pulling-ip-addresses-and-ranges-from.html"&gt;updated script&lt;/a&gt; that replaces the one in this post. I would suggest using the updated version rather than this one.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;#!/usr/bin/perl&lt;br /&gt;#&lt;br /&gt;# Script to pull IP address from Snort rules file&lt;br /&gt;# by nr&lt;br /&gt;# 2007-08-30&lt;br /&gt;&lt;br /&gt;# Set filenames&lt;br /&gt;$rulefile = "/nsm/rules/bleeding-compromised.rules";&lt;br /&gt;$ip_outfile = "iplist.txt";&lt;br /&gt;&lt;br /&gt;# Print error unless successful open of file to read&lt;br /&gt;die "Can't open rulefile.\n" unless open RULEFILE, "&lt;", "$rulefile"; # Open file to write open IPLIST, "&gt;", "$ip_outfile";&lt;br /&gt;&lt;br /&gt;# Put each rule from rules file into array&lt;br /&gt;chomp(@rule = &amp;lt;RULEFILE&amp;gt;);&lt;br /&gt;&lt;br /&gt;# For each rule&lt;br /&gt;foreach $rule (@rule) {&lt;br /&gt;# Match only rules with IP addresses so we don't get comments etc&lt;br /&gt;# This string match does not check for validity of IP addresses&lt;br /&gt;if ( $rule =~ /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/ ) {&lt;br /&gt;    # Remove everything before [ character&lt;br /&gt;    $rule =~ s/.*\[//g;&lt;br /&gt;    # Remove everything after ] character&lt;br /&gt;    $rule =~ s/\].*//g;&lt;br /&gt;    # Split the remaining data using the commas&lt;br /&gt;    # and put it into ip_address array&lt;br /&gt;    @ip_address = split /\,/, $rule;&lt;br /&gt;&lt;br /&gt;    # For each IP address in array&lt;br /&gt;    foreach $ip_address (@ip_address) {&lt;br /&gt;        # Remove CIDR notation (means those IP ranges are missed - need to fix)&lt;br /&gt;        $ip_address =~ s/\/.*//g;&lt;br /&gt;        # Print to output file one IP per line&lt;br /&gt;        print IPLIST "$ip_address\n";&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;# Close filehandles&lt;br /&gt;close RULEFILE;&lt;br /&gt;close IPLIST;&lt;/pre&gt;&lt;br /&gt;Now I have a file called "iplist.txt" with the list of IP addresses, one per line. Next, I log into MySQL and load the list into a temporary database and table. The table really only needs one column of the CHAR or VARCHAR data type. (See the &lt;a href="http://dev.mysql.com/doc/index.html"&gt;MySQL documentation&lt;/a&gt; for creating tables or databases).&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;LOAD DATA LOCAL INFILE '/home/nr/iplist.txt' INTO TABLE temp.ipaddr;&lt;/pre&gt;&lt;br /&gt;Then I have to convert the IP addresses to the INT data type using the &lt;a href="http://dev.mysql.com/doc/refman/4.1/en/miscellaneous-functions.html"&gt;INET_ATON function&lt;/a&gt; so they can be matched against my sancp session data. I created the table "sguildb.ipaddresses" for cases like this where I want to load external IP address and then run a query. The "temp.ipaddr" table has one column called "new_ip". The "sguildb.ipaddresses" table also has one column, but called "dst_ip".&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;INSERT INTO sguildb.ipaddresses SELECT INET_ATON(new_ip) FROM temp.ipaddr;&lt;/pre&gt;&lt;br /&gt;In MySQL 5.x, you can combine the previous two steps to add and convert the data in one step. I'm currently running 4.1, so I have not investigated the exact syntax.&lt;br /&gt;&lt;br /&gt;Finally, I can query my sancp session data for connections going to any of the IP addresses in sguildb.ipaddresses, which are the IP addresses from the Snort rule.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SELECT sancp.sid,INET_NTOA(sancp.src_ip),sancp.src_port,INET_NTOA(sancp.dst_ip),&lt;br /&gt;sancp.dst_port,sancp.start_time FROM sancp INNER JOIN ipaddresses ON&lt;br /&gt;(sancp.dst_ip = ipaddresses.dst_ip) WHERE sancp.start_time &gt;= DATE_SUB(UTC_DATE(),&lt;br /&gt;INTERVAL 24 HOUR) AND sancp.dst_port = '80';&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This query will return the sensor ID, source IP, source port, destination IP, destination port, and session start time from the sancp table wherever the sancp.dst_ip matches the ipaddresses.dst_ip where I stored the IP addresses from the Snort rule. Notice that it will query the last 24 hours for port 80 connections only. Depending on the type of activity you are looking for, you could change ports or remove the port match entirely.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;This whole process could be automated further by running the mysql commands directly from the Perl script so the compromised IP addresses are updated in the database when the script is run.&lt;br /&gt;&lt;br /&gt;The final SQL query to match the compromised IP addresses with sancp destination IP addresses can easily be turned into a cronjob. For instance, if querying for the past 24 hours then run the cronjob once a day. Once the results are returned, if running Sguil with full content logging it is easy to then query for the individual connections you're interested in and view the ASCII transcripts or the packet captures.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297187840164530151-4244546972158443035?l=eatingsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eatingsecurity.blogspot.com/feeds/4244546972158443035/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eatingsecurity.blogspot.com/2007/09/querying-session-data-based-on-snort.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/4244546972158443035'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297187840164530151/posts/default/4244546972158443035'/><link rel='alternate' type='text/html' href='http://eatingsecurity.blogspot.com/2007/09/querying-session-data-based-on-snort.html' title='Querying Session Data Based on Snort Rule IPs'/><author><name>nr</name><uri>http://www.blogger.com/profile/16307898781407130985</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>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297187840164530151.post-5816944495183923632</id><published>2007-09-08T17:33:00.000-04:00</published><updated>2007-09-11T09:10:30.558-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MMAP'/><category scheme='http://www.blogger.com/atom/ns#' term='libpcap'/><category scheme='http://www.blogger.com/atom/ns#' term='snort_inline'/><category scheme='http://www.blogger.com/atom/ns#' term='snort'/><category scheme='http://www.blogger.com/atom/ns#' term='bridging'/><title type='text'>Transparent Bridging, MMAP pcap, and Snort Inline</title><content type='html'>I use &lt;a href="http://www.snort.org/"&gt;Snort&lt;/a&gt; and the &lt;a href="http://sguil.sourceforge.net/"&gt;Sguil Analyst Console for NSM&lt;/a&gt;, but there is always room to experiment and/or improve. Up to this point, I have used Snort either on mirrored (SPAN) ports or with a network TAP, both common configurations. After finally getting a second-hand CPU and motherboard to replace a dead CPU, I had a spare system to set up Snort inline at home.&lt;br /&gt;&lt;br /&gt;The upgrade from Snort 2.4.x to 2.6.x.x was quite taxing on performance, so I decided it was also time to play with &lt;a href="http://public.lanl.gov/cpw/"&gt;Phil Wood's MMAPped libpcap&lt;/a&gt;. The modified libpcap will make drastically fewer system calls when compared to the standard libpcap sniffing on a busy network. Although my home network certainly isn't high bandwidth, I wanted the experience of setting up Snort with the Phil Wood's modified version of libpcap. Since I actually did all this many months ago and am just now posting about it, I can say that I have seen a huge performance improvement when going from the standard libpcap to Phil Wood's libpcap in high bandwidth environments.&lt;br /&gt;&lt;br /&gt;How would I implement Snort Inline on a home network? The two choices were to replace one of my routers with a BSD or Linux system configured as a router, or to set up Linux as a transparent bridge. For those that prefer FreeBSD, you would have to configure it as a router since the bridge code in FreeBSD does not support the ipfw divert socket. I am not familiar enough with other BSD versions to say whether their bridge code is the same or not.&lt;br /&gt;&lt;br /&gt;I much preferred a bridge rather than a router since it would avoid the time-consuming process of reconfiguring my network topology. This meant that I had to use Linux, and my distribution in this case is Slackware-current. The process should not be much different for any distribution.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Installing Software&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Because plugging in an untested bridge between my LAN and the Internet could interrupt my connection, I decided it would be easiest to get and install all the software prior to configuring the bridge and putting it inline.&lt;br /&gt;&lt;br /&gt;My first step was to install the modified libpcap, which needs either flex and bison, or yacc. This was essentially a freshly built Slackware system and I didn't have them installed, so I used swaret to install the packages.&lt;br /&gt;&lt;pre&gt;swaret --install flex&lt;br /&gt;swaret --install bison&lt;/pre&gt;I was now ready to install libpcap.&lt;br /&gt;&lt;pre&gt;cd /usr/src/&lt;br /&gt;wget http://public.lanl.gov/cpw/libpcap-current.tar.gz&lt;br /&gt;tar xvzf libpcap-current.tar.gz&lt;br /&gt;ln -s libpcap-0.9.20060417 libpcap&lt;br /&gt;cd libpcap&lt;br /&gt;./configure&lt;br /&gt;make&lt;br /&gt;make install&lt;/pre&gt;Snort will need the header files from libpcap and the install did not copy them anywhere, so I manually copied the files to  /usr/include/. Another option would be to create a link to the files in the include directory.&lt;br /&gt;&lt;pre&gt;cp /usr/src/libpcap/pcap.h /usr/include/&lt;br /&gt;cp /usr/src/libpcap/pcap-bpf.h /usr/include/&lt;br /&gt;cp /usr/src/libpcap/pcap-namedb.h /usr/include/&lt;/pre&gt;Because this is a modified libpcap, all the software that depends on libpcap must also be compiled against the version I just installed. I will definitely be using tcpdump when I test the bridge.&lt;br /&gt;&lt;pre&gt;wget http://www.tcpdump.org/daily/tcpdump-current.tar.gz&lt;br /&gt;tar xvzf tcpdump-current.tar.gz&lt;br /&gt;ln -s tcpdump-2007.01.07 tcpdump&lt;br /&gt;cd tcpdump&lt;br /&gt;./configure&lt;br /&gt;make&lt;br /&gt;make install&lt;br /&gt;&lt;/pre&gt;Now I could test that tcpdump worked with the PCAP_FRAMES option available because of the modified libpcap. For some reason, perhaps because of my kernel version, PCAP_FRAMES=max did not work but I was able to use it by manually setting the value. I was able to bump the value of PCAP_FRAMES quite high, above 300000, before it resulted in errors. I have yet to determine what that really means for performance. Here are two commands I used to show that the newly installed tcpdump worked with the modified libpcap.&lt;br /&gt;&lt;pre&gt;PCAP_FRAMES=65535 PCAP_VERBOSE=1 PCAP_TO_MS=0 PCAP_PERIOD=10000 /usr/local/sbin/tcpdump \&lt;br /&gt;-i eth0 -s 1514 -w /dev/null -c 100&lt;br /&gt;&lt;br /&gt;PCAP_FRAMES=65535 /usr/local/sbin/tcpdump -v -i eth0&lt;/pre&gt;Snort needs libnet-1.0.2a when configured with --enable-inline, so I had to install libnet first.&lt;br /&gt;&lt;pre&gt;tar xvzf libnet-1.0.2a&lt;br /&gt;cd libnet-1.0.2a&lt;br /&gt;./configure&lt;br /&gt;make&lt;br /&gt;make install&lt;br /&gt;&lt;/pre&gt;Finally, install Snort 2.6.x.x. (Note: Since this document was written quite a while ago, there are quite a few newer versions of Snort available). Another alternative to using the --enable-inline option with mainline Snort is to download &lt;a href="http://snort-inline.sourceforge.net/"&gt;snort_inline&lt;/a&gt;, which is maintained by William Metcalf and Victor Julien. There are a number of added features and conveniences when using snort_inline, as  highlighted on &lt;a href="http://www.inliniac.net/blog/2007/05/14/differences-between-snort-and-snort_inline.html"&gt;Victor's blog&lt;/a&gt;. However, I used mainline Snort in the following example.&lt;br /&gt;&lt;pre&gt;tar xvzf snort-2.6.1.2.tar.gz&lt;br /&gt;cd snort-2.6.1.2&lt;br /&gt;./configure --enable-dynamicplugin --enable-inline&lt;br /&gt;make&lt;br /&gt;make install&lt;br /&gt;&lt;/pre&gt;I tested snort with -V to check that it would start and was compiled to work inline. It shows that Snort was configured with the inline option.&lt;br /&gt;&lt;pre&gt;snort -V&lt;br /&gt;&lt;br /&gt; ,,_     -*&gt; Snort! &lt;*-&lt;br /&gt;o"  )~   Version 2.6.1.2 (Build 34) inline&lt;br /&gt; ''''    By Martin Roesch &amp; The Snort Team: http://www.snort.org/team.html&lt;br /&gt;         (C) Copyright 1998-2006 Sourcefire Inc., et al. &lt;/pre&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Configuring Linux for Transparent Bridging&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Configuring the bridging is fairly simple. The only module I had to manually insert was ip_queue. Other modules that may be needed are ip_tables, iptable_filter and bridge.&lt;br /&gt;&lt;br /&gt;In this case, eth0 is my separate management interface, I named the bridge interface bridge0, and the physical interfaces joining bridge0 were eth1 and eth2. The bridge device can be configured with an IP address if you do not want to use a separate NIC for management. In either case, make sure to secure the management NIC on your Snort box, for example limiting connections to the management IP so only source IP addresses in your private IP space are allowed to connect. Here, I created the bridge interface, added eth1 and eth2 to it, and brought them up:&lt;br /&gt;&lt;pre&gt;/sbin/brctl addbr bridge0&lt;br /&gt;/sbin/brctl addif bridge0 eth1&lt;br /&gt;/sbin/brctl addif bridge0 eth2&lt;br /&gt;/sbin/ifconfig eth1 up&lt;br /&gt;/sbin/ifconfig eth2 up&lt;br /&gt;/sbin/ifconfig bridge0 up&lt;br /&gt;&lt;/pre&gt;After some iptables configuration, bridge0 should work. Assuming the system is dedicated to being a bridge running Snort Inline, the only addition necessary to make bridging work is the following:&lt;br /&gt;&lt;pre&gt;iptables -I FORWARD -o bridge0 -j ACCEPT&lt;br /&gt;&lt;/pre&gt;Now bridge0 should be ready to pass packets.&lt;br /&gt;&lt;br /&gt;Once the bridge is connected, iptables can be used to show packet statistics and confirm that the bridge is forwarding. You can also use tcpdump -v -i bridge0 to confirm th
