posts | comments
02Jun

Howto: ipfw allow/deny match on MAC address

No comments

FreeBSD ipfw match on MAC ADDRESS

1. First of all you have to compile ipfw into your kernel.
2. Second add layer2 filtering support into fbsd sysctl :
#sysctl net.link.ether.ipfw=1

3. OK, now we create full shell script to adding ipfw ruleset.

#vi ipfw.conf

Read the rest of this entry »

02Jun

Anti Streamripping shell script (+ipfw)

No comments

#!/usr/compat/linux/bin/bash
# Copyright (c) 2005 DaveG.ca
# Modified 2005-11-15 by Mike Brown (skew.org) for FreeBSD ipfw and Shoutcast logs
# You may use this code under the GPL, version 2 or newer.
# firewall streamrippers

PATH=/bin:/sbin:/usr/bin:/usr/sbin
IPFW_FILE=/usr/local/etc/rc.d/firewall_misc.sh

tail -50 /usr/local/shoutcast/sc_serv.log | \
egrep ‘Streamripper|FreeAmp|UnknownPlayer|Pathfinder|sr-POSIX|andycadd1|AmiNetRadio|UPLAYER|HiDownload|jake|JetAudio|TotalRecorder’ | \
cut -d\ -f 3 | sed ’s#]$##’ | sort | uniq -c | \
( while read num ip; do
if [ $num -gt 0 ]; then
if ! ipfw show | grep -q $ip ; then
echo adding $ip for $num streamripper violation\(s\)
logger -p auth.warn blocking $ip for $num streamripper violation\(s\)
ipfw -q add 1005 deny tcp from $ip to any
date +”# streamripper %Y-%m-%dT%H:%M:%S” >> ${IPFW_FILE}
echo “ipfw -q add 1005 deny tcp from $ip to any” >> ${IPFW_FILE}
fi
fi
done
)

Original at : http://forums.winamp.com/printthread.php?s=799480f2c2a5ca3a2e587a6954a94ecc&threadid=231067

01Jun

make devfs in FreeBSD jail

No comments

This is about how to make your devfs into fbsd jails

0. Before you login , you need to mount devfs in first:

#mount_devfs devfs /usr/jail/dev

1. Login into host machine and start the jail

#jail /usr/jail jail.mydomain.net 192.168.7.60 /bin/sh /etc/rc

2. Now do the devfs command:

#  devfs -m /usr/jail/dev rule apply hide

# devfs -m /usr/jail/dev rule apply path null unhide

# devfs -m /usr/jail/dev rule apply path random unhide

Of course after all , you have to write jail config into your rc.conf file :

Read the rest of this entry »

18May

Howto: FreeBSD router with PF and traffic shaper

No comments

FreeBSD router with PF and traffic shaper

OK.

step1. Brand New Fbsd 7.2-RELEASE installation. …
step2. Kernel configuration
cd /usr/src/sys/i386/conf

….. remove not used drivers, and put at the end of the kernelconf file

# pf support

device mem
device pf
device pflog
device pfsync

#altq support
options ALTQ
options ALTQ_CBQ
options ALTQ_RED
options ALTQ_RIO
options ALTQ_HFS

———

cd /usr/src

make buildkernel Read the rest of this entry »

24Apr

FreeBSD jail, console php: shmget() failed - SOLUTION

No comments

The Error: shmget() failed: Function not implemented

This is in the fbsd jail with php console execution.

Fix:
1. Get out of the jail
2. run sysctl -w security.jail.sysvipc_allowed=1

22Apr

Add and operate with vlan on MacOSX

No comments

1. Create your vlan interface
root# ifconfig vlan100 create

2. Attach your new vlan interface to a real network interface (en0, en1…)
root# ifconfig vlan100 vlan 100 vlandev en0
root# ifconfig vlan100
vlan100: flags=8842 mtu 1500
ether 00:1b:63:b2:ef:db
media: autoselect status: inactive
supported media: autoselect
vlan: 100 parent interface: en0

3. That’s all. Now add ip addresses and do whatever you want with it.

14Apr

Install symfony on blank FreeBSD jail

No comments

We have blank jail : installworld , you know.
We have to install apache php symfony, all libs etc..

line-by-line on commandline

#cd /usr/ports/www/apache13
#make install clean clean-depends
#cd /usr/ports/lang/php5 && make install clean clean-depends
…….
#cd /usr/ports/land/php5-extensions && make install clean clean-depends
……….
#echo ” AddType application/x-httpd-php .php \
AddType application/x-httpd-php-source .phps” >> /usr/local/etc/apache/httpd.conf
#echo “apache_enable=YES” >> /etc/rc.conf
#/usr/local/etc/rc.d/apache start
Read the rest of this entry »

14Apr

Allow chmod for ftp users in proftpd - SOLUTION

No comments

the problem:
When user login via ftp , the server refuse chmod command.

the solution:
edit your proftpd.conf and change in Limit SITE_CHMOD directive from DenyAll to AllowAll

that’s all :)

16Mar

Howto install backtrack 3 on USB flash device in for 4 steps

No comments

1. First download backtrack 3 usb version –> Click here

2. Mount or extract the .iso file

3. Copy folders Boot and BT3 into the main path on the usb flash drive

4.1 For Windows machines run /boot/bootinst.bat

4.2 For Linux/FBSD/OS X machines run /boon/bootinst.sh

 

PS.

In my case usb was mounted on /Volumes/USB DISK and becouse the empty space in path, the bootinst.sh script doesn’t work. So I just remount drive into a folder without empty space and everything is FINE and WORKING!

16Mar

debian 5.0 + asterisk COMPLETE INSTALL AND SETUP. simple, quick and working!

No comments

1.0 first install debian5

1.1 download it! debian-500-i386-CD-1.iso

1.2 write image to cd

1.3 INSTALL

 

2.0 install asterisk debian package

apt-get update && apt-get upgrade && apt-get install

 
Read the rest of this entry »