WEBVTT

0:00:03.760000 --> 0:00:06.220000
 Hello everyone and welcome.

0:00:06.220000 --> 0:00:11.000000
 In this section of the course we're going
 to be taking a look at XML attacks.

0:00:11.000000 --> 0:00:15.380000
 Now it goes without saying that before
 we actually take a look at how

0:00:15.380000 --> 0:00:20.740000
 to perform a specific attack or target
 a specific vulnerability, we need

0:00:20.740000 --> 0:00:25.920000
 to be introduced to the underlying technology
 or language if that makes

0:00:25.920000 --> 0:00:31.680000
 sense. So if we're taking a look at
 XML attacks, it goes without saying

0:00:31.680000 --> 0:00:37.020000
 that we need to get an introduction
 to XML and nothing too deep, just

0:00:37.020000 --> 0:00:41.480000
 an understanding of what it is, how
 it works and how it's implemented

0:00:41.480000 --> 0:00:46.680000
 in web applications which will give
 you an idea as to how to identify

0:00:46.680000 --> 0:00:50.900000
 the presence of XML which again as
 most of you already know is fairly

0:00:50.900000 --> 0:00:55.840000
 simple but I think this is quite important
 to understand exactly what

0:00:55.840000 --> 0:01:03.540000
 standard XML injection attacks are about
 as well as XML external entities

0:01:03.540000 --> 0:01:05.620000
 and how that works.

0:01:05.620000 --> 0:01:14.120000
 So what is XML if you've never heard of XML
 which I doubt, XML is an abbreviation

0:01:14.120000 --> 0:01:16.980000
 for the extensible markup language.

0:01:16.980000 --> 0:01:20.620000
 As the name suggests, it is a markup
 language that is used to structure,

0:01:20.620000 --> 0:01:26.980000
 store and transport data in a readable
 and platform independent format.

0:01:26.980000 --> 0:01:31.600000
 So it essentially defines a set of rules
 for encoding documents in a format

0:01:31.600000 --> 0:01:37.000000
 that is both human readable and more
 importantly machine readable.

0:01:37.000000 --> 0:01:41.280000
 And XML plays an important role in many
 different IT systems and is often

0:01:41.280000 --> 0:01:46.480000
 used for distributing or communicating data
 over the internet in a standardized

0:01:46.480000 --> 0:01:49.440000
 format, if that makes sense.

0:01:49.440000 --> 0:01:55.820000
 And the idea is to have it, you know,
 is to have a format or format data

0:01:55.820000 --> 0:02:01.360000
 in a way that can be read by humans
 but also processed or interpreted

0:02:01.360000 --> 0:02:04.480000
 by computers or various systems.

0:02:04.480000 --> 0:02:10.120000
 Now despite the arrival of newer quote
 data structure formats like Yamo

0:02:10.120000 --> 0:02:16.460000
 and JSON, XML remains both alive and
 of course prevalent as an alternative

0:02:16.460000 --> 0:02:19.380000
 for exchanging data over the internet.

0:02:19.380000 --> 0:02:23.460000
 So nowadays, you know, in newer web
 applications you have Yamo, JSON,

0:02:23.460000 --> 0:02:29.000000
 etc. Of course, JSON is, you know, will
 play a huge role in some of the

0:02:29.000000 --> 0:02:32.760000
 other courses but we're not really
 looking at that right now.

0:02:32.760000 --> 0:02:37.940000
 XML is still there and it's very important
 that as a pen tester, you actually

0:02:37.940000 --> 0:02:44.680000
 understand what XML is, how it's used
 and more importantly what types

0:02:44.680000 --> 0:02:49.300000
 of vulnerabilities it actually introduces
 or, you know, is vulnerable

0:02:49.300000 --> 0:02:55.100000
 to so sort of building on what I've just
 said, there's a couple of important

0:02:55.100000 --> 0:02:56.700000
 things that I need to state.

0:02:56.700000 --> 0:03:00.820000
 So, you know, given that I stated and
 you know, it's pretty obvious that

0:03:00.820000 --> 0:03:06.180000
 XML is a markup language just like HTML,
 there are some differences between

0:03:06.180000 --> 0:03:11.300000
 the two and these two and these differences
 are really, I would say key

0:03:11.300000 --> 0:03:15.360000
 to understanding exactly, you know,
 what separates it from other markup

0:03:15.360000 --> 0:03:20.400000
 languages and its role in not just displaying
 or rendering data on a web

0:03:20.400000 --> 0:03:25.740000
 page, let's say, but also, you know,
 transferring data or information

0:03:25.740000 --> 0:03:27.460000
 over the internet.

0:03:27.460000 --> 0:03:33.180000
 So first things first is that XML was
 designed from, you know, from the

0:03:33.180000 --> 0:03:39.260000
 ground up to transport data, that was
 its primary, its primary use case,

0:03:39.260000 --> 0:03:43.700000
 one, you know, the primary reason it
 was developed, while HTML, as you

0:03:43.700000 --> 0:03:47.720000
 obviously know, was designed, you know,
 to display or render data in a

0:03:47.720000 --> 0:03:49.920000
 way that made sense or
 that that was readable.

0:03:49.920000 --> 0:03:55.660000
 So the other thing that is important to
 understand in terms of the differences

0:03:55.660000 --> 0:04:00.900000
 between the two is that XML tags are
 not predefined like HTML tags.

0:04:00.900000 --> 0:04:02.060000
 Now, what does that mean?

0:04:02.060000 --> 0:04:06.020000
 Well, it essentially means that you
 as a web app developer can actually

0:04:06.020000 --> 0:04:10.000000
 define what tags you want to use depending
 on the web application or the

0:04:10.000000 --> 0:04:11.540000
 design of your web application.

0:04:11.540000 --> 0:04:18.520000
 So for example, if I want to use XML
 on a web page, you know, I don't

0:04:18.520000 --> 0:04:23.320000
 need to adhere to any predefined tags,
 although there is a format that

0:04:23.320000 --> 0:04:27.980000
 I need to sort of adhere to, but
 we'll get to that shortly.

0:04:27.980000 --> 0:04:32.600000
 So, you know, XML has many practical
 uses in both web applications, but

0:04:32.600000 --> 0:04:36.960000
 also applications in general, and,
 you know, leaving web applications

0:04:36.960000 --> 0:04:41.280000
 or putting them aside, the other applications
 are typically in, you know,

0:04:41.280000 --> 0:04:48.020000
 PDFs, RSS, if you've ever seen an RSS
 feed, that's XML, right, documents

0:04:48.020000 --> 0:04:55.820000
 using OXML, so DocX, PPTX, etcetera,
 SVGs, and also networking protocols

0:04:55.820000 --> 0:05:00.820000
 like XML RPC. So, you know, for
 web services, web dev, etcetera.

0:05:00.820000 --> 0:05:03.240000
 So it's actually quite prevalent
 as you can see.

0:05:03.240000 --> 0:05:08.520000
 Now, in this section of the course, we're
 going to be exploring the primary

0:05:08.520000 --> 0:05:12.500000
 attack techniques against XML data
 structures, more specifically, what

0:05:12.500000 --> 0:05:18.920000
 I mean by that is we'll be focusing
 primarily on the injection based XML

0:05:18.920000 --> 0:05:23.500000
 vulnerabilities, like tag injection,
 and of course, XML external entities.

0:05:23.500000 --> 0:05:26.720000
 Now, in the next video, we'll actually
 take a look at what other types

0:05:26.720000 --> 0:05:31.080000
 of vulnerabilities or XML related vulnerabilities
 exist, but there's going

0:05:31.080000 --> 0:05:35.340000
 to be a focus on a specific set of
 vulnerabilities, and we'll actually

0:05:35.340000 --> 0:05:37.840000
 discuss that when we get there.

0:05:37.840000 --> 0:05:41.100000
 So how does XML work?

0:05:41.100000 --> 0:05:50.860000
 There's a couple of things that, or
 the that sort of infur, you know,

0:05:50.860000 --> 0:05:56.220000
 the way it presents data, the use cases,
 and of course, the processing

0:05:56.220000 --> 0:06:02.560000
 of XML. So in terms of data representation,
 XML organizes data hierarchically

0:06:02.560000 --> 0:06:06.140000
 in a tree structure, very similar
 to LDAP, if you remember.

0:06:06.140000 --> 0:06:09.940000
 And as a result, each piece of data
 is enclosed in tags that describe

0:06:09.940000 --> 0:06:14.560000
 its meaning, sort of similar to HTML,
 but of course, without the adherence

0:06:14.560000 --> 0:06:17.180000
 to any predefined tags.

0:06:17.180000 --> 0:06:21.280000
 Now, to further understand how it works,
 let's take a look at some of

0:06:21.280000 --> 0:06:24.820000
 the use cases, and I'm talking about
 functional or technical use case.

0:06:24.820000 --> 0:06:30.100000
 So data storage in transport, typically
 between systems or applications,

0:06:30.100000 --> 0:06:34.280000
 you'll typically see it in, you
 know, soap, web services, etc.

0:06:34.280000 --> 0:06:38.100000
 Configuration files for software, that
 is, you should be aware of that

0:06:38.100000 --> 0:06:42.060000
 a lot of software, like even let's
 say notepad++, which is open on my

0:06:42.060000 --> 0:06:47.460000
 desktop right now, is actually configured
 using XML, or if you want to

0:06:47.460000 --> 0:06:51.380000
 modify the settings or how it looks
 and feels, you actually modify an

0:06:51.380000 --> 0:06:53.060000
 XML file, right?

0:06:53.060000 --> 0:06:55.760000
 And why is that?

0:06:55.760000 --> 0:06:59.180000
 If you have, if you actually take a look
 at the XML file, you'll see that

0:06:59.180000 --> 0:07:04.040000
 you'll actually see one of the reasons
 why XML is, is so powerful is because

0:07:04.040000 --> 0:07:09.680000
 again, we all come back to that, that specific
 point of there's no predefined

0:07:09.680000 --> 0:07:13.680000
 tags. So you as the application or
 web application developer based on

0:07:13.680000 --> 0:07:16.960000
 your requirements actually define
 the tags to represent something.

0:07:16.960000 --> 0:07:22.080000
 So you can create a tag for the, let's
 say font size setting, and you

0:07:22.080000 --> 0:07:26.240000
 can, you can give it any name you want,
 as long as you adhere to it, right?

0:07:26.240000 --> 0:07:31.140000
 So, obviously, I mentioned web
 services, you know, soap, etc.

0:07:31.140000 --> 0:07:35.000000
 And then of course processing,
 how does this work?

0:07:35.000000 --> 0:07:38.220000
 Or how does this, how is XML processed?

0:07:38.220000 --> 0:07:43.140000
 Well, applications pass XML using
 an XML parser, all right?

0:07:43.140000 --> 0:07:46.480000
 The pass data is used for operations
 like database updates, rendering

0:07:46.480000 --> 0:07:51.600000
 content or communication between systems,
 and that'll become important.

0:07:51.600000 --> 0:07:57.080000
 Now I took this great image and a couple
 of examples from the w3schools

0:07:57.080000 --> 0:07:59.880000
.com website, especially the XML lessons.

0:07:59.880000 --> 0:08:02.260000
 By the way, I highly recommend
 you check them out.

0:08:02.260000 --> 0:08:07.040000
 If you're into a web app, pen testing
 or web security in general, if you

0:08:07.040000 --> 0:08:10.480000
 want to understand some of these technologies,
 or in this case, XML.

0:08:10.480000 --> 0:08:14.260000
 So the key thing that I want to point
 out here is that XML documents form

0:08:14.260000 --> 0:08:17.660000
 a tree structure that starts at the
 root and branches to the leaves.

0:08:17.660000 --> 0:08:20.320000
 So keep that in mind when
 understanding tags.

0:08:20.320000 --> 0:08:24.840000
 So firstly, you're always going to have
 a root element, and then you're

0:08:24.840000 --> 0:08:29.860000
 going to have, you know, parent child
 relationship with all the other

0:08:29.860000 --> 0:08:33.480000
 elements that fall under
 the root element.

0:08:33.480000 --> 0:08:37.000000
 And then you're going to have attributes
 for different elements.

0:08:37.000000 --> 0:08:41.760000
 In this case, you can see the examples
 are, you know, if you if we follow

0:08:41.760000 --> 0:08:45.020000
 what I defined previously, it follows
 a hierarchical structure.

0:08:45.020000 --> 0:08:49.420000
 So again, just think of LDAP, you have
 the root, and then you have branches,

0:08:49.420000 --> 0:08:52.940000
 leaves, etc. So this is the
 root right over here.

0:08:52.940000 --> 0:08:58.100000
 These three or sorry, these two
 element would be a branch.

0:08:58.100000 --> 0:09:01.700000
 And then of course, elements
 have attributes.

0:09:01.700000 --> 0:09:05.720000
 And then we have, let's say, twigs or leaves,
 if you will, and these elements

0:09:05.720000 --> 0:09:09.440000
 would be title, author, year, price, etc.


0:09:09.440000 --> 0:09:13.560000
 And you can see also have siblings or a
 sibling relationship between elements

0:09:13.560000 --> 0:09:15.800000
 on the same hierarchical level.

0:09:15.800000 --> 0:09:19.520000
 And then you're obviously going to have
 other ones that fall under that,

0:09:19.520000 --> 0:09:25.720000
 or values for, you know, specific elements,
 or data types, I should say.

0:09:25.720000 --> 0:09:30.560000
 But you know, the way to understand
 it is you have elements, attributes,

0:09:30.560000 --> 0:09:33.500000
 and that, you know, pretty much it, you
 just need to understand that there's

0:09:33.500000 --> 0:09:37.080000
 a hierarchy, and you always
 start from the root element.

0:09:37.080000 --> 0:09:38.740000
 And I'll show you what this looks like.

0:09:38.740000 --> 0:09:45.840000
 So this is an example of an XML file
 that actually is based on the tree

0:09:45.840000 --> 0:09:47.780000
 structure you see here.

0:09:47.780000 --> 0:09:50.880000
 Now, actually, this is
 slightly different.

0:09:50.880000 --> 0:09:57.100000
 I'll actually refer back to that particular
 tree structure here, or at

0:09:57.100000 --> 0:09:58.560000
 least the names of the elements.

0:09:58.560000 --> 0:10:01.020000
 But yeah, actually, I
 think that's correct.

0:10:01.020000 --> 0:10:03.800000
 So book, and then category.

0:10:03.800000 --> 0:10:07.480000
 Yeah, so right over here, the first
 thing you need to understand, and

0:10:07.480000 --> 0:10:11.540000
 this is referring not just to the tree
 structure, but what you're likely

0:10:11.540000 --> 0:10:13.880000
 to find it in an XML file.

0:10:13.880000 --> 0:10:18.260000
 So the prologue is very important,
 because it defines the XML version

0:10:18.260000 --> 0:10:23.400000
 and the character encoding, you usually
 see this in any entities, we'll

0:10:23.400000 --> 0:10:26.600000
 get to external entities and what
 that attack is all about.

0:10:26.600000 --> 0:10:31.880000
 But you can pretty much guess where
 the payload is going to be injected.

0:10:31.880000 --> 0:10:43.180000
 And then the next line is the root element
 of file or XML document starts

0:10:43.180000 --> 0:10:45.900000
 with the root, so bookstore.

0:10:45.900000 --> 0:10:50.360000
 And then you can see right over here,
 the next line starts with a book

0:10:50.360000 --> 0:10:54.540000
 element. So book element, in
 this case, would be cooking.

0:10:54.540000 --> 0:10:59.200000
 So, and then the book elements have
 four child elements, which would be

0:10:59.200000 --> 0:11:01.460000
 the title, author, year, price, etc.

0:11:01.460000 --> 0:11:03.860000
 So very, very simple to understand.

0:11:03.860000 --> 0:11:09.860000
 The key takeaways here are the prologue,
 the root element, and then of

0:11:09.860000 --> 0:11:14.440000
 course, the fact that there's no adherence
 to let's say, predefined tags.

0:11:14.440000 --> 0:11:20.040000
 So you can see, you can create one called
 title author based on your requirements,

0:11:20.040000 --> 0:11:22.120000
 if you're developing a web application.

0:11:22.120000 --> 0:11:24.700000
 Now, there's a couple of important things
 I want to point out regarding

0:11:24.700000 --> 0:11:26.900000
 the syntax of XML.

0:11:26.900000 --> 0:11:30.800000
 So the start and end tags just because
 it is a markup language that's

0:11:30.800000 --> 0:11:36.120000
 quite similar to HTML, every element
 has an opening and closing tag.

0:11:36.120000 --> 0:11:40.060000
 So if you create an element called name,
 you need to actually close it.

0:11:40.060000 --> 0:11:43.280000
 Or if you're using one called name,
 you need to you know, open it, put

0:11:43.280000 --> 0:11:45.980000
 the value, close it attributes.

0:11:45.980000 --> 0:11:50.240000
 So you already know what an attribute
 is, but elements can have attributes

0:11:50.240000 --> 0:11:54.560000
 for metadata, again, very similar to
 HTML, where let's say you have the

0:11:54.560000 --> 0:11:58.940000
 user element and inside the user element,
 you can specify the attributes

0:11:58.940000 --> 0:11:59.760000
 for that element.

0:11:59.760000 --> 0:12:03.900000
 So things like ID, I hope you're seeing
 where the injections can come

0:12:03.900000 --> 0:12:06.860000
 into play. And that's how that works.

0:12:06.860000 --> 0:12:11.880000
 Now, I want to also make an important note
 here, you can see it's highlighted

0:12:11.880000 --> 0:12:16.980000
 in red. And that is that an XML element
 is everything from including the

0:12:16.980000 --> 0:12:20.760000
 elements start tag to including
 the elements and tags.

0:12:20.760000 --> 0:12:26.020000
 So an element can contain text attributes,
 you know, other elements or

0:12:26.020000 --> 0:12:28.300000
 a text attributes, etc.

0:12:28.300000 --> 0:12:32.380000
 So I just want you to keep that in
 mind, because it's quite important.

0:12:32.380000 --> 0:12:36.500000
 Another important thing regarding
 the syntax is nesting, right?

0:12:36.500000 --> 0:12:40.860000
 And what that means is that elements
 can be nested can be nested within

0:12:40.860000 --> 0:12:47.380000
 an XML file to represent hierarchical data
 or to represent the the hierarchical

0:12:47.380000 --> 0:12:51.380000
 structure or how you want elements
 to fall under each other.

0:12:51.380000 --> 0:12:56.360000
 Right? So you can see that we have
 the user element here, and then to

0:12:56.360000 --> 0:13:02.180000
 essentially infer this hierarchy that
 name and email our child elements,

0:13:02.180000 --> 0:13:05.760000
 you would, you know, you'd essentially
 nest or tabulate.

0:13:05.760000 --> 0:13:07.400000
 So you tab to us.

0:13:07.400000 --> 0:13:11.260000
 And that when passed would essentially
 mean that, okay, these are child

0:13:11.260000 --> 0:13:14.920000
 elements. And then of course, the root
 element, which I've talked quite

0:13:14.920000 --> 0:13:20.620000
 a lot about, I also want to point out
 the following that or reiterate

0:13:20.620000 --> 0:13:25.680000
 the fact that XML documents, XML documents
 must have a single root element

0:13:25.680000 --> 0:13:27.960000
 that encapsulates all other elements.

0:13:27.960000 --> 0:13:33.680000
 So whatever that is, the bottom line,
 just like the HTML, let's say head

0:13:33.680000 --> 0:13:36.940000
 or body tag, you can think
 of that as a root element.

0:13:36.940000 --> 0:13:39.280000
 Actually, that's probably not correct.

0:13:39.280000 --> 0:13:43.620000
 The HTML element in HTML
 would be the actual root.

0:13:43.620000 --> 0:13:49.480000
 And then would be nested.

0:13:49.480000 --> 0:13:53.140000
 So title would be nested under head
 head would be nested under HTML.

0:13:53.140000 --> 0:13:55.360000
 Hopefully that makes sense.

0:13:55.360000 --> 0:13:58.980000
 There's also a couple of other important
 syntax considerations.

0:13:58.980000 --> 0:14:03.340000
 So I've already mentioned about, I've
 already talked about the root element,

0:14:03.340000 --> 0:14:04.960000
 but the prologue.

0:14:04.960000 --> 0:14:07.180000
 This is not required.

0:14:07.180000 --> 0:14:10.540000
 Okay. It's optional.

0:14:10.540000 --> 0:14:15.020000
 However, if it exists, if it exists,
 so if you are using one, it must

0:14:15.020000 --> 0:14:17.720000
 come first in the document.

0:14:17.720000 --> 0:14:23.000000
 And the other syntax, the other syntax
 considerations are that XML tags

0:14:23.000000 --> 0:14:24.220000
 are case sensitive.

0:14:24.220000 --> 0:14:25.760000
 This is very important.

0:14:25.760000 --> 0:14:27.620000
 A lot of people don't realize this.

0:14:27.620000 --> 0:14:31.640000
 But for example, because you're not
 adhering to any predefined tags, and

0:14:31.640000 --> 0:14:34.740000
 you get to define your own if you're
 a web app developer, if you are using

0:14:34.740000 --> 0:14:40.240000
 XML, you need to be very cognizant of
 the case sensitive nature of tags.

0:14:40.240000 --> 0:14:44.880000
 Because if you create one called letter
 with an uppercase L, and you create

0:14:44.880000 --> 0:14:49.260000
 another one called letter with an uppercase
 or lowercase L, these are

0:14:49.260000 --> 0:14:50.580000
 two different tags.

0:14:50.580000 --> 0:14:52.540000
 Okay, so very important.

0:14:52.540000 --> 0:14:57.480000
 Another consideration is that in XML,
 it is illegal to omit the closing

0:14:57.480000 --> 0:15:00.400000
 tag. All elements must
 have a closing tag.

0:15:00.400000 --> 0:15:06.680000
 Others, you'll get a syntax error
 thrown by the actual parser.

0:15:06.680000 --> 0:15:09.720000
 Now that brings us to a
 very important question.

0:15:09.720000 --> 0:15:13.440000
 And again, you don't need to worry about
 what the relevance of this is.

0:15:13.440000 --> 0:15:17.140000
 It'll become apparent when we actually talk
 about the attacks or the vulnerabilities.

0:15:17.140000 --> 0:15:20.060000
 So well formed XML.

0:15:20.060000 --> 0:15:23.180000
 And how exactly is this facilitated?

0:15:23.180000 --> 0:15:25.620000
 Are there any standards, or is
 there a preferred structure?

0:15:25.620000 --> 0:15:27.100000
 Well, let's take a look at this.

0:15:27.100000 --> 0:15:30.540000
 So first thing's first, you know, technically
 speaking, XML is derived

0:15:30.540000 --> 0:15:35.280000
 from the SGML standard, and is the same
 standard on which HTML is based.

0:15:35.280000 --> 0:15:37.460000
 So I want you to keep that in mind.

0:15:37.460000 --> 0:15:40.980000
 However, with lightweight, with
 a lightweight implementation.

0:15:40.980000 --> 0:15:47.340000
 Now this means that some SGML features
 or HTML based features such as

0:15:47.340000 --> 0:15:52.140000
 unclosed and enclosed tags,
 etc, are not implemented.

0:15:52.140000 --> 0:15:56.980000
 Nevertheless, there is a document type
 definition or DTD that is used

0:15:56.980000 --> 0:16:00.720000
 to define the legal building
 blocks of an XML document.

0:16:00.720000 --> 0:16:04.220000
 And the blocks are as follows elements,
 tags, attributes, entities, PC

0:16:04.220000 --> 0:16:06.600000
 data and C data.

0:16:06.600000 --> 0:16:12.360000
 So that begs the question, what is an
 XML DTD or document type definition?

0:16:12.360000 --> 0:16:18.400000
 Well, an XML document, you know, we're
 sort of returning back to a properly

0:16:18.400000 --> 0:16:20.460000
 formatted XML document.

0:16:20.460000 --> 0:16:32.120000
 So an XML document with correct syntax
 is called you know, a definition

0:16:32.120000 --> 0:16:36.960000
 or a standard, if you will, is considered
 both well-formed and valid.

0:16:36.960000 --> 0:16:38.560000
 That's very important, right?

0:16:38.560000 --> 0:16:43.460000
 Now an XML DTD defines the structure
 elements and attributes of an XML

0:16:43.460000 --> 0:16:48.460000
 document. It essentially acts as a
 blueprint that specifies how an XML

0:16:48.460000 --> 0:16:52.580000
 document should be structured, ensuring
 the document is valid and follows

0:16:52.580000 --> 0:16:54.860000
 the predefined rules.

0:16:54.860000 --> 0:16:59.120000
 A DTD can be included with an XML document,
 you know, internal DTD or

0:16:59.120000 --> 0:17:01.820000
 referenced externally, an external DTD.

0:17:01.820000 --> 0:17:08.960000
 So you'll actually see them referenced
 again at the top of an XML document.

0:17:08.960000 --> 0:17:11.060000
 I'll actually use a couple
 of examples here.

0:17:11.060000 --> 0:17:18.760000
 So this is an example of an XML document
 with a DTD or one that's referencing

0:17:18.760000 --> 0:17:19.780000
 one, if you will.

0:17:19.780000 --> 0:17:21.840000
 In this case, it's an internal one.

0:17:21.840000 --> 0:17:26.580000
 So you can see right over here, I've
 sort of used a different example

0:17:26.580000 --> 0:17:29.500000
 here and I've sort of outlined
 the components of a DTD.

0:17:29.500000 --> 0:17:36.260000
 So in terms of elements, so you define
 the tags allowed in the XML documents.

0:17:36.260000 --> 0:17:41.020000
 So essentially, using a DTD to tell
 or to specify what is allowed and

0:17:41.020000 --> 0:17:45.140000
 what is not allowed or what is legal,
 what is not legal, or to try and

0:17:45.140000 --> 0:17:46.840000
 ensure that formatting is consistent.

0:17:46.840000 --> 0:17:54.840000
 So if I wanted to define, you know,
 the elements or how, you know, how

0:17:54.840000 --> 0:17:58.480000
 you own them defined, you do that
 right over here at the top.

0:17:58.480000 --> 0:18:02.620000
 So define the tags allowed in the
 XML document and the hierarchy.

0:18:02.620000 --> 0:18:04.720000
 They're declared with the element tags.

0:18:04.720000 --> 0:18:09.360000
 So you say element library book, you
 essentially use the hierarchy there.

0:18:09.360000 --> 0:18:14.580000
 So element book, and then you specify
 the child elements and then the

0:18:14.580000 --> 0:18:18.820000
 attributes. If you wanted to specify
 those ones, you'd use a different

0:18:18.820000 --> 0:18:20.100000
 tag called atlas.

0:18:20.100000 --> 0:18:24.280000
 So you specify the attributes for elements,
 their types, and whether they

0:18:24.280000 --> 0:18:25.480000
 are optional or required.

0:18:25.480000 --> 0:18:27.760000
 And that's declared with atlas.

0:18:27.760000 --> 0:18:31.200000
 So you can actually say required
 right over here.

0:18:31.200000 --> 0:18:37.020000
 And then entities, you know, define,
 it's not really referenced here,

0:18:37.020000 --> 0:18:40.320000
 but you know, you can actually define
 reusable values or references.

0:18:40.320000 --> 0:18:43.280000
 And these are declared
 with the entity tag.

0:18:43.280000 --> 0:18:46.680000
 And then of course, you
 have PC data and C data.

0:18:46.680000 --> 0:18:51.800000
 PC data means past character data or,
 you know, stands for past character

0:18:51.800000 --> 0:18:56.500000
 data. You know, this allows past text
 and then C data, which is character

0:18:56.500000 --> 0:19:00.520000
 data allows raw unpasked text is very,
 very important because you're actually

0:19:00.520000 --> 0:19:05.060000
 specifying what type of data to expect
 or what's the preferred data.

0:19:05.060000 --> 0:19:09.640000
 So past text, where PC data is specified,
 and you get the idea.

0:19:09.640000 --> 0:19:15.940000
 So a DTD document, in this case, an
 internal DTD, you know, because it's

0:19:15.940000 --> 0:19:20.060000
 being referenced internally or within the
 XML file, is just a set of guidelines,

0:19:20.060000 --> 0:19:25.580000
 if you will, that says, you know, this
 is how things are going to work.

0:19:25.580000 --> 0:19:31.860000
 And I've sort of, I've sort of elaborated
 further here with the second

0:19:31.860000 --> 0:19:36.900000
 slide where you can see the text content
 of the elements, right over here,

0:19:36.900000 --> 0:19:38.800000
 declaring the root element.

0:19:38.800000 --> 0:19:44.080000
 So library is the root element, and it
 contains one or more book elements.

0:19:44.080000 --> 0:19:46.480000
 The plus indicates more than one.

0:19:46.480000 --> 0:19:48.860000
 And then you can define
 your child elements.

0:19:48.860000 --> 0:19:50.140000
 And I already mentioned that.

0:19:50.140000 --> 0:19:52.680000
 So a book element must have
 four child elements.

0:19:52.680000 --> 0:19:55.400000
 I'm not saying this is a requirement.

0:19:55.400000 --> 0:19:57.380000
 This is how you're defining it, right?

0:19:57.380000 --> 0:20:00.860000
 So in that specified order,
 and that's very important.

0:20:00.860000 --> 0:20:03.940000
 The order is very important because
 it must be a dear to so right over

0:20:03.940000 --> 0:20:06.160000
 here in the XML file.

0:20:06.160000 --> 0:20:09.760000
 Now, you know, speaking about the data
 within the XML file, if I change

0:20:09.760000 --> 0:20:12.380000
 the order, it's not going to work.

0:20:12.380000 --> 0:20:14.080000
 So very, very important.

0:20:14.080000 --> 0:20:18.940000
 Okay, so that brings us to the end
 of the introduction to XML video.

0:20:18.940000 --> 0:20:22.680000
 Now that we have this introduction,
 or we understand what we're dealing

0:20:22.680000 --> 0:20:26.540000
 with, you know, what XML is, what it's
 used for, how it differs from other

0:20:26.540000 --> 0:20:35.960000
 markup languages, its syntax, and of
 course, well formatted XML, we can

0:20:35.960000 --> 0:20:38.820000
 actually turn our attention to
 the attacks of vulnerabilities.

0:20:38.820000 --> 0:20:41.340000
 So with that being said, that's
 going to be it for this video.

0:20:41.340000 --> 0:20:43.680000
 And I will be seeing you
 in the next video.

