Saturday, November 21, 2020

BugBounty Hunters Must Know and Use These 10 Google Chrome Features/Tricks

In this video I shared my 10 most favourite Google Chrome Dev Tool features, That I believe all BugBounty hunters / Penetration testers must know and should be using on a day to day basis.






Monday, October 19, 2020

[Video]Building a Machine Learning Based Web Application Firewall/Intrusion Prevention System From Scratch

Recently I started to play around with some machine learning stuffs, and I decided to build a small project related to cyber security. So, I decided to build a Machine Learning based Web Application firewall. 

Disclaimer:  I’ve worked on web application security for a few years; however, this subject (machine learning) is completely new to me. Just because I make a video guides, doesn't mean I know everything, please feel free to correct me if I'm wrong at any point. Full series here

I've used pycaret library to develop this IPS from scratch. Here is the summary of what it does

1. A proxy intercepts  all HTTP request any server.

2. An web application security scanner is fired against a dummy web application

3. The scanner ran in two modes – Crawling Mode and Scanning Mode.

4. The Intercepting proxy logs all the HTTP request generated by the scanner. The crawling and scanning http log exported from the proxy. 

5. A python script parse all http request logs and extracts several features form the raw request. Those features will be used to tarin the model.

6. The exported feature data then fed to kmean’s clustering model for training. We choose to create two clusters. One for good requests and one for bad request.

7. Once the model is trained its deployed and integrated with HTTP proxy in real time.

8. From the live data the IPS tries to detect if any request falls in good cluster and bad cluster and alert user.














Wednesday, August 19, 2020

Beginner's Guide to DFIR/Threat Hunting with VirusTotal Video Series

VirusTotal intelligence allowes threat researchers to search VirusTotal's dataset for malware samples, URLs, domains and IP addresses according to binary properties, antivirus detection verdicts, static features, behavior patterns such as communication with specific hosts or IP addresses, submission metadata and many other notions. Pinpoint files similar to your suspect being studied. Samples matching search criteria can be downloaded for further study.

In this video tutorial series I tried to explain how virus total can be used effectively to hunt threats from wild. This tutorial has following chapters.

  • An Introduction to VirusTotal
  • Introduction to VT Intelligence
  • VT Tags & AND OR NOT Search Operators 
  • Behaviour Based Search Modifiers
  • Live/Realtime Threat Hunting with Yara Rules
  • Basics of Incident Correlation with VT Graph

The full playlist can be found here


Tuesday, August 4, 2020

IDA Pro Video Tutorial Series for Vulnerability Researchers & Reverse Engineers[Beginners]

IDA Pro is a disassembler. A disassembler like IDA Pro is capable of creating maps of their execution to show the binary instructions that are actually executed by the processor in a symbolic representation called assembly language. 

Reverse Engineering Malware, Part 3: IDA Pro Introduction

I recently started a new video tutorial series on IDA Pro for beginner reverse engineers and vulnerability researchers in specific. 

So far the i've covered follwing topics: The entire playlist can be found here.

  • Reverse Engineering Tutorial with IDA Pro – An Introduction
  • Reverse Engineering with IDA Pro – Fixing/Rebuilding Structure/Structs (Pseudocode)
  • C++ Reverse Engineering with IDA Pro – Rebuilding virtual function table (vftable)
  • Reverse Engineering with IDA Pro – Function Cross Reference & Proximity Browser 
  • Reverse Engineering IDA Pro – How to do Binary Diffing - Patch Analysis
  • Reverse Engineering IDA Pro- Code Coverage Measurement with Dynamo Rio & Lighthouse

Just because I make a video guides, doesn't mean I know everything, please feel free to correct me if I'm wrong at any point :-) I will be more than happy to learn from you :)

Monday, July 20, 2020

[Video]Virtual Machine Detection using JavaScript | Malware | Browser Exploit

Virtual Machine / Security sandbox detection is not new in Malware Technology. For virtual machine detection usually, malware needs to have some sort of system level access / should be able to execute certain machine instruction. Is it possible for malicious web page to understand if you are opening the page in any security sandbox? The answer is Yes! In this short video I explain how browser based malware such as browser exploits can use JavaScript to reliably detect whether they are being executed / run inside a security sand box , virtual machine.


Friday, July 17, 2020

[Video]Reflective Dll Injection Explained in 10 Minutes Malware Techniques

Reflective DLL injection is a library injection technique in which the concept of reflective programming is employed to perform the loading of a library from memory into a host process. As such the library is responsible for loading itself by implementing a minimal Portable Executable (PE) file loader. It can then govern, with minimal interaction with the host system and process.


\

Monday, July 13, 2020

Dll Injection Explained in 10 Minutes | Video Tutorial | Basic Malware Techniques Simplified

In computer programming, DLL injection is a technique used for running code within the address space of another process by forcing it to load a dynamic-link library. DLL injection is often used by external programs to influence the behavior of another program in a way its authors did not anticipate or intend. For example, the injected code could hook system function calls,[4][5] or read the contents of password textboxes, which cannot be done the usual way. A program used to inject arbitrary code into arbitrary processes is called a DLL injector. In this short white board video I tried to explain how malwares inject dll files into trusted remote process to execute malicious code.


Friday, July 3, 2020

My First $15,000 Microsoft Windows Insider Preview Bug Bounty | How to Get Started

This video blog explains how can you get started with Windows Inside Preview Bug Bounty Program and Win Big Bounty.


Saturday, June 27, 2020

Dynamic Binary Instrumentation(DBI)Tutorial with Intel PIN for Reverse Engineering Video

Pin is a platform for creating analysis tools. A pin tool comprises instrumentation, analysis and callback routines. Instrumentation routines are called when code that has not yet been recompiled is about to be run, and enable the insertion of analysis routines.



In this video live workshop we discussed various featues of Intel PIN Tool. The playlist is available here

Monday, June 22, 2020

Fixing Windbg Broken Stack Trace using Fake Debugging Symbol Exported From IDA Pro.

If you ever debuged/reversed software for which debugging symbols are not availble using windbg, You might have had hard time understanding broken stack trace. Recently i tried to do some experiment with a tool. In this video I showed how can you export fake debugging symbol from IDA prob. and add them in windbg to fix broken stack trace.



Frida Video Tutorial Series for Reverse Engineers

I decided to create a video tutorial series about basics of Frida and how it can help you automate lot of your reverse engineering effort.

The playlist is availble here 
  1. Frida Tutorial for Reverse Engineers 1 of 10: Installing Frida on Windows
  2. Frida Tutorial for Reverse Engineers 2 of 10: Instrumenting Your First Windows API with frida-trace
  3. Frida Tutorial for Reverse Engineers 3 of 10: Setting up Frida on Android for Instrumentation
  4. Frida Tutorial for Reverse Engineers 4 of 10: Getting Your hands Dirty with Frida's Python Binding
  5. Frida Tutorial for Reverse Engineers 5 of 10: Measuring Code Coverage of a Binary
  6. Frida Tutorial for Reverse Engineers 6 of 10: Instrument Unexported Functions using Debugging Symbol



Video Tutorial Series on Python Winappdbg for Reverse Engineers

In past I've created a few open source projects related to vulnerability research and reversing using python winappdbg module. Sometimes I receive queries/doubts over DM. So I decided to create a video tutorial series about basics of winappdbg and how it can help you automate lot of your reverse engineering effort- to kind of better use of this lock down :)



The playlist is available here 


  1. Python Winappdbg Tutorial for Reverse Engineers 1 of 20: : Installing Winappdbg on Windows Platform
  2. Python Winappdbg Tutorial for Reverse Engineers 2 of 20: Launching Your First App under Debugger
  3. Python Winappdbg Tutorial for Reverse Engineers 3 of 20: Attaching to Existing Process
  4. Python Winappdbg Tutorial for Reverse Engineers 4 of 20: Handling Debug Events
  5. Python Winappdbg Tutorial for Reverse Engineers 5 of 20: Setting Breakpoints
  6. Python Winappdbg Tutorial for Reverse Engineers 6 of 20: Accessing Registers
  7. Python Winappdbg Tutorial for Reverse Engineers 7 of 20: Reading Writing Process Memory
  8. Python Winappdbg Tutorial for Reverse Engineers 8 of 20: Enumerating Process Thread & Loaded Module
  9. Python Winappdbg Tutorial for Reverse Engineers 9 of 20: Hooking Windows API
  10. Python Winappdbg Tutorial for Reverse Engineers 10 of 20: Exception (Crash)Handling within Debuggee
  11. Python Winappdbg Tutorial for Reverse Engineers 11 of 20: Writing Your First Mutation Fuzzer - I
  12. Python Winappdbg Tutorial for Reverse Engineers 12 of 20: Writing Your First Mutation Fuzzer - II



There will be around 20 videos in this series , I've uploaded first 12 of it. If you find it helpful, you can show some support by subscribing to this channel.

Wednesday, August 8, 2018

Ranked #32 in Microsoft’s Top 100 Security Researchers - BlackHat USA 2018

To appreciate researcher's work and partnership, each year at BlackHat USA, Microsoft Security Response Center highlights contributions of security researchers through a list of “Top 100” security researchers worldwide.

In 2018 I ranked #32 for reporting issues is Microsoft Edge and Office


Friday, March 9, 2018

The Art of Large Scale Cumulative Binary Diffing

I've been performing patch diffing on various windows based softwares for past couple of years now. Patch diffing is a process of comparing two binary builds of the same code – a known vulnerable one and the one containing the security fix for a vulnerability. Bindiff is very popular among security researchers because it is generally used to gather information about patched security vulnerabilities, find root causes and vectors.

In 2017 December I've delivered a talk at BlackHat Europe where I've showcased many patched vulnerabilities in VMWare workstation, mostly identified using binary patch diffing different releases of VMWare workstation.

Performing BinDiffing on a huge software is very challenging specially when affected components are not known. Let's take the example of VMWare workstation. If we unpack VMWare workstation installer we find nearly 300 binary files. Among these huge number of binary files, finding the components on which security fixes were applied is very difficult and time consuming. Especially for my VMWare research I had to do this on a cumulative basis because I had to analyze each and every released security patches of last one year. Following screenshots lists out VMWare workstation releases and their version details.

To be able to identify the components modified in each workstation release and to understand the modification logic, we had to perform binary diffing like this


Performing binary diffing on each and every patch released by vmware for last one year was indeed very tedious. So I thought of automating the whole process. In this blog post I'm going briefly explain the way it was done and also release the source code of the python library I've written to automate this. The same code can be re-used (with little modification) to perform cumulative binary diffing on any windows based software.

Manually Unpacking The Installer

There were some manual efforts involved initially. Manually unpacking the installer files was the first step. For vmware workstation it can be done using following command 

VMware-workstation-full-xxxx-xxxx.exe /extract "folder path"

For other softwares files can be directly taken from "Program Files" folder.

After the installer files are unpacked they are kept in an organized way in same directory. Point to be noted here directory structure of all the unpacked file should be same like this because these paths would be accessed the the Mass binary diffing program.

C:\MassDiffing\VMware-workstation-full-12.5.0.exe\x64\vmware-vmx.exe
C:\MassDiffing\VMware-workstation-full-12.5.1.exe\x64\vmware-vmx.exe
C:\MassDiffing\VMware-workstation-full-12.5.2.exe\x64\vmware-vmx.exe

Introducing MassDiffer

MassDiffer is small python program developed to automate the tedious process of cumulative binary diffing. This script has few dependencies 
  1. IDA Pro idaq.exe & idaq64.exe
  2. Zynamics Binexport
  3. BinDiff  - differ.exe & differ64.exe

This is exactly how the MassDiffer works,

1. Path of two directories containing unpacked installer files (old release and new release) are passed to the program for example C:\MassDiffing\VMware-workstation-full-12.5.0.exe\ and C:\MassDiffing\VMware-workstation-full-12.5.1.exe\

2. The program traverses two directories, tries to find out files which can have binary code and create a mapping between the old version and new version of the file.




3. After the mapping is created it checks if the binary image version has changed in the new release or not. If binary images are identical in both the releases nothing will be done to those files.



4. Next, if it finds any change in binary image file version it process them. First it generates set of IDB files for both old and new version.

5. From the IDB file it generates BinExport file with help of zynamics binexport.

6. From BinExport files it generates BinDiff file. Point to be noted here BinDiff files are nothing but a sqlite database, where all the diffing results are stored. Simple sqlite query can be made to extract information from the BinDiff file about the modified function in two binary files.

7. Next step, BinDiff database file is parsed and modified function details and addresses are extracted from BinDiff database.

8. Once these information are gathered a MS Excel report is prepared which gives a visual representation of the modified components. Following screenshot shows a sample MassDiff output for VMware-workstation version 12.5.1 and 12.5.2 release. As it can be easily pointed out that in this release VMWare had only applied fix to two binary files they are vmware-vmx.exe and vmwarebase.dll and only few functions in these binary files were modified. This reduces a lot of repetitive work.



Source Code :

Source code is available at https://github.com/debasishm89/MassDiffer
The program was developed and tested on IDA Pro Version 6.5 + Bindiff version 4.2.

Thanks for reading. Hope you've enjoyed :) 

Sunday, December 10, 2017

My BlackHat Europe 2017 Talk: THE GREAT ESCAPES OF VMWARE

This December 2017 Me & my colleague Yakun Zhang delivered a talk at Blackhat Europe 2017 Briefings on VMWare escapes. Blackhat Europe is an annual information security conference, scheduled on December 4 2017 to December 7, 2017, in the ExCeL London, located at 1 Western Gateway, London E16 1XL.We have talked about reverse engineering of vmware, attacking hypervisor isolation and some virtual machine escape attacks against vmware.


Talk Abstract

Virtual machine escape is the process of breaking out of the virtual machine and interacting with the host operating system. VMWare recently fixed several bugs in their products that were allowing malicious code to escape sandbox. Some of these issues were exploited and reported during exploitation contest and while others reported individually by researchers. For very obvious reason details of this bugs are undisclosed. This paper presents a case study of VMWare VM escape vulnerabilities based on the analysis of different patches released by VMWare in recent past. 

Looking at the advisories published by VMWare in the last few months, reveals that there are many surfaces, that are being targeted by security researchers. To summarize, the attack surfaces would be as follows: 

A) RPC Request handler.
B) Virtual Printer.
C) VMWare Graphics Implementation.

Talking about vulnerabilities fixed in VMWare RPC layer, we see several CVEs (CVE-2017-4901, CVE-2016-7461 etc.) fixing security issues in RPC layers. This talk will cover end to end RPC implementation in VMWare workstation. It will cover everything from VMWare Backdoor in guest OS to different RPC command handler in host OS. We will uncover some of these fixed bugs in VMWare RPC layer by performing binary diffing on VMWare Workstation binaries. This talk will also showcase some of the PoCs developed from different VMware workstation patches.


VMWare's EMF file handler is one of most popular attack surfaces, when it comes to guest to host escape. VMSA-2016-0014 fixed several security issues in EMF file handling mechanism. EMF format is composed of many EMR data structures. TPView.dll parses every EMR structure in EMF file. In VMware, COM1 port is used by Guest to interact with Host printing proxy. EMF files are spool file format used in printing by windows. When a printing EMF file request comes from Guest, in host TPView.dll render the printing page. The TPView.dll holds the actual code which parses the EMF file structures. In our talk, we will be diving deep into this attack surface & uncover some of the vulnerabilities fixed in this area recently by performing binary diffing on VMWare work station binaries.


VMSA-2017-0006 resolved several security vulnerabilities in Workstation, Fusion graphics implementation which allows Guest to Host Escape. These vulnerabilities were mostly present in VMWare SVGA implementation. In this section of our talk we will cover implementation of VMWare virtual GPU through reverse engineering different guest components (vmx_fb.dll - VMware SVGA II Display Driver, vmx_svga.sys - VMware SVGA II Miniport) as well as host component (vmware-vmx.exe) where virtualize GPU code exist. The VMware virtual GPU provides several memory ranges which is used by Guest OS to communicate with the emulated device. These memory ranges are 2D frame buffer and FIFO Memory Queue. In FIFO memory queue, we write command that we want our GPU to process. The way VMWare handles and process these commands is error prone. This talk will uncover some of these bugs in SVGA command processing code and try to understand anatomy of issues by bin-diffing through VMWare binaries.

Slides:


References:


  • https://www.blackhat.com/eu-17/briefings.html#the-great-escapes-of-vmware-a-retrospective-case-study-of-vmware-g2h-escape-vulnerabilities
  • https://www.blackhat.com/docs/eu-17/materials/eu-17-Mandal-The-Great-Escapes-Of-Vmware-A-Retrospective-Case-Study-Of-Vmware-G2H-Escape-Vulnerabilities.pdf