Avoid Server-side code access, file system access, command execution, SQL injection using Honey Drops
Post date: Jul 28, 2011 4:15:29 AM
Summary:
Threats:
Honey drops work as mini intrusion detectors.
Server-side code access, file system access, command execution, SQL injection
Many people are familiar with the concept of a honey pot, which is a system designed to lure and ensnare hackers, giving an administrator time to gather evidence and track down the intruder. Sometimes you can’t anticipate all possible attacks, but you’ll at least want to detect and log intrusions. Honey pots, if carefully managed, can prove to be effective intrusion detection systems. You can integrate this same concept into your Web application by using small honey pots, or honey drops. This is how it works:Place unique strings throughout your application or data that you can use as honey drops. For example, create fake database records, fields, tables, or even complete databases, depending on the type of intrusion you want to monitor.
Configure your application so that it will never normally access this data. For example, if you created a fake database field, never use a wildcard select statement (such as “SELECT * FROM”), but instead list the specific fields you require.
Configure your application or an external packet sniffer (or both) to watch for these strings leaving your database or Web server.
Suppose that you have an e-commerce Web site that accepts credit card transactions and want to use honey drops to detect any unauthorized access to your data. To do this, create a single fake record in your database using a unique credit card number that you would not otherwise encounter, perhaps one containing all zeros. Make sure that you structure any SQL queries so that this record would not appear under normal circumstances so that if it ever does appear in a query, there is a good chance it is an intrusion, such as a hacker using SQL injection to access your database.
There are several ways for you to watch for this string. One method is to write code to check every query result to see if it contains that record, although this might add a considerable amount of processing overhead. Another method is to use an intrusion detection system (IDS), such as Snort (www. snort.org), to sniff the network link between the Web server and the database, and also between the Web server and the Internet. Finally, configure the sniffer to look for the fake record you created and alert you anytime this value travels from the database to the Web server or from your Web server to the Internet. Note that encrypted network connections prevent sniffing, so you might need to adjust your strategy based on your particular configuration.
Honey drops are not just for databases. You can also use them to detect access to files, directories, or even commands. Here are some more ideas:
Place a conspicuous, blank text file with a unique filename within your Web content directories. Then, configure your IDS to watch for this filename string leaving the network.
Place server-side comments with a unique string in your source code to detect access to server-side scripts.
Change the prompt variable in your command prompt to a unique string to detect remote command access.
Honey drops are not appropriate for all applications, but they can provide an extra layer of protection by allowing early detection of application attacks.
Security Policy
Use honey drops in your database to detect SQL injection attacks.
Use honey drops in your file system to detect file system access.
Use honey drops in your source code to detect server-side code access.