forked from OWASP/SecureTea-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MalwareAnalysis.py
80 lines (71 loc) · 2.9 KB
/
MalwareAnalysis.py
1
2
3
4
5
6
7
8
9
10
11
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# !/bin/python
# -*- coding: utf-8 -*-
u"""SecureTea Social Engineering
Project:
╔═╗┌─┐┌─┐┬ ┬┬─┐┌─┐╔╦╗┌─┐┌─┐
╚═╗├┤ │ │ │├┬┘├┤ ║ ├┤ ├─┤
╚═╝└─┘└─┘└─┘┴└─└─┘ ╩ └─┘┴ ┴
Author: Digvijay Bhosale <[email protected]> August 15 2021
Version: 1.0
Module: SecureTea
"""
import os
import json
from securetea.lib.malware_analysis.fileAnalysis import FileAnalyser
from securetea.lib.malware_analysis.malwareAnalysis import MalwareAnalysis
i = 0
filename = ''
same_file = 'n'
if __name__ == '__main__':
while True:
if i == 1: # so that this will run after the first loop runs
try:
same_file = input('Use same file? (Y/n)') or 'y' # makes UX better by not making select same file again
except KeyboardInterrupt:
print("KeyboardInterrupt Detected. Quitting now ...")
if same_file.lower() == 'n': # get new file if user wants new file
filename = ''
i = 0
try:
pass
filename = input(
"File to check for malware (Enter complete path if file not in directory of script) : ")
except KeyboardInterrupt:
print("KeyboardInterrupt Detected. Quitting now ...")
exit(0)
if filename.lower().strip() == 'q' or filename.lower() == 'quit' or filename.lower() == 'exit':
print("Thank you for using SecureTea Malware Analysis Tool")
exit()
if os.path.isfile(filename):
pass
else:
print('Given Filename does not exist. ')
continue
file = open(filename, 'r')
action = ''
try:
action = input('f/F - Steganographic File Analysis of Suspicious file\n'
'm/M - Malware Analysis of Suspicious file\n'
'a/A - Steg and Malware analysis\n'
'q/Q - Quit\n'
'\t:')
except KeyboardInterrupt:
print("KeyboardInterrupt Detected. Quitting now ...")
exit(0)
if action.lower() == 'f':
f_analysis = FileAnalyser(file)
f_analysis.start_analysis()
elif action.lower() == 'm':
m_analysis = MalwareAnalysis(file, filename)
m_analysis.runner()
elif action.lower() == 'a':
f_analysis = FileAnalyser(file)
f_analysis.start_analysis()
m_analysis = MalwareAnalysis(file, filename)
m_analysis.runner()
elif action.lower() == 'q':
print("Thank you for using SecureTea Malware Analysis Tool")
exit()
else:
print('Incorrect Option selected')
i = 1 # after first loop, i =1