Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Lucksi
GitHub Repository: Lucksi/Mr.Holmes
Path: blob/master/Core/Port_Scanner.py
1071 views
1
# ORIGINAL CREATOR: Luca Garofalo (Lucksi)
2
# AUTHOR: Luca Garofalo (Lucksi)
3
# Copyright (C) 2021-2023 Lucksi <[email protected]>
4
# License: GNU General Public License v3.0
5
6
import os
7
from Core.Support import Font
8
from Core.Support import Clear
9
from Core.Support.Websites import Scanner
10
from Core.Support import Creds
11
from Core.Support import FileTransfer
12
from Core.Support import Banner_Selector as banner
13
from Core.Support import Language
14
from Core.Support import DateFormat
15
from Core.Support import Notification
16
from Core.Support import Encoding
17
from datetime import datetime
18
19
filename = Language.Translation.Get_Language()
20
filename
21
22
23
class Ports:
24
25
@staticmethod
26
def Banner(Mode):
27
Clear.Screen.Clear()
28
Folder = "Banners/Ports"
29
banner.Random.Get_Banner(Folder, Mode)
30
31
@staticmethod
32
def Main(username, Mode):
33
Ports.Banner(Mode)
34
print(Font.Color.BLUE + "\n[I]" + Font.Color.WHITE + "INFO:" + "[{}]".format(Font.Color.GREEN + Language.Translation.Translate_Language(filename,"Ports","Explanation","None") + Font.Color.WHITE) )
35
now = datetime.now()
36
dataformat = DateFormat.Get.Format()
37
dt_string = now.strftime(dataformat)
38
Date = "Date: " + str(dt_string)
39
report = "GUI/Reports/Ports/{}.txt".format(username)
40
if os.path.exists(report):
41
print(Font.Color.BLUE + "[I]" + Font.Color.WHITE +
42
Language.Translation.Translate_Language(filename, "Default", "Delete", "None").format(username))
43
os.remove(report)
44
f = open(report, "a")
45
f.write("SCANNING EXECUTED ON:\n" + Date + "\r\n")
46
f.write("OPEN PORTS:\r\n")
47
f.close()
48
Scanner.Port.Scan(username, report)
49
f = open(report, "a")
50
f.write(Language.Translation.Translate_Language(
51
filename, "Report", "Default", "By"))
52
f.close()
53
print(Font.Color.WHITE + Language.Translation.Translate_Language(filename, "Default", "Report", "None") +
54
report)
55
Notification.Notifier.Start(Mode)
56
Creds.Sender.mail(report, username)
57
choice = int(input(
58
Font.Color.BLUE + "\n[?]" + Font.Color.WHITE + Language.Translation.Translate_Language(filename, "Transfer", "Question", "None") + Font.Color.GREEN + "[#MR.HOLMES#]" + Font.Color.WHITE + "-->"))
59
if choice == 1:
60
FileTransfer.Transfer.File(report,username,".txt")
61
Encoding.Encoder.Encode(report)
62
inp = input(Language.Translation.Translate_Language(
63
filename, "Default", "Continue", "None"))
64
65