-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathcybermachine.py
65 lines (46 loc) · 1.96 KB
/
cybermachine.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
import argparse
import subprocess
import random
from pyfiglet import Figlet
from extractPE import fileExtract
from malwareML import machineLearnMalware
from spamML import machineLearnSpam
from urlML import machineLearnUrl
print("\n\n\n")
fontList = ["big","bulbhead","roman","epic","larry3d","speed","nancyj","stampatello","smslant","slscript","serifcap","rounded","puffy","o8","letters","colossal","basic"]
fontType = random.choice(fontList)
f = Figlet(font=fontType)
print(f.renderText('Cyber Machine'))
print("by emr4h\n")
parser = argparse.ArgumentParser(prog="hackwall\n", description="Threat Analysis Tool for End User", usage="\n\n Malware Analysis with ML: python3 cybermachine.py --exe <file_path> \n Email Analysis with ML: python3 cybermachine.py --mail <string> \n Url Analysis with ML: python3 cybermachine.py --url <string>")
parser.add_argument("--exe", help = "Malware Analysis with ML, give value in exe file type")
parser.add_argument("--mail", type=str, help = "Email Spam Analysis with ML, give value in string type ")
parser.add_argument("--url", type=str, help = "Url Spam Analysis with ML, give value in string type ")
args = parser.parse_args()
def analysisMalware(argument):
fileExtract(argument)
result = machineLearnMalware()
if(result >=2):
print("ML Prediction --> Malware.\n")
else:
print("ML Prediction --> Secure.\n")
subprocess.call(["rm", "inputData.csv"])
def analysisSpam(argument):
result = machineLearnSpam(argument)
if(result >=2):
print("ML Prediction --> Spam.\n")
else:
print("ML Prediction --> Secure.\n")
def analysisUrl(argument):
result = machineLearnUrl(argument)
if(result >=2):
print("ML Prediction --> Spam.\n")
else:
print("ML Prediction --> Secure.\n")
if __name__=='__main__':
if(args.exe):
analysisMalware(args.exe)
if(args.mail):
analysisSpam(args.mail)
if(args.url):
analysisUrl(args.url)