123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- import networkx as nx
- import matplotlib.pyplot as plt
- def hack_account():
-
-
- with open("data/KnowledgeGraph/sample1.txt") as f:
- G = nx.Graph()
- for line in f:
- line = line.strip('\n')
-
- uid, ip, tel, activesyncid = line.split(',')
- G.add_edge(uid, ip)
- G.add_edge(uid, tel)
- G.add_edge(uid, activesyncid)
- nx.draw(G, with_labels=True, node_size=600)
- plt.show()
- def attack_pass():
-
- with open("data/KnowledgeGraph/sample2.txt") as f:
- G = nx.Graph()
- for line in f:
- line = line.strip('\n')
-
- uid, ip, login, ua = line.split(',')
- G.add_edge(uid, ip)
- G.add_edge(uid, login)
- G.add_edge(uid, ua)
- nx.draw(G, with_labels=True, node_size=600)
- plt.show()
- def click_farming():
-
- G = nx.Graph()
- with open("data/KnowledgeGraph/sample3.txt") as f:
- for line in f:
- line = line.strip('\n')
-
- hid, uid, app = line.split(',')
- G.add_edge(hid, uid)
- G.add_edge(hid, app)
- with open("data/KnowledgeGraph/sample4.txt") as f:
- for line in f:
- line = line.strip('\n')
-
- hid, uid, action = line.split(',')
- G.add_edge(hid, uid)
- G.add_edge(hid, action)
- nx.draw(G, with_labels=True, node_size=600)
- plt.show()
- def main():
- hack_account()
- attack_pass()
- click_farming()
- if __name__ == "__main__":
- main()
|