[ previous ] [ next ] [ threads ]
 
 From:  Steven Nusser <jaguar11735 at gmail dot com>
 To:  Andy Wodfer <wodfer at gmail dot com>
 Cc:  m0n0wall at lists dot m0n0 dot ch
 Subject:  Re: [m0n0wall] XML import tool or trick?
 Date:  Wed, 25 May 2011 12:54:35 -0400
The easiest way I can think of is to do a mail merge using Word
(OpenOffice may be able to do this as well). Copy your IP list into an
excel spreadsheet and save it; copy the rule template into a Word doc,
and start the mail merge using the spreadsheet as the source. I'm not
a mail merge guru, so check Google for the details.

Once Word has the whole set of rules populated, you'll probably want
to copy and paste it all into notepad or similar to get rid of any
extra formatting crap that Word throws in there.
--
Steven C. Nusser



On Wed, May 25, 2011 at 5:16 AM, Andy Wodfer <wodfer at gmail dot com> wrote:
>
> I need some help again here ... My webserver that's on my LAN interface
> (10.0.0.10) is being DDOS'ed (TCP port 80). I need to block the attackers.
>
> I have a txt file containing about 1300 IP addresses (one on each line).
>
> I need to create block rules in my firewall (m0n0wall) for all these IP
> addresses. The syntax is:
>
> <rule>
> <type>block</type>
> <interface>wan</interface>
> <protocol>tcp</protocol>
> <source>
> <address>IP ADDRESS</address>
> </source>
> <destination>
> <any/>
> </destination>
> <descr>blocked</descr>
> </rule>
>
> The IP list .txt file looks like this (just random typed numbers):
>
> 200.200.202.2
> 55.33.100.224
> 81.55.44.75
> and so on ...
>
> Is there a way I can generate the XML data rule tags and insert one IP from
> each line into the <address> tag and put everything in a new file with the
> rules underneath eachother like this so I can add it to my config backup xml
> file?
>
> <rule>
> <type>block</type>
> <interface>wan</interface>
> <protocol>tcp</protocol>
> <source>
> <address>IP ADDRESS</address>
> </source>
> <destination>
> <any/>
> </destination>
> <descr>blocked</descr>
> </rule>
> <rule>
> <type>block</type>
> <interface>wan</interface>
> <protocol>tcp</protocol>
> <source>
> <address>IP ADDRESS</address>
> </source>
> <destination>
> <any/>
> </destination>
> <descr>blocked</descr>
> </rule>
> <rule>
> <type>block</type>
> <interface>wan</interface>
> <protocol>tcp</protocol>
> <source>
> <address>IP ADDRESS</address>
> </source>
> <destination>
> <any/>
> </destination>
> <descr>blocked</descr>
> </rule>
>
> Thanks for all help!
>
> Cheers,
> Andy