VIM-cheatsheet
By ronaldMarch 29, 2006 on 3:00 pm | In Tech | Add your comment
Voor iedere Vi/Vim gebruiker:
graphical vi/vim Cheat Sheet and Tutorial
Building a snort enabled gateway
By ronaldFebruary 13, 2006 on 5:59 pm | In Tech | Add your comment
Today I build a snort enabled gateway, the risk of getting the Windows XP workstations infected by some kind of exploit or virus is getting bigger and bigger. We all have the zero-day WMF-exploit fresh in mind and the risk of getting infected by some foolish Windows exploit is just too big.
Situation
We don’t want our gateway to do anything with non-infected data, so we are going to build a transparent (bridging) gateway, knownas a bridge. A bridge passes all the traffic on OSI-layer 2 between two interfaces, so the clients aren’t able to see the trafficgoing over two interfaces.
On the bridge we’re installing snort_inline, a modified version of snort able to drop maliscious traffic with iptables.
Installing the bridge
If you know what you are doing, creating a bridge isn’t too difficult. To create a bridge between two interfaces (e.g. eth0 and eth1) you need the bridge-utils. In Debian it’s as easy as apt-get install bridge-utils, but I’m sure that your distribution has itpackaged. After installing the bridge-utils it is as easy as these commands:
#create the bridge
brctl addbr br0
#add the interfaces
brctl addif eth0
brctl addif eth1
Notice that we’re not giving the bridge an ip address, because we are going to connect this system directly to the Internet.
Installing snort_inline
Before we install snort_inline, we need to install libpcap, libnet, libipq and libpcre. Also make sure you have the iptables development headers in place. To install snort_inline it is as simple as doing the famous three-command sequence (configure, make, make install) but make sure you solve reported problems first ![]()
After installation you need to edit the configfile by hand, look at the examples in the source-directory (some hints: var RULE_PATH, log stuff etc).
Integrading snort_inline and iptables
Before you can use snort_inline to monitor (and block) you’re traffic you need to integrate it with iptables. We do this with theip_queue module, so you need to modprobe the module first. In case your kernel doesn’t provide ip_queue you are in bad luck, you need to recompile the kernel to include ip_queue….
After loading the module it is as easy as the following rule in iptables:
iptables -I FORWARD -p tcp –dport 80 -j QUEUE
The line above pushes all the traffic from and too port 80 in a queue. If you try to surf to the Internet with a box behind the bridge, it won’t work.
Now we start snort_inline:
snort_inline -c /etc/snort_inline/snort_inline.conf -Q -N -t /var/log/snort/ -v
You should be able to surf again.
Converting rules
Normaly snort has ALERT rules, it just alerts you when maliscious traffic is detected. Because we aren’t looking at our logs all the time, we’re going to DROP the traffic if it is maliscious. In the source-directory you see a directory rules, copy this directory to your configdirectory (normaly this is /etc/snort). Make a backup off the directory and run the following script on the backup:
#!/bin/bash
#converting ALERT rules to DROP rules
for file in $(ls -1 *.rules)
do
sed -e ‘s:^alert:drop:g’ ${file} > ${file}.new
mv ${file}.new ${file} -f
done
Make sure you alter your configfile to load the adjusted rules!
That’s all folks!
Remember, all the traffic to port 80 is going through snort_inline, so if snort_inline is stopped the traffic will stop!
To reverse this project, just remove ip_queue and the iptables rules you use to push the traffic through snort_inline!
iBook geupdate en de rumors beginnen alweer….
By ronaldAugust 3, 2005 on 12:47 am | In Tech | Add your comment
Want, en ja als we dat checken klopt het wel, de PowerBook is end-off-life-cycle, als je van gemiddelden uitgaat that is. Alleen was de Mac mini nu niet geupdate omdat er eigenlijk te weinig geheugen inzat? En de iBook moest toch ook nodig naar de 512MB…. Dus ondanks dat Macrumors roept dat de PowerBook end-off-life zou zijn, denk ik persoonlijk dat we nog wel even kunnen blijven wachten.
Maar we zullen het zien, als er een update komt dan zou het nu moeten gebeuren, of in ieder geval in augustus….
Bull AIX freeware site
By ronaldJuly 30, 2005 on 2:48 am | In Tech | Add your comment
Spelen met een RS6000 van IBM is leuk, alleen die software is zo veroudert…. Wat ga je daar nou aan doen? Nou dan ga je dus naar deze site en kom je een hele bak met software tegen die je zo kan installeren (mits je natuurlijk genoeg vrije ruimte hebt). Hoe je dat doet? Gewoon heel simpel, je download van de juiste pagina (in dit geval voor AIX 4.3) een bestand met extentie .exe, je chmod +x hem en voert hem uit. Daarna log je in als root (of je su-ed) verwijdert eventuele .toc bestanden en open je smit (oeh, nice name) met het commando install_latest erna (smit install_latest). Als er gevraagd wordt om de INPUT directory dan kies je voor de plek waar je het spul uitgepakt hebt en drukt op enter.
Na het genereren van de lijst rammel je op F4 en selecteer je de bedoelde package met F7. Nu installeert smit speciaal voor jou de applicatie. Om de app te kunnen gebruiken zal je /usr/local/bin in je $PATH moeten hebben. Op AIX kan je dat voor alle users doen in /etc/environment. Als laatste zal je in /etc/profile nog export MANPATH=/usr/share/man:/usr/local/man:/uman: willen toevoegen.
Powered by WordPress design by Ronald van den Blink.
Entries and comments feeds.
Valid XHTML and CSS. ^Top^
25 queries. 0.434 seconds.