-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
53 lines (42 loc) · 1.43 KB
/
main.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
#import libraries
import os, gzip, time
#import tkinter
import tkinter as tk
# install libraries to render image
from PIL import Image, ImageTk
#get the name of current user
username = os.environ.get('USERNAME')
#set the exploit dictionary
exploit_dict = {}
exploit_found = False
#add the log's content to exploit_dict
if os.path.isdir(f"C:/Users/{username}/AppData/Roaming/.minecraft/logs"):
for root, directories, file in os.walk(f'C:/Users/{username}/AppData/Roaming/.minecraft/logs'):
for file in file:
if(file.endswith(".txt.gz")):
with gzip.open(f'C:/Users/{username}/AppData/Roaming/.minecraft/logs/{file}', 'rb') as f:
file_content = f.read()
#print(file_content.decode('UTF-8'))
exploit_dict[file] = file_content.decode('UTF-8')
#check the exploit dir for any strings that refer to the exploit
for i, x in exploit_dict.items():
if 'jndi:ldap' in x:
print('Found an exploit reference in file :',i)
exploit_found = True
#set the window
window = tk.Tk()
#check if an exploit reference was found
if exploit_found:
load = Image.open("warning.png")
text_for_label = 'Warning!!! An exploit reference was found'
else:
load = Image.open("checkmark.png")
text_for_label = 'No exploit reference was found'
#set the rest of the GUI
render = ImageTk.PhotoImage(load)
img = tk.Label(image=render)
img.pack()
textlabel = tk.Label(text=text_for_label, font=("Arial", 20))
textlabel.pack()
#render the GUI
window.mainloop()