|
Access:
» Writing advanced Linux backdoors – packet sniffingRelated categories: Sniffing | Security | Linux | Backdoors Brandon EdwardsViewed: 17165 | Article date: 2006-03-10 17:33:11 People create new defences for backdoors and intruders are forced to innovate new techniques to keep pace with the rapidly progressing security industry e.g. packet sniffing backdoors. Brandon describes how they work by writing our own proof-of-concept tool.
About the authorBrandon Edwards, also known as drraid, is a security researcher and student from Portland, Oregon, United States. He has spoken at security conferences such as Defcon and currently works in the security industry. He can be contacted at drraid@gmail.com.
As people create new defences for backdoors, intruders are forced to innovate new techniques to keep pace with the rapidly progressing security industry. One of such techniques is packet sniffing backdoors. Let's learn how they work by writing our own proof-of-concept tool. A new backdoor technique which has evolved from the need to bypass a local firewall (like Netfilter), without embedding code or connecting back, is packet sniffing. This style of backdoor works by capturing packets (possibly with specific traits) to interpret for commands to execute. The packets containing the backdoor commands don't have to be accepted by the system as a connection, just seen by the target system's network interface.
What you will learn...
What you should know...
Local vs remote backdoorsLocal backdoors are executed locally on the target system (hence the name), and thus require that the attacker has some form of prior access to the affected system before execution. Most local backdoors are used by intruders who have shell access to the compromised system, using the backdoor to escalate their privileges. Although there are many approaches for covertly using and hiding local backdoors, the necessity for the attacker's local presence provides an inherent high risk of discovery. For this reason, remote backdoors are becoming more prevalent than those which require local access. Remote backdoors are network accessible, allowing for use from the attacker's system without prior access (other than the initial planting of the backdoor itself, of course). Traditionally, these backdoors were accessed remotely via TCP sockets listening on a high port, to which the user could connect. Upon establishing a connection, authentication may have been required, however many backdoors granted access immediately. This style of standard socket listening backdoor is primitive and very easily discovered by tools such as netstat (assuming netstat itself is not backdoored). This type of backdoor is also easily discovered by remote port scanning, consequently allowing arbitrary use by other hackers.
There are many interesting advantages with packet sniffing for commands (instead of listening for or initiating connections). By capturing packets off the network interface, and not asking the system for a socket, packets are seen by the backdoor regardless of being locally filtered (by Netfilter, for example). Since it never has to accept a connection through the system, it never shows up with netstat. Finally, because it only needs to capture packets directed at the system (not other systems on the network), it can keep the network interface in non-promiscuous mode to prevent it from showing up in local system logs.
New backdoor tacticsAs the security industry has progressed, administrators have learned to detect and defeat basic socket listening backdoors. By implementing firewall rules to block traffic on ports not essential to legitimate services, connectivity to listening backdoors can be greatly reduced, if not eliminated. To counteract this defence, new tactics were devised.
Backdoor designAlong with the advantages of packet sniffing backdoors, come some interesting issues, such as identifying which packets to interpret for commands, and how to authenticate them. Also, sending plain text command strings inside of packets might give away the presence of a backdoor to someone monitoring network traffic - some form of encoding or encryption (even if just simple character substitution) should be used. Although this method is not flawless, it can be very inconspicuous and difficult to notice unless specifically being looked for. This article further examines the nature of this type of backdoor by demonstrating how to write one. Backdoor objectivesBefore writing any program, it is best to first identify the program's objectives. Once objectives are identified, it is then easy write an outline of the program to later base code upon. The objectives (goals) to achieve with our example packet sniffing backdoor will be the following:
Code skeletonHaving identified this example's objectives, we now have to use some way to illustrate the program's structure and logic. This can be done in many ways, for example via diagrams. Another way is to use pseudo-code, which may later be easily read and translated into real code. Listing 1 contains a program skeleton outlining how to attain the desired backdoor goals. This outline is written in a descriptive code-comment fashion, and meant to illustrate the program's flow of logic. This base is used in reference throughout the article for writing the actual backdoor code.
|
|
Copyright C 2006 by Software Developer's Journal. All rights reserved.





SDJ Users:
hakin9 StarterKit IT Practical Solutions for Newbies










