0
点赞
收藏
分享

微信扫一扫

《Web安全之机器学习入门》笔记:第十三章 13.7 知识图谱在威胁情报领域的应用

一、挖掘后门文件的潜在联系

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()

图示结果

 

举报

相关推荐

0 条评论