<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Security on </title>
    <link>https://www.matteomalvica.com/categories/security/</link>
    <description>Recent content in Security on </description>
    <generator>Hugo</generator>
    <language>en</language>
    <copyright>This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.</copyright>
    <lastBuildDate>Thu, 24 Sep 2020 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://www.matteomalvica.com/categories/security/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Kernel exploitation: weaponizing CVE-2020-17382 MSI Ambient Link driver</title>
      <link>https://www.matteomalvica.com/blog/2020/09/24/weaponizing-cve-2020-17382/</link>
      <pubDate>Thu, 24 Sep 2020 00:00:00 +0000</pubDate>
      <guid>https://www.matteomalvica.com/blog/2020/09/24/weaponizing-cve-2020-17382/</guid>
      <description>Preamble - Why are drivers still a valuable target? Kernels are, no euphemism intended, complex piece of software and the Windows OS is no exception. Being one of the toughest to scrutinize due to its lack of source code and undocumented APIs, it is now being more documented thanks to the immense effort from the research community. Regrettably, during recent times, it has also increased in complexity and its mitigation way improved.</description>
    </item>
    <item>
      <title>Silencing the EDR. How to disable process, threads and image-loading detection callbacks.</title>
      <link>https://www.matteomalvica.com/blog/2020/07/15/silencing-the-edr/</link>
      <pubDate>Wed, 15 Jul 2020 00:00:00 +0000</pubDate>
      <guid>https://www.matteomalvica.com/blog/2020/07/15/silencing-the-edr/</guid>
      <description>Backround - TL;DR This post is about resuming the very inspiring Rui&amp;rsquo;s piece on Windows Kernel&amp;rsquo;s callbacks and taking it a little further by extending new functionalities and build an all-purpose AV/EDR runtime detection bypass. Specifically, we are going to see how Kaspersky Total Security and Windows Defender are using kernel callbacks to either inhibit us from accessing LSASS loaded module or detect malicious activities. We&amp;rsquo;ll then use our evil driver to temporarily silence any registered AV&amp;rsquo;s callbacks and restore EDR original code once we are done with our task.</description>
    </item>
    <item>
      <title>Distrusting the patch: a run through my first LPE 0-day, from command injection to path traversal</title>
      <link>https://www.matteomalvica.com/blog/2020/05/21/lpe-path-traversal/</link>
      <pubDate>Thu, 21 May 2020 00:00:00 +0000</pubDate>
      <guid>https://www.matteomalvica.com/blog/2020/05/21/lpe-path-traversal/</guid>
      <description>Intro - TL;DR On April 29th, exploit-db published a Local Privilege Escalation (LPE) exploit for Druva InSync. Druva had by then implemented a patch on their latest InSync release, fixing the bug. However, the patch introduced an additional bug, paving the way for further exploitation and making it possible for a local low-privileged user to obtain SYSTEM level privileges. A team from Tenable Research and I concurrently discovered this new vulnerability, resulting in a new CVE (CVE-2020-5752) and exploit being published.</description>
    </item>
    <item>
      <title>The universal antidebugger, x64 revamped</title>
      <link>https://www.matteomalvica.com/blog/2020/04/10/x64-trap-flag-antidebugger/</link>
      <pubDate>Fri, 10 Apr 2020 00:00:00 +0000</pubDate>
      <guid>https://www.matteomalvica.com/blog/2020/04/10/x64-trap-flag-antidebugger/</guid>
      <description>A single step for a debugger a giant leap for the obfuscator. When a debugger hits a breakpoint, it can perform single-stepping into the subsequent instructions by halting itself each time. To do so, it uses a specially crafted flag called Trap Flag (TF) residing at 0x8th bit position inside the EFLAGS x86 register.&#xA;If the Trap Flag is enabled, the processor then triggers an interrupt after each instruction has been executed.</description>
    </item>
    <item>
      <title>heappo: a WinDBG extension for heap tracing</title>
      <link>https://www.matteomalvica.com/blog/2020/03/24/heappo-windbg-heap-tracing/</link>
      <pubDate>Tue, 24 Mar 2020 00:00:00 +0000</pubDate>
      <guid>https://www.matteomalvica.com/blog/2020/03/24/heappo-windbg-heap-tracing/</guid>
      <description>Preface During these days of forced quarantine time-off, I have been reviewing notes and exercises from the outstanding Corelan Advanced training I took last October at Brucon, and so I decided to work on some tooling I had in mind lately. The idea came from thisresearch by Sam Brown from F-Secure: after testing the tool I decided to port it to the latest PyKD version to support both Python3 and Python2, and can run on both x86 and x64 (tested on latest Win10 1909) I aptly named this effort Heappo and here some of its key-features and enhancements.</description>
    </item>
    <item>
      <title>Uncovering Mimikatz &#39;msv&#39; and collecting credentials through PyKD</title>
      <link>https://www.matteomalvica.com/blog/2020/01/20/mimikatz-lsass-dump-windg-pykd/</link>
      <pubDate>Mon, 20 Jan 2020 00:00:00 +0000</pubDate>
      <guid>https://www.matteomalvica.com/blog/2020/01/20/mimikatz-lsass-dump-windg-pykd/</guid>
      <description>Preface All the value that a tool such as mimikatz provides in extrapolating Windows credential’s from memory resides in every pentester’s heart and guts. It is so resilient and flexible that it has quickly become the de facto standard in credential dumping and we cannot thank Benjamin Delpy enough for the immense quality work that has been done in recent years.&#xA;Since the code is open source , I recently decided to take up the not-so-leisurely hobby of understanding the mimikatz codebase.</description>
    </item>
    <item>
      <title>Evading WinDefender ATP credential-theft: a hit after a hit-and-miss start</title>
      <link>https://www.matteomalvica.com/blog/2019/12/02/win-defender-atp-cred-bypass/</link>
      <pubDate>Mon, 02 Dec 2019 00:00:00 +0000</pubDate>
      <guid>https://www.matteomalvica.com/blog/2019/12/02/win-defender-atp-cred-bypass/</guid>
      <description>Intro Recently, I became rather intrigued after reading this article from MSTIC about how Windows Defender Advanced Threat Protection (WDATP) is supposed to detect credential dumping by statistically probing the amount of data read from the LSASS process.&#xA;A little background is first necessary, though: on a host guarded by WDATP, when a standard credential-dumper such as mimikatz is executed, it should trigger an alert like the following one.</description>
    </item>
    <item>
      <title>Monitoring linux system-calls the right way</title>
      <link>https://www.matteomalvica.com/blog/2019/11/18/linux-syscall-monitoring/</link>
      <pubDate>Mon, 18 Nov 2019 00:00:00 +0000</pubDate>
      <guid>https://www.matteomalvica.com/blog/2019/11/18/linux-syscall-monitoring/</guid>
      <description>This ten-year-old vulnerability found by Chris Evans should remind us once more how, on modern linux systems, is important to take care of how we do security monitoring of software and user behaviour on modern linux systems.&#xA;Here&amp;rsquo;s the knot. This simple assembly code spwans /bin/sh via execve and then exit.&#xA;BITS 64 global _start section .text _start: jmp short jump main: pop rbx ; stack needs x64 register [rbx]- ; string address offset fits into 32 bit though xor eax, eax mov ecx, eax mov edx, eax mov al, 0xb int 0x80 ; execve_syscall xor eax,eax inc eax int 0x80 ; exit_syscall jump: call main message db &amp;#34;/bin/sh&amp;#34; If we compile it as an x64 ELF binary we can start noticing a few shenanigans.</description>
    </item>
    <item>
      <title>Windows Kernel Shellcodes - a compendium</title>
      <link>https://www.matteomalvica.com/blog/2019/07/06/windows-kernel-shellcode/</link>
      <pubDate>Sat, 06 Jul 2019 00:00:00 +0000</pubDate>
      <guid>https://www.matteomalvica.com/blog/2019/07/06/windows-kernel-shellcode/</guid>
      <description>Intro As opposed to the multi-purpose windows&amp;rsquo; userland shellcode, kernel ones merely try to elevate privileges and obtain an NT\SYSTEM status. There are several ways to accomplish this, and we are going to explore some of the different scenarios.&#xA;Most of the following ideas have been inspired by Morten Schenk and Cesar Cerrudo excellent works, which I have then gathered and readapted to the latest Win10 version.&#xA;Before jumping too quickly into shellcoding, we want would like to setup a comfortable and easy-to-fire shellcode loader on our system.</description>
    </item>
    <item>
      <title>Converting win shellcode from msfvenom to FASM</title>
      <link>https://www.matteomalvica.com/blog/2019/06/13/converting-win-shellcode-from-msfvenom-to-fasm/</link>
      <pubDate>Thu, 13 Jun 2019 00:00:00 +0000</pubDate>
      <guid>https://www.matteomalvica.com/blog/2019/06/13/converting-win-shellcode-from-msfvenom-to-fasm/</guid>
      <description>Intro During the last couple of weeks I started focusing more and more on windows internals and the way shellcode is crafted for the different windows platforms. There are many good windows shellcodes examples available out for grabs on the internet, but some of them are written in MASM or others are not so keen having a small memory footprint. Hence, I decided to focus on probably the best shellcode actively mantained repository: msfvenom.</description>
    </item>
    <item>
      <title>Injecting shellcode into x64 ELF binaries</title>
      <link>https://www.matteomalvica.com/blog/2019/05/18/injecting-shellcode-into-x64-elf-binaries/</link>
      <pubDate>Sat, 18 May 2019 00:00:00 +0000</pubDate>
      <guid>https://www.matteomalvica.com/blog/2019/05/18/injecting-shellcode-into-x64-elf-binaries/</guid>
      <description>Intro Recently, I have decided to tackle another challenge from the Practical Binary Analysis book, which is the latest one from Chapter 7.&#xA;It asks the reader to create a parasite binary from a legitimate one. I have picked ps, the process snapshot utility, where I have implanted a bind-shell as a child process.&#xA;DISCLAIMER : The following PoC will work only on a non-PIE binary due to the hardcoded entry-point address</description>
    </item>
    <item>
      <title>Baffling objdump</title>
      <link>https://www.matteomalvica.com/blog/2019/04/17/baffling-objdump/</link>
      <pubDate>Wed, 17 Apr 2019 00:00:00 +0000</pubDate>
      <guid>https://www.matteomalvica.com/blog/2019/04/17/baffling-objdump/</guid>
      <description>objdump is one of the most widley adopted linear disassembler, which often gives a significant help during initial binary analysis. A linear disassmbling algorithm, as opposed to a recursive one, is faster but also more prone to errors, as it only weeps through the file sections one instruction at a time, instead of inspecting every conditional statement.&#xA;Here, I would like to give a simple demo of how easily objdump can be confused, by filling the binary with instructions in the rdata section and strings in the text section.</description>
    </item>
    <item>
      <title>Practical Binary Analysis - Chapter 5 - CTF walkthrough level 7</title>
      <link>https://www.matteomalvica.com/blog/2019/03/31/pba-ctf-level7/</link>
      <pubDate>Sun, 31 Mar 2019 00:00:00 +0000</pubDate>
      <guid>https://www.matteomalvica.com/blog/2019/03/31/pba-ctf-level7/</guid>
      <description>Following the wake of the previous post, here is Practical Binary Analysis level 7 CTF walkthrough. As we pay attention to the oracle’s hint, we begin to suspect that this level might be two-staged:&#xA;$ ./oracle 0fa355cbec64a05f7a5d050e836b1a1f -h Find out what I expect, then trace me for a hint If we try to open the level7 file&#xA;1.$ ./lvl7 -bash: ./lvl7: cannot execute binary file: Exec format error $ file lvl7 lvl7: gzip compressed data, last modified: Sat Dec 1 17:30:15 2018, from Unix We can see it&amp;rsquo;s a gzip format, so we need to decompress it first.</description>
    </item>
    <item>
      <title>Practical Binary Analysis - Chapter 5 - CTF walkthrough level 6</title>
      <link>https://www.matteomalvica.com/blog/2019/03/25/pba-ctf-level6/</link>
      <pubDate>Mon, 25 Mar 2019 00:00:00 +0000</pubDate>
      <guid>https://www.matteomalvica.com/blog/2019/03/25/pba-ctf-level6/</guid>
      <description>During the last month I have been busy reading this awesome book by Dennis Andriesse, which quickly became one of my favourite reads on the subject: it does an excellent job on covering the foundation about Linux&amp;rsquo;s binary analysis and also going above and beyond by providing the reader with all the necessary techniques to be highly proficient and effective when dealing with such alchemical matter.&#xA;Chapter 5 has the purpose of illustrating all these different tools of the trade which culminates with an intriguing CTF, whose goal is to challenge the reader to put in practice all the skills&amp;amp;tricks gained up to this point.</description>
    </item>
    <item>
      <title>Custom base64 alphabet encoder/decoder</title>
      <link>https://www.matteomalvica.com/blog/2019/01/21/custom-base64-alphabet-encoder/decoder/</link>
      <pubDate>Mon, 21 Jan 2019 00:00:00 +0000</pubDate>
      <guid>https://www.matteomalvica.com/blog/2019/01/21/custom-base64-alphabet-encoder/decoder/</guid>
      <description>As I am spending slices of my time refreshing some Malware Analysis theory, I thought was valuable (at least to my future amnesiac self) writing down a simple &amp;lsquo;custom base64 alphabet translator.&amp;rsquo; This can/should be extended to support CLI/WebApp i ntegration. So, here is the skeleton:&#xA;UPDATE: added interactive mode below and also found this great tool which is already doing what I aimed for and much more.&#xA;import string import base64 # custom encoding function def EncodeCustomBase64(stringToBeEncoded,custom_b64): standard_b64 = &amp;#39;ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=&amp;#39; encoded = base64.</description>
    </item>
    <item>
      <title>Detecting VMware on 64-bit systems</title>
      <link>https://www.matteomalvica.com/blog/2018/12/05/detecting-vmware-on-64-bit-systems/</link>
      <pubDate>Wed, 05 Dec 2018 00:00:00 +0000</pubDate>
      <guid>https://www.matteomalvica.com/blog/2018/12/05/detecting-vmware-on-64-bit-systems/</guid>
      <description>Hot on the heels of the latest post, I have decided to port to linux another lab example from Intermediate x86 class. This time I will talk about the RedPill paper by Joanna Rutkowska.&#xA;This test is expected to work on single-core CPUs only&#xA;The main purpose of this test code is to call the SIDT instruction and save its return value inside an array: this value will tell us whether we are running it inside a vm or not.</description>
    </item>
  </channel>
</rss>
