File size: 680 Bytes
9d8745f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import gradio as gr
import requests
import networkx as nx

def get_cyber_map():
  url = "https://threatmap.checkpoint.com/ThreatPortal/livemap.html"
  response = requests.get(url)
  html = response.text
  return html

def get_cyber_graph():
  G = nx.Graph()
  G.add_nodes_from(["Attacker", "Target", "Malware", "Vulnerability"])
  G.add_edges_from([("Attacker", "Malware"), ("Malware", "Vulnerability"), ("Vulnerability", "Target")])
  return G

map_component = gr.HTML(fn=get_cyber_map, live=True)
graph_component = gr.Network(fn=get_cyber_graph)

iface = gr.Interface(
  fn=None,
  inputs=None,
  outputs=[map_component, graph_component],
  layout="horizontal"
)

iface.launch()