Beispiel #1
0
                     help="check document/MS Office file",
                     action="store_true")
 parser.add_argument("-u",
                     "--update",
                     help="Update SSMA",
                     action="store_true")
 args = parser.parse_args()
 internet_connection = check_internet_connection()
 if args.update and internet_connection:
     try:
         update_me()
     except Exception as e:
         print(e, '\n')
 filetype = Magic(mime=True).from_file(args.filename)
 if filetype == 'application/x-dosexec':
     pe = PEScanner(filename=args.filename)
     print(colors.BOLD + colors.YELLOW + "File Details: " + colors.RESET)
     for n in pe.file_info():
         print('\t', n)
     print()
     print(
         "================================================================================"
     )
     if input("Continue? [Y/n] ") is 'n':
         exit()
     print()
     check_date_result = pe.check_date()
     if check_date_result:
         print(check_date_result)
         print()
         print(
Beispiel #2
0
        try:
            os.path.realpath(args.directory)
        except:
            print(colors.BOLD + colors.RED +
                  "No option selected, run ssma.py -h" + colors.RESET)
            exit()

    internet_connection = check_internet_connection()

    py_file_location = os.path.dirname(__file__)
    args.filename = os.path.realpath(args.filename)
    if py_file_location:
        os.chdir(py_file_location)
    filetype = magic.from_file(args.filename, mime=True)
    if filetype == 'application/x-dosexec':
        pe = PEScanner(filename=args.filename)
        if args.report == "output":
            pass
        else:
            print(colors.BOLD + colors.YELLOW + "File Details: " +
                  colors.RESET)
        for n in pe.file_info(args.report, False):
            if args.report == "output":
                pass
            else:
                print('\t', n)
        if args.report == "output":
            pass
        else:
            print()
            print(
Beispiel #3
0
    parser.add_argument("filename", help="/path/to/file")
    parser.add_argument("-k", "--api-key", help="Virustotal API key")
    parser.add_argument("-d",
                        "--document",
                        help="check document/MS Office file",
                        action="store_true")

    args = parser.parse_args()
    args.filename = os.path.realpath(args.filename)
    internet_connection = check_internet_connection()
    py_file_location = os.path.dirname(__file__)
    if py_file_location:
        os.chdir(py_file_location)
    filetype = magic.from_file(args.filename, mime=True)
    if filetype == 'application/x-dosexec':
        pe = PEScanner(filename=args.filename)
        print(colors.BOLD + colors.YELLOW + "File Details: " + colors.RESET)
        for n in pe.file_info():
            print('\t', n)
        print()
        print(
            "================================================================================"
        )
        if input("Continue? [Y/n] ") is 'n':
            exit()
        print()
        pe.sections_analysis()
        print(
            "================================================================================"
        )
        if input("Continue? [Y/n] ") is 'n':