![]() |
|
OpenBSD Security Functionally paranoid! |
![]() |
|
Thread Tools | Display Modes |
|
||||
![]()
In a thread about mail hosting, I'd written, in part:
Quote:
Code:
#!/bin/sh # # this is normally run once per day via /etc/daily.local. # echo updating Spamhaus DROP lists: TMPDIR=`mktemp -d` || exit 1 ( cd $TMPDIR ftp https://www.spamhaus.org/drop/drop.txt ftp https://www.spamhaus.org/drop/edrop.txt ftp https://www.spamhaus.org/drop/dropv6.txt cat drop.txt edrop.txt dropv6.txt | sed "s/;/#/" > /root/drop.txt ) rm -r $TMPDIR pfctl -t spamhaus -T replace -f /root/drop.tx Code:
# Spamhaus DROP list: table <spamhaus> persist file "/root/drop.txt" block drop in log quick from <spamhaus> |
|
|||
![]() Quote:
Quote:
last-modified: Sun, 31 May 2020 15:45:06 GMT For eDROP: last-modified: Tue, 12 May 2020 10:42:24 GMT DropV6 doesn't sent that header, but third line of file says: ; Last-Modified: Thu, 30 Jan 2020 05:16:30 GMT Anyway I really like that OpenBSD's pf allows to load table directly from file. In Linux's ipset command closest you can get is "ipset restore < file" command, but file must include actual ipset commands instead of only CIDRs.
__________________
Signature: Furthermore, I consider that systemd must be destroyed. Based on Latin oratorical phrase Last edited by e1-531g; 4th June 2020 at 12:10 PM. Reason: Remark about ipset |
|
|||
![]()
Another small thing that makes PF shine.
__________________
Signature: Furthermore, I consider that systemd must be destroyed. Based on Latin oratorical phrase |
|
|||
![]()
Little suggestion for script in post #1
I was experimenting with bash and wget lately, but I think this should going to work for Korn Shell and ftp too. Execute frp commands in a group. Instead of writing to three files make them send output to stdout and pipe directly to sed: Code:
#!/bin/sh # # this is normally run once per day via /etc/daily.local. # echo updating Spamhaus DROP lists: ( { ftp -o - https://www.spamhaus.org/drop/drop.txt && \ ftp -o - https://www.spamhaus.org/drop/edrop.txt && \ ftp -o - https://www.spamhaus.org/drop/dropv6.txt ; \ } 2>/dev/null | sed "s/;/#/" > /root/drop.txt ) pfctl -t spamhaus -T replace -f /root/drop.txt
__________________
Signature: Furthermore, I consider that systemd must be destroyed. Based on Latin oratorical phrase Last edited by e1-531g; 14th June 2020 at 10:48 AM. Reason: Changed script, becuse tmp is not needed |
![]() |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Large-scale DNS DDoS attack on Spamhaus | J65nko | News | 1 | 28th March 2013 10:54 PM |
Awk script to aggregate MyFreeFarm shopping lists | J65nko | Programming | 0 | 30th January 2011 10:41 PM |
Accused spammer demands $135M from Spamhaus; gets $27,002 | J65nko | News | 1 | 17th June 2010 07:07 PM |
Multiple entries in job lists | ros2468 | OpenBSD General | 1 | 19th February 2010 07:45 AM |
troff/nroff Q; how to put a linebreak in a tag labeled lists item | TerryP | General software and network | 8 | 10th November 2008 07:39 AM |