โดยปกติแล้วเจ้าเซอเวอร์ของเรามันจะโชว์เวอร์ชันของ 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 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 ไปเลย
[...]
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 [...]