Skip to content

SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.

fix: fix gexf exporting

Amr Awad96f8295cc413
diff --git a/requirements.txt b/requirements.txt
index 2ee36ffa..2cf66527 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -19,4 +19,4 @@ secure
pyOpenSSL>=16.2.0
python-docx>=0.8.10
python-pptx>=0.6.18
-networkx>=2.4
+networkx==2.3
diff --git a/sflib.py b/sflib.py
index 39c96325..c8cff8a1 100644
--- a/sflib.py
+++ b/sflib.py
@@ -198,7 +198,6 @@ class SpiderFoot:
graph = nx.Graph()
nodelist = dict()
- ecounter = 0
ncounter = 0
for pair in mapping:
(dst, src) = pair
@@ -224,8 +223,7 @@ class SpiderFoot:
graph.node[src]['viz'] = {'color': { 'r': col[0], 'g': col[1], 'b': col[2] } }
nodelist[src] = ncounter
- ecounter = ecounter + 1
- graph.addEdge(str(ecounter), str(nodelist[src]), str(nodelist[dst]))
+ graph.add_edge(str(nodelist[src]), str(nodelist[dst]))
gexf = GEXFWriter(graph=graph)
return str(gexf).encode('utf-8')