What is Evilgrade and the Attack Scenario
What is Evilgrade and the Attack Scenario
Overview
This lesson introduces Evilgrade, a modular penetration-testing framework that exploits insecure software auto-update mechanisms by serving victims fake updates that contain attacker-controlled payloads. You'll learn what problem the tool targets (applications that trust updates based only on a hostname), the network conditions that make the attack possible (ARP spoofing, DNS poisoning, and similar hostname-redirection techniques), and how Evilgrade's built-in DNS server and web server work together to complete the attack chain. Understanding this scenario matters because it illustrates a broad class of supply-chain / update-integrity weaknesses that are still relevant in modern software.
Key Concepts
1. Fake-Update Injection Framework
Explanation: Evilgrade exploits "poor upgrade implementations." Many applications check for updates over the network and download/run a binary if the update server tells them one is available. If that check isn't cryptographically verified, an attacker who controls the response can deliver a malicious binary instead.
Example: Imagine your laptop's media player phones home to updates.example.com and runs whatever .exe it receives. If someone can impersonate that server, your player happily installs their malware.
In the code (README.md):
Evilgrade is a modular framework that allows the user to take advantage of poor upgrade implementations by injecting fake updates.
It comes with pre-made binaries (agents), a working default configuration for fast pentests, and has it's own WebServer and DNSServer modules.
2. Hostname Redirection as the Precondition
Explanation: Evilgrade does not break into the network by itself. It assumes the attacker can already redirect the victim's traffic for a target hostname (e.g., java.sun.com) to the attacker's machine. Redirection is achieved through separate techniques.
Example: Like swapping the address label on a package so it's delivered to your house instead of the intended recipient — the package itself isn't altered, just where it goes.
In the code (README.md):
This framework comes into play when the attacker is able to make hostname redirections (manipulation of victim's dns traffic), and such thing can be done on 2 scenarios:
3. Internal vs. External Scenarios
Explanation: The README splits redirection techniques into two scenarios. Internal assumes you share the victim's local network (LAN-level attacks). External is narrower, relying on DNS-level manipulation reachable from outside the LAN.
Example: An attacker on the same coffee-shop Wi-Fi (internal) vs. an attacker who poisons an upstream DNS resolver's cache (external).
In the code (README.md):
Internal scenery:
- Internal DNS access
- ARP spoofing
- DNS Cache Poisoning
- DHCP spoofing
- TCP hijacking
- Wi-Fi Access Point impersonation
External scenery:
- Internal DNS access
- DNS Cache Poisoning
4. Modules and VirtualHosts
Explanation: Each supported application is a module that encodes how to emulate that app's update protocol — including the VirtualHost(s) (the real update domains) the fake web server must pretend to be. Evilgrade ships with 63 modules.
Example: The sunjava module knows that Java's updater talks to java.sun.com and javadl-esd.sun.com, so it answers requests for exactly those hostnames.
In the code (README.md):
evilgrade>show vhosts
Virtual hosts:
=============
[
"java.sun.com",
"javadl-esd.sun.com",
...
]
5. DNS Server + WebServer Working Together
Explanation: Evilgrade bundles two services. The DNSServer answers the victim's name lookups for the target VirtualHost, pointing them at the attacker. The WebServer then serves the crafted update response and the malicious agent. Global options control both.
Example: The DNS server is the "receptionist" that directs the victim to the wrong door; the web server is the "impostor" waiting behind that door.
In the code (README.md): The global options show both services' knobs (note: a debug row sits between DNSPort and port in the full table and is elided here):
.-----------------------------------------------------------------------------------.
| Name | Default | Description |
+-------------+-----------+---------------------------------------------------------+
| DNSEnable | 1 | Enable DNS Server ( handle virtual request on modules ) |
| DNSAnswerIp | 127.0.0.1 | Resolve VHost to ip ) |
| DNSPort | 53 | Listen Name Server port |
...
| port | 80 | Webserver listening port |
| sslport | 443 | Webserver SSL listening port |
'-------------+-----------+---------------------------------------------------------'
Code Walkthrough
Section 1 — Configuring a module and inspecting its options (README.md)
evilgrade>conf sunjava
evilgrade(sunjava)>show options
Display options:
===============
Name = Sun Microsystems Java
Version = 2.0
...
VirtualHost = "java.sun.com|javadl-esd.sun.com"
.-------------------------------------------------------------------------------------------------------------------------.
| Name | Default | Description |
+--------------+-------------------------------------------------+--------------------------------------------------------+
...
| agent | ./agent/reverseshellsign.exe | Agent to inject |
...
'--------------+-------------------------------------------------+--------------------------------------------------------'
conf sunjavaenters the module context — the prompt changes toevilgrade(sunjava)>, scoping subsequent commands to that module.VirtualHost = "java.sun.com|javadl-esd.sun.com"is the heart of the attack: these are the domains the fake web server will impersonate. For the attack to work, the victim must resolve these names to the attacker.- The
agentrow (./agent/reverseshellsign.exefor this module) is the payload binary delivered when the victim "updates." Each module defines its own agent default — there is no single global shipped agent; other modules use different defaults. - The remaining rows (
title,description,website, etc.) only control what the victim sees during the fake update — cosmetic social-engineering details.
Why it's written this way: Separating the VirtualHost, the agent, and the display text makes modules reusable templates — you point them at a payload and let the framework emulate the rest of the update protocol.
Section 2 — Starting services and catching a victim (README.md)
evilgrade>start
evilgrade>
[28/10/2010:21:35:55] - [WEBSERVER] - Webserver ready. Waiting for connections ...
evilgrade>
[28/10/2010:21:35:55] - [DNSSERVER] - DNS Server Ready. Waiting for Connections ...
#### Waiting for victims
evilgrade>
[25/7/2008:4:58:25] - [WEBSERVER] - [modules::sunjava] - [192.168.233.10] - Request: "^/update/[.\\d]+/map\\-[.\\d]+.xml"
evilgrade>
[25/7/2008:4:58:26] - [WEBSERVER] - [modules::sunjava] - [192.168.233.10] - Request: "^/java_update.xml\$"
evilgrade>
[25/7/2008:4:58:39] - [WEBSERVER] - [modules::sunjava] - [192.168.233.10] - Request: ".exe"
evilgrade>
[25/7/2008:4:58:40] - [WEBSERVER] - [modules::sunjava] - [192.168.233.10] - Agent sent: "./agent/reverseshell.exe"
startbrings up both the WEBSERVER and the DNSSERVER — confirming the attack needs both halves of the chain running.- The log shows the victim (
192.168.233.10) contacting the fake Java update endpoint. Because the victim's DNS lookup was redirected, these requests arrive at Evilgrade rather than the real Sun servers. - The requests progress through the update protocol: fetching update XML metadata, then requesting the
.exe. Agent sent: "./agent/reverseshell.exe"is the payoff — the configured payload is delivered and will execute on the victim as if it were a legitimate update.
Why it's written this way: The stepwise log mirrors the real update handshake, demonstrating that Evilgrade must faithfully emulate each request the client expects before it can deliver the agent.
A note on agents in general: an "agent" is just whatever binary you configure for the module. The project even ships benign placeholder binaries so you can test the mechanics safely, but each module's agent option is independent and must be set to a payload appropriate for the target platform.
Common Mistakes
1. Thinking Evilgrade performs the redirection itself
Why it happens: The tool bundles a DNS server, so learners assume it hijacks victim traffic automatically. In reality, the README states the attacker must already be able to make hostname redirections (via ARP spoofing, DNS cache poisoning, etc.). Evilgrade's DNS server answers lookups only once that redirection sends them its way. How to avoid it: Treat redirection (ARP/DNS/DHCP attacks) as a separate prerequisite step you set up before launching Evilgrade.
2. Forgetting to match the VirtualHost to the target
Why it happens: Learners set an agent but don't verify that VirtualHost matches the exact domains the target app contacts. If the victim queries a hostname the module doesn't emulate, no update request ever reaches the web server.
How to avoid it: Run show vhosts / show options and confirm the module's VirtualHosts cover every domain the target application actually uses for updates.
3. Assuming any payload works on any target
Why it happens: Evilgrade is cross-platform, which some read as "payload-agnostic." The README clarifies it "only depends of having an appropriate payload for the right target platform."
How to avoid it: Choose an agent binary built for the victim's OS/architecture; a Windows .exe won't execute on a Linux target.
Real-World Use Case
A penetration tester is assessing a corporate LAN where employee laptops run outdated software with insecure auto-updaters. With authorization, the tester uses ARP spoofing to position themselves as a man-in-the-middle, then runs Evilgrade with the sunjava module. When a laptop's Java updater queries java.sun.com, Evilgrade's DNS server resolves it to the tester's machine, the web server emulates the Java update protocol, and the configured agent is delivered — demonstrating to the client, with concrete evidence in the victim-status log, that their update mechanism lacks signature verification and must be hardened.
Next Steps
Next, explore the module internals to see how a single application's update protocol is emulated (request patterns, response XML, and dynamic agent generation), which builds directly on the VirtualHost and agent concepts introduced here.