Hnfull / Intensio-Obfuscator

Obfuscate a python code 2.x and 3.x
MIT License
624 stars 129 forks source link

String content being obfuscated. #40

Closed mcastillof closed 4 years ago

mcastillof commented 4 years ago

Hi, this one was hard to spot and reduce to a minimal working example. Is like the obfuscator thinks that part of a string, is a variable defined earlier, so it obfuscates it.

Example file:

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

for i in (0, 1):
    i=i+1

text = "i)P"

File generated with Intensio-Obfuscator with -rts -v parameters.

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
for JYgNfXRzUIfZzVXxGBGNAwPEHgORxvdYZGenRSRlkluADRpUyTiBnpiqvsDgTuWq in (0, 1):
    JYgNfXRzUIfZzVXxGBGNAwPEHgORxvdYZGenRSRlkluADRpUyTiBnpiqvsDgTuWq=JYgNfXRzUIfZzVXxGBGNAwPEHgORxvdYZGenRSRlkluADRpUyTiBnpiqvsDgTuWq+1
HJggwujJzKiRfGTXQKxpcjouanKEWXGJUueytnjnBsMsLLDoZkEdIZjZHcYKxpRq = "JYgNfXRzUIfZzVXxGBGNAwPEHgORxvdYZGenRSRlkluADRpUyTiBnpiqvsDgTuWq)P"

I expected the last line to be:

HJggwujJzKiRfGTXQKxpcjouanKEWXGJUueytnjnBsMsLLDoZkEdIZjZHcYKxpRq = "i)P"

The verbose output while obfuscating the example file was:

********************* [ Analyze and setup environment ] **********************

[+] Running analyze input of 1 file(s)...

Analysis     |================================| 100%

[+] File input found :

-> /home/dodo/tmp/safeToDelete/tmp1/main.py

[+] Analyze input argument '/home/dodo/tmp/safeToDelete/tmp1' -> Successful
[!] Output '/home/dodo/tmp/safeToDelete/deploy1' already exists, do you want delete it ? (Y/N) : 
[+] Running analyze output of 1 file(s)...

Analysis     |================================| 100%

[+] Output files copy :

-> /home/dodo/tmp/safeToDelete/deploy1/main.py

[+] Analyze and setup output argument environment '/home/dodo/tmp/safeToDelete/deploy1' -> Successful

********************** [ Obfuscation delete comments ] ***********************

[+] Running delete comments in 1 file(s)...

Obfuscation  |================================| 100%

Check        |================================| 100%

-> 0 lines of comments deleted

[+] Obfuscation delete comments -> Successful

******************** [ Obfuscation delete line space(s) ] ********************

Obfuscation  |================================| 100%

Check        |================================| 100%

[+] Obfuscation delete lines spaces -> Successful

******************* [ Correction padding empty class(es) ] *******************

Correction   |================================| 100%

[!] No empty class found in /home/dodo/tmp/safeToDelete/deploy1

****************** [ Correction padding empty function(s) ] ******************

Correction   |================================| 100%

[!] No empty function found in /home/dodo/tmp/safeToDelete/deploy1

************ [ Obfuscation replace string(s) to string(s) mixed ] ************

[+] Running replacement of variables/classes/functions in 1 file(s), he can be long... you have time to make a coffee :)

Setting up   |================================| 100%

[+] Variable(s) found :

-> i : JYgNfXRzUIfZzVXxGBGNAwPEHgORxvdYZGenRSRlkluADRpUyTiBnpiqvsDgTuWq
-> text : HJggwujJzKiRfGTXQKxpcjouanKEWXGJUueytnjnBsMsLLDoZkEdIZjZHcYKxpRq

[+] Class(es) found :

-> No result

[+] Function(s) found :

-> No result

[+] String excluded found in 'exclude/string_to_string_mixed/exclude_word_by_user.txt' that have been matched from '/home/dodo/tmp/safeToDelete/deploy1' :

-> No result

[+] String excluded found in 'exclude/string_to_string_mixed/exclude_word_do_not_modify.txt' that have been matched from '/home/dodo/tmp/safeToDelete/deploy1' :

-> No result

Obfuscation  |================================| 100%

Check        |================================| 100%

-> 2 variable(s)/class(es)/function(s) replaced in 1 file(s)

[+] Obfuscation replace string to string mixed -> Successful

****************** [ Obfuscation adding padding script(s) ] ******************

[!] Obfuscation [ padding script ] no asked !

******************** [ Obfuscation replace file(s) name ] ********************

[!] Obfuscation [ replace file name ] feature no asked !

****************** [ Obfuscation replace string(s) to hex ] ******************

[!] Obfuscation [ replace string to hex ] feature no asked !

********************* [ Correction delete .pyc file(s) ] *********************

[!] No .pyc file(s) found in /home/dodo/tmp/safeToDelete/deploy1
Hnfull commented 4 years ago

hi,

unfortunately, this is a malfunction that I documented here -> https://github.com/Hnfull/Intensio-Obfuscator/blob/master/docs/malfunctions/python_code_malfunctions.md that I have not yet resolved .

I will try to prioritize this very important feature.

thank you for this return

mcastillof commented 4 years ago

Hello,

To be honest, I didn't read the docs. I was in rush to obfuscate my code, but I ended it. :) Thanks to you!

Hnfull commented 4 years ago

Okay no problem :), I close this issue to avoid duplication this feature is in https://github.com/Hnfull/Intensio-Obfuscator/issues/26