Thứ năm, ngày 16 tháng hai năm 2012

Ngày đầu tiên sử dụng IPHONE thay thế cho Nokia E71

Đầu tiên cần cài đặt Cydia để cài đặt những ứng dụng cho IPhone của mình .Thì chuẩn bị firmware cho iPhone của mình, mở redsn0w ra nhấn nút Browse để tìm loại firmware tương ứng .


Cài đặt cái này rất đơn giản , theo hướng dẫn tiếng Anh của nó 1 chút
- Tắt nguồn iPhone trước tiên, cắm cáp từ iphone đến máy tính.
- Giữ nút Home trong khoãng 3 giậy
- Nhấn nút Nguồn kết hợp với nút Home trong khoãng 10 giây
- Bỏ nút nguồn ra lúc này vẫn còn giữ phím Home trong khoãng 15 giây

Sau khi cài đặt xong Cydia thì nó sẽ xuất hiện 1 icon như sau


Chú ý :
- Không nên sử dụng tính năng Erase All Content And Settings vì chức năng này sẽ khôi phục toàn bộ hệ thống để trở về trạng thái ban đầu, xóa tất cả các dữ liệu mà bạn đã lưu trữ . Nếu lỡ dùng tính năng này, khi khởi động lại IP thì nó bị hiện tượng "treo táo" do vậy chỉ còn cách restore. Dùng tính năng restore của iTunes để restore mất chừng 15 phút là xong mọi thứ. Do iTunes nó chỉ hỗ trợ cho hệ điều hành Mac và Windows do vậy nếu bạn sử dụng Linux thì bạn chỉ còn cách sử dụng VirtualBox để cài đặt iTunes .

- Không nên để nguồn dưới 10%, có trường hợp để dưới nguồn 10% tắt ngúm IP thì chỉ còn cách đem ra thợ kích hoạt nguồn .

Trong Cydia bạn thêm source của 2 thằng này , tôi thấy có mấy chổ repo khá hay
GSM VN: http://iphone.gsm.vn hay http://cydia.vn
HHVN: http://iphone.handheld.com.vn
Vnmagic: http://vnmagic.net/repo
Pda viet: http://p daviet.net/iphone
HeaveniPhone:
http://cydia.heaveniphone.com

Nếu bạn từng dùng qua Linux thì việc add source này còn dễ hơn ăn kẹo.


Còn nếu muốn sử dụng ngon hơn thì bạn cần Search với từ khóa AppStoreVN


Để bật SSH kiểm tra trong iphone có những gì thì bạn cần cài đặt gói OpenSSH . Như vậy tên người dùng là root và mật khẩu của người dùng để truy cập từ xa vào thiết bị alpine

Lúc này bạn có thể dùng WinSCP, Terminal, SecureCRT để truy cập từ xa vào điện thoại của mình.

(Hình ảnh trong bài viết lấy nhiều nguồn từ trên Internet)

Thứ tư, ngày 08 tháng hai năm 2012

CCIE Routing and Switching Exam Certification Guide 4th Edition


CCIE Routing and Switching Certification Guide, Fourth Edition, is a best-of-breed Cisco® exam study guide that focuses specifically on the objectives for the CCIE® Routing and Switching written exam. Well-respected networking professionals Wendell Odom, Rus Healy, and Denise Donohue share preparation hints and test-taking tips, helping you identify areas of weakness and improve both your conceptual knowledge and hands-on skills. Material is presented in a concise manner, focusing on increasing your understanding and retention of exam topics.

CCIE Routing and Switching Certification Guide, Fourth Edition, presents you with an organized test preparation routine through the use of proven series elements and techniques. “Do I Know This Already?” quizzes open each chapter and allow you to decide how much time you need to spend on each section. Exam topic lists make referencing easy. Chapter-ending Exam Preparation Tasks sections help drill you on key concepts you must know thoroughly.

The companion CD-ROM contains a powerful testing engine that allows you to focus on individual topic areas or take complete, timed exams. The assessment engine also tracks your performance and provides feedback on a module-by-module basis, presenting question-by-question remediation to the text and laying out a complete study plan for review.

Well regarded for its level of detail, assessment features, and challenging review questions and exercises, this official study guide helps you master the concepts and techniques that will enable you to succeed on the exam the first time.

CCIE Routing and Switching Certification Guide, Fourth Edition, is part of a recommended learning path from Cisco that includes simulation and hands-on training from authorized Cisco Learning Partners and self-study products from Cisco Press. To find out more about instructor-led training, e-learning, and hands-on instruction offered by authorized Cisco Learning Partners worldwide, please visit www.cisco.com/go/authorizedtraining.

The official study guide helps you master all the topics on the CCIE Routing and Switching written exam, including:

  • Bridging and LAN switching
  • IP addressing, IP services, TCP, UDP, and application protocol details
  • Layer 3 forwarding concepts
  • EIGRP, OSPF, and BGP routing protocols
  • Quality of service
  • Frame Relay
  • MPLS
  • IP multicast
  • IPv6
  • Router and switch security
  • Troubleshooting

Thứ năm, ngày 12 tháng một năm 2012

TetCon 2012 (Hội thảo Tết) 13/01 - HVA

Nguyên ngày 13/01/2012 ở TPHCM có diễn ra hội thảo TetCon do HVA và VNSecurity tổ chức, đây là 1 dịp tốt, hiếm để bạn có thể đặt câu hỏi , thảo luận với các diễn giả (chuyên gia an ninh mạng, hệ thống, ứng dụng làm việc trong các tập đoàn, công ty lớn trong và ngoài nước)

Ngay cả bản thân của mình khi lần đầu tiên nhận được thông báo này , mình rất vui và thu xếp toàn bộ thời gian để về TPHCM trong thời gian ngắn và sớm nhất để tham dự hội thảo , lắng nghe những bài thuyết trình của các diễn giả, những thành viên tham dự, khách mời để học hỏi thêm được nhiều kiến thức bổ ích, bổ sung thêm những kiến thức còn thiếu...bao la của mình.

Ngày mai 13/01/2012 anh em có điều kiện tham dự thì có thể đến ngay hội trường Lầu 6 Tòa nhà Trung tâm Thông tin Hợp tác Quốc Tế Thông Tấn tại TPHCM số 116-118 Nguyễn Thị Minh Khai Phường 6 Quận 3 để tham dự hội thảo TetCon 2012.

Chúc hội thảo thành công tốt đẹp

Thứ hai, ngày 09 tháng một năm 2012

slowhttptest - Application Layer DoS attack simulator

SlowHTTPTest is a highly configurable tool that simulates some Application Layer Denial of Service attacks.

It implements most common low-bandwidth Application Layer DoS attacks, such as slowloris, Slow HTTP POST, Slow Read attack (based on TCP persist timer exploit) by draining concurrent connections pool, as well as Apache Range Header attack by causing very significant memory and CPU usage on the server.

Slowloris and Slow HTTP POST DoS attacks rely on the fact that the HTTP protocol, by design, requires requests to be completely received by the server before they are processed. If an HTTP request is not complete, or if the transfer rate is very low, the server keeps its resources busy waiting for the rest of the data. If the server keeps too many resources busy, this creates a denial of service. This tool is sending partial HTTP requests, trying to get denial of service from target HTTP server.

Slow Read DoS attack aims the same resources as slowloris and slow POST, but instead of prolonging the request, it sends legitimate HTTP request and reads the response slowly.

Demo thử đoạn tấn công bằng slowhttptest






Homepage
http://code.google.com/p/slowhttptest/

How to use Google Authenticator for sshd/OSX

Tóm tắt:

Hướng dẫn cách tích hợp Google Authenticator vào sshd trên môi trường OSX. Mục đích ngoài password thường dùng ra thì phải có one-time-password trên điện thoại mới có thể đăng nhập được vào hệ thống.

I was interested in Google Authenticator one month ago, if you don't know what Google Authenticator is, check this description (1):

The Google Authenticator project includes implementations of one-time passcode generators for several mobile platforms, as well as a pluggable authentication module (PAM). One-time passcodes are generated using open standards developed by the Initiative for Open Authentication (OATH) (which is unrelated to OAuth).

Google Authenticate can turn your mobile phone to an one-time-password (OTP) token. That means, beside your own password, you must provide a number from your phone to login to your system.

Some applications have integrated Google Authenticator like Google Apps, LastPass, WordPress... So, I asked myself if i could use it for my Macbook ssh daemon?

After some searches, I understood that Google Authenticator has not supported OSX officially. That's why it can not work with OSX although you can build it successfully. To have some funs, I decided to modify it. You can follow my steps to apply your Linux systems also because it's similar. Let's go:

1. Download source code (2):
You can use hg to grab the source code (3). Type the following command in console:

hg clone --insecure https://code.google.com/p/google-authenticator/

If you get a certificate problem, try press R to ignore it (to fix this error, please contact Google Security Team :-P). The local source folder will be similar Google lastest repository (4).

2. Edit and compile:
Because of unofficially OSX supported, you can build the source code but you can't use it to login. You will always have this error:
in _openpam_check_error_code(): pam_sm_authenticate(): unexpected return value 19

A little modification for OSX required (Linux maybe not), edit pam_google_authenticator.c, insert those lines:

static int drop_privileges(pam_handle_t *pamh, const char *username, int uid,
int *old_uid, int *old_gid) {
// Try to become the new user. This might be necessary for NFS mounted home
// directories.

int old_uid1 = setuser(uid);
if (old_uid1 < 0) {
log_message(LOG_ERR, pamh, "Failed to change user id to \"%s\"", username);
return -1;
}
return old_uid1;

Exit and execute "make && make install" in console. *Please keep in mind that this is my dirty hack to make it works, it is unsupported and I take no responsibles for this modification*.

As a result, pam_google_authenticator_testing.so is complied.

3. Install:
Copy pam_google_authenticator.so module to PAM folder:
sudo cp pam_google_authenticator.so /usr/lib/pam/

Add this line to /etc/pam.d/sshd:
auth required pam_google_authenticator.so

Add this line to /etc/sshd_config:
ChallengeResponseAuthentication yes

Finally, restart sshd (5) by:
sudo launchctl unload /System/Library/LaunchDaemons/ssh.plist
sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist

To here, you finished the installation process, we can move to next step: Setup.

4. Setup:
You must install Google Authenticator for your mobile phone, in my case, i used App Store to download and install.

Run the following command in your server console:
./google-authenticator

Answer "y" for its questions.

That's all for server settings, now, you should look at information Google Authenticator provided, there is a link likes:
https://www.google.com/chart?chs=200x200&chld=


Copy this link and paste it to your browser, a barcode image will appear.

Open Google Authenticator on your phone, press Plus (+) button and move your mobile's camera to capture the barcode image, it will automatically display your own OTP.

It's ok for mobile settings also.

5. Testing:
Try to login to your system via ssh, you will be required for password and verification code.

This is the result:


Two-factors authentication is now enabled.

References:
(1) http://code.google.com/p/google-authenticator/
(2) http://code.google.com/p/google-authenticator/source/checkout
(3) hg client: http://mercurial.selenic.com/downloads/
(4) http://code.google.com/p/google-authenticator/source/browse/
(5) Enable sshd for OSX: go to Apple > System Preferences > Sharing, check Remote Login

Bài viết này của "pa" LeVuHoang

Thứ sáu, ngày 06 tháng một năm 2012

Firmware Modification Kit

This kit gives the user the ability to make changes to a firmware image without recompiling the firmware sources. It works by extracting the firmware into its component parts, then extracting the file system image. The user can then make modifications to the extracted file system, then rebuild the firmware image.

It is most useful for quick debugging of problems without having to rebuild the entire firmware image. It can even be deployed 'on the road'. A variety of formats are supported, mainly linux based GPL images known to be around; additionally, it can be used to customize DD-WRT web GUIs.

We've written a few custom utilities (i.e. untrx, wrt_vx_imgtool, spliter3) to support various devices. We've also made modifications to squashfs-tools and added known variants of squashfs-tools.

Recently, Binwalk was also integrated, to help identify and support even more firmware types and segment/filesystem types.

NO GUARANTEE IS PROVIDED. WITH EVERY REBUILT IMAGE YOU STAND THE CHANCE OF BRICKING YOUR DEVICE (EITHER A SOFT OR HARD BRICK). DO NOT USE THIS TOOL IF YOU CAN NOT RECOVER FROM SUCH A BRICK. BY USING THIS TOOL YOU ASSUME LIABILITY OF ALL DAMAGES, TANGIBLE AND INTANGIBLE, RESULTING FROM THE USE OR MIS-USE OF THIS SOFTWARE.

Un-guaranteed support fir firmware image formats for the following devices:

  1. WRT54G v1 - v6
  2. WRT54GS v1 - v6
  3. WRTSL54G v?
  4. M10 (Cisco Valet)
  5. ASUS WL-330g
  6. ASUS WL-500g/p
  7. ASUS WL-520g
  8. ASUS WL-530g
  9. Belkin 7230-4 (some versions)
  10. Belkin 7231-4 (?)
  11. Buffalo WHR-G54S
  12. Buffalo WHR-HP-G54
  13. Siemens SE505
  14. Trendnet TEW-632BRP
  15. D-Link DIR615 (maybe, untested)
  16. many others..

Some specific firmware types:

  1. OpenWrt
  2. Tomato
  3. X-Wrt
  4. DD-WRT v23 for all models
  5. DD-WRT v24 SP1+ (for some models ONLY)

The following filesystems can be extracted and assembled:

  1. squashfs 2.x (zlib)
  2. squashfs 2.x (lzma)
  3. squashfs 3.x (zlib)
  4. squashfs 3.x (lzma)
  5. squashfs 3.x (lzma with prepended encoding params)
  6. squashfs 3.x (lzma with other variations)
  7. JFFS2
  8. cramfs (zlib)

This utility has recently taken on a new contributor who wrote his own new rendition of the extraction and rebuild scripts and inclusion (or creation) of related tools. His are superior at identifying more types of firmwares. His scripts have the -ng.sh filename.

The original scripts are still necessary and could work on some firmware images that the newer scripts may not work on. Therefore, they are being kept around, at least for now.

Homepage

http://code.google.com/p/firmware-mod-kit/

Thứ ba, ngày 03 tháng một năm 2012

Thay thế router "cùi" bằng các giải pháp DD-WRT, Tomato, Sveasoft

Bài viết này tôi xin giới thiệu 3 site dùng để thay thế router... cùi trong gia đình của bạn (thiếu một số tính năng mà bạn cần) về việc hướng dẫn sử dụng, tinh chỉnh theo ý muốn, thao tác các giải pháp này đầy rẫy ở trên mạng Internet-ngay cả cộng đồng mạng còn quay video clip hình ảnh để làm. Cho nên với 1 người chẳng biết tí về công nghệ, làm theo cũng làm được chuyện nâng cấp firmware cho router nên tôi không nhắc đến trong bài viết này.

Tôi thử nghiệm với dòng Linksys thì theo nhận xét của tôi, các giải pháp này làm việc khá tốt, hỗ trợ khá tốt với dòng sản phẩm Linksys tuy nhiên với các dòng China, Taiwan (Hồng Kông bên hông...Chợ lớn như Huawei thì có cái được cái không được) .

Ví dụ như bạn có 1 con router mà trong các trang này không có hỗ trợ thì bạn không nên...liều mạng mà cập nhật firmware (có 3 cách để bạn chọn lựa cập nhật : Qua Web GUI, qua SSH , qua TFTP) .

Nên lựa chọn danh sách các router mà các site cung cấp giải pháp, nó hỗ trợ cho router của gia đình bạn. Nếu muốn thử nghiệm thì nên dùng các router bị chập chờn, sóng lúc có lúc không,router quá hạn bảo hàng ... và theo tôi được biết thì khi cập nhật firmware có sai xót thì hầu như tụi cung cấp sản phẩm nó sẽ không bảo hành, nếu như router của bạn vẫn còn thời hạn bảo hành (giống như trường hợp cháy , chập, nổ)

Lý do vì sao tôi cần cập nhật Firmware của hãng khác mà không phải hãng của mình
- Do các modem hỗ trợ đầy đủ các tính năng mà bạn cần thì đồng nghĩa với việc bạn cần chi trả thêm tiền để trang bị cho việc mua router mới.
- Các router mà bạn mua trên thị trường hầu như là các router thông dụng chẳng hạn thiếu VPN, Radius, ...

1. DD-WRT
Tụi DD-WRT cung cấp danh sách các router mà nó hỗ trợ khá nhiều so với 2 anh còn lại .

Homepage :
http://www.dd-wrt.com/site/support/router-database


2. Tomato (nghe giống như ....cà chua)
Homepage : http://www.polarcloud.com/tomato
3. Sveasoft
Homepage : http://sveasoft.com/talisman-basic-firmare-beta



Tôi có con Microsens và con TP-Link TD-W8901G mà cho đến nay tôi vẫn chưa liều để thử nghiệm cũng vì những lý do trên .

Thứ hai, ngày 02 tháng một năm 2012

Hướng dẫn cập nhật Kernel tránh lỗi Kernel Panic trên Centos 5.7

Kernel Linux là nòng cốt của "hệ điều hành" Linux, để cho hệ thống hoạt động mạnh mẽ, hiệu quả , an toàn, bảo mật thì thường người quản trị hệ thống nên cập nhật phiên bản Kernel mới. Kernel mới nhất bạn có thể tìm, tải tại đây http://www.kernel.org/ khuyến cáo nên dùng các phiên bản ổn định (Stable) thay vì dùng các phiên bản Mainline, Beta.

Tuy nhiên đám phát triển các dòng Centos thường ít cập nhật phiên bản mới nhất, nếu có thì trong kernel nó "gom" một đống những thứ không cần thiết vào làm cho máy chủ bị đình trệ hoặc dư thừa những module không cần thiết, giống như tronòg 1 công ty "tôi cần anh A nhưng không cần anh B".

Những lý do nên cập nhật kernel
- Đương nhiên 1 nhà lập trình nào đó , khi viết ra 1 sản phẩm phần mềm nếu thêm nhiều đoạn code vào thì đoạn code đó dung lượng , thời gian sẽ chậm hơn so với 1 đoạn code khá ngắn .
- Thử hình dung kernel có nhiều tính năng "hữu ích" trong đó thì khi module này có lỗi thì bạn sẽ trở thành nạn nhân của hacker như các cuộc tấn công tràn bộ đệm là 1 ví dụ.
- Lựa chọn cài đặt khá đơn giản chỉ Yes (Y) hay No (N)

Những lý do không nên cập nhật kernel (cẩn thận với người dùng đăng nhập SSH từ xa)
- Việc cập nhật kernel thường xuyên đối với 1 người lam việc thành thạo trên Linux và có kinh nghiệm nhiều năm trong kernel thì việc cập nhật kernel có thể đơn giản hơn bao giờ hết tuy nhiên với những người theo mạng...cộng đồng, ai nói cập nhật kernel là tốt sau đó thử nghiệm trên hệ thống của mình mà "kéo" theo nguyên đám không cần thiết thì có thể làm hệ thống trì trệ hơn nữa.
- Hệ thống dễ chết bất cứ lúc nào khi cập nhật kernel phiên bản mới nhất bị lỗi như Kernel Panic thường xãy ra là 1 ví dụ điển hình, nếu điều chỉnh grub không đúng cũng có thể làm bạn tự "khóa" mình lại.


Kernel cũ trên máy tính của tôi
# uname -a
Linux localhost.localdomain 2.6.18-274.el5


Chuẩn bị mọi thứ cần thiết
# wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.39.4.tar.bz2
# tar jxvf linux-2.6.39.4.tar.bz2 -C /usr/src
# cd /usr/src
# ln -sf linux-2.6.39.4 linux

Thêm 1 số gói cài đặt bổ sung cho việc nâng cấp kernel mới
# yum install gcc make bison ncurses-devel rpm-build

Bắt đầu cài đặt
# cd /usr/src/linux
# make clean && make mrproper
# cp /boot/config-`uname -r` .config
# make menuconfig

Trong phần này bạn cần bật
General setup->
[*] enable deprecated sysfs features to support old userspace tools
[*] enabled deprecated sysfs features by default

Nếu bạn config trực tiếp thì mở .config , điều chỉnh 2 dòng sau thành
CONFIG_SYSFS_DEPRECATED=y
CONFIG_SYSFS_DEPRECATED_V2=y


Thường thì khi tôi cập nhật, nâng cấp kernel thì các tính năng mà nó hỗ trợ iptables tôi đều bật nó cả (nếu bạn không biết về các tính năng này thì chọn hết)

Tôi ví dụ như conntract
Tìm dòng Networking support chọn tiếp Networking option , kéo xuống phía dưới thấy dòng này Network packet filtering framework (Netfilter) chọn mục Core Netfilter Configuration và chọn mục Netfilter connection tracking support

Bạn tìm mục General Setup chọn dòng Local version – append to kernel release sau đó nhập vào ví dụ như -hvaonline hay -default , -config tùy bạn


Sau đó xong mọi thứ thì bạn vào Exit để thoát ra

# make rpm
# ls -alh /usr/src/redhat/RPMS/i386/
total 217M
drwxr-xr-x 2 root root 4.0K Jan 1 11:04 .
drwxr-xr-x 9 root root 4.0K Oct 3 17:14 ..
-rw-r--r-- 1 root root 217M Jan 1 11:04 kernel-2.6.39.4hvaonline-1.i386.rpm

# rpm -ivh /usr/src/redhat/RPMS/i386/kernel-2.6.39.4hvaonline-1.i386.rpm
Preparing... ########################################### [100%]
1:kernel ########################################### [100%]

# ls /boot
config-2.6.18-274.el5 symvers-2.6.18-274.el5.gz
config-2.6.39.4-hvaonline System.map-2.6.18-274.el5
grub System.map-2.6.39.4-hvaonline
initrd-2.6.18-274.el5.img vmlinux-2.6.39.4-hvaonline.bz2
lost+found vmlinuz-2.6.18-274.el5
message vmlinuz-2.6.39.4-hvaonline

# cd /boot
# depmod 2.6.39.4-hvaonline

# mkinitrd -v /boot/initrd-2.6.39.4-hvaonline.img 2.6.39.4-hvaonline

Ta xem qua cấu hình mặc định của tập tin grub
# cat /boot/grub/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-274.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-274.el5 ro root=/dev/VolGroup00/LogVol00
initrd /initrd-2.6.18-274.el5.img

Bây giờ ta điều chỉnh thêm vào 1 đoạn như sau
title CentOS (2.6.39.4-hvaonline)
root (hd0,0)
kernel /vmlinuz-2.6.39.4-hvaonline ro root=/dev/VolGroup00/LogVol00
initrd /initrd-2.6.39.4-hvaonline.img

Kết thúc

Thứ năm, ngày 29 tháng mười hai năm 2011

Compile kernel IPFW (FreeBSD 8.2)

Kiểm tra xem ipfw có compilte vào kernel hay không
# ipfw list

Nếu xuất hiện thông báo như sau ipfw: getsockopt(IP_FW_GET): Protocol not available thì bạn cần làm những bước sau
- Sử dụng sysinstall để cài đặt src (chọn Configure chọn mục Distributions chọn src trong phần src chọn All)

- Sau khi đợi nó cài đặt xong, kiểm tra xem thư mục /usr/src xem có tập tin binary xuất hiện ở trong đường dẫn này hay không
master# grep IPFIREWALL /usr/src/sys/i386/conf (tùy thuộc vào kiến trúc mà bạn chọn loại thích hợp có thể là i386, amd64, ia64, powerpc, sparc64 hoặc pc98)

master# cd /usr/src/sys/i386/conf
master# cp GENERIC IPFWKERNEL

master# vi IPFWKERNEL
Thêm vào các dòng sau
options IPFIREWALL # required for IPFW
options IPFIREWALL_VERBOSE # optional; logging
options IPFIREWALL_VERBOSE_LIMIT=10 # optional; don't get too many log entries
options IPDIVERT # needed for natd


Bắt đầu thực thi
master# cd /usr/src
master# make buildkernel KERNCONF=IPFWKERNEL

Sau khi đợi nó compile xong , bạn
master # vi /etc/rc.conf

Thêm vào các dòng sau :
firewall_enable="YES"
firewall_script="/usr/local/etc/ipfw.rules"

Bgây iờ bắt đầu viết rule Firewall đầu tiên trên FreeBSD

# vi /usr/local/etc/ipfw.rules
IPF="ipfw -q add"
ipfw -q -f flush
#loopback
$IPF 10 allow all from any to any via lo0
$IPF 20 deny all from any to 127.0.0.0/8
$IPF 30 deny all from 127.0.0.0/8 to any
$IPF 40 deny tcp from any to any frag
# statefull
$IPF 50 check-state
$IPF 60 allow tcp from any to any established
$IPF 70 allow all from any to any out keep-state
$IPF 80 allow icmp from any to any
# open port ftp (20,21), ssh (22), mail (25)
# http (80), dns (53) etc
$IPF 110 allow tcp from any to any 21 in
$IPF 120 allow tcp from any to any 21 out
$IPF 130 allow tcp from any to any 22 in
$IPF 140 allow tcp from any to any 22 out
$IPF 150 allow tcp from any to any 25 in
$IPF 160 allow tcp from any to any 25 out
$IPF 170 allow udp from any to any 53 in
$IPF 175 allow tcp from any to any 53 in
$IPF 180 allow udp from any to any 53 out
$IPF 185 allow tcp from any to any 53 out
$IPF 200 allow tcp from any to any 80 in
$IPF 210 allow tcp from any to any 80 out
# deny and log everything
$IPF 500 deny log all from any to any
# sh /usr/local/etc/ipfw.rules

Để kiểm tra các rules chạy
# ipfw list

Tham khảo từ

Happy New Year 2012


Chia tay năm củ 2011, chỉ còn vài ngày là bước sang năm mới 2012, xin kính chúc bà con cô bác, anh em và gia đình, những anh em viếng thăm blog cá nhân này của tôi có nhiều sức khỏe, may mắn, bình an, gia đình êm ấm hạnh phúc, gặt hái được nhiều thành công trong cuộc sống và công việc .


Nhìn đến năm 2012 bất chợt suy nghĩ trong lòng ta sắp "già" mất rồi.