终极主机黑名单项目的白名单工具。

ultimate-hosts-blacklist-whitelist的Python项目详细描述


这是终极主机黑名单项目提供的白名单工具。 它主要用于将主题(域、IP、URL)白名单到我们的基础架构中,但也可以在我们的基础架构之外使用。

实际上,此工具允许您:

  • 以摆脱我们的白名单。
  • 使用你自己的白名单。
  • 使用你自己的白名单和我们的白名单。
  • 以摆脱我们白名单中提到的规则之一。
  • 准备一个白名单工具作为python模块使用。

安装

$ pip3 install --user ultimate-hosts-blacklist-whitelist

补充白名单

我们的工具允许我们将一个或多个文件链接到系统,该系统将用于补充我们的白名单。

特殊标记

如果你已经使用了一个白名单,你已经知道我们通常只列出所有的域,我们想一个一个白名单。

我们的白名单系统也可以做到这一点,但我们可以做更多。

ALL

标记ALL将告诉系统重新转义并重新检查以下内容的regex。

无效字符

  • $

    • As we automatically append $ to the end, you should not use this character.
  • \\

    • As we automatically escape the given expression, you should not explicitly escape your regular expression when declaring an ALL marker.

REG

标记REG将告诉系统显式检查标记后面的给定regex。

RZD

RZD标记将告诉系统显式检查给定的字符串和所有可能的tdl。

反白名单

不喜欢我们的规则吗?我们的工具允许您指定一个包含不想应用的规则列表的文件。

只要使用--anti-whitelist标志告诉我们一个或多个反白名单文件,我们就会申请!

了解我们的实际工作

如果我们有以下二级白名单:

facebook.com
ALL .gov
REG face
RZD example

我们的系统实际上会:

  • 删除与facebook.comwww.facebook.com
  • 匹配的每一行
  • 删除与example.*
  • 匹配的所有行
  • 在互补中,将所有ALL ` or :code:`REG的行转换为正确的格式。
  • 再次检查正则表达式的每一行。
  • 在屏幕上打印或保存结果。

生成的正则表达式将在以下示例中:

(\.gov$)|(face)|(example(.*))

注意

当我们基于IANA的根区域数据库和公共后缀列表项目构建TDL列表时,example组要长得多。**

这实际上意味着我们的白名单:

  • .gov结尾的所有元素/行
  • 包含单词face
  • 的所有元素/行
  • example
  • 开头的所有可能的TDL组合

贡献者

工具的使用

sript可以称为uhb-whitelistuhb_whitelistultimate-hosts-blacklist-whitelist

usage: uhb_whitelist [-h] [-a ANTI_WHITELIST [ANTI_WHITELIST ...]] [-d]
                    [-f FILE] [-o OUTPUT] [-m] [-p PROCESSES] [-v]
                    [-w WHITELIST [WHITELIST ...]] [-wc]

The tool to clean a list or a hosts file with the Ultimate Hosts Blacklist
whitelist list or your own.

optional arguments:
    -h, --help            show this help message and exit
    -a ANTI_WHITELIST [ANTI_WHITELIST ...], --anti-whitelist ANTI_WHITELIST [ANTI_WHITELIST ...]
                            Read the given file and remove the rules (its data)
                            from the whitelist list we are going to use.
    -d, --debug           Activate the debug mode. This mode will write the
                            whole processes to stdout.
    -f FILE, --file FILE  Read the given file and remove all element to
                            whitelist.
    -o OUTPUT, --output OUTPUT
                            Save the result to the given filename or path.
    -m, --multiprocessing
                            Activate the usage of multiple processes.
    -p PROCESSES, --processes PROCESSES
                            The number of (maximal) processes to use.
    -v, --version         Show the version end exist.
    -w WHITELIST [WHITELIST ...], --whitelist WHITELIST [WHITELIST ...]
                            Read the given file and append its data to the our
                            whitelist list.
    -wc, --without-core   Disable the usage of the Ultimate Hosts Blacklist
                            whitelist list.

Crafted with ♥ by Nissar Chababy (Funilrys)

许可证

MIT License

Copyright (c) 2018, 2019 Ultimate-Hosts-Blacklist
Copyright (c) 2018, 2019 Nissar Chababy
Copyright (c) 2019 Mitchell Krog

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

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

推荐PyPI第三方库


热门话题
安卓如何在java字符串中获取RATE的值   java ANT在哪里输出编译器错误?   在java中,while循环在何处启动对象   javacom。谷歌。格森。内部的LinkedTreeMap无法强制转换到我的类   java单选按钮。isSelected()方法未返回正确的响应   嵌入式系统中applet中的java相对码基字段   如何在eclipse中将Java应用程序附加到jvm探查器?   java为什么Android应用程序崩溃?   在java中拖放上传后保持文件夹结构   爪哇多领导人选举问题   java Springs RestTemplate如何处理postForEntity()中的错误响应   Java如何用前导零递增整数字符串?   java Android将文本作为图像共享给其他应用程序   Java搜索替换   java isDirectory()不适用于UNIX目录   java我们可以得到显示测试类是否通过或失败的TestNG报告吗   Java类对象排序和分组   简单Java幂递归   java在处理MethodArgumentNotValidException时如何访问请求对象?