Skip to content

Prevent parameter keyword obfuscation #29

@fgarit

Description

@fgarit

I have another issue with the tool that may again come from a certain misunderstanding.
This time, it requires flash to me installed on the computer.

I've a test.py script:

from flask import Flask

proxy = Flask(__name__)

proxy.run(host='0.0.0.0', port=5000, debug=True, threaded=True)

And my opy_config.txt file

obfuscate_strings = True
obfuscated_name_tail = '_opy_'
plain_marker = '_opy_'
pep8_comments = True

source_extensions = '''
py
pyx
'''

skip_extensions = '''
pyc
'''

skip_path_fragments = '''
opy.py
'''

external_modules = '''
flask
'''

plain_files = '''
opy_config.txt
'''

plain_names = '''
opy
test
'''

The result is the following:

# coding: UTF-8
import sys
l1l1_opy_ = sys.version_info [0] == 2
l11ll_opy_ = 2048
l1l_opy_ = 7
def l1l11_opy_ (l111_opy_):
    global l111l_opy_
    l1lll_opy_ = ord (l111_opy_ [-1])
    l1ll_opy_ = l111_opy_ [:-1]
    l11l_opy_ = l1lll_opy_ % len (l1ll_opy_)
    l11_opy_ = l1ll_opy_ [:l11l_opy_] + l1ll_opy_ [l11l_opy_:]
    if l1l1_opy_:
        l1l1l_opy_ = l11l1_opy_ () .join ([l1_opy_ (ord (char) - l11ll_opy_ - (l1ll1_opy_ + l1lll_opy_) % l1l_opy_) for l1ll1_opy_, char in enumerate (l11_opy_)])
    else:
        l1l1l_opy_ = str () .join ([chr (ord (char) - l11ll_opy_ - (l1ll1_opy_ + l1lll_opy_) % l1l_opy_) for l1ll1_opy_, char in enumerate (l11_opy_)])
    return eval (l1l1l_opy_)
from flask import Flask
proxy = Flask(__name__)
proxy.run(host=l1l11_opy_ (u"ࠫ࠵࠴࠰࠯࠲࠱࠴ࠬࠀ"), port=5000, debug=True, ll_opy_=True)

The interesting part is the change from:

proxy.run(host='0.0.0.0', port=5000, debug=True, threaded=True)

to:

proxy.run(host=l1l11_opy_ (u"ࠫ࠵࠴࠰࠯࠲࠱࠴ࠬࠀ"), port=5000, debug=True, ll_opy_=True)

Checkout https://github.com/pallets/flask/blob/master/flask/app.py def run line 840. It looks like opy knows not to rename the host, port and debug keywords before of the fonction declaration def run(self, host=None, port=None, debug=None, load_dotenv=True, **options):. But to me it's an issue that the threaded keyword is renamed.

I am again wondering if this is the intended behavior and if I'm missing something here.

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions