与crit交互以构建指标白名单系统的库。

critswhitelist的Python项目详细描述


临界点列表

python库,它与crit交互以构建指示器白名单系统。

要求

https://pypi.org/project/tld/ 0.9+
https://github.com/lolnate/critsapi.git
https://github.com/IntegralDefense/urltools

critswhitelist参数

whitelist_tags: Required.
mongo_connection: Required if NOT supplying mongo_uri and mongo_db.
mongo_uri: Required if NOT supplying mongo_connection.
mongo_db: Required if NOT supplying mongo_connection.
urlshortener_tags: Optional.

示例用法

如果在代码的其他地方已经有了critsdbapi对象,那么创建critswhitelist对象将如下所示:

from critswhitelist import CritsWhitelist

mongo_connection = CRITsDBAPI(mongo_uri=mongo_uri, db_name=mongo_db)
mongo_connection.connect()

w = CritsWhitelist(['whitelist:e2w'], mongo_connection=mongo_connection, urlshortener_tags=['urlshortener:e2w'])

如果您还没有critsdbapi对象,critswhitelist类可以为您创建一个对象:

from critswhitelist import CritsWhitelist

w = CritsWhitelist(['whitelist:e2w'], mongo_uri='mongodb://your.crits.server:27017/', mongo_db='crits', urlshortener_tags=['urlshortener:e2w'])

功能性

创建critswhitelist对象时,必须指定"whitelist_tags"属性。这是在crits中搜索不推荐使用的指标以生成白名单时要包含的标记列表。

例如,如果要将域"google.com"列入白名单,crits中必须满足两个条件:

  1. 在crits中,指示器必须设置为deprecated。
  2. 创建critswhitelist对象时,指示器必须具有在"白名单标记"属性中指定的标记之一。上面的示例使用"whitelist:e2w"标记。

当满足这两个条件时,critswhitelist将在其白名单中包含该指标。

指示灯中的值与指示灯中的值

critswhitelist类中可用的大多数公共函数都提供了一个"value_in_indicator"和一个"indicator_in_value"布尔参数。这些参数允许您镜像crits指示符匹配的功能,就像它们是通配符/子字符串值一样。

如果您正在检查"thing"是否为白名单,则这些参数表示:

  • 值在指示符中:如果白名单指示符中存在"thing"字符串,"thing"被视为白名单。

    • 当我们希望白名单中的指标与不太具体的"thing"值匹配时,该值设置为true。例如,想想文件路径。如果我们将路径"c:\ users\administrator\appdata\roaming\microsoft\office\something.tmp"列为白名单,并且其中一个沙盒报告显示了一个已删除的文件,但将路径列为"appdata\roaming\microsoft\office\something.tmp",那么我们可能也希望将此路径列为白名单。
  • 指示符在u值中:如果"thing"中存在白名单指示符,则"thing"被视为白名单。

    • 当我们希望特定程度较低的白名单指标与"thing"值匹配时,此值设置为true。再想想文件路径。我们不能实际地列出每个文件路径组合的白名单,但我们知道某些路径几乎总是良性的,例如任何包含白名单字符串"microsoft\cryptneturlcache"的路径。

默认行为

critswhitelist类中以下公共函数的行为已自定义为我们的事件和事件哨兵的最佳默认行为。

下面列出的大多数函数都会检查给定值是否无效。

  • 示例:如果您检查域名"google.local"是否为白名单,它将返回true,因为".local"不是有效的顶级域。

有一个内置的缓存系统,因此如果您两次检查同一个值,它将更快地返回缓存为白名单还是非白名单。

是否已将MD5列入白名单(MD5)

Checks whitelisted indicators: Hash - MD5
Returns: True/False if the "md5" string is whitelisted or the md5 is invalid

是否已列入白名单(SHA1)

Checks whitelisted indicators: Hash - SHA1
Returns: True/False if the "sha1" string is whitelisted or the sha1 is invalid

SHA256是否被列入白名单(SHA256)

Checks whitelisted indicators: Hash - SHA256
Returns: True/False if the "sha256" string is whitelisted or the sha256 is invalid

SHA512已被列入白名单(SHA512)

Checks whitelisted indicators: Hash - SHA512
Returns: True/False if the "sha512" string is whitelisted or the sha512 is invalid

是否已将ssdeep列入白名单(ssdeep)

Checks whitelisted indicators: Hash - SSDEEP
Returns: True/False if the "ssdeep" string is whitelisted

文件名是否为白名单(名称,值在指示符中=false,指示符在值中=true)

https://pypi.org/project/tld/ 0.9+
https://github.com/lolnate/critsapi.git
https://github.com/IntegralDefense/urltools
0

示例:如果"~wrs"是白名单,则:

  • "~wrs{ab90d-fade840abc-9e9da}"是白名单。
  • "WRS"没有白名单。

文件路径是否白名单(路径,值在指示器中=真,指示器在值中=真)

https://pypi.org/project/tld/ 0.9+
https://github.com/lolnate/critsapi.git
https://github.com/IntegralDefense/urltools
1

示例:如果"appdata/local/microsoft"是白名单,则:

  • "local/microsoft"是白名单(即使这不是有效路径)
  • "c:/users/dude/appdata/local/microsoft/something.tmp"已白名单。
  • "c:/users/dude/appdata/local/malitive.exe"未被列入白名单。

电子邮件主题是否已白名单(主题,值指示=真,值指示=假)

https://pypi.org/project/tld/ 0.9+
https://github.com/lolnate/critsapi.git
https://github.com/IntegralDefense/urltools
2

示例:如果"hi there"是白名单,则:

  • "嗨"已被列入白名单。
  • "你好,朋友"没有白名单。

电子邮件地址是否为白名单(地址,值,指示器=真,指示器=假)

https://pypi.org/project/tld/ 0.9+
https://github.com/lolnate/critsapi.git
https://github.com/IntegralDefense/urltools
3

示例:如果"noreply@microsoft.com">noreply@microsoft.com"被白名单,则:

URL是否白名单(u,value_in_indicator=false,indicator_in_value=false)

https://pypi.org/project/tld/ 0.9+
https://github.com/lolnate/critsapi.git
https://github.com/IntegralDefense/urltools
4

示例:如果"http://www.google.com/" rel="nofollow">http://www.google.com/"被白名单,则:

注意:是否将URL白名单中的函数也调用是否将URL路径白名单中的函数、是否将域白名单中的函数和是否将IP白名单中的函数。

uri路径是否白名单(path,relationships=none,value-in-u indicator=true,indicator-in-u value=true)

https://pypi.org/project/tld/ 0.9+
https://github.com/lolnate/critsapi.git
https://github.com/IntegralDefense/urltools
5

"relationships"是uri路径所关联的值的可选列表。例如,如果您知道要检查的uri路径来自url"http://google.com/index.html",那么其中一个关系可能是"google.com"。在这种情况下,如果uri-domain-name指示符"google.com"是白名单,那么这个uri-path指示符也将是白名单。

示例:如果".css"是白名单,则:

示例:如果"/social/signin/"是白名单,则:

  • "/social"是白名单。

如果在创建critswhitelist对象时指定了"urlshortener_tags"参数,下面是其预期功能的示例:

  • 如果"goo.gl"是用"urlshortener_"标记的不推荐使用的指示器之一,则:
    • 网址"http://goo.gl/ae81b" rel="nofollow">http://goo.gl/ae81b"将不会白名单。但是,
    • 如果"goo.gl"被列为关系之一,那么uri路径"/ae81b"将被白名单。这背后的想法是,url缩短器使用非常短的uri路径,通常在电子邮件或其他文档中作为随机的base64字符串找到这些路径。

是否已白名单(域,值在指示符中=false,指示符在值中=true)

https://pypi.org/project/tld/ 0.9+
https://github.com/lolnate/critsapi.git
https://github.com/IntegralDefense/urltools
6

示例:如果"blog.google.com"是白名单,则:

IP是否白名单(IP,value_in_indicator=false,indicator_in_value=false)

https://pypi.org/project/tld/ 0.9+
https://github.com/lolnate/critsapi.git
https://github.com/IntegralDefense/urltools
7

示例:如果"100.0.0.0/8"是白名单,则:

  • "100.1.8.37"为白名单。

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

推荐PyPI第三方库


热门话题
为Java排序一个好的排序列表   java如何识别最后一行,然后单击Add按钮。。根据人们给出的建议,点击第二行想要点击最后一行任何潜在客户吗   收集器(.stream()。独特的()。collect(Collectors.toList());)在java中从eclipse成功运行并从命令提示符运行?   java致命异常:安卓的后台任务。数据库sqlite。SQLiteException:没有这样的表   java如何创建生成随机特殊字符的方法   java SQL只插入到特定列中   java Hibernate 5.2混合本机和JPA API   在Android应用程序中使用Java获取特定的XML标记文本   java之间的通道差异。addPeer()和channel。joinPeer()   java关闭对serialVersionUID的检查   java如何在不设置Id的情况下处理新的实体对象?   用于afterJob(JobExecution JobExecution)的java Spring批处理将参数从编写器传递到侦听器   java如何通过OSGi声明性服务声明hasa依赖关系?   java Android捕获在警报对话框中启动的OnFocusChange或Recents   Java刽子手游戏(主要关注输出)   java消息在OpenMQ中超时后丢失   Java方法在父级中的占位符用于子级   Java AWT列表框   来自http get请求的java“格式错误的JSON”