12
OnionBots: Subverting Privacy Infrastructure for Cyber Attacks Amirali Sanatinia Northeastern University [email protected] Guevara Noubir Northeastern University [email protected] Abstract—Over the last decade botnets survived by adopting a sequence of increasingly sophisticated strategies to evade detection and take overs, and to monetize their infrastructure. At the same time, the success of privacy infrastructures such as Tor opened the door to illegal activities, including botnets, ransomware, and a marketplace for drugs and contraband. We contend that the next waves of botnets will extensively subvert privacy infrastructure and cryptographic mechanisms. In this work we propose to preemptively investigate the design and mitigation of such botnets. We first, introduce OnionBots, what we believe will be the next generation of resilient, stealthy botnets. OnionBots use privacy infrastructures for cyber attacks by completely decoupling their operation from the infected host IP address and by carrying traffic that does not leak information about its source, destination, and nature. Such bots live sym- biotically within the privacy infrastructures to evade detection, measurement, scale estimation, observation, and in general all IP-based current mitigation techniques. Furthermore, we show that with an adequate self-healing network maintenance scheme, that is simple to implement, OnionBots achieve a low diameter and a low degree and are robust to partitioning under node deletions. We developed a mitigation technique, called SOAP, that neutralizes the nodes of the basic OnionBots. We also outline and discuss a set of techniques that can enable subsequent waves of Super OnionBots. In light of the potential of such botnets, we believe that the research community should proactively develop detection and mitigation methods to thwart OnionBots, potentially making adjustments to privacy infrastructure. I. I NTRODUCTION Over the last decade botnets rose to be a serious security threat. They are routinely used for denial of service attacks, spam, click frauds, and other malicious activities [1]. Both the research and industry communities invested a significant effort analysing, developing countermeasures, and products to effectively detect, cripple, and neutralize botnets. While some countermeasures operate on user computers, most are deployed at the ISP and enterprise levels. Many botnets were successfully neutralized by shutting down or hijacking their Command and Control (C&C) servers, communications channels (e.g., IRC), reverse engineering the algorithm used for the domain name generation (DGA) and preemptively blocking the access to these domains [2]. Such mitigation techniques exploit the fact that most current botnets rely on primitive communication architectures and C&C mechanisms. This forced botnet developers to continuously adapt raising the level of sophistication of their design from the early static and centralized IRC or fixed servers’ IP addresses to more sophisticated fast-fluxing [3] and even straightforward use of Tor hidden services [4], [5]. In this paper, we are interested in investigating the next level of this arm-race. We contend that the next wave of bot- nets’ sophistication will rely on subverting privacy infrastruc- ture and a non-trivial use of cryptographic mechanisms. The Tor project was very successful in building an infrastructure that protects users identity over the Internet and allowing one to host Internet servers without revealing her or his location using the Tor hidden services feature. Evidence of our predictions can be found in the malicious use of hidden services for hosting the infamous silk road [6], instances of the Zeus [4] botnet, and the hosting of the CryptoLocker ransomware C&C server [7]. Interestingly, CryptoLocker combines Tor with the use of another privacy “infrastructure”, bitcoin the crypto currency, for the ransom payment. The combination of Tor and bitcoin make it possible today to blackmail Internet users, anonymously be paid, and get away with it. The current use of Tor and crypto-mechanisms in botnets is still in its infancy stages. Only hosting the C&C server as a hidden service still allows the detection, identification, and crippling of the communication between the bots. Recent research demonstrated that it is possible to successfully deny access to a single or few .onion server [8]. To assess the threat of crypto-based botnets, we advocate a preemptive analysis, understanding of their potential and limitations, and the development of mitigation techniques. In this paper, we present the design of a first generation of non-trivial OnionBots. In this Basic OnionBot, communication is exclusively carried out through hidden services. No bot (not even the C&C) knows the IP address of any of the other bots. At any instant, a given bot is only aware of the temporary .onion address of a very small (constant) number of bots. Bots relay packets but cannot distinguish the traffic based on their source, destination, or nature. At the same time, the bot master is able to access and control any bot, anytime, without revealing his identity. We show that this design is resilient to current mitigations and analysis techniques from botnet mapping, hijacking, to even assessing the size of the botnet. We also show that the proposed Neighbors-of-Neighbor graph maintenance algorithm achieves a low diameter, degree, and high resiliency and repair in the event of a take-down (e.g., Tor DoSing or node capture/cleanup) of a significant fraction of the botnet nodes. Since our goal is to preemptively prevent the emergence of OnionBots, we also propose a novel mitigation technique against the Basic OnionBots. This technique exploits the same stealthy features of the OnionBot (namely peers not knowing each other’s identities) to neutralize the bots. The technique called SOAP, gradually surrounds the bots by clones (or sybils) until the whole botnet is fully contained. We believe that the Basic OnionBot is only the prelude arXiv:1501.03378v1 [cs.CR] 14 Jan 2015

OnionBots: Subverting Privacy Infrastructure for Cyber Attacks · nets’ sophistication will rely on subverting privacy infrastruc-ture and a non-trivial use of cryptographic mechanisms

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: OnionBots: Subverting Privacy Infrastructure for Cyber Attacks · nets’ sophistication will rely on subverting privacy infrastruc-ture and a non-trivial use of cryptographic mechanisms

OnionBots: Subverting Privacy Infrastructurefor Cyber Attacks

Amirali SanatiniaNortheastern [email protected]

Guevara NoubirNortheastern University

[email protected]

Abstract—Over the last decade botnets survived by adoptinga sequence of increasingly sophisticated strategies to evadedetection and take overs, and to monetize their infrastructure.At the same time, the success of privacy infrastructures suchas Tor opened the door to illegal activities, including botnets,ransomware, and a marketplace for drugs and contraband. Wecontend that the next waves of botnets will extensively subvertprivacy infrastructure and cryptographic mechanisms. In thiswork we propose to preemptively investigate the design andmitigation of such botnets. We first, introduce OnionBots, whatwe believe will be the next generation of resilient, stealthybotnets. OnionBots use privacy infrastructures for cyber attacksby completely decoupling their operation from the infected hostIP address and by carrying traffic that does not leak informationabout its source, destination, and nature. Such bots live sym-biotically within the privacy infrastructures to evade detection,measurement, scale estimation, observation, and in general allIP-based current mitigation techniques. Furthermore, we showthat with an adequate self-healing network maintenance scheme,that is simple to implement, OnionBots achieve a low diameterand a low degree and are robust to partitioning under nodedeletions. We developed a mitigation technique, called SOAP,that neutralizes the nodes of the basic OnionBots. We also outlineand discuss a set of techniques that can enable subsequent wavesof Super OnionBots. In light of the potential of such botnets,we believe that the research community should proactivelydevelop detection and mitigation methods to thwart OnionBots,potentially making adjustments to privacy infrastructure.

I. INTRODUCTION

Over the last decade botnets rose to be a serious securitythreat. They are routinely used for denial of service attacks,spam, click frauds, and other malicious activities [1]. Boththe research and industry communities invested a significanteffort analysing, developing countermeasures, and productsto effectively detect, cripple, and neutralize botnets. Whilesome countermeasures operate on user computers, most aredeployed at the ISP and enterprise levels. Many botnetswere successfully neutralized by shutting down or hijackingtheir Command and Control (C&C) servers, communicationschannels (e.g., IRC), reverse engineering the algorithm usedfor the domain name generation (DGA) and preemptivelyblocking the access to these domains [2]. Such mitigationtechniques exploit the fact that most current botnets rely onprimitive communication architectures and C&C mechanisms.This forced botnet developers to continuously adapt raisingthe level of sophistication of their design from the early staticand centralized IRC or fixed servers’ IP addresses to moresophisticated fast-fluxing [3] and even straightforward use ofTor hidden services [4], [5].

In this paper, we are interested in investigating the next

level of this arm-race. We contend that the next wave of bot-nets’ sophistication will rely on subverting privacy infrastruc-ture and a non-trivial use of cryptographic mechanisms. TheTor project was very successful in building an infrastructurethat protects users identity over the Internet and allowing one tohost Internet servers without revealing her or his location usingthe Tor hidden services feature. Evidence of our predictionscan be found in the malicious use of hidden services forhosting the infamous silk road [6], instances of the Zeus [4]botnet, and the hosting of the CryptoLocker ransomware C&Cserver [7]. Interestingly, CryptoLocker combines Tor with theuse of another privacy “infrastructure”, bitcoin the cryptocurrency, for the ransom payment. The combination of Torand bitcoin make it possible today to blackmail Internet users,anonymously be paid, and get away with it.

The current use of Tor and crypto-mechanisms in botnetsis still in its infancy stages. Only hosting the C&C serveras a hidden service still allows the detection, identification,and crippling of the communication between the bots. Recentresearch demonstrated that it is possible to successfully denyaccess to a single or few .onion server [8]. To assessthe threat of crypto-based botnets, we advocate a preemptiveanalysis, understanding of their potential and limitations, andthe development of mitigation techniques.

In this paper, we present the design of a first generation ofnon-trivial OnionBots. In this Basic OnionBot, communicationis exclusively carried out through hidden services. No bot (noteven the C&C) knows the IP address of any of the other bots.At any instant, a given bot is only aware of the temporary.onion address of a very small (constant) number of bots.Bots relay packets but cannot distinguish the traffic based ontheir source, destination, or nature. At the same time, the botmaster is able to access and control any bot, anytime, withoutrevealing his identity. We show that this design is resilientto current mitigations and analysis techniques from botnetmapping, hijacking, to even assessing the size of the botnet.We also show that the proposed Neighbors-of-Neighbor graphmaintenance algorithm achieves a low diameter, degree, andhigh resiliency and repair in the event of a take-down (e.g., TorDoSing or node capture/cleanup) of a significant fraction of thebotnet nodes. Since our goal is to preemptively prevent theemergence of OnionBots, we also propose a novel mitigationtechnique against the Basic OnionBots. This technique exploitsthe same stealthy features of the OnionBot (namely peers notknowing each other’s identities) to neutralize the bots. Thetechnique called SOAP, gradually surrounds the bots by clones(or sybils) until the whole botnet is fully contained.

We believe that the Basic OnionBot is only the prelude

arX

iv:1

501.

0337

8v1

[cs

.CR

] 1

4 Ja

n 20

15

Page 2: OnionBots: Subverting Privacy Infrastructure for Cyber Attacks · nets’ sophistication will rely on subverting privacy infrastruc-ture and a non-trivial use of cryptographic mechanisms

to waves of increasingly sophisticated bots subverting privacyinfrastructure such as Tor. We outline and discuss an additionalset of techniques that fully exploits the decoupling betweenIP addresses and bots, enabling multi-bot per host, proofs ofwork mechanisms and other techniques that can potentiallyovercome the SOAP mitigation. Our goal is to draw theattention of the community to the potential of OnionBotsand develop preemptive measures to contain them and ideallyprevent their occurence.

Our contributions are summarized as follows:

• A novel reference design for a OnionBotnet whosecommand, communication, and management are fullyanonymized within the Tor privacy infrastructure.

• A communication topology with repair mechanismsthat minimizes the nodes’ degree, graph diameter, andmaximizes resiliency.

• A performance evaluation and discussion of resiliencyto various takedown attacks such as simultaneousdenial of service attacks against multiple .onionbotnet nodes.

• A Sybil mitigation technique, SOAP, that neutralizeseach bot by surrounding it by clones.

• An outline and discussion of a set of techniques thatcan enable subsequent waves of Super OnionBots.

We first survey the current state of botnet design andmitigation techniques in Section II, followed by a review ofthe key features of the Tor privacy infrastructure in Section III.In Section IV, we present our proposed reference design foran OnionBotnet. We evaluate the resiliency and performanceof the OnionBotnet, using several metrics in Section V. Weinvestigate potential mechanisms to prevent the rise of suchbotnets in Section VI. We finally discuss how the attackerswould evolve their infrastructure to evade mitigation in Sec-tion VII.

II. CURRENT BOTNETS & MITIGATIONS

We first review the evolution of botnets and why webelieve the next generation of botnets would subvert privacyinfrastructures to evade detection and mitigation. Currently,bots are monitored and controlled by a botmaster, who issuescommands. The transmission of theses commands, which areknown as C&C messages, can be centralized, peer-to-peer orhybrid [9]. In the centralized architecture the bots contact theC&C servers to receive instructions from the botmaster. In thisconstruction the message propagation speed and convergenceis faster, compared to the other architectures. It is easy toimplement, maintain and monitor. However, it is limited by asingle point of failure. Such botnets can be disrupted by takingdown or blocking access to the C&C server. Many centralizedbotnets use IRC or HTTP as their communication channel. GT-Bots, Agobot/Phatbot [10], and clickbot.a [11] are examplesof such botnets. A significant amount of research focused ondetecting and blocking them [12], [13], [14], [15], [16], [17].To evade detection and mitigation, attackers developed moresophisticated techniques to dynamically change the C&Cservers, such as: Domain Generation Algorithm (DGA) andfast-fluxing (single flux, double flux).

Single-fluxing is a special case of fast-flux method. It mapsmultiple (hundreds or even thousands) IP addresses to a do-main name. These IP addresses are registered and de-registeredat rapid speed, therefore the name fast-flux. These IPs aremapped to particular domain names (e.g., DNS A records) withvery short TTL values in a round robin fashion [3]. Double-fluxing is an evolution of single-flux technique, it fluxes bothIP addresses of the associated fully qualified domain names(FQDN) and the IP address of the responsible DNS servers(NS records). These DNS servers are then used to translatethe FQDNs to their corresponding IP addresses. This techniqueprovides an additional level of protection and redundancy [3].Domain Generation Algorithms (DGA), are the algorithmsused to generate a list of domains for botnets to contact theirC&C. The large number of possible domain names makes itdifficult for law enforcements to shut them down. Torpig [18]and Conficker [19] are famous examples of these botnets.

A significant amount of research focuses on the de-tection of malicious activities from the network perspec-tive, since the traffic is not anonymized. For exam-ple [20], [21], [22], [23], [24], [25] inspect the DNS traffic anduse machine learning clustering and classification algorithms.BotFinder [26] uses the high-level properties of the bot’snetwork traffic and employs machine learning to identify thekey features of C&C communications. DISCLOSURE [27]uses features from NetFlow data (e.g., flow sizes, client accesspatterns, and temporal behavior) to distinguish C&C channels.Other work [28], [29] focus on endpoints’ static metadataproperties and the order of the high-level system events forthreat classification.

The next step in the arms race between attackers anddefenders was moving from a centralized scheme to a peer-to-peer C&C. Storm [30], Nugache [31], Walowdac [32] andGameover Zeus [33] are examples of such botnets. Some ofthese botnets use an already existing peer-to-peer protocol,while others use customized protocols. For example earlierversions of Storm used Overnet, and the new versions use acustomized version of Overnet, called Stormnet [30]. Mean-while other botnets such as Walowdac and Gameover Zeusorganize their communication channels in different layers.

Previous work studied specific mitigations against peer-to-peer botnets. For example BotGrep [34] uses the uniquecommunication patterns in a botnet to localize its members byemploying structured graph analysis. Zhang et al. [35] proposea technique to detect botnet P2P communication by finger-printing the malicious and benign traffic. Yen and Reiter [36]use three features (peer churn, traffic volume and differencesbetween human-driven and bot-driven behavior) in networkflow to detect malicious activity. Coskun et al. [37] propose amethod to detect the local members of an unstructured botnetby using the mutual contacts. As we can see, some of thesetechniques rely on observing the unencrypted traffic, thereforeby using a privacy infrastructure such as Tor they can beevaded.

Very recently the use of Tor received more attention frommalware and botnet authors. For example the new 64-bit Zeusemploys Tor anonymity network in its botnet infrastructure [4].It creates a Tor hidden service on the infected host and theC&C can reach this infected hosts using their unique .onionaddress through Tor. Another example is ChewBacca [5],

Page 3: OnionBots: Subverting Privacy Infrastructure for Cyber Attacks · nets’ sophistication will rely on subverting privacy infrastruc-ture and a non-trivial use of cryptographic mechanisms

Fig. 1: Tor hidden service structure

which uses Tor, and logs the keystrokes on the infected hostand reports them back to the botmaster. The C&C is an HTTPserver that is hosted as a hidden service. Although using Torand hidden services makes the detection and mitigation moredifficult, these bots are still using the basic client-server model.This leaves them open to single point of failure.

III. PRIVACY INFRASTRUCTURE: TOR

We envision OnionBots to rely on Tor for their operation.To better understand their potential and limitations, we brieflyreview the structure of Tor and hidden services. Tor [38] is themost widely used distributed low-latency anonymity-network.It helps users to resist censorship, and protects their personalprivacy. Furthermore it allows users to hide their activitiesand location from government agencies and corporations.Clients establish anonymous communication by relayingtheir traffic through other Tor relays, called Onion Routers(OR). A client builds a circuit with the relays by negotiatingsymmetric keys with them. After building the circuit, theclient sends the data in fixed sized cells and encryptsthem in multiple layers, using the previously negotiated keys.Besides providing anonymous communication for clients,current implementation of Tor also offers anonymity forservers through hidden services.

The Tor hidden service architecture is composed of thefollowing components:

• Server, that runs a service (e.g., a web server).

• Client, that wishes to access the server.

• Introduction Points (IP), a set of Tor relays, chosen bythe hidden service, that forward the initial messagesbetween the server and the client’s Rendezvous Point.

• Rendezvous Point (RP), a Tor relay randomly chosenby the client that forwards the data between the clientand the hidden service.

• Hidden Service Directories (HSDir), a set of Tor relayschosen by the server to store its descriptors.

In order to make a service available via Tor, Bob (theservice provider) generates an RSA key pair. The first 10bytes of the SHA-1 digest of the generated RSA publickey becomes the Identifier of the hidden service. The.onion hostname, is the base-32 encoding representation ofthe public key. As Figure 1 illustrates the following steps takeplace to connect to a hidden service. Bob’s Onion Proxy (OP)

Fig. 2: Tor hidden service Directories (HSDir) Fingerprint

chooses a set of Tor relays to serve as his Introduction Pointsand establishes a circuit with them (step 1). After making thecircuits, he computes two different service descriptors thatdetermine which Tor relays should be chosen as its HSDirs(step 2). HSDirs are responsible for storing the hidden servicedescriptors, which change periodically every 24 hours andare chosen from the Tor relays that have the HSDir flag. Thisflag is obtained by relays that have been active for at least25 hours. Later, in section VI we discuss the critical role thatHSDirs can paly in mitigating OnionBots.

descriptor-id = H(Identifier || secret-id-part)secret-id-part = H(time-period || descriptor-cookie|| replica)time-period = (current-time +permanent-id-byte * 86400 / 256) / 86400

H denotes the SHA-1 hash digest. Identifier is the 80bit fingerprint (truncated SHA-1 digest of public key) of thehidden service. Descriptor-cookie is an optional 128 bitfield. It can be used to provide authorization at the Tor networklevel and preventing unauthorized clients from accessing thehidden service. Time-period is used to periodically changethe responsible HSDirs, and making the system more resilient.The permanent-id-byte prevents the descriptors fromchanging all at the same time. Replica takes values of 0 or1. It is used to compute two different sets of descriptor IDs fora hidden service. The current implementation of Tor distributeseach set of descriptor IDs in 3 different HSDirs, thereforefor each hidden service there are a total of 6 responsibleHSDirs. The list of Tor relays, which is called the consensusdocument, is published and updated every hour by the Torauthorities. If we consider the circle of the fingerprint of Torrelays as depicted in Figure 2, then if the descriptor ID of thehidden service falls between the fingerprint of HSDirk−1 andHSDirk, it will be stored on HSDirk, HSDirk+1 and HSDirk+2.

When a client (Alice) wants to contact a hidden service, shefirst needs the hostname of the service. Then from the .onionhostname, she computes the Descriptor ID of the hiddenservice and the list of its responsible HSDirs (step 3). Tocommunicate with the hidden service, Alice first randomlychooses a Tor relay as her Rendezvous Point and makes acircuit to it (step 4). She then builds a new circuit to oneof Bob’s Introduction Points, and sends it a message. This

Page 4: OnionBots: Subverting Privacy Infrastructure for Cyber Attacks · nets’ sophistication will rely on subverting privacy infrastruc-ture and a non-trivial use of cryptographic mechanisms

message includes the Rendezvous Point’s info and the hashof the public key of the hidden service (step 5). If the publickey (sent by Alice) is recognized by the Introduction Point,it will forward the information to the hidden service OP (step6). When Bob’s OP receives the message it will extract theRendezvous Point information and establishes a circuit with it(step 7).

This approach protects client’s (Alice) IP address fromBob, and hides hidden service’s (Bob) IP address from Alice,thus providing mutual anonymity for both the client and theserver.

IV. ONIONBOT: A CRYPTOGRAPHIC P2P BOTNET

In this section, we look at the details of the proposedOnionBot, a novel non IP based construction that is immuneto the current mitigation techniques. We explore differentbootstrapping approaches and a distributed, self-healing, low-degree, low-diameter overlay peer-to-peer network formation.

A. Overview

OnionBot retains the life cycle of a typical peer-to-peerbot [39]. However, each stage has unique characteristics thatmake OnionBots different from current peer-to-peer botnets.As a result, existing solution are not applicable to them. Forexample, in the infection stage, each bot creates a .onionaddress and generates a key to indistinguishably encrypt themessages. In the rally stage, the bot dynamically peer withother bots that are the foundation of a self-healing network.Furthermore, while at the waiting stage, bots periodicallychange their address to avoid detection and mitigation. Thisnew .onion addresses are generated from the key that isshared with the botmaster. This allows the botmaster to accessand control any bot through the shared key, anytime, withoutrevealing his identity.

Infection: is the first step in recruiting new bots, whereeach bots is also hardcoded with the public key of thebotmaster. It can happen through traditional attack vectors suchas phishing, spam, remote exploits, drive-by-download or zero-day vulnerabilities [40]. A great body of literature have focusedon different spread mechanisms [41], [42]. In this work wefocus on the remaining stages of a bot’s life cycle.

Rally: in order to join a botnet, the newly infected botsneed to find already existing members of the network. In peer-to-peer network this process it called bootstrapping. For clarityreasons we use the same terminology in describing OnionBots.Based on the requirements of the network, the complexityand flexibility of bootstrapping techniques varies significantly.OnionBots necessitate a distributed mechanism to maintaina low-degree, low-diameter network. Such requirements, de-mands a bootstrapping mechanism that is able to evolve withthe network. In section IV-B we discuss different techniquesand their ramifications more in detail.

Waiting: in this state, a bot is waiting for commands fromthe botmaster. Generally the command transmissions can bepull-based (bots make periodic queries to the C&C) or push-based (bot master sends the commands to the bots), and thereare trade-offs in each mechanism. For example in the pull-based approach, if bots aggressively make queries for the C&C

messages, it allows faster propagation of commands. Howeverit results in easier detection of C&C and the bots. In the push-based approach, it is important to be able to reach to each bot,within reasonable steps. Furthermore, to prevent leakage ofinformation about the botnet operation and topology, it shouldnot be feasible for an adversary to distinguish the source, des-tination and the nature of the messages. Meanwhile, satisfyingsuch requirements is not trivial in self-healing networks. Laterin section IV-D we discuss how in OnionBots, the bot masteris able to access and control any bot.

Execution: at this stage the bots execute the commandsgiven by the botmaster (e.g., bitcoin mining, sending spam [43]or DDoS attack [44]), after authenticating them. Recentlybotmasters started offering botnet-as-a-service [45] as it waspreviously predicted by researchers in 2008 [46]. Consideringthat the OnionBots make use of cryptographic block beyondthe basic, trivial encryption/decryption of payload, it allowsthem to offer the botnet for rent. In section IV-E, we explainhow this can be done, in a distributed way, and without furtherintervention of the botmaster.

In the next sections we will focus on describing the keymechanisms of OnionBots.

B. Bootstrap

As mentioned previously the bootstrapping is an essentialpart of network formation in peer-to-peer networks. Addition-ally, in OnionBots, it provides the foundation for he self-healing graph construction. In the following, we study differentapproaches and their trade-offs. We discuss how these conceptsshould be adapted to the context of a privacy infrastructuresuch as Tor. Note that, the address of a peer list in ourprotocol refers to the .onion address of the peers, unlessstated otherwise.

• Hardcoded peer list: in this setting each bot has a listof other bots to contact at the beginning. Since theinfections can be carried out by bots, this new peerlists can be updated. Each peer upon infecting anotherhost will send a subset of its peer list. Each node in theoriginal peer list will be included in the subset withprobability p. In the conventional botnets this schemeis vulnerable to detection and blacklisting. However,in OnionBots, the .onion address is decoupled formIP address, and changes periodically as it is describedin section IV-D. Therefore the current mitigations arenot applicable.

• Hotlists (webcache): this is conceptually similar tothe hardcoded peer list. However each bot has a listof peers to query for other peers. In this setting, theadversary (defenders) will only have access to a subsetof servers, since each bot only has a subset of theaddresses, and these subsets can be updated uponinfection or later in the waiting stage.

• Random probing: in this scheme a bot randomlyqueries the list of possible addresses, until it finds abot listening on that address. Although it can be usedin IPv4 and IPv6 [47] networks, it is not feasible in thecontext of Tor .onion addresses. Since the addressspace is intractable (to craft an address with specific

Page 5: OnionBots: Subverting Privacy Infrastructure for Cyber Attacks · nets’ sophistication will rely on subverting privacy infrastruc-ture and a non-trivial use of cryptographic mechanisms

first 8 letters, takes about 25 days [48]), to randomlyquery all possible .onion addresses requires probingan address space of size 3216.

• Out-of-band communication: the peer list can be trans-mitted through another infrastructure. For example byusing a peer-to-peer network such as BitTorrent andMainline DHT to store and retrieve peer lists, or byusing social networks, such as Twitter, Facebook orYouTube.

We envision that OnionBots would use a customized ap-proach based on hardcoded peer list and hotlists. As mentionedearlier in OnionBots the blacklisting of nodes is not practical,since their address changes periodically. In the followingsection we describe how OnionBots address the bootstrappingand recruitment during network formation and maintenance.

C. Maintenance of the OnionBot Communication Graph

OnionBots form a peer-to-peer, self-healing network thatmaintains a low degree and a low diameter with other bots torelay messages. Peer-to-peer networks are broadly categorizedas structured and unstructured [49], where both categories areused by botnets, and studied in previous work [31], [30], [50].However, the already existing peer-to-peer networks are gen-eral in terms of their operations. Therefore, their design andresiliency is based on different assumptions and requirements.In the following, we propose a Dynamic Distributed SelfRepairing (DDSR) graph, a new peer-to-peer construction thatis simple, stealthy and resilient. Furthermore it is an overlaynetwork, formed over a privacy infrastructure such as Tor.

Neighbors of Neighbor Graph: In this section, we in-troduce DDSR graph construct that is used in the networkformation of OnionBots. The proposed construct is inspiredby the knowledge of Neighbors-of-Neighbor (NoN). Previouswork [51] studied the NoN greedy routing in peer-to-peernetworks, where it can diminish route-lengths, and is asymp-totically optimal. In this work we discuss how NoN conceptscan be used to create a self-healing network.

Consider graph G with n nodes (V ), where each node ui,0 ≤ i < n, is connected to a set of nodes. The neighbors ofui, are denoted as N(ui). Furthermore, ui has the knowledgeof nodes that are connected to N(ui). Meaning that each nodealso knows the identity of its neighbor’s neighbors. In thecontext of our work the identity is the .onion address.

Repairing: When a node ui is deleted, each pair of itsneighbors uj , uk will form an edge (uj , uk) iff (uj , uk) /∈ E,where E is the set of existing edges. Figure 3 depicts thenode removal and the self repairing process in a 3-regulargraph with 12 nodes. The dashed red lines indicate the newlyestablished links between the nodes. For example, as we cansee if we remove one of the nodes (7), its neighbors (0, 1, 4)start to find a substitute for the delete node (7), to maintain theaforementioned requirements. In this case the following edgesare created: (0, 1), (1, 4), and (1, 4).

The basic DDSR graph outlined in the previous paragraphdoes not deal with the growth in the connectivity degree ofeach node, denoted by d(u); after multiple deletions the degreeof some nodes can increase significantly. Such increase in thenodes degree is not desirable for the resiliency and stealth of

the botnet, therefore we introduce a pruning mechanism tokeep the nodes degree in the range [dmin, dmax]. Note thatdmin is only applicable as long as there are enough survivingnodes in the network.

Pruning: Consider the graph G, when a node ui is deleted,each one of its neighbors, starts the repairing process. Howeverthis scheme causes degree of the neighbors of node ui, toincrease significantly after t steps (deletions). To maintainthe degree in the aforementioned range([dmin, dmax]), eachneighboring node of the deleted node (ui), deletes the highestdegree node from its peer list. If there is more than one suchcandidate, it randomly selects one among those for deletion,until its degree is in the desired range. Removing the nodeswith the highest degree, maintains the reachability of all nodes,and the connectivity of the graph.

Forgetting: In the proposed OnionBot, nodes forget the.onion address of the pruned nodes. Additionally, to avoiddiscovery, mapping and further blocking, each bot can peri-odically change his .onion address and announce the newaddress to his current peer list. The new .onion address isgenerated based on a secret key and time. This periodic changeis possible because of the decoupling between IP address andthe bots that is provided by Tor. Later, in section IV-D weexplain how the C&C is able to directly reach each bot, evenafter they change their address.

D. Command and Control Communication

In this section, we show how Tor enables a communicationchannel with C&C that is stealthy, and resilient. As mentionedbefore, OnionBot is a non IP address based construction, there-fore current techniques to detect and disable the C&C (e.g.,IP blacklisting and DNS traffic monitoring) are ineffective.

In OnionBot we assume two classes of messages: 1)messages from C&C to the bots and 2) messages from bots toC&C. The messages from C&C can be either directed to anindividual node(s) (e.g., a maintenance message telling a botto change it peers) or directed to all bots (e.g., DDoS attackon example.com). Furthermore, the botmaster can setup groupkeys to send encrypted messages for a group of bots. Whilea bot can tell the difference between a broadcast messageand messages directed individual bot(s), it is not able toidentify the source, the destination and the nature of thesemessages. Therefore the authorities are not able to detectdifferent messages and drop harmful message and only allowthe maintenance message to pass through. As a result they cannot create the illusion that the botnet is operational, when it isactually neutralized.

In OnionBot, the bots report their address to C&C, andestablish a unique key to be shared with botmaster ats theinfection/rally stage. This allows C&C to have direct access tothe bots, even after they change their .onion address. Eachbot generates a symmetric key, KB and reports it to the C&C;by encrypting KB with the hard coded public key of the C&C({KB}PKCC

). After establishing the key, bots can periodicallychange their .onion address based on a new private key gen-erated using the following recipe, generateKey(PKCC,H (KB, ip)). Where, H is a hash function, and ip is theindex of period (e.g., day). All messages are of the same

Page 6: OnionBots: Subverting Privacy Infrastructure for Cyber Attacks · nets’ sophistication will rely on subverting privacy infrastruc-ture and a non-trivial use of cryptographic mechanisms

4

5

7

6

0

1

2

119

8

3

10

4

5

6

0

1

2

119

8

3

10

4

5

6

0

1

2

9

8

3

10

4

5

6

0

1

2

9

3

10

4

5

6

0

1

2

9

3

4

5

6

0

1

23

4

5

6

0

23

5

6

0

23

(1) (2) (3) (4)

(5) (6) (7) (8)

7

11

8

10

91

4

Fig. 3: Node removal and the self repairing process in a 3-regular graph with 12 nodes. The dashed red lines, indicate the newlyestablished links between the nodes.

Botnet Crypto Signing ReplayMiner none none yesStorm XOR none yes

ZeroAccess v1 RC4 RSA 512 yesZeus chained XOR RSA 2048 yes

TABLE I: Cryptographic use in different botnets.

fixed size, as they are in Tor. Furthermore, to achieve indistin-guishability between all messages, we use constructions suchas Elligator [52]. As a result no information is leaked to therelaying bots.

E. Operation

While many current botnets lack adequate secure commu-nications [53] (e.g., sending messages in plaintext) that leavesthem open to hijacking, the OnionBot’s communication iscompletely encrypted since it uses Tor and SSL. Note that thethe encryption keys are unique to each link. Table I summarizesa number of botnet families and their lack of adequate cryptoblocks, after discovery and reverse engineering [53]. Further-more, we introduce new cryptographic blocks that enable theOnionBot to offer new services, such as a botnet-for-rent [46]and a distributed computation platform for rent.

To achieve the aforementioned services, we need to accountfor three aspects of the messages: 1) authenticity, 2) expirationtime, and 3) legitimacy. Public key encryption and certificatesbased on the chain of trust, are suitable candidates to solvethe authenticity and the legitimacy of the messages, andthe expiration of the message (rental contract term) can beaddressed by using timestamps. In the following we describethe details of such operation.

Imagine Trudy wishes to rent the botnet from Mallory, andevery bot has the public key of Mallory hardcoded. Trudysends her public key PKT to Mallory, to be signed by theprivate key of Mallory SKM . The signed message (TT ) actsas a token containing PKT , an expiration time, and a list ofwhitelisted commands. When Trudy wants to issue a commandto her rented bots, she signs her command by using her privatekey SKT and includes TT . The bots are able to verify thelegitimacy of such commands, by looking at the token and thesignature of the message.

As a bussiness operation, Trudy pays Mallory using Bit-coin, where the whole transaction can be carried out overSilk Road 2.0 [54]. Furthermore Mallory can instruct herbots to install computation platforms such as Java VirtualMachine (JVM). By doing so, she can also offer a cross-platform distributed computation infrastructure to carry outCPU intensive tasks, such as bitcoin mining or passwordcracking.

V. ONIONBOTS EVALUATION

To evaluate the envisioned OnionBots, we look at twoaspects: the self-healing network formation resilience perfor-mance and the resilience to analysis techniques, such as botnetmapping, hijacking, or even assessing the size of the botnet.The NoN look-ahead routing is proven to be asymptoticallyoptimal, however such claims have not been studied in thecontext of self-healing networks. Although it is desirable torigorously prove properties of such networks, in this work weuse empirical data and simulations for evaluation.

A. Mapping OnionBot

OnionBots provide a more resilient structure by usingfeatures available in the Tor network that previous botnets

Page 7: OnionBots: Subverting Privacy Infrastructure for Cyber Attacks · nets’ sophistication will rely on subverting privacy infrastruc-ture and a non-trivial use of cryptographic mechanisms

0 200 400 600 800 1000 1200 1400Nodes Deleted

0.0

0.2

0.4

0.6

0.8

1.0Cl

osen

ess

Cent

ralit

ydeg = 5deg = 10deg = 15

(a) without pruning

0 200 400 600 800 1000 1200 1400Nodes Deleted

0.0

0.2

0.4

0.6

0.8

1.0

Clos

enes

s Ce

ntra

lity

deg = 5deg = 10deg = 15

(b) with pruning

0 200 400 600 800 1000 1200 1400Nodes Deleted

0.0

0.2

0.4

0.6

0.8

1.0

Degr

ee C

entr

ality

deg = 5deg = 10deg = 15

(c) without pruning

0 200 400 600 800 1000 1200 1400Nodes Deleted

0.000

0.002

0.004

0.006

0.008

0.010

Degr

ee C

entr

ality

deg = 5deg = 10deg = 15

(d) with pruning

Fig. 4: The average closeness centrality (4a, 4b) and degree centrality (4c, 4d) of nodes in a k-regular graph, (k = 5, 10, 15)with 5000 nodes after 30% node deletions, with and without pruning.

lack. All OnionBot nodes are directly accessible, even thoserunning behind NAT, compared to previous work [55]. If a botis captured and the address (.onion) of other bots is revealed,it is still not practical to block the bots. Additionally, bots canperiodically change their .onion address, and share it onlywith their operational peers. Therefore limiting the exposureof the bot’s address. As a result one single .onion could beblocked as we later discuss in section VI, but it is not feasibleto block all of them.

B. OnionBot Network Resilience

To evaluate the resiliency and performance of the selfrepairing construction we use some of the metrics that areused in graph theory, such as the changes on graph centralityafter node deletions. Centrality metrics examined in previousstudies [56], [57] include closeness centrality and degreecentrality.

The closeness centrality of node u, is the inverse of sumof the shortest paths between node u to all n− 1 other nodes.Since the sum of distances depends on the number of nodes,it is normalized.

C(u) =n− 1∑

v 6=u d(u, v)

Where n is the number of nodes, and d(u, v) is the shortestpath between nodes u and v. It is an indication of how fastmessages can propagate in the network, from a node, v, to allother nodes sequentially.

The degree centrality of a node u is the number of itsneighbors. The degree centrality values are normalized by themaximum possible degree in graph G. Therefore it is thefraction of nodes that u is connected to. It is an indicationof immediate chance of receiving whatever is flowing throughthe network (e.g., messages).

Another metric that we explore and is overlooked byprevious work, is the diameter of the graph. The diameterof a graph is defined as the longest shortest path (geodesicdistance) in the graph. It is formally defined as the maximumof d(u, v), ∀u, v, and provides a lower bound on worst casedelay.

While a theoretical analysis is more desirable, it is alsomuch harder. In the following, we resort to simulation to geta good sense of the properties of OnionBot. We simulate thenode deletion process in a k-regular graph, (k = 5, 10, 15)of 5000 nodes, with up to 30% (1500) node deletions. Fig-ure 4 illustrates the average closeness centrality with pruning(Figure 4b) and without pruning (Figure 4a). As we can seein Figure 4a, closeness centrality of the nodes is stable, andeven after node deletion, it does not decrease. Furthermore wemeasure the degree centrality of the nodes in the aforemen-tioned graph, with pruning (Figure 4d) and without pruning(Figure 4c). As we can see, the degree of nodes increasessignificantly after node deletions without pruning. Low degreecentrality is desirable in advanced persistent attacks (APT).It decreases the chances of detection and take down, becauseof maintaining a low profile and avoiding to raise the alarm.For example Stuxnet only infected maximum of three othernodes [58], to slow down its spread and avoid detection.

To better understand the effect of size, we simulate a smallbotnet of size 5000 [56] and a medium botnet of size 15000.Figure 5 depicts the aforementioned metrics. As we can see inFigures 5a and 5b, the self-repairing graph remains connectedeven when a large portion (90%-95%) of the nodes are deleted,compared to a normal graph (a graph with no self-repairingmechanism). Note that, in a normal graph after 60% nodedeletion, the number of partitions increases sharply. As wecan see in Figures 5c and 5d, the degree centrality slightlyincreases in the DDSR compared to a normal graph, sincethe healing process ensures that the degree of the nodes stayswithin the range. However, as we remove the nodes in a normalgraph, the diameter increases until the graph is partitioned,where the diameter is infinite. In OnionBot, as the nodes aredeleted and the number of nodes decreases, the diameter ofthe graph also decreases accordingly (Figures 5e and 5f).

VI. MITIGATION OF BASIC ONIONBOTS

In this section we look at different mitigation strategiesagainst OnionBots. Mitigation and detection can take place atdifferent levels, such as host level or network level. Host levelremediation techniques include the use of anti-virus softwareand frameworks such as the Security Behavior Observatory(SBO) [59]. Because of the scaling limitation of such tech-niques, and the fact that compromised hosts are rarely updatedor patched, we focus on the network level strategies.

Page 8: OnionBots: Subverting Privacy Infrastructure for Cyber Attacks · nets’ sophistication will rely on subverting privacy infrastruc-ture and a non-trivial use of cryptographic mechanisms

0 1000 2000 3000 4000 5000Nodes Deleted

0

50

100

150

200

250

Con

nect

ed C

ompo

nent

s

DDSRNormal

(a)

0 2000 4000 6000 8000 10000 12000 14000Nodes Deleted

0

100

200

300

400

500

600

700

Conn

ecte

d Co

mpo

nent

s

DDSRNormal

(b)

0 1000 2000 3000 4000 5000Nodes Deleted

0.00

0.01

0.02

0.03

0.04

0.05

Degr

ee C

entr

ality

DDSRNormal

(c)

0 2000 4000 6000 8000 10000 12000 14000Nodes Deleted

0.00

0.01

0.02

0.03

0.04

0.05

Degr

ee C

entr

ality

DDSRNormal

(d)

0 1000 2000 3000 4000 5000Nodes Deleted

0

2

4

6

8

10

12

Dia

met

er

DDSRNormal

(e)

0 2000 4000 6000 8000 10000 12000 14000Nodes Deleted

0

2

4

6

8

10

Dia

met

er

DDSRNormal

(f)

Fig. 5: Graphs depicting the number of connected components,average degree centrality and graph diameter, after incrementalnode deletions, in a 10-regular graph of 5000 (left side) and15000 (right side) nodes.

0 2000 4000 6000 8000 10000 12000 14000Nodes

0

1000

2000

3000

4000

5000

6000

Node

s De

lete

d

Graphf(x)=.4 * x

Fig. 6: Partitioning of graphs after removing nodes. Thenetwork becomes partitioned after removing on average about40% of the nodes, in 10-regular graphs of size n=1000, ton=15000.

Many of the current detection and mitigation mecha-nisms are IP-based (e.g., the WOMBAT attack attributionmethod [60]), and use the network traffic patterns or DNSqueries to distinguish legitimate traffic from malicious traffic.However current solutions do not work with the OnionBots,since the Tor traffic is encrypted, non IP-based, and thereare no conventional DNS queries to resolve the .onionaddresses. Furthermore, even if an adversary captures a botsample (e.g., by using honeypots or other similar techniques),and recovers the .onion address of its peers, he is stillunable to directly map these addressees to their correspondingIP addresses and take down the infected hosts. Since theproposed construction offers a self-repairing low-degree, low-diameter network even after taking over a large portion ofthe bots, the botnet remains functional. As Figure 6 shows,an adversary needs to take down about the 40% of the botssimultaneously, to even partition the network into 2 subgraphs.Note that, it means there is not enough time for the graphto self-repair. As we can see the conventional solutions thatignore the privacy infrastructure construction of OnionBots arenot effective, therefore we need to adapt our detection andmitigation methods, and integrate them into the foundation ofsuch infrastructures. In this section we divide network levelmitigations into two categories; techniques that are generic toTor, and schemes that are specific to OnionBot. In particular,we propose a new OnionBot specific mitigation method, calledSybil Onion Attack Protocol (SOAP).

A. Targeting OnionBots Through Privacy Infrastructures

Generic mitigations targeting Tor are based on denyingaccess to the bots through the HSDirs. As described be-fore, the list of HSDirs can be calculated by any en-tity who knows the .onion address (in case there is nodescriptor-cookie). Hence an adversary can inject herrelay into the Tor network such that it becomes the relay re-sponsible for storing the bot’s descriptors. Since the fingerprintof relays is calculated from their public keys, this translatesinto finding the right public key [8]. Nevertheless, it should benoted that an adversary needs to position herself at the rightposition in the ring at least 25 hours before (it takes 25 hoursto get the HSDir flag). It is difficult to mitigate against manybots, since the adversary requires the computation power, anda prior knowledge of the .onion addresses. Furthermore itdisrupts the operation and user experience of the Tor network.

A more long term approach involves making changes to theTor, such as use of CAPTACHAs, throttling entry guards andreusing failed partial circuits, as described in [61]. Having saidthat, these mitigations are limited in their preventive power,open the door to censorship, degrade Tor’s user experience, andare not effective against advanced botnets such as OnionBot.

B. Sybil Onion Attack Protocol (SOAP)

We devised a mitigation mechanism that uses OnionBots’very own capabilities (e.g., the decoupling of IP address andthe host) against them. We first overview the attack here, andthen provide a step by step explanation as depicted in Figure 7.To attack the botnet and neutralize it, we first need to find thebots .onion address. This can be done, either by detectingand reverse engineering an already infected host, or by usinga set of honeypots. Although this is not a trivial task, and

Page 9: OnionBots: Subverting Privacy Infrastructure for Cyber Attacks · nets’ sophistication will rely on subverting privacy infrastruc-ture and a non-trivial use of cryptographic mechanisms

Fig. 7: Soaping attack: node T is under attack by the compromised node C and its clones. In each step one of the clonesinitiates the peering process with the T, until it is contained. After several iterations, the network is partitioned, and the botnetis neutralized.

requires a significant amount of effort, it allows us to infiltratethe botnet, traverse its network, and identify the other bots.After identify the bots .onion address, we run many hiddenservices, disclosing a subset of these as neighbors to each peerwe encounter, so gradually over time our clone nodes dominatethe neighborhood of each bot and contain it. Note that we canrun all of the clones on the same machine because of thedecoupling between the IP address and the host.

Figure 7 depicts the soaping attack in different steps.Node T is the target of the soaping attack, nodes Ni, are itsneighboring bot nodes, and nodes C are the adversary (e.g.,the authorities), and his clones, which are represented withsmall black circles. In step 1, the botnet is operating normally,and none of T ’s neighbors are compromised. In step 2, oneof its peers, N4, is compromised. Then, N4 (now depicted asC), makes a set of clones (the small black circles). In step3, a subset of C’s clones, start the peering process with T ,and declare their degree to be a small random number, whichchanges to avoid detection (e.g., d=2). Doing so increasesthe chances of being accepted as a new peer, and replacingan existing peer of T . In step 4, T forgets about one of itsneighbors with the highest degree, N3, and peers with one theclones. The clones repeat this process until T has no more

benign neighbors (steps 5-8). As a result, T is surrounded byclones and is contained (step 9). As we can see after manyiterations the adversary can partition the network into a set ofcontained nodes, and neutralizing the botnet. In section VII,we discuss how the attackers can withstand the soaping attack,by using sophisticated detection and mitigation mechanisms,such as probing and proof of work.

VII. BEYOND BASIC ONIONBOTS

As the authorities design mitigation techniques againstadvanced botnets such as OnionBost, the attackers will evolvetheir infrastructure to evade detection and blocking. Thisarms race, results in the design and deployment of moresophisticated generation of OnionBots that limit the mitigationefforts. Such increased complexity, introduces new challenges,both for authorities and attacker. In the following we brieflydiscuss a few of them.

A. Overcoming SOAP

Although basic OnionBots are susceptible to the soapingattack, the attacker can mitigate against them, by using proof ofwork and rate limiting. In the proof of work scheme each new

Page 10: OnionBots: Subverting Privacy Infrastructure for Cyber Attacks · nets’ sophistication will rely on subverting privacy infrastruc-ture and a non-trivial use of cryptographic mechanisms

node needs to do some work before being accepted as a peerof an already existing node. As more nodes request peeringwith a node, the complexity of the task is increased to givepreference to the older nodes. The same approach can be usedin the rate limiting, where the delay of accepting new nodesis increased proportional to the size of peer list. Althoughsuch actions increase the adversarial resilience of the network,they also decrease the flexibility and the recoverability of thenetwork. Finding the right balance between the recoverabilityand adversarial resilience is an open question that the researchcommunity needs to study in detail to allow the preemptivedesign of effective detection and mitigation mechanisms. Ad-ditionally the attacker can make the NoN construction moreresilient, and create a SuperOnionBot, by fully utilizing thedecoupling provided by Tor.

B. SuperOnionBots

Even though basic OnionBots exploit the decoupling pro-vided by Tor, they do not fully utilize the decoupling ofphysical host, IP address and the .onion address. Notethat a single physical host with one IP address can hostmany .onion addresses. By considering the aforementionedfeature, we envision a new botnet formation called SuperOnion(SO). This construction is consist of n SOs (physical hosts)and each SO simulates m virtual nodes, and each virtual nodeis connected to i other virtual nodes; a total of n ∗m virtualnodes, and m ∗ i virtual peers per physical node. Although inthis construct each virtual nodes is still susceptible to soapingattack, the physical hosting node is immune to such attacks,as long as one of its m virtual nodes is not soaped. Figure 8illustrates a SuperOnion construction, with n = 5, m = 3, i =2.

To ensure the connectivity of the network, the hosting nodeperiodically initiates a connectivity test by sending a probemessage from each one of its m virtual nodes, and expectingto receive the message at its m − 1 other virtual nodes. Tomaintain its stealth, the hosting node uses flooding techniqueswith low message complexity, such as gossiping. We makethe assumption that the authorities are legally liable [62],and they can not participate in the botnet activity. Since themessages are encrypted and indistinguishable, the authoritiesare not able to drop certain message and only allow theconnectivity probe messages to pass through. If certain virtualnodes don’t receive the messages, the host can deduce that theyare soaped. After a physical nodes realized one of its virtualnodes is soaped, it creates a new virtual nodes, and initiates thebootstrapping stage, using peers from its currently connectedvirtual nodes. As we can see, distinguishing between the honestand compromised bots, translates into a variation of Byzantinegenerals problem [63]. We plan to investigate the operation ofbots in such Byzantine environment in more detail [64], [65].

VIII. RELATED WORK

In this section we look at other work that examine alterna-tive botnet constructions. However, they still rely on traditionalmodels, which makes them vulnerable to the current detectionand mitigation, once their design is known.

Stranerger et al. [50], introduce a botnet communicationprotocol, called Overbot. Their design leverages Kademila

Fig. 8: SuperOnion construction, with n = 5, m = 3, i = 2

peer-to-peer protocol, a distributed hash table (DHT) used bymany peer-to-peer applications. They investigate the possibil-ities of using the existing protocol to design stealth C&Cchannels. The bot uses the 160-bit hash values in a searchrequest to announce it’s sequence number, which is encryptedwith the public key of the botmaster. Later this sequencenumber is used to send commands to the bot.

Nappa et al. [66], propose a parasitic botnet protocol thatexploits Skype overlay network. Skype provides a widespreadresilient network with a large install base for C&C infrastruc-ture. The communications between the master and the botsare encrypted using adhoc schemes. The protocol broadcastsmessages to all peers in the network, similar to the algorithmsused in Gnutella. Once each peer receives a new message itpasses it to all of its neighbors.

Vogt et al. [67], examine the possibility of creating a super-botnet by splitting a large botnet into many smaller botnets.Each smaller botnet in the super-botnet network, stores somerouting information on how to communicate with the rest of thenetwork. They use a tree-structured infection process, whereeach new zombie learns how many additional host it shouldinfect and add to its botnet. This design results in a connectedgraph, with many densely connected cliques.

Lee and Kim [68] explore the design and mitigationof botnets that use URL shortening services (USSes) foralias fluxing. A botmaster uses the USSes to hide andobfuscate IP address of the C&C by using a dictionaryof 256 words for each part of an IPv4. For example10.15.43.89 can be mapped to “Brown.Fox.Jumps.Over.” Thenthis expression is transformed into a search query, suchas google.com/q?=Brown+Fox+Jumps+Over. Using the URLshortening service, bots can find the corresponding IP addressby using the same dictionary.

Wang et al. [55] design a hybrid peer-to-peer botnet,which is composed of servant and client bots. Their botnetcommunicates with a fixed number of peers contained in eachbot to limit the node exposure. The botmaster can control,monitor and update the bots by sending the messages throughservant bots, and getting the reports from a sensor host. Thesemessages are encrypted using individualized predefined ordynamically generated keys.

Page 11: OnionBots: Subverting Privacy Infrastructure for Cyber Attacks · nets’ sophistication will rely on subverting privacy infrastruc-ture and a non-trivial use of cryptographic mechanisms

IX. CONCLUSION

Privacy infrastructures such as Tor had a tremendous im-pact on society, protecting users anonymity and rights to accessinformation in the face of censorship. It also opened the door toabuse and illegal activities [69], [61], such as ransomware [7],and a marketplace for drugs and contraband [70], [6]. In thiswork we envisioned OnionBots, and investigated the potentialof subverting privacy infrastructures (e.g., Tor hidden services)for cyber attacks. We presented the design of a robust andstealthy botnet that lives symbiotically within these infrastruc-tures to evade detection, measurement, scale estimation andobservation. It is impossible for Internet Service Providers(ISP) to effectively detect and mitigate such botnet, withoutblocking all Tor access. Additionally, OnionBots rely on a self-healing network formation that is simple to implement, yet ithas desirable features such as low diameter and low degree.Such botnets are robust to partitioning even if a large fractionof the bots is simultaneously taken down. In the scenario of agradual take down of nodes, the network is also able to self-repair, even up to 90% nodes deletions. More importantly, wedeveloped soaping, a novel mitigation attack that neutralizesthe basic OnionBots. We also suggested mitigations that actat the Tor level. Finally, we discussed how an attacker candesign advanced botnets (SuperOnionBots) that fully utilize thedecoupling provided by Tor and are immune to soaping attacks.There are still many challenges that need to be preemptivelyaddressed by the security community, we hope that this workignites new ideas to proactively design mitigations against thenew generations of crypto-based botnets.

REFERENCES

[1] R. A. Rodrıguez-Gomez, G. Macia-Fernandez, and P. Garcıa-Teodoro,“Survey and taxonomy of botnet research through life-cycle,” ACMComputing Surveys (CSUR), vol. 45, no. 4, August 2013.

[2] S. S. Silva, R. M. Silva, R. C. Pinto, and R. M. Salles, “Botnets: Asurvey,” Computer Networks, vol. 57, 2013.

[3] “Know your enemy: Fast-flux service networks,” http://www.honeynet.org/papers/ff/, July 2007.

[4] “The inevitable move - 64-bit zeus enhancedwith tor,” http://securelist.com/blog/events/58184/the-inevitable-move-64-bit-zeus-enhanced-with-tor/, December2013.

[5] “Chewbacca - a new episode of tor-based mal-ware,” http://securelist.com/blog/incidents/58192/chewbacca-a-new-episode-of-tor-based-malware/, December 2013.

[6] N. Christin, “Traveling the silk road: A measurement analysis of alarge anonymous online marketplace,” in Proceedings of the 22NdInternational Conference on World Wide Web, ser. WWW, 2013.

[7] “Cryptolocker ransomware,” http://www.secureworks.com/cyber-threat-intelligence/threats/cryptolocker-ransomware/, December2013.

[8] A. Biryukov, I. Pustogarov, and R. Weinmann, “Trawling for tor hiddenservices: Detection, measurement, deanonymization,” in Security andPrivacy (SP), 2013 IEEE Symposium on, 2013.

[9] M. Bailey, E. Cooke, F. Jahanian, Y. Xu, and M. Karir, “A survey ofbotnet technology and defenses,” in Proceedings of the 2009 Cyberse-curity Applications & Technology Conference for Homeland Security,ser. CATCH, 2009.

[10] J. Liu, Y. Xiao, K. Ghaboosi, H. Deng, and J. Zhang, “Botnet:Classification, attacks, detection, tracing, and preventive measures,”EURASIP J. Wirel. Commun. Netw., 2009.

[11] N. Daswani, T. G. C. Quality, S. Teams, and G. Inc, “The anatomy ofclickbot.a,” in In USENIX Hotbots, 2007.

[12] G. Gu, R. Perdisci, J. Zhang, W. Lee et al., “Botminer: Clusteringanalysis of network traffic for protocol-and structure-independent botnetdetection.” in USENIX Security Symposium, 2008.

[13] E. Cooke, F. Jahanian, and D. McPherson, “The zombie roundup:Understanding, detecting, and disrupting botnets,” in Proceedings of theSteps to Reducing Unwanted Traffic on the Internet on Steps to ReducingUnwanted Traffic on the Internet Workshop, ser. SRUTI, 2005.

[14] F. C. Freiling, T. Holz, and G. Wicherski, “Botnet tracking: Explor-ing a root-cause methodology to prevent distributed denial-of-serviceattacks,” in Proceedings of 10 th European Symposium on Research inComputer Security, ESORICS, 2005.

[15] M. Abu Rajab, J. Zarfoss, F. Monrose, and A. Terzis, “A multifacetedapproach to understanding the botnet phenomenon,” in Proceedings ofthe 6th ACM SIGCOMM Conference on Internet Measurement, ser.IMC, 2006.

[16] J. P. John, A. Moshchuk, S. D. Gribble, and A. Krishnamurthy,“Studying spamming botnets using botlab,” in Proceedings of the 6thUSENIX Symposium on Networked Systems Design and Implementation,ser. NSDI, 2009.

[17] R. Perdisci, W. Lee, and N. Feamster, “Behavioral clustering ofhttp-based malware and signature generation using malicious networktraces,” in Proceedings of the 7th USENIX Conference on NetworkedSystems Design and Implementation, ser. NSDI, 2010.

[18] B. Stone-Gross, M. Cova, L. Cavallaro, B. Gilbert, M. Szydlowski,R. Kemmerer, C. Kruegel, and G. Vigna, “Your botnet is my botnet:Analysis of a botnet takeover,” in Proceedings of the 16th ACMConference on Computer and Communications Security, ser. CCS,2009.

[19] P. Porras, H. Saıdi, and V. Yegneswaran, “A foray into conficker’slogic and rendezvous points,” in Proceedings of the 2Nd USENIXConference on Large-scale Exploits and Emergent Threats: Botnets,Spyware, Worms, and More, ser. LEET, 2009.

[20] M. Antonakakis, R. Perdisci, Y. Nadji, N. Vasiloglou, S. Abu-Nimeh,W. Lee, and D. Dagon, “From throw-away traffic to bots: Detecting therise of DGA-based malware,” in Presented as part of the 21st USENIXSecurity Symposium (USENIX Security), 2012.

[21] S. Yadav, A. K. K. Reddy, A. Reddy, and S. Ranjan, “Detectingalgorithmically generated malicious domain names,” in Proceedings ofthe 10th ACM SIGCOMM conference on Internet measurement, 2010.

[22] S. Yadav, A. Reddy, A. Reddy, and S. Ranjan, “Detecting algo-rithmically generated domain-flux attacks with DNS traffic analysis,”Networking, IEEE/ACM Transactions on, 2012.

[23] M. Antonakakis, R. Perdisci, W. Lee, N. Vasiloglou, II, and D. Dagon,“Detecting malware domains at the upper DNS hierarchy,” in Proceed-ings of the 20th USENIX Conference on Security, ser. SEC, 2011.

[24] M. Antonakakis, R. Perdisci, D. Dagon, W. Lee, and N. Feamster,“Building a dynamic reputation system for DNS,” in Proceedings ofthe 19th USENIX Conference on Security, 2010.

[25] L. Bilge, E. Kirda, C. Kruegel, and M. Balduzzi, “EXPOSURE : Findingmalicious domains using passive DNS analysis,” in NDSS, 18th AnnualNetwork and Distributed System Security Symposium, 2011.

[26] F. Tegeler, X. Fu, G. Vigna, and C. Kruegel, “Botfinder: Finding botsin network traffic without deep packet inspection,” in Proceedings ofthe 8th International Conference on Emerging Networking Experimentsand Technologies, ser. CoNEXT, 2012.

[27] L. Bilge, D. Balzarotti, W. Robertson, E. Kirda, and C. Kruegel, “Dis-closure: Detecting botnet command and control servers through large-scale netflow analysis,” in Proceedings of the 28th Annual ComputerSecurity Applications Conference, ser. ACSAC, 2012.

[28] A. Mohaisen, O. Alrawi, A. G. West, and A. Mankin, “Babble:Identifying malware by its dialects,” in IEEE Communications andNetwork Security, 2013.

[29] A. G. West and A. Mohaisen, “Metadata-driven threat classificationof network endpoints appearing in malware,” DIMVA: Proceedingsof the 11th Conference on Detection of Intrusions and Malware &Vulnerability Assessment, 2014.

[30] T. Holz, M. Steiner, F. Dahl, E. Biersack, and F. Freiling, “Measure-ments and mitigation of peer-to-peer-based botnets: A case study onstorm worm,” in Proceedings of the 1st Usenix Workshop on Large-Scale Exploits and Emergent Threats, ser. LEET, 2008.

Page 12: OnionBots: Subverting Privacy Infrastructure for Cyber Attacks · nets’ sophistication will rely on subverting privacy infrastruc-ture and a non-trivial use of cryptographic mechanisms

[31] S. Stover, D. Dittrich, J. Hernandez, and S. Dietrich, “Analysis of thestorm and nugache trojans: P2P is here,” in ;login, 2007.

[32] B. Stock, J. Gobel, M. Engelberth, F. C. Freiling, and T. Holz,“Walowdac - analysis of a peer-to-peer botnet,” in Proceedings of theEuropean Conference on Computer Network Defense, ser. EC2ND,2009.

[33] D. Andriesse, C. Rossow, B. Stone-Gross, D. Plohmann, and H. Bos,“Highly resilient peer-to-peer botnets are here: An analysis of GameoverZeus,” in Malicious and Unwanted Software: ”The Americas” (MAL-WARE), 8th International Conference on, 2013.

[34] S. Nagaraja, P. Mittal, C.-Y. Hong, M. Caesar, and N. Borisov, “Botgrep:Finding P2P bots with structured graph analysis,” in Proceedings of the19th USENIX Conference on Security, ser. USENIX Security, 2010.

[35] J. Zhang, R. Perdisci, W. Lee, U. Sarfraz, and X. Luo, “Detectingstealthy P2P botnets using statistical traffic fingerprints,” in DependableSystems Networks (DSN), IEEE/IFIP 41st International Conference on,2011.

[36] T.-F. Yen and M. Reiter, “Are your hosts trading or plotting? telling P2Pfile-sharing and bots apart,” in Distributed Computing Systems (ICDCS),IEEE 30th International Conference on, 2010.

[37] B. Coskun, S. Dietrich, and N. Memon, “Friends of an enemy: Identi-fying local members of peer-to-peer botnets using mutual contacts,”in Proceedings of the 26th Annual Computer Security ApplicationsConference, ser. ACSAC, 2010.

[38] R. Dingledine, N. Mathewson, and P. Syverson, “Tor: The second-generation onion router,” in Proceedings of the 13th Conference onUSENIX Security Symposium, 2004.

[39] P. Narang, S. Ray, C. Hota, and V. Venkatakrishnan, “Peershark: De-tecting peer-to-peer botnets by tracking conversations,” in InternationalWorkshop on Cyber Crime (IWCC), 2014.

[40] “2012 data breach investigation report,” http://www.verizonenterprise.com/resources/reports/rp data-breach-investigations-report-2012-ebken xg.pdf, December 2012.

[41] C. Rossow, C. Dietrich, and H. Bos, “Large-scale analysis of malwaredownloaders,” in Detection of Intrusions and Malware, and Vulnerabil-ity Assessment. Springer Berlin Heidelberg, 2013.

[42] R. Potharaju, E. Hoque, C. Nita-Rotaru, S. Sarkar, and S. Venkatesh,“Closing the pandora’s box: Defenses for thwarting epidemic outbreaksin mobile adhoc networks,” in IEEE 9th International Conference onMobile Adhoc and Sensor Systems (MASS), 2012.

[43] O. Thonnard and M. Dacier, “A strategic analysis of spam botnetsoperations,” in Proceedings of the 8th Annual Collaboration, ElectronicMessaging, Anti-Abuse and Spam Conference, ser. CEAS, 2011.

[44] M. Marchetti, M. Colajanni, M. Messori, L. Aniello, and Y. Vigfusson,“Cyber attacks on financial critical infrastructures,” in Collaborativefinancial infrastructure protection: Tools, abstractions and middleware,R. Baldoni and G. Chockler, Eds. Springer, January 2012, ch. 3, pp.53–81.

[45] “Microsoft: Kelihos ring sold ’botnet-as-a-service’,” http://www.darkreading.com/risk-management/microsoft-kelihos-ring-sold-botnet-as-a-service/d/d-id/1100470,September 2011.

[46] R. Hund, M. Hamann, and T. Holz, “Towards next-generation botnets,”in European Conference on Computer Network Defense, EC2ND, 2008.

[47] R. Bless, O. P. Waldhorst, C. P. Mayer, and H. Wippel, “Decentralizedand autonomous bootstrapping for ipv6-based peer-to-peer networks,”in Winning Entry of the IPv6 Contest 2009 by IPv6 Council, 2009.

[48] “Shallot,” https://github.com/katmagic/Shallot, June 2012.[49] E. K. Lua, J. Crowcroft, M. Pias, R. Sharma, and S. Lim, “A survey and

comparison of peer-to-peer overlay network schemes,” CommunicationsSurveys Tutorials, IEEE, 2005.

[50] G. Starnberger, C. Kruegel, and E. Kirda, “Overbot: A botnet pro-tocol based on kademlia,” in Proceedings of the 4th InternationalConference on Security and Privacy in Communication Netowrks, ser.SecureComm, 2008.

[51] G. Singh Manku, M. Naor, and U. Wieder, “Know thy neighbor’sneighbor: the power of lookahead in randomized p2p networks,” inProceedings of the thirty-sixth annual ACM symposium on Theory(STOC), 2004.

[52] D. J. Bernstein, M. Hamburg, A. Krasnova, and T. Lange, “Elligator:Elliptic-curve points indistinguishable from uniform random strings,”in Proceedings of the ACM SIGSAC Conference on Computer andCommunications Security, ser. CCS, 2013.

[53] C. Rossow, D. Andriesse, T. Werner, B. Stone-Gross, D. Plohmann,C. J. Dietrich, and H. Bos, “Sok: P2pwned - modeling and evaluatingthe resilience of peer-to-peer botnets,” in Proceedings of the 2013 IEEESymposium on Security and Privacy, ser. SP, 2013.

[54] “’silk road 2.0’ launches, promising a resurrected black market forthe dark web,” http://www.forbes.com/sites/andygreenberg/2013/11/06/silk-road-2-0-launches-promising-a-resurrected-black-market-for-the-dark-web,November 2013.

[55] P. Wang, S. Sparks, and C. Zou, “An advanced hybrid peer-to-peerbotnet,” IEEE Transactions on Dependable and Secure Computing(DSN), 2010.

[56] T.-F. Yen and M. K. Reiter, “Revisiting botnet models and their implica-tions for takedown strategies,” in Proceedings of the First InternationalConference on Principles of Security and Trust, ser. POST, 2012.

[57] C. Davis, S. Neville, J. Fernandez, J.-M. Robert, and J. McHugh,“Structured peer-to-peer overlay networks: Ideal botnets command andcontrol infrastructures?” in Computer Security - ESORICS 2008, ser.Lecture Notes in Computer Science, 2008.

[58] “W32.stuxnet,” http://www.symantec.com/security response/writeup.jsp?docid=2010-071400-3123-99, February 2013.

[59] A. Forget, S. Komanduri, A. Acquisti, N. Christin, L. F. Cranor, andR. Telang, “Security behavior observatory: Infrastructure for long-termmonitoring of client machines,” 2014.

[60] M. Dacier, V.-H. Pham, and O. Thonnard, “The wombat attack attri-bution method: Some results,” in Proceedings of the 5th InternationalConference on Information Systems Security, ser. ICISS, 2009.

[61] N. Hopper, “Challenges in protecting tor hidden services from botnetabuse,” in Proceedings of the Financial Cryptography and Data Secu-rity, ser. FC, 2014.

[62] P. Wang, L. Wu, R. Cunningham, and C. C. Zou, “Honeypot detectionin advanced botnet attacks,” Int. J. Inf. Comput. Secur., vol. 4, no. 1,Feb 2010.

[63] L. Lamport, R. Shostak, and M. Pease, “The byzantine generalsproblem,” ACM Trans. Program. Lang. Syst., vol. 4, no. 3, July 1982.

[64] Y. Amir, B. Coan, J. Kirsch, and J. Lane, “Prime: Byzantine replicationunder attack,” Dependable and Secure Computing, IEEE Transactionson, vol. 8, no. 4, pp. 564–577, July 2011.

[65] B. Awerbuch, D. Holmer, C. Nita-Rotaru, and H. Rubens, “An on-demand secure routing protocol resilient to byzantine failures,” inProceedings of the 1st ACM Workshop on Wireless Security, ser. WiSE,2002.

[66] A. Nappa, A. Fattori, M. Balduzzi, M. Dell’Amico, and L. Cavallaro,“Take a deep breath: A stealthy, resilient and cost-effective botnet usingskype,” in Proceedings of the 7th International Conference on Detectionof Intrusions and Malware, and Vulnerability Assessment, ser. DIMVA,2010.

[67] R. Vogt, J. Aycock, and M. J. Jacobson, “Army of botnets,” in Proceed-ings of Annual Network and Distributed System Security Symposium(NDSS), 2007.

[68] S. Lee and J. Kim, “Fluxing botnet command and control channels withurl shortening services,” Comput. Commun., 2013.

[69] M. Moser, R. Bohme, and D. Breuker, “An inquiry into money laun-dering tools in the bitcoin ecosystem,” in eCrime Researchers Summit(eCRS). IEEE, 2013.

[70] A. Biryukov, I. Pustogarov, and R.-P. Weinmann, “Content and popu-larity analysis of tor hidden services,” arXiv preprint arXiv:1308.6768,2013.