With 2006 just starting off many are happy to have left a myriad of security problems behind in 2005. I hope you see more security awareness and experience a cleaner network environment this year.

This issue brings more technical articles and reflections on the past year. Many of you e-mailed us asking us to review software titles and hardware, so you’ll be glad to know that we have a review in this issue.

Keep those comments coming and thanks for the support!

Mirko Zorz Chief Editor

Visit the magazine website at www.insecuremag.com

(IN)SECURE Magazine contacts

Feedback and contributions: Mirko Zorz, Chief Editor - [email protected]

Marketing: Berislav Kucan, Director of Marketing - [email protected]

Distribution

(IN)SECURE Magazine can be freely distributed in the form of the original, non modified PDF document. Distribution of substantively modified versions of (IN)SECURE Magazine content is prohibited without the explicit permission from the editor. For reprinting information please send an email to [email protected] or send a fax to 1-866-420-2598.

Copyright HNS Consulting Ltd. 2006.

www.insecuremag.com The popularity of web application firewalls is on the rise. These tools used to be reserved for a very small percentage of high profile deployments, but, with the number of less costly products appearing on the market and an open source option available for anyone to try out (ModSecurity - modsecurity.org), they are finally available to the majority.

In this article I will describe what web application time I thought it was a beautiful idea. Other people firewalls do and give you a quick overview of their must have liked the idea too because by mid 2005 most useful features. After reading the article you we have had formed a team consisting of some of should leave fairly familiar with the subject matter. the very knowledgeable people in the web applica- You should also have enough information to de- tion firewall market. The Web Application Firewall termine whether or not web application firewalls Evaluation Criteria project was born. (It's home have a place in your life. page is at webappsec.org/projects/wafec) The name of the project is a mouthful so we are usu- What is a web application firewall? ally referring to it by the abbreviation WAFEC. To save me some typing I will also refer to web appli- The interesting thing about web application fire- cation firewalls as WAFs from now on. walls is that no one really knows exactly what they are. Or, to say that correctly, it is difficult to get dif- This text is not about the work we've done for the ferent people to agree to a common definition. In project, although my opinions have, without any very broad terms, web application firewalls are doubt, been heavily influenced by it. I mention this specialized tools whose purpose is to increase project now (although it was bound to be men- security in web applications. But try pressing a few tioned sooner or later instead of later) is because I people to give you a more specific definition and remembered one of the emails sent to the project they'll give you more questions than answers. list, which illustrates my point about market confu- Some web application firewalls work are hardware sion beautifully. Achim Hoffmann, one of the fellow devices, some are software applications. Where team members, had sent a list of names various some are network-based, the others work embed- people and organizations used to refer to web ap- ded in web servers. You can try to compile a list of plication firewalls over time. With Achim's permis- web application firewall vendors and visit their web sion, I am providing the full list here (with a couple sites in order to learn more, but chances are you of additions I thought were appropriate): will only get more confused reading what you find there. • Adaptive Firewall • Adaptive Proxy Jeremiah Grossman, spokesman for the Web Ap- • Adaptive Gateway plication Security Consortium (webappsec.org), • Application Firewall approached me in late 2004 with an idea of start- • Application-level Firewall ing a project to figure out the web application fire- • Application-layer Firewall walls. Having been involved with WAFs for some • Application Level Gateway www.insecuremag.com 4 • Application-level Security Gateway picions by using Google to search for each of the • Application Security Gateway terms. Only the term "web application firewall" had • Application Security Device any adverts associated with it. • Stateful Multilayer Inspection Firewall • Web Adaptive Firewall Enough talk; what is a web application • Web Application Firewall firewall? • Web Application Security Device • Web Application Proxy The main reason it is often difficult for people to • Web Application Shield agree on a single definition for a web application • Web Shield firewall is simply because the name is used to re- • Web Security Firewall fer to too many things. If you look at the lower • Web Security Gateway network layers (web application firewalls are situ- • Web Security Proxy ated at layer 7) you will find that they are occupied • Web Intrusion Detection System by many devices, each specialized for a specific • Web Intrusion Prevention System purpose. We have routers, switches, firewalls, in- trusion detection systems, intrusion preventions There are 22 names on the list and none of them systems, and so on. In the HTTP world, however, are entirely adequate, for the reasons I will soon we are seeing roughly the equivalent functionality discuss. Adequate or not, of all the names only crammed into a single device type (and thus only one survived (guess which one). I verified my sus- one name): the web application firewall.

THE MAIN REASON IT IS OFTEN DIFFICULT FOR PEOPLE TO AGREE ON A SINGLE DEFINI- TION FOR A WEB APPLICATION FIREWALL IS SIMPLY BECAUSE THE NAME IS USED TO RE- FER TO TOO MANY THINGS.

Roughly speaking, it is possible to identify four dis- distinction between intrusion detection and intru- tinct functionality types within what is today called sion prevention if often not quite clear. But Richard a web application firewall (the names in the Bejtlich summed it up well: “... an "IPS" is a layer 7 bracket refer to the equivalent devices on the firewall that inverts the access control best prac- lower network layers): tice of "allow some, deny everything else." (In other words, an IPS performs a "deny some, allow 1. Audit device. Used to capture full content data everything else" function.) I absolutely detest the (Network Security Monitoring) or only transactions IPS label and wish access control devices were that match some criteria (Intrusion Detection Sys- simply identified as such, and not confused with tems). audit devices (e.g., IDSs).” 2. Access control device. Used to control access to web applications, either in positive security Additional confusion is often introduced when the mode (Network Firewalls) or negative security term deep-inspection firewalls is involved. Deep- mode (Intrusion Prevention Systems). inspection firewalls are devices which, some 3. Architectural/Network design tool. When operat- claim, have features equivalent to those of web ing in reverse proxy mode, used to distribute func- application firewalls. But, although there is some tionality, centralize access, virtualize infrastructure similarity, the difference is profound. Deep- and so on. inspection firewalls generally make some effort to 4. Web application hardening tool. Features that look beyond level 3 and into higher levels. Web increase web application security either by resolv- application firewalls, on the other hand, are tools ing the weaknesses inherent to web applications, that are built from the ground up to handle HTTP or by targeting the programming errors in the ap- and they understand it very well. A very good (and plications they are protecting. entertaining) overview of this subject has been provided by Marcus J. Ranum in his 'What is Because of the multi-faceted nature of WAFs peo- "Deep Inspection?' text, available at ple with different backgrounds tend to view them in ranum.com/security/computer_security/editorials/d different light. For example, people with back- eepinspect/. ground in network intrusion detection are likely to view WAFs as an IDS devices that just happen to It is important to accept one fact though: it is not operate on the HTTP level. Of course, to be en- necessary for a device to implement all four types tirely honest, the lower network layers are not of functionality in order for it to be called a web without their problems either. For example, the application firewall. As long as there is a clear www.insecuremag.com 5 understanding of the possible variations, anything a completely new vocabulary. It comes with its that increases web application security can be own set of problems and challenges, which are called a WAF as far as I am concerned. What end different from the ones of TCP/IP. users need to do is first determine what their • The real problem is that web applications are not needs are and then find a tool that fulfils them. simple users of the HTTP protocol. Instead, HTTP is only used to carry the application-specific data. Evolution of Web Intrusion Detection It is as though each application builds its own pro- tocol on top of HTTP. Intrusion detection, as a concept, has been with • Many new protocols are deployed on top of us for many years. Its purpose is to detect attacks HTTP (think of Web Services, XML-RPC, and by looking at the network traffic or by looking at SOAP), pushing the level of complexity further up. operating system events. The term intrusion pre- • Other problems, such as the inability of an NIDS vention is used to refer to systems that are also to see through encrypted SSL channels (which capable of preventing attacks. most web applications that are meant to be secure use) and the inability to cope with a large amount Today, when people mention intrusion detection, in of web traffic, make NIDSs insufficient tools for most cases they will be referring to a network in- web intrusion detection. trusion detection system (NIDS). An NIDS works on the TCP/IP level and is used to detect attacks Vendors of NIDSs have responded to the chal- against any network service, including the web lenges by adding extensions to better understand server. The job of such systems, the most popular HTTP. The term deep-inspection firewalls refers to and most widely deployed of all IDSs, is to monitor systems that make an additional effort to under- raw network packets to spot malicious payload. stand the network traffic on a higher level. Ulti- Host-based intrusion detection systems (HIDSs), mately, a new breed of IDSs was born. Web appli- on the other hand, work on the host level. Though cation firewalls (WAFs) are designed specifically they can analyse network traffic (only the traffic to guard web applications. Designed from the that arrives to that single host), this task is usually ground up to support HTTP web application fire- left to NIDSs. walls often work as reverse proxies. Instead of go- ing directly to the web application, a request is re- Host-based intrusion is mostly concerned with the routed to go to a WAF first and only allowed to events that take place on the host (such as users proceed if deemed safe. Web application firewalls logging in and out and executing commands) and were designed from the ground up to deal with the system error messages that are generated. An web attacks and are better suited for that purpose. HIDS can be as simple as a script watching a log NIDSs are better suited for monitoring on the net- file for error messages. Integrity validation pro- work level and cannot be replaced for that pur- grams (such as Tripwire) are also a form of HIDS. pose. Some systems can be complex: one form of HIDS uses system call monitoring on a kernel level to Though most vendors are focusing on supporting detect processes that behave suspiciously. HTTP, the concept of application firewalls can be applied to any application and protocol. Commer- Using a single approach for intrusion detection is cial products have become available that act as insufficient. Security information management proxies for other popular network protocols and for (SIM) systems are designed to manage various popular databases. (Zorp, at security-relevant events they receive from agents, balabit.com/products/zorp/, available under a where an agent can listen to the network traffic or commercial and open source license at the same operating system events or can work to obtain any time, is one such product.) other security-relevant information. Isn't it better to just fix the code? Because many NIDSs are in place, a large effort was made to make the most of them and to use Of course it is. But it is not that simple. Sometimes them for web intrusion detection, too. Though there is a controversy as to whether we are correct NIDSs work well for the problems they were de- to pursue this approach to increasing security. A signed to address and they can provide some help common counter-argument is that web intrusion with web intrusion detection, they do not and can- detection does not solve the real problem, and not live up to the full web intrusion detection po- that it is better to go directly to the problem and fix tential for the following reasons: weak the vulnerable web applications. I tend to agree with this opinion. However the reality is pre- • NIDSs were designed to work with TCP/IP. The venting us from letting go from web application Web is based around the HTTP protocol, which is firewalls: www.insecuremag.com 6 • It is not possible to make anything 100% secure It is, therefore, necessary to adopt a dual- - humans have limited capabilities and make mis- approach strategy to achieve best results. You takes. should work hard to raise awareness among man- • Attempting to approach 100% security is not agement and developers. In the meantime do even done in most cases. Today, in real life, those what you can to increase security straight away. who direct application development usually de- mand features, not security. Attitudes are chang- Life becomes much easier once you accept you ing, but slowly. will fail. To deal with the problem (in this case • A complex system always contains third-party “deal” means minimize the chance of total failure) products (components, libraries) whose quality people invented an approach called defense in (security-wise) is not known. If the source code for depth. By now, defense in depth is a well-known the products is unavailable, then you are at the and a widely accepted security principle. The ba- mercy of the vendor to supply the fixes. Even in sic idea is that you don’t want to put all your eggs the cases when the source code is available you into the same basket. Instead, assuming any part are unlikely to have the resources to review it. of the system can fail, you look for ways to config- • We must work with existing vulnerable systems. ure other parts, or introduce new parts to limit the Some of these legacy systems can not be effect of the failure. Web application firewalls are touched. just another piece in the security puzzle. Treat them as such.

Web Application Firewall Features that happens, the programmers may implement input validation in the browser using JavaScript. The following sections describe some of the more Since the browser is just a simple tool under con- interesting features frequently found in web appli- trol of the user, an attacker can bypass such input cation firewalls. validation easily and send malformed input directly to the application. Protocol anomaly detection A correct approach to handling this problem is to If you read through various RFCs, you may detect add server-side validation to the application. If that a recurring theme. Most RFCs recommend that is impossible, another way is to add an intermedi- implementations be conservative about how they ary between the client and the application and to use protocols, but liberal with respect to what they have the intermediary reinterpret the JavaScript accept from others. Web servers behave this way embedded in the web page. too, but such behavior opens the door wide open for all sorts of attacks. Almost all WAFs perform Negative versus positive security models some sort of sanity check on incoming requests and refuse to accept anything that is not in accor- If you have ever worked to develop a firewall pol- dance with the HTTP standard. Furthermore, they icy, you may have been given advice to start with can narrow down the features to those that are a configuration that denies access to everything, acceptable to the application and thus reduce the and only then proceed to allow the traffic you attack surface area. Some will even go further know is safe. That is a very good example of a than that, restricting certain aspects of the HTTP positive security model. Negative security model protocol that were left too loose or completely un- does the opposite - access is allowed by default specified. and some dangerous traffic patterns are denied.

Enforcing input validation The two approaches each ask a question:

A frequent web security problem occurs where the • Positive security model: What is safe? web programming model is misunderstood and • Negative security model: What is dangerous? programmers think the browser can be trusted. If www.insecuremag.com 7 A negative security model is used more often. You So it turns out neither approach is entirely satis- identify a dangerous pattern and configure your factory on its own. Negative security model works system to reject it. It is simple, easy, and fun. But it well to deal with known problems. Positive security is not foolproof. The concept relies on you know- model works well for stable web applications. A ing what is dangerous. If there are aspects of the combination of both approaches is ideal to use in problem you are not aware of (which happens real life. from time to time) then you have left a hole for the attacker to exploit. Just-in-time Patching

A positive security model (also known as a white- The positive security model has the potential to list model) appears to be a better approach to work well because the communication between a building policies and works well for firewall policy browser and the application is well defined in the building. In the realm of web application security, a HTML specification. Scripts that make web appli- positive security model approach boils down to cations are essentially designed to process re- enumerating every script in the application. For quests that consist of a number of parameters. each script in the list, you need to create a list This is true for almost any application out there. such as this one: Since these parameters are visible to the web ap- plication firewall it is possible to make decisions • Allowed request methods (e.g., GET/POST or based on its observations. This leads to a interest- POST only) ing WAF capability I like to call just-in-time patch- • Allowed Content-Type ing. Is it very simple, really. • Allowed Content-Length • Allowed parameters When a vulnerability in an application is discov- • Which parameters are mandatory and which are ered in most cases forces are put in motion to optional close the hole in the code. Depending on the cir- • The type of every parameter (e.g., text or inte- cumstances (the size of the application, availability ger) of developers, legal arrangements and such) the • Additional parameter constraints (where applica- process can last anywhere from a couple of min- ble) utes to, well, infinity. This is the window of oppor- tunity for the attacker to exploit. This list is just an example. A real-life positive se- curity model typically includes more elements. If you can close a vulnerability in code quickly then Positive security model actually attempts to do ex- you don't have anything to worry about. But what if ternally what programmers are actually supposed the length of the window of opportunity is meas- to internally: verify every bit of information that ured in days or weeks? Web application firewalls goes into a web application. Using the positive se- are ideal tools to help with this: give a decent WAF curity model is better if you can afford to spend the to a security professional together with enough time to develop it. One difficult aspect of this ap- information about the security problem and he will proach is that the application model changes as likely be able to close the security hole in under the application evolves. You will need to update one hour. Naturally, this type of protection is not the model every time a new script is added to the foolproof and there is always a danger the fix is application or if an existing one changes. But it not complete but in case when you have no other works well to protect stable, legacy applications choice any protection is better than no protection. that no one maintains anymore. Still, the advantages are worth restating:

Automating policy development can ease prob- 1. Just-in-time patching is applied as a separate lems: security layer. 2. It can be implemented straight away. (Some • Some WAFs can observe the traffic and use it to web application firewalls require changes to the build the policy automatically. Some can do it in network layout but some are happy to work em- real time. bedded in the existing web server.) • With white-list protection in place, you may be 3. It is work executed by a different user profile. able to mark certain IP addresses as trusted, and Your typical developer may not be very skilled in configure the WAF to update the policy according application security, but chances are the security to the observed traffic. professional that discovered the problem is. • If an application is built with a comprehensive set of regression tests (to simulate correct behav- The principle of just-in-time patching is even eas- ior), playing the tests while the WAF is watching ier to apply to the XML-based applications be- will result in a policy being created automatically. cause the application communication is much www.insecuremag.com 8 better documented. On the other end of the range • Enforcement of entry points. At most web sites, are various AJAX applications, which tend to use you can start browsing from any site URL that is their own unique protocols to exchange informa- known to you. This is often convenient for attack- tion between browsers and the application code. ers and inconvenient for defenders. An IDS that This is where just-in-time patching without custom understands sessions will realise the user is mak- programming becomes much difficult. ing his first request and redirect him back to the default entry point (possibly logging the event). Rule-based versus anomaly-based protec- tion • Observation of each user session individually. Being able to distinguish one session from another Rule-based WAFs comprise the majority of what is opens interesting possibilities, e.g., it becomes available on the market today. They subject every possible to watch the rate at which requests are transaction to a series of tests. Each test can con- made and the way users navigate through the ap- sists of one or more inspection rules. If the test plication going from one page to another. Looking fails, the request is treated as invalid and possibly at the behavior of just one user it becomes much rejected. easier to detect intrusion attempts.

Rule-based WAFs are easy to build and use and • Detecting and responding to brute-force attacks. are efficient when used to defend against known Brute-force attacks normally go undetected in problems. They are also easy to use when the most web applications. With state management in task is to build a custom defence policy. But since place, an IDS tracks unusual events (such as login they must know about the specifics of every threat failures), and it can be configured to take action to protect from it, these tools must rely on using when a threshold is reached. It is often convenient extensive rule databases. Vendors maintain rule to slow down future authentication attempts databases and distribute their tools with programs slightly, not enough for real users to notice but to update WAF installations automatically. enough to practically stop automated scripts. If an authentication script takes 50 milliseconds to This approach is unlikely to be able to protect cus- make a decision, a script can make around 20 at- tom applications or to protect from zero-day ex- tempts per second. If you introduce a delay of, ploits (exploits that attack vulnerabilities that are say, one second, that will bring the speed to under not yet publicly known). This is where anomaly- one attempt per second. That, combined with an based IDSs work better. alert to someone to investigate further, would pro- vide a decent defense. The idea behind anomaly-based protection is to build a protection layer that will observe legal ap- • Implementation of session timeouts. Sessions plication traffic and then build a statistical model to can be expired after the default timeout expires, judge the future traffic against. In theory, once and users would be required to re-authenticate. trained, an anomaly-based system should detect Users can be logged out after a time of inactivity. anything out of the ordinary. With anomaly-based protection, rule databases are not needed and • Detection and prevention of session hijacking. In zero-day exploits are not a problem. Anomaly- most cases, session hijacking results in a change based protection systems are difficult to build and of IP address and some other request data (that are thus rare. Because users do not understand is, request headers are likely to be different). A how they work, many refuse to trust such systems, stateful monitoring tool can detect the anomalies making them less popular than their rule-based and prevent exploitation from taking place. The counterparts. recommended action to take is to terminate the session, ask the user to re-authenticate, and log a State management warning.

The stateless nature of the HTTP protocol has • Allowing only links provided to the client in the many negative impacts on web application secu- previous request. Some tools can be strict and rity. Sessions can and should be implemented on only allow users to follow the links that have been the application level, but for many applications the given in the previous response. This seems like an added functionality is limited to fulfilling business interesting feature but can be difficult to imple- requirements other than security. Web application ment. One problem with it is that it prevents the firewalls, on the other hand, can throw their full user from using more than one browser window weight into adding various session-related protec- with the application. Another problem is that it can tion features. Some of the features include: cause incompatibilities with applications using JavaScript to construct links dynamically. www.insecuremag.com 9 Other protection techniques lar to session tokens), while the cookies are kept safely in the web application firewall itself. Other security-hardening features specific to web application firewalls aim to remedy the problems Anti-evasion techniques that arise when the developers place trust in the input data. For example: One area where network-based IDSs have had trouble with web traffic is with respect to evasion • Hidden form fields protection. Internal applica- techniques. The problem is there are so many tion data is sometimes exposed via hidden form ways to alter incoming (attack) data, so that it variables, which are not hidden at all. Program- keeps the original meaning as far as the applica- mers often use hidden form fields to preserve tion is concerned, but to still have it modified suffi- process state, send data to the user and expect ciently to sneak under the IDS radar. This is an such data back with no modifications. Such data is area where being able to understand HTTP com- very easy to change. This is a tough problem to pletely results in significant improvement. solve, but WAFs usually employ selective crypto- graphic signing to deal with it. For example, just by looking at whole HTTP re- quests at a time, an entire class of attacks based • Cookies protection. Similar to the problems with on request and packet fragmentation is avoided. the hidden form fields, cookies are sometimes And because they understand HTTP well and can used to transport private application data. Unlike separate dynamic requests from requests for static hidden form fields, some cookies may contain very resources (and so choose not to waste time pro- sensitive data so WAFs usually encrypt their con- tecting static requests that cannot be compro- tents altogether. Another approach is to com- mised), they can afford to apply many different pletely virtualise the cookie mechanism. In such a anti-evasion techniques that would prove too time setup the end users only see cookie tokens (simi- consuming for NIDSs.

NO MATTER HOW YOU CALL THEM, WEB APPLICATION FIREWALLS ARE VERY USEFUL SE- CURITY TOOLS WITH A SECURE POSITION (NO PUN INTENDED) IN EVERY SECURITY PRAC- TITIONER'S TOOLBOX. THEY ARE HERE TO STAY.

Response monitoring and information leak Conclusion prevention No matter how you call them, web application Information leak prevention is a fancy name for firewalls are very useful security tools with a se- monitoring of the outgoing HTTP traffic. In princi- cure position (no pun intended) in every security ple it is identical to request monitoring, and its goal practitioner's toolbox. They are here to stay. is to watch the output for suspicious patterns and Whether the name itself will remain is a matter for prevent the response from reaching the client debate. Many believe the name is not entirely when such a pattern is detected. The most likely adequate and that the major vendors will force a candidates for patterns in output are credit card name change in order to get a bigger slice of the numbers and social security numbers. Another application market. This article only scratches the use for this technique is to watch for signs of suc- surface of this subject. If you care to learn more cessful intrusions. about it I suggest you visit the Web Application It is not really possible to prevent a determined Firewall Evaluation Criteria project, which has re- and skillful attacker from retrieving a piece of in- cently had its first official release. It's a concise a formation, since she will always be able to encode document of twenty pages which lists various as- the information in some a way as to prevent detec- pects of web application firewalls. Reading it tion. Still, this technique can protect in the cases probably won't be as entertaining as reading this when the attacker does not have full control over article was but it can at least claim to be a serious the server but instead tries to exploit a weakness attempt to provide a comprehensive analysis in the application. framework.

Ivan Ristic is a web security specialist and the author of ModSecurity (modsecurity.org), an open source web application firewall. He is the founder of Thinking Stone (thinkingstone.com), a web application security com- pany. Ivan wrote "Apache Security" for O'Reilly (apachesecurity.net), a concise yet comprehensive web secu- rity guide for administrators, system architects, and programmers. Ivan is an active participant in the web ap- plication security community, and a member of the Web Application Security Consortium. www.insecuremag.com 10

Over the years we have seen a number of different concepts that were trying to help the state of security of an average Windows PC user. Earlier, the only major problems were viruses, than we saw Trojans, worms, spyware, mali- cious scripting, etc. Antivirus software nowadays incorporates scanning for all the mentioned types of pests, but the approach that is based on signature updating and therefore on human intervention is not a perfect way to secure a PC user.

Security company Trustware (www.trustware.com) around all the pieces of software that interact with has a product that takes a new approach on pro- remote computers over the Internet. For instance, tecting the end users. BufferZone is centered on a if you are still using Microsoft Internet Explorer, concept of virtualization technology, that creates a you are probably well aware of the problems un- whole new secluded environment on your com- patched versions of this software could generate. puter. Never mind, just add Internet Explorer into the BufferZone and every potential malicious script will After installing the software, you are guided execute in this simulated environment and there- through a mini presentation that introduces you to fore won’t have any impact on your real computer the process of setting up your BufferZone. Al- files. though usage of terms like "virtualization" and "buffer" might be a bit complicated for the average From my perspective, the real power of Buffer- PC user, the concept is very easy to comprehend Zone is not just real-time protection from the prob- and to setup. lems that can occur while browsing, but the possi- bility of reassuring that downloaded files are se- Fighting the malware cure for running.

Your connection to the Internet has probably the In the test case scenario, I tried to download a biggest potential of damaging your computer in Trojan that gets a list of all my files and sends it to any way. Using a non patched browser and visiting an online web page. I downloaded the file and a site with malicious code can very fast compro- started it while it was placed outside the Buffer- mise your computer. Downloading and starting a Zone. The Trojan did its payload and very soon I file without any proper checking by a 24/7 updated could see my details online. I then sent the file to antivirus product could generate a massive infes- the BufferZone and started it once again. tation that will soon hurt your computer in many ways. These are just some of the constant threats This time the test Trojan encountered an internal PC users are susceptible to. error as he couldn’t list my files, and it reported that my computer was secure. I usually download BufferZone comes to the rescue – with only a few a lot of different files from the Internet, especially of clicks you could create a defensive shield from sites like Sourceforge and Freshmeat. www.insecuremag.com 12 Although they have different methods of taking when you will come across an “evil” developer that care of file integrity and security, you never know will create some kind of a unsafe file.

Test Trojan output when application is run outside the BufferZone

BufferZone main screen

During my tests, I ran different programs in the the BufferZone have a red border around their BufferZone, from simple SCP clients and Instant icons and windows (see an example on the follow- Messengers to an mpeg4 modifier program that I ing page). This way you always know if you are used for editing a couple of gigabytes of digital working within an insecure or secure environment. video files. All programs worked like a charm, I If the border annoys you, you can disable it from didn’t come across any potential problem. There is the configuration menu. a very nice visual touch – all programs that are in www.insecuremag.com 13 The red border indicates that this file is in the buffer zone

The program hosts a couple of customizing fea- will immediately add the popular Internet related tures. You can group specific files under several tools into its environment. You can also add your categories including Web, Mail and P2P. This own software into these categories, making it easy helps a bit as the most popular software is prede- to enable or disable a specific set of programs. fined. When you start BufferZone out of the box, it

If you want, any file can be sent for execution outside of the protected zone

From the enterprise point of view, BufferZone 1.6 designated servers and lets managers define ac- incorporates advanced management tools for ceptable filename extensions. Managers could monitoring, controlling and enforcing user activity also monitor all BufferZone activity in real time. throughout the LAN. These include an enterprise- wide, automated, scheduled BufferZone technol- Overall, BufferZone is a must have software for ogy re-set that removes BufferZone values from Windows users. Its powerful virtualization engine Windows registries without data loss. Also, there is creates a trusted environment that you will very a tool that controls and prevents installation any- soon fall in love with. The software is very easy to where on the LAN of software not originating from setup, manage and use.

Mark Woodstone is a security consultant that works for a large Internet Presence Provider (IPP) that serves about 4000 clients from about 30 countries worldwide.

www.insecuremag.com 14 Extrusion Detection: Security Monitoring for Internal Intrusions by Richard Bejtlich Addison-Wesley Professional, ISBN: 0321349962

Extrusion Detection is a comprehensive guide to preventing, detecting, and mitigating se- curity breaches from the inside out. Bejtlich teaches you how to assess threats from in- ternal clients, instrument networks to detect anomalies in outgoing traffic, architect net- works to resist internal attacks, and respond effectively when attacks occur.

If you’ve enjoyed Bejtlich’s previous publications, especially The Tao of Network Security Monitoring, you will love this one.

Digital Identity by Phillip Windley O'Reilly, ISBN: 0596008783

The author shares his extensive knowledge on the ideas, issues, and technologies be- hind a key concept known as Identity Management Architecture” (IMA).

Focused on upper management and IT professionals working in this field, the book cov- ers in details set of standards, policies, certifications, and management activities that en- able companies to manage digital identity effectively.

Real Digital Forensics : Computer Security and Incident Response by Keith J. Jones, Richard Bejtlich, Curtis W. Rose Addison-Wesley Professional, ISBN: 0321240693

If you are into forensics, this book is probably already on your book case. If not, you should definitely check this out.

The authors provide five different scenarios and show you what steps to take and what tools to use in the process of incident response. The book is complemented with a DVD with all the evidence collected for each of the scenarios, which makes the educational perspective of this book much more interesting.

www.insecuremag.com 15 Self-Service Linux: Mastering the Art of Problem Determination by Mark Wilding, Dan Behman Prentice Hall PTR, ISBN: 013147751X

In Self-Service Linux, two of IBM’s leading Linux experts introduce a four-step methodol- ogy for identifying and resolving every type of Linux-related system or application prob- lem: errors, crashes, hangs, performance slowdowns, unexpected behavior, and unex- pected outputs.

If you’re involved with deploying or managing Linux in the enterprise, it can help you sig- nificantly reduce operation costs and enhance availability.

Computer Privacy Annoyances by Dan Tynan O’Reilly, ISBN: 0596007752

This is a very interesting little book that will make you think a bit more about your pri- vacy, both at home, work and online. It contains a myriad of good tips, each of them con- taining information on the actual annoyance and a possible solution.

Although the title of this book implies that it focuses on computers, the author also man- aged to give a lot of good tips on various real life stations, including dealing with the IRS, US government, postal service, etc.

(SCTS) Symantec Certified Technical Specialist: Small Business Security Study Guide by Nik Alston, Mike Chapple, Kirk Hausman Addison-Wesley Professional, ISBN: 0321349946

Symantec’s Certified Technical Specialist (SCTS), Small Business Security certification allows security professionals to validate their knowledge of today’s most crucial informa- tion security techniques in combination with Symantec’s security products.

This guide covers the exam objective in depth; everything you need to know to pass your exam the first time. The book comes with a CD that contains a couple of SCTS sample exams.

Essential PHP Security by Chris Shiflett O’Reilly, ISBN: 059600656X

This hundred pager should be “a must” for every self-conscious PHP developer. A large majority of PHP web applications had some kind of a security vulnerability, so develop- ers, start your engines. “Essential PHP Security” is a straight-forward book, it has 100 pages and hosts a precise problem/solution type of content. This could also be a good read to penetration testers, as it will definitely broaden their knowledge on the subject.

www.insecuremag.com 16 System and security administrators have long known the value in capturing and analyzing log data. Systems administrators tend to focus on operating system logs, while security administrators focus on router, firewall, and simi- lar log data. Unfortunately these groups rarely see how system logs and se- curity log data can be used together to paint a better overall picture of what is going on in the environment.

The goal of this article is to educate system and for. Or it may be that you are somewhat new to security administrators, and others, on the value in administration of security systems and may need analyzing disparate log data to discover potentially input from others in your organization or from on- malicious behavior. line resources. For example, your accounting group may have ideas on the sort of things to look This article is broken up into the following sec- for with respect to financial systems and such. tions: Step 3. Collect • Log Data Basics • Log Gathering Architecture Aggregation is often used to describe the act of • Prepare Log Data for Analysis collecting log data to a central location. By collect- • Analyzing Events for Threats ing all log data to a central you are able to look at • Threat Analysis Example things as a whole and perform effective analysis. • Tools of the Trade Step 4. Prepare Let’s begin by summarizing the threat analysis process. The following five steps briefly discuss Preparing log data for analysis is performed the process. through normalization. The end result of normali- zation is the creation of an event, which is used in Step 1. Configure the analysis process.

Generally you will need to configure your systems Step 5. Analyze to begin emitting log data. This is system- and device-specific so this step will not be discussed in The fifth and final step is analysis. Here we are this article. concerned about discovering potentially malicious behavior. Step 2. Understand Analysis is generally performed against events, Understanding what sort of log data your systems but in some instances analysis is performed can emit is critical. It is through this understanding against raw log data. that you are then able to effectively analyze data for interesting behavior. It may be that you are well Let’s now begin the journey down the path to versed on the nature of your systems and you can threat analysis. formalize what sort of things you will want to look

www.insecuremag.com 17 Log Data Basics The following list of Internet-protocol specific methods are utilized by many devices and sys- Log data is a general term used to identify infor- tems systems: mation which can be used to better understand what is going on with a particular system, set of Syslog systems or network. Some systems, like operating systems, store log data on disk. Others like routers Syslog (System Logger) is a simple UDP-based or hardware-based systems don’t have internal protocol. Syslog logging comes in two flavors: lo- disks to store log data on; they simply emit log cal logging and remote logging. Local logging is data. where logs are generated and stored on the same machine. Remote logging is where one machine Most people think of a file on disk when they hear generates a log message but forwards it on to an- the term log data or log messages. UNIX adminis- other machine for storage. By default all data trators tend to think of /var/log/ or /var/adm as transmission is sent in clear-text. Since Syslog is repositories for log data. Windows people, on the the most commonly used mechanism, let’s delve other hand, are used to dealing with the Event into it a bit more. Syslog messages generally have Log. As for log data sources, again most people the following simple format: think of UNIX or Windows servers, routers, and such.

While these are accurate, the source of log data is The format is as follows: not limited to a certain type of system. The follow- ing is a partial list of system/device classes which Timestamp are capable of generating log data. This is the time and date of when the message was created. If local logging is used then it’s • Operating System (OS) based on the local machine’s time. If the message • Firewall was received from a remote machine then the • Network Intrusion Prevention System (NIPS) time is based on the remote machine. • Host Intrusion Prevention System (HIPS) • Authentication Systems (Kerberos, Radius, etc.) Hostname • Vulnerability Assessment (VA) The hostname can be an IP address (if no DNS • Anti-Virus (AV) information for the IP address exists), fully quali- • Anti-Spam fied domain name (FQDN) or simply a hostname. • Router • Switch Message source The message source indicates, as you might have The type of information contained in log data var- guessed, the source of the message. For ies greatly. Some examples of the type of informa- operating-system components or applications, the tion which could be used for threat analysis in- source is usually a process name. Note that when clude: receiving messages from devices like routers, switches, and firewalls, you generally will not get a • Login/Logout Messages process ID as part of the source. Often times all • User Account addition, modification, or deletion you get is something along the lines of the vendor • Disk Full Messages name. • Firewall allow/deny Messages • NIPS Messages Message • Web Server Logs The message contains specific detail on what • Many others happened. Note that message formats between applications, systems, devices, vendors, etc., all Log Data Transmission differ, e.g. it is very free-form in nature.

Log data transmission deals with how data is sent SNMP and received. This includes knowing what trans- mission protocols your systems support and con- SNMP (Simple Network Management Protocol) is figuring them to send data. The most common also UDP based. protocol is Syslog. Generally speaking some piece of software is run to gather log data sent via one There are three versions of SNMP: SNMPv1, of these transmission protocols. SNMPv2, and SNMPv3. SNMPv3 adds security to the protocol in the form www.insecuremag.com 18 of authentication and encryption. Many systems Collector employ SNMP traps for sending of log data. The collector is used to collect and aggregate log SMTP data from log data sources.

SMTP (Simple Mail Transfer Protocol) is TCP- Analysis Server based. While many systems support SMTP for notification, it is rare to see a system which uses The analysis server does the actual work of ana- SMTP as its log data emission mechanism, but a lyzing log data for threats. Note that the collector few do exist. The default is to send in clear-text. and analysis server may be on the same machine or different machines for efficiency. Beyond these Internet-standard methods, proprie- tary ones also exist. These are protocols and APIs Archive Server that commercial vendors have created. Some these include the following: The archive server is used to store log data, either in raw form, normalized form or both, so it can be Checkpoint OPSEC LEA analyzed at a later time or for report generation. Typically a database is used to store this informa- The Open Platform for Security (OPSEC) is an tion. open and extensible framework for managing all aspects of network security. The Log Export API Administrator Console (LEA) is one API under the OPSEC umbrella. LEA can be used to gather Checkpoint firewall logs The administrator console is generally some piece from Checkpoint’s SmartCenter management plat- of software which is used for viewing log data, form. The LEA API uses encryption to securely events, alerts, reports, etc. transmit data. Reporting Cisco RDEP/SDEE Reporting is generally performed on data in the The Remote Data Exchange Protocol (RDEP) is archive database. Cisco’s first generation protocol for gather log data from its IPS product. The Security Device Event Figure-1 (on the following page) depicts a basic Exchange (SDEE) extends and updates RDEP. log-gathering architecture. Both clear-text and encrypted modes are sup- ported. There are actually two architectures within Figure- 1. The fist one is the most basic. The firewall, Sourcefire E-Streamer router, database and Web server are all config- ured to send their log data to the central log E-Streamer is a protocol used to gather log data server. The central log server is responsible not from SourceFire IPS. Both clear-text and en- only for gathering log data, but for preparing the crypted modes are supported. data for analysis.

Windows Event Log The second architecture is one where a remote collector is used at a remote network site. It is The Windows Event Log is Microsoft’s central called a collector because it is responsible for col- source for logging. There are three main log types: lecting log data, but it forwards what it receives to System, Application, and Security. the central log server. There are several reasons for using a remote collector: Log Gathering Architecture • You may not want all log data flowing over your Gathering log data requires you to configure your Internet link. You can filter out messages you don’t systems to emit log data. Once this is done, you care about or want to analyze and save on band- then need a place to capture all this data. At a width. minimum you need a server that will act as the • The collector could prepare the data before it is central collector or log server. Aggregation is used sent to the central server. This would allow the to describe the act of gathering log data in one server to not have to work as hard and spend place. A log data architecture generally has a more time analyzing critical events. number of components which are discussed now. • You may want to encrypt the data sent over the Internet. www.insecuremag.com 19 Figure-1. Log gathering architecture

The final component in the architecture is the Event Creation administrators/analysts who are consumers of the gathered log data and analyses. It is their job to be Think of an event as the currency used within an aware of what’s going on both at the network level analysis system. How an event comes into exis- and at the machine level. For more information on tence depends upon the underlying locomotion creating a logging server, see Anton Chuvakin’s mechanism used for normalization. Here are some article Advanced Log Processing example mechanisms. (www.securityfocus.com/infocus/1613). He also discusses how to secure Syslog transmission. Database A schema can be created which embodies an Prepare Log Data for Analysis event format. Log data is received, normalized and inserted into an event table. Standard SQL While Syslog’s protocol has a common format, the can then be used to analyze the event table. The device- or system-specific data format itself varies use of a database is quite common and can make widely. This is because no two vendors pick the life a little easier. identical format for messages and log data. Programming language-specific Structure Preparing Log Data The C programming language allows the pro- grammer to create user-defined types using struc- Recall that Step 4 in the threat-analysis process is tures. Object oriented languages like Java and to prepare log data. This is a critical and important C++ facilitate the creation of user-defined types step in the threat analysis process. Unfortunately, via classes. Regardless of the language used, the it is also tedious and error prone. This is because goal is the same as with a database. The main you have to know and understand the format of difference is that a database isn’t used. Instead the log data you gather. Some vendors provide you have a system, written in one particular lan- excellent documentation on their message for- guage, broken up by components. One compo- mats, while others either inaccurately document or nent gets the log data, normalizes it. Events are provide no documentation at all. Normalization is created in a language specific manner and the process of going from a specific format to a handed off to an analysis component. The analy- common one without loss of precision. The output sis component may be on the same machine as of normalization is an event. This event is what is the normalization component or it may be on a used during the analysis phase. But what is an remote machine (for efficiency purposes). This event? means some sort of inter-process communication

www.insecuremag.com 20 (IPC) will need to be used to pass information tinct messages are now collapsed down to one from one component to the next. single concept.

Flat-file Priority A simpler way to create events is to use flat-files The priority is used to determine how severe an where each line contains a CSV line of text. Each event is. Some of the log data you normalize will value would map to specific field in your normal- have its own priority value as part of the message, ized event. Similar to a database, the flat file while others will not. It is generally a good idea to would be processed for analysis. establish your own priority scheme and map your log data’s priorities to this scheme. One simple Event Fields scheme is to use low, medium, and high.

Now that we have established what an event is, Protocol what sort of fields should we have in our event The most common are UDP and TCP. structure? The following list outlines some of the more common fields that are of interest to system ICMP Type and Code and security administrators. When the protocol is ICMP, don’t forget to record the type and code. Date and Time It is important to record the time the message was Username received by the collector or server. Some vendors Capturing username information is very useful in also include the time the message was created, tracking down malicious attackers who log into a which should be captured in another field. Some machine and attempt to do something nasty like fill products and systems emit epoch timestamps up hard disks, crash running programs, etc. Unfor- while others generate normal month, day, time, tunately, username information is generally only etc. It is often easier to deal with epochs, so con- available in certain log messages. sider normalizing all date and times to an epoch. Domain Application/File Names Domain could refer to Windows domain or the This could either be the application which gener- domain name portion of an email address, etc. ated the message or an application which at- tempted to perform an illegal action, e.g. a host Email Address intrusion prevention system can identify potentially An email address may be present in SMTP/POP malicious applications. messages.

Application Exit Codes The Mechanics of Normalization Some log messages may contain exit codes, which could help point out dubious behavior. Normalization in the case of log data is sometimes referred to as parsing. The most common way Source and Destination IP Addresses and Ports parsing is performed is through regular expres- Firewall and NIPS systems generate source and sions. It allows for the most flexible processing destination IP address and port information which possible. Care must be taken, however, to ensure can be used to discover malicious behavior pat- you create regular expressions which perform as terns, among other things. optimal as possible. Jeffrey E. F. Friedl’s book Mastering Regular Expressions, 2nd Edition Taxonomy Type (www.oreilly.com/catalog/regex2) is one of the A Taxonomy is a set of types which are aligned best resources for learning everything you need to around conceptual boundaries. For example, one know about regular expressions. firewall vendor may emit a message which uses the word “accept”, but a different firewall vendor The following sections provide actual parsing ex- may use the word “allow”. Through use of a tax- amples. Even though Perl is used with the exam- onomy, these two messages could be normalized ples, the concept would be the same regardless of simply as accept. But taxonimification doesn’t stop the language or technique used. at homogenous device normalization. It can also be used for heterogeneous normalization. UNIX Login When someone logs into a UNIX system using For example, let’s say IPS vendor A emits log SSH, this activity is recorded in the form of a log Message-A. Firewall vendor B emits log Message- message. The following is an example Syslog B. It turns out that Message-A and Message-B are message from a Linux machine: the same conceptually. This means that two dis- www.insecuremag.com 21 Jan 10 14:57:29 server login(pam_unix)[2653]: session opened for user root by LOG- IN(uid=0)

The following Perl snippet shows how to process this log messages.

# Assume $message contains the message my($month, $day, $time, $host, $process, $pid, $user, $rest) = $message =~ m/^(\w{3}) (\d{2}) (\d{2}:\d{2}:\d{2}) (.*?) (.*?)\[(\d+)\]: session opened for user (\w+) by (.*?)$/g;

Here I grab month, day, time, host, process, pid (process id), user, and rest.

Cisco PIX Cisco PIX is Cisco’s firewall product. It is capable of generating an extensive amount of valuable log mes- sages. Here are two such examples.

Jan 11 2006 10:00:03: %PIX-4-106023: Deny tcp src dmz:10.0.3.4/36637 dst outside:10.0.2.2/25 by access-group \"in_dmz\"

Jan 11 2006 16:21:25: %PIX-6-106015: Deny TCP (no connection) from 10.3.3.15/80 to 10.21.1.3/41063 flags SYN ACK on interface outside

This illustrates and interesting point. Both of these lem in the real world and you need to be aware of are TCP deny messages, yet neither of them have it. So let’s look at how we might parse these. exactly the same format. This is a common prob-

# Assume $message contains the message my($month, $day, $year, $time, $type, $protocol) = $message =~ /^(\w{3}) (\d{2}) (\d{4}) (\d+:\d+:\d+):.*?: (.*?) (.*?) /g; my($srcIp, $srcPort, $dstIp, $dstPort) = $message =~ /(\d+\.\d+\.\d+\.\d+)\/(\d+)/gc;

I use two regular expressions to process the mes- wrote takes advantage of this fact. However, there sage. The first regular expression gets the month, are many PIX messages that either have no type day, year, and time. Notice how the PIX mes- or have the type string some place else in the sages, unlike the UNIX message, has a year as message. Your parsing should be able to handle part of the date. Next I grab the type of event and these conditions. protocol. The type for both messages is Deny. Protocol is the same for both, but one is upper- One approach is to create message-specific pars- case and the other is lowercase. ers. Notice how both messages have a token which looks like %PIX-X-YYYYYY. Each PIX mes- The second regular expression obtains the source sage has this token. The six-digit number is a and destination IP addresses and ports. I used the unique identifier for the event. Fortunately Cisco /gc modifier, which allows Perl’s regular expres- documents the format for all PIX messages and sion engine to keep matching after /g fails. This is they do so by the version of PIX. why I only specify a single pattern but I am able to get both IP addresses and both ports. Unfortu- Analyzing Events for Threats nately, this will not work for many PIX messages. Some PIX messages will contain NAT addresses, Richard Bejtlich has written that “the process by too, which would cause our regular expression to which the intentions and capabilities of threats are miss some or all of the information we need. assessed is called threat analysis.” I really like this definition because it simply makes sense. It’s worth while at this point to discuss some things that can go wrong with parsing. The PIX type (in It should be noted that threat analysis cannot re- this case Deny) just happens to be in the same place the human factor in network security. Threat place in both messages. The regular expression I analysis techniques provide better information on www.insecuremag.com 22 what is going on in an environment, but an analyst better intelligence to administrators so they can or administrator may still need to investigate fur- investigate possibly dubious behavior. ther by firing up a packet capture tool, inspect OS logs, etc., to make a determination that something Some people may say “why should I care about malicious really happened. Let’s now look at tech- correlation since firewall, IPS, and other systems niques used for analyzing log data for potential can aid in the detection and prevention of mali- threats. cious behavior?” This is certainly true to a certain extent. But what about the situation where a cer- Correlation tain IPS event combined with a certain OS event constitutes a higher-level threat which cannot be Correlation is the buzzword used in conjunction detected solely by the IPS event or OS event? with threat analysis. It is often times touted as a This is where correlation is beneficial. panacea. In reality it isn’t. What people generally mean when they mention correlation is: looking at Correlation, using log data, is generally accom- all events in aggregate and grouping similar things plished via two methods: real-time (or near real- together to see if they relate to each other in inter- time) and non-real-time. Generally speaking, real- esting ways. It is the aggregation of log data to a time relies on rules to specify what things to look single place which allows correlation to take place. for; non-real-time analysis deals with methods In the context of log data, we want to group similar which can either supplement real-time analysis or events together to discover possible malicious be- stand alone in its own right, but are generally done havior. The real goal of correlation is to provide after the fact, i.e. forensically. These topics will now be discussed.

Real-time Analysis This rule works on two firewall events. Event A is a normalized event with taxonomy accept. Event B Rules are simply a prescribed set of checks or is also normalized to deny. conditions whose entire truth value is evaluated. There are many ways rules can be written. For The rule itself is looking for 10 B’s followed by a example, you may use the if-then structure of a single A, in other words 10 accepts followed by a programming language to embed rules in applica- single deny. This form of analysis is useful, but we tion code. Or you way wish to purchase a stand- also want to group across event types. alone rule engine which evaluates events fed to it with an externally created rule set. For example:

The purpose of this section is simply to present Event A = portscan the idea of rule-based analysis. A few pseudo- Event B = accept code examples will be provided to drive home this IF (A’s destination IP == B’s destination analysis technique. IP) AND (A’s destination port == B’s destination Recall that our definition of correlation stipulates port) that we group events together. The first kind of THEN grouping involves events from the same device Possible destination breach due to open firewall rule type. Consider the following example: Here Event A is a normalized IPS port scan event. Event A = accept Event B = deny Event B is a firewall accept. The rule uses destina- tion IP address and port fields in Events A and B to IF (10 B’s are followed by 1 A) identify a possible scan breach due to an open THEN firewall hole. Possible scan success www.insecuremag.com 23 Non-real-time Analysis • Ratios • Range The techniques discussed in this section can be • Interquartile Range used to supplement real-time analysis or as • Variance Analysis standalone methods. It is the nature of these methods that they operate over data which has Vulnerability Correlation been accumulated for some time period. Vulnerability correlation is the use of vulnerability assessment data to determine how valid an event Statistical Methods is. For example, if your IPS detects that an at- tempt has been made to exploit some sendmail Statistical methods can be employed to discover vulnerability on a Windows server, which isn’t run- interesting things that rules generally cannot. A ning sendmail, then you can disregard this event few of these methods are discussed now. or set its priority lower.

Baseline External Data Correlation A baseline is simply a set of data which represents This technique is similar to vulnerability correlation normal values. Trends can be discovered by in that it uses external data sources to validate evaluating new data against an established base- events. For example, you may take in a feed from line. some security Web site and correlate an increase in a certain type of event with the outbreak of Thresholds and Windows some new worm. With windowing we wish to discover possible du- bious behavior that occurs outside of a certain Final Thoughts range, e.g. time of day, etc. For example, you may want to know any time your router’s configuration Never underestimate the value in learning from changes outside of scheduled maintenance win- others. Here’s a brief list of books I have found dows. The comparison of some event against a useful for helping me think about threat analysis: simple baseline is considered thresholding. For example, you may wish to know when a user fails • Building a Logging Infrastructure to login five times in a row. The value five is a (www.sage.org/pubs/12_logging/) by Tina Bird and threshold. Abe Singer • Schaum’s Outline of Statistics by Murray R. Never Before Seen (NBS) Detection Spiegel and Larry J. Stephens NBS detection deals with determining when some- • The Tao of Network Security Monitoring: Beyond thing hasn’t happened before. Marcus Ranum’s Intrusion Detection by Richard Bejtlich NBS (www.ranum.com/security/computer_ • Extrusion Detection: Security Monitoring for In- security/code) tool can aid in this endeavor. ternal Intrusions by Richard Bejtlich.

Other Statistical Techniques Threat Analysis Example The following statistical techniques can be used by themselves or in conjunction with the other A walk through of how real-time analysis can be methods discussed in this section. used to aid in threat analysis is probably in order. Let’s say the following events show up in • Standard Deviation /var/log/auth.log on a Unix system: • Moving Averages

Dec 20 15:00:35 host PAM_unix[11351]: check pass; user unknown Dec 20 15:00:35 host PAM_unix[11351]: authentication failure; (uid=0) -> **un- known** for ftp service Dec 20 15:00:43 host PAM_unix[11351]: check pass; user unknown Dec 20 15:00:43 host PAM_unix[11351]: authentication failure; (uid=0) -> **un- known** for ftp service

But moments before this the following showed up in /var/log/daemon.log:

Dec 20 15:00:30 host in.ftpd[11351]: connect from 10.0.3.4

www.insecuremag.com 24 To understand what is going on here we need to catch such behavior is tricky. In the case of our have access to messages written to both log files. FTPD messages, we see that the process ID (the But more importantly than this is that we have the number between the square brackets, “[11351]”) is proper knowledge and experience to know what the same. This is because the in.ftpd process constitutes a possible attack, break in, etc. (in /var/log/daemon.log) spawned a sub- process to handle the incoming connection. We We first need to normalize the events. Beyond know the process name and the process ID be- this, however, it is important to properly map the cause of the string “in.ftpd[11351]”. Notice, how- messages to a taxonomy. For example, the first ever, that /var/log/auth.log shows the same message in /var/log/auth.log could be classi- process ID but different process names (“PAM_u- fied as credential-check. The second message nix[11351]”). This means when crafting a rule to tie could be auth-failure. We notice that the third these events together we will need to make sure and fourth messages are really the same as the the process ID is used to tie together these mes- first and second messages respectively. Finally, sages into a single session. So how would we de- the message from /var/log/daemon.log could tect something like this? A rule can be used to be classified as access-attempt. specify how to determine that something has hap- pened and then what to do about it. We can ex- The next step is to write a rule to combine or cor- press it in pseudo-English with the following: relate these normalized events. Writing a rule to

Event A = credential-check Event B = auth-failure Event C = access-attempt

IF((B.count >= 2 ) AND (A.processID == B.processID) AND (B.processID == C.processID) AND (TimeDifferenceBetween(A,B,C) <= 10) THEN Create and investigate an event with process ID, hostname, etc.

This rule attempts to detect a situation where cur in close proximity to each other (less than 10 there are two authentication failures occur. It also seconds all together). What if we wanted to use makes sure the process IDs for events A, B and C this rule for systems where we don’t get process are the same and the time difference between ID information? It is the case that we may very them is no greater than 10 seconds. In other well have non-OS message taxonomized exactly words, make sure all three events are tied to- the same way. We could rewrite the previous rule gether by process ID and also make sure they oc- as follows:

A = credential-check B = auth-failure C = access-attempt

IF((B.count >= 2) AND (A.srcIp == B.srcIp) AND (B.srcIp == C.srcIp) AND (TimeDifferenceBetween(A,B,C) <= 10)) THEN Create and investigate an event with sourceIP of attacker, etc.

Here we are using the source IP address to en- about achieving this goal? Fortunately you have sure that events A, B and C are from the same several options at your disposal to help you. They attacker. Of course there will be times when proc- range from building your own solution to using ess ID and source/destination IP address informa- open source software. tion will not be available. Sometimes you have to do the best you can with what you have. Roll Your Own Solution

Tools of the Trade If you have software development expertise you can opt to build your own log data gathering and Now that you have a firm foundation for the steps analysis system. This is probably the least desir- involved in threat analysis, how do you actually go able approach, but it is an option. www.insecuremag.com 25 Commercial Solutions (security.sdsc.edu/software/sdsc-syslog/). It boasts the following features: Security Information Management (SIM) and Se- curity Event Manage (SEM) companies have • Input modules for socket, UDP network connec- sprung up over the last five or so years to meet tions, TCP/BEEP, etc. the growing emphasis on log data analysis. SIM • Message switch to perform log message routing software is delivered either as an appliance or • Multiple output modules for UDP, TCP/BEEP, shrink-wrapped software and utilizes a three-tiered "syslog classic" files, structured files architecture. The first tier is a collector which is • Multi-processing - handles more input syslog used to gather and normalize log data. The sec- steams, provides better scalability ond tier is an analysis and storage system. The • Support for draft standards such as "syslog- storage system is used to store events in long- reliable" (RFC 3195, syslog messages over term storage. This is done for forensic purposes BEEP). as well as historical reporting. The console admin- istrators use to view events is the third and final Simple Event Correlator (SEC) layer. One advantage of commercial vendors is they tend to support a wide variety of devise and SEC (estpak.ee/~risto/sec/) is a Perl-based sys- systems out of the box. This makes your job eas- tem for analyzing data via several different meth- ier, i.e. because you don’t have to spend time wor- ods like regular files, named pipes, and standard rying about log data format issues. input. It uses rules to instruct it how to analyze and react to events. External programs or analysis Some of the bigger players in the SIM market in- modules can be spawned from rules for greater clude: flexibility.

• Intellitactics (www.intellitactics.com) Open Source Security Information Manage- • ArcSight (www.arcsight.com) ment (OSSIM) • netForensics (www.netforensics.com) • GuardedNet (www.guraded.net) OSSIM (ossim.net) is an open source SIM tool • LogLogic (www.loglogic.com) that aims to be as feature-rich as its commercial • LogRhythm (www.logrhythm.com) counterparts. It supports normalization, correla- tion, and risk assessment among many other fea- Open Source Solutions tures.

In the open source realm you have a lot of differ- LogAnalysis.Org ent tools to choose from. These tools range from Syslog daemon replacements to log analysis pro- LogAnalysis.Org (loganalysis.org) is not an open grams to full-blown SIM solutions. The following source tool, but is a resource for all things related list is by no means exhaustive. It is simply meant to log data analysis. It includes mailing lists and a to give you a feel for what sort of open source comprehensive resource library on log data analy- tools are out there. sis tools, systems, software, etc. This site should be one you visit to learn more about what open syslog-ng source (and commercial) tools are available.

syslog-ng (www.balabit.com/products/syslog_ng) Conclusion is a replacement for the standard UNIX Syslog daemon. It is unique in that it is highly configurable Threat analysis involves gathering, normalizing, and supports TCP transmission and extensive fil- and analyzing log data. tering. It also supports customizable data mining and analysis features. The end goal is to correlate data from many sources to better detect dubious behavior, which High Performance Syslog may not be detected by a single source, and alert on it. Administrators and analysts use alerts to de- The San Diego Supercomputer Center (SDSC) termine if a given situation requires further investi- maintains a high-performance Syslog replacement gation or not.

Kevin J. Schmidt is a senior software developer at SecureWorks, Inc. (.com), an Atlanta, Georgia based MSSP. He is a member of a dedicated software team who take security, threat analysis and correlation very seriously. This team provides software tools and systems which allows the Security Operation Center (SOC) to ensure SecureWorks’ clients are well protected 24X7X365. www.insecuremag.com 26 InfoSec World 2006 3 April-5 April 2006 – Disney’s Coronado Spring Resort, Orlando, USA www.misti.com

Infosecurity Europe 2006 25 April-27 April 2006 – Olympia, London, UK www.infosec.co.uk

RSA Conference 2006 13 February-17 February 2006 – McEnery Convention Center, San Jose, CA, USA 2005.rsaconference.com/us/C4P06/

Black Hat Europe 2006 Briefings and Training 28 February-3 March 2006 – Grand Hotel Krasnapolsky, Amsterdam, the Nether- lands http://blackhat.com

LayerOne 2006 22 April-23 April 2006 – Pasadena Hilton, Los Angeles, California, USA www.layerone.info/

InfoSeCon 2006 8 May-10 May 2006 Hotel Croatia, Dubrovnik, Croatia www.infosecon.org

iTrust 2006 16 May-19 May 2006 – Piza, Italy www.iit.cnr.it/iTrust2006/index.htm

Eurocrypt 2006 28 May-1 June 2006 – St. Petersburg, Russia www.iacr.org/conferences/eurocrypt2006/

www.insecuremag.com 27 What follows are some of the biggest events of 2005 with comments by:

• Bruce Schneier - CTO of Counterpane Internet Security and acclaimed se- curity technologist and author. • Howard Schmidt - former Special Adviser for Cyberspace Security for the White House, was CSO of eBay and Microsoft. • Dr. Gerhard Eschelbeck - CTO of Webroot, named one of Infoworld's 25 Most Influential CTO's in 2003 and 2004. • Mikko H. Hyppönen - Chief Research Officer at F-Secure. • Fyodor - acclaimed security researcher and author of nmap. • Ira Winkler - author of "Spies Among Us".

An increasing number of techniques and easier mother are getting gifts for the holidays online. access to computer equipment enhances the The truth is always somewhere in between - de- knowledge of both the malicious users and the spite the media trying to publish "horror stories" in security professionals. However, it always seems order to increase readership. that the "dark side" has much more free time on their hands since they tend to be ahead of the in- When it comes to all these reports where we see dustry. average users very paranoid Ira Winkler has an- other view on the situation: "As time goes on, Windows users are fighting with all sorts of mal- people will only be more comfortable with comput- ware and security holes year after year. "I know it ers. They will use it for more and more applica- is popular to blame Microsoft for security woes, tions. Security is at best an afterthought, and the but they really deserve it this year! From remotely more ubiquitous the computer becomes, the less exploitable vulnerabilities in Windows core serv- they will consider the threats involved with its us- ices like UPnP and MSDTC, to a barrage of se- age." vere IE vulnerabilities, Windows users were con- stantly under attack." said Fyodor. "Microsoft Every year analysts inform us that this year was spends many marketing dollars touting their secu- the worst yet and that a bleak digital future awaits rity, but they need to start backing this up with ac- just around the corner. I tend to be skeptical about tion." he added. such predictions so I'm going to let you decide what to make of 2005. The events depicted in this The media tends to spread FUD by writing stories article all left a mark on both the industry and the where large percentages of Internet users are very users. As repercussions go, some are evident and afraid to shop online, we see exceptionally big some will be seen in the upcoming months. All in numbers when it comes to identity theft and yet e- all, it was an interesting year. commerce is booming and everyone and their www.insecuremag.com 28 Not a great year for credit cards crypted and if that wasn't bad enough they also kept the three digit Card Value Verification (CVV) CardSystems processed payments for multiple numbers despite the guidelines by MasterCard credit card companies. In May the company suf- and Visa that prohibit the storage of the CVV fered the largest data security breach to date numbers after a transaction and require the data- when around 40 million credit card numbers were bases to be encrypted. The company says they stolen. The affected companies were MasterCard, didn't know these numbers were stored for a Visa, American Express and Discover. longer period of time. I don't know if this makes things better or worse. The problem was not only in the fact that the inci- dent occurred in the first place but in the fact that Rootkits go mainstream CardSystems did not comply with the regulations that their customers had in place. Audits showed On October 31st Mark Russinovich posted an en- that they weren't as secure as they had to be. The try on his blog entitled "Sony, Rootkits and Digital result? Not surprisingly, even after complying to Rights Management Gone Too Far" that sparked a the demands of increased security the company media frenzy. Russinovich discovered that Sony was sold in October. was using a rootkit as a method of control for some of their CDs. Bruce Schneier comments on this situation: "Every credit card company is terrified that people will re- Sony got under much fire as both privacy advo- duce their credit card usage. They're worried that cates and the users were raging against such vile all of this press about stolen personal data, as well control actions and started boycotting certain Sony as actual identity theft and other types of credit titles, bad reviews were starting to show up on card fraud, will scare shoppers off the Internet. shopping sites and Amazon.com contacted their They're worried about how their brands are per- customers and offered them a complete refund if ceived by the public. And they don't want some they returned the "infected" CDs. At least now the idiot company ruining their reputations by expos- public is much more aware of certain problems. ing 40 million cardholders to the risk of fraud." Assorted malware Howard Schmidt said: "I think that anytime a breach of security of any size, especially one that Not surprisingly this year had thousands of pages contains consumer private information causes ex- filled with reports of various types of malware ecutives to ask "Can this happen to us and if so wrecking havoc. So, are things getting any better how do we fix it?" With the compliance issues ta- or just worse when it comes to virus outbreaks? "It king a bigger role in corporate governance world seems better. In 2003 we had tons of large out- wide I would expect this to continue to be a board breaks. In 2004 we saw some. This year only a room discussion which will increase security." handful." says Mikko H. Hyppönen. "However, the transformation from hobbyist virus writers to pro- And just in time for the holidays, Guidance Soft- fessionals also means more targeted attacks. ware (a self-proclaimed leader in incident re- These stay under the radar and don't become sponse and computer forensics) suffered a breach front page news - the criminals don't want to end that will probably get a lot of people fired. The in- up on the front page. We're seeing less outbreaks cident during which some 3,800 customer credit - so the situation seems to be getting better. It's card numbers have been stolen, occurred on No- actually getting worse" he adds. vember 25th but wasn't discovered until December 7th. Did Guidance Software contact their custom- The most talked about virus of 2005 is certainly ers immediately? No. In the age where even chil- Sober which caused a lot of problems and dis- dren use mobile phones, IM and e-mail, they rupted e-mail traffic for both MSN and Hotmail. F- chose to send out notices of the breaches via Secure cracked the code and learned how Sober regular mail. Why? They claim people change e- activates. More than 20 variants of the virus have mail addresses too frequently while the location of been found since October. the offices stays the same. I guess they think these companies also change their phone num- Other "popular" viruses in 2005 were Zafi.D and bers all the time. Even if they do, shouldn't they several variants of Zotob. When it comes to num- keep an up-to-date database with contact informa- bers, Hyppönen says the situation seems better: tion? "All of these cases were smaller than cases like the Mydoom/Bagle/Netsky war or the Sasser out- To make things even worse, the company stored break from 2004." customer records in databases that were not en- www.insecuremag.com 29 Is there any hope in sight for 2006? "We're afraid Cisco claims the presentation was dangerous of several things. Automatic mobile phone viruses. since it contains information on IOS and that the WLAN viruses. Skype viruses. I'm afraid it's not information was obtained illegally. Lynn found the going to get better" according to Hyppönen. problem while working for ISS under specific in- structions to reverse-engineer the Cisco operating Ciscogate system. He noted that the release of information was necessary since the IOS source code was A lot of media attention was on the Black Hat Con- already stolen earlier and it was only a matter of ference in Las Vegas this year. Michael Lynn, a time before someone decided to engage in some researcher working for ISS, did a presentation on illegal activity. To get his perspective on things I a security hole in Cisco's IOS. Since Cisco threat- suggest you read this interview at Wired ened to shut down the conference Lynn first re- (elfURL.com/141z). signed from his position at Internet Security Sys- tems but wouldn't back down from the presenta- I'm positive that if they hadn't made all this noise, tion. What was a sad example of bad PR is every- much less interest would have surrounded this thing that Cisco did. They instructed the people presentation. Immediately after the conference behind the conference to get the promotional ma- Cisco released a patch for the IOS vulnerability. terial and rip out the pages containing the slides of Lynn was hired by Juniper Networks in November. Lynn's presentation. So 1984 of them.

Common Vulnerability Scoring System allows IT managers to create a single standardized and prioritized ranking of security vulnerabilities across multiple vendors and platforms.

Common Vulnerability Scoring System proven that people can be caught and will be (CVSS) prosecuted. Also, MANY technology steps have been taken to reduce the likelihood one will even The issues surrounding the scoring of vulnerabili- see the phishing emails. There was a period of ties got a possible solution this year with the crea- time where some people were scared away from tion of the CVSS (first.org/cvss/). Gerhard Es- online commerce because of phishing but all indi- chelbeck said: "CVSS allows IT managers to cre- cations that there is limited "if any" impact at all." ate a single standardized and prioritized ranking of security vulnerabilities across multiple vendors Opinions on top problems in 2005 and platforms. CVSS is relevant in all stages of the vulnerability lifecycle, from the time a vulner- The security related event that defined 2005 ability is identified by a researcher to the time a vulnerability needs patching within an enterprise. Fyodor: "I think the continued rise of botnets has For computing the vulnerability score, CVSS con- been the year's greatest trend. The Honeynet Pro- siders not only the technical aspects of a vulner- ject has been researching these and identified ability, but also how widely a vulnerable technol- more than 100 botnets containing at least 226,585 ogy is deployed within an enterprise. A multitude unique compromised hosts. Much of this excellent of vendors have indicated their commitment to work was done by the German Honeynet Project, support CVSS in their products, and enterprises and we released a paper. In the months since are currently introducing CVSS into their environ- then, we've seen several people arrested for run- ments. By utilizing this scoring system, organiza- ning botnets of more than 100,000 machines tions can patch critical issues quicker, spending each. Increasingly, they have been using these for less resources on low priority issues." extortion: threatening crippling distributed denial of service (DDoS) attacks unless companies pay up." Phishing The biggest online security threats in 2005 This is the year when phishing stopped being con- fused with fishing and basically everyone knows Gerhard Eschelbeck: "The security research what it means. Howard Schmidt comments: "I community as well as vendors identify and publish agree that the number of phishing scams is on the on average 40 new security vulnerabilities per increase all indications are that LESS people are week. These vulnerabilities provide a multitude of falling for the scams. In some cases the interna- avenues for attack and originate from many differ- tional law enforcement have made arrests of peo- ent areas. Incorrectly configured systems, un- ple who are running these scams which has changed default passwords, product flaws, or missing security patches are among the most www.insecuremag.com 30 typical causes. Security vulnerabilities linger and Final thoughts consequently create a breeding ground for at- tacks, leading to security breaches. Improperly Was it worse than 2004? Better? Or did it just patched systems not only endanger themselves, evolve to what you expected a year ago? It de- but also put other users at risk. pends on how you look at it, how much influence a certain event had on your job, on your home com- It is not the security holes and vulnerabilities we puter or on your neighbor that just won't patch his know about and can respond to that are the big- machine and you have to help every weekend. We gest concern – it is the security holes and vulner- all rate the importance of an event based on how it abilities we do not know about and will be the tar- affected us. The industry will take care of itself. Its get of tomorrow." revenue has been rising every year and you can look at it like this - more incidents, more compli- ance or both.

Mirko Zorz is the Chief Editor of (IN)SECURE Magazine and Help Net Security (www.net-security.org).

www.insecuremag.com 31 Most IT administrators will agree that writing a security policy is like passing a kidney stone. It’s a glacially slow, excruciating process. And it’s even worse when it comes to dealing with handheld devices such as personal digital as- sistants (PDAs) and Smartphones. Unlike legacy platforms, we still haven’t found what the threats are to these powerful new devices. Worse, these tiny, embedded operating systems currently have little or no native security.

We have recently been helping a major telecom What is a Security Policy and why are they carrier in the USA create an enterprise security needed policy for 5.0 devices. But the lessons learned can apply broadly to other hand- A security policy can be defined as specific rules held platforms. or laws that are put in place by an organization’s management to ensure the security of information. This paper draws on our experience in the field, A security policy is essential for any organization but you should recognize our limitations, too. You from large commercial companies to small non- know your own systems better than we ever will. profit groups. We hope this template can help give you a head start. Most countries have laws that concern the privacy of its individual citizens; these laws are a factor in Note that if you are planning to roll out PDAs security policies. Other factors are the commercial across the enterprise, you will first need to invest sensitivity of information, national security and in 3rd party management software. personal security. Good security policies address all these factors. 95% of the large customers that we deal with use Intellisync. SOTI has a new program out as well Security policies are also essential for insurance (Mobicontrol), but they have not yet returned any purposes. Large insurers expect that a company of our requests for evaluation. Still, we respect will have done its very best to avoid an incident. their programming skills and we recommend you Security policies are necessary to prove this, in check them out. the same way insurance companies expect you to lock your house when you leave. We will begin with a general background, and will then provide you with the skeleton of a sample The ultimate responsibility lies with the CEO of template for your organization. any company. Her job is to ensure that the security policy is written to a professional standard. www.insecuremag.com 32 The CEO does not have to write the policy, but some useful information on Linux-specific tools she does have to ensure the quality of the policy. that can help protect against loss and theft - When the policy fails a company, it is ultimately tuxmobil.org/stolen_laptops.html the CEO who will shoulder the responsibility. The chief information officer should also have a great Replacing a stolen or lost device is not cheap; deal of input into the policy as it is his or her job to more importantly, the data on a device may be ir- be fully conversant with the information systems of replaceable, and security policy needs to reflect the organization. this. The small size of devices makes them easy targets for thieves. While it may be hard for a thief Policies require planning and research before they to stroll into an office and steal a desktop pc, a can be implemented. When researching what type Pocket PC can easily be removed without much of policy will be implemented in your organization effort. Misplacing a device is also relatively easy; it is important to consider the following factors: Security company PointSec conducted research into this and came up with astounding results. In • Threats: What are the potential threats faced by Chicago (United States), during the 6 months that the enterprise or mobile field you want to protect? the study was conducted, 85,619 mobile phones, A threat is something that has the potential to 21,460 PDAs/Pocket PCs, and 4,425 laptops damage. It can be an activity by a user or an event where left in the back of taxis. such as a virus infection (or even an earthquake). Employees need to be held responsible for their • Vulnerabilities: Does the mobile field you are try- device. Accidents can and do happen, but loss ing to protect have flaws that would allow an inter- can be minimized when staff are encouraged to nal or external attack? Does the operating system take ownership of their device. Stickers placed on frequently crash? Vulnerabilities pose a major the outside of the device with the owner’s details threat. Systems with very policies are only as can help the police or finder of a lost device to strong as their weakest flaw. It is important that contact the owner. If a device has proper security you fix all known vulnerabilities before implement- measures in place this may be the only way for ing policies. someone to find out who owns the device.

• Risk: A risk can be described as the likelihood of Proper physical storage of an unused device a threat occurring and the damage sustained by needs to also be addressed. This may seem a triv- an individual or company, financial or otherwise, ial issue, but don’t take it for granted that an em- from the occurrence of that threat. It is important ployee will know how to look after a device. Sim- to differentiate between likely threats and unlikely ple measures can extend the life of your mobile threats. device inventory.

Mobile devices have revolutionized that way that Data storage media needs to me secured. This people do business. Mobile phones in particular embraces all types of storage, either removable or are becoming increasingly common, not only for other. SD cards have the ability to hold gigabytes business users but for the ordinary householder. worth of data and they are the size of a postage With the increased advances in technology also stamp. The data on these devices is also vulner- come the increased risks of threats to the informa- able to damage by heat, RFI and electro magnetic tion that is stored and or passes through these damage. This needs to be addressed. devices. Protocols for data transfer need to be secured. With the emergence of malware for mobile de- Packet sniffing wifi transmissions can provide in- vices, companies and organizations are now being valuable information to a hacker or to a rival com- forced to adequately implement Mobile Device / pany. PDA security policies. Effective policies will ensure that the confidentiality, integrity and availability of How it needs to be secured: Access con- every individual device in the enterprise are main- trol and Authentication tained. The use of access control mechanisms among Implementation: What needs to be secured? your mobile device field is essential to prevent un- authorized access of data. Access control needs First and foremost the actual device needs to be to be strong and well tested. The device on a data secured physically. Theft and loss play a major is only as safe as the ability of someone to access factor in mobile device security breaches. Em- it. If strong access control software is used the ployee carelessness needs to be addressed along data remains relatively safe. with inventory control. The following URL has www.insecuremag.com 33 Authentication processes need to be easy to use the device. Thieves can use these codes to by- and not time consuming. End users are not inter- pass authentication measures and gain access to ested in security; they only want to be able to ac- the protected data. Essentially this is a backdoor cess their work easily. If the process is time con- to the data stored on the device. suming or difficult you may find that employee’s will look for ways of disabling the access control If you are worried that your device may have some mechanisms, thus defeating the whole purpose. sort of debugging feature it may be wise to contact the manufacturer, or even try to reverse engineer Consideration should also be made to the pre- it yourself. authentication state of the device. Some devices do have debugging features that can be accessed Authentication passwords should be changed by manufacturer codes. A lot of mobile phones regularly. Staff should be made aware of password have these debugging features hard coded into security issues including social engineering.

Encryption Firewall and IDS protection

Even if an attacker manages to break an access Just like a desktop machine, mobile devices are control system, properly encrypted data will pro- also vulnerable to remote attacks and intrusions. A tect it from being of any use. As with access con- proper firewall will protect not only the end users trol mechanisms, it is important to insure that the device, but also will protect any corporate network encryption process is not difficult for the end user to which this device has access. Hackers realize to use. Passwords and passphrases should be that a lot of mobile devices do not have firewalls. kept separate from the device; staff training will An unprotected device is literally a backdoor into help ensure this. your network.

Some security companies unwisely place hidden Firewall settings need to be easily administrated backdoors into their encryption software. Thor- and mandatory settings need to be fully transpar- oughly research the software you intend to use. ent. It may not be a good choice to allow employ- Do not take the software company’s word at face ees to access the firewall settings. Employees value: read newsgroups and forums of actual user who find the firewall hinders them may disable it or impressions. Backdoored software serves no pur- remove it altogether. It is also preferable that fire- pose to your organization; it may help in instances wall rulesets be updated regularly to include newly of lost passwords, but it will also help hackers at- discovered trojan ports and worm-vulnerable ports tain information and data. into the database until a fix is ready.

Countries such as the USA also have rules that IDS or intrusion detection system’s do not offer the pertain to the allowable encryption strength com- literal blocking that firewalls provide; they do, panies are allowed to export. It is best to research however, alert a user to an intrusion attempt. In- your options before you purchase; you might be trusion detection systems monitor file changes able to find stronger encryption solutions from less and security breaches: these are logged and can restrictive countries. One important factor to re- be reviewed by administrators. member is that buying software from companies that are not well established may not be advisable. IDS software is not common on mobile devices, If a company goes under (bankrupt) it may be im- but there are a few products around. Some antivi- possible to get further upgrades or technical sup- rus software also have IDS type functions and a port for your software. good IDS can help an administrator when it comes to advanced debugging of a device. www.insecuremag.com 34 Antivirus and Malware protection to stop it from retrieving confidential business documents. Normal synchronization software will Mobile devices are actively being targeted by allow the device to grab any new documents with- malware coders. The range of software available out checking if they are confidential or not. for mobile devices varies but software should be easy to use and not interfere with the end users’ The problem occurs when an employee takes his work. Mandatory settings should be enforced so or her device home and perhaps syncs it with their that end users cannot disable the antivirus soft- home computer. The confidential documents are ware. The software should also be easily update- now transferred to the user’s home machine, able preferably over the air. Malware protection which may not have the security mechanisms in should also include protection against web based place that the organizations computers do. It is malicious scripting. Some mobile devices are vul- wise to restrict the synchronization ability of de- nerable to these attacks. vices, and perhaps to not allow them to synchro- nize at all. Antivirus software should not try and detect mal- ware that does not target mobile devices. It is not Automatic, silent wifi synchronization should be sensible to detect desktop PC malware on a mo- disabled. If a device mistakenly synchronizes with bile device as these can not damage a mobile de- the wrong host computer, all sorts of problems vice. The company’s desktop PCs are protected could ensue. In general, this is not a major prob- with their own antivirus software. Scanning for lem, but for security reasons it is best to have this non-specific malware is a giant drain on resources disabled by default. of embedded devices. Staff Training Active scanning (“real time scanning”) for mali- cious files is a way to distinguish a good mobile Staff training is an essential aspect of all good pol- antivirus program from one that is mediocre. If the icy implementation. Make your training experi- software offers this benefit then it will probably ences enjoyable; don’t overload the staff with provide better security then “scan on demand” highly technical jargon. A system of friendly re- type programs. minders such as slogans printed on coffee cups is also an advantage. You walk a fine line, so be Data Erasure careful not to go overboard as staff members may switch off and become complacent. Data erasure software is required for all devices that handle confidential information. This software Proper staff training is also the best insurance should at least meet the US Department of De- against employee’s pleading ignorance to security fense guidelines as outlined at the following URL - measures. If that employee has been shown what www.dss.mil/isec/nispom_0195.htm to do, then the onus is on them in the event of a security breach or incident. This type of security will protect old data from be- ing retrieved, which is essential if your organiza- Strict policy guidelines should be made clearly tion sells its old devices to a third party. available to staff. Policies should be enforced us- ing a system of warnings. If a staff member re- Data erasure should also be controlled so that end ceived too many warnings against his or her name users do not accidentally wipe important informa- then it is probably time to let them go. tion. This can be addressed with restrictive set- tings as well as with staff training. Software should Mentoring systems can help new staff adjust to an also ask a user at least once if they really want to organizations security policy. New staff can be wipe the information. teamed up with responsible older staff from whom they can learn. It may be a good idea to rotate When purchasing data erasure software, make mentors so the new staff member does not pick up sure that the software lives up to the manufactur- bad habits. er’s claims. You should test it with proper forensic software to ensure that information or data is not Staff should be rewarded for good practice. Pay leaked. increases may not be financially viable, but it doesn’t cost anything to tell an employee that you Proper Synchronization Controls appreciate their adherence to company security policy. People like to be praised and happy em- When a device is synchronized with a workplace ployees are generally more likely to be security- computer it is vital that measures are put in place conscious. www.insecuremag.com 35 Mandatory Device Settings avoided. Mandatory device settings can stop un- authorized software from being installed. All devices in your mobile fleet should have man- datory security settings in place that are impossi- Mass Device Management ble to change by the average user. If the device does not need to be wifi aware, then this should You will find many tools on the market that allow be disabled, along with and infrared. for mass management of devices. This can allow Viruses such as Cabir exploit Bluetooth and simply the administration to implement security updates, disabling this feature will provide protection. as changes to the organizations policy are made. These tools can also push out virus definition up- If your employees have no reason to play media dates for antivirus software. files such as mp3’s, mpg’s, etc. it is recommended that media players be removed from the device. Mass device management ensures that all devices This not only stops the device being used as an are homogenized, and they protect a network from expensive mp3 player it also protects your organi- rogue devices that may have been modified by zation from potential legal problems often sur- staff members (e.g. devices with pirated games rounding these types of media files. installed, etc). Management software can also al- low administration to remotely control a device Malware has been found in pirated software for viewing its screen on a desktop PC. This type of mobile devices, especially software for Symbian administration is invasive but protection of com- mobile phones. It is imperative that employees are pany assets should be a main priority. fully educated on the risk involved in installing this type of software. As with mp3s, there is also a le- The following gives a sample template for you to gal aspect as to why these files should be start writing your own PDA security policy.

All devices in your mobile fleet should have mandatory security settings in place that are impossible to change by the average user.

Sample PDA security policy template the PDA policy by signing a copy of the policy, which will be placed in their administrative record. A. Purpose If a second violation occurs, the owner of the PDA This document outlines the accepted use policy will be given a second written warning, and asked related to personal digital assistant (PDA) devices. to remove the PDA from company property, or if Any existing user or future user of a PDA should the PDA is company property, then the device will acknowledge their understand of this document be taken from the violator. Any further violations of and that they will abide by its content. this policy will result in termination. Managerial approval is required for any second time violator to B. Definition of PDA be permitted to use a PDA on company property. A Personal Digital Assistant is any device that pro- vides a mobile handheld computing platform. In D. Policy Guidelines general, these devices contain the ability to keep The following section will outline the acceptable track of tasks, contact information, provide internet use guidelines that apply to PDA devices. This in- and email access, in addition to various other fea- cludes synchronization procedure, data storage tures, such as games, music, time keeping, and and encryption, network use, authentication/ more. Common devices include, but are not lim- identification measures, and loss of control guide- ited to, the Palm, Treo, Blackberry, Compaq iPaq lines. and Axim. Some PDAs are merged with other mobile devices, such as a GPS or Cell phone, 1. Data Storage - A PDA can store data in persis- which are also considered applicable for this pol- tent memory, external storage (ie. Compact icy. Flash), or internal RAM. Each of these types of memory present a security challenge that will be C. Failure to Comply with Policy covered in this section Upon the first violation of this policy, the PDA owner will be given a written warning of their in- a. Internal RAM: All sensitive data in use must be fraction, and be required to read and acknowledge stored in this part of the memory while decrypted. www.insecuremag.com 36 D. Policy Guidelines the incident. An inventory of programs and data The following section will outline the acceptable must also be included with the report. use guidelines that apply to PDA devices. This in- cludes synchronization procedure, data storage 5. Third Party Applications - Only approved third and encryption, network use, authentication/ party applications can be installed on PDA’s. The identification measures, and loss of control guide- approved list can be obtained by contacting your lines. IT department. If there is a desired program that is not on the list, a request can be submitted to the 1. Data Storage - A PDA can store data in persis- IT department. If the program meets internal test- tent memory, external storage (ie. Compact ing requirements (stability/security), it will be Flash), or internal RAM. Each of these types of added and at that point it can be installed. memory present a security challenge that will be covered in this section 6. Synchronization - Synchronization of the PDA to the host PC can only occur locally or via a secure a. Internal RAM: All sensitive data in use must be connection to the company. stored in this part of the memory while decrypted. E. 3rd party security software b. Persistent Memory: This part of memory main- 1. VPN - A VPN is required to connect from the tains it status in the even of a loss of power, which handheld to the corporate environment from out- eliminates the need for reinstallation if there is a side. This includes remote email, remote sync, etc. loss of power. PDA owners can install their appli- cations in this section of memory, as long as no 2. Encryption - Encryption software should con- sensitive data is stored in the program directories. form to currently accepted, strong cryptographic algorithms c. External Memory: External memory is only to be used for data that has no security risk (ie. Music). 3. Data Wiping - Any encryption program should If data is encrypted according to policy require- likewise include a security file-overwriter/data ments, this section of memory can be used to wiper. This secure bit-overwriting must conform to store that information, this includes encrypted DoD standards (up to seven passes of secure file backup files. overwriting) and must allow wiping of internal and external memory cards as well. 2. Network Use (Email/Internet/Etc.) - The PDA may be used to access web sites provided the 4. No hard reset code - Security software will not content is not a security risk. Email may be down- implement remote hard reset ability. Bit wiping of loaded to the PDA over a security link. The secu- RAM with a remote hard reset is now considered rity link should consist of a VPN connection to the an obsolete security practice, and may actually company network, or via an SSL protected con- increase the danger from worm attacks. nection to the secure website. Use of public hot- pots is acceptable only for generic web browsing. 5. Firewall - A host-based personal firewall is mandatory on all PDAs. 3. Authentication/Identification - Each PDA device must have an alphanumeric login enabled. The 6. Antivirus - Virus scanning programs, updated password must contain letters and numbers. In regularly, are required on all PDAs. addition, there must be a check in place to prevent brute force password guessing. 7. Remote security management - Security soft- ware must provide central control policy that al- 4. Loss of Control (Lost or stolen device) - In the lows the administrator to set features such as fre- even that a PDA is lost or stolen, the owner must quency of virus signature updates, remote change immediately contact the IT department and report of firewall rules, enforcing password strength, etc.

This paper completes our rather long, three-part The field is evolving rapidly so we hope you will series on handheld security written for (IN)SE- keep up with our blogs and news releases at CURE Magazine. www.airscanner.com.

Jon Read, CISSP, Seth Fogie, and Cyrus Peikari are members of the Airscanner Mobile Security Team. They focus on exploring security threats and on reverse engineering malware for embedded and handheld wireless platforms. www.insecuremag.com 37

Access control using authentication and authorization works well for limiting how people use digital resources in a controlled environment, such as the corporate network. But traditional access control schemes do not work as well when the people or resources are outside of the organization's direct control.

Documents released under non-disclosure competitor, the premature release of financial data agreements illustrate this problem. Once the to an analyst or market, or the leak of embarrass- document has been released to someone outside ing information to the media. Digital leakage oc- your organization, that person could make unlim- curs from seven primary sources: ited copies, send the document to your competitor, and so on. Encrypting or password protecting the • Employees sometimes steal valuable confiden- document does little to deter this unwanted behav- tial information for personal use or to sell. ior, because the person receiving the document • Confidential information is sometimes acciden- must unlock it to use it. The authorization schemes tally distributed. This can happen when an email we've discussed don't address the problem either, containing confidential data is addressed to the because access control depends on a trusted en- wrong person. vironment. Absent another solution, we're left with • Computer theft and hacking results in the re- trust and legal remedies. lease of confidential data despite the best efforts of computer security professionals. Digital rights management (DRM) is an attempt to • Employees, partners, and customers often do address these problems. Rather than merely con- not understand the real value of information that trolling the actions that an entity can perform on your organization has shared with them and do digital resources, DRM provides mechanisms for not adequately protect it. controlling the particular uses to which a digital • Changing alliances result when relationships be- resource can be put. This is a tough problem, and tween the organization and employees, partners, as we'll see, good solutions are sufficiently draco- and customers end, leaving these entities in pos- nian that they impose a significant burden on us- session of information to which they are no longer ers and have raised the ire of digital rights activ- entitled. ists. • Lost or stolen devices can result in the loss of information more valuable than the device itself. Digital Leakage Often, companies sell used computers that con- tain confidential data. Digital leakage is the loss, whether intentional or • Disgruntled employees and others may mali- inadvertent, of confidential data in digital form. The ciously redistribute or otherwise release confiden- loss might take the form of a trade secret sent to a tial information. www.insecuremag.com 39 Digital leakage is costly. A survey published by allow a purchaser to listen to the song in an unlim- PricewaterhouseCoopers and the American Soci- ited way on up to three computers and to burn the ety for in Industrial Security in 1999 found that on song to a CD. average, large organizations lost confidential or proprietary information 2.45 times in a year and This set of rights was chosen to try to match the each incident cost an average of $500,000. The value that user's place on the audio file to the survey estimated that the cost of digital leakage in price Apple wanted to charge. For example, Apple the Fortune 1000 in a single year was $45 billion. could disallow burning AAC format songs to CD, because they control the client, but that would de- The DRM Battle crease the value of the file for many people.

With those kinds of statistics, you'd think DRM Apple also has to be able to administer rights re- would be a technology that everyone could love, motely to provide customer service. For example, but it has been at the heart of some of the most if I purchased a song, installed it on three comput- acrimonious debates of the digital age. The movie ers, and then sold one of those computers and and recording industries are worried that elec- bought another, I can contact Apple to have the tronic distribution of their works will result in viola- rights reset on my music collection, allowing it to tions of their copyrights and, as a result, diminish be installed on my new computer. Without this their bottom line. ability, audio files purchased on iTunes would quickly lose their value as people upgraded their This is a classical problem for digital rights man- computers. agement. The producers of the digital goods want to release them to people beyond their control and This case study is a good example of the addi- give them only specific rights (e.g., to listen to, but tional burden placed on a company in controlling not copy, the music). access to content using DRM. Restricting rights for content costs real money, because the content The problem is that the needs of the copyright has to be administered and it reduces the value of holders are in direct conflict with the wants of their the content to users. customers. Consumers of movies and songs want open access, open formats, and access to works Features of DRM no longer for sale in traditional distribution chan- nels. Napster illustrated the powerful drivers in this Digital rights management is, of course, about market. People want to be able to share music more than just protecting music and movies. DRM and movies with others. is a technology all of us would like to use in certain circumstances. For example, when I send my So- Needless to say, this is a complex issue. The rea- cial Security Number to my bank, I'd like to be able son for bringing it up here is that the battle over to control how it is used. As another example, copying movies and music has colored many peo- wouldn't it be nice to be able to send your credit ple's view of DRM and created an atmosphere card number to an online merchant and attach where any discussion of DRM creates strong feel- specific rights to it: the right to use it to facilitate a ings. DRM might be the right technology for solv- single purchase and not be stored or transferred. ing critical access-control problems for your or- All of us have digital information that we'd like to ganization's digital resources. Unfortunately, DRM be able to send to someone else without giving has become synonymous with the battle over them unlimited rights. copyrighted music and movies. You can probably avoid the DRM battle and the emotions it engen- SealedMedia, a DRM vendor, lists some important ders if your motive is to control activities on digital features that DRM systems should have to be ef- resources rather than to use DRM as part of a fective. business plan that restricts customer actions. • Persistent security, wherever the digital resource Apple iTunes: A Case Study in DRM exists. • Separation of right of access from the informa- Apple's iTunes and its associated music store pro- tion itself. vide a real-world example of DRM in action. • Management of discrete rights (viewing, printing, iTunes will play unprotected MP3 format audio editing, print-screen). files, but when a user purchases music form the • Dynamic allocation and withdrawal of rights. Apple music store, the audio file is downloaded in • Support for both online and offline work. a format called AAC. Apple wraps the AAC file in a • Audit trail of actions and activities performed on DRM system called Fairplay. The standard rights the document. www.insecuremag.com 40 • Support for multiple common document formats tion invoked on behalf of the person who owns or using the same security tools. controls the rights associated with the good. The • Simple integration with existing workflow and license server and content server might be oper- applications. ated by the same entity or they might not. For ex- • Integration with document/content management ample, the owner of the goods may contract with systems. multiple distributors to supply the good but control the licensing centrally. A perfect DRM system with all of these features does not exist. You will likely have to prioritize In the reference architecture, the client, on behalf these properties for your particular application and of the user, requests a specific resource from the evaluate solutions on that basis. The next section content server. The content server uses a content describes a reference architecture that shows how repository along with product information to create some of these features can be accommodated. a content package. The content repository might be part of the content server itself or a standalone DRM Reference Architecture content management system. The product infor- mation specifies price and other product-specific Figure 1 shows a reference architecture for a digi- information. It makes sense to separate the prod- tal rights management system. The reference ar- uct information from the content, because the chitecture is by Bill Rosenblatt, et al., and is dis- same content may be sold as different products cussed in some detail in the book Digital Rights differentiated by customer class, additional serv- Management: Business and Technology (John ices or warranties, and so on. Wiley & Sons). The reference architecture points out the key interactions in a DRM system and also The content is delivered in an encrypted content exposes some of the weaknesses in current DRM package that contains both the content and meta- schemes. data. Whether the content is streamed or deliv- ered as a single package is inconsequential to our In Figure 1, there are three primary participants. discussion. The metadata usually includes infor- The client is an application invoked on behalf of mation such as title, author, rights holder, and the entity wanting to access and use a digital re- other information about the content as well as in- source. The content server is the application that formation that uniquely identifies this content and is invoked on behalf of the entity supplying the transaction. digital resource. The license server is the applica-

Figure 1. A DRM reference architecture www.insecuremag.com 41 The DRM controller (2) contacts the license server directed to a use that wasn't specifically author- (3) associated with the content package to retrieve ized. a license for the content. The DRM controller sends the license server information about the The iTunes example illustrates some of the prob- content package and the identity credentials for lems: the entity that invoked it. • Once an audio file has been put on a CD, it can The license server checks the identity credentials be ripped in another format, such as MP3, without (4) using whatever identity infrastructure is avail- any DRM, because the DRM wrapper can't be able to it for authentication and then consults a transferred to the CD. rights database (5) for authorization. We'll see an • Remote rights administration, needed for cus- example of an XML language for expressing rights tomer service, opens up further opportunities for later in this chapter. people to exploit the system and get around DRM. • The Fairplay system has been cracked, and There may be a financial transaction (6) if the user methods for playing Fairplay-protected files out- is required to pay for the license. Alternately, the side of iTunes have been published on the Inter- license server may require some other considera- net. tion such as registering and providing contact in- • Even if all of these problems were solved, the formation. Once consideration for the license has analog feed going to the speakers could always been received, encryption keys (7) are retrieved be redirected to a recording device, and the audio based on the content package identity and these file could be re-encoded in another format. keys are used to generate a license that is sent back to the DRM controller (8) as an encrypted These examples show just how hard it is to really package containing a statement of rights and a set protect content in a digital format. In addition to of keys for unlocking the content package. The the tradeoffs made by Apple that were examined license is encrypted to protect the keys used to in the case study, Apple is inconveniencing their unlock the content package and to ensure its in- legitimate users while still allowing the rights of tegrity. The DRM controller decrypts the license copyright holders to be undermined by determined and uses the keys contained in it to unlock the crackers. content. The content can be sent to a rendering application (9) for display (10). These problems have led to numerous calls for trusted computing platforms that would ensure The client, in managing rights, may store informa- that the DRM client was run in an environment tion about usage in the content package. Usage that kept even determined attackers from gaining data is stored with the package, rather than sepa- access to protected content illegitimately. The ba- rately, to ensure that even if the content package sic idea is to protect every component of the end- and license are moved to another client, the usage user system in a way that disallows illegitimate restrictions are honored and audit trails are con- use. When we say "every component," we're be- tinuous. ing literal - right down to the keyboard. Building a trusted computing platform requires the coopera- The client application is a critical component in tion and coordination of both hardware and soft- this scheme, because the client application, rather ware manufacturers in very sophisticated way. than the client, receives and processes the keys. This overcomes, in part, the problem of a user un- The nature of trusted computing systems and the locking the digital content and then using it in an debate surrounding them is beyond the scope of uncontrolled fashion, because the client applica- this article, but they are being advanced by com- tion can ensure the permissions carried in the li- panies as powerful as Microsoft and and cense are honored. countered by numerous user advocacy groups. Because trusted computing platforms are still in Trusted Computing Platforms the future, DRM will remain an exercise in making the theft of unauthorized rights sufficiently incon- If you were applying a little creative thinking during venient that most users will only access content the preceding discussion of the DRM reference legitimately. architecture, you probably thought of several ways that the scheme could be defeated. That issue is Specifying Rights the chief weakness of DRM. As we've seen, for the user to view or otherwise use the content, it One of the most important features of a DRM sys- has to be rendered in a usable format, and that tem is the ability to specify and manage rights. allows ample opportunity for the content to be re- Rights are a special kind of authorization. www.insecuremag.com 42 The differences lie in the fact that DRM is meant to statement is to protect content that is not directly restrict actions on a much finer-grained scale than under our control, the rights will generally be sent we typically deal with in a standard authorization outside the systems we directly control to some system. Authorization rights typically center other system that will enforce them. Offline access around whether a subject is allowed to read, mod- to protected content is usually a requirement, and ify, or create objects. As we saw, we usually spec- so it is not practical for the client application to ify the rights for classes of users against classes check back with the license server each time the of objects in order to make the task manageable. content is accessed. Thus, rights can be difficult or In DRM, we often want to give specific rights (for impossible to revoke once they've been issued. example, the right to view but not copy) to specific people (Ted in accounting or a particular cus- XrML tomer) for specific time periods (for the next two hours or three more times). That makes the task There are several proprietary DRM systems and much more difficult. The problem can be made most of them have proprietary languages or sys- tractable by being able to build general licenses tems for specifying rights. XrML is an XML-based and derive specific licenses from them automati- rights management language. We'll discuss it cally. briefly because it is gaining widespread accep- tance as an open format for specifying rights and Separating authorization rights from the objects because it illuminates the kinds of features that being protected increases the ability of operators you want in a rights language. XrML is a large to take protective action. Specifically, when rights standard, and this section is not intended to be a are associated with objects, removing rights for a tutorial. More detailed information on the XrML particular user means visiting each object the user standard can be found at xrml.org. The examples might have had rights to. The goal of systems like given here are based on the Example Use Cases RBAC is to specify rights separately, so we can document that accompanies the XrML 2.0 specifi- remove access rights across the board with a sin- cation. The following simple example gives us a gle, reliable action. feel for XrML. In English, the license grants a spe- cific RSA public-key holder the right to print the In DRM systems, the nature of the problem does contents of an object identified by a URI as many not make this solution possible. Since our problem times as she wants before Christmas day, 2005.

Fa7wo6NYf... AQABAA= =

Excerpted from “Digital Identity” by Phil Windley, (ISBN: 0-596-00878-3). Copyright 2005, O'Reilly Media, Inc. www.oreilly.com All rights reserved.

www.insecuremag.com 44 WINDOWS - Deep Network Analyzer http://www.net-security.org/software.php?id=646

DNA (Deep Network Analyzer) is an open, flexible, and extensible deep network analyzer server and soft- ware architecture for passively gathering and analyzing network packets, network sessions, and applica- tions protocols.

LINUX - ProShield http://www.net-security.org/software.php?id=282

ProShield is a security program for Debian Linux. It helps ensure your system is secure and up-to-date by checking many different aspects of your system. Regular use is recommended.

MAC OS X - Fugu http://www.net-security.org/software.php?id=629

Fugu allows you to take advantage of SFTP's security without having to sacrifice the ease of use found in a GUI. Fugu also includes support for SCP file transfers, and the ability to create secure tunnels via SSH.

POCKET PC - AirFix http://www.net-security.org/software.php?id=647

With the release of ActiveSync 4.0, you can no longer maintain a network connection while synced. Ac- cording to Microsoft, they removed this useful feature because some corporate customers had thought it was a security risk. However, Airscanner believe that taking it out is a much greater risk. The result of this feature removal is that any ActiveSync session (via Bluetooth, IR, or USB) will immediately disable your network connection. AirFix will give the control back to you, which is where it belongs.

If you want your software title included in the HNS Software Database e-mail us at [email protected] www.insecuremag.com 45 2005 was a banner year for high-profile big money security breaches. One vio- lated company after another notified law enforcement while news trickled to the press in slow and reluctant batches. Called into question were manage- ment styles, internal process, security infrastructure, lack of vigilance, dili- gence and common sense. While companies struggle with break-ins, hijacks, and nearly invisible infiltration the ever expanding legions of would-be cyber thieves are gearing up for their next attack.

In recent years we’ve given excess weight to the last year is not so golden by this year’s standards. criminal element – making them bigger, stronger According to Bindview’s RAZOR research team - a and more intelligent than normal folk. In fact, re- group of people focused on incorporating the lat- search shows that today’s cyber-crime is most of- est up-to-date changes in the threat, vulnerability, ten perpetrated by a far less threatening group - and regulatory landscape into Bindview’s products the everyman. - Credit card numbers that were worth approxi- mately $25 each wholesale and $100 each retail Once the domain of savvy hackers and progres- in 2002 are now worth $1-$5 wholesale and $10- sive crime lords, online crime is now anybody’s $25 retail. Where identities used to net a tidy game. Online crime has quickly devolved from an profit, email addresses and letters of credit are elitist game of network infiltration to plug-and-play gaining ground. theft kits readily available to anyone that’s inter- ested. Ease and accessibility make the buying and A fly-by-night hacker could easily procure tens of selling of illicit information increasingly attractive. thousands of email addresses in one night of fo- cused pharming and a well-programmed bot could Forward thinking criminals have long used the find many more. Each email address netting be- evolution of technology to their advantage, up- tween $.01 and $.05 cents per name adds up to a grading their nefarious activities in line with com- tidy sum by the end of the take. pany upgrades of applications. Joining their ranks are those with time on their hands and the new- The cyber criminal profile is rapidly shifting from found means to dig up data. the devious black hat to the enterprising capitalist.

Much like the magic pyramid, hackers, phishers, “The ease with which data can be stolen depends crackers and social engineers recruit others to on the tools being used and the thief’s level of so- help them build their wealth. The buying and sell- phistication in traversing through the network,” ing of products is buoyed by the black market’s says Jim Hurley, Senior Director, RAZOR Re- supply and demand. If it’s valuable, it can be search, for Houston, Texas-based Bindview, “Cre- taken, if it’s taken, it’s for sale. Yet even criminal ating a breach ranges in difficulty from been inti- consumers are a fickle bunch. What was popular mately familiar with the innards of OS design, www.insecuremag.com 46 construction and network protocols to having ab- Tools of the Trade solutely no knowledge - because you don’t need it with the vast availability of pre-built tools.” According to a recent presentation by Hurley at the Computer Security Institute’s 32nd Annual “Sniffers, keyloggers, rootkits, loaders, Trojans Conference in Washington D.C., Windows and and virus kits are but a few of the many offerings Linux tools enable a vast amount of attacks using on thousands of accessible sites” he adds. the Least Common Denominator (LCD) approach. A snapshot of the choices include:

Ping Whois Finger Traceroute

Dig Host DNSwalk Netstat

Procman Portscan NBscan SNMPAudit

NMBlookup Who Route Rsh

ARP Rarp Nmap NDIS

Promiscuous mode Rsh Useradd/mod

Sniffers provide a whole different realm of opportunity with tools such as:

NetBus Strobe Msscan SATAN SAINT

SARA Nmap Super Scan Stealth Back Orifice

Win scan Port Scan Airsnort Snort Proxy Hunter

Snare Honeyd Nessus ScanIP Tcpdump

Windump Whisker IP Tracer Kismet FTP scanner

Keyloggers and crackers, often used by criminals with a more hearty technical background can in- clude:

KLOG BIOS cracker CMOS killer

Home page worm mailer generators MS Word cracker VNC cracker

Linux W0rmxx.xn generators Brutus PwDUMP

IRC worm generators SID tracer SID dump

Firewalk - ACLs on network devices Rainbow Tables/Crack

l0pht SID2USER (USER2SID)

John the Ripper Brute force Chntpwd

Trojans are used by more sophisticated black marketers and readily available examples include:

Sub Seven Sub7CRK Sub7PC Rat Cracker Back Orifice

Silk Rope Netbus Moosoft Admin Trojan AcidSchivers www.insecuremag.com 47 Boing GRUB VICE Infiltrator Deep Throat

Apache BD Evil Hack Attack NetController

SubRoot Telnet Trojan Donald Dick

Determined criminal programmers have easy ac- They’re not in the business of stealing things and cess to ready-made worms and rootkits waiting for they’re not hackers,” says Hurley, “It’s best to think their creative skill set to turn them loose. Exam- of them as a fence between the buyer and the ples include: seller. They’re not technologists and they don’t care to be, they just want to make sure that their • VBS worm generators activities are not traceable and these are the or- • Home page worm mailer generators ganizations that are operating around the world.” • Linux W0rmxx.xn generators • IRC worm generators So what’s for sale in this more accessible market? • Firewalk – determines ACLs on network devices Falsified deeds, birth and death records, letters of • FU credit, health insurance cards, source code, di- • Shadow Walker plomas and even people are available for the right • LRK 5 price. The anonymity and relative ease of criminal • Adore LKM activity is gaining in attractiveness to the barely • Adore BSD skilled programmers looking to cash in. • Knark • Root evil The modus operandi of today’s cyber criminal in- • Adore MS cludes commonly known tricks of the trade, start- ing with the path of least resistance, i.e., social In the recent past online theft and criminal activity engineering. relating the Web poured forth from highly ad- vanced or conversely, severely disadvantaged na- According to Hurley, criminals go after their victims tions – but today’s online crime is far from country using a predictable set of steps: reconnaissance, specific. Just as online auctions launched a flurry target, evaluate the environment, install new serv- of overnight entrepreneurs, so has the availability ice or backdoor, cover your tracks, hit pay dirt and of criminal source kits. run or decide to hang around to exploit and reuse the target, keep ownership of the device - or not, Once a realm that depended on well-cultivated and then move on to the next victim. contacts between buyers and sellers, today’s on- line black market requires little more than access With so much information so relatively easy to get to Web sites, bulletin boards, IM, email and cell to, it’s a feast of sorts for the would-be Web Mob- phones. If its volume sales they’re looking for, the ber. Using established channels spanning interna- first stop is the lucrative Web auction ring. tional date lines, and employing thousands of zombie machines, it’s more difficult than ever to Well-organized Web Mobs run in a similar vein to locate these extensive criminal networks but eas- organized crime families. They’re efficient ma- ier than expected to join one. chines that include many layers of people perform- ing very specific roles and functions. From the top So what can be done to protect ourselves from down they include the inner ring, evaluators, in- this type of infiltration? spectors, enforcers/contacts, trusted fences and the buyer and seller. “There’s what I’ll call best practices and then there’s reality. Based on our research over the Web Mobs have proved to be a very nasty prob- past 2-3 years there are significant differences in lem for Federal and international investigators due performance results that companies are experi- to their cross-country logistics and distributed op- encing with their security programs based on a erations. Once sufficient evidence has been gath- number of factors such as the strategic actions ered to crack an auction ring, authorities must they take, how they’re organized and structured to work within international boundaries, time zones deal a breach, how they share data and knowl- and with foreign legal statutes to make an arrest. edge to minimize security losses, the procedures they use, their policies, and how much active em- “What’s not well known is the scope, intelligence ployee training they do,” says Hurley. and capabilities of these Web auction rings. www.insecuremag.com 48 “There’s a whole lot of different things that distin- Although international governments have joined guish one company’s performance results from forces to dismember online Web Mobs, they con- another. There are some common things that are tinually form and disband in a constant game of done very well among the best class enterprises hide and seek. With many thousands of converts, that are suffering the least amount of breaches the seething side of the Web is a thriving economy and damages but even having said that, there’s for those willing to cross over to the dark side. probably no way to defeat a serious security threat While our indictments are a win, we’ve only just today and it wouldn’t matter what the tool is. The touched the iceberg. only way to do it would be to unplug the comput- ers.” Melisa Bleasdale would like to thank Jim Hurley, Senior Director, RAZOR Research, Bindview According to Hurley, the firms that have a good (www.bindview.com) and Executive VP of Re- chance of avoiding victimization are the ones with search for Security Compliance.com for providing a very active risk management program in place, access to his presentation “The Not-So- “An executive team devoted to solving security Unorganized World of Online Crime” which sup- issues, where the IT security function isn’t buried plied the statistics and framework presented in this in a hole somewhere in IT but rather implemented article. as far as a risk management function, cross- company and cross-functional.”

Melisa Bleasdale is a San Francisco area communications consultant and strategist specializing in the security industry. Her focus is on emerging and innovative security technology, current events and market concerns. Visit www.superheated.com to find out more about Melisa.

www.insecuremag.com 49 More than ever, today, the battle for security is played on the application field.

Years ago, attacking Windows 95 or 98 boxes was granted. Developers sometimes don't check appli- not that easy. Few network services to target, few cations inputs, assuming users will provide data in complex networking applications to pull about. In- the correct form, and malformed inputs crash their stead of exploiting those, attackers considered as applications, and in some cases give access to the best way to reach their victims was creating the underlying system with full permissions. These new engaging points. So Trojan horses like Sub- validation input errors are quite probable in mod- Seven started spreading on Windows, arriving ern networked applications. The more complex the mainly by e-mail and chat file exchanges. application, the easier it will be to forget some- thing. Even if today's vendors apply secure devel- Since that time a lot of things changed: the firewall opment frameworks to reduce errors, we'll likely “culture” reached the masses, new and improved have to handle validation input errors for many security tools were developed, modern Windows years to come. operating systems got a huge amount of network services, every application became network ori- How Hardening Can Help ented, people’s security awareness increased. Now, with Trojan horses no more effective, attack- The best way to mitigate the inherent application ers needed to find a new way to reach targets. insecurity is to harden our systems, hoping end- Fortunately for malicious users, Windows 2000 point security methods will soon offer something and XP offer a large number of services ready to more defenses. receive malicious input and provide unauthorized access. Not to mention the thousands of applica- Hardening means reducing the amount of services tions, from news aggregators to P2P clients and listening on the system, the amount of installed MMORPG games, where one could use to send applications and the way applications handle in- malformed network traffic in order to gain remote puts. In other terms hardening means reducing the computer control. attack surface area. Typically hardening is some- thing applied to Operating Systems but it should The days of Trojan horses are not over yet but the be considered an approach valuable with any large majority of attacks are now based on exploit- back-end server and desktop application as well. ing application vulnerabilities. Why? Have devel- opers started producing more insecure applica- Today we have hardening guidelines written by tions? No, quite the opposite. The attackers fo- well-known security experts and organizations cused on them, plainly exposing what has always (like NIST), and have partially automated harden- been there - crucial development errors. ing tools, covering several aspects of an OS. Mi- Development errors are here and will most cer- crosoft released its official tool for hardening within tainly always exist. They are the product of a typi- the Windows Server 2003 Service Pack 1: Secu cal human brain behavior: taking things for rity Configuration Wizard (SCW) that addresses a www.insecuremag.com 50 lot of problems. Other OSes have their semi- and will require a lot of time and testing before automated hardening tools like JASS for Sun So- reaching optimal configurations. laris or Bastille for Red Hat Linux distributions. SCW explains every setting and therefore enables Hardening Can Be A Risky Business the user to make the correct choice and becomes a sort of a learning too. Hardening practices exist since a lot of years but are hard to apply. Before stopping a service or SCW also offers a rollback feature, able to revert modifying a registry key, people should have a your system to its pre-hardening state. This fea- deep knowledge of the system. And even in that ture is a must-have since troubleshooting a prob- case, a hardening set of modifications could break lematic service or application after a hardening an installed application, requiring infrequent ac- can be highly complex. When something you dis- cess to what you disabled. A hardened configura- abled or removed prevents the proper starting of a tion could work for a system doing a specific task depended service, it's not always reported on the and not for another. Every platform needs its Windows event log, or if reported, it's not always hardening tuning which is time-consuming and declared in a clearly. Starting back from a working error-prone. Just consider that even when harden- environment can save a lot of time and availability ing two identical systems you can always miss problems, otherwise the rollback feature always something. And if the platform role or base of in- summarizes how the previous state was config- stalled application changes, you'll need to review ured, so you could eventually invoke it just to the hardening procedure and adjust it accordingly. check and find where the problems could lay. It's a hard security life-cycle to achieve, even on a small server farm. One of the best parts of SCW is its configuration file. When you finish producing your hardening The bottom line is that hardening a system can template it's saved as an XML file. This permits invalidate vendor support for an installed product you to deploy it on every single machine in your because it essentially changes the supported envi- server farm equipped with SCW, without restarting ronment. the template creation process, avoiding mistyping errors and saving lot of time. The whole procedure Exploring the SCW is done just typing a single command:

SCW lets you approach hardening in two ways: scwcmd.exe configure /p:my_policy.xml per-role or custom. If you work in an Active Directory environment you

can assign the XML configuration file to a Group Hardening with a per-role approach means you Policy and deliver hardening to all servers within just explain the wizard what servers and applica- an Organizational Unit (OU) at once. tions your operating system is going to run. For example, you can choose to declare the SQL SCW is distributed as free tool but it won't work on Server 2000 role and the ISA Server 2004 anything but Windows Server 2003 SP1 platforms. role, but also to declare the system will act as a A bad decision from Microsoft that hopefully will DNS client. Depending on which roles you se- change its mind for the next version. lected the wizard will submit you a hardened con- figuration where unneeded services are stopped and registry keys are disabled. This is the best Best practices way to start with for a hardening novice. Even if SCW greatly simplifies the hardening pro- Hardening with a custom approach means you cedure, many things can go wrong. Before hard- details every single setting modification of your ening a system be sure to study and check service system. The resulting configuration will be a dependencies and applications needs. Custom hybrid-role model tailored for a specific environ- applications are particularly important to verify. ment. This is the expert way to work with the SCW and should be adopted carefully. In Active Directory environments, a hardening configuration applied to apparently similar servers Services and registry keys aren't the only settings can produce different results and eventually cause SCW can modify. You'll be asked to choose how to services down-time (for example because similar setup Local Policies, IPSec filters, Windows Fire- servers weren't installed in unattended ways). wall ingress filters and IIS web extensions (if you So, if you want to deploy the SCW template to a are going to harden a web server). The whole whole OU, you better define a subset of hardening amount of things you can control is impressive modifications, commons to every OU member and then apply specific hardening settings to every www.insecuremag.com 51 single server. Do a lot of testing in a lab environ- Conclusion ment with cloned productions servers before de- ploying SCW templates. SCW is a great step forward in securing Windows platforms. It does the large part of the job, offers Remember to document every choice and update you a basic documentation of what you're modify- documentation on changes. ing and addresses some distribution problems you'll have when dealing with multiple servers. Finally plan a periodical review of hardening tem- plates to adapt them with new knowledge and new It requires a good knowledge of Windows behavior needs. and a fair amount of testing before deploying in production. I'd still consider it a tool for experts.

Alessandro Perilli ([email protected]) is founder of False Negatives (falsenegatives.com) and the technology focused blogs Security Zero (securityzero.com) and virtualization.info.

www.insecuremag.com 52 There is no need to give any statistics to claim that spam is now a real and important problem in computing. It is a pain for everyone, even for my grandmother, and this threat is universal and cross-platform. It has conse- quences on many levels and affects different people in many ways.

There is no need to give any statistics to claim that late directly into lowered risks of early infection by spam is now a real and important problem in com- new strains of virus, even if they’re used without puting. It is a pain for everyone, even for my an anti-virus engine. grandmother, and this threat is universal and cross-platform. It has consequences on many lev- Law/Ethics els and affects different people in many ways. For individuals, the consequences are difficult to as- This aspect of spam is often overlooked but is sess, but for a business they are clearly harmful quite significant. In particular, messages leading to on many levels: Management/Financial, Law/ an ethical/legal consequence are those that con- Ethics, Technical. tain pornographic content. Another type that is growing faster than any e-mail-related malware is I’ll quickly go through some “grey-suit” content, so fraud or phishing. See www.antiphishing.org for if you want to go directly to the technical details, details. Many spam filters and anti-virus engines feel free to skip to the “Installing a spam-filtering (ClamAV) can detect phishing characteristics in a server with MailScanner” section. I added this message. Without being used exclusively for managerial-related content mainly because I spam, address forgery (using a false address to wanted to offer technical persons some arguments send an e-mail) can harm an organization’s repu- to convince their manager/clients that spam- tation. These elements are all ‘contingencies’ but filtering is needed and will reduce costs in the end. when they hit an organization their impact can be financially and operationally large. Management/Financial Technical The most evident consequence of spam is loss of productivity and employee frustration. An organi- It is becoming harder than ever to live without zation of 100 employees who each receive 10 spam filtering. In medium to large organizations spam messages per day will cost approximately the most cost-effective method for spam-filtering is $1300 yearly in lost productivity (Google for “spam on the server side, whether internal or outsourced cost calculator” to get numbers from different (spam-filtering service). Individual or small busi- sources). 100 employees? $13 000. You get the nesses will usually rely on the usually not-very- picture? There is also a chance of discarding le- effective ISP spam filters or try client-side soft- gitimate messages, for which the cost could be a ware. Be it client- or server-based, adding new lot higher. It is easy to conclude that most spam- technology in an organization always means in- filtering solutions pay for themselves fairly quickly, creased monetary costs as well as increased soft especially when used together with virus filtering. costs incurred in teaching employees how to use Since many modern viruses can be detected by new tools. spam filters, having spam filtering systems trans- www.insecuremag.com 53 Client-side spam-filtering solutions usually show a first receives the messages and queues them. lower initial cost than server-side solutions. How- MailScanner then picks the messages in the in- ever, they can be more complex to install and coming queue and will process them (spam/virus/ maintain in an organization with more than 10 cli- threat detection) and will drop them in the outgo- ents unless it is provided with a management con- ing queue when completed. The second instance sole. A client-side solution may allow for more of the MTA will then pick up messages in the out- granular preferences for each user but may be going queue and deliver them. less effective than a server-side solution (please don’t flame me for that, this opinion is based on To increase the reader’s knowledge about spam- general assumptions). Finally, server-side solu- filtering techniques, I’ll throw in some explanations tions can reduce the amount of costly resources about other technologies that can help make this needed (bandwidth, CPU time, storage space) to solution even more effective (DNSBLs, SPF, Do- process e-mail on corporate servers. mainKeys, Greylisting).

Installing a spam-filtering server based on Now, let's get our hands dirty. Please try this on a MailScanner test server first, and read all the licenses. Not all software mentioned here is free to use in all situa- My goal in this article is to make it easier for peo- tions: Razor, DCC, and F-Prot have restrictive li- ple to install a secure server-side solution that is censes. free, robust and effective. The solution described is based on MailScanner, used with SpamAssas- Of course, there is more than one way to do sin and its plugins; and virus scanners. I chose things, so please don’t scream at me if I did not this solution because MailScanner allows one to choose your favorite. If you have a better way to do security check on many levels (file names, file do things, you are probably knowledgeable types, dangerous HTML code, Web Bugs, phish- enough so that you can adapt these instructions to ing attacks), while using SpamAssassin’s very fit your needs. I will give explanations rather than good spam-detection engine. It is constantly exact commands, so I presume basic knowledge evolving and can now suppress dangerous HTML of the operating system. Before putting your code and Web Bugs in messages; and has a server in a production environment, make sure “phishing net” that warns when it suspects a you have secured your OS and tested the system phishing fraud, with a global whitelist that is up- thoroughly. More importantly: READ messages dated automatically once a day. It can also work printed on screen. During MailScanner’s installa- with up to about 15 different anti-virus engines and tion you can use CTRL-S to stop output messages updates them automatically. It is robust, reliable, from scrolling and CTRL-Q to start it again highly configurable and efficient. A MailScanner (install.sh output). These procedures were all cor- server typically uses 2 instances of the MTA; the rect at time of writing. You may need to adapt them over time.

My goal in this article is to make it easier for people to install a secure server-side solu- tion that is free, robust and effective.

Before installation: Make sure your operating sys- - Answer yes when you’re asked if you want to in- tem is up to date and you have a supported MTA stall the ports. installed and configured correctly. Here are ge- - After the OS install process, install these ports: neric installation instructions for FreeBSD, Debian clamav, bdc, f-prot, p5-Mail- SpamAssassin, razor- Sarge Linux and Red Hat Enterprise Linux 4. I’m agents, dcc-dccd, pyzor, spamass-rules, spamass- more familiar with the RHEL platform, so the direc- rules_du_jour, (search at www.freebsd.org/ports/) tions are obviously more complete for this plat- and configure them correctly form. - Install ports: mailscanner, then mailscanner-mrtg - Make sure you read carefully what is printed on Installation on FreeBSD screen at the end of the installation of the MailS- canner port. - Minimal install of FreeBSD - Look in /usr/local/etc/rc.d and edit - Make sure you enable SSH login 1. mailscanner.sh.sample - Create a user in the group wheel in the installa- 2. mta.sh.sample tion so that you can su - and rename them without the .sample. Those are the startup scripts.

www.insecuremag.com 54 Installation on Debian Sarge (wiki.mailscanner.info/doku.php?id=maq:index). Along with optimization tips, the wiki contains in- - Using APT or Aptitude, install: mailscanner, formation about how to test and use the software. pyzor, razor, spamassassin, clamav (volatile), dcc- There is even a full section about the “Best Prac- client. tices of e-mail server administration, which covers topics from reverse-lookup records that matches Installation on Red Hat Enterprise Linux 4 (or EHLO string to confidentiality disclaimers. one of its clones) Another good move would be to buy the MailS- - Minimal install canner book (mailscanner.info/store/). It is written - Change, in /etc/sysconfig/i18n, the language to by MailScanner’s author, Julian field. It helps mak- “en_US” and reboot ing the learning curve less steep and encourages - Download the MailScanner and the ClamAV + the continuing development of MailScanner. SpamAssassin packages from mailscanner.info - Download Razor from razor.sourceforge.net/ MailScanner servers are mainly used as mail- (agents and sdk). filtering gateways that are “in front of” corporate - Download Pyzor from pyzor.sourceforge.net/ mail servers (Exchange, Domino, Groupwise). A - Download DCC from: search for “gateway” in the wiki will lead you to rhyolite.com/anti-spam/dcc/source/dcc.tar.Z. instructions for your MTA. It is even possible to - If possible, check GPG signatures/MD5 configure the MTA on the spam-filtering system so - Untar all the packages and install them, following that it accepts messages only for valid e-mail ad- the instructions given in the tarball. dresses. This is done by performing a request to - Install MailScanner using the install.sh script in- the corporate mail server before accepting the side the MailScanner package. There is also an message and saves a lot of resources on both the install.sh script for the ClamAV + SpamAssassin MailScanner and corporate server. package to ease this installation as well. - You may need to install dependencies like gcc, Once you’ve got that working and read through rpm-build and zlib-devel. They are easy to install some documentation, I suggest you subscribe to with yum. the MailScanner-announce list to get announce- ments and the Mailscanner list where you can get Once you're done with the installation, take a few answers from knowledgeable users. minutes to read the file “MailScanner.conf” (in /etc/ MailScanner on RHEL and Debian, in /usr/local/ What now? You need to manage this server, and etc/MailScanner on FreeBSD). The default set- your manager/customer can’t wait to see stats and tings are rather safe, but you must change two reports. For statistics, you should be able to install parameters to activate SpamAssassin and virus Vispan (while.homeunix.net/mailstats/) (from scanning. source) and MailScanner-MRTG (mailscannermrtg.sourceforge.net/) (packages/ 1. Change “Use SpamAssassin = no” to Use ports available for RHEL and FreeBSD, source SpamAssassin = yes” install for Debian). To help you with the configura- 2. Change “Virus Scanners = none” to “Virus tion of MailScanner, you may want to use the Scanners = clamav bitdefender fprot” (depends on MailScanner Webmin Module which engines you choose). (sourceforge.net/projects/msfrontend/).

This will give you a basic, functional spam- and Finally, the ultimate management interface for virus-filtering mail server. The default settings are MailScanner is MailWatch, available at for Sendmail, so you will have to make a few edits mailwatch.sourceforge.net. It is slightly complex to to make it works with your favorite MTA. There are install and requires an AMP setup (Apache many tweaks you can do to improve the spam- MySQL PHP) to work, but it is really worth it. It al- catching effectiveness and processing speed. lows you to see all the messages that have been MailScanner is highly customizable, using the pa- processed, get real-time statistics about message rameters in the MailScanner.conf file. Rulesets are processing and about your system (load, queue at the core of MailScanner’s flexibility. They allow size, etc.), manage black/white lists, create highly- one to designate different parameters, depending customizable reports. Instructions are included in on many conditions (source IP, from:, to:, etc). the tarball and on the website.

I strongly encourage you to visit the MailScanner To conclude, a few words on 3 spam-fighting tools: Wiki (wiki.mailscanner.info) and especially its DNSBLs, SPF, DomainKeys and GreyListing. “Most Asked Questions” section www.insecuremag.com 55 DNSBLs (DNS black lists) have been used since sage integrity between two servers. DomainKeys the early ages of spam filtering. On a MailScanner is dependent, like SPF, of how many sites use the server, DNSBLs can be used at 3 levels, with dif- technology. However, it offers a more reliable ferent consequences. First, they can be used at mechanism. the MTA level. At this level, it is black or white; there is no ‘maybe’: If the originating server is on a Greylisting (projects.puremagic.com/greylisting/) is black list, the message is immediately rejected. rather new and aims at reducing the load on serv- That makes it a bit risky for false positives. At ers while improving the anti-spam effectiveness of least, the sender has a reject message explaining the whole system. It is implemented at the MTA why the message has been rejected. level and here is a quick, very simplified overview:

When used at the MailScanner level, it needs 1. If the “triplet” of the message (originating server more processing than at the MTA level, but at least IP, envelope sender, and envelope recipient) is not the system administrator can decide what to do known, the MTA sends a “temporary failure” mes- with a message that comes from a blacklisted sage, saying to the originating server to try again server: consider it as spam, or high scoring spam, later. after x RBL hits all configurable by rulesets. It is more flexible than at MTA level, but not as flexible 2. If the “triplet” is known (has been seen before), as when used in SpamAssassin. the message is delivered as usual.

SpamAssassin adds a (configurable) score, de- The idea behind the idea of Greylisting is that pending on the specific RBL that has a positive zombies and spammers will not retry the delivery, result. Of course, this requires more processing and legitimate mail servers will. It features white power than the other methods, but lowers consid- listing, different configuration parameters and a erably the risk of rejecting or deleting a legitimate “learning” mode (depending on the implementa- message. tion).

SPF (spf.pobox.com) is a tool based on DNS re- It usually helps block a lot of messages at MTA- cords stating from which IP address outgoing level. Since post-processing (MailScanner, messages from a certain domain should come SpamAssassin, etc.) are more expensive on re- from. For example, it will help identify a spam sources, Greylisting usage reduces the load on message coming from [email protected] that comes the server considerably. Many see an increase of from a compromised server in China. over 80% in rejected spam at MTA level, and a significant decrease of undetected spam mes- Its main advantage is that it doesn’t cause extra sages (~60%). delays or many false positives. However, its suc- cess depends directly from the number of domains All of these concepts can be implemented on a that have SPF DNS records. There are different MailScanner-based server and most of them de- ways to test messages against DNS records, in- pend on MTA features. Most MTAs have features cluding SpamAssassin and MTA-level tools like that have not been discussed here, but can be Sendmail milters, but if you don’t want to filter configured independently, since MailScanner is based on SPF records, please at least put up SPF never involved in the SMTP transaction. records for your domain. Since spam and viruses are constantly evolving, DomainKeys (antispam.yahoo.com/domainkeys) is the best way to keep a high spam-catching rate is similar to SPF, but instead of using DNS records, it to use many techniques and update their imple- uses public key cryptography to prove that a mentations often. server is allowed to send mail for a specific send- ing domain. As a side effect, it guarantees mes-

Ugo Bellavance (www.lubik.ca) is an independent consultant in computer security. He’s an expert in e-mail fil- tering servers, but he also appreciates playing with intrusion detection systems web and database servers. In his spare time he enjoys telemark skiing, mountain biking, hiking, cycling, and playing acoustic guitar.

www.insecuremag.com 56