Thủ thuật google 3
|
||
|
|
||
|
||
|
|
||
Demystifying Google Hacks
By Debasis Mohanty
by
Debasis Mohanty (Orissa, India)
Giới thiệu
Tôi đã nghĩ về việc công bố bài báo này từ lâu nhưng vì thiếu thời gian nên tôi đã không thể hoàn thành nó. Tôi đã bổ sung và cập nhật bài báo này khi tôi đã mệt mỏi với công việc nghiên cứu hàng ngày.
Google là máy tìm kiếm mạnh mẽ và phổ biến nhất thế giới,nó có khả năng chấp nhận những lệnh được định nghĩa sẵn khi nhập vào và cho những kết quả không thể tin được.Điều này cho phép những người dùng có dã tâm như
tin tặc, crackers, và _script_ kiddies v.v… sử dụng máy tìm kiếm Google để thu thập những thông tin bí mật và nhạy cảm, những cái mà không thể nhìn thấy qua những tìm kiếm thông thường.
Trong bài báo này tôi sẽ làm rõ những điểm dưới đây mà những người quản trị hoặc chuyên gia bảo mật phải đưa vào tài khoản
để phòng chống những thông tin bí mật bị phơi bày.
- Những cú pháp tìm kiếm nâng cao với Google
- Tìm kiếm những Site hoặc Server(máy chủ) dễ bị tấn công sử dụng những cú pháp nâng cao của Google
- Bảo mật cho servers hoặc sites khỏi sự tấn công của Google
Những cú pháp tìm kiếm nâng cao với Google
Dưới đây thảo luận về những lệnh đặc biệt của Google và tôi sẽ giải thích từng lệnh một cách ngắn gọn và nói rõ nó được sử dụng như thế nào để tìm kiếm thông tin.
[ in_title_: ]
Cú pháp “in_title_:” giúp Google giới hạn kết quả tìm kiếm về những trang có chứa từ đó trong tiêu đề. Ví dụ, “in_title_: login password” (không có ngoặc kép) sẽ cho kết quả là những _link_ đến những trang có từ “login” trong tiêu đề, và từ “password” nằm ở đâu đó trong trang.
Tương tự, nếu ta muốn truy vấn nhiều hơn một từ trong tiêu đề của trang thì ta có thể dùng “allin_title_:” thay cho “in_title_” để có kết quả là những trang có chứa tất cả những từ đó trong tiêu đề. Ví dụ như dùng
“in_title_: login in_title_: password” cũng giống như truy vấn “allin_title_: login password”.
[ inurl: ]
Cú pháp “inurl:” giới hạn kết quả tìm kiếm về những địa chỉ URL có chứa từ khóa tìm kiếm. Ví dụ: “inurl: passwd” (không có ngoặc kép) sẽ cho kết quả là những _link_ đến những trang có từ “passwd” trong URL.
Tương tự, nếu ta muốn truy vấn nhiều hơn một từ trong URL thì ta có thể dùng “allinurl:” thay cho “inurl” để được kết quả là những URL chứa tất cả những từ khóa tìm kiếm.Ví dụ: “allinurl: etc/passwd“ sẽ tìm kiếm những URL có chứa “etc” và “passwd”. Ký hiệu gạch chéo (“/”) giữa các từ sẽ bị Google bỏ qua.
[ site: ]
Cú pháp “site:” giới hạn Google chỉ truy vấn những từ khóa xác định trong một site hoặc tên miền riêng biệt. Ví dụ: “exploits site:hackingspirits.com” (không có ngoặc kép) sẽ tìm kiếm từ khóa “exploits” trong những trang hiện có trong tất cả các _link_ của tên miền “hackingspirits.com”. Không có khoảng trống nào giữa “site:” và “tên miền”.
[ filetype: ]
Cú pháp “filetype:” giới hạn Google chỉ tìm kiếm những files trên internet có phần mở rộng riêng biệt (Ví dụ: doc, pdf hay ppt v.v…). Ví dụ : “filetype:doc site:gov confidential” (không có ngoặc kép) sẽ tìm kiếm những file có phẩn mở rộng là “.doc” trong tất cả những tên miền của chính phủ có phần mở rộng là “.gov” và chứa từ “confidential”(bí mật) trong trang hoặc trong file “.doc”. Ví dụ . Kết quả sẽ bao gồm những liên kết đến tất cả các file văn bản bí trên các site của chính phủ.
[ _link_: ]
Cú pháp “_link_:” sẽ liệt kê những trang web mà có các liên kết đến đến những trang web chỉ định. Ví dụ :
chuỗi “_link_:www.securityfocus.com” sẽ liệt kê những trang web có liên kết trỏ đến trang chủ SecurityFocus.
Chú ý không có khoảng trống giữa “_link_:” và URL của trang Web.
[ related: ]
Cú pháp “related:” sẽ liệt kê các trang Web “tương tự” với trang Web chỉ định. Ví dụ :
“related:www.securityfocus.com” sẽ liệt kê các trang web tương tự với trang chủ Securityfocus. Nhớ rằng không có khoảng trống giữa “related:” và URL của trang Web.
[ cache: ]
Truy vấn “cache:” sẽ cho kết quả là phiên bản của trang Web mà mà Google đã lưu lại. Ví dụ:
“cache:www.hackingspirits.com” sẽ cho ra trang đã lưu lại bởi Google’s. Nhớ rằng không có khoảng trống giữa “cache:” và URL của trang web.
Nếu bạn bao gồm những từ khác trong truy vấn, Google sẽ điểm sáng những từ này trong văn bản đã được lưu lại.
Ví dụ: “cache:www.hackingspirits.com guest” sẽ cho ra văn bản đã được lưu lại có từ “guest” được điểm sáng.
[ intext: ]
Cú pháp “intext:” tìm kiếm các từ trong một website riêng biệt. Nó phớt lờ các liên kết hoặc URL và tiêu đề của trang.
Ví dụ: “intext:exploits” (không có ngoặc kép) sẽ cho kết quả là những liên kết đến những trang web có từ khóa tìm kiếm là “exploits” trong các trang của nó.
[ phonebook: ]
“phonebook” tìm kiếm thông tin về các địa chỉ đường phố ở Mỹ và số điện thoại. Ví dụ:
“phonebook:Lisa+CA” sẽ liệt kê tất cả các tên người có từ “Lisa” trong tên và ở “California (CA)”. Cú pháp này có thể được sử dụng như là một công cụ tuyệt vời của tin tặc trong trường hợp ai đó muốn tìm kiếm thông tin cá nhân cho công việc xã hội.
Truy vấn các site hoặc server dễ bị tấn công sử dụng các cú pháp nâng cao của Google
Những cú pháp truy vấn nâng cao thảo luận ở trên thực sự có thể giúp người ta chính xác hóa các tìm kiếm và có được những gì họ thực sự tìm kiếm.
Bây giờ Google trở thành một máy tìm kiếm thông minh, những người dùng có ác ý không hề bận tâm khai thác khả năng của nó để đào bới những thông tin bí mật từ internet mà chỉ có sự truy cập giới hạn. Bây giờ tôi sẽ thảo luận những kỹ thuật này một cách chi tiết làm thế nào để những người dùng ác tâm đào bới thông tin trên internet sử dụng Google như một công cụ.
Sử dụng cú pháp “Index of ” để tìm kiếm các site cho phép duyệt chỉ mục
Một webserver(máy chủ web) cho phép duyệt chỉ mục nghĩa là bất kỳ ai có thể duyệt các thư mục của webserver như các thư mục nội bộ thông thường. Ở đây tôi sẽ thảo luận làm thế nào để sử dụng cú pháp “index of” để có một danh sách các liên kết đến webserver cho phép duyệt thư mục.
Cách này trở thành một nguồn dễ dàng cho việc thu thập thông tin của tin tặc. Tưởng tưởng nếu họ nắm được các file mật khẩu hoặc các file nhạy cảm khác mà bình thưởng không thể thấy được trên internet.
Dưới đây là vài Ví dụ sử dụng để có được quyền truy cập vào rất nhiều thông tin nhạy cảm dễ dàng hơn rất nhiều:
Index of /admin
Index of /passwd
Index of /password
Index of /mail
“Index of /” +passwd
“Index of /” +password.txt
“Index of /” +.htaccess
“Index of /secret”
“Index of /confidential”
“Index of /root”
“Index of /cgi-bin”
“Index of /credit-card”
“Index of /logs”
“Index of /config”
Tìm kiếm các site hoặc server dễ bị tấn công sử dụng cú pháp “inurl:” hoặc “allinurl:”
a. Sử dụng “allinurl:winnt/system32/” (không có ngoặc kép) sẽ liệt kê tất cả các liên kết đến server mà cho phép truy cập đến những thư mục giới hạn như “system32” qua web. Nếu bạn đủ may mắn thì bạn có thể có quyền truy cập đến file cmd.exe trong thư mục “system32”. Một khi bạn có quyền truy cập đến file “cmd.exe” và có thể thực thi nó thì bạn có thể tiến lên xa hơn
leo thang quyền của bạn khắp server và làm hại nó.
b. Sử dụng “allinurl:wwwboard/passwd.txt”(không có ngoặc kép) trong
Google search sẽ liệt kê tất cả các liên kết đến server mà dễ bị tấn công vào “tính dễ bị tấn công mật khẩu WWWBoard”. Để biết thêm về tính dễ bị tấn công này bạn có thể vào _link_ sau đây:
http://www.securiteam.com/exploits/2BUQ4S0SAW.html
c. Sử dụng “inurl:.bash_history” (không có ngoặc kép) sẽ liệt kê tất cả các liên kết đến server mà cho phép truy cập vào file
“.bash_history” qua web. Đây là một file lịch sử dòng lệnh. File này bao gồm danh sách các lệnh được thực thi bởi quản trị viên,
, và đôi khi bao gồm cả thông tin nhạy cảm như mật khẩu
gõ vào bởi quản trị viên. Nếu file này bị làm hại
và nếu nó bao gồm mật khẩu đã mã hóa của hệ thống unix (or *nix)
thì nó có thể dễ dàng bị crack bởi phương pháp “John The
Ripper”.
d. Sử dụng “inurl:config.txt” (không có ngoặc kép) sẽ liệt kê tất cả các liên kết đến các máy chủ cho phép truy cập vào file “config.txt”
qua giao diện web. File này bao gồm các thông tin nhạy cảm,
bao gồm giá trị bị băm ra của mật khẩu quản trị và sự xác thực quyền truy cập cơ sở dữ liệu. Ví dụ: Hệ thống quản lý học tập Ingenium
là một ứng dụng Web cho các hệ thống Windows phát triển bởi Click2learn, Inc. Hệ thống quản lý học tập Ingenium
phiên bản 5.1 và 6.1 lưu các thông tin nhạy cảm không an tòan trong file config.txt. Để biết thêm thông tin vào liên kết sau:
http://www.securiteam.com/securitynews/6M00H2K5PG.html
Những tìm kiếm tương tự khác dùng “inurl:” hoặc “allinurl:” kết hợp với các cú pháp khác:
inurl:admin filetype:txt
inurl:admin filetype:db
inurl:admin filetype:cfg
inurl:mysql filetype:cfg
inurl
asswd filetype:txt
inurl:iisadmin
inurl:auth_user_file.txt
inurl:orders.txt
inurl:”wwwroot/*.”
inurl:adpassword.txt
inurl:webeditor.php
inurl:file_upload.php
inurl:gov filetype
ls “restricted”
index of ftp +.mdb allinurl:/cgi-bin/ +mailto
Tìm kiếm các site hoặc server dễ bị tấn công dùng “in_title_:” hoặc “allin_title_:”
a. Sử dụng [allin_title_: "index of /root”] (không có ngoặc vuông) sẽ liệt kê các liên kết đến các webserver(máy chủ Web) cho phép truy cập vào các thư mục giới hạn như “root” qua giao diện web. Thư mục này đôi khi bao gồm các thông tin nhạy cảm mà có thể dễ dàng tìm được tqua những yêu cầu Web đơn giản.
b. Sử dụng [allin_title_: "index of /admin”] (không có ngoặc vuông) sẽ liệt kê các liên kết đến các website cho phép duyệt chỉ mục các thư mục giới hạn như “admin” qua giao diện web. Hầu hết các ứng dụng web đôi khi sử dụng tên như “admin” để lưu quyền admin trong đó. Thư mục này đôi khi bao hàm các thông tin nhạy cảm mà có thể dễ dàng tìm được qua các yêu cầu Web đơn giản.
Những tìm kiếm tương tự dùng “in_title_:” hoặc “allin_title_:” kết hợp với các cú pháp khác
in_title_:”Index of” .sh_history
in_title_:”Index of” .bash_history
in_title_:”index of” passwd
in_title_:”index of” people.lst
in_title_:”index of” pwd.db
in_title_:”index of” etc/shadow
in_title_:”index of” spwd
in_title_:”index of” master.passwd
in_title_:”index of” htpasswd
in_title_:”index of” members OR accounts
in_title_:”index of” user_carts OR user_cart
allin_title_: sensitive filetype:doc
allin_title_: restricted filetype :mail
allin_title_: restricted filetype:doc site:gov
Những truy vấn tìm kiếm thú vị khác
Để tìm những site dễ bị tấn công bằng phương pháp Cross-Sites _script_ing (XSS):
allinurl:/_script_s/cart32.exe
allinurl:/CuteNews/show_archives.php
allinurl:/phpinfo.php
Để tìm những site dễ bị tấn công bằng phương pháp SQL Injection:
allinurl:/privmsg.php
allinurl:/privmsg.php
Bảo mật các server hoặc site khỏi sự tấn công của Google
Dưới đây là những phương pháp bảo mật mà các quản trị viên và các chuyên gia bảo mật phải đưa vào tài khoản để bảo mật những thông tin then chốt khỏi rơi vào không đúng chỗ:
- Cài những bản vá bảo mật mới nhất cho các ứng dụng cũng như hệ điều hành chạy trên máy chủ.
- Đừng để những thông tin nhạy cảm và then chốt trên máy chủ mà không có hệ thống xác nhận hợp lệ mà có thể bị truy cập trực tiếp bởi bất kỳ ai trên internet.
- Không cho phép duyệt thư mục trên webserver. Duyệt thư mục chỉ nên được cho phép với các thư mục web bạn muốn cho bất kỳ ai trên internet truy cập.
- Nếu bạn tìm thấy bất kỳ liên kết nào đến server hoặc site giới hạn của bạn trong kết quả của Google search thì nó phải được xóa đi. Vào liên kết sau để biết thêm chi tiết:
http://www.google.com/remove.html
- Không cho phép truy cập dấu tên vào webserver qua internet
vào các thư mục hệ thống giới hạn.
- Cài các công cụ lọc như URLScan cho các máy chủ chạy
IIS như là webserver.
Kết luận
Đôi khi tăng sự phức tạp trong hệ thống tạo ra những sự cố mới. Google trở lên phức tạp hơn có thể được sử dụng bởi bất kỳ anh Tom,
anh Dick & Harry nào đó trên internet để đào bới những thông tin nhạy cảm mà thông thường không thể nhìn thấy hoặc với đến bởi bất kỳ ai.
Người ta không thể ngăn cản ai đó ngừng tạo ra những giả mạo vì vậy những lựa chọn duy nhất còn lại cho những chuyên gia bảo mật và quản trị hệ thống là bảo vệ hệ thống của họ và làm khó khăn hơn từ sự xâm hại không mong muốn.
Về tác giả
Không có nhiều điều để tôi có thể nói về chính tôi. Nói một cách ngắn gọn, Tôi dành hầu hết thời gian để nghiên cứu về sự dễ bị tấn công,
một tách càfê và internet. Đó là tất cả về tôi.
Để biết thêm về tôi xin mời vào www.hackingspirits.com
D
ebasis Mohanty
|
||
|
|
||
Basic Web Guide
Version 2.2
July 4th 2007
Table Of Contents
Introduction
For those of you that have questions after reading this, or before reading this (if they are specific) please do post them. We will gladly help you out. This guide is simply meant to help those who need a little bit of help on the missions, without the use of spoilers.
Remember, when posting a question, please make the thread title specific, and give a good description of your problem. And please please please write in proper English. Its really not that hard. You will get much faster and friendlier answers by doing so. And as always, do tell us what you’ve tried, and what was the outcome of your attempts.
Of course, I am not the expert. Just a local HTS member that spends too much time in these forums. This one especially. For those of you who have read my article on basic missions 1 to 3, this guide is intended to replace it. I prefer posting a thread – and hoping it will get sticky’d – then to release another article. Since I have freedom of BB codes here, and its much easier for replies to be made, and for others to refer to this post. ed note: buz originally pinned this topic in HTSv2 and since then, it has become an integral part of the HTS Basic Web Missions
Common Errors and Problems with Basic Missions
Hackthissite.org has a few problems with the basic missions that should be mentioned beforehand, as it might help solve that question you have.
The first thing you may ask is why do you always have to redo the missions you’ve previously completed every time you log back in. Well the answer is, you don’t. You can easily skip the missions you’ve completed by changing the URL to jump to the last mission you completed. This will not, however, allow you to skip ahead of missions you’ve not yet completed. Doing so will present you with a password box for the current mission you are on, and wont give you the mission details and information you need to complete the mission.
Basic Mission 1
Sometimes the source code doesn’t appear. All you get is an empty notepad page. To resolve this, close notepad and your web browser, and try again. As far as I am aware, this only occurs on mission 1.
Basic Mission 2
In mission 2, instead of displaying an ‘Incorrect password’ warning, all you receive is a blank page. Anytime you see this – in any level – this means the password is incorrect.
Basic Mission 4
When trying to send the email are you getting an error saying that you’re banned due to spamming? This is because the HTS mail server does actually send emails and the script could be tricked to send emails to an arbitrary address (in fact this is what you’re doing). Without this restriction the script would be used to mail bomb someone. The ban will automatically be lifted in 15 minutes or so. Have a short brake. ed note: Paragraph borrowed from Sid
Basic Mission 4/5
For those of you with hotmail.com accounts, for mission 4 and mission 5, you will receive the email in your junk folder. The email is from ‘Sam’ and has a single sentence containing the password. For those with gmail.com accounts, 99% of the time, you will receive an ‘IP/email address banned for flooding’ error. This doesn’t really ban you, so just go back and try a non-gmail account if you have one. I know you have one, seeing as the only way to obtain a gmail account is through invite.
As well, if you have a software firewall, you might experience difficulties with mission 5, receiving “invalid referrer” errors even after you have entered the correct Javascript code. To solve this, disable your firewall temporarily.
Basic Mission 7
The command ‘dir’ should also work however, in this mission, it does not.
If you have any other errors you would like to report, simply PM me and I will check it out.
Before you Begin
Most of HTS’s missions are based on internet hacking. So you don’t need a very profound knowledge of computers. You do need, however, knowledge on internet and networking. Seeing as the internet is just a collection of millions of networks, books about internet and networking go hand in hand.
Before you even attempt mission 1, there are a few things you need to know. The essential being HTML. No you do not need to be an expert in HTML, but you need to know the basics of HTML. For example, some of the codes, how to edit and create HTML documents. And how to view the HTML source code of a webpage.
w3schools.com can provide some good information on HTML, as well as other web related topics.
If your goal is simply to get by the HTS hacking missions, your knowledge need only be as far as internet and networking, as I mentioned above. But the world of hacking extends far beyond the internet. Hacking extends to computers that are not part of the internet, or simply hacking someone’s personal computer. Although at this stage it is more for the purpose of stealing and causing damage, it is none the less, part of hacking. For this you should also have a decent grasp on general computing knowledge, such as hardware and software, operating systems, domains and trusts, policies and permissions, and much more. Again, you don’t have to be an expert, but you would have to become one. I will leave this as is, because I am straying away from the objective of this guide, getting by the basic web hacking missions. For more information about beginning hacking in general, read this article. Ed note: This article was a mini “guide” to starting your hacking career which contained many references to books and web links. This thread was lost when forums.HTS moved and became CS.net
Ok, now onto the missions!
Basic Mission 1
Knowledge required:
- basic HTML
Sam, the network security agent at some random company has created a password for users to access information on the company’s website. This is made to prevent just anyone from accessing the site. Only those who know the password can enter. But Sam is fresh out of tech school and doesn’t have any experience. So he’s made a grave error in the way he handled the implementation of the password.
Basic Mission 1 is called the idiot test. Simply put, if you cannot beat it on your own, don’t worry, I came to the forums looking for help too. Although I knew how to finish the mission, I just wasn’t thinking the right way. This is something you will learn in these missions, its not just what you know, but what you do with that knowledge. Sometimes all you need is a push in the right direction.
If you’ve ever created a webpage on Angelfire or Geocities, then you know how to finish this mission. You just need that “push in the right direction”. If you haven’t, then thats ok. Sam made an error when he created the password feature. We have to find that error. The first place to start looking for would be in his code. Perhaps he left us a clue there.
NOTE: If you still don’t know how to beat this mission, I strongly suggest reading up on some basic computing and basic internet. Books such as those I mentioned in this article. Ed note: This is the same link as previous. To fully understand and enjoy this mission, I suggest you do sign up for a domain at Angelfire or Geocities and experiment with some HTML.
Basic Mission 2
Knowledge required:
- basic HTML
- ability to think logically
Sam has gotten a tad smarter. Experience always comes from experience is what I say. Sam decided to create a text file with the password in it. So that the edit box will read from that file, and match what you typed in to that password stored in the file. There’s only one problem. Sam forgot to upload the file. So then, the edit box will be comparing the password to nothing.
For those seeking a better understanding. Look at this:
(IMG:http://img.photobucket.com/albums/v637/WildCard832/level2.jpg)
One thing I always try and do is submit the password field blank to see what kind of error message it will give.
Basic Mission 3
knowledge required:
- decent amount of HTML
Ok, same concept as basic mission 2. Except this time, Sam remembered to upload the password file. The corporation he’s working for should fire him. Poor Sam. Ok, so we know the edit box will compare what you type to the password file. So this means that the edit box must know the location of the password file. So lets see if we can find out were that is.
Again, a pretty diagram:
(IMG:http://img.photobucket.com/albums/v637/WildCard832/level3.jpg)
Basic Mission 4
knowledge required:
- decent amount of HTML
- directory structure
This time around, Sam decided to make use of a little bit of programming in his attempt to keep hackers at bay. He created a little script that would send himself the password in case he ever forgot it. You see, Sam is the type of guy that goes to the grocery store with a paper list of items to buy since he cant remember what his wife told him before he walked out the door some 20 minutes ago. (Little bit of humour)
So not only is Sam a poor network security technician, but he’s also got a bad memory. I have to wonder how he got hired sometimes.. Lucky for us, Sam left us a nice big (sorry, its not red) button for us to press to send Sam the email to his account.
We can get the password if we hacked into Sam’s email account. So we need to know his username, domain name, and password. A quick look at the source will reveal to us his email address, which contains his username and domain name (username@domainname.com). Now we just need to figure out his password. But there’s a problem. If we hack into his email, he’ll know someone got his password, and we don’t want that. And on top of that, we don’t know his email password. So thats even more trouble. But we like to keep things simple.
Do you have an email account? Hopefully, you answered yes. (If you answered no, you need help) Now, lucky for you Im assuming you know the password to your email account too right? Yes you do.
Need I say more on this? No.
Now as for directory structure, you cannot move the location of a webpage and expect it to still refer to the real pages at the original location. Its like if you made a shortcut to a game, and then changed the location of the original file. The shortcut would no longer work. The real terms for this are called absolute path and relative path. You can easily google those terms for extra help.
Here is an example:
(IMG:http://img.photobucket.com/albums/v637/WildCard832/HTTPchart.jpg)
This part is always so hard to explain yet so simple to understand. The keywords to remember; Absolute path, and relative path.
Basic Mission 5
knowledge required:
- decent amount of HTML
- basic understanding of how information moves around the internet
- basic Javascript
- Javascript Injections
Ok, so Sam has gotten smarter yet again. (And so have you!) He modified his level 4 password script to make it a little more secure. This is why IT technicians get paid the big bucks. To stay one step ahead of hackers. But your job as a hacker, is to find vulnerabilities, learn them, and exploit them. Maybe Sam should get a raise now.
For those who have read my previous article, I list several books which I have read. One of which, is ‘How Computers Work: Millennium Edition’ by Ron White. If you turn to page 342, you’ll see a nice diagram of how network communications work. I have re-created a diagram to explain this for our situation in level 5.
When you send data over the internet (or any form of network, local or otherwise) your computer sends two major pieces of information. The header and the data. The header contains two important values. A “to” value and a “from” value. The “to” value indicates who the information is addressed to. If you wanted to go to Google’s website, the “to” value would be http://www.google.com. The “from” value contains two pieces of information. The first is what computer is sending the information, so in this case, Pilot’s computer, and the second, is the type of web browser, and current URL address of my browser. So if I was on HTS’s webpage, it would be http://hackthissite.org. Just like on a birthday card! To: From:
So our header is launched towards Google’s homepage. From there, Google knows who to send it’s information back to, because of the “from” value in the header. Google’s header would have a “to” value of Pilot’s computer and a “from” value of http://www.google.com.
Ok, so now that we know what a header is, the second part is the data. This is what you are sending. If you typed into your URL address bar Google’s website, then the data would be a request to see the webpage. Google’s data in return would be it’s homepage so that it can be displayed on your browser. Thats how computers communicate over networks, local, and wide.
Back to level 5. What did Sam do to make his level 4 password page more secure? He created what is called a referrer. A simple piece of code in the webpage’s PHP that tells the server that if the webpage comes from a certain address, then it can send the email to whatever address is in the HTML code on the webpage. If the referrer doesn’t match the information in the header, then Sam’s server will return an error message.
(IMG:http://img.photobucket.com/albums/v637/WildCard832/level5.jpg)
In level 4, to change the email address, you had to save the source code onto your computer, thus changing the “from” value in the header. But in level 5, this will result in an ‘invalid referrer’ error. So we need a way to change the contents of the webpage without saving the source to our computer. In comes Javascript. An internet programming language on the client side of a webpage. Client side meaning that it modifies the webpage on your computer. Not on Sam’s server.
So using Javascript, we need to change Sam’s email to our own email. That way, we wont tip off Sam’s referrer because the page is still being executed from the same location, and we’ll be able to receive Sam’s password.
*New* If you want to gain a little more experience with Javascript, I suggest you look over the missions here. (Ed note: This link seems to be down, I will try fix this) If you can manage to get up to mission 10 (I think) then you are good to go. Although you don’t have to, the first few missions will give you a general idea of what Javascript is.
For more information, you can read the Javascript injection article. However I must point out it contains spoilers. It contains the exact Javascript code you must use. Don’t say I didn’t warn you. Here it is.
Basic Mission 6
knowledge required:
- ASCII
- pattern recognition (logic)
Sam is getting smarter and smarter. But so are you. For every wall he builds, you successfully climb over it. Sam has yet again decided to take a new approach to his password protection. Not with HTML, not with Javascript, but with encryption. He created an encoder that would encrypt his password. This way, if he ever forgot the password, all he would need was the encrypted password and he would decode it using his decoder (which we don’t have access to)
However, we did manage to acquire his encrypted password. Even more lucky for us, we found his encryption program too. However, it is not a decoder. It is an encoder. So we cannot simply put in his encrypted password and get his real password. But perhaps there is another way…
For those of you who like math, simply think of this equation: A+2=4. The method used to solve that equation is the same you would use to solve this encryption problem.
Basic Mission 7
knowledge required:
- basic Linux (or *nix Operating System) is optional
- experience using MS-DOS is optional
- UNIX commands
- directory structure
As I said earlier, Sam is a graduate from tech school. While he might still be new to the security scene, he still has some other valuable knowledge. And he has begun to use it. Most of us are running Windows on our computer. On Sam’s server, this is not the case. We don’t know exactly what Operating System he is using, but we know it is a *nix OS and that both Linux and UNIX operate on UNIX commands.
When I say they operate on UNIX commands, think of it like MS-DOS. (Just as extra knowledge, MS-DOS stands for Microsoft Disk Operating System) DOS is the actual Operating System of Windows 3.x, Windows 95/98 and Windows ME. Those Windows are simply Graphical User Interfaces (GUIs) to DOS. Since DOS is not GUI, it isn’t as user friendly as Windows. But those versions of Windows cannot exist without DOS.
Now in DOS you can do magical things. You can copy folders and file from one place to the next, you can view the contents of a directory (AKA folder in Windows terms) you can change directory, and you can format your drive (don’t do that though). You can also do plenty of other things, but that is straying away from the goal of this mission.
In a *nix Operating System (*nix meaning either UNIX or Linux) they have their equivalent to MS-DOS called the console or shell. The console resembles DOS and uses many of the same commands. But it also has some of its own commands that DOS does not recognise, in fact, many.
Now, why is this important to the mission you might ask. Well, simple. If you remember back to level 5, Sam used PHP (PHP Hypertext Pre-processor) to execute a script on the server-side (meaning on his server) and then send out the page to your computer (the client) with a referrer. The referrer was in fact a PHP command that was executed before the page was sent out to you.
In mission 7, Sam again uses PHP. This time, the script launches a query to you. It is asking you to input a year so that it may display a calendar. What is in fact happening is that the page is attaching whatever you enter into the edit box to a UNIX command and sending that back to Sam’s server to be processed. After that, it will return to you with the calendar for the year you entered, in other words, the result or output of that command.
Now this is where having experience with both MS-DOS and Linux (or UNIX) helps. If you have experience in DOS, you understand how this type of problem is handled. If you have Linux or UNIX, you can in fact try out the UNIX command for displaying a calendar.
Here is how the calendar command works.
(IMG:http://img.photobucket.com/albums/v637/WildCard832/level7.jpg)
The command cal can be used with a year value just like you are required to use, or it can be left alone, and then it will return a calendar for the current year and month. There is, however, one problem that Sam didn’t address. The word ‘cal’ is only the first part of the command. What you are typing in the edit box is also part of the command. Meaning you are typing a UNIX command that will be executed on Sam’s server. Aha! Now we know how to exploit mission 7.
Onto the problem. Sam has hidden the file in an ‘obscurely named file saved in this very directory’ to quote the mission statement. What does obscurely mean? Well a quick search of dictionary.com revealed this:
QUOTE
Not readily noticed or seen
So that means Sam didn’t save the password to password.php like he did in level 3. So don’t think you can guess the webpage that the password is located in.
But we also know that the password file is located in missions/basic/7 directory. So we have access to a UNIX console where we can input commands, and we have the directory where the password file is located. And lucky for us, that directory is the current directory. Meaning the directory we are on. So we wont have to change directory. So why don’t we try and find a way to see what is contained inside the missions/basic/7 directory.
Basic Mission 8
knowledge required:
- Server Side Includes (SSI) language
- basic programming knowledge, optional
Sam took a different approach this time. He still put the password on his server. Now, since he was using UNIX last time, it’s safe to assume he hasn’t changed.
The problem now is this. In mission 7, a PHP script was called that would execute a UNIX command on Sam’s computer. The first part of the command was already entered, cal. The second part of the command was the year which you entered. Well, were supposed to enter. But we exploited his script to our advantage by executing our own code.
In mission 8 however, Sam’s PHP script doesn’t execute a UNIX command. In fact, there seems to be no way for Sam to have access to the password himself (I guess HTS forgot about that part) He did, however, upload a PHP script that his daughter wrote. A simple script that inputs your name into a string variable and then counts the numbers of characters and stores that in a integer variable. Then a page is created in a directory called /tmp which stores .shtml files (Scripted HyperText Markup Language) These files use Server Side Includes to change the contents of the page to include your name and the number of characters in your name.
Basic Mission 9
knowledge required:
- Server Side Includes (SSI) language
- ability to think logically
Sam hasn’t learned a thing between mission 8 and mission 9. How did you get the password in mission 8? Well, think. How will you get the password to mission 9?
Although this mission is extremely easy, I feel it is also very important. Even I learned something out of it.
Basic Mission 10
knowledge required:
- Javascript
- what are cookies and how they work
Internet cookies are simple files that a website saves onto your computer when you visit the site. This is so the next time you visit the website, it will remember who you are. The most common example of this is on websites that require a username and password, such as HTS, Myspace, ImageShack, Hotmail (and every other email site). They will store a cookie on your computer so that the next time you visit the site, you don’t have to re-enter your username and password. That is how the little checkbox “remember me?” works.
(IMG:http://img.photobucket.com/albums/v637/WildCard832/level10.jpg)
However, don’t confuse this with Windows’s username and password saving feature. When you type in a new username and password to a website, Windows offers to remember it. This way, when you type the username, it will automatically add the password for you. This is not related to cookies.
Ok, now that we know a little bit about cookies, lets work on the mission. Sam, in his final attempt to keep you out of his site, has turned to using cookies. No more hidden password files to worry about. Unfortunately, Sam’s cookie is not stored permanently on our computer, so we cant go out looking for a file and changing it. So then, how do we change something if there is no file to edit. HTML? Good try, but no. HTML is the source of the webpage. Cookies are not part of the actual webpage. So how do we change the value of the cookie? Javascript you say? Yes!
Remember back in mission 5 how we used Javascript to modify the email value on the webpage so that we could receive the password? We used Javascript. Well, now we need to change the value of a cookie so we can have access to Sam’s site.
In using this method, Sam made it easy for his employers to access the website, and difficult for hackers to get in. Sam’s employers have an ability that Sam doesn’t have. The ability to remember their damn passwords!! So they need only enter it into the password box and then get into the site, skipping the whole cookie process. However, if the password is entered incorrectly, they are sent to another page where a cookie is created so the site remembers they no longer are authorized to the site. Unless they go back and enter the right password.
Onto the objectives. Forget about the password. A hacker always finds the easiest way into something. Just like in mission 4. You chose to have the password sent to your email rather than try and get into Sam’s email account. Now in mission 10 you’ll choose to modify the cookie to accept you rather than try and guess the password.
I will give you one hint however, this is your choice to view it or not. However even if you do view it, it wont give the answer away. This Javascript command could prove useful:
» Click to show Spoiler – click again to hide… «
java script:alert(document.cookie);
ed note: Spoiler tag is now working
Conclusion
I hope this has provided you with that “first step in the right direction” without giving too much away. If you have read this, and still cannot continue, please feel free to post in this forum. We are here to help you. Don’t feel stupid even if the question is “I’ve read the Basic Web Guide and still don’t get level 1″ Trust me, there are others that are in the same situation as yourself.
Now that I have beaten all the missions, mission objectives will be posted soon for the remaining missions (8 and 10). Look out for those.
Happy learning,
Pilot
Table of Contents:
1.) What you will learn.
2.) Introduction.
3.) Basic 1
4.) Basic 2
5.) Basic 3
6.) Basic 4
7.) Basic 5
8.) Basic 6
9.) Basic 7
10.) Basic 8
11.) Basic 9
12.) Basic 10
13.) Description that faith removed because it was too long.
1.) What you will learn.
A.) A better understanding of HTML.
B.) A basic understanding of PHP.
C.) Completion of the basic missions.
D.) Plus more!! (not going to put all of this into detail
).
2.) Introduction.
If you are reading this I just want to say thanks because I am still a new member of this site and I am loving every moment of it. I would also like to state that this is my first tutorial and I would love if you would post comments about it and give me some feedback so I can improve on the next one I might consider making in the future if this one turns out good. So please read carefully and I hope I made it as clear as I can. If you ever have any questions please do not hesitate to PM here on hackthissite.org
. Also please note that this might be a spoiler but I tried my best not to make it one.
3.) Basic 1:
Requirements:
A. Very basic knowledge of HTML
B. ability to READ
Okay as you read this is very simple. It is so simple you are going to smack yourself in the face and be like wtf?!?! To how stupid and easy this is. Okay first thing is first. It does not matter if you’re on firefox or IE your browser will be work on this one. Either right click and click on view source/view page source or click on view and then source/page source. There is actually where some people screw up. You need to look through the HTML coding carefully until you hit a comment tag, go to w3school if you don’t know what that is. Comment tags will not show up as text nor be executed. If you didn’t know what I was talking about- and there should be something there to help you within the source of the page
. Good luck! XD
FEdited out major spoilers ;]
4.) Basic 2:
Requirements:
A. Really nothing is required besides what it says… COMMONSENSE.
When I first tried this I thought there was a catch to it because it seemed way too easy. Well there is no catch XD. Ok please pay a large amount of attention to this quote taking directly from Basic 2 mission. “However, he neglected to upload the password file…” Now read it a few times. This should be enough to get you to realize that he forgot to do something (duh). So try a few things on the password thing with that statement in mind. Okay, so enough said on that I am going to end Basic 2.
FNote: Basically, the script tells the password to compare the password hosted password.
As long as they are the same, it should let you through. Now think, if it’s not uploaded, it’s comparing to null, or nothing…
5.) Basic 3:
Requirements:
A. basic knowledge of HTML if not able to read and understand it
Okay, this one is yet again very easy to figure out. Now from the information they give us about our mission. Sam has the password in a file somewhere on their server. Now that we know that high amount of information this gives us a very distinct clue. We need to know figure out where the password file is. Seeing that you hopefully know the basics of HTML, you must know that the form or the password field has to lead to somewhere or in other words it has a location within the form coding to pin point the location of the password. So just go into the source of the page. Find where the form is and look for the file and your on your own from here
LOL it is kind of simple and common sense.
FNOTE: This goes to what I was saying on the mission above, now it’s checking for the password at the right location, again, our handy commonsense comes into play…
6.) Basic 4:
Requirements:
A. little bit more than basic knowledge of HTML but this is still a little basic. But I recommend reading up on HTML anyway from http://www.w3schools.com, it has helped me out a lot in being a webmaster and coding my own website ![]()
B. I also recommend using Firefox for this one because there is a bug for when you go to send an email to your account instead it will just give you the password. It saves a lot of time.
The first thing I want to say is congrats on completing that last level lol. Okay, now that that is over, time to get back the tutorial. Okay this is getting a bit more into being able to change simple thing in a form within an HTML document. Now yet again go to the source of the HTML document and yet again get to where your mission is. Okay once you find it, there will be two forms. One is for sending the password to your email and the other one is for entering the password. Look at the form that has to do with sending the password to your email. Know copy the first form and paste it into a blank notepad. Now here is where editing is needed. Ok where it says <form action=”/missions/basic/4/level4.php” notice that the form action points to a subdirectory. Now I hope you know that you will have to change this because you do not have any of these files on your computer. So you will have to obviously change this. So how do we get it to link to HTS? Now that you have that done. Change the email to yours, and then save it as an HTML document by just adding the .html at the end of the name of the document and save it to your desktop so it is easier to get to. Now like I said before I recommend you use Firefox due to the bug so you will not have to do more work than you already have to. I think you can finish the rest. It would be kind of pointless to tell you because it would spoil it even more than I already did.
FNOTE: Edit out spoilers, minor typo, random lol and zomgs. And here’s the theory of this mission:
Basically, what you did up there is reproducing a webpage above, and then exploits it. That’s really a big fuss to do for me. That is, if you know (*faith checks for Silent-Shadow* >.>) inline JavaScript. You’d run into it later, this level is extremely simple with inline JavaScript, great article here.
http://www.hackthissite.org/articles/read/405
http://www.hackthissite.org/articles/read/170
*the Silent-Shadow is the admin of our site. Last time I misused the term, she tripped. (Really hard)
7.) Basic 5:
Requirements:
A. some knowledge of Inline Javascript (I will teach you a little bit about it in this section)
FNOTE: oh, wow, just what I was talking about
The first thing you are going to notice about this mission is that it looks a hell of a lot like the last one. It does have similarities but the security is a lot better so now we need to prove to poor Sam that he still needs to work on it. The most difficult part in this one is to get the right Inline Javascript code to put into the URL bar. The following are Inline Javascript you will need for this. The first one: alert. When you use alert in the Inline Javascript, it will then show a small pop up showing you what you wanted.
Ex. 1.) javascript:alert(“Hello World!!”); When you type this, there will be a small pop up on your screen that says Hello World!! Now you can also add things to it like if you want to see the cookie on the page.
Ex 2.) javascript:alert(document.cookie); Now another thing you can do is change things like the cookie by well using Inline Javascript.
Ex 3.) javascript:void(document.cookie=”something new”); This would change the current cookie to something new. You can also do things like that with a form that is embeded into the HTML document.
Ex. 4.) javascript:void(document.forms[number of form you want to change starting from 0].to.value=”what the value is”); Now that you know some of the basic Inline Javascript, try a few things out. I will give you a little hint though, you will have to add two of them together like this: javascript:void(document.cookie=”something new”);alert(document.cookie); So good luck ![]()
FNOTE: Great explaining, used javascript injection about 7 or 8 times there… I had to fix it, so silent doesn’t kill you while you’re asleep. It’s called Inline Javascript. And I’ve fixed your fail at typing “=” when there should be “.”
However, what you didn’t explain was how to change forms.
This is your everyday inline. Javascript:void(document.forms[0].name.value=” “)
Javascript:void(document.forms <- this tells us it’s forms that we’re going to modify
.name <- this is the name of the field surprisingly enough! View source, and if you see name=”cookiejar”. Put cookiejar where name is so it becomes .cookiejar
.value <- this is where the value is, wow~ no tricks to it at all! If it says on the source value=”empty”, and we want it to be full, make change it to be full, so we have .full
After all that, we could have this as our result of our inline javascript to put in the url bar.
Javascript:void(document.forms[0].cookiejar.value=”full “)
Still confused? Pm liuyuan or jump on #help on irc.
8.) Basic 6
Requirements:
A. knowledge of some general cryptography would be helpful according to hackthissite.org but I used a different method
Wow, ha.. Ha.. Sam isn’t as retarded as I thought he was. Well since Sam is really starting to pick up on his coding skills, we will too. So as we look at it you will tend to scratch your head and be like wtf? But this is normal. Once I break it down for you, you will be like OMG, awesome I love you. So here we go!(yes I know lame but w/e) Okay er figured out that his encrypted password is bdd8hgg: so we will have to use this… But what do we do with it. I know know your first thought as it was mine, “Wait!! I will try this as the password.” Then, “Well now that was a complete failure, let’s try the encryption thing good ol’ Sam set up for meh.” Well that isn’t the right answer either. Now the encryption thing he set up was to just confuse the hell out of us. Since the password is encrypted, we will have to do the opposite to it, Decrypt it. (Notice the DE… Key word.) Now the only way to do that is to understand how the encryption works and its pattern. Try using the letter a. Use 8 a’s so you will be able to figure out what you will need for each letter. After that you will notice it becomes abcdefgh. So it is 0, 1, 2, 3, 4, 5, 6, and 7. Now that you know that you will know how to decrypt it. So instead of going forward with the letter u will have to go backwards. But wait, you have!?!?!? Well fortunate for you I am going to give you a big clue that might be a spoiler so I will tell you the hint and I will set the spoiler at the bottom of this section. Well the password is ASCII. Now with that knowledge just look up some information on it and then you should know what you have to do from here.
WARNING: SPOILER BELOW
WARNING: SPOILER BELOW
WARNING: SPOILER BELOW
WARNING: SPOILER BELOW (Fnote: geeze, omg, we get it <.<)
Okay here is the spoiler. This is the link to an image that shows all of the ASCII characters so you will be able to decrypt the encrypted password. http://en.wikipedia.org/wiki/Image:ASCII_full.svg
WARNING: SPOILER ABOVE ^
FNOTE: Fixed minor typo, great explaining, this is called ASCII shifting btw. Great job on this section, I couldn’t have explained it better myself. *gives cookies*
9.) Basic 7
Requirements:
A. very little knowledge of UNIX commands
Okay Sam has been upgrading his equipment and techniques. From what he said the cal command is being operated from UNIX. So that means trouble for us. But once you learn a few commands that you will see here in this section this will be a piece of cake. Now since it is being run from a UNIX server and we have full access to it and are able to put in commands we are able to put in our own commands in order to change the information and hopefully figure out how to get the password. Hackthissite.org was nice enough to give us a HUGE tip in saying the file is in the main directory so we will not have to fool around directory switching. So this makes it so much easier to do!
FNOTE: From this part, I’d have to disagree. Please see my note.
Okay here are a few basic commands you will need for this in no particular order. First off is the command for getting into the main directory. The command is simply / so in the form where you enter the year you want just put / and you can see the directory. Now here is another very useful command that allows you to make your own command over the one that was programmed. The cal command has been programmed so you can’t just put any command in. The command is *spoiler removed* so just type it in the field and you are then able to change the command. Now the final command I am going to tell you is how to view the directory. The / command was not the command to view but to get to it… I think LOL… So if I am wrong please tell me I would appreciate that.
Now the command is *spoiler removed*. So now that you have the proper tools, I will let you handle this on your own. If I tell you what to do it will be a big spoiler. But the rest is practically common sense so have fun and goodluck!!
Okay, interesting theory there, but unfortunately, it’s wrong. *see below*
FNOTE: fixed minor typo, grammar error, repeated “the” for 3 times. Programmed is spelled with double m. =]
Hmm I wouldn’t have agreed without on this one, the years aren’t stored in a directory, this is a perl calculator. It calculates the years and date and everything. Don’t believe me? Save the .pl file, open it with notepad. It should gives you something like print ‘cal $year’; or something similar.
Now, only if we know how to start a new command, there are two ways, now google.
While you’re at it, google the dir command on a unix box.
10.) Basic 8
Requirements:
A. an understanding of SHTML or you can go here: http://httpd.apache.org/docs/1.3/howto/ssi.html
B. ability to copy and paste
Okay now his daughter wants to get involved in his programming. -.- Well we will just have to find the loop hole in here scripting. Okay after we put in our name in the text field, we notice that the page the results come on is an SHTML file. Hmmm… I do not know too much about this. If you are like me I recommend going to http://httpd.apache.org/docs/1.3/howto/ssi.html and reading up on it. After reading that and almost falling asleep I realize that with that bit of information, it shows you how to execute a command within the SHTML text field. Now there is one thing they didn’t show you, it is how to go up a directory. The command for that is .. and I would also like to point out that I was using Firefox for this so the command ‘cd’ or change directory would not work. After I tried it on IE I notice it doesn’t work either. I would also like to remind you like from the previous mission, the server is UNIX so you can’t use the windows command. So use the command *spoiler removed* to show the directory. But I will give you a hint. Unlike the other mission, you can’t just type the commands you need to enter a piece of coding that you find at http://httpd.apache.org/docs/1.3/howto/ssi.html which I have been pointing to this whole section of the tutorial… So yea, good luck lol!!
FNOTE: fixed the usual stuff.
Alright, SSI is a technology that allows execution of server-side commands on the processing of files… Hmm…
<!–#command attribute=”value”–>
That’s enough hints, remind you about directory transversal tho.
. current directory
.. go back a directory
11.) Basic 9
Requirements:
A. basic knowledge of UNIX commands
B. bit of understanding of SHTML
Okay as you notice this missions talks about the last mission. This gives you a bigger hint than you think. It actually says that Sam screwed up. It says that you can get to the level 9’s password in the /var/www/hackthissite.org/html/missions/basic/9 directory. But we cannot access this in level 9. We will have to go back to Basic 8 in order to complete this level. So once your there use some of the information you have gained from the last mission to type in the command to get to the directory. But what you must know is how to change directory. But this time you are going to have to go down a directory. But it will actually be two because you are on the /basic/8/tmp/ directory. What you want is to get to the /basic/9/ directory. Now this is where a lot of people get confused over. The command for going back a directory is ../ So if it requires two you will have to use two of those, because you’re really going up two directories. What really messes people up about this is there no space between the two commands. Please remember that you also have to point the command to the proper directory or the correct level so it can work. If you don’t you will get an error. So I have given you either enough information or too much and some of the more experienced people might get pissed at me for revealing too much information LOL so good luck!!
FNOTE: Hmm, great guide. You did reveal too much information, but you explained it over, so great job. (Also added minor explaining)
12.) Basic 10
Requirements:
A. some Inline Javascript knowledge needed
B. yet again more common sense
Wow Sam is going to get a promotion soon if he keeps this up. But knowing that we were able to do that last 9, I think we can do this one. To tell you the truth I think this is the easiest um hard mission there is lol. Okay now the first thing you are going to notice there isn’t much directions given. Or any at all. So if you were paying attention and read the description of the mission before trying it you would have noticed that it said something about Javascript and cookies. Now this is actually a big clue. This means that the access is enabled by cookies. This is how you view a cookie using Javascript by simply typing it into your URL bar. javascript:alert(document.cookie); This simple and basic javascript code is how to view the cookie being used. Now this simple code is very important in figuring out how to do this. You will also need to know one more type of code. This one will change the cookie. javascript:void(document.cookie=”variable=value”); You will need this in order to complete your mission. Now the last thing I am going to tell is what I thought of trying. I am not sure if it actually works even thought I did it, but what I tried is using the alert code before trying to put in the password. Then after without actually putting a password, just click “submit” and then do the alert again to see if there was a change. Then after change accordingly in order to pass this mission. That is all I am tell you for this one. This should be enough information for you in order to complete this level.
Fnote: roflmao, again, inline javascript. Just remember tho, you must try to access page once, in order to get the cookie. So click on submit once, it’d tell you “you’re not 1337 enough to access”
Great article again: http://www.hackthissite.org/articles/read/405
I would just like to say thank you for reading my noob friendly tutorial for 1-10 basic missions for www.hackthissite.org and please comment this and give feedback via here on this article, PM me on msn, or send me a comment on my profile. I would like to say that I am deeply sorry if I let out too much information but this will also help the new people who are not quite use to this. I have never given the answer well practically but I have just guided them. So thank you again for reading this and I hope I helped out some noobs
lol. PLEASE COMMENT!!
(might make more articles in the future so keep a look out!!)
~ sk8terboi43
I am still a noob but I have been able to complete all basic stages of the site. And now that I know how to do everything, (in basic
) I will break everything down to step by step instructions and make everything a bit easier to understand. This is my first article so please give me feedback. so PM for comments and well go to my page and give me feedback
thanks!
P.S. I had to edit this thanks to magikstik. Thanks man for pointing out the major bug in my tutorial
* Đăng kí 1 nick ở hackthissite.org . login và vào phần challenges/ basic missions /
basic 1
* Nó bắt bạn điền mật khẩu phải ko. làm thế nào bi giờ? Bạn có biết đằng sau những hình ảnh, chữ, ô text box kia là cái gì ko. Đó là những đoạn code. Trình duyệt biến những đoạn code mà ta viết thành hình ảnh, văn bản… Vậy làm thế nào để xem code của nó. Trong IE bạn hãy vào view source. Với IE 7 thì là page/view source. Với firefox là ctr+ U.
* Hãy tìm hiểu sơ qua về cấu trúc và sự hoạt động của html. Hãy đọc mã và bạn sẽ pass level1 một cách dễ dàng.
basic 2
“Sam has gotten a tad smarter. Experience always comes from experience is what I say. Sam decided to create a text file with the password in it. So that the edit box will read from that file, and match what you typed in to that password stored in the file. There’s only one problem. Sam forgot to upload the file. So then, the edit box will be comparing the password to nothing.”
Ông sam lần này ko để pass hớ hênh như ở lv1 nữa.Ổng nghĩ ra cách là tạo 1 file text và ghi pass vào đó. Những gì bạn nhập vào sẽ bị so sánh với pass đc lưu trữ trong file. Nhưng có một vấn đề…ông ta quên upload file đó lên host
basic 3
Lần này sam đã nhớ và upload file password lên mạng.trường hợp này có file chứa pass để cho cái script đó so sánh.Vậy phải chỉ ra file đó nằm ở đâu cho cái script kia biết chứ, phải ko? Hãy đọc mã nguồn và tìm xem.
basic4
Chắc chúng ta cũng đã từng nghe nhắc đến google hoặc có thể bạn đã từng làm việc với google .Google là một search engine (tạm dịch là cơ chế tìm kiếm) rất mạnh . Với Google,bạn có thể tìm được hầu hết những thứ bạn cần . “©2005 Google – Searching 6,083,324,652 web pages” as of Sunday, February 16, 2003”,hơn 6 tỷ trang web đã được Google viếng thăm,một con số đáng quan tâm đúng không ?
Google được xem như máy chủ tìm kiếm lớn nhất và hiệu quả nhất hiện nay,nếu làm chủ được Google thì quả thật là tuyệt vời .Thay vì đãi cát tìm vàng giữa hàng tấn thông tin trên iNet,bạn chỉ tốn vài phút là có thể tìm được tất cả những gì bạn thích trong khi đó nếu không có Google,bạn sẽ tốn hàng ngày,thậm chí cả tuần để làm công việc nhàm chán này .
1.Google căn bản :
Để sử dụng Google,máy tính của bạn chỉ cần một trình duyệt căn bản (Internet Explorer,Netscape,…) và một kết nối Internet .Hãy gõ vào thanh Address dòng www.google.com.vn và bắt đầu khám phá .
Đầu tiên bạn xác định từ khóa của thông tin muốn tìm kiếm,đây là một bước rất quan trọng,từ khóa thể hiện chủ đề của nguồn thông tin .Một điều cần chú ý đó là đôi khi kết quả trả về quá nhiều ,bạn chỉ cần quan tâm đến 20-30 results đầu tiên thôi .
Mặc định google có chứa tóan tử “AND”,nghĩa là nếu bạn không thay đổi từ khóa thì google sẽ tìm kiếm và đánh đấu tất cả những trang chứa từ khóa sau đó trả về trang kết quả .
Ví dụ : nhập chuỗi Java ebook ,trang kết quả sẽ trả về tất cả những trang chứa chuỗi Java và ebook ,ví dụ như “java programming ebook” hay “Java certificate ebook”,nghĩa là tất cả những trang chứa đồng thời chữ Java và ebook .
Thế nhưng bây giờ yêu cầu của bạn có thay đổi một chút,bạn muốn kết quả trả về chứa một trong hai từ khóa Java hoặc ebook ? Rất may là Google có tóan tử OR ,bạn nhập và form dòng Java OR ebook ,google sẽ tìm kiếm tất cả những trang chứa một trong hai ký tự trong chuỗi từ khóa thôi .
Trở về với ví dụ đầu tiên .Giả sử như tôi muốn tìm tất cả những trang chứa cả hai ký tự Java ebook liên tục nhau thì sao nhỉ . Đơn giản là bạn sử dụng dấu “+” : nhập chuỗi Java+ebook và form tìm kiếm,thế là xong .
Tip : để kết quả thật sự chính xác,bạn nên dùng dấu “ “ quanh từ khóa,ví dụ “ebook java”,đây là một cách tìm kiếm rất hiệu quả,bạn có thể dễ dàng “khống chế” được độ chính xác của kết quả trả về .
2.Tìm kiếm nâng cao :
In_title_ : tìm kiếm dựa theo _title_s của trang web .Trở về với ví dụ trước ,tôi muốn kiếm một ít sách về java ,tôi gõ vào google dòng in_title_:“Java ebook” ,kết quả sẽ khả quan hơn bước trên rất nhiều .Nên lưu ý rằng _title_s luôn phản ánh nội dung của trang web .Vì vậy search với function _title_ sẽ hiệu quả hơn rất nhiều so với cách search keyword đơn giản .Theo mặc định google sẽ đánh giá nội dung trang web,do đó nếu tìm theo _title_s thông tin sẽ không cô đọng hơn .
Inurl : hạn chế kết quả tìm kiếm trong urls . Ví dụ bạn nhập dòng inurl:java world thì kết quả trả về là www.javaworld.com .Đây là một function bạn nên dùng nếu bạn nhớ “mang máng” một url nào đó và muốn tìm lại .
Inanchor : tìm kiếm dựa vào phần text chứa liên kết .Vdu bạn nhập vào inanchor : O’Reilly and Associates thì kết quả sẽ tham chiếu đến O’Reilly and Associates
Filetype : tìm kiếm theo tên mở rộng file, ở ví dụ đầu tiên tôi muốn tìm kiếm một vài ebook java .Bây giờ để hiệu quả hơn tôi sẽ chỉ ra phần mở rộng của tập tin .Nhập vào google chuỗi sau : Java ebook filetype:chm (chm là chuẩn file help của microsoft và thường được dùng để làm ebook do tính tiện lợi của nó) hoặc java ebook filetype
df (pdf là chuẩn file của ebook cũng được dùng làm ebook) .Nice,tôi đã có được thứ cần tìm rồi đó .
Cache : xem thông tin của trang web chứa trong cache của google .Đây là một tính năng rất hay của google,mặc dù trang web bạn muốn xem không còn hiện hữu trên Internet nữa nhưng google vẫn lưu lại rất nhiều thông tin bên trong cache .Biết đâu bạn có thể tìm được nhiều thông tin cần thiết bằng cách này thì sao ?
cache:www.yahoo.com
Trên đây là một số function hay dùng của googles,google còn có một số function nữa nhưng tôi nghĩ nếu làm tốt thì bây nhiều là đủ rồi .
Trick :
Directory Indexing – truy cập cấp thư mục
Bạn muốn truy cập vào các directory trên web để download thay vì một vài file mà là cả một tá files. Nếu muốn truy cập các thư mục chứa nhạc thì nhập vào chuỗi sau in_title_:”index of” music,còn muốn truy cập các thư mục chứa ebook thì nhập in_title_:”index of” ebook ,một list các _link_ sẽ hiện ra,công việc còn lại là tìm xem có thứ mình cần hay không .Đây là cách rất hay bởi vì người ta thường đặt các file trong một thư mục và dấu chúng đi bằng file index.html (hay là một trang nào đó),cách này sẽ by pass và get tất cả những file chứa trong thư mục !
Lời khuyên cuối cùng dành cho bạn đó là hãy sử dụng các từ khóa,function và tóan tử một cách linh động .Kinh nghiệm sẽ giúp bạn tìm được 99% những gì bạn cần trên internet .Chúc vui .
tài liệu tham khảo : irc.dev-zone.com , google hacks and some tricks on the internet .
PHẦN 2:
Có lẽ mục đích duy nhất của bạn khi sử dụng công cụ tìm kiếm là muốn thấy kết quả càng chính xác càng tốt, nhưng đôi khi những gì mà bạn có được không đúng như mong muốn vì kết quả chứa quá nhiều thông tin tạp, thậm chí không liên quan gì tới chủ đề bạn cần tìm kiếm. Trong trường hợp này, sử dụng vài thuật toán tìm kiếm có thể giúp ích cho bạn rất nhiều.
* Lệnh tìm kiếm thông tin phục vụ cho mục đích nhất định
- Cấu trúc: “mục đích” text “nội dung”
- Ví dụ: vulnerabilities text yahoo (tìm kiếm danh sách, chi tiết về những lỗ hổng bảo mật bằng công cụ tìm kiếm Yahoo).
* Lệnh tháo gỡ rắc rối về một chủ đề
- Cấu trúc: “mục đích” help “nội dung”
- Ví dụ: vulnerabilities help yahoo
* Lệnh tìm kiếm những thông tin mới nhất
- Cấu trúc: What’s news
* Lệnh tìm kiếm đối với các cụm từ nhất định
- Cấu trúc: “+” search
- Vì Google có xu hướng bỏ qua một số từ hoặc kí tự thông dụng như: “where” và “how”, các con số đơn và chữ cái, nên nếu trong từ khoá của bạn những từ này, bạn cần phải cho thêm dấu “+” vào trước (nhớ là có khoảng trắng trước dấu “+”).
- Ví dụ: Bạn cần tìm kiếm bộ film Star Wars tập 1, thay vì bạn gõ cả cụm từ Star Wars Episode I vào ô tìm kiếm, bạn cần chia từ khoá này thành 2 phần vì nó có chứa con số (số 1):
* Lệnh loại trừ
- Cấu trúc: “-” search
Trong nhiều trường hợp, từ khoá của bạn có thể khiến công cụ tìm kiếm cho ra nhiều kết quả không mong muốn, chính vì vậy bạn cần phải bổ xung dấu “-” (loại trừ trước những khái niệm bạn không muốn hiển thị.
- Ví dụ: từ “bass” trong tiếng Anh có 2 nghĩa, vừa chỉ tên một loại cá, vừa có liên quan tới âm nhạc. Nếu bạn chỉ muốn tìm kiếm nghĩa “cá” của từ này mà không quan tâm tới nghĩa “âm nhạc”, bạn cần phải cho thêm dấu “-” vào trước từ “music”:
* Tìm từ đồng nghĩa
- Cấu trúc: ” ~” Searches
Bạn không chỉ muốn tìm kiếm một từ khoá đặc biệt mà còn muốn tìm từ đồng nghĩa của nó? Hãy đặt dấu “~” vào trước chúng:
* Lệnh gộp
- Cấu trúc: * “OR” Searches
- Google hỗ trợ cả thuật toán “OR”, nên bạn muốn hiển thị cả nghĩa A và B, bạn cần bổ sung thêm từ “OR” ở giữa.
* Tìm kiếm theo cụm từ
- Bạn hãy đặt cụm từ tìm kiếm trong dấu “” để có được kết quả chính xác hơn. Kỹ thuật này đặc biệt có ích khi bạn tìm kiếm một câu nói hoặc một câu thành ngữ nổi tiếng.
* Tìm kiếm tên miền (domain) riêng biệt
Nếu bạn chỉ biết tới tên website truy nhập mà không chắc thông tin cần tìm được đặt ở vị trí nào trong website đó, bạn có thể sử dụng Google để chỉ tìm kiếm tên miền đó.
Chẳng hạn bạn muốn tìm kiếm domain quản trị của website Trường Đại học StanfordUniversity:
Theo VnMedia
Bình luận mới