Skip to main content
BlackShield is an experimental project designed to block malicious patterns, including file extensions associated with ransomware, malware, scraping, crawlers, bots, circumvention tools, Proxy, BitTorrent, Tor, and other cyber threats. It prevents the spread of these threats using access control lists and custom rules.
Experimental Status: BlackShield is marked as experimental. Use at your own risk and test thoroughly before deploying in production environments.Result Not Guaranteed: This project contains files that may generate false positives.

Dependencies

Installation

1

Install Python

2

Download project

3

Run BlackShield

4

Install ACL files

Configuration

Squid Rules

Modify /etc/squid/squid.conf and add the following rules:

Samba Rules

Modify /etc/samba/smb.conf and add the list to the veto files directive:
Important:
  • You cannot include more than one list in smb.conf for the veto files directive
  • Use the acl/smb/merge_veto.sh script to merge lists:
    • ransom_veto.txt (updated with blackshield.sh)
    • common_veto.txt (static - add/remove extensions manually)
Performance Impact: This project contains ACLs with non-exclusive strings that can generate false positives. Iptables firewall rules slow down traffic and may not produce desired results.String matching is intensive and unreliable - consider it as a last resort.

Global Variables

Identify your network interface:
Example output:
Set your LAN interface:

Hex String Rule

Block malicious hex strings:
Example NFLOG output (/var/log/ulog/syslogemu.log):

BitTorrent Rule

Block BitTorrent protocol:
Example NFLOG output (/var/log/ulog/syslogemu.log):

Tor Rule

Block Tor connections:
Example NFLOG output (/var/log/ulog/syslogemu.log):

ACL Files Reference

Data Sources

Ransomware Extensions

Malicious User-Agents

Analysis Tools

String Capture Tools

Algorithms Used

Use Cases

  • Ransomware Prevention: Block file extensions commonly used by ransomware
  • Malware Protection: Prevent malicious file downloads via proxy
  • Bot Blocking: Filter out malicious crawlers and bots
  • Circumvention Control: Block proxy and VPN circumvention attempts
  • P2P Blocking: Prevent BitTorrent and similar protocols
  • Tor Blocking: Block Tor network access
  • Samba Protection: Prevent ransomware from encrypting network shares

License

BlackShield is licensed under:
  • GPL-3.0
  • CC BY-SA 4.0

Disclaimer

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.