A tool for making python source difficult to read.

Overview

obscurepy

Build Status codecov

Description

A tool for obscuring, or making python source code difficult to read.

Table of Contents

  1. Installation
  2. Limitations
  3. Usage
  4. Disclaimer
  5. License

Installation

This command will install obscurepy:

python -m pip install obscurepy

I would recommend installing it in a virtual environment as opposed to globally:

python -m venv venv
source venv/bin/activate
python -m pip install obscurepy

Limitations

As this program is still in active development, there are many limitations. Below are some examples of what obscurepy can do. If it isn't in the example, obscurepy probably can't do it. This example serves to represent the ablities of each release. This example should be functional, both the original source and obscured source should execute.

An example:

class FirstClass:
    pass


class SecondClass(FirstClass):
    # this is a comment
    class_variable = 6

    def __init__(self, param_1):
        self.my_property = param_1

    def class_function(self, param_1, param_2):
        self.prop_1 = param_1
        self.prop_2 = param_2


def first_function():
    def with_another():
        c = 42
        return c
    return with_another()

def second_function(param_1, param_2, param_3):
    d = 'string'
    return d + str(param_1)

def third_function():
    e = 100.0
    return e

a = FirstClass()

b = SecondClass(1)

print(first_function())

print(second_function(1, 2, 3))

print(third_function())

a = SecondClass(1)

a.class_function(1, 2)

first_function()
class _0x3fe:
    pass

class _0x452(_0x3fe):
    _0x5bb = int('0x6', 16)

    def __init__(_0x1aa, _0x2a1):
        _0x1aa._0x4ca = _0x2a1

    def _0x5db(_0x1aa, _0x2a1, _0x2a2):
        _0x1aa._0x251 = _0x2a1
        _0x1aa._0x252 = _0x2a2

def _0x5ed():

    def _0x50c():
        _0x63 = int('0x2a', 16)
        return _0x63
    return _0x50c()

def _0x641(_0x2a1, _0x2a2, _0x2a3):
    _0x64 = ''.join([chr(x) for x in [115, 116, 114, 105, 110, 103]])
    return _0x64 + str(_0x2a1)

def _0x5e0():
    _0x65 = float.fromhex('0x1.9000000000000p+6')
    return _0x65
_0x61 = _0x3fe()
_0x62 = _0x452(int('0x1', 16))
print(_0x5ed())
print(_0x641(int('0x1', 16), int('0x2', 16), int('0x3', 16)))
print(_0x5e0())
_0x61 = _0x452(int('0x1', 16))
_0x61._0x5db(int('0x1', 16), int('0x2', 16))
_0x5ed()

Usage

The following command can be used to obscure a single file:

obscure --filepath=my_module.py

The following command can be used to obscure a multi file project:

obscure --project_dir=my_project

Alternatively, you can specify an output directory for both single file and multi file obscuring:

obscure --filepath=my_module.py --output_dir=desired_output_directory
obscure --project_dir=my_project --output_dir=desired_output_directory

Disclaimer

Obscurepy is no substitution for standard security practices. Obscurepy will not protect your code, nor will it protect the constants within your code. Python is an interpreted language and by nature anyone with access to your source code can reverse engineer it or simply extract any constant replacement to determine the value. Obscurepy is not meant to be used with security in mind. Obscurepy can make your source code difficult to read and it may deter people from trying. It will not stop any determined person from figuring out what your code does. I suggest looking into PyArmor if a more sophisticated method of obfuscation is required.

License

MIT License

Copyright (c) 2021 Andrew Christiansen

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE

Salesforce Recon and Exploitation Toolkit

Salesforce Recon and Exploitation Toolkit Salesforce Recon and Exploitation Toolkit Usage python3 main.py URL References Announcement Blog - https:/

81 Dec 23, 2022
AmiEviL - This program uses the Virus Total API to determine if your suspicious file is malicious or not

AmiEviL - This program uses the Virus Total API to determine if your suspicious file is malicious or not. The program requests the hash of the file and outputs information (if any). This version will

Kirk 1 Jan 03, 2022
BoobSnail allows generating Excel 4.0 XLM macro. Its purpose is to support the RedTeam and BlueTeam in XLM macro generation.

Follow us on Twitter! BoobSnail BoobSnail allows generating XLM (Excel 4.0) macro. Its purpose is to support the RedTeam and BlueTeam in XLM macro gen

STM Cyber 232 Nov 21, 2022
Um script simples de Port Scan + DNS by Hostname

🖥 PortScan-DNS Esta é uma ferramenta simples de Port Scan + DNS by Hostname... 💻 | DNS Resolver / by Hostname: HOST IP EXTERNO IP INTERNO 💻 | Port

AlbâniaSecurity-RT 7 Dec 08, 2022
OMIGOD! OM I GOOD? A free scanner to detect VMs vulnerable to one of the

omigood (OM I GOOD?) This repository contains a free scanner to detect VMs vulnerable to one of the "OMIGOD" vulnerabilities discovered by Wiz's threa

Marco Simioni 13 Jul 13, 2022
Grafana-0Day-Vuln-POC

Grafana V8.0+版本存在未授权任意文件读取 0Day漏洞 - POC 1 漏洞信息 1.1 基本信息 漏洞厂商:Grafana 厂商官网:https://grafana.com/ 1.2 漏洞描述 Grafana是一个跨平台、开源的数据可视化网络应用程序平台。用户配置连接的数据源之后,Gr

mik1th0n 3 Dec 13, 2021
NexScanner is a tool which allows you to scan a website and find the admin login panel and sub-domains

NexScanner NexScanner is a tool which helps you scan a website for sub-domains and also to find login pages in the website like the admin login panel

8 Sep 03, 2022
A fast sub domain brute tool for pentesters

subDomainsBrute 1.4 A fast sub domain brute tool for pentesters. It works with P

Oliver 2 Oct 18, 2022
Universal Radio Hacker: Investigate Wireless Protocols Like A Boss

The Universal Radio Hacker (URH) is a complete suite for wireless protocol investigation with native support for many common Software Defined Radios.

Dr. Johannes Pohl 9k Jan 03, 2023
A proxy for asyncio.AbstractEventLoop for testing purposes

aioloop-proxy A proxy for asyncio.AbstractEventLoop for testing purposes. When tests writing for asyncio based code, there are controversial requireme

aio-libs 12 Dec 12, 2022
Writeups for wtf-CTF hosted by Manipal Information Security Team as part of Techweek2021- INCOGNITO

wtf-CTF_Writeups Table of Contents Table of Contents Crypto Misc Reverse Pwn Web Crypto wtf_Bot Author: Madjelly Join the discord server!You know how

6 Jun 07, 2021
Monty Hall Problem simulation written in Python.

Monty Hall Problem Simulation monty_hall_sim is a brute-force method of determining the optimal strategy for the Monty Hall Problem. Usage Set boolean

Xavier D 1 Aug 29, 2022
Ensure secure infrastructure and consistency with the firewall rules

Python Port Scanner This script tries to check if it's possible to make a connection with the specific endpoint port. This is very useful to ensure se

Allan Avelar 7 Feb 26, 2022
Quickstart resources for the WiFi Nugget, a cat themed WiFi Security platform for beginners.

Quickstart resources for the WiFi Nugget, a cat themed WiFi Security platform for beginners.

HakCat 62 Jan 08, 2023
Ducky Script is the payload language of Hak5 gear.

Ducky Script is the payload language of Hak5 gear. Since its introduction with the USB Rubber Ducky in 2010, Ducky Script has grown in capability while maintaining simplicity. Aided by Bash for logic

Abir Abedin Khan 6 Oct 07, 2022
Scanning for CVE-2021-44228

Filesystem log4j_scanner for windows and Unix. Scanning for CVE-2021-44228, CVE-2021-45046, CVE-2019-17571 Requires a minimum of Python 2.7. Can be ex

Brett England 4 Jan 09, 2022
Obfuscate ip address using different encodings

ipobfuscator How it works? Single ip address can be written in multiple ways. The most popular way is to represent ip as 4 octets separated with dots.

Piotr Warmke 1 Nov 02, 2021
BOF-Roaster is an automated buffer overflow exploit machine which is begin written with Python 3.

BOF-Roaster is an automated buffer overflow exploit machine which is begin written with Python 3. On first release it was able to successfully break many of the most well-known buffer overflow exampl

Kaan Caglan 5 Nov 23, 2021
NFC Implant-base RSA Encrypted Messagging application

Encrypted messaging application with the use of MIFARE DESfire chip to store the private/public keys needed for the application authentication

4 Nov 06, 2021
APKLeaks - Scanning APK file for URIs, endpoints & secrets.

APKLeaks - Scanning APK file for URIs, endpoints & secrets.

dw1 3.5k Jan 09, 2023