-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
445 lines (367 loc) · 40.1 KB
/
app.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
#!/usr/bin/env python3
from idlelib.tooltip import Hovertip
from yaml.loader import SafeLoader
import tkinter as tk
import webbrowser
import importlib
import threading
import yaml
import re
class MyApp(tk.Tk):
def __init__(self):
super().__init__()
self.homepage = HomePage(self)
# self.configurepage = ConfigurePage(self)
# self.aboutpage = AboutPage(self)
# Set window size
self.HEIGHT = 500
self.WIDTH = 600
# window title
self.title('IP Analyzer Tool')
# gets current directory for icon
# path = Path(__file__).parent.absolute()
# icon_path = f'{path}\icon.ico'
# self.iconbitmap(icon_path)
# Icon base64
self.icon_base64 = """
iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOxAAADsQBlSsOGwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAACAASURBVHic7d13mF1Vof7xd+3TZyYz6QlpkEKoUkIPUgTpSGhBEQslIiCgV2leQPHqVbkoWO+9IE1Q4dJBEAsdpAbpICYQSEKENJKpp+71+yPgL0DKlHPO2vus7+d5eB5KMuedsGef96y9ihGA6rPWzJz/8q6h0f7G2F1kNUXSUEktrqOtrueV0a4jfFAga4KwolSlPUhUXlZGv71j+3H/6zoW0IiM6wBAI9nT3p8csWD4l6zM1yVNcZ1nfSJXANYgSFWKprl4Y/vI8qwHJk7Mu84DNAoKAFAlMxc+v4utJK6SsZu4ztJbcSgA7zOpctG0lr7y++3HX+46C9AIAtcBgEZwxPwX/82GwYNxevOPG1tKpu2y7K8+9diCm11nARoBBQAYoCPffPFsI10sKeU6S6OzMgrbc4d/6rGF97vOAsQdBQAYgJnzXzhZRj90ncM3YXt2z0MeX3Ct6xxAnFEAgH464o2XtrUyF7vO4auwPfu5Q2a/OdN1DiCuKABAP5mE/YWkrOscvrLWyHamr5S13MeAfuAHB+iHIxa8eISsprvO4buwkGr51FMLL3SdA4gjlgECfXTi7Nmp5SOzL0na2HWWgYrTMsC1CVK2lDV26I2fGNnpOgsQJ4wAAH20fFTuJDXAm3+jCEsmlW8qXuE6BxA3jAAAfXDYwleGJcLwFcmOcJ2lGhphBECSgoQNs4O6pty400bzXG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vXVx+Vd50D0UACwRolE5SJJoescAAbCKJVqOtd1CkQTBQBrdOGF01+Q9BvXOQD0XzbbMufyyz/1f65zIJooAFirSsWcJ2mp6xwA+i6RSISpVI6jgLFWFACs1cUX77ggCOxhkoquswDoC6Ncru2Myy8/+GnXSRBdFACs04UX7vyItTpFUsV1FgC909zcdtUVVxx6iesciDYKANbrRz/a6QrJHCxphessANYuCBJ20KDB/3nllYcf7zoLoo8CgF656KId/2hMOF3Sw66zAPioTCa7orl56MGXX374ea6zIB6M6wCIn7POeuwQa4PvSNrGdRYMzPz5L7mOgAFKJjM9TU3NF/3qV4d+23UWxAsFAP12zjmPTqlUgkOtNZ80RptKGi6JY0djhAIQL8YYBUGqnEgkVqRSmcdTKfOTSy897F7XuRBP/w/x4C1mi3XMfAAAAABJRU5ErkJggg==
"""
# Icon
self.iconphoto(True, tk.PhotoImage(data=self.icon_base64))
# Create initial menubar
self.menubar = tk.Menu(self)
self.config(menu=self.menubar)
# File menubar
self.file_menu = tk.Menu(self.menubar, tearoff=False)
self.file_menu.add_command(label='Configure', command=lambda:[self.homepage.home_frame.destroy(), ConfigurePage(self)]) # Removes current home_frame and then opens config page
self.file_menu.add_separator()
self.file_menu.add_command(label='Exit', command=self.destroy,)
# Help menubar
self.help_menu = tk.Menu(self.menubar, tearoff=False)
self.help_menu.add_command(label='About', command=lambda:[self.homepage.home_frame.destroy(), AboutPage(self)])
# Add all Menus to the menubar
self.menubar.add_cascade(label='File', menu=self.file_menu)
self.menubar.add_cascade(label='Help', menu=self.help_menu)
# canvas - creates the screen
self.canvas = tk.Canvas(self, height=self.HEIGHT, width=self.WIDTH)
self.canvas.pack()
# Draw home_page on the screen
HomePage(self)
# Reads the config.yaml
def read_config_yaml(self):
with open('config.yaml', 'r') as f:
config = yaml.load(f, Loader=SafeLoader)
return config
class HomePage(tk.Frame):
def __init__(self, myapp):
super().__init__()
self.myapp = myapp
# Frame for everything on home screen
self.home_frame = tk.Frame(self.myapp, bg='grey')
self.home_frame.place(relwidth=1, relheight=1)
# Label - IP Address Field
self.input_label = tk.Label(self.home_frame, text='IP Address: ', bg='grey', fg='white')
self.input_label.grid(row=0, column=0, sticky=tk.W, padx=(113, 0))
# Input box for ip address
self.search_ip = tk.Entry(self.home_frame, width=35)
self.search_ip.grid(row=0, column=0, sticky=tk.W, padx=(180, 0))
# Submit button and enter key creation
self.search_btn = tk.Button(self.home_frame, text = 'Submit', fg = 'black', command=self.search_ip_clicked)
self.search_btn.grid(row=0, column=0, sticky=tk.W, padx=(400, 0))
self.myapp.bind('<Return>', self.search_ip_clicked)
# Output Window
self.output_window = tk.Text(self.home_frame, height=29, width=75)
self.output_window.insert(tk.INSERT, 'Results show up here')
self.output_window.grid(row=1, column=0)
# event=None has to be here for the ENTER button on keyboard to be used.
def search_ip_clicked(self, event=None):
ip_result = re.search(r'\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}', str(self.search_ip.get())) # pulls only an ipv4 address from search_ip input box
if ip_result == None: # Checks if nothing was found
self.output_window.delete(1.0, tk.END) # Clear output window
output = '[-] Only use an IPv4 Address. Ex: 8.8.8.8'
self.output_window.insert(tk.END, output)
else:
r_config_yaml = self.myapp.read_config_yaml()
self.output_window.delete(1.0, tk.END) # Clear output window
output = f'Showing results for: {ip_result.group(0)}\n'
self.output_window.insert(tk.END, output) # Adds the searched IP Address to the top of the reporting list.
self.run_analyzer(ip_result.group(0), r_config_yaml)
self.search_ip.delete(0, tk.END) # Clear search window
# Checks to see if analyzer is enabled and if so then creates a new thread for that analyzer
def run_analyzer(self, ip_address, config):
for analyzers in config['analyzers']: # Dynamically creates a thread for each analyzer
enabled = f'{analyzers}_enabled'
if config[enabled] == True:
analyzer = threading.Thread(target=self.query_analyzer, args=(ip_address, config, analyzers))
analyzer.start()
# fetches/filters data for each analyzer dynamically
def query_analyzer(self, ip_address, config, analyzer):
if config[analyzer] == 'your_api_key_goes_here': # Checks to see if there no data in api key field
output = f'\n[-] {analyzer} is missing an API Key\n'
else:
fetch_data = 'fetch_data'
mod = importlib.import_module(f'{analyzer}_analyzer')
fetch = getattr(mod, fetch_data)
filter_data = 'filter_data'
filter = getattr(mod, filter_data)
data = fetch(ip_address, config[analyzer])
output = filter(data)
self.output_window.insert(tk.END, output) # Adds output to output window
class ConfigurePage(tk.Frame):
def __init__(self, myapp):
super().__init__()
self.myapp = myapp
self.homepage = HomePage(self.myapp)
# Frame for everything on Configuration page
self.config_frame = tk.Frame(self.myapp, bg='grey')
self.config_frame.place(relwidth=1, relheight=1)
# Back Button - Removes current config_frame and then opens config page
self.back_btn = tk.Button(self.config_frame, text = 'Back', fg = 'black', command=lambda:[self.save_btn_func(), self.config_frame.destroy(), self.homepage])
self.back_btn.grid(row=0, column=0, sticky=tk.W)
# Load on/off Images
self.on_image = tk.PhotoImage(file='switch-on.png')
self.off_image = tk.PhotoImage(file='switch-off.png')
# Adds AbuseIPDB to config page
self.abuseipdb_widget()
# Adds alienvault to config page
self.alienvault_widget()
# Adds greynoise to config page
self.greynoise_widget()
# Adds pulsedive to the config page
self.pulsedive_widget()
# Adds virustotal to the config page
self.virustotal_widget()
# Configuration Label
# self.input_label = tk.Label(self.config_frame, text='Configuration Page', bg='grey', fg='white', font=('Calibri', 18))
# self.input_label.grid(row=1, column=0, pady=(0, 20))
# abuseIPDB widget
def abuseipdb_widget(self):
abuseipdb_label = tk.Label(self.config_frame, text='AbuseIPDB', bg='grey', fg='white', font=('Calibri', 13))
abuseipdb_label.grid(row=2, column=0)
self.abuseipdb_btn = tk.Button(self.config_frame, command=lambda: [self.switch_btn('abuseipdb')], bg='grey', bd=0, activebackground='grey',)
abuseipdb_image = self.set_init_switch('abuseipdb')
self.abuseipdb_btn.config(image=abuseipdb_image)
self.abuseipdb_btn.grid(row=2, column=0, sticky=tk.E)
self.abuseipdb_entry = tk.Entry(self.config_frame, width=90)
abuseipdb_key = self.set_init_key('abuseipdb')
self.abuseipdb_entry.insert(0, abuseipdb_key)
self.abuseipdb_entry.grid(row=3, column=0, padx=(20, 0))
self.abuseipdb_link = tk.Label(self.config_frame, text='https://www.abuseipdb.com/account/api', fg='orange', bg='grey', font=('Calibri', 10))
self.abuseipdb_link.grid(row=4, column=0, padx=(20, 0), pady=(0, 20), sticky=tk.W)
self.abuseipdb_link.bind('<Button-1>', lambda e: self.open_url('https://www.abuseipdb.com/account/api'))
self.abuseipdb_link_tooltip = Hovertip(self.abuseipdb_link, 'Click here to register for an API Key - AbuseIPDB')
# alienvault widget
def alienvault_widget(self):
alienvault_label = tk.Label(self.config_frame, text='AlienVault', bg='grey', fg='white', font=('Calibri', 13))
alienvault_label.grid(row=5, column=0)
self.alienvault_btn = tk.Button(self.config_frame, command=lambda: [self.switch_btn('alienvault')], bg='grey', bd=0, activebackground='grey',)
alienvault_image = self.set_init_switch('alienvault')
self.alienvault_btn.config(image=alienvault_image)
self.alienvault_btn.grid(row=5, column=0, sticky=tk.E)
self.alienvault_entry = tk.Entry(self.config_frame, width=90)
alienvault_key = self.set_init_key('alienvault')
self.alienvault_entry.insert(0, alienvault_key)
self.alienvault_entry.grid(row=6, column=0, padx=(20, 0))
self.alienvault_link = tk.Label(self.config_frame, text='https://otx.alienvault.com/api', fg='light blue', bg='grey', font=('Calibri', 10))
self.alienvault_link.grid(row=7, column=0, padx=(20, 0), pady=(0, 20), sticky=tk.W)
self.alienvault_link.bind('<Button-1>', lambda e: self.open_url('https://otx.alienvault.com/api'))
self.alienvault_link_tooltip = Hovertip(self.alienvault_link, 'Click here to register for an API Key - AlienVault')
# greynoise widget
def greynoise_widget(self):
greynoise_label = tk.Label(self.config_frame, text='GreyNoise', bg='grey', fg='white', font=('Calibri', 13))
greynoise_label.grid(row=8, column=0)
self.greynoise_btn = tk.Button(self.config_frame, command=lambda: [self.switch_btn('greynoise')], bg='grey', bd=0, activebackground='grey',)
greynoise_image = self.set_init_switch('greynoise')
self.greynoise_btn.config(image=greynoise_image)
self.greynoise_btn.grid(row=8, column=0, sticky=tk.E)
self.greynoise_entry = tk.Entry(self.config_frame, width=90)
greynoise_key = self.set_init_key('greynoise')
self.greynoise_entry.insert(0, greynoise_key)
self.greynoise_entry.grid(row=9, column=0, padx=(20, 0))
self.greynoise_link = tk.Label(self.config_frame, text='https://www.greynoise.io/viz/account', fg='orange', bg='grey', font=('Calibri', 10))
self.greynoise_link.grid(row=10, column=0, padx=(20, 0), pady=(0, 20), sticky=tk.W)
self.greynoise_link.bind('<Button-1>', lambda e: self.open_url('https://www.greynoise.io/viz/account'))
self.greynoise_link_tooltip = Hovertip(self.greynoise_link, 'Click here to register for an API Key - GreyNoise')
# pulsedive widget
def pulsedive_widget(self):
pulsedive_label = tk.Label(self.config_frame, text='Pulsedive', bg='grey', fg='white', font=('Calibri', 13))
pulsedive_label.grid(row=11, column=0)
self.pulsedive_btn = tk.Button(self.config_frame, command=lambda: [self.switch_btn('pulsedive')], bg='grey', bd=0, activebackground='grey',)
pulsedive_image = self.set_init_switch('pulsedive')
self.pulsedive_btn.config(image=pulsedive_image)
self.pulsedive_btn.grid(row=11, column=0, sticky=tk.E)
self.pulsedive_entry = tk.Entry(self.config_frame, width=90)
pulsedive_key = self.set_init_key('pulsedive')
self.pulsedive_entry.insert(0, pulsedive_key)
self.pulsedive_entry.grid(row=12, column=0, padx=(20, 0))
self.pulsedive_link = tk.Label(self.config_frame, text='https://pulsedive.com/api/#login', fg='light blue', bg='grey', font=('Calibri', 10))
self.pulsedive_link.grid(row=13, column=0, padx=(20, 0), pady=(0, 20), sticky=tk.W)
self.pulsedive_link.bind('<Button-1>', lambda e: self.open_url('https://pulsedive.com/api/#login'))
self.pulsedive_link_tooltip = Hovertip(self.pulsedive_link, 'Click here to register for an API Key - Pulsedive')
# virustotal widget
def virustotal_widget(self):
virustotal_label = tk.Label(self.config_frame, text='VirusTotal', bg='grey', fg='white', font=('Calibri', 13))
virustotal_label.grid(row=14, column=0)
self.virustotal_btn = tk.Button(self.config_frame, command=lambda: [self.switch_btn('virustotal')], bg='grey', bd=0, activebackground='grey',)
virustotal_image = self.set_init_switch('virustotal')
self.virustotal_btn.config(image=virustotal_image)
self.virustotal_btn.grid(row=14, column=0, sticky=tk.E)
self.virustotal_entry = tk.Entry(self.config_frame, width=90)
virustotal_key = self.set_init_key('virustotal')
self.virustotal_entry.insert(0, virustotal_key)
self.virustotal_entry.grid(row=15, column=0, padx=(20, 0))
self.virustotal_link = tk.Label(self.config_frame, text='https://www.virustotal.com/gui/my-apikey', fg='orange', bg='grey', font=('Calibri', 10))
self.virustotal_link.grid(row=16, column=0, padx=(20, 0), pady=(0, 20), sticky=tk.W)
self.virustotal_link.bind('<Button-1>', lambda e: self.open_url('https://www.virustotal.com/gui/my-apikey'))
self.virustotal_link_tooltip = Hovertip(self.virustotal_link, 'Click here to register for an API Key - VirusTotal')
# Saves all entry fields
def save_btn_func(self):
r_config_yaml = self.myapp.read_config_yaml()
self.abuseipdb_field_check(r_config_yaml)
self.alienvault_field_check(r_config_yaml)
self.greynoise_field_check(r_config_yaml)
self.pulsedive_field_check(r_config_yaml)
self.virustotal_field_check(r_config_yaml)
def abuseipdb_field_check(self, r_config_yaml):
if self.abuseipdb_entry.get() == '':
r_config_yaml['abuseipdb'] = 'your_api_key_goes_here'
else:
r_config_yaml['abuseipdb'] = self.abuseipdb_entry.get()
self.write_config_yaml(r_config_yaml)
def alienvault_field_check(self, r_config_yaml):
if self.alienvault_entry.get() == '':
r_config_yaml['alienvault'] = 'your_api_key_goes_here'
else:
r_config_yaml['alienvault'] = self.alienvault_entry.get()
self.write_config_yaml(r_config_yaml)
def greynoise_field_check(self, r_config_yaml):
if self.greynoise_entry.get() == '':
r_config_yaml['greynoise'] = 'your_api_key_goes_here'
else:
r_config_yaml['greynoise'] = self.greynoise_entry.get()
self.write_config_yaml(r_config_yaml)
def pulsedive_field_check(self, r_config_yaml):
if self.pulsedive_entry.get() == '':
r_config_yaml['pulsedive'] = 'your_api_key_goes_here'
else:
r_config_yaml['pulsedive'] = self.pulsedive_entry.get()
self.write_config_yaml(r_config_yaml)
def virustotal_field_check(self, r_config_yaml):
if self.virustotal_entry.get() == '':
r_config_yaml['virustotal'] = 'your_api_key_goes_here'
else:
r_config_yaml['virustotal'] = self.virustotal_entry.get()
self.write_config_yaml(r_config_yaml)
def set_init_key(self, analyzer):
r_config_yaml = self.myapp.read_config_yaml()
return r_config_yaml[analyzer]
# Checks config.yaml to see if the analyzer is turned on or not
def set_init_switch(self, analyzer):
r_config_yaml = self.myapp.read_config_yaml()
analyzer_bool = f'{analyzer}_enabled'
if r_config_yaml[analyzer_bool]:
return self.on_image
else:
return self.off_image
# Used for changing the buttons from on to off in Configuration page
def switch_btn(self, analyzer):
r_config_yaml = self.myapp.read_config_yaml()
analyzer_bool = f'{analyzer}_enabled'
if analyzer == 'abuseipdb':
if r_config_yaml[analyzer_bool]:
self.abuseipdb_btn.config(image=self.off_image)
r_config_yaml[analyzer_bool] = False
self.write_config_yaml(r_config_yaml)
else:
self.abuseipdb_btn.config(image=self.on_image)
r_config_yaml[analyzer_bool] = True
self.write_config_yaml(r_config_yaml)
if analyzer == 'alienvault':
if r_config_yaml[analyzer_bool]:
self.alienvault_btn.config(image=self.off_image)
r_config_yaml[analyzer_bool] = False
self.write_config_yaml(r_config_yaml)
else:
self.alienvault_btn.config(image=self.on_image)
r_config_yaml[analyzer_bool] = True
self.write_config_yaml(r_config_yaml)
if analyzer == 'greynoise':
if r_config_yaml[analyzer_bool]:
self.greynoise_btn.config(image=self.off_image)
r_config_yaml[analyzer_bool] = False
self.write_config_yaml(r_config_yaml)
else:
self.greynoise_btn.config(image=self.on_image)
r_config_yaml[analyzer_bool] = True
self.write_config_yaml(r_config_yaml)
if analyzer == 'pulsedive':
if r_config_yaml[analyzer_bool]:
self.pulsedive_btn.config(image=self.off_image)
r_config_yaml[analyzer_bool] = False
self.write_config_yaml(r_config_yaml)
else:
self.pulsedive_btn.config(image=self.on_image)
r_config_yaml[analyzer_bool] = True
self.write_config_yaml(r_config_yaml)
if analyzer == 'virustotal':
if r_config_yaml[analyzer_bool]:
self.virustotal_btn.config(image=self.off_image)
r_config_yaml[analyzer_bool] = False
self.write_config_yaml(r_config_yaml)
else:
self.virustotal_btn.config(image=self.on_image)
r_config_yaml[analyzer_bool] = True
self.write_config_yaml(r_config_yaml)
def open_url(self, url):
webbrowser.open_new_tab(url)
# Writes new config to config.yaml
def write_config_yaml(self, new_config_yaml):
with open('config.yaml', 'w') as f:
yaml.dump(new_config_yaml, f)
class AboutPage(tk.Frame):
def __init__(self, myapp):
super().__init__()
self.myapp = myapp
self.homepage = HomePage(self.myapp)
# Frame for everything on home screen
self.about_frame = tk.Frame(self.myapp, bg='grey')
self.about_frame.place(relwidth=1, relheight=1)
# Back Button - Removes current config_frame and then opens config page
self.back_btn = tk.Button(self.about_frame, text = 'Back', fg = 'black', command=lambda:[self.about_frame.destroy(), self.homepage])
self.back_btn.grid(row=0, column=0, sticky=tk.W)
# Label - About Label
# self.input_label = tk.Label(self.about_frame, text='About Page', bg='grey', fg='white', font=('Calibri', 18))
# self.input_label.grid(row=1, column=0, padx=(150, 0), pady=(0, 40))
# Version Information
self.version_label = tk.Label(self.about_frame, text='Version: 1.0.5', bg='grey', fg='white', font=('Calibri', 12))
self.version_label.grid(row=1, column=0, padx=(150, 0), pady=(0, 40))
self.version_label.bind('<Button-1>', lambda e: self.open_url('https://github.com/PeanutTheAdmin/IP-Analyzer-Tool'))
self.version_label_tooltip = Hovertip(self.version_label, 'Github Link: https://github.com/PeanutTheAdmin/IP-Analyzer-Tool')
self.created_by_attribute = tk.Label(self.about_frame, text='Created by: Jacob Cavaness', fg='orange', bg='grey', font=('Calibri', 10))
self.created_by_attribute.grid(row=2, column=0, padx=(215, 0), pady=(0, 30), sticky=tk.W)
self.created_by_attribute.bind('<Button-1>', lambda e: self.open_url('https://www.linkedin.com/in/jacob-cavaness/'))
self.created_by_attribute_tooltip = Hovertip(self.created_by_attribute, 'Connect On Linkedin: https://www.linkedin.com/in/jacob-cavaness/')
self.ip_icon_attribute = tk.Label(self.about_frame, text='IP icons created by Freepik - Flaticon', fg='light blue', bg='grey', font=('Calibri', 10))
self.ip_icon_attribute.grid(row=3, column=0, padx=(200, 0), pady=(0, 30), sticky=tk.W)
self.ip_icon_attribute.bind('<Button-1>', lambda e: self.open_url('https://www.flaticon.com/free-icons/ip'))
self.ip_icon_attribute_tooltip = Hovertip(self.ip_icon_attribute, 'Click here to visit: https://www.flaticon.com/free-icons/ip')
self.on_icon_attribute = tk.Label(self.about_frame, text='On icons created by Pixel perfect - Flaticon', fg='orange', bg='grey', font=('Calibri', 10))
self.on_icon_attribute.grid(row=4, column=0, padx=(188, 0), pady=(0, 30), sticky=tk.W)
self.on_icon_attribute.bind('<Button-1>', lambda e: self.open_url('https://www.flaticon.com/free-icons/on'))
self.on_icon_attribute_tooltip = Hovertip(self.on_icon_attribute, 'Click here to visit: https://www.flaticon.com/free-icons/on')
self.off_icon_attribute = tk.Label(self.about_frame, text='Off icons created by Pixel perfect - Flaticon', fg='light blue', bg='grey', font=('Calibri', 10))
self.off_icon_attribute.grid(row=5, column=0, padx=(188, 0), pady=(0, 40), sticky=tk.W)
self.off_icon_attribute.bind('<Button-1>', lambda e: self.open_url('https://www.flaticon.com/free-icons/off'))
self.off_icon_attribute_tooltip = Hovertip(self.off_icon_attribute, 'Click here to visit: https://www.flaticon.com/free-icons/off')
# Create a Label Widget to display the text or Image
python_powered_img = tk.PhotoImage(file="python-powered.png")
self.python_powered_label = tk.Label(self.about_frame, image = python_powered_img)
self.python_powered_label.photo = python_powered_img
self.python_powered_label.grid(row=6, column=0, padx=(175, 0))
self.python_powered_label.bind('<Button-1>', lambda e: self.open_url('https://www.python.org/'))
self.python_powered_tooltip = Hovertip(self.python_powered_label, 'Click here to visit: https://www.python.org/')
def open_url(self, url):
webbrowser.open_new_tab(url)
if __name__ == '__main__':
myapp = MyApp()
myapp.mainloop()