Persistence Analysis Remediation Python PopUp Malware
-
LAB TIME: Le PeΔstistence
-
Download my Python-coded annoying pop up-ware and remediate yourself from the ever running hell RUN ON AVM LINK
-
The link will be sent on the WhatsApp group
-
Group up, write a report documenting your work after discovering how does this malware-Ish persist, you should also document the remediation actions.
-
This is a 40-ish minutes lab
-
HINT: go to REGSEEK (not the academic search engine)
πΉ Scenario
-
You have a Python script that displays annoying pop-up advertisements and remains active in the system (i.e., it continues running automatically even after a system restart).
-
Objective:
-
Identify the mechanism by which the program persists in the system.
-
Explain the steps involved in analyzing and documenting the issue, as well as the steps for removing the program.
πΉ Initial Setup
-
Opened the Virtual Machine prepared for the lab "Malware LAB".
-
Downloaded the program from the link and then isolated the network on the machine, set it to HostOnly, because it must be tested in a contained environment.
-
Before isolating the machine, installed 7Zip to extract compressed files easily, then isolated the machine again.
-
Disabled Windows Defender and anything that could prevent the malware from running.
-
Extracted the folder using 7Zip (Password: infected).
πΉ Initial File Analysis
-
File Name:
what_have_i_become.exe -
File Type: Application (.exe)
-
Size: 7.72 MB (8,103,596 bytes)
Running the Malware:
- Extremely annoying pop-ups appeared:
- Performed End Task from Task Manager to make the pop-ups disappear.
πΉ Startup / Persistence Check
- Opened Task Manager β Startup:
-
Found a new app with the same icon named:
runme.exe -
Opened Open File Location:
- File location:
C:\Users\as\AppData\Roaming
Analysis:
-
After running
what_have_i_become.exe: -
Pop-ups run in a continuous loop even if End Task is used.
-
The program added itself automatically to Startup under a different name (
runme.exe) to run on every reboot.
πΉ Auto-Start Keys
-
Searched on Google for references:
Auto-Start Methods Tried
-
Startup Folder (Per user / System-wide)
-
C:\Users\as\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startupβ per user. -
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startupβ system-wide. -
Note: Some programs require administrative privileges or Compatibility Mode to run from Startup.
-
Task Manager β Startup Tab
-
Automatically adds the program to the internal Run key or sets it up to launch.
-
Problem: If the program is not officially installed or untrusted, it might not appear or run.
-
Registry β HKCU\β¦Run
-
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run -
Runs for the current user, and indeed the file was found here.
-
Registry β HKLM\β¦Run
-
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run -
Runs for all users (requires administrative privileges), and it was not present due to insufficient permissions.
πΉ Windows Malware Persistence Run Key
- Opened Registry Editor:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
![[Pasted image 20250921203508.png]]
Persistence Mechanism:
- The file
runme.exeis present here as a text (REG_SZ) β any file here runs automatically at every Boot for the current user.
πΉ Using RegSeek
- After identifying the malware location, used RegSeek mentioned in the hint:
## Registry Run Keys Persistence
persistence-methods high priority
HKLM\Software\Microsoft\Windows\CurrentVersion\Run
HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce
HKCU\Software\Microsoft\Windows\CurrentVersion\Run
HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce
HKLM\Software\Microsoft\Windows\CurrentVersion\RunServices
HKLM\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce
### Artifact Overview
### What It Stores
Registry locations where Windows automatically executes programs during user logon or system startup. HKLM keys run for all users with SYSTEM privileges, HKCU keys run for specific users with user privileges. RunOnce keys execute once then delete themselves. RunServices keys exist on older Windows versions for service startup.
### Forensic Value
Primary persistence mechanism used by malware, backdoors, and legitimate software. Shows what programs automatically start with Windows. Critical for identifying unauthorized persistence and malware installation. Can reveal privilege escalation attempts and system compromise indicators. Essential for incident response triage.
Simplified Explanation:
-
RegSeekβs Purpose:
-
Find registry locations where any program, malware or legitimate, can add itself to automatically run on Windows startup.
-
Keys of Focus:
-
HKLM\Software\Microsoft\Windows\CurrentVersion\Runβ runs for all users (requires SYSTEM privileges). -
HKLM\...\RunOnceβ same idea but runs only once then deletes itself. -
HKCU\...\Runβ runs for the current user only (normal user privileges). -
HKCU\...\RunOnceβ runs once per user. -
HKLM\...\RunServicesandRunServicesOnceβ present in older Windows versions for service startup. -
What These Keys Store:
-
Paths or file names that execute automatically at login or system startup.
-
Forensic Value:
-
Primary mechanism for persistence in malware.
-
Helps detect suspicious programs, privilege escalation attempts, and system tampering.
πΉ Persistence Removal / Remediation
-
Open Registry Editor (
regedit.exe). -
Navigate to:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
-
Locate the value associated with
runme.exe. -
Delete it (Right-click β Delete).
-
Navigate to the original file location:
C:\Users\as\AppData\Roaming\runme.exe
and delete it.
- Reboot the system to ensure the pop-ups are gone.
πΉ Verification After Removal
-
After reboot:
-
Pop-ups no longer appear.
-
Registry β HKCU\β¦Run does not contain the key.
-
System is clean and free of persistence.
β Summary
-
Malware relies on:
-
Registry Key: HKCU\β¦Run
-
Startup Folder: to launch itself at Boot
-
Persistence was successfully identified and removed:
-
Deleted the registry value
-
Deleted the original file
-
Verified after reboot
-
Important Security Lesson:
-
Always test any malware in an isolated VM and temporarily disable protections.
-
Monitoring Startup and Registry helps detect suspicious programs.
21-09-2025
Abdelwahab Ahmed Abdelwahab Mohamed