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

avast! Linux Home Edition cho người dùng Linux

Nếu bạn muốn dùng phần mềm Antivirus cho home user trên Linux thì có khá nhiều giải pháp như avast! Linux Home Edition , AVG, Clam Antivirus ,...thật tình mà nói cũng không cần sử dụng phần mềm Antivirus cho home user bên Linux mặc dù virus vẫn lây nhiểm qua các tập tin binary của linux tuy nhiên nếu bạn cần quét virus cho máy tính ở nhà, quét USB khi cắm vào máy thì có thể dùng nó.

Ở đây mình dùng phần mềm avast! Linux Home Edition download nó ở địa chỉhttp://www.avast.com/linux-home-edition


Chọn loại package thích hợp , sau khi bạn download xong thì tiến hành cài đặt nó và đăng ký 1 license miển phí với thời gian sử dụng lên đến 12 tháng.

Tuy nhiên đến khi chạy nó thì bạn sẽ gặp 1 lỗi An error occured in avast! engine: Invalid argument như sau :



Trên Fedora bạn fix nó như sau


Trên Ubuntu
$ sudo sysctl -w kernel.shmmax=128000000

Kết quả

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

Cài đặt JForum trên Centos 5.7 (Phần 2)

Bắt đầu cài đặt MySQL Server , jfroum hỗ trợ 4 loại DB như MySQL, Oracle, PostgreSQL, HSLDB ở đây mình dùng MySQL.

# yum -y install mysql mysql-server
# mysql_secure_installation
# chkconfig --levels 235 mysqld on
# mysql -u root -p

Tạo cơ sở dữ liệu đặt tên là jforum
mysql> create database jforum;

Về việc không cho đăng nhập vào MySQL với user root , gán quyền phù hợp cho DB mình không nhắc lại trong phần này cho nên đi nhanh qua .

Sau khi start Tomcat thành công thì mặc định thư mục chứa nội dung của nó đặt ở đường dẫn /usr/share/apache-tomcat-7.0.26/webapps (đường dẫn này tùy theo bạn khai báo)

# cd /usr/share/apache-tomcat-7.0.26/webapps
# wget http://jforum.net/jforum-2.1.9.zip
# unzip jforum-2.1.9.zip
# mv jforum-2.1.9 jforum

Bây giờ thử mở trình duyệt web truy cập vào đường dẫn sau (trong đó IP 192.168.1.7 chính là địa chỉ IP của server Lab)
http://192.168.1.7:8080/jforum/install.jsp

Do đây chỉ là bài lab nên bỏ qua công đoạn tạo user cho MySQL server, gán quyền hạn phù hợp của user này cho DB,...nên dùng quyền root (đừng như BKAV Forum bạn nhé)

Tiếp tục nhấn nút Next Step để đi sang bước kế tiếp

Bắt đầu nhấn nút Begin Install

Kết thúc

Đường dẫn của trang quản trị http://192.168.1.7:8080/jforum/admBase/login.page



--Còn nữa

Red Hat Linux System Administration Multimedia Cyber Classroom

The Red Hat Linux System Administration Multimedia Cyber Classroom | 187.23 MB

1 Installation
2 Linux Boot and Shutdown
3 Account Administration
4 Installing New Packages to Your Linux System
5 Networking with Linux
6 Printing and Print Sharing
7 Samba
8 E-mail
9 Setting Up FTP Services
10 Web Serving
11 X Windowing System
12 Securing Linux
13 Kernel Administration
14 System and Network Monitoring
15 Backing Up Your Data
Appendix.

Download links

http://www.fileserve.com/file/7bWhKGa/theredIinx.sys.admin.part1.rar

http://www.fileserve.com/file/WkKuD92/theredIinx.sys.admin.part2.rar

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

Cài đặt JForum trên Centos 5.7 (Phần 1)

Download JDK ở đây http://www.oracle.com/technetwork/java/javase/downloads/index.htmlđây tôi chọn JDK phiên bản 6 U31 cho bài LAB của mình.


# wget http://download.oracle.com/otn-pub/java/jdk/6u31-b04/jdk-6u31-linux-i586-rpm.bin
# # mv jdk-6u31-linux-i586-rpm.bin /opt/jdk-6u31-linux-i586-rpm.bin
# mkdir /usr/java
# cd /usr/java
# sh /opt/jdk-6u31-linux-i586-rpm.bin


Để thiết lập JAVA_HOME cho session hiện tại thì bạn cần thiết lập như sau
# JAVA_HOME=/usr/java/jdk1.6.0_31
# export JAVA_HOME
# PATH=$JAVA_HOME/bin:$PATH
# export PATH

Để thiết lập cho tất cả các người dùng thì bạn thiết lập trong ~/.bashrc hoặc ~/.bash_profile của từng người dùng . Tuy nhiên bạn có thể điều chỉnh bằng cách thêm vào trong /etc/profile

JAVA_HOME=/usr/java/jdk1.6.0_31
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH



Để kiểm tra xem bạn có thiết lập đúng hay không bằng command sau
# echo $JAVA_HOME
/usr/java/jdk1.6.0_31

Đến đây bắt đầu cài đặt Apache Tomcat 7.0.26 , download nó ở đây http://tomcat.apache.org/download-70.cgi

# wget http://www.eng.lsu.edu/mirrors/apache/tomcat/tomcat-7/v7.0.26/bin/apache-tomcat-7.0.26.tar.gz

Đến đây sau khi download Apache Tomcat thành công thì bạn có thể dùng lệnh md5sum để kiểm tra gói mà bạn tải về có đúng key mà trang chủ Apache Tomcat nó cung cấp .

# mv apache-tomcat-7.0.26.tar.gz /usr/share/apache-tomcat-7.0.26.tar.gz
# cd /usr/share
# tar -xzf apache-tomcat-7.0.26.tar.gz
# cd /usr/share/apache-tomcat-7.0.26/bin
# ./startup.sh



Tạo dịch vụ Tomcat
# cd /etc/init.d
# vi tomcat

Nội dung tập tin tomcat như sau :
#!/bin/bash
# description: Tomcat Start Stop Restart
# processname: tomcat
# chkconfig: 234 20 80
JAVA_HOME=/usr/java/jdk1.6.0_31
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
CATALINA_HOME=/usr/share/apache-tomcat-7.0.26
case $1 in
start)
sh $CATALINA_HOME/bin/startup.sh
;;
stop)
sh $CATALINA_HOME/bin/shutdown.sh
;;
restart)
sh $CATALINA_HOME/bin/shutdown.sh
sh $CATALINA_HOME/bin/startup.sh
;;
esac
exit 0

# chmod 755 tomcat
# chkconfig --add tomcat
# chkconfig --level 234 tomcat on

# service tomcat start


Thử start, stop, restart dịch vụ tomcat sau đó kiểm tra xem catalina có xuất hiện lỗi hay không bằng command sau :
# less /usr/share/apache-tomcat-7.0.26/logs/catalina.out

Bây giờ thử mở trình duyệt truy cập vào địa chỉ IP của con server để làm lab với cổng mặc định của Apache Tomcat là 8080 (nếu không truy cập vào được bạn cần kiểm tra lại firewall của máy server có thể nó block cổng này) thì bạn sẽ thấy hình như sau


Bây giờ bạn đã cài đặt Apache Tomcat thành công tuy nhiên hiện giờ Apache Tomcat đang chạy user root , để kiện toàn bảo mật hệ thống không nên chạy user root ứng với 1 dịch vụ nào đó ví dụ như Apache Tomcat , MySQL Server,...

# groupadd tomcat
# useradd -s /bin/noshell -g tomcat tomcat

Khi tạo user tomcat thì mặc định nó sẽ xuất hiện "mái nhà" cho user tomcat ở /home/tomcat

Tuy nhiên nếu bạn muốn quy định "mái nhà" cho user tomcat thì bạn
# useradd -g tomcat -d /usr/share/apache-tomcat-7.0.26/tomcat tomcat

# chown -Rf tomcat.tomcat /usr/share/apache-tomcat-7.0.26/

Đến đây thì bạn tạo script tomcat giống như bước trên tuy nhiên bằng cách dùng thêm su

#!/bin/bash
# description: Tomcat Start Stop Restart
# processname: tomcat
# chkconfig: 234 20 80
JAVA_HOME=/usr/java/jdk1.6.0_31
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
TOMCAT_HOME=/usr/share/apache-tomcat-7.0.26/bin
case $1 in
start)
/bin/su tomcat $TOMCAT_HOME/startup.sh
;;
stop)
/bin/su tomcat $TOMCAT_HOME/shutdown.sh
;;
restart)
/bin/su tomcat $TOMCAT_HOME/shutdown.sh
/bin/su tomcat $TOMCAT_HOME/startup.sh
;;
esac
exit 0

Thứ bảy, ngày 25 tháng hai năm 2012

Điều khiển máy tính từ xa qua Iphone, Ipad hoặc Nokia, LG, SamSung

Đối với Iphone, Ipad thì dùng giải pháp này

Mocha VNC for iPhone and iPad

APPLICATION DESCRIPTION
Using your iPhone, you can connect to a Windows PC or Mac OS X and see the files, programs, and resources exactly as you would if you were sitting at your desk, just on a smaller screen.
LITE VERSION
Compared to the Lite version the full version has:
- Cool key board banners with extra keys.
- Extra keys as ALT,CTRL, Option and Apple key.
- Full mouse Support, dragging, right click, hover and wheel.
- Ctrl+alt+del key. Needed if using Win 200x as a VNC Server.
FEATURES
Standard VNC protocol with encrypted password signon.
- Mac OS X sign on with user/password (needed for Lion).
- 8 and 32 bit color modes.
- Local Mouse support.
- Zoom and scroll as the Safari browser.
- Landscape mode.
- WOL (Wake on LAN).
- NETBIOS and and Bonjour names for easy configuration.
- Can handle 50 different Host configurations.
- Has been tested with RealVNC, TightVNC, UltraVNC on
Windows, and Apple Screen sharing, which
is included with the Mac OS X.
- A screen resolution larger than 2000x2000, as to memory
and speed, is not recommended.
On the new 3GS phones, memory is not a problem anymore.
Trang chủ :

Đối với Nokia , SamSung, LG thì dùng giải pháp sau
Free WiFiCheema Servers available for PC, Mac and Linux. Free WiFiCheema Clients are available for Nokia, Samsung,Sony Ericsson and LG smartphones
Trang chủ

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
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