Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The following HTML/PHP text is given: The PHP text at start ensures that the message inserted at text area message is appended to an XML

The following HTML/PHP text is given:image text in transcribed

The PHP text at start ensures that the message inserted at text area "message" is appended to an XML file "guestbook.xml". Thus, step by step the following type of an XML file is created at server side:

The PHP text in the middle ensures that the messages inserted by the users so far, are displayed to the current user. The goal is the presentation of a guestbook to the current user. The "echo" statements create the static part of the Web site.

image text in transcribed

To illustrate what happens: If "guestbook.xml" looks as shown above, the following Web site will be created image text in transcribed

As you can see, no measures for the defence against cross side scripting are taken

Task 2a) Which goals do attackers pursue with Cross-Site Scripting?

Task 2a) What do you need to type into the text area "message", to achieve, that the headline is "hallo" instead of "Guests"?

Task 2b) What do you need to type into the text area "message", to achieve, that all the guest's opinions so far change to "Bad!"?

load ("gaestebuch. xml") topElement -$obj DOM->getElementsByTagName ("buch")->item (0) Smessage-$ REQUEST ['message' message node?obj DOM->createElement ("message") $topElement->appendChild (Smessage_node) ?message text node?objDOM->createTextNode (?message) ?message_node->appendChild (Smessage_text_node); ?obj DOM->save("gaestebuch. xml") echo 'Guests/>'; echo '

Opinion of the guests:

?messagelist$obj DOM->getElementsByTagName ("message"); if (Smessage_list->length 0) for (S1-0; $? length; $1++) { echo $i.":" $msg-node = Sme s sage-list->item ($i); echo "p>".Smsg node->childNodes-item (0)->data."I echo echo echo echo '
'?textarea name="message" cols="140" rows="20">'; 'input type="submit" value-"Abschicken"/>'; /form>" ?s

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Strategic Database Technology Management For The Year 2000

Authors: Alan Simon

1st Edition

155860264X, 978-1558602649

More Books

Students also viewed these Databases questions

Question

1. What are the major sources of stress in your life?

Answered: 1 week ago