Thursday, April 05, 2007

The Cross Site Scripting (XSS) FAQ

Introduction


Websites today are more complex than ever, containing a lot of dynamic content making the experience for the user more enjoyable. Dynamic content is achieved through the use of web applications which can deliver different output to a user depending on their settings and needs. Dynamic websites suffer from a threat that static websites don't, called "Cross Site Scripting" (or XSS dubbed by other security professionals). Currently small informational tidbits about Cross Site Scripting holes exist but none really explain them to an average person or administrator. This FAQ was written to provide a better understanding of this emerging threat, and to give guidance on detection and prevention.


"What is Cross Site Scripting?"


Cross site scripting (also known as XSS) occurs when a web application gathers malicious data from a user. The data is usually gathered in the form of a hyperlink which contains malicious content within it. The user will most likely click on this link from another website, instant message, or simply just reading a web board or email message. Usually the attacker will encode the malicious portion of the link to the site in HEX (or other encoding methods) so the request is less suspicious looking to the user when clicked on. After the data is collected by the web application, it creates an output page for the user containing the malicious data that was originally sent to it, but in a manner to make it appear as valid content from the website. Many popular guestbook and forum programs allow users to submit posts with html and javascript embedded in them. If for example I was logged in as "john" and read a message by "joe" that contained malicious javascript in it, then it may be possible for "joe" to hijack my session just by reading his bulletin board post. Further details on how attacks like this are accomplished via "cookie theft" are explained in detail below.

Read more

Monday, September 25, 2006

Ajax...

"Ajax is not a technology in itself, but a term that refers to the use of a group of technologies together"

(Wikipedia)


Ajax is

• Short for Asynchronous JavaScript And XML
• New approach to use a number of existing technologies together :
–XHTML & CSS (standard presentation display)
–Document Object Model (DOM) (dynamic display & interaction)
–XML & XSLT (data interchange & manipulation)
–xmlHTTPRequest (asynchronous data retrieval)
–Javascript (to put together all the above)



How Ajax is Different?

"An Ajax application eliminates the start-stop-start-stop nature of interaction on the Web by introducing an intermediary — an Ajax engine — between the user and the server. It seems like adding a layer to the application would make it less responsive, but the opposite is true."


"The biggest challenges in creating Ajax applications are not technical. The core Ajax technologies are mature, stable, and well understood. Instead, the challenges are for the designers of these applications: to forget what we think we know about the limitations of the Web, and begin to imagine a wider, richer range of possibilities."
(Jesse James)

Monday, September 11, 2006

Send email through PHP script

Currently, I learnt to send email just using php script. It made me reliazed that PHP is very powerful server side language.

Below is an example that using php script to send email... Enjoy it!

$to = 'scleong@gmail.com';
$subject = 'Red alert!';
$message = 'yo, whassup?';
$headers = "From: admin@pknpk.gov.my\r\n" .
'X-Mailer: PHP/' . phpversion() . "\r\n" .
"MIME-Version: 1.0\r\n" .
"Content-Type: text/html; charset=utf-8\r\n" .
"Content-Transfer-Encoding: 8bit\r\n\r\n";
// Send
$is_send = mail($to, $subject, $message, $headers);
if ($is_send)
echo "email have been sent to $to successfully";
else
echo "Failed to send the E-mail.";

Thursday, August 24, 2006

The Opening of Web Cafe

I welcome you all to visit my Web Cafe. Hopefully you enjoy it.

Thanks.