RAR file download from the internet

I tried this rule since a lot of malware is spread using password protected RAR files

Roshal Archive (RAR) or PowerShell File Downloaded from the Internet | Elastic Security Solution [7.17] | Elastic

The Query the rule uses:

event.category:(network or network_traffic) and network.protocol:http and
  (url.extension:(ps1 or rar) or url.path:(*.ps1 or *.rar)) and
    not destination.ip:( or or or or or or or or or or or or or or or or or or or or or or or
      "::1" or
      "FE80::/10" or
    ) and
    source.ip:( or or

I wrote 2 scripts 1 in Python and 1 in PowerShell both cases give no alert

import requests

url = 'https://getsamplefiles.com/download/rar/sample-1.rar'
filename = 'file.rar'

response = requests.get(url)

with open(filename, 'wb') as f:

print('Download complete!')
$url = 'https://getsamplefiles.com/download/rar/sample-1.rar'
$outputFile = 'file.rar'

Invoke-WebRequest -Uri $url -OutFile $outputFile

Write-Host 'Download complete!'

I also tried downloading a rar file with a browser (Opera GX) but this isn't logged aswell

url.extension is not an available field, the rule filters on this to see if the url is a RAR file

I use the system, windows and defense integrations

Any ideas why the network traffic from the scripts or browser isn't logged?

Hi @Maretti. Thanks for reaching out.

In order to execute, those files must be extracted from the archive, written to disk, then opened by their respective applications. Endpoint scans supported file types when they are written and/or opened. Endpoint doesn't attempt to scan compressed archives because the performance overhead can be significant, and efficacy is limited because trivial bypasses via password encryption are ubiquitous these days.

Endpoint doesn't intercept/MITM TLS connections (HTTPS) either. It provides IP-level reporting for such connections. For HTTPS connections, the URL is transmitted inside the encrypted stream. The encryption is performed inside the user-mode application, and its contents are not visible to our kernel driver. That rule mentions HTTP - have you tried the same download without TLS?


Hi @gabriel.landau

Thanks for the response I tried without TLS and it still isn't present in the logs


Thanks for the update. I just spoke with the engineer who wrote it and got clarification on the Defend/Endpoint side - I misunderstood it.

PacketBeat will get you the data you want. Add the "Network Packet Capture" integration to Agent.


Sample data:

    "method": "GET",
    "query": "GET /download/rar/sample-1.rar",
    "destination": {
      "port": 80,
      "bytes": 414,
      "ip": "",
      "domain": "getsamplefiles.com"
    "source": {
      "port": 50871,
      "bytes": 188,
      "ip": ""
    "type": "http",
    "url": {
      "path": "/download/rar/sample-1.rar",
      "extension": "rar",
      "scheme": "http",
      "domain": "getsamplefiles.com",
      "full": "http://getsamplefiles.com/download/rar/sample-1.rar"
    "network": {
      "community_id": "1:FT5uqa2sUJPH1NjlQpGMezJPlDM=",
      "protocol": "http",
      "bytes": 602,
      "transport": "tcp",
      "type": "ipv4",
      "direction": "egress"



This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.