YouTube2Text

HACKERS sur le WEB : comment ils VOLENT vos DONNÉES (XSS expliqué) — Transcript

by Fransosiche · 4,191 words · 767 segments · language en · Watch on YouTube

Full transcript

  1. 0:00Hello everyone, today we meet for a video on a rather exploited and rather seen fault on the web, the XSS also called Cross Scythe Skeptics.
  2. 0:09So little disclaimer, this video is mainly for educational purposes and to popularize what an XSS is.
  3. 0:15If you're ever in the middle of the dry info, I doubt I'll teach you something, even if we never know.
  4. 0:19But here, little disclaimer, close.
  5. 0:21So before explaining what an XSS is, I think it's rather useful to explain how the web works
  6. 0:27and more broadly, how to reload a web page when you click on a link.
  7. 0:31First, you have to understand that a web page is a collection of files, so a set of HTML files, images, JavaScript, PHP.
  8. 0:39We will see all these files later.
  9. 0:41And so these files will be downloaded by your browser from a web server and then will be understood by your web browser and then displayed on the screen.
  10. 0:52I will quickly show an example, I think it will be much more talkative.
  11. 0:55So here we have a test website with a HTML point.
  12. 1:00We will start with fairly simple things.
  13. 1:02Generally, HTML points are what we have on all websites.
  14. 1:05It's a ballista language that will allow your browser to understand what it should display.
  15. 1:09Who says ballista language necessarily says ballista.
  16. 1:11We find several in this HTML file.
  17. 1:13So I'm not going to go through all the ballistas, but here for example we have a ballista H1 which will display the title of the page.
  18. 1:20We will see it here.
  19. 1:21Title here is the ballista H1.
  20. 1:23This is the demo of how the web works.
  21. 1:25It will be displayed with the ballista title which is in ballista add.
  22. 1:28We will see it later, but we sometimes have parent and child ballistas.
  23. 1:31We will also find the ballista paragraph with paragraph.
  24. 1:35With paragraph we will just find it here.
  25. 1:37There are also ballista script that will be very interesting for XSS.
  26. 1:42So here is a script that is loaded locally on the HTML page that will just display a console.log test.
  27. 1:48That is to say that we will call on a JavaScript function to display tests in the console.
  28. 1:52But we can also load distant resources.
  29. 1:55For example, here we are going to load a script that is in the same folder as our index.html but which is not in the same file.
  30. 2:02Why do we do that?
  31. 2:03Because it's easier if we have a big website to be able to separate the JavaScript from the CSS, from the HTML.
  32. 2:09We do the same thing here for the style.css since in fact we load it remotely.
  33. 2:13We could do very well like here and put everything directly on the same page.
  34. 2:16But hey, it's a bit of a mess because we really have big websites.
  35. 2:19We can of course load resources that are local as well as resources that are remote.
  36. 2:23For example, here we are going to load a ballista, a Google API font that will be located on the Google URL with font.googleapi.com.
  37. 2:31And we will see later how it works when we question the server.
  38. 2:34So here is a little explanation of a very basic website.
  39. 2:39How does it work?
  40. 2:40So here I'm going to start a little local web server.
  41. 2:44And so we're going to go into this web server.
  42. 2:47I started Burpsuite.
  43. 2:49It's a software that allows you to intercept requests that we're going to make.
  44. 2:52And it's going to be pretty practical to understand how a web application works.
  45. 2:56So here we see that I started my web server.
  46. 2:59Here I am a normal server on my browser.
  47. 3:02And I'm going to go into the URL with an IP.
  48. 3:05And we can see that we have the web site display without any problem.
  49. 3:08So how did it happen on the server and browser side?
  50. 3:11Because we just had to put a link and everything was displayed.
  51. 3:14We will be able to see all these requests here.
  52. 3:16And we will also see these requests here because we have our server that was on our machine.
  53. 3:21We made a get on the slash to have the index.html.
  54. 3:24We can see that we made it to our Python server.
  55. 3:27And Python which is a programming language and which is the web server that is currently running.
  56. 3:32It has thus retained our HTML page that we developed earlier.
  57. 3:36I show it to you, it's right there.
  58. 3:37And it's exactly the same thing that made us here.
  59. 3:40Then we could see that our website needed script.js to work.
  60. 3:46So he went to look for script.js to load it.
  61. 3:49Likewise for Google's static fonts.
  62. 3:52He was going to look for it here, not on the IP00 localhost.
  63. 3:57But directly on a destination that is other.
  64. 4:01He also looked to load favicon because favicon is what allows you to display the small icon here in the page.
  65. 4:07But we don't have it here.
  66. 4:08So he made a mistake 404.
  67. 4:10We can see it, file not found.
  68. 4:12So here is quickly how the web works.
  69. 4:14It's relatively simple.
  70. 4:15It's just a request to a web server that will answer us.
  71. 4:18The browser will interpret this answer and will display it on the screen.
  72. 4:21During the introduction, I talked about JavaScript.
  73. 4:24It will be quite important for XSS since in fact this is where our XSS will happen.
  74. 4:29To give a general definition, XSS is an attack that will allow an attacker to inject malicious code in a web page in the form of JavaScript.
  75. 4:38This malicious code will be executed by the web browser.
  76. 4:42It will allow an attacker to do malicious actions through the script that will be injected into the web page.
  77. 4:49The XSS works on the injection principle.
  78. 4:52Injection is a vector of attack that we will find a lot in cyberattacks.
  79. 4:55The injection principle will be relatively simple.
  80. 4:57An attacker will provide a non-reliable entry to a program.
  81. 5:00The program will not check it and will execute this entry directly even if it is not reliable.
  82. 5:06So typically a malicious code.
  83. 5:07And it's exactly the same as the XSS.
  84. 5:09You should know that injections are a vector of attack that is still seen a lot in all PNTS web.
  85. 5:14Well, web in general since in the top 10 OWASP, which is a standard sensibility document for developers and web security, we find in the top 3.
  86. 5:23It is the injection principle but it concerns the XSS, the injection SKs and the web security.
  87. 5:28In the top 10 OWASP, which is a standard sensibility document for developers and web security, we find in the top 3.
  88. 5:35It is the injection principle but it concerns the XSS, the injection SKs and the web security.
  89. 5:41You should know that there are three different types of XSS.
  90. 5:44For each type, we will review them and make a small lab together because I think it's rather useful to make a lab to understand.
  91. 5:51We have the XSS Stored, the XSS Stored, the XSS Reflected, the XSS Reflected and finally the DOM-Based XSS.
  92. 6:00Well listen, let's go straight to the XSS Stored.
  93. 6:05Imagine that behind your screen, you use a website that offers to post comments.
  94. 6:10Imagine Youtube, even if Youtube is secure, but a post like that with forums where you can put comments.
  95. 6:17So the site does not have enough protection against the XSS Stored attacks.
  96. 6:21So an attacker can post a comment containing a malicious script.
  97. 6:26With the XSS Stored that we have seen before, script to script.
  98. 6:29Since when the malicious actor will post the comment, the download of the page will be refreshed and interpreted by the browser.
  99. 6:39And so the script will run as if it were a normal script.
  100. 6:42The problem is that the comment is stored as a database.
  101. 6:46So if another user, a victim, goes to the malicious comment page, he will also see the malicious code executed on his machine.
  102. 6:54So it will potentially allow an attacker to directly recover the comments or do malicious things.
  103. 7:01The general definition of a XSS Stored is that the malicious script is directly stored, saved on the server.
  104. 7:08And so it is one of the most dangerous XSS.
  105. 7:11Let's go straight to the example with a lab, it will be even simpler to understand.
  106. 7:14We immediately left for the lab on the XSS Stored.
  107. 7:18So we access the site that we have to destroy.
  108. 7:21So we are on a site with a blog.
  109. 7:24Blog normally echoes what we said earlier.
  110. 7:28What can we do on this blog?
  111. 7:30We can post comments.
  112. 7:31We have already tried to post a fairly basic comment with tests everywhere.
  113. 7:35Test at test.com.
  114. 7:38We will make a small HTTP test.com.
  115. 7:41Let's see how it reacts.
  116. 7:43We go back to the blog.
  117. 7:44We see that our comment has been posted.
  118. 7:46We will quickly see in the console how it translates here.
  119. 7:51So just a malice.
  120. 7:53Can't we inject a script here?
  121. 7:58Is it secured?
  122. 8:00Is it sanitized?
  123. 8:01I don't know if it's sanitization in French, I think.
  124. 8:03We will just make a basic alert1.
  125. 8:06Here we call our JavaScript script.
  126. 8:09We call the alert function method.
  127. 8:12And we will close the package without worry.
  128. 8:15We will also put our name, etc.
  129. 8:19We will post the comment.
  130. 8:21And there we see that the lab is resolved.
  131. 8:23Why?
  132. 8:24Because if we go back to the blog, we see the alert.
  133. 8:27So the JavaScript function that has been executed.
  134. 8:30Which is stored as a database.
  135. 8:32And so all the users will have this script trigger.
  136. 8:36We can see here of course that there is no comment displayed.
  137. 8:39Since it is rendered by the web browser.
  138. 8:42So if we click here, we can see that the script is rendered.
  139. 8:46We can see that the packages are colored.
  140. 8:48So let's go, it's validated.
  141. 8:52Now we're going to talk about the XSS Reflected.
  142. 8:56Let's imagine again that we use a site with a search bar.
  143. 8:59Which allows you to search for fruits and vegetables for example.
  144. 9:02And so we're going to type in the search bar.
  145. 9:04We're going to get all the apples out.
  146. 9:06And we will have marked on the page that you have searched for apples.
  147. 9:08Very good.
  148. 9:09But the problem is that if the site does not have enough protection against XSS Reflected attacks.
  149. 9:15An attacker will be able to insert in this search bar.
  150. 9:17Since it is an input.
  151. 9:18We will be able to inject, again.
  152. 9:20Well, script packages.
  153. 9:22To execute the malicious code.
  154. 9:24Since the search terms will be sent to the response page.
  155. 9:27And so in the response page, the browser will interpret it as JavaScript script.
  156. 9:31And so will directly execute the malicious code that will be inserted in the search bar.
  157. 9:36So of course, I think you may have understood that it is not stored.
  158. 9:40So the XSS Reflected automatically needs a click.
  159. 9:43An action of an initiator.
  160. 9:44That's why we often see XSS Reflected used in phishing emails.
  161. 9:49Since it needs the user to click on a link.
  162. 9:51In this link, there is directly the XSS Reflected.
  163. 9:54Which will directly do a malicious action to the user without him knowing it.
  164. 9:59But trèfle de babla, let's go straight to the demonstration.
  165. 10:02We left for the XSS Reflected Lab.
  166. 10:06So quickly, just to give you some information.
  167. 10:09We are on very easy labs.
  168. 10:11Labs that are not secure.
  169. 10:13So of course there are many many solutions.
  170. 10:16Many different existing payloads.
  171. 10:18For bypass, to bypass possible security.
  172. 10:22We can see all this here.
  173. 10:23For example on the payload of the thing.
  174. 10:25Of everything that is XSS.
  175. 10:27The payload of the XSS Reflected.
  176. 10:28To not have any codes.
  177. 10:30To not use opened chevrons, etc.
  178. 10:32So it's really really, there are a lot of things to do.
  179. 10:35Just a little closed parenthesis.
  180. 10:37We go directly to the lab.
  181. 10:38So here we have a search bar.
  182. 10:40If we click on search, we see the result that is displayed right here in HTML.
  183. 10:45If we go directly to the console.
  184. 10:47What does it look like?
  185. 10:49So there ok, it is displayed without problem.
  186. 10:51Is that if we type a JavaScript package.
  187. 10:54With again, alert 1.
  188. 10:56I put this type.
  189. 10:58I put this hypo.
  190. 10:59We do that.
  191. 11:01Well here.
  192. 11:02Unfortunately there is no security.
  193. 11:04So we can see here in the URL that we have our script display.
  194. 11:07Alert 1.
  195. 11:08Well there it is URL encoded.
  196. 11:09But it is well executed.
  197. 11:10Since the browser has taken into account our script.
  198. 11:12And if we ever press OK.
  199. 11:14Well we can see that there is nothing displayed in the search.
  200. 11:18Because in fact our script is displayed.
  201. 11:20I used the browser.
  202. 11:21It was interpreted by the browser.
  203. 11:23So it's a successful lab.
  204. 11:28Now we're going to talk about the DOM-based XSS.
  205. 11:30So a little disclaimer.
  206. 11:31I find the XSS the most complicated to understand.
  207. 11:34But do not worry.
  208. 11:35We will try.
  209. 11:36I will try to explain it to you.
  210. 11:38So before talking about the XSS as such.
  211. 11:41I think it is important and very interesting to talk about DOM.
  212. 11:44So the DOM is Document Object Model.
  213. 11:47It is a memory representation of a web page.
  214. 11:50So as we saw earlier.
  215. 11:51When I explained how a web page turns out.
  216. 11:54To put it simply.
  217. 11:55The DOM is an object hierarchy.
  218. 11:56Which represents the HTML elements.
  219. 11:58And typically.
  220. 11:59So the value P.
  221. 12:00The value div.
  222. 12:01The value image.
  223. 12:02Etc.
  224. 12:03All that is elements of the DOM.
  225. 12:04We will have the HTML element.
  226. 12:06Which will be the root element at the top.
  227. 12:08And so after all these elements are elements.
  228. 12:10We will say FIS in fact.
  229. 12:11With the HTML element.
  230. 12:12So root per year.
  231. 12:13Which is above.
  232. 12:14And so in fact these elements can be modified.
  233. 12:16By methods or JavaScript properties.
  234. 12:18So normally with this sentence.
  235. 12:20You must understand potentially where the vulnerability came from.
  236. 12:22Because if we have elements of the DOM.
  237. 12:24Which can be dynamically modified with JavaScript.
  238. 12:26So potentially.
  239. 12:27An malicious actor.
  240. 12:28Could make sure to modify.
  241. 12:30As he wishes.
  242. 12:31And inject malicious code.
  243. 12:32In these elements of the DOM.
  244. 12:34Well that's exactly it.
  245. 12:35The DOM base XSS.
  246. 12:36In fact it will occur when an attacker.
  247. 12:38Will be able to inject malicious code.
  248. 12:39In the web page.
  249. 12:40By using in fact.
  250. 12:41JavaScript elements.
  251. 12:42Which will have code problems.
  252. 12:43In fact quite simply.
  253. 12:44Generally for there to be a DOM base XSS.
  254. 12:46There must be a developer.
  255. 12:47Who made a mistake in his code.
  256. 12:49And behind an attacker.
  257. 12:50Will be able to abuse.
  258. 12:51Directly from this error.
  259. 12:52So you have to know that.
  260. 12:53Contrary to the previous XSS.
  261. 12:55The DOM base XSS.
  262. 12:56It is really on the client side.
  263. 12:58Since there is no interaction with the server.
  264. 13:00Since it is mainly based on the code.
  265. 13:02JavaScript in fact.
  266. 13:04On the client side.
  267. 13:05But directly.
  268. 13:06We will go to the lab.
  269. 13:07So here we go.
  270. 13:08Especially for the DOM XSS.
  271. 13:09So potentially for the moment.
  272. 13:10You have not very well understood.
  273. 13:11How it worked.
  274. 13:12But I think.
  275. 13:13With this example.
  276. 13:14You will really understand.
  277. 13:15Much more easily.
  278. 13:16So there we have again.
  279. 13:17A search bar.
  280. 13:18We can test.
  281. 13:19To put test.
  282. 13:20We see that it is displayed.
  283. 13:21As earlier.
  284. 13:22If we go to the console.
  285. 13:23We have the display.
  286. 13:24We will potentially have.
  287. 13:25A XSS reflected.
  288. 13:26But here.
  289. 13:27It indicated that it is a DOM XSS.
  290. 13:29So we will not test.
  291. 13:30The XSS reflected.
  292. 13:31Even if.
  293. 13:32In any case it will not work.
  294. 13:33Because there is a security.
  295. 13:34Normally the test here.
  296. 13:35Is treated like a string.
  297. 13:36So it will not be executed by the browser.
  298. 13:37In any case.
  299. 13:38What interests us here.
  300. 13:39Is the small.
  301. 13:40The small image package.
  302. 13:41Since we see.
  303. 13:42Right here.
  304. 13:43That.
  305. 13:44We have the test.
  306. 13:45Which is added at the end.
  307. 13:46Of the image.
  308. 13:47So the source.
  309. 13:48Is equal to.
  310. 13:49Resource.
  311. 13:50Image.
  312. 13:51Tracker.
  313. 13:52Etc.
  314. 13:53Search term.
  315. 13:54And call test.
  316. 13:55So it means.
  317. 13:56That in fact.
  318. 13:57We have the DOM.
  319. 13:58Which is dynamically modified.
  320. 13:59By the search.
  321. 14:00So by the search term.
  322. 14:01Which means.
  323. 14:02That we can potentially.
  324. 14:03Inject script in there.
  325. 14:04So how are we going to do.
  326. 14:05To escape.
  327. 14:06In fact.
  328. 14:07Of equal sources.
  329. 14:08And well.
  330. 14:09Quite simply.
  331. 14:10We are going to do a payload.
  332. 14:11Which is equal to.
  333. 14:12Double code.
  334. 14:13So double code.
  335. 14:14To escape.
  336. 14:15We close.
  337. 14:16The chevrons.
  338. 14:17To leave the tag.
  339. 14:18The image package.
  340. 14:19And here.
  341. 14:20We will be able to quietly add.
  342. 14:21Our script tag.
  343. 14:22With one alert one.
  344. 14:23Because it is the payload.
  345. 14:24Which must be executed.
  346. 14:25To succeed these labs.
  347. 14:26We close the script package.
  348. 14:27We will press enter.
  349. 14:28And we see that it is executed.
  350. 14:30So in the console.
  351. 14:31What does it do?
  352. 14:32Well it does.
  353. 14:33It does in fact.
  354. 14:34We managed to escape.
  355. 14:35With the double code.
  356. 14:36The chevron.
  357. 14:37The script.
  358. 14:38So it was executed.
  359. 14:39By the browser.
  360. 14:40And after the rest.
  361. 14:41We can see that it is displayed here.
  362. 14:42Of what was.
  363. 14:43At the end of the image.
  364. 14:44But suddenly.
  365. 14:45We added our small payloads.
  366. 14:46So it is displayed after.
  367. 14:47Because the browser does not know how to manage it in fact.
  368. 14:48So here.
  369. 14:49For this little lab.
  370. 14:50The lab succeeded.
  371. 14:51So now.
  372. 14:52We saw the different XSS.
  373. 14:53I wanted to say.
  374. 14:54What are the impacts of these XSS.
  375. 14:55Since it's nice to have these vulnerabilities there.
  376. 14:56But.
  377. 14:57Why are they used?
  378. 14:58And what can it induce?
  379. 14:59If ever.
  380. 15:00We are on a site.
  381. 15:01And unfortunately.
  382. 15:02We will see.
  383. 15:03There was an XSS.
  384. 15:04And we will see.
  385. 15:06So first.
  386. 15:07What is the most used.
  387. 15:08And what we see the most often.
  388. 15:09It's the cookie theft.
  389. 15:10Since behind.
  390. 15:11It will be able to allow an attacker.
  391. 15:12To be passed.
  392. 15:13For the user.
  393. 15:14Who stole the cookies.
  394. 15:15And.
  395. 15:16Do actions.
  396. 15:17As this victim.
  397. 15:18This user.
  398. 15:19We also have the keylogging.
  399. 15:20Which is possible.
  400. 15:21Since in fact.
  401. 15:22We will be able to see.
  402. 15:23What is typed.
  403. 15:24On.
  404. 15:25The keyboard.
  405. 15:26Of a user.
  406. 15:27If ever.
  407. 15:28It is infected.
  408. 15:29By suddenly.
  409. 15:30An XSS.
  410. 15:31And then.
  411. 15:32And finally.
  412. 15:33We have the phishing.
  413. 15:34Which is also used.
  414. 15:35Which is also induced by the XSS.
  415. 15:36So.
  416. 15:37First.
  417. 15:38Through.
  418. 15:39Reflected XSS.
  419. 15:40Which requires.
  420. 15:41Directly.
  421. 15:42As we saw.
  422. 15:43Well.
  423. 15:44An action.
  424. 15:45Of an attacker.
  425. 15:46But we can also.
  426. 15:47Use the XSS.
  427. 15:48To.
  428. 15:49Defigure.
  429. 15:50Phasing.
  430. 15:51A website.
  431. 15:52And suddenly.
  432. 15:53To use it.
  433. 15:54To make believe.
  434. 15:55That in fact.
  435. 15:56It is a site.
  436. 15:57Quite normal.
  437. 15:58Basically.
  438. 15:59A Gmail site.
  439. 16:00We will be able to send it.
  440. 16:01Through phishing.
  441. 16:02He will think that.
  442. 16:03Well.
  443. 16:04It is a Gmail site.
  444. 16:05Quite normal.
  445. 16:06He has not checked.
  446. 16:07The URL bar.
  447. 16:08He will enter his password.
  448. 16:09And his email.
  449. 16:10We will be able to steal his password.
  450. 16:11And his email.
  451. 16:12And so.
  452. 16:13It will be very critical.
  453. 16:14So of course.
  454. 16:15The real impact of XSS.
  455. 16:16It really depends on the context of the site.
  456. 16:17I think you understood it.
  457. 16:18Since indeed.
  458. 16:19If ever.
  459. 16:20We have a site.
  460. 16:21Where.
  461. 16:22There is no possibility.
  462. 16:23To connect.
  463. 16:24All the information is public.
  464. 16:25And the users.
  465. 16:26Are potentially anonymous.
  466. 16:27So there.
  467. 16:28To have an execution.
  468. 16:29JavaScript code.
  469. 16:30It will not be very useful.
  470. 16:31On the contrary.
  471. 16:32If ever.
  472. 16:33We are on a site.
  473. 16:34With a context.
  474. 16:35With sensitive data.
  475. 16:36Potentially.
  476. 16:37Bankers.
  477. 16:38Medical files.
  478. 16:39And users.
  479. 16:40With several rights.
  480. 16:41Guest rights.
  481. 16:42Admin rights.
  482. 16:43Etc.
  483. 16:44So there.
  484. 16:45To have an XSS.
  485. 16:46It can be much, much more critical.
  486. 16:47And especially.
  487. 16:48If ever.
  488. 16:49We manage to steal cookies.
  489. 16:50Of session.
  490. 16:51Of someone who is administrator of the site.
  491. 16:52Or with fairly high rights.
  492. 16:53Since suddenly.
  493. 16:54We will have a lot more.
  494. 16:55Of power.
  495. 16:56On the whole site.
  496. 16:57So of course.
  497. 16:58There are possibilities.
  498. 16:59And to avoid.
  499. 17:00That our site.
  500. 17:01Be spawned.
  501. 17:02By XSS.
  502. 17:03And we really have a lot.
  503. 17:04Of things to do.
  504. 17:05First.
  505. 17:06It is always necessary.
  506. 17:07To filter the data.
  507. 17:08Which are at the arrival.
  508. 17:09So that is to say.
  509. 17:10That if you have inputs.
  510. 17:11So.
  511. 17:12A field of comments.
  512. 17:13Or a field of research.
  513. 17:14You have to make sure.
  514. 17:15In fact.
  515. 17:16Well.
  516. 17:17To filter.
  517. 17:18What is going to be put in place.
  518. 17:19To potentially avoid.
  519. 17:20Well.
  520. 17:21That we put boxes.
  521. 17:22Open and closed.
  522. 17:23With script inside.
  523. 17:24Or image.
  524. 17:25Really.
  525. 17:26To avoid.
  526. 17:27That we put.
  527. 17:28Things like HTML.
  528. 17:29JavaScript.
  529. 17:30Etc.
  530. 17:31Or even CSS.
  531. 17:32Since we can do.
  532. 17:33XSS.
  533. 17:34With CSS.
  534. 17:35So.
  535. 17:36Here.
  536. 17:37Avoid.
  537. 17:38And filter.
  538. 17:39As much as possible.
  539. 17:40The data at the arrival.
  540. 17:41And do it.
  541. 17:42Not necessarily.
  542. 17:43With regex.
  543. 17:44Because regex.
  544. 17:45It can be bypassed.
  545. 17:46We can overpass these regex.
  546. 17:47Rather.
  547. 17:48Passed by.
  548. 17:49White listing.
  549. 17:50Or black listing.
  550. 17:51Rather.
  551. 17:52White listing.
  552. 17:53Like that.
  553. 17:54We only authorize what we want.
  554. 17:55But sometimes.
  555. 17:56It can be a bit complicated.
  556. 17:57We send a request to the server.
  557. 17:58The server sends us the request.
  558. 17:59And after.
  559. 18:00It will be executed by the browser.
  560. 18:01So.
  561. 18:02If.
  562. 18:03For XSS reflected.
  563. 18:04We filter the data at the entrance.
  564. 18:05Potentially.
  565. 18:06But we bypass all that.
  566. 18:07And after.
  567. 18:08We do not encode the data at the exit.
  568. 18:09We will directly have an XSS that will be possible.
  569. 18:10While.
  570. 18:11Yet.
  571. 18:12It is not very complicated.
  572. 18:13To encode typically.
  573. 18:14The chevrons.
  574. 18:15With.
  575. 18:16LTNGT.
  576. 18:17Or again.
  577. 18:18Encapsulate these chevrons.
  578. 18:19In unicode.
  579. 18:20It can be quite feasible.
  580. 18:21And like that.
  581. 18:22In fact.
  582. 18:23Once we have received.
  583. 18:24Our answer.
  584. 18:26From the web server.
  585. 18:27When the browser.
  586. 18:28Will try to render the page.
  587. 18:29And execute JavaScript.
  588. 18:30It will not understand.
  589. 18:31Since the chevrons.
  590. 18:32It will no longer be chevrons.
  591. 18:33It will be either unicode.
  592. 18:34Or.
  593. 18:35LTNGT.
  594. 18:36It will say.
  595. 18:37Okay.
  596. 18:38I do not know that.
  597. 18:39So.
  598. 18:40I do not execute it.
  599. 18:41And it will be perfect.
  600. 18:42Then.
  601. 18:43It is also possible.
  602. 18:44To use HTTP headers.
  603. 18:45So.
  604. 18:46I think I'll talk to you again.
  605. 18:47About the HTTP protocol.
  606. 18:48Potentially.
  607. 18:49During a video on Request Muggling.
  608. 18:50But.
  609. 18:51HTTP headers.
  610. 18:52This is what defines.
  611. 18:53This is what we can put.
  612. 18:54That we can put in a HTTP request.
  613. 18:55In the HTTP protocol.
  614. 18:56To tell the server.
  615. 18:57What we want.
  616. 18:58And what we do not want.
  617. 18:59So.
  618. 19:00It's really very quickly.
  619. 19:01But globally.
  620. 19:02You have to know.
  621. 19:03In fact.
  622. 19:04We can tell the server.
  623. 19:05That we want in the answer.
  624. 19:06Only plain text.
  625. 19:07Or only JavaScript.
  626. 19:08And the other way around.
  627. 19:09We can tell it.
  628. 19:10We do not want JavaScript.
  629. 19:11In the answer.
  630. 19:12We do not want HTML.
  631. 19:13And that is quite possible.
  632. 19:14With the header.
  633. 19:15Content type.
  634. 19:16X content type.
  635. 19:17Like that.
  636. 19:18If ever.
  637. 19:19A user.
  638. 19:20Tries to make an XSS reflected.
  639. 19:21If ever.
  640. 19:22In the answer.
  641. 19:23Then.
  642. 19:24X content type.
  643. 19:25Which prohibits JavaScript.
  644. 19:26And then.
  645. 19:27The web server.
  646. 19:28Will refuse.
  647. 19:29To give its answer.
  648. 19:30Since.
  649. 19:31At the beginning.
  650. 19:32We will have JS.
  651. 19:33Then.
  652. 19:34We have the use.
  653. 19:35Of content security policies.
  654. 19:36So.
  655. 19:37CSP.
  656. 19:38Content Security Policy.
  657. 19:39In English.
  658. 19:40Globally.
  659. 19:41You have to know that.
  660. 19:42Often.
  661. 19:43The XSS.
  662. 19:44Or even.
  663. 19:45Anything.
  664. 19:46We will try to.
  665. 19:47Try to load a script.
  666. 19:48That we control.
  667. 19:49On a server.
  668. 19:50That we have.
  669. 19:51In fact.
  670. 19:52To allow.
  671. 19:53In fact.
  672. 19:54Quite simply.
  673. 19:55Let's imagine.
  674. 19:56That I have the site.
  675. 19:57Toto.fr.
  676. 19:58That unfortunately.
  677. 19:59On my site.
  678. 20:00There is an XSS.
  679. 20:01But.
  680. 20:02I put in place.
  681. 20:03A CSP.
  682. 20:04Content Security Policy.
  683. 20:05Which says that.
  684. 20:06If ever.
  685. 20:07A script.
  686. 20:08Is not loaded.
  687. 20:09From.
  688. 20:10The domain name.
  689. 20:11Toto.fr.
  690. 20:12Then.
  691. 20:13You have no right to load it.
  692. 20:14And so.
  693. 20:15If ever.
  694. 20:16An attacker.
  695. 20:17Discoveres an XSS.
  696. 20:18And tries to.
  697. 20:19Load a script.
  698. 20:20Which comes from.
  699. 20:21I talk a lot.
  700. 20:22About JavaScript script.
  701. 20:23But.
  702. 20:24We can also load images.
  703. 20:25To make sure.
  704. 20:26That the image executes JavaScript.
  705. 20:27On.
  706. 20:28Balances.
  707. 20:29As in error.
  708. 20:30Etc.
  709. 20:31So.
  710. 20:32It can be rather practical.
  711. 20:33To avoid precisely.
  712. 20:34Loading.
  713. 20:35Of external resources.
  714. 20:36And prohibit.
  715. 20:37The loading of these resources.
  716. 20:38So.
  717. 20:39That's it for the little video.
  718. 20:40On the XSS.
  719. 20:41I hope you liked it.
  720. 20:42I hope I didn't do too much.
  721. 20:43Shortening.
  722. 20:44And if I did.
  723. 20:45And if there are some who are really bad at XSS.
  724. 20:46Do not hesitate to tell me.
  725. 20:47In the comments.
  726. 20:48If I made small mistakes.
  727. 20:49It is with pleasure that I.
  728. 20:51There are really a lot of resources on the net.
  729. 20:53You can also watch the chars rootnix.
  730. 20:55They are very interesting on the XSS.
  731. 20:57There are really a lot.
  732. 20:58And also.
  733. 20:59Small research.
  734. 21:00Lately I've seen the Mizzou's research.
  735. 21:01Which is a complete RCE XSS.
  736. 21:03A CVE of 2022.
  737. 21:04On Electron.
  738. 21:05Which will allow.
  739. 21:06In fact.
  740. 21:07He found an XSS.
  741. 21:08He tried to chain several vulnerabilities.
  742. 21:10To get an RCE.
  743. 21:11So.
  744. 21:12Remote command execution.
  745. 21:13Who will be able to.
  746. 21:14In fact.
  747. 21:15He was able to execute commands on the server.
  748. 21:16Distant.
  749. 21:17Which is one of the most critical vulnerabilities.
  750. 21:19So if you ever.
  751. 21:20I put the link in description.
  752. 21:21If you ever want to see.
  753. 21:22Sarodif.
  754. 21:23I think he did a stream on.
  755. 21:24RootMe.
  756. 21:25And if you ever.
  757. 21:26I put you these slides.
  758. 21:27So if you ever.
  759. 21:28Interested in all that.
  760. 21:29Do not hesitate.
  761. 21:30To take a look at these things.
  762. 21:31In any case.
  763. 21:32I tell you.
  764. 21:33See you next time.
  765. 21:34Surely for a video.
  766. 21:35On the request muggling.
  767. 21:36It was François.

About this transcript

This page contains the full transcript of HACKERS sur le WEB : comment ils VOLENT vos DONNÉES (XSS expliqué) by Fransosiche, generated from the public captions YouTube serves with the video. The transcript has 4,191 words across 767 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.

What you can do with it

Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.

Free YouTube transcript tool

YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.