|
| 1 | ++++ |
| 2 | +date = 2026-01-21 |
| 3 | +description ="KnightCTF 2026 - Network 100 - Database Theft" |
| 4 | +title = "KnightCTF 2026 - Network 100 - Database Theft" |
| 5 | +[taxonomies] |
| 6 | +tags = ["ctf", "networking", "wireshark", "tshark"] |
| 7 | ++++ |
| 8 | +## Task |
| 9 | + |
| 10 | +``` |
| 11 | +## Database Credentials Theft |
| 12 | +
|
| 13 | +### 100 Points |
| 14 | +
|
| 15 | +Author |
| 16 | +
|
| 17 | +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. |
| 18 | +
|
| 19 | +> Use pcap3.pcapng file to solve this challenge. |
| 20 | +
|
| 21 | +**Flag Format: KCTF{username_password}** |
| 22 | +
|
| 23 | +_**Author: TareqAhamed (0xt4req)**_ |
| 24 | +``` |
| 25 | + |
| 26 | +## Tshark Dump |
| 27 | + |
| 28 | +This was the easiest one so far. |
| 29 | +Since we know from previous task that reverse shell was running on 9576, lets only dump tcp stream from it, and convert it from hex to bin/ascii. |
| 30 | +That way we can basically see what the attacker was running in reverse shell: |
| 31 | +```bash |
| 32 | +tshark -r pcap3.pcapng -Y "tcp.port==9576" -T fields -e tcp.payload | xxd -r -p |
| 33 | + |
| 34 | +``` |
| 35 | + |
| 36 | +Output: |
| 37 | +```bash |
| 38 | +www-data@ubuntu-server-2:/var/www/html/wordpress/wp-admin$ cd .. |
| 39 | +cd .. |
| 40 | +www-data@ubuntu-server-2:/var/www/html/wordpress$ ls |
| 41 | +ls |
| 42 | +index.php |
| 43 | +license.txt |
| 44 | +readme.html |
| 45 | +wp-activate.php |
| 46 | +wp-admin |
| 47 | +wp-blog-header.php |
| 48 | +wp-comments-post.php |
| 49 | +wp-config-sample.php |
| 50 | +wp-config.php |
| 51 | +wp-content |
| 52 | +wp-cron.php |
| 53 | +wp-includes |
| 54 | +wp-links-opml.php |
| 55 | +wp-load.php |
| 56 | +wp-login.php |
| 57 | +wp-mail.php |
| 58 | +wp-settings.php |
| 59 | +wp-signup.php |
| 60 | +wp-trackback.php |
| 61 | +xmlrpc.php |
| 62 | +............. |
| 63 | +www-data@ubuntu-server-2:/var/www/html/wordpress$ cat wp-config.php |
| 64 | +cat wp-config.php |
| 65 | +<?php |
| 66 | +/** |
| 67 | + * The base configuration for WordPress |
| 68 | + * |
| 69 | + * The wp-config.php creation script uses this file during the installation. |
| 70 | + * You don't have to use the website, you can copy this file to "wp-config.php" |
| 71 | + * and fill in the values. |
| 72 | + * |
| 73 | + * This file contains the following configurations: |
| 74 | + * |
| 75 | + * * Database settings |
| 76 | + * * Secret keys |
| 77 | + * * Database table prefix |
| 78 | + * * ABSPATH |
| 79 | + * |
| 80 | + * @link https://developer.wordpress.org/advanced-administration/wordpress/wp-config/ |
| 81 | + * |
| 82 | + * @package WordPress |
| 83 | + */ |
| 84 | +
|
| 85 | +// ** Database settings - You can get this info from your web host ** // |
| 86 | +/** The name of the database for WordPress */ |
| 87 | +define( 'DB_NAME', 'wordpress_db' ); |
| 88 | +
|
| 89 | +/** Database username */ |
| 90 | +define( 'DB_USER', 'wpuser' ); |
| 91 | +
|
| 92 | +/** Database password */ |
| 93 | +define( 'DB_PASSWORD', 'wp@user123' ); |
| 94 | +
|
| 95 | +/** Database hostname */ |
| 96 | +define( 'DB_HOST', 'localhost' ); |
| 97 | +
|
| 98 | +/** Database charset to use in creating database tables. */ |
| 99 | +define( 'DB_CHARSET', 'utf8mb4' ); |
| 100 | +
|
| 101 | +/** The database collate type. Don't change this if in doubt. */ |
| 102 | +define( 'DB_COLLATE', '' ); |
| 103 | + |
| 104 | +.................... |
| 105 | +``` |
| 106 | +
|
| 107 | +And, well, yes thats a password and username right there. |
| 108 | +
|
| 109 | +## Flag |
| 110 | +
|
| 111 | +Flag is: **KCTF{wpuser_wp@user123}** |
| 112 | +
|
| 113 | + |
0 commit comments