Preparing dictionaries that list resources to block

Preparing a dictionary with a list of resources to block takes two steps. Firstly, one creates a text file with a list of resources. Secondly, one converts this file into an internal format by means of a special utility.

The conversion is carried out with two utilities:
  • url2dic - for URL, SNI CN
  • ip2bin - for IP

Blacklist Checker Utility - checklock.

File format with a list of URLs to block:

Each line contains one URL (with no http:// prefix). For example:

1magehut.com/users.php?act=gallery&gal=81&page=4
3dmx.net

To convert into the internal format

cat my_url_list.txt|url2dic my_url_list.dic

To convert into the internal format with automatic conversion of domains and URL-letters written in the national alphabet in utf-8 encoding:

cat my_url_list.txt|url2norm|url2dic my_url_list.dic

File format with a list of names to block in SSL certificates:

Each line contains one name. For example:

*.facebook.com
www.vasexpertsdpi.com

To convert into the internal format:

cat my_cn_list.txt|url2dic my_cn_list.dic

File format with a list of public SNI (HTTPS domains)

Each line contains one SNI (without http:// prefix), it is allowed to use *, for example:

qiwi.ru
*.qiwi.ru

To convert into internal format

cat my_sni_list.txt|url2dic my_sni_list.bin

File format with the list of blocked IP addresses, CIDR:

As of version 12.4, list-based list creation is supported:

  • IPv4 <space> port_number
  • IPv4
  • IPv6 <space> port_number
  • IPv6
  • CIDR IPv4/IPv6

Each line of the file contains only one entry, example for IPv4:

78.47.115.34 443
95.211.6.93
95.211.4.0/24
SSG allows the client to establish TCP connection and waits for data transfer. According to the data SSG determines the protocol and in case of HTTP/HTTPS/QUIC it waits for the transmission of URL/SNI/CN, for other protocols it blocks data transmission at once. This behavior is due to the fact that one IP address may have many domains and the priority check by URL/SNI/CN.
Since version 13, support for hard blocking (despite URL/SNI/CN name) has been added - set by adding the code word hard to the IP list, example for IPv4:
78.47.115.34 443 hard
95.211.6.93 hard
95.211.4.0/24 hard

To convert into the internal format:

cat my_ip_list.txt|ip2bin my_ip_list.bin
SSG 12.4+ Added the ability to use CIDRs, addresses, and ports for IPv4 and IPv6 blacklists and whitelists.
If CIDR or address is set, all TCP ports are blocked (UDP with the setting udp_block=3)