Pozdrav da li zna neko novi Host od ovog http://mkdlive.org
Follow along with the video below to see how to install our site as a web app on your home screen.
Забелешка: This feature may not be available in some browsers.
Било што и да имате 4К да испробам.Koj kanali hoches da gledas i kakvom kvalitetu orginalno ili sa mali bitrejd.

import tkinter as tk
from tkinter import filedialog, messagebox
from urllib.parse import urlparse
import re
from collections import Counter
COMMON_PORTS = [
80, 443, 8000, 8080, 8081, 8443,
25461, 25500, 2095, 2096, 8880, 9000
]
class IPTVInspector:
def __init__(self, root):
self.root = root
root.title("IPTV Security Inspector PRO")
root.geometry("1000x700")
# ===== TOP =====
top = tk.Frame(root)
top.pack(fill="x", pady=5)
tk.Label(top, text="Ručno ubaci URL:").pack(side="left")
self.url_entry = tk.Entry(top, width=60)
self.url_entry.pack(side="left", padx=5)
tk.Button(top, text="Dodaj URL", command=self.add_url).pack(side="left")
tk.Label(top, text="OS Firewall:").pack(side="left", padx=10)
self.os_var = tk.StringVar(value="ufw")
tk.OptionMenu(top, self.os_var, "ufw", "iptables").pack(side="left")
# ===== BUTTONS =====
btns = tk.Frame(root)
btns.pack(fill="x", pady=5)
tk.Button(btns, text="Učitaj M3U", command=self.load_m3u).pack(side="left")
tk.Button(btns, text="Analiziraj", command=self.analyze).pack(side="left")
tk.Button(btns, text="Kopiraj Firewall", command=self.copy_firewall).pack(side="left")
tk.Button(btns, text="Export TXT", command=self.export_txt).pack(side="left")
tk.Button(btns, text="Export HTML", command=self.export_html).pack(side="left")
tk.Button(btns, text="Obriši sve", command=self.clear_all).pack(side="left")
# ===== TEXT =====
self.text = tk.Text(root, bg="black", fg="white", font=("Consolas", 10))
self.text.pack(fill="both", expand=True)
self.urls = []
self.report = ""
self.firewall_cmds = ""
# ===== ACTIONS =====
def add_url(self):
url = self.url_entry.get().strip()
if not url.startswith("http"):
messagebox.showerror("Greška", "URL mora početi sa http:// ili https://")
return
self.urls.append(url)
self.url_entry.delete(0, tk.END)
self.text.insert(tk.END, f"[DODAT URL] {url}\n", "green")
def load_m3u(self):
path = filedialog.askopenfilename(filetypes=[("M3U files","*.m3u")])
if not path:
return
with open(path, "r", errors="ignore") as f:
data = f.read()
found = re.findall(r'http[s]?://[^\s]+', data)
self.urls.extend(found)
messagebox.showinfo("OK", f"Učitano {len(found)} URL‑ova")
def analyze(self):
if not self.urls:
messagebox.showwarning("Prazno", "Nema URL‑ova")
return
ips = set()
ports = []
live = vod = series = 0
risks = 0
panel = "Custom"
for u in self.urls:
p = urlparse(u)
ips.add(p.hostname)
ports.append(p.port or 80)
if "/live/" in u: live += 1
elif "/movie/" in u: vod += 1
elif "/series/" in u: series += 1
if "get.php" in u:
panel = "Xtream Codes / Xtream UI"
risks += 1
if "username=" in u and "password=" in u:
risks += 1
port_count = Counter(ports)
used_ports = set(port_count.keys())
free_ports = [p for p in COMMON_PORTS if p not in used_ports]
if len(ips) > 1: risks += 1
if len(port_count) > 1: risks += 1
if 80 in used_ports: risks += 1
if any(p in [25461,25500] for p in used_ports): risks += 1
score = "LOW" if risks <= 2 else "MEDIUM" if risks <= 5 else "HIGH"
# ===== FIREWALL COMMANDS =====
self.firewall_cmds = ""
osfw = self.os_var.get()
if osfw == "ufw":
self.firewall_cmds += "# OSTAVI (ALLOW)\n"
for p in used_ports:
self.firewall_cmds += f"ufw allow {p}\n"
self.firewall_cmds += "\n# ZATVORI (DENY)\n"
for p in free_ports:
self.firewall_cmds += f"ufw deny {p}\n"
else:
self.firewall_cmds += "# OSTAVI (ACCEPT)\n"
for p in used_ports:
self.firewall_cmds += f"iptables -A INPUT -p tcp --dport {p} -j ACCEPT\n"
self.firewall_cmds += "\n# ZATVORI (DROP)\n"
for p in free_ports:
self.firewall_cmds += f"iptables -A INPUT -p tcp --dport {p} -j DROP\n"
# ===== REPORT =====
self.report = f"""
IPTV SECURITY INSPECTOR – FINAL REPORT
=====================================
[PANEL]
- {panel}
[STREAM]
- URL‑ova: {len(self.urls)}
- IP adresa: {len(ips)}
- LIVE: {live}
- VOD: {vod}
- SERIES: {series}
[PORTOVI U UPOTREBI]
"""
for p,c in port_count.items():
self.report += f"- Port {p}: {c} streamova\n"
self.report += "\n[SLOBODNI PORTOVI – ZATVORI]\n"
for p in free_ports:
self.report += f"- Port {p}\n"
self.report += f"""
[RISK SCORE]
- {score}
[PREPORUKE]
- Jedan stream port
- HTTPS umesto HTTP
- Sakriti get.php
- Rate‑limit po IP
"""
self.text.delete("1.0", tk.END)
self.text.insert(tk.END, self.report)
self.text.insert(tk.END, "\n[FIREWALL KOMANDE]\n", "yellow")
self.text.insert(tk.END, self.firewall_cmds, "red")
def copy_firewall(self):
if not self.firewall_cmds:
return
self.root.clipboard_clear()
self.root.clipboard_append(self.firewall_cmds)
messagebox.showinfo("OK", "Firewall komande kopirane")
def export_txt(self):
with open("security_report.txt","w") as f:
f.write(self.report + "\n\n" + self.firewall_cmds)
messagebox.showinfo("OK","TXT snimljen")
def export_html(self):
html = f"<html><body style='background:#111;color:#0f0'><pre>{self.report}\n\n{self.firewall_cmds}</pre></body></html>"
with open("security_report.html","w") as f:
f.write(html)
messagebox.showinfo("OK","HTML snimljen")
def clear_all(self):
self.urls.clear()
self.text.delete("1.0", tk.END)
# ===== TAG COLORS =====
root = tk.Tk()
root.tk.call("tk", "scaling", 1.2)
app = IPTVInspector(root)
app.text.tag_config("green", foreground="lime")
app.text.tag_config("yellow", foreground="yellow")
app.text.tag_config("red", foreground="red")
root.mainloop()
mozeПрегледај го приврзокот 465349
javi se ko hoce skener novi
Автоматски споено мислење:
import tkinter as tk
from tkinter import filedialog, messagebox
from urllib.parse import urlparse
import re
from collections import Counter
COMMON_PORTS = [
80, 443, 8000, 8080, 8081, 8443,
25461, 25500, 2095, 2096, 8880, 9000
]
class IPTVInspector:
def __init__(self, root):
self.root = root
root.title("IPTV Security Inspector PRO")
root.geometry("1000x700")
# ===== TOP =====
top = tk.Frame(root)
top.pack(fill="x", pady=5)
tk.Label(top, text="Ručno ubaci URL:").pack(side="left")
self.url_entry = tk.Entry(top, width=60)
self.url_entry.pack(side="left", padx=5)
tk.Button(top, text="Dodaj URL", command=self.add_url).pack(side="left")
tk.Label(top, text="OS Firewall:").pack(side="left", padx=10)
self.os_var = tk.StringVar(value="ufw")
tk.OptionMenu(top, self.os_var, "ufw", "iptables").pack(side="left")
# ===== BUTTONS =====
btns = tk.Frame(root)
btns.pack(fill="x", pady=5)
tk.Button(btns, text="Učitaj M3U", command=self.load_m3u).pack(side="left")
tk.Button(btns, text="Analiziraj", command=self.analyze).pack(side="left")
tk.Button(btns, text="Kopiraj Firewall", command=self.copy_firewall).pack(side="left")
tk.Button(btns, text="Export TXT", command=self.export_txt).pack(side="left")
tk.Button(btns, text="Export HTML", command=self.export_html).pack(side="left")
tk.Button(btns, text="Obriši sve", command=self.clear_all).pack(side="left")
# ===== TEXT =====
self.text = tk.Text(root, bg="black", fg="white", font=("Consolas", 10))
self.text.pack(fill="both", expand=True)
self.urls = []
self.report = ""
self.firewall_cmds = ""
# ===== ACTIONS =====
def add_url(self):
url = self.url_entry.get().strip()
if not url.startswith("http"):
messagebox.showerror("Greška", "URL mora početi sa http:// ili https://")
return
self.urls.append(url)
self.url_entry.delete(0, tk.END)
self.text.insert(tk.END, f"[DODAT URL] {url}\n", "green")
def load_m3u(self):
path = filedialog.askopenfilename(filetypes=[("M3U files","*.m3u")])
if not path:
return
with open(path, "r", errors="ignore") as f:
data = f.read()
found = re.findall(r'http?://[^\s]+', data)
self.urls.extend(found)
messagebox.showinfo("OK", f"Učitano {len(found)} URL‑ova")
def analyze(self):
if not self.urls:
messagebox.showwarning("Prazno", "Nema URL‑ova")
return
ips = set()
ports = []
live = vod = series = 0
risks = 0
panel = "Custom"
for u in self.urls:
p = urlparse(u)
ips.add(p.hostname)
ports.append(p.port or 80)
if "/live/" in u: live += 1
elif "/movie/" in u: vod += 1
elif "/series/" in u: series += 1
if "get.php" in u:
panel = "Xtream Codes / Xtream UI"
risks += 1
if "username=" in u and "password=" in u:
risks += 1
port_count = Counter(ports)
used_ports = set(port_count.keys())
free_ports = [p for p in COMMON_PORTS if p not in used_ports]
if len(ips) > 1: risks += 1
if len(port_count) > 1: risks += 1
if 80 in used_ports: risks += 1
if any(p in [25461,25500] for p in used_ports): risks += 1
score = "LOW" if risks <= 2 else "MEDIUM" if risks <= 5 else "HIGH"
# ===== FIREWALL COMMANDS =====
self.firewall_cmds = ""
osfw = self.os_var.get()
if osfw == "ufw":
self.firewall_cmds += "# OSTAVI (ALLOW)\n"
for p in used_ports:
self.firewall_cmds += f"ufw allow {p}\n"
self.firewall_cmds += "\n# ZATVORI (DENY)\n"
for p in free_ports:
self.firewall_cmds += f"ufw deny {p}\n"
else:
self.firewall_cmds += "# OSTAVI (ACCEPT)\n"
for p in used_ports:
self.firewall_cmds += f"iptables -A INPUT -p tcp --dport {p} -j ACCEPT\n"
self.firewall_cmds += "\n# ZATVORI (DROP)\n"
for p in free_ports:
self.firewall_cmds += f"iptables -A INPUT -p tcp --dport {p} -j DROP\n"
# ===== REPORT =====
self.report = f"""
IPTV SECURITY INSPECTOR – FINAL REPORT
=====================================
[PANEL]
- {panel}
[STREAM]
- URL‑ova: {len(self.urls)}
- IP adresa: {len(ips)}
- LIVE: {live}
- VOD: {vod}
- SERIES: {series}
[PORTOVI U UPOTREBI]
"""
for p,c in port_count.items():
self.report += f"- Port {p}: {c} streamova\n"
self.report += "\n[SLOBODNI PORTOVI – ZATVORI]\n"
for p in free_ports:
self.report += f"- Port {p}\n"
self.report += f"""
[RISK SCORE]
- {score}
[PREPORUKE]
- Jedan stream port
- HTTPS umesto HTTP
- Sakriti get.php
- Rate‑limit po IP
"""
self.text.delete("1.0", tk.END)
self.text.insert(tk.END, self.report)
self.text.insert(tk.END, "\n[FIREWALL KOMANDE]\n", "yellow")
self.text.insert(tk.END, self.firewall_cmds, "red")
def copy_firewall(self):
if not self.firewall_cmds:
return
self.root.clipboard_clear()
self.root.clipboard_append(self.firewall_cmds)
messagebox.showinfo("OK", "Firewall komande kopirane")
def export_txt(self):
with open("security_report.txt","w") as f:
f.write(self.report + "\n\n" + self.firewall_cmds)
messagebox.showinfo("OK","TXT snimljen")
def export_html(self):
html = f"<html><body style='background:#111;color:#0f0'><pre>{self.report}\n\n{self.firewall_cmds}</pre></body></html>"
with open("security_report.html","w") as f:
f.write(html)
messagebox.showinfo("OK","HTML snimljen")
def clear_all(self):
self.urls.clear()
self.text.delete("1.0", tk.END)
# ===== TAG COLORS =====
root = tk.Tk()
root.tk.call("tk", "scaling", 1.2)
app = IPTVInspector(root)
app.text.tag_config("green", foreground="lime")
app.text.tag_config("yellow", foreground="yellow")
app.text.tag_config("red", foreground="red")
root.mainloop()
Автоматски споено мислење:
Код:import tkinter as tk from tkinter import filedialog, messagebox from urllib.parse import urlparse import re from collections import Counter COMMON_PORTS = [ 80, 443, 8000, 8080, 8081, 8443, 25461, 25500, 2095, 2096, 8880, 9000 ] class IPTVInspector: def __init__(self, root): self.root = root root.title("IPTV Security Inspector PRO") root.geometry("1000x700") # ===== TOP ===== top = tk.Frame(root) top.pack(fill="x", pady=5) tk.Label(top, text="Ručno ubaci URL:").pack(side="left") self.url_entry = tk.Entry(top, width=60) self.url_entry.pack(side="left", padx=5) tk.Button(top, text="Dodaj URL", command=self.add_url).pack(side="left") tk.Label(top, text="OS Firewall:").pack(side="left", padx=10) self.os_var = tk.StringVar(value="ufw") tk.OptionMenu(top, self.os_var, "ufw", "iptables").pack(side="left") # ===== BUTTONS ===== btns = tk.Frame(root) btns.pack(fill="x", pady=5) tk.Button(btns, text="Učitaj M3U", command=self.load_m3u).pack(side="left") tk.Button(btns, text="Analiziraj", command=self.analyze).pack(side="left") tk.Button(btns, text="Kopiraj Firewall", command=self.copy_firewall).pack(side="left") tk.Button(btns, text="Export TXT", command=self.export_txt).pack(side="left") tk.Button(btns, text="Export HTML", command=self.export_html).pack(side="left") tk.Button(btns, text="Obriši sve", command=self.clear_all).pack(side="left") # ===== TEXT ===== self.text = tk.Text(root, bg="black", fg="white", font=("Consolas", 10)) self.text.pack(fill="both", expand=True) self.urls = [] self.report = "" self.firewall_cmds = "" # ===== ACTIONS ===== def add_url(self): url = self.url_entry.get().strip() if not url.startswith("http"): messagebox.showerror("Greška", "URL mora početi sa http:// ili https://") return self.urls.append(url) self.url_entry.delete(0, tk.END) self.text.insert(tk.END, f"[DODAT URL] {url}\n", "green") def load_m3u(self): path = filedialog.askopenfilename(filetypes=[("M3U files","*.m3u")]) if not path: return with open(path, "r", errors="ignore") as f: data = f.read() found = re.findall(r'http[s]?://[^\s]+', data) self.urls.extend(found) messagebox.showinfo("OK", f"Učitano {len(found)} URL‑ova") def analyze(self): if not self.urls: messagebox.showwarning("Prazno", "Nema URL‑ova") return ips = set() ports = [] live = vod = series = 0 risks = 0 panel = "Custom" for u in self.urls: p = urlparse(u) ips.add(p.hostname) ports.append(p.port or 80) if "/live/" in u: live += 1 elif "/movie/" in u: vod += 1 elif "/series/" in u: series += 1 if "get.php" in u: panel = "Xtream Codes / Xtream UI" risks += 1 if "username=" in u and "password=" in u: risks += 1 port_count = Counter(ports) used_ports = set(port_count.keys()) free_ports = [p for p in COMMON_PORTS if p not in used_ports] if len(ips) > 1: risks += 1 if len(port_count) > 1: risks += 1 if 80 in used_ports: risks += 1 if any(p in [25461,25500] for p in used_ports): risks += 1 score = "LOW" if risks <= 2 else "MEDIUM" if risks <= 5 else "HIGH" # ===== FIREWALL COMMANDS ===== self.firewall_cmds = "" osfw = self.os_var.get() if osfw == "ufw": self.firewall_cmds += "# OSTAVI (ALLOW)\n" for p in used_ports: self.firewall_cmds += f"ufw allow {p}\n" self.firewall_cmds += "\n# ZATVORI (DENY)\n" for p in free_ports: self.firewall_cmds += f"ufw deny {p}\n" else: self.firewall_cmds += "# OSTAVI (ACCEPT)\n" for p in used_ports: self.firewall_cmds += f"iptables -A INPUT -p tcp --dport {p} -j ACCEPT\n" self.firewall_cmds += "\n# ZATVORI (DROP)\n" for p in free_ports: self.firewall_cmds += f"iptables -A INPUT -p tcp --dport {p} -j DROP\n" # ===== REPORT ===== self.report = f""" IPTV SECURITY INSPECTOR – FINAL REPORT ===================================== [PANEL] - {panel} [STREAM] - URL‑ova: {len(self.urls)} - IP adresa: {len(ips)} - LIVE: {live} - VOD: {vod} - SERIES: {series} [PORTOVI U UPOTREBI] """ for p,c in port_count.items(): self.report += f"- Port {p}: {c} streamova\n" self.report += "\n[SLOBODNI PORTOVI – ZATVORI]\n" for p in free_ports: self.report += f"- Port {p}\n" self.report += f""" [RISK SCORE] - {score} [PREPORUKE] - Jedan stream port - HTTPS umesto HTTP - Sakriti get.php - Rate‑limit po IP """ self.text.delete("1.0", tk.END) self.text.insert(tk.END, self.report) self.text.insert(tk.END, "\n[FIREWALL KOMANDE]\n", "yellow") self.text.insert(tk.END, self.firewall_cmds, "red") def copy_firewall(self): if not self.firewall_cmds: return self.root.clipboard_clear() self.root.clipboard_append(self.firewall_cmds) messagebox.showinfo("OK", "Firewall komande kopirane") def export_txt(self): with open("security_report.txt","w") as f: f.write(self.report + "\n\n" + self.firewall_cmds) messagebox.showinfo("OK","TXT snimljen") def export_html(self): html = f"<html><body style='background:#111;color:#0f0'><pre>{self.report}\n\n{self.firewall_cmds}</pre></body></html>" with open("security_report.html","w") as f: f.write(html) messagebox.showinfo("OK","HTML snimljen") def clear_all(self): self.urls.clear() self.text.delete("1.0", tk.END) # ===== TAG COLORS ===== root = tk.Tk() root.tk.call("tk", "scaling", 1.2) app = IPTVInspector(root) app.text.tag_config("green", foreground="lime") app.text.tag_config("yellow", foreground="yellow") app.text.tag_config("red", foreground="red") root.mainloop()
Može drug.Прегледај го приврзокот 465349
javi se ko hoce skener novi
Автоматски споено мислење:
import tkinter as tk
from tkinter import filedialog, messagebox
from urllib.parse import urlparse
import re
from collections import Counter
COMMON_PORTS = [
80, 443, 8000, 8080, 8081, 8443,
25461, 25500, 2095, 2096, 8880, 9000
]
class IPTVInspector:
def __init__(self, root):
self.root = root
root.title("IPTV Security Inspector PRO")
root.geometry("1000x700")
# ===== TOP =====
top = tk.Frame(root)
top.pack(fill="x", pady=5)
tk.Label(top, text="Ručno ubaci URL:").pack(side="left")
self.url_entry = tk.Entry(top, width=60)
self.url_entry.pack(side="left", padx=5)
tk.Button(top, text="Dodaj URL", command=self.add_url).pack(side="left")
tk.Label(top, text="OS Firewall:").pack(side="left", padx=10)
self.os_var = tk.StringVar(value="ufw")
tk.OptionMenu(top, self.os_var, "ufw", "iptables").pack(side="left")
# ===== BUTTONS =====
btns = tk.Frame(root)
btns.pack(fill="x", pady=5)
tk.Button(btns, text="Učitaj M3U", command=self.load_m3u).pack(side="left")
tk.Button(btns, text="Analiziraj", command=self.analyze).pack(side="left")
tk.Button(btns, text="Kopiraj Firewall", command=self.copy_firewall).pack(side="left")
tk.Button(btns, text="Export TXT", command=self.export_txt).pack(side="left")
tk.Button(btns, text="Export HTML", command=self.export_html).pack(side="left")
tk.Button(btns, text="Obriši sve", command=self.clear_all).pack(side="left")
# ===== TEXT =====
self.text = tk.Text(root, bg="black", fg="white", font=("Consolas", 10))
self.text.pack(fill="both", expand=True)
self.urls = []
self.report = ""
self.firewall_cmds = ""
# ===== ACTIONS =====
def add_url(self):
url = self.url_entry.get().strip()
if not url.startswith("http"):
messagebox.showerror("Greška", "URL mora početi sa http:// ili https://")
return
self.urls.append(url)
self.url_entry.delete(0, tk.END)
self.text.insert(tk.END, f"[DODAT URL] {url}\n", "green")
def load_m3u(self):
path = filedialog.askopenfilename(filetypes=[("M3U files","*.m3u")])
if not path:
return
with open(path, "r", errors="ignore") as f:
data = f.read()
found = re.findall(r'http?://[^\s]+', data)
self.urls.extend(found)
messagebox.showinfo("OK", f"Učitano {len(found)} URL‑ova")
def analyze(self):
if not self.urls:
messagebox.showwarning("Prazno", "Nema URL‑ova")
return
ips = set()
ports = []
live = vod = series = 0
risks = 0
panel = "Custom"
for u in self.urls:
p = urlparse(u)
ips.add(p.hostname)
ports.append(p.port or 80)
if "/live/" in u: live += 1
elif "/movie/" in u: vod += 1
elif "/series/" in u: series += 1
if "get.php" in u:
panel = "Xtream Codes / Xtream UI"
risks += 1
if "username=" in u and "password=" in u:
risks += 1
port_count = Counter(ports)
used_ports = set(port_count.keys())
free_ports = [p for p in COMMON_PORTS if p not in used_ports]
if len(ips) > 1: risks += 1
if len(port_count) > 1: risks += 1
if 80 in used_ports: risks += 1
if any(p in [25461,25500] for p in used_ports): risks += 1
score = "LOW" if risks <= 2 else "MEDIUM" if risks <= 5 else "HIGH"
# ===== FIREWALL COMMANDS =====
self.firewall_cmds = ""
osfw = self.os_var.get()
if osfw == "ufw":
self.firewall_cmds += "# OSTAVI (ALLOW)\n"
for p in used_ports:
self.firewall_cmds += f"ufw allow {p}\n"
self.firewall_cmds += "\n# ZATVORI (DENY)\n"
for p in free_ports:
self.firewall_cmds += f"ufw deny {p}\n"
else:
self.firewall_cmds += "# OSTAVI (ACCEPT)\n"
for p in used_ports:
self.firewall_cmds += f"iptables -A INPUT -p tcp --dport {p} -j ACCEPT\n"
self.firewall_cmds += "\n# ZATVORI (DROP)\n"
for p in free_ports:
self.firewall_cmds += f"iptables -A INPUT -p tcp --dport {p} -j DROP\n"
# ===== REPORT =====
self.report = f"""
IPTV SECURITY INSPECTOR – FINAL REPORT
=====================================
[PANEL]
- {panel}
[STREAM]
- URL‑ova: {len(self.urls)}
- IP adresa: {len(ips)}
- LIVE: {live}
- VOD: {vod}
- SERIES: {series}
[PORTOVI U UPOTREBI]
"""
for p,c in port_count.items():
self.report += f"- Port {p}: {c} streamova\n"
self.report += "\n[SLOBODNI PORTOVI – ZATVORI]\n"
for p in free_ports:
self.report += f"- Port {p}\n"
self.report += f"""
[RISK SCORE]
- {score}
[PREPORUKE]
- Jedan stream port
- HTTPS umesto HTTP
- Sakriti get.php
- Rate‑limit po IP
"""
self.text.delete("1.0", tk.END)
self.text.insert(tk.END, self.report)
self.text.insert(tk.END, "\n[FIREWALL KOMANDE]\n", "yellow")
self.text.insert(tk.END, self.firewall_cmds, "red")
def copy_firewall(self):
if not self.firewall_cmds:
return
self.root.clipboard_clear()
self.root.clipboard_append(self.firewall_cmds)
messagebox.showinfo("OK", "Firewall komande kopirane")
def export_txt(self):
with open("security_report.txt","w") as f:
f.write(self.report + "\n\n" + self.firewall_cmds)
messagebox.showinfo("OK","TXT snimljen")
def export_html(self):
html = f"<html><body style='background:#111;color:#0f0'><pre>{self.report}\n\n{self.firewall_cmds}</pre></body></html>"
with open("security_report.html","w") as f:
f.write(html)
messagebox.showinfo("OK","HTML snimljen")
def clear_all(self):
self.urls.clear()
self.text.delete("1.0", tk.END)
# ===== TAG COLORS =====
root = tk.Tk()
root.tk.call("tk", "scaling", 1.2)
app = IPTVInspector(root)
app.text.tag_config("green", foreground="lime")
app.text.tag_config("yellow", foreground="yellow")
app.text.tag_config("red", foreground="red")
root.mainloop()
Автоматски споено мислење:
Код:import tkinter as tk from tkinter import filedialog, messagebox from urllib.parse import urlparse import re from collections import Counter COMMON_PORTS = [ 80, 443, 8000, 8080, 8081, 8443, 25461, 25500, 2095, 2096, 8880, 9000 ] class IPTVInspector: def __init__(self, root): self.root = root root.title("IPTV Security Inspector PRO") root.geometry("1000x700") # ===== TOP ===== top = tk.Frame(root) top.pack(fill="x", pady=5) tk.Label(top, text="Ručno ubaci URL:").pack(side="left") self.url_entry = tk.Entry(top, width=60) self.url_entry.pack(side="left", padx=5) tk.Button(top, text="Dodaj URL", command=self.add_url).pack(side="left") tk.Label(top, text="OS Firewall:").pack(side="left", padx=10) self.os_var = tk.StringVar(value="ufw") tk.OptionMenu(top, self.os_var, "ufw", "iptables").pack(side="left") # ===== BUTTONS ===== btns = tk.Frame(root) btns.pack(fill="x", pady=5) tk.Button(btns, text="Učitaj M3U", command=self.load_m3u).pack(side="left") tk.Button(btns, text="Analiziraj", command=self.analyze).pack(side="left") tk.Button(btns, text="Kopiraj Firewall", command=self.copy_firewall).pack(side="left") tk.Button(btns, text="Export TXT", command=self.export_txt).pack(side="left") tk.Button(btns, text="Export HTML", command=self.export_html).pack(side="left") tk.Button(btns, text="Obriši sve", command=self.clear_all).pack(side="left") # ===== TEXT ===== self.text = tk.Text(root, bg="black", fg="white", font=("Consolas", 10)) self.text.pack(fill="both", expand=True) self.urls = [] self.report = "" self.firewall_cmds = "" # ===== ACTIONS ===== def add_url(self): url = self.url_entry.get().strip() if not url.startswith("http"): messagebox.showerror("Greška", "URL mora početi sa http:// ili https://") return self.urls.append(url) self.url_entry.delete(0, tk.END) self.text.insert(tk.END, f"[DODAT URL] {url}\n", "green") def load_m3u(self): path = filedialog.askopenfilename(filetypes=[("M3U files","*.m3u")]) if not path: return with open(path, "r", errors="ignore") as f: data = f.read() found = re.findall(r'http[s]?://[^\s]+', data) self.urls.extend(found) messagebox.showinfo("OK", f"Učitano {len(found)} URL‑ova") def analyze(self): if not self.urls: messagebox.showwarning("Prazno", "Nema URL‑ova") return ips = set() ports = [] live = vod = series = 0 risks = 0 panel = "Custom" for u in self.urls: p = urlparse(u) ips.add(p.hostname) ports.append(p.port or 80) if "/live/" in u: live += 1 elif "/movie/" in u: vod += 1 elif "/series/" in u: series += 1 if "get.php" in u: panel = "Xtream Codes / Xtream UI" risks += 1 if "username=" in u and "password=" in u: risks += 1 port_count = Counter(ports) used_ports = set(port_count.keys()) free_ports = [p for p in COMMON_PORTS if p not in used_ports] if len(ips) > 1: risks += 1 if len(port_count) > 1: risks += 1 if 80 in used_ports: risks += 1 if any(p in [25461,25500] for p in used_ports): risks += 1 score = "LOW" if risks <= 2 else "MEDIUM" if risks <= 5 else "HIGH" # ===== FIREWALL COMMANDS ===== self.firewall_cmds = "" osfw = self.os_var.get() if osfw == "ufw": self.firewall_cmds += "# OSTAVI (ALLOW)\n" for p in used_ports: self.firewall_cmds += f"ufw allow {p}\n" self.firewall_cmds += "\n# ZATVORI (DENY)\n" for p in free_ports: self.firewall_cmds += f"ufw deny {p}\n" else: self.firewall_cmds += "# OSTAVI (ACCEPT)\n" for p in used_ports: self.firewall_cmds += f"iptables -A INPUT -p tcp --dport {p} -j ACCEPT\n" self.firewall_cmds += "\n# ZATVORI (DROP)\n" for p in free_ports: self.firewall_cmds += f"iptables -A INPUT -p tcp --dport {p} -j DROP\n" # ===== REPORT ===== self.report = f""" IPTV SECURITY INSPECTOR – FINAL REPORT ===================================== [PANEL] - {panel} [STREAM] - URL‑ova: {len(self.urls)} - IP adresa: {len(ips)} - LIVE: {live} - VOD: {vod} - SERIES: {series} [PORTOVI U UPOTREBI] """ for p,c in port_count.items(): self.report += f"- Port {p}: {c} streamova\n" self.report += "\n[SLOBODNI PORTOVI – ZATVORI]\n" for p in free_ports: self.report += f"- Port {p}\n" self.report += f""" [RISK SCORE] - {score} [PREPORUKE] - Jedan stream port - HTTPS umesto HTTP - Sakriti get.php - Rate‑limit po IP """ self.text.delete("1.0", tk.END) self.text.insert(tk.END, self.report) self.text.insert(tk.END, "\n[FIREWALL KOMANDE]\n", "yellow") self.text.insert(tk.END, self.firewall_cmds, "red") def copy_firewall(self): if not self.firewall_cmds: return self.root.clipboard_clear() self.root.clipboard_append(self.firewall_cmds) messagebox.showinfo("OK", "Firewall komande kopirane") def export_txt(self): with open("security_report.txt","w") as f: f.write(self.report + "\n\n" + self.firewall_cmds) messagebox.showinfo("OK","TXT snimljen") def export_html(self): html = f"<html><body style='background:#111;color:#0f0'><pre>{self.report}\n\n{self.firewall_cmds}</pre></body></html>" with open("security_report.html","w") as f: f.write(html) messagebox.showinfo("OK","HTML snimljen") def clear_all(self): self.urls.clear() self.text.delete("1.0", tk.END) # ===== TAG COLORS ===== root = tk.Tk() root.tk.call("tk", "scaling", 1.2) app = IPTVInspector(root) app.text.tag_config("green", foreground="lime") app.text.tag_config("yellow", foreground="yellow") app.text.tag_config("red", foreground="red") root.mainloop()



