OpenSource For You

Device Evasions

This is the last installmen­t of the year-long series on cyber attacks. As we know, network infrastruc­ture is protected by security devices such as routers and firewalls. So far, it was believed that such devices were enough to secure the perimeter. This b

- By: Prashant Phatak The author has over 20 years of experience in IT hardware, networking, Web technologi­es and IT security. Prashant is MCSE and MCDBA certified, and also an F5 load balancer expert. In the IT security world, he is an ethical hacker and a

By DEfinItIon, EvAsIon Is tHE proCEss oF AvoIDInG or BypAssInG An oBJECt or A sItuAtIon. In tECHnICAl tErms, EvAsIon Is A tECHnIquE By wHICH An AttACkEr BypAssEs A sECurIty systEm In tHE CyBEr sECurIty spACE. THE systEm mAy typICAlly ConsIst oF routErs, firEwAlls, nEtwork swItCHEs AnD IntrusIon DEtECtIon DEvICEs. As wE All know, routErs sEGrEGAtE nEtworks; firEwAlls BloCk unwAntED IP ADDrEss AnD TCP port CommunICAt­Ions, wHErEAs IntrusIon DEtECtIon DEvICEs ADD A lAyEr oF IntEllIGEn­CE BAsED on AnomAly DEtECtIon tECHnIquEs. A FEw yEArs BACk, wHEn tHEsE tECHnIquEs wErE ImplEmEntE­D nEtwork ADmInIstrA­tors CoulD sAFEly sAy tHAt tHEIr InFrAstruC­turE wAs sECurE. HowEvEr, tHE lAws oF HumAn nAturE tEll us tHAt A tHIEF Is AlwAys A stEp AHEAD oF tHE Cops! WHIlE tHEsE DEvICEs sEEm to tHwArt tHE AttACks For somE tImE, tHEy HAvE mADE CyBEr CrImInAls morE AGGrEssIvE AnD HAvE promptED tHEm to ComE up wItH wAys to pEnEtrAtE AnD BrEAk Down tHE sECurIty pErImEtEr. AttACkErs usE EvAsIon mEtHoDs In orDEr to stEAl DAtA, DIsrupt IT nEtworks or plAnt soFtwArE ExploIts.

As sHown In FIGurE 1, A typICAl sECurE InFrAstruC­turE ContAIns At lEAst A routEr, wItH A swItCH AnD A firEwAll Also InCorporAt­ED. To lEArn morE ABout DEvICE EvAsIons, lEt’s ConCEntrAt­E on tHEsE tHrEE DEvICEs, AnD CovEr A BIt ABout IDS systEms too. LEt’s Also lEArn How EACH oF tHEsE DEvICEs CAn BE BrokEn Into, AnD finAlly, How to sECurE tHEm to protECt

the infrastruc­ture. Device evasion is a highly technical and systematic approach to penetratin­g a network.

Router evasion

Often, routers are the first devices accessible from outside a firm’s network. Routers maintain their own routing tables, which store the paths to destinatio­n IP ranges, with a cost metric. The routing table is checked every time a TCP/ IP packet is processed prior to being sent to the desired destinatio­n. Besides this, routers implement intelligen­t algorithms to speed up the routing process. The router device thus acts as a first line of defence from the cybersecur­ity perimeter standpoint. In earlier articles in this series, we learnt about denial of service (DoS) attacks, IP spoofing attacks, man-in-the-middle attacks and packet-crafting attacks. All these attack vectors can either fool a router into routing malicious packets into the target network, or can simply render it functional­ly useless, thus disrupting the whole network. Besides this, there are a few router-specific techniques too, which are mentioned below.

Route hijacking: In this method, the attacker first sniffs the traffic originatin­g from a router. Based on the informatio­n gathered, the router is then supplied with bogus source and destinatio­n IP addresses, which are spoofed purposely to trick the router. As the router tracks these and updates its routing table, this process can become very overwhelmi­ng to the router, causing its routing table to overflow and get corrupted. This is similar to a DoS attack, but can take much less time, in practice. An expert attacker can further exploit this situation by feeding the vulnerable router with its own IP segment, and waiting for the routing table to get built up again. The very first routing protocol, called RIP, didn’t have a built-in authentica­tion mechanism to verify the authentici­ty of the routes being updated. Hence, a forged RIP packet can easily disrupt the routing table, and this scenario becomes seriously dangerous if multiple routers are connected together using the RIP protocol. Modern routers usually don’t fall prey to this attack; however, an improperly configured router can still be vulnerable.

IoS penetratio­n: Like any other network device, a router runs its own operating system, which can be vulnerable to attacks. For example, most wireless routers and early-generation industry-grade routers were running on a compromise­d kernel OS. Attackers with a thorough knowledge of such vulnerabil­ities can write scripts and programmat­ically subject the device to DoS or other dangerous attacks, such as remote code execution. Once the OS has been penetrated, attackers can remotely run commands to change critical configurat­ions and settings. Attackers can route traffic to malicious servers to steal and corrupt data, and cause even more damage.

Firewall evasion

It is a common practice to host a firewall behind a router; however, many mid-sized firms running only one office may completely remove the router, turning the firewall into the first line of defence. As compared to the router, a firewall acts as a strong opposition to attacks because its kernel functional­ity is designed for this, causing serious challenges to attackers wanting to get past a well-configured firewall.

As we know, a firewall is a rule-based device that allows or disallows traffic entering or exiting a security perimeter. When a source address initiates a connection with a host behind a firewall, the firewall rules intercept the connection, interpret it and take appropriat­e action. This also tells us that the TCP handshake actually happened between the source and firewall. In case the connection being establishe­d is not allowed, based on the rules configured, the firewall drops the connection by sending a TCP RST signal to the source. If the connection is allowed, it initiates a connection with the destinatio­n and performs the packet transfer. This also shows us that the source and destinatio­n IP addresses, as well as the ports, are very important from the firewall’s standpoint. With this fundamenta­l theory in mind, let’s look at few firewall-specific evasion attacks.

Firewall request spoofing: If the attackers can spoof their packets to make them look like they are coming from the internal network segment of the firewall, an improperly configured firewall may allow those through the system. Similar effects can be achieved by spoofing the MAC address, in case the firewall is keeping a track of all internal MAC addresses.

Firewall DoS: Modern firewalls intercept each packet and apply more intelligen­t checks on them than their predecesso­rs, before letting them through to the network. Typical checks by anti- virus and anti- spyware algorithms, attack anomalies, etc, are performed on each packet. This feature, though tremendous­ly useful, is exploited by attackers in some cases. Apart from sending an overwhelmi­ng number of requests, there are a few other tricks used by attackers. In one case, a malicious request to a known destinatio­n host listening on a known port is sent multiple times, but with the source IP and port of that packet spoofed to a non- existent host. There is no way for the firewall to know this, and hence this results

in an internal connection to the destinatio­n that gets updated in the firewall’s own tracking table. Since the source does not exist, such requests keep on piling up, thus exhausting the firewall resources. In another case, the source address is spoofed to be one of the internal network IP range, and the MAC address is spoofed. This causes the destinatio­n host to call for a MAC address RARP request, causing turbulence on the internal network. It is important to note that a firewall DoS attack can disrupt internal- to- external network traffic, and can even take down the internal network.

Packet forging: In one of the previous articles in this series, we learnt about packet crafting. The same technique can be used against firewalls. In one case, a packet can be crafted to have a bad TCP checksum, which the firewall has to calculate every time, before taking a decision on the packet, thus causing sluggishne­ss. In another case, the datalength parameter in the TCP packet can be filled with a very big number, which tricks the firewall into waiting for the entire data chunk to arrive. This can eventually exhaust the firewall’s internal memory.

Rule exploitati­on: Attackers know by experience that, in many cases, a firewall is not configured correctly. For example, it is commonly found that TCP packet rules are set up, whereas the administra­tor simply forgets to deal with UDP packets, letting those get through the firewall. It has also been found that many firewalls are configured with port 80 being open bi-directiona­lly, whereas it should be open only from the external network to the internal network. Modern black-hats (attackers) often write scripts to detect such mis-configurat­ions—and on finding one, they gather enough data to exploit those further.

IDS and switch evasion

Today’s IT infrastruc­tures always try to go beyond firewalls, by implementi­ng Layer-3 switches as well as intrusion detection systems. A Layer-3 switch contains some great features, such as compartmen­talised virtual networks, network bandwidth quality of service, MAC registrati­on, etc. An IDS system works by applying attack anomaly algorithms on the packet traffic in a network. While each of those have their advantages, the techniques used to invade a router and firewall apply to them too. At the heart of all these techniques is packet crafting and packet spoofing, so that these devices are fooled into treating those packets as legitimate—and thus the attack is not sensed, suspected or detected.

One common technique to evade an IDS system is forceful signature embossing. An IDS system learns as time goes by, and updates its own database of anomaly signatures, which further helps in deciding which request is legitimate and which is not. Attackers send multiple spoofed packets over a long period of time, to a destinatio­n host running a known TCP service. The packets are sent in well-formed as well as malformed patterns. The IDS drops the malformed ones, but eventually ‘learns’ it as an acceptable behaviour based on historic patterns. Once this state is attained, the attacker storms the IDS with malformed packets to the host, thus achieving the goal of disrupting the system. This also shows us that an IDS is a great idea, but a mis-configured IDS can be equivalent to having almost no security at all.

For switches and IDS systems, DoS attacks planted at Layer-2 or Layer-3 are possible. Switches are configured to deal with such situations; however, attackers scan networks to find out the weakest link, which is usually the misconfigu­red device, and use it as a target. The operating system of switches, too, can be compromise­d, as attackers can take control of these switches remotely. This is, however, not so easy in case of IDS systems, making these an important network component from the cyber security perspectiv­e.

Protecting FOSS systems

There are many flavours of open source routers running on Ubuntu and other distros. The same is true for firewalls and intrusion detection systems. While we have discussed the devices, it is important to note here that the FOSS systems behind the perimeter of these devices should be properly configured and monitored for network attack anomalies. At the network layer, Linux FOSS systems come with a built-in feature called source address verificati­on. This is a kernel feature which, when turned on, starts dropping packets that appear to be arriving from the internal network, but in reality are not. Most of the latest kernels in distros, such as Ubuntu and CentOS, support it. This feature helps to reduce the chances of packet spoofing.

Summary

This article concludes this series on cyber security. We all love FOSS, and can enjoy and benefit from it even more only if it is cyber-secured. Thanks for all the great feedback received so far, and the encouragin­g words via email and social networks. Device evasion is a new trend in network attacks and is being increasing­ly used to break into corporate IT infrastruc­ture for malicious reasons; it should be taken very seriously by network administra­tors and the IT senior management.

 ??  ?? Router
Firewall
Figure 1: Typical network configurat­ion
Switch
Typical Network Configurat­ion
Router Firewall Figure 1: Typical network configurat­ion Switch Typical Network Configurat­ion
 ??  ?? WAY TO FIREWALL EVASION AND ROUTER EVASION SCANNING PHASE
WAY TO FIREWALL EVASION AND ROUTER EVASION SCANNING PHASE
 ??  ??

Newspapers in English

Newspapers from India