一、挖掘后门文件的潜在联系
def show4():
    G = nx.Graph()
    with open("../data/KnowledgeGraph/sample5.txt") as f:
        for line in f:
            line=line.strip('\n')
            mail,domain,ip=line.split(',')
            G.add_edge(mail, domain)
            G.add_edge(domain, ip)
    f.close()
    nx.draw(G, with_labels=True, node_size=600)
    plt.show()图示如下

二、挖掘域名潜在联系
def show5():
    G = nx.Graph()
    with open("../data/KnowledgeGraph/sample6.txt") as f:
        for line in f:
            line=line.strip('\n')
            file,domain=line.split(',')
            G.add_edge(file, domain)
    f.close()
    nx.draw(G, with_labels=True, node_size=600)
    plt.show()图示结果
 










