175 words
1 minute
KnightCTF 2026 - Forensics: Database Credentials Theft

KnightCTF 2026 - Forensics: Database Credentials Theft#

Challenge Information#

  • Category: Forensics
  • File: pcap3.pcapng

Challenge Description#

The attacker’s ultimate goal was to access our database. During the post-exploitation phase, they managed to extract database credentials from the compromised system. Find the database username and password that were exposed.

Flag Format: KCTF{username_password}


Solution#

Step 1: Context from Previous Challenges#

From the previous pcap analysis:

  • Target: WordPress 6.9 on 192.168.1.102
  • Vulnerable plugin: Social Warfare 3.5.2 (CVE-2019-9978)
  • The attacker exploited RCE to gain access to the system

Step 2: Search for Database Credentials#

After exploiting the RCE vulnerability, attackers typically read wp-config.php to extract database credentials.

Terminal window
strings pcap3.pcapng | grep -iE 'DB_NAME|DB_USER|DB_PASSWORD|DB_HOST'

Step 3: Results#

Found WordPress database configuration:

// Default template values
define( 'DB_NAME', 'database_name_here' );
define( 'DB_USER', 'username_here' );
define( 'DB_PASSWORD', 'password_here' );
define( 'DB_HOST', 'localhost' );
// Actual credentials exposed
define( 'DB_NAME', 'wordpress_db' );
define( 'DB_USER', 'wpuser' );
define( 'DB_PASSWORD', 'wp@user123' );
define( 'DB_HOST', 'localhost' );

Extracted Credentials#

FieldValue
Database Namewordpress_db
Usernamewpuser
Passwordwp@user123
Hostlocalhost

Flag#

KCTF{wpuser_wp@user123}

Attack Chain Summary#

  1. Reconnaissance - Attacker scanned WordPress for vulnerable plugins
  2. Exploitation - Used Social Warfare 3.5.2 RCE (CVE-2019-9978)
  3. Post-Exploitation - Read wp-config.php to extract DB credentials
  4. Goal Achieved - Database credentials stolen

Tools Used#

  • strings
  • grep

Author: MR. Umair
Date: January 20, 2026
Competition: KnightCTF 2026

KnightCTF 2026 - Forensics: Database Credentials Theft
https://ctf-writeups-webb.vercel.app/posts/knightctf-2026-forensics-database-credentials-theft/
Author
Umair Aziz
Published at
2026-03-17
License
CC BY-NC-SA 4.0