Lưu trữ

Archive for Tháng Ba, 2008

Đáp án các bài tập trong The C programming language

Tháng Ba 26, 2008 vuau 1 comment

Answer to Exercise 1-1, page 8

Run the “hello, world” program on your system. Experiment with leaving out parts of the program, to see what error messages you get.

Murphy’s Law dictates that there is no single correct answer to the very first exercise in the book. Oh well. Here’s a “hello world” program:

#include <stdio.h>

int main(void)
{
  printf("hello, world\n");
  return 0;
} Read more...
Categories: lập trình

Hướng dẫn leech file từ Rapidshare sang 1 host khác

Tháng Ba 18, 2008 vuau 1 comment

Giới thiệu

Biến máy tính thành host rùi leech file RS,MU về

Hiện giờ theo mình biết để down ở RS,MU… mà không cần tài khoản premium thì cần phải tìm một host tốt để up cái bộ source này lên host đó rồi leech file từ RS,MU về host đó, sau đó mình mới tải nhanh về máy mình được. Host mua thì ko nói rồi, nếu dùng host free thì có khi nó ko hỗ trợ bộ nguồn này, có khi hỗ trợ thì khi down gặp thông báo :”cannot connect to rapidshare.com at port 80″. Tại sao chúng ta ko tự tạo ra một host ngay trên máy của ta, rồi leech file về host này. Read more…
Categories: kinh nghiệm

HBH Basic Web 6: PHP Unix Command Processor

Tháng Ba 12, 2008 vuau 1 comment

Basic web hacking mission 6 in Hellbound Hackers is very situational:

My friend Drake has found this new way on how to execute Unix Commands from a simple php file, but he was testing the security and the logs recorded his activities and reported it to the FBI and it chmod the file logs.txt, now the only chance for him to be safe is that you chmod the file to all+execute and delete that file and the other file that tracks people. Mr. Deitry also said the command to do all these action needs a $ in the begining

This challenge is extremely obscure and confusing. I wasn’t able to do it before reading a spoiler-pumped article by system_meltdown on Hellbound Hackers about this mission. Therefore, I am going to give the solution away.

We need to chmod a file. What file? logs.txt. Where is logs.txt? No idea! Fotunately, system_meltdown’s article reveals that it is in this very directory, in the sub-directory logs/.

The first part-mission is to chmod the log file. chmod is a UNIX command that is used to change the permissions of a file. Remember that the mysterious Mr. Deitry told us that we for some reason need to put a dollar sign ($) in front of the commands.

$ chmod a+x logs/logs.txt

The a+x part stands for “all + execute”, which will allow everyone to execute the file. Now, we will remove it with the rm command.

$ rm logs/logs.txt

Now, we only have to delete the file that tracks our presence. Don’t ask me how we’re supposed to find the filename out — I had to read the article. Apparently, it is logs/track_logs.php.

$ rm logs/track_logs.php

Therefore, the three commands that should be used are the following:

$ chmod a+x logs/logs.txt
$ rm logs/logs.txt
$ rm logs/track_logs.php

Mission accomplished.

Categories: hackgame

HBH Basic Web 5: Beat Asterix-Protect

Tháng Ba 12, 2008 vuau Phản hồi đã bị khóa

In basic web mission 5 on Hellbound Hackers, a (fictional) new project, called Asterix-Protect, is implemented: [sic]

Welcome to Asterix-Protect

Asterix-Protect is an email search system that uses this new type of Asterix database to match your search and uses the same type of form like a login. And Asterix-Protect its a login system which also uses this advanced type Asterix database to match your username:password, this is a project that just started… If something is wrong or you have found a bug in our product, please contact us at problems@Asterix-Protect.org.

This means that you will have to find out someone’s username and password and log in. From the mission text, you see that the username is the email adress, and the username and password are separated with a colon (:). As always, begin with checking the source code. You will discover a very revealing comment:

<!--attention admin: * is a wildcard -->

The asterisk (*) can be used as a wildcard. Hackers have always been fond of puns, and that’s probably what the Asterix-Protect system got its name from. Try logging in with an auto-matched email-adress and an automatically matched password using the asterisk wildcards:

*@*:*

Mission accomplished.

Categories: Uncategorized

HBH Basic Web 3: Switch User Agent

Tháng Ba 12, 2008 vuau 1 comment

In Basic Web Hacking mission 3, there is a problem which is quite difficult to overcome unless you’ve read about it before and know what it is about.

Now, Drake learned how to make http user agents with php.
Wrong user_agent, bwh3_user_agent wasn’t found

From the mission description, you can discern that Drake uses PHP, a server-side scripting language, to check what your user agent is. The user agent is the browser that you are currently using. In your case, your user agent is: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12 (this value was produced with the PHP variable $_SERVER['HTTP_USER_AGENT']). Changing your user agent is trivial, if you have the right tools, that is. I recommend using Firefox, which is faster and more secure than Internet Explorer.


<!–
google_ad_client = “pub-2303908469917611″;google_ad_width = 468;google_ad_height = 60;google_ad_format = “468×60_as_rimg”;google_cpa_choice = “CAAQ9eOTlwIaCN2K1NgLkVQQKNO193M”;google_ad_channel = “3690139778″;
//–>

When you have downloaded Firefox, you can use the extension called User Agent Switcher to spoof the data that the web brower is sending and make the server think that you are using another user agent. In this case, we understand from the error message given in the mission (Wrong user_agent, bwh3_user_agent wasn’t found) that a user_agent called bwh3_user_agent (Basic Web Hacking 3 user_agent) is required.

To accomplish this, just open User Agent Switcher and create another user_agent with the browser name “bwh3_user_agent” and refresh the page. If it doesn’t work, try refreshing this page to see what your new user agent’s name is.

Categories: hackgame

HBH Basic Web 2: Simple HTML

Tháng Ba 12, 2008 vuau Phản hồi đã bị khóa

“My friend Drake has begin to program in HTML and he made this IFRAME, but the host of the website has kicked him out, and he doesnt remeber where is this IFRAME reading it from.”

Despite the crude English, I managed to read that basic web hacking mission 2 is about getting the URL of the IFRAME on the page. An IFRAME is an HTML element for viewing one page inside another one (never iframe a page in itself!). You’ve just got to view the source code and search for the text “iframe”:

<IFRAME border='0' height='250' width='500' align='center' name='content' src='../basic1/b2/index.php' frameBorder='0' scrolling='yes'></IFRAME>

The page that is viewed in the IFRAME is the content of the src (source) attribute of the IFRAME element. In this case, it is:

../basic1/b2/index.php

Which also is the password for this level. Note that you must use the local path and not the absolute.

Categories: hackgame

HBH Basic Web 1: Source Clue

Tháng Ba 12, 2008 vuau Phản hồi đã bị khóa

I just found out about Hellbound Hackers, an eductational hacking website which is supposed to legally simulate a realistic hacking environment, just like Hack This Site. The first challenge is, as expected, very simple. Just take a look at the source code. In the source to my challenge, I found an HTML comment that looked like this:

<!-- it has four legs and most of the time its called 'man's best friend'-->

Apparently, this mission exists just to check whether the user is capable of viewing the source code. It’s probably a riddle in order to prohibit social freaks that never talk to people from further endangering their species.

Of course, the answer and password was “dog

Categories: hackgame

hướng dẫn toàn tập

Tháng Ba 12, 2008 vuau 1 comment

http://timjoh.com/archive/guides

Categories: hackgame

thử xem nào

Tháng Ba 11, 2008 vuau Phản hồi đã bị khóa

HTML <table> tag


Definition and Usage

The <table> tag defines a table. Inside a <table> tag you can put table headers, table rows, table cells, and other tables.


Differences Between HTML and XHTML

The “align” and “bgcolor” attributes of the table element were deprecated in HTML 4.01.

The “align” and “bgcolor” attributes of the table element are not supported in XHTML 1.0 Strict DTD.


Example

Source Output
<table border = “1″>
<tr>
<td>Cell A</td>
<td>Cell B</td>
</tr>
</table>
Cell A Cell B

Optional Attributes

DTD indicates in which DTD the attribute is allowed. S=Strict, T=Transitional, and F=Frameset.

Attribute Value Description DTD
align left
center
right
Aligns the table. Deprecated. Use styles instead. TF
bgcolor rgb(x,x,x)
#xxxxxx
colorname
Specifies the background color of the table. Deprecated. Use styles instead. TF
border pixels Specifies the border width.Tip: Set border=”0″ to display tables with no borders! STF
cellpadding pixels
%
Specifies the space between the cell walls and contents STF
cellspacing pixels
%
Specifies the space between cells STF
frame void
above
below
hsides
lhs
rhs
vsides
box
border
Specifies which sides of the border surrounding a table will be visible Note: The “border” attribute can be used in conjunction with the “frame” attribute to specify the width of the border! STF
rules none
groups
rows
cols
all
Specifies the horizontal/vertical divider lines.Note: Must be used in conjunction with the “border” attribute! STF
summary text Specifies a summary of the table for speech-synthesizing/non-visual browsers STF
width %
pixels
Specifies the width of the table STF

Standard Attributes

id, class, title, style, dir, lang, xml:lang

For a full description, go to Standard Attributes.

Event Attributes

onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

For a full description, go to Event Attributes.


Try-It-Yourself Demos

Tables
How to create tables in an HTML document.

Table borders
Different table borders.

Table with no borders
A table with no borders.

Headings in a table
How to display table headers.

Empty cells
How to use “&nbsp;” to handle cells that have no content.

Table with a caption
A table with a caption.

Table cells that span more than one row/column
How to define table cells that span more than one row or one column.

Tags inside a table
How to display elements inside other elements.

Cell padding
How to use cellpadding to create more white space between the cell content and its borders.

Cell spacing
How to use cellspacing to increase the distance between the cells.

Add a background color or a background image to a table
How to add a background to a table.

Add a background color or a background image to a table cell
How to add a background to one or more table cells.

Align the content in a table cell
How to use the “align” attribute to align the content of cells.

The frame attribute

Categories: Uncategorized