From: alvin <alvin.sm@Mail.Linux-Consulting.com>
To: Thomas Delrue <thomas.delrue@fundamental-software.net>
Cc: netfilter@vger.kernel.org, alvin <alvin.sm@Mail.Linux-Consulting.com>
Subject: Re: Creating, editing, removing rules from C(++)
Date: Wed, 22 Jul 2015 10:01:54 -0700 [thread overview]
Message-ID: <20150722170154.GA2610@Mail.Linux-Consulting.com> (raw)
In-Reply-To: <55AECB5B.9090302@fundamental-software.net>
hi thomas
On Tue, Jul 21, 2015 at 06:44:43PM -0400, Thomas Delrue wrote:
> Thank you for replying!
...
> On 07/21/2015 06:30 PM, alvin wrote:
...
> > # eg. add incoming ddos attackers to iptables blacklist
> > # iptables-gui -autoadd ... 'a.b.c.d|w.x.y.z'
> >
> > # the corresponding actual iptable rule:
> > iptables -I BlackList -p tcp -s a.b.c.d -d myLAN/24 -j TARPIT
>
> This is exactly the kind of thing that I would like to do
> Is the source for iptables-gui open source?
it is not open source :-)
the idea is simple:
- ( tcpdump or any sniffer | cleanup and extract > traffic.data.txt ) &
--- iptables-gui need to sort the traffic data and insert or delete
--- incoming IP# of the DDoS at the right rule# in iptables chains
- crontab# iptables-gui -add or -delete
> Can you point me to it or to
> the documentation/resources you used to write this application.
#
# i assume ( require ) certain set or sequence of iptables rules
# and list of the other people's IPtables howto
#
http://iptables-blacklist.net/Howto/
------
Neil murphy's idea of using iptables-restore is a good idea too
for add/deleting CIDRs that changes infrequently
iptables-save -c > /tmp/iptables.txt
sed -e s/a.b.c.d/w.x.y.z/g < /tmp/iptables.txt > /tmp/iptables.new.txt
iptables-restore -c < /tmp/iptables.new.txt
#
# you'd need to verify save and restore works ... it didn't work
# for me when i tested on debian-testing, slackware-14.x, redhat variants
#
# save/restore seems to work on most all versions of OpenSuSE
# and rolling updates worked across 4 major patch levels from
# 11.x - 12.x - 13.x - factory
#
# i needed iptables rules to be independent of the distro's syntax
#
> # eg. remove inactive ddos attacks from the blacklist
> > # iptables-gui -autodelete ... w.x.y.z
> >
> > # the corresponding actual iptable rule:
> > iptables -D BlackList -p tcp -s a.b.c.d -d myLAN/24 -j TARPIT
>
> Yep, this also is exactly what I'm trying to do
have fun
alvin
http://DDoS-Mitigator.net
next prev parent reply other threads:[~2015-07-22 17:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-21 21:41 Creating, editing, removing rules from C(++) Thomas Delrue
2015-07-21 22:30 ` alvin
[not found] ` <55AECB5B.9090302@fundamental-software.net>
2015-07-22 17:01 ` alvin [this message]
2015-07-21 23:15 ` Neal P. Murphy
2015-07-22 0:08 ` Sven-Haegar Koch
2015-07-22 0:31 ` Neal P. Murphy
2015-07-22 13:39 ` Thomas Delrue
2015-07-27 10:25 ` Bastian Bittorf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150722170154.GA2610@Mail.Linux-Consulting.com \
--to=alvin.sm@mail.linux-consulting.com \
--cc=netfilter@vger.kernel.org \
--cc=thomas.delrue@fundamental-software.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox