tlp是一个python库,它使用自然语言处理模块来解析文本体以获得上下文。

tlp的Python项目详细描述


#威胁语言分析器

tlp是一个python库,它解析文本体以获得折衷指标(ioc),利用令人惊叹的[textblob](http://textblob.readthedocs.org/en/dev/)和[nltk](http://www.nltk.org/)自然语言处理模块来派生这些ioc周围的上下文和颜色。tlp的目标是让安全分析人员和研究人员能够从他们每天遇到的无尽信息流中提取和存储有意义的数据,而无需无休止的ctrl+c、ctrl+v工作流。

为了解决这个问题,tlp使用正则表达式、词性标记、列表过滤器和简单的统计分析的组合来从独创风格的散文中提取以下数据:

  • 文档摘要
  • 折衷指标,以及相关统计数据
  • 关键字和短语,以及相关的统计信息
  • 分析器调试信息

##安装

TLP可以在PYPI上找到,并与以下组件一起安装:

$ pip install tlp

您还可以克隆此回购,并运行:

$ python setup.py install

##依赖关系

TLP需要以下模块才能工作:

###文本块 默认情况下将安装textblob。如果需要手动安装,请运行:

$ pip install -U textblob

请注意:无论是自动安装还是手动安装textblob,都需要通过运行以下命令下载并安装其余的nltk语料库:

$ python -m textblob.download_corpora

###纽比 注意,大多数numpy安装都需要编译,因此您可能需要运行以下命令将其作为独立安装:

$ pip install -U numpy

###Python 此依赖项应由setuptools自动安装,但如果失败:

$ pip install -U python-Levenshtein

##用法

>>> from tlp import TLP
>>> ...
>>> threat_text = get_threat_data_from_something()
>>> tlp = TLP(threat_text)
>>>
>>> # get summary
>>> tlp.summary
u"This report outlines a terrible scourge upon our internets: miscreants. We have
discovered that miscreants are systematically taking over the series of tubes, and
and are attempting to leverage them to proliferate their love of 'My Little Pony.'
Let's explore how we punched them repeatedly with our data."
>>>
>>> # get keywords, occurance counts
>>> tlp.keywords
[
    (u'miscreant', 97),
    (u'punch', 39),
    (u'whiskey', 18)
]
>>>
>>> # get iocs, sorted by type
>>> tlp.iocs
{
    'cve': set([u'cve-2011-0611',
                u'cve-2013-1347',
                u'cve-2013-2465']),
    'domain': set([u'miscreantsmustsuffer.com',
                   u'ministryofpromise.co.uk']),
    'ip': set([u'8.8.4.4',
               u'127.0.0.1']),
    'md5': set([u'6fc67ebcb6423efa06198cd123ffc3ee']),
    'sha1': set([]),
    'sha256': set([])
}
>>>
>>> # get tlp color (if present)
>>> tlp.color
set([u'white'])
>>>
>>> # get debug info, including total word count, and word frequency mean/stddev
>>> tlp.debug
{
    'keywords': {
        'std': 2.5559937998299809,
        'total': 1012,
        'mean': 2.0321285140562249
    },
    'iocs': {
        'ip': 2,
        'domain': 2,
        'md5': 1
        'sha1': 0,
        'sha256': 0,
        'cve': 3
    }
}
>>>
>>> # get complete filtered text used for data distillation
>>> tlp.text
u"This report outlines a terrible scourge upon our internets: miscreants. We have
discovered that miscreants are systematically taking over the series of tubes, and
and are attempting to leverage them to proliferate their love of 'My Little Pony.'
Let's explore how we punched them repeatedly with our data.
...

“In conclusion – bottom’s up!”

##待办事项

  • 通过更稳健的统计方法和更好的上下文语言处理提高关键字准确性
  • 修改IOC筛选器引擎以允许更模块化的筛选器管理
  • 允许在对象创建< /LI>中解析和过滤更多的灵活性
  • 增加/改进正则表达式和筛选器集
  • 在关键字权重中包括使用“title”初始参数

##贡献 这在很大程度上是一个alpha,所以我们希望有些人能很快发现效率低下或解决问题的更好方法。欢迎所有拉取请求。:)

如果您是威胁情报发布者,希望被添加到TLP白名单中,请[联系](mailto:github@ministryofpromise.co.uk)我们。

##许可证 麻省理工学院许可证(MIT)

版权所有(c)2015{承诺部}

兹免费准许任何人取得副本 本软件和相关文档文件(“软件”)的 在软件中不受限制,包括但不限于 使用、复制、修改、合并、发布、分发、再授权和/或出售 软件的副本,并允许软件的用户 在满足以下条件的情况下,可以这样做:

上述版权公告及本许可公告须包括在 软件的拷贝或大部分。

本软件按“原样”提供,无任何形式的保证,明示或 默示的,包括但不限于适销性保证, 适合特定目的和不侵权。在任何情况下 作者或版权所有者应对任何索赔、损害或其他 责任,无论是在合同诉讼、侵权诉讼或其他诉讼中, 不属于或与本软件有关,或使用或与本软件的其他交易有关。 软件。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
如何使用java向dropup html/css添加项目   如何从java中的向量向量打印   Java Maven库项目模板   java使用atmosphere api还是直接使用grizzly?   java JComponent仅部分显示   如何将动态值传递给自定义注释,以从Java数据进行映射。性质   java破解已实现方法的返回类型的最佳方法?   java Netbeans在JFrame Gui布局中覆盖图像   spring java仅向登录用户显示注销按钮   java如何对com进行身份验证。谷歌。云bigquery。带有服务帐户的BigQuery`   java禁止空字符串参数和抛出RuntimeException以阻止方法继续的利弊   java分析项目中的所有JAR以获取版本和许可证信息   Java,数据库为什么要分配一个新对象,而我们可以直接将它放入数据库