HOSTS file

For discussions about security.
Message
Author
User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#31 Post by mikeb »

We are dealing with an impure internet and software world...this will affect the tactics used.

mike

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#32 Post by musher0 »

mikeb wrote:We are dealing with an impure internet and software world...this will affect the tactics used.

mike
Quite true, General. ;)
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

labbe5
Posts: 2159
Joined: Wed 13 Nov 2013, 14:26
Location: Canada

Block lists to prevent JavaScript miners

#33 Post by labbe5 »

https://github.com/hoshsadiq/adblock-nocoin-list

This is an adblock list to block "browser-based crypto mining".

For the blocking based on the HOSTS file use the below link:
https://raw.githubusercontent.com/hoshs ... /hosts.txt

Ctrl+S to save.

labbe5
Posts: 2159
Joined: Wed 13 Nov 2013, 14:26
Location: Canada

hblock

#34 Post by labbe5 »

https://github.com/hectorm/hblock

This POSIX-compliant shell script, designed for Unix-like systems, gets a list of domains that serve ads, tracking scripts and malware from multiple sources and creates a hosts file (alternative formats are also supported) that prevents your system from connecting to them.

Installation

curl -o /tmp/hblock 'https://raw.githubusercontent.com/hecto ... 1.3/hblock' \
&& echo '5aa752ceee6f4d10bdeab372ca557aefc3c7f32e4e10cceb4dddb3a86f6db4d3 /tmp/hblock' | shasum -c \
&& sudo mv /tmp/hblock /usr/local/bin/hblock \
&& sudo chown root:root /usr/local/bin/hblock \
&& sudo chmod 755 /usr/local/bin/hblock

Usage

In your terminal : hblock

Result :

116888 blocked domains.

Optional :

You can use this Systemd timer to regularly update the hosts file for new additions :
https://github.com/hectorm/hblock/blob/ ... /README.md

The following commands will schedule a daily update of the hosts file :

curl -o '/tmp/hblock.#1' 'https://raw.githubusercontent.com/hecto ... vice,timer}' \
&& echo '70964235a03152d4bc68096a0b99cc59e3f77595b99330f8c55dcca79d7164ff /tmp/hblock.service' | shasum -c \
&& echo '79ecc28c13b2489400bd5ddc0ee61ddaf6c3225acb1d54b5cb4026f822ae60e8 /tmp/hblock.timer' | shasum -c \
&& sudo mv /tmp/hblock.{service,timer} /etc/systemd/system/ \
&& sudo chown root:root /etc/systemd/system/hblock.{service,timer} \
&& sudo chmod 644 /etc/systemd/system/hblock.{service,timer} \
&& sudo systemctl daemon-reload \
&& sudo systemctl enable hblock.timer \
&& sudo systemctl start hblock.timer

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#35 Post by musher0 »

Yoo-hoo! Labbe5!

You again forgot that Puppy runs as root, so it does not need the sudo command
before another command.

As to systemctl... we don't have it.

Code: Select all

[~]>systemctl
bash: systemctl: command not found
BFN.
Last edited by musher0 on Mon 30 Dec 2019, 04:42, edited 1 time in total.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#36 Post by s243a »

musher0 wrote:Yoo-hoo! Labbe5!

You again forgot that Puppy runs as root, so it does not need the sudo command
before another command.

As to systemctl... we con't have it.

Code: Select all

[~]>systemctl
bash: systemctl: command not found
BFN.
If all also fails kill the daemon and then restart it!

BTW, there is a completely unrelated command called sysctl. I always get this one mixed up with systemctl.
Find me on [url=https://www.minds.com/ns_tidder]minds[/url] and on [url=https://www.pearltrees.com/s243a/puppy-linux/id12399810]pearltrees[/url].

Post Reply