def install(enabled, force, rewrite):
    (temp, source) = download_archive()

    folders = {
        "signatures": os.path.join("modules", "signatures"),
        "processing": os.path.join("modules", "processing"),
        "reporting": os.path.join("modules", "reporting"),
        "machinemanagers": os.path.join("modules", "machinemanagers")
    }

    for category in enabled:
        folder = folders[category]

        print("\nInstalling {0}".format(colors.cyan(category.upper())))

        origin = os.path.join(source, folder)

        for file_name in os.listdir(origin):
            if file_name == ".gitignore":
                continue

            destination = os.path.join(CUCKOO_ROOT, folder, file_name)

            if not rewrite:
                if os.path.exists(destination):
                    print("File \"{0}\" already exists, {1}".format(
                        file_name, colors.yellow("skipped")))
                    continue

            install = False

            if not force:
                while 1:
                    choice = raw_input(
                        "Do you want to install file \"{0}\"? [yes/no] ".
                        format(file_name))
                    if choice.lower() == "yes":
                        install = True
                        break
                    elif choice.lower() == "no":
                        break
                    else:
                        continue
            else:
                install = True

            if install:
                shutil.copy(os.path.join(origin, file_name), destination)
                print("File \"{0}\" {1}".format(file_name,
                                                colors.green("installed")))

    shutil.rmtree(temp)
示例#2
0
def install(enabled, force, rewrite):
    (temp, source) = download_archive()

    folders = {
        "signatures" : os.path.join("modules", "signatures"),
        "processing" : os.path.join("modules", "processing"),
        "reporting" : os.path.join("modules", "reporting"),
        "machinemanagers" : os.path.join("modules", "machinemanagers")
    }

    for category in enabled:
        folder = folders[category]

        print("\nInstalling {0}".format(colors.cyan(category.upper())))

        origin = os.path.join(source, folder)

        for file_name in os.listdir(origin):
            if file_name == ".gitignore":
                continue

            destination = os.path.join(CUCKOO_ROOT, folder, file_name)

            if not rewrite:
                if os.path.exists(destination):
                    print("File \"{0}\" already exists, {1}".format(file_name, colors.yellow("skipped")))
                    continue

            install = False

            if not force:
                while 1:
                    choice = raw_input("Do you want to install file \"{0}\"? [yes/no] ".format(file_name))
                    if choice.lower() == "yes":
                        install = True
                        break
                    elif choice.lower() == "no":
                        break
                    else:
                        continue
            else:
                install = True

            if install:
                shutil.copy(os.path.join(origin, file_name), destination)
                print("File \"{0}\" {1}".format(file_name, colors.green("installed")))

    shutil.rmtree(temp)
示例#3
0
def logo():
    """Cuckoo asciiarts.
    @return: asciiarts array.
    """
    apt = """
                            xxxxxx       xxxx
                             xxx        xxxx
                              x         xxxx
                   xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx              x
                        xxxx    xxxx    xxxx                        x
                 xxx    xxx     xxxxxxxxxxxxxxx         x
                          xx    xx                 xxxx      x
      x      xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxx     x
          x             xxxxxxxxxxxx    xxxx                 x
            x           xxxx    xxxx    xxxxxxxxxxxxx          x
             x          xxxxxxxxxxxx    xxxx                x
            x           xxxx    xxxx    xxxxxxxxxxxxx                x
         x              xxxxxxxxxxxx    xxxx                           xx
       xx               xxxx    xxxx    xxxxxxxxxxxxx                  xxx
      xxx              xxxx  x  xxxx    xxxx                         xxxxx
       xxxx          xxxx     xxxxx      xxxx                     xxxxxx
         xxxxxxxxxxxxx         xxx         xxxxxxxxxxxxxxxxxxxxxxxxx
                                    /   \\       
   _                        )      ((   ))     (
  (@)                      /|\\      ))_((     /|\\
  |-|                     / | \\    (/\\|/\\)   / | \\                      (@)
  | | -------------------/--|-voV---\\`|'/--Vov-|--\\---------------------|-|
  |-|                         '^`   (o o)  '^`                          | |
  | |                               `\\Y/'                               |-|
  |-|                                                                   | |
  | |                        Dragon Sandbossss                          |-|
  | |                                                                   |-|
  |_|___________________________________________________________________| |
  (@)              l   /\\ /         ( (       \\ /\\   l                `\\|-|
                   l /   V           \\ \\       V   \\ l                  (@)
                   l/                _) )_          \\I
                                     `\\ /'
                                       `"""

    print(red(bold(apt)))
    print("")
    print(" Dragon Sandbox " + yellow(CUCKOO_VERSION))
    sys.stdout.flush()