your botnet is my botnet: analysis of a botnet takeover

39
Your Botnet is My Botnet: Analysis of a Botnet Takeover Ahmed Ali El-Kosairy Nile University IS Prog 121173

Upload: ahmed-ali-el-kosairy

Post on 20-Aug-2015

682 views

Category:

Internet


4 download

TRANSCRIPT

Page 1: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Your Botnet is My Botnet: Analysis of a Botnet

TakeoverAhmed Ali El-Kosairy

Nile University

IS Prog

121173

Page 2: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

281] And fear the Day when ye shall be brought back to Allah. Then shall every soul be paid what it earned, and none shall be dealt with unjustly.َم�ا �ْف�ٍس� َن �ُّل ُك �َو�َّف�ى ُت �َّم� ُث �ِه� الَّل �ل�ى ِإ َّف�يِه� َج�ُع�َوَن� �ْر� ُت �َو�َم�ا َي �ُق�َوا َو�اُت

�ُم�َوَن� �ْظ�َّل َي اَل� َو�ُه�َّم� �ْت� َب �َس� ُك

Page 3: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Outline

• Introduction• Domain flux• Taking control of the Botnet• Botnet analysis• Threats and data analysis• Conclusion

Page 4: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

IntroductionTorpig (a.k.a. Sinowal, or Anserin) botnet for ten days., one of the most advanced pieces of crimeware ever created,” is a type of malware that is typically associated with bank account and credit card theft. However, as we will see, it also steals a variety of other personal information.

Page 5: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Introduction (cont.)

Page 6: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Introduction (cont.)

• Botnets are the primary means for cyber-criminals to carry out their malicious tasks

• sending spam mails

• launching denial-of-service attacks

• stealing personal data such as mail accounts or bank credentials.

Page 7: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Introduction (cont.)

• By collaborating with domain registrars, it is possible to change the mapping of a

botnet domain to a machine which is controlled by the defender .

• Several recent botnets, including Torpig, use the concept of domain flux.

• This is an approach that is similar to botnet takeover attempts of the Kraken [1] and Conficker [32] botnets.

Page 8: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Introduction (cont.)

• Torpig uses Mebroot to get new victims– Mebroot is a rootkit that takes

control of a machine by replacing the system’s Master Boot Record (MBR).

– This allows Mebroot to be executed at boot time, before the operating system is loaded, and to remain undetected by most anti-virus tools.

Page 9: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Introduction (cont.)How Torpig distributes and gets data

Page 10: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Introduction (cont.)

• Torpig uses phishing attacks

• Mebroot provides functionality to manage (install, uninstall, and activate) such additional modules.

• Immediately after the initial reboot, Mebroot contacts the Mebroot C&C server to obtain malicious modules (5). These modules are saved in encrypted form in the system32 directory,

• so that, if the user reboots the machine, they can be immediately reused without having to contact the C&C server again.

• After the initial update, Mebroot contacts its C&C server periodically, in two-hour intervals.

Page 11: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Introduction (cont.)Mebroot injects these modules (i.e., DLLs) into a number of

applications. (services.exe), as web browsers , FTP clients , email clients , instant messengers and system programs (e.g., cmd.exe). After the injection, Torpig can inspect all the data.

Periodically Torpig contacts the Torpig C&C server to upload the data stolen.This communication with the server is also over HTTP.

protected by a simple obfuscation mechanism, based on XORing the clear text with an 8-byte key and base64 encoding. <Broken>

Page 12: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Introduction (cont.)How Torpig distributes and gets data

The C&C server can reply to a bot in one of several ways:

simply acknowledge the data. ( okn response)

In addition, the C&C server can send a configuration file to the bot (we call this reply an okc response).

The configuration file is obfuscated using a simple XOR-11 encoding.

Config file contains new info and updated domains , encryption...etc

Page 13: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Introduction (cont.)

Page 14: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Domain flux

• Botnet authors have identified several ways to make these schemes more flexible and robust against take-down actions, e.g., by using fast-flux techniques .

• With fast-flux, the bots would query a certain domain that is mapped onto a set of IP addresses, which change frequently.

• However, fast-flux uses only a single domain name, which constitutes a single point of failure.

Page 15: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Domain flux,Fast-flux Prob

Page 16: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Domain flux (cont.)

• Torpig solves this issue by using a different technique for locating its C&C servers: domain flux (Using DGA) .

Page 17: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Domain flux (cont.)

DGA:

For example, consider a DGA where every minute the malware connects to the GMT-time-based server address <month><day><year><hour><minute>.com.

• example, on July 31, 2013, at 2:30 PM, the malware would connect to 07 31 13 14 30.com.

•Every time an attacker wants to communicate with their malware, they choose a strike-time and a register the domain corresponding to that strike-time 24 hours before the time is hit.

Page 18: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Domain flux (cont.)

• Kraken was one of the first malware families to use a DGA, beginning around April of 2008

• Although several families such as Torpig and Srizbi have also been known to use DGAs, and the famous Conficker.

Page 19: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Domain flux (cont.)

• The feasibility of these sinkholing attacks depends not only on technical means but also on economic factors.

• Sinkholing : (Sinkholing is a technique that researchers use to redirect the identification of the malicious C&C server to their own analysis server.)

• Trendmicro: ref:http://www.trendmicro.com.tr/media/misc/sinkholing-botnets-technical-paper-en.pdf

Page 20: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Domain flux (cont.)

Page 21: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Taking control of the Botnet

• Author registered the .com and .net domains that were to be used by the botnet from January 25th, 2009 to February 15th, 2009.

• However, on February 4th, 2009, the Mebroot controllers distributed a new Torpig binary that updated the domain algorithm.

Page 22: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Taking control of the Botnet (cont.)

• During the ten days that author controlled the botnet, and collected over 8.7GB of Apache log files and 69GB of pcap data.

• However, on January 19th, when we started our collection, we instantly received HTTP requests from 359 infected machines. ???Why???

Page 23: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Taking control of the Botnet (cont.)

Author protected the victims according to: • PRINCIPLE 1.

– The sinkholed botnet should be operated so that any harm and/or damage to victims and targets of attacks would be minimized.

• PRINCIPLE 2. – The sinkholed botnet should collect

enough information to enable notification and remediation of affected parties.

Page 24: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Taking control of the Botnet (cont.)

Also Author protected the victims according to:

when a bot contacted our server, we always replied with an okn message and never sent it a new configuration file.

By responding with okn, the bots remained in contact only with our servers.

If we had not replied with a valid Torpig response, the bots would have switched over to the .biz

Although we could have sent a blank configuration file to potentially remove the web sites currently targeted by Torpig.

We also did not send a configuration file with a different HTML injection server IP address for the same reasons.

FBI & CERT

Page 25: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Botnet analysis• The submission header and the body are encrypted using

the Torpig encryption algorithm (base64 and XOR).– The header contains the time stamp when the

configuration file was last updated (ts), – the IP address of the bot (ip), – the port numbers of the HTTP and SOCKS proxies

that Torpig opens on the infected machine (hport and sport),

– the operating system version and locale (os and cn),– the bot identifier (nid),– and the build and version number of Torpig (bld and

ver)

Page 26: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Botnet analysis (cont.)

Page 27: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Botnet analysis (cont.)

Page 28: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Botnet analysis (cont.)Botnet sizeBotnet size

• Counting Bots by nid• this value was unique for each machine

and remained constant over time• therefore, it would provide an accurate

method to uniquely identify each bot.• My Botnet is Bigger than Yours

(Maybe, Better than Yours) : , very Good Paper

M. Rajab, J. Zarfoss, F. Monrose, and A. Terzis. My Botnet is Bigger than Yours (Maybe, Better than Yours) : Why Size Estimates Remain Challenging. In USENIX Workshop on Hot Topics in Understanding Botnet, 2007.

Page 29: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Botnet analysis (cont.)

• Authors were able to reconstruct the algorithm used to compute this 8-byte value by reverse engineering the Torpig binary.

• For static, the nid depends on (software or hardware) characteristics of the infected machine’s hard disk.

Page 30: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Botnet analysis (cont.)• the number of unique IP addresses observed

during the ten days.

Page 31: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Botnet analysis (cont.)

Page 32: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Botnet analysis (cont.)Botnet as a service

• Torpig DLLs are marked with a build type represented by the bld field in the header.

• 12 different values for the bld parameter: dxtrbc, eagle, gnh1, gnh2, gnh3, gnh4, gnh5, grey, grobin, grobin1, mentat, and zipp.

• the most convincing explanation ??

Page 33: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Threats and data analysis

• Financial Data Stealing• Torpig is specifically crafted to obtain

information that can be readily monetized in the underground market.

• “man-in-the-browser” phishing attacks

• in ten days of activity, the Torpig controllers may have profited anywhere between $83K and $8.3M.

Page 34: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Threats and data analysis (cont.)• the number of accounts at financial institutions that were

stolen by Torpig and sent to our C&C server.

Page 35: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Threats and data analysis (cont.)

Proxies•Authors wanted to verify if spam was sent through machines in the Torpig botnet. •Torpig has the potential to drag its victims into a variety of malicious activities.

Page 36: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Threats and data analysis (cont.)

Denial-of Service

•using 435 kbps as a conservative estimate for each bot’s upstream bandwidth. The aggregate bandwidth for the DSL/Cable connections is roughly 17 Gbps

•a botnet of this size could cause a massive distributed denial-of-service (DDoS) attack.

Page 37: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Threats and data analysis (cont.)• Password Analysis

• almost 28% of the victims reused their credentials for accessing 368,501 web sites.

Page 38: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Conclusion• Author addresses a comprehensive analysis of

the operations of the Torpig botnet.• First, a naïve evaluation of botnet size based

on the count of distinct IPs yields grossly overestimated results.

• Second, the victims of botnets are often users with poorly maintained machines that choose easily guessable passwords to protect access to sensitive sites.

• Third, interacting with registrars, hosting facilities, victim institutions, and law enforcement is a rather complicated process.

Page 39: Your Botnet is My Botnet:  Analysis of a Botnet Takeover

Thank you & Question?