Install portupgrade on FreeBSD 6

ติดตั้ง cvsup โดยไปที่ /usr/ports/net/cvsup-without-gui และทำการติดตั้งได้เลยครับ
#cd /usr/ports/net/cvsup-without-gui
#make install clean

จากนั้นก็ทำการ synchronize ports index กับเซิร์ฟเวอร์ที่เป็น cvsup server โดยผมเลือก cvsup.jp.freebsd.org เพราะทำการ ping ดูแล้ว ได้เวลาเร็วสุด เมื่อเทียบกับเซิร์ฟเวอร์อื่นๆครับ โดยใช้คำสั่ง

#/usr/local/bin/cvsup -g -L 2 -h cvsup.jp.freebsd.org /usr/share/examples/cvsup/ports-supfile

จากนั้นก็ทำการติดตั้ง portupgrade ครับ
Continue reading “Install portupgrade on FreeBSD 6” »

Web proxy in freeBSD with Squid

หาที่อยู่ Ports ก่อนครับ
>whereis squid
/usr/ports/www/squid
เข้าไปที่ Ports เพื่อติดตั้ง
>cd /usr/ports/www/squid
>make all
>make install
แก้ไข config ของ squid
> vi /usr/local/etc/squid/squid.conf
หาบรรทัดต่าง ๆ ต่อไปนี้
Continue reading “Web proxy in freeBSD with Squid” »

OpenSSH Security with Fake banner in FreeBSD

โดยปกติแล้วเจ้าเซอเวอร์ของเรามันจะโชว์เวอร์ชันของ ssh โดยจะบอกทั้งเวอร์ชั่น ระบบปฏิบัติการ ทำให้เป็นเป้าหมายของเหล่า hacker สามารถค้นหาและสามารถเล่นงานได้โดยง่าย การทำ fake banner เป็นการเปลี่ยนรายละเอียนของโปรแกรมหรือเซอร์วิส เพื่อให้แสดงข้อมูลอย่างที่เราต้องการ ในตัวอย่างนี้ผมจะทำการเปลี่ยน banner ของ service OpenSSH ที่ลงในระบบปฏิบัตการ FreeBSD

โดยค่าปกติของ SSH Banner เป็นค่า SSH-2.0-OpenSSH_4.5p1 โดยเราจะเปลี่ยนให้เป็นค่า SSH-2.0-JiramotService

โดยทำการเข้าไปแก้ไฟล์ซอร์ส versioh.h ของ OpenSSH โดยใน FreeBSD จะอยู่ที่

/usr/scr/crypto/openssh/

จากนั้นแก้ให้เป็น

#define SSH_VERSION (ssh_version_get()) #define SSH_RELEASE (ssh_version_get()) #define SSH_VERSION_BASE “JiramotService” #define SSH_VERSION_ADDENDUM “JiramotInfo”

ทำการบันทึก จากนั้นรีคอมไฟล์ โดยไปที่

/usr/src/secure/lib/libssh

make [...]

Apache Security with Fake Banner

เพื่อเป็นการป้องการกันโจมที apache server โดยการทำ Fake banner ของ apache service

/etc/httpd/conf/httpd.conf            ; redhat distro

ServerTokens Full,OS,Minor,Minimal,Major,Prod

ServerTokens Setting ProductOnly Server: Apache Major Server: Apache/2 Minor Server: Apache/2.0 Minimal Server: Apache/2.0.55 OS Server: Apache/2.0.55 (Debian) Full (or not specified) default Server: Apache/2.0.55 (Debian) PHP/5.1.2-1+b1 mod_ssl/2.0.55 OpenSSL/0.9.8b

ถ้าจะแก้ไข header :  กรณีที่ต้องการเปลี่ยน banner ไปเลย

[...]

Monitor server with munin

Monitoring FreeBSD with Munin Munin is a monitoring tool available in the FreeBSD ports. It tracks the vital signs of your servers and charts everything on graphs by day, week, month and year. It makes it easy to see when your server gets spikes of traffic and how well it handles them. It [...]