YouTube2Text

🥷 Resumen de cómo DETECTAR y Explotar VULNERABILIDADES Paso a Paso | HACKING ÉTICO y Ciberseguridad — Transcript

by El Pingüino de Mario · 5,655 words · 794 segments · language en · Watch on YouTube

Full transcript

  1. 0:00Welcome to my channel, welcome to a new
  2. 0:02video, and today we're going to do the
  3. 0:03following. We're going to make a
  4. 0:05machine, a slightly complicated machine
  5. 0:07for our Dockerlaps platform. We're
  6. 0:09going to make the Summer Vibes machine.
  7. 0:11See? If I type Summer here, we'll have
  8. 0:14this machine in the search engine,
  9. 0:15which is a difficult machine, although
  10. 0:18it's not that difficult in itself; but
  11. 0:20it's a long machine, it's a machine
  12. 0:22that considers the exploitation of
  13. 0:23several vulnerabilities: you have to do
  14. 0:26a fairly complete intrusion process. So
  15. 0:28, that makes it ideal for practicing
  16. 0:30hacking, even if you're just starting
  17. 0:33out. We're going to see things like
  18. 0:35first a really basic port scan with
  19. 0:37Nmap, then port enumeration. We're
  20. 0:40going to go into each one of them and
  21. 0:41analyze them. Then we're going to fing
  22. 0:43web, we're going to find directories.
  23. 0:45Once we have found directories, we are
  24. 0:47going to identify vulnerable services,
  25. 0:49the version of said service, we are
  26. 0:51going to see if there are exploits, we
  27. 0:53are going to test some of them, we are
  28. 0:56going to use brute force, we are going
  29. 0:58to do an intrusion, we will exploit
  30. 1:00several vulnerabilities and enter the
  31. 1:02machine. So, well, this is basically
  32. 1:04going to be a summary. I think it is
  33. 1:06going to be ideal for those who are
  34. 1:08starting out in hacking. So, well, I
  35. 1:09highly recommend this machine and let's
  36. 1:11get to it. Well, in my case, well, I am
  37. 1:13going to download it. Let's go here to
  38. 1:16the Mega link and click on end, and
  39. 1:17this machine is also very good in my
  40. 1:19opinion because it exploits a
  41. 1:20vulnerability that came out very
  42. 1:22recently, it is from this year. So
  43. 1:24sometimes it is very good to practice
  44. 1:26hacking with current things, well,
  45. 1:28things that are recent, because I think
  46. 1:30that helps a lot, right? Well, here we
  47. 1:32have the zip point. Let's open it and
  48. 1:34now, well, we simply extract the
  49. 1:36contents of this file. Zip to the
  50. 1:38desktop. Well, as you know, this is how
  51. 1:40it works in Dockerlaps. We have an
  52. 1:42auto-deployment script and then we have
  53. 1:44the machine itself. So, we're going to
  54. 1:47run this machine like this. Let's go to
  55. 1:50the desktop and type in auto-deploy and
  56. 1:52pass it the Summer Vipes machine. Well,
  57. 1:56once we've done this, notice that the
  58. 1:57auto-deployment script takes care of
  59. 1:59everything. We forget about it, wait a
  60. 2:02bit and voila, we have the IP provided
  61. 2:04here. Let's ping it and see. And we
  62. 2:07have connectivity. Well, now we're
  63. 2:09going to start the hacking process step
  64. 2:11by step. But I think before we continue
  65. 2:14, at least I'm hearing a noise here, I
  66. 2:16don't know if you're hearing it too. I
  67. 2:18think there's a noise here in the
  68. 2:19background. And yes, I think it's a
  69. 2:22message from our sponsor Rayola
  70. 2:25Networks. If you're thinking of setting
  71. 2:27up a website, Rayola Networks is your
  72. 2:29solution. They offer different SSD
  73. 2:31hosting rates, so we're guaranteed high
  74. 2:33speed on our website. In addition, with
  75. 2:36these offers we can have a 20%discount
  76. 2:38on annual contracts along with the
  77. 2:40registration or transfer of a free
  78. 2:42domain, which allows us to have
  79. 2:43everything we need to get started with
  80. 2:45hosting plus a domain at a really
  81. 2:47affordable price for the channel's
  82. 2:49followers. Whether we want a single
  83. 2:51domain, more than one domain, depending
  84. 2:53on the storage, that is, if we want to
  85. 2:56create a web page, these offers are
  86. 2:58ideal. In addition, as we can see on
  87. 3:00their website, they also have 24-hour
  88. 3:02support by phone or ticket, as well as
  89. 3:05a 30-day warranty, support for
  90. 3:07WordPress, a very important high-speed
  91. 3:09SSD and also an SSL certificate
  92. 3:11included. Also, in case you already
  93. 3:14have another provider and want to make
  94. 3:16the change, Rayola Networks offers free
  95. 3:18migration, as well as automatic backups
  96. 3:20every day and free tutorials and
  97. 3:22resources. Here we also have more
  98. 3:24detailed information, the different
  99. 3:26rates depending on our needs. We have
  100. 3:29everything from the most basic plan,
  101. 3:30which is still very complete, to a much
  102. 3:32more advanced plan such as the Pro plan
  103. 3:34. So, ultimately, if you want to create
  104. 3:37a website, Rayola Networks is ideal.
  105. 3:39And that's it. Well, now we've seen
  106. 3:40this wonderful little message. Let's
  107. 3:42continue with the video. Well, well,
  108. 3:44well. Okay, let's start with the
  109. 3:46step-by-step hacking process of this
  110. 3:47vulnerable machine. We can see that we
  111. 3:49have connectivity. Let's start with
  112. 3:51step number one. This is very much
  113. 3:53focused on those who are starting out
  114. 3:55in cybersecurity. When I come across a
  115. 3:57system, when I want to, well, when I
  116. 3:59have a goal, step number one, well,
  117. 4:01apart from first launching the ping
  118. 4:03command, etc., etc., is to perform a
  119. 4:05scan for open ports with Nmap. That is,
  120. 4:08we would do it like this. NMAP is a
  121. 4:11tool to find open ports on a system, be
  122. 4:14it Linux or Windows, whatever. So, with
  123. 4:17NMAP, using this series of parameters,
  124. 4:20I'm scanning for ports that may be open
  125. 4:23on this machine, which in this case is
  126. 4:25the IP of the victim machine. Well, P-
  127. 4:28is to cover the entire range of open
  128. 4:30ports. This is good, gu SS SIM-type
  129. 4:33scanning is so that the TCP connection
  130. 4:35is not completely completed because
  131. 4:37NMAP does not need to wait for the
  132. 4:39entire TCP connection to be completed
  133. 4:41to be able to know if a port is open or
  134. 4:44not. So, by doing this, we can make the
  135. 4:46scan faster and at the same time make
  136. 4:48it a little more useful. gu SC is a set
  137. 4:50of skips that NMAP has to be able to do
  138. 4:52this recognition, to be able to give us
  139. 4:54much more information. SV is so that on
  140. 4:57each port, for example, if Apache is
  141. 4:59running on port 80, it shows me the
  142. 5:01Apache version, as well as any other
  143. 5:03port, whether it's port 21, if it's
  144. 5:05running a VSFTPD, if it's running a Pro
  145. 5:08FTP, whatever, it's going to show me
  146. 5:10the min rate version so that this scan
  147. 5:12goes really fast. Uh, we can set it to
  148. 5:143000, we can set it to 5000. When we
  149. 5:16are in a controlled environment, 5,000
  150. 5:18is perfect because this is going to be
  151. 5:20quite powerful, what happens is that it
  152. 5:22is going to make quite a lot of noise,
  153. 5:24but since we are here in a controlled
  154. 5:26environment, there is no problem. Minus
  155. 5:28N so that it does not perform NS
  156. 5:29resolution. This is something that
  157. 5:30takes a long time. Triple verbose for
  158. 5:33Kenemap as it advances, as it does this
  159. 5:35scan, so that it reports to me what it
  160. 5:38finds as it goes. And then the PN dash
  161. 5:41parameter, basically to, well, that's
  162. 5:43it, to not use the ping command to do
  163. 5:46this reconnaissance. And well, here I
  164. 5:49could use the minus on parameter to
  165. 5:51save this entire report in a file
  166. 5:53called scan or also pingü scan. The
  167. 5:56name is very important. Well, doing
  168. 5:58this, notice that we are finding open
  169. 6:00ports, port 80 and port 22 SSH. Okay,
  170. 6:03by default SSH runs on port 22 and HTTP
  171. 6:06runs on port 80. Well, we are indeed
  172. 6:09checking it. Open SSH version 8.9 is
  173. 6:12quite corrupted. Let's remember that if
  174. 6:15it were version 7.7 or earlier, for
  175. 6:16example, there would be a user
  176. 6:18enumeration exploit, but in this case
  177. 6:20it doesn't apply because it is a fairly
  178. 6:22current version. Well, in this report
  179. 6:24we can already obtain, well, let's say,
  180. 6:26information about the machine beyond
  181. 6:28the issue of open ports. For example,
  182. 6:30look at this that says Ubuntu 0.7 here.
  183. 6:33I can find out the exact version of
  184. 6:35Ubuntu with this information. How can I
  185. 6:37find out? Well, you'll see it like this
  186. 6:38. I paste this into the browser and
  187. 6:41here we have the Launchpad website, and
  188. 6:43if we go here we can see the Ubuntu
  189. 6:45version. In this case it is the Yumi
  190. 6:47version. It is also a current version,
  191. 6:50well, we can put Ubuntu Yami here and
  192. 6:53it is the Ubuntu 2204 version, well,
  193. 6:55long-term support, right? Well, perfect
  194. 6:58, we are obtaining information. This
  195. 7:00can be very useful because we could
  196. 7:02already know if it was an old version
  197. 7:04or not, but in this case it is quite
  198. 7:05current. Well, let's take a look at
  199. 7:07port 80, shall we? We are interested in
  200. 7:09port 80. Let's go to the browser and
  201. 7:12type 172.17.0.2. If I enter the IP of
  202. 7:17the victim machine in the browser, what
  203. 7:19I will get is to view the content of
  204. 7:21port 80. If, for example, port 43 were
  205. 7:24open, which would be the port where the
  206. 7:26https protocol runs by default, which
  207. 7:28would be like this but with encryption,
  208. 7:31then we would have to enter through
  209. 7:33port 4.3, which would be here, by
  210. 7:35typing https. But here, when I just
  211. 7:38type the IP, it's like typing http,
  212. 7:40colon, slash, slash, which would
  213. 7:42basically be insecure. Okay, perfect.
  214. 7:45Well, here we have a little bit of this
  215. 7:47little Apache template. This is, well,
  216. 7:48when you install Apache, this appears
  217. 7:50by default. Okay, something very
  218. 7:52important to do, well, when we are at
  219. 7:55this point, is to do web fucing, that
  220. 7:57is, web fucing is a technique that
  221. 7:59allows us to find directories or files
  222. 8:01within this server, within this website
  223. 8:04. Imagine that here after this, well,
  224. 8:07this IP, there is a bar login/admin/
  225. 8:10upload, anything, whether files, for
  226. 8:13example, in welcome.php PHP, such as a
  227. 8:16welcome SIMAS, a welcome directory.
  228. 8:20Well, for both cases, to be able to
  229. 8:22find this, we have the web fucing
  230. 8:23technique and for that we can use
  231. 8:25several tools. We have Dirf, Gobustter,
  232. 8:28Ufut, Fuf, uh Dir Search, there are
  233. 8:30many. For example, I'm going to use
  234. 8:33Gobuster, Gobuster Dir. And then I say,
  235. 8:36"Hey, I want you to find directories
  236. 8:37for me and I say minus U, so here we're
  237. 8:39going to paste the URL http colon slash
  238. 8:41slash and paste the IP of the target
  239. 8:43machine, right? Now, with the minus W
  240. 8:45parameter, here we're going to load a
  241. 8:47directory list. User directory list,
  242. 8:49seclist, Discovery, I think I remember,
  243. 8:52Web Content directory list, lower case,
  244. 8:55as far as I remember, yes, and for
  245. 8:57example medium. Well, here I'm loading
  246. 9:00a dictionary that has, on each line,
  247. 9:02many possible paths of a system, many
  248. 9:05in fact. Well, we're using this
  249. 9:07dictionary: directory list lowcase 2.3
  250. 9:09medium. Remember that this is inside
  251. 9:11the checklist directory. This by
  252. 9:13default depends on the CALI, it may or
  253. 9:15may not be installed. If this is not
  254. 9:17installed for you, you put sudo aptal
  255. 9:19segist, this here and that's it. And
  256. 9:22this entire path is created for you.
  257. 9:24Well, if I do this here, for example,
  258. 9:25this is what it's going to do. What
  259. 9:26we're going to do is search for web
  260. 9:28directories. In this case, there's an
  261. 9:30issue, and that is, well, this is
  262. 9:32nothing because this is already there
  263. 9:33by default. In this case, it happens
  264. 9:36that if the directory is not found in
  265. 9:38this dictionary, Gobuster won't find
  266. 9:40any path for me. That's normal. The
  267. 9:43path must be in the dictionary. So, in
  268. 9:45this case, it's a bit of a mischievous
  269. 9:47machine. Well, it won't find it here,
  270. 9:50unless we go to the source code and I
  271. 9:53intentionally left a little clue down
  272. 9:55here to show you this, right? To show
  273. 9:58you that sometimes if the directory is
  274. 10:00a bit strange, Gobuster won't find it
  275. 10:03because it won't be in the dictionary.
  276. 10:05Here we have, look, CMS Miss Simple and
  277. 10:07Instal Gear. Well, here we have a CMS
  278. 10:09Miss Simple, uh, which is installed
  279. 10:12here. To access it, CMS MS. Well, it
  280. 10:15seems that there is a directory, but
  281. 10:18since it wasn't in the dictionary, it
  282. 10:21can't find it. Let's do a test. Let's
  283. 10:23go here and, well, let's go. Let's see
  284. 10:25if this directory exists and it does
  285. 10:27exist. That's why it's very important
  286. 10:29to do a good enumeration and be able to
  287. 10:30find all the directories properly.
  288. 10:31Let's remember that we haven't found
  289. 10:34this because it wasn't within this
  290. 10:36dictionary. Let's do a test. For
  291. 10:39example, I could edit this. You see, I
  292. 10:42can edit this here. And what happens if
  293. 10:45I, for example, add cms ms here, for
  294. 10:48example? No, manually. Well, now we're
  295. 10:50going to see how Gobuster will find it.
  296. 10:53See? Now it did find it because now I
  297. 10:55added it within the dictionary and if
  298. 10:57it's added, I can find it. Well, CMS,
  299. 11:00MS, perfect. Well, this vulnerability
  300. 11:03is quite nice because this is basically
  301. 11:06a CMS. A CMS is basically a, well, yes,
  302. 11:09a tool that allows you to create web
  303. 11:12pages in a fairly simple way compared
  304. 11:14to doing them by hand, so to speak,
  305. 11:17right? Well, doing it with code is
  306. 11:19basically a good thing, a content
  307. 11:21manager, right? For example, WordPress
  308. 11:23is a CMS Drupal Magento and we also
  309. 11:25have CMS Simple which is another option
  310. 11:27, it's another alternative. Well, I
  311. 11:29installed this and so something that
  312. 11:31you should always do is check the
  313. 11:33version, right? Let's do some research.
  314. 11:35That is to say, whenever you come
  315. 11:37across a service, a website, anything,
  316. 11:40the first thing you should check, or at
  317. 11:42least almost the first thing, is the
  318. 11:44version. In this case, here we are
  319. 11:46seeing what this site says. Well, it's
  320. 11:48made in CMS M Simple version 2219. Well
  321. 11:52, this is information that you should
  322. 11:54always check, you have to consult. We
  323. 11:56can see it manually or in many cases,
  324. 11:58well, you could use tools like What.
  325. 12:01Wordweb is a tool that, at the terminal
  326. 12:04level, shows us a lot of information
  327. 12:06about a web page. Well, we can also
  328. 12:08find the version here. So, if we can't
  329. 12:14find it manually, it's advisable to
  330. 12:16also use these tools as a plan B,
  331. 12:18because maybe we can't see the version
  332. 12:20by looking at it, but hey, we have
  333. 12:21tools to be able to list it. Version
  334. 12:252219. Okay, perfect. Let's go to the
  335. 12:28internet now and I'm going to type CMS
  336. 12:31Mate simple version 2219 and we have to
  337. 12:34type exploit. Let's see if there are
  338. 12:37exploits to exploit this. And they do
  339. 12:41exist in version 2219. Let's look at
  340. 12:43something else now. CMS M simple latest
  341. 12:47version. Let's see the latest version
  342. 12:50of this CMS. And we can see that the
  343. 12:52latest version is 2219, that is, we are
  344. 12:55dealing with, well, let's say, a tool
  345. 12:57that is updated to the latest version,
  346. 13:00very updated. And even so, let's see
  347. 13:02how we can compromise it. Okay, perfect
  348. 13:05. Let's see what we have here. We have,
  349. 13:06well, look, for example, the first one
  350. 13:08is called simple, SSTI, a Site Template
  351. 13:11Injection server. Okay, perfect. Here
  352. 13:13we are seeing a little bit how this is
  353. 13:14exploited. Look, here it says," Hey,
  354. 13:16log in as the admin user and then go to
  355. 13:18the dising manager directory. "Okay, it
  356. 13:21goes through a few steps. I have a
  357. 13:22video on my channel explaining this
  358. 13:24vulnerability. Basically, if we test a
  359. 13:26paylot like MX, and we see that the web
  360. 13:29calculates and interprets it in the
  361. 13:31output, it means that it is vulnerable
  362. 13:34to SV6 Template Injection. What happens
  363. 13:37is that this does not imply that we
  364. 13:39already have remote command execution,
  365. 13:41it depends on other things, but anyway,
  366. 13:43it would be vulnerable. Well, what
  367. 13:45happens? Well, yes or yes, we have to
  368. 13:47log in as the admin user. So, let's do
  369. 13:49one thing. Let's copy the URL and fuze
  370. 13:52the CMS directory again. That is, we
  371. 13:55are not going to do it, let's say, to
  372. 13:57the IP, but now also to this directory.
  373. 13:59Let's go there. And here it does find
  374. 14:01many things. You see that the web
  375. 14:04fuzing technique is quite important.
  376. 14:06Well, we have an admin directory that
  377. 14:08right here in GitHub tells us that we
  378. 14:10have to log in as admin. In other words
  379. 14:13, let's see if we can access this panel
  380. 14:14. Let's go. to put admin. And perfect,
  381. 14:18we are seeing an admin panel, a login
  382. 14:20panel. We can try admin, for example,
  383. 14:23right? I mean, here you always have to
  384. 14:26try a few typical combinations, right?
  385. 14:28Root, root and cms for example. But no,
  386. 14:33I'm telling you no. Well, look at the
  387. 14:35error message. Username or password
  388. 14:37incorrect. Well, when I don't have any
  389. 14:40data, well, you can do brute force
  390. 14:42attacks. What happens? I could do it
  391. 14:45here with Hidra. Well, usually with
  392. 14:47Idla, when we do a brute force attack,
  393. 14:50whether it's SSH, FTP, MySQL, SMB, it's
  394. 14:52simple because it's always the same
  395. 14:54syntax, but when it comes to doing a
  396. 14:57brute force attack here on a website,
  397. 14:59things change a little and it gets a
  398. 15:01little bit complicated. Even so, we're
  399. 15:03going to see it here step by step. How
  400. 15:05can I do a brute force attack on a web
  401. 15:08login panel? Well, let's see a little
  402. 15:10how it's done. First, let's do a brute
  403. 15:11force attack on a web login panel.
  404. 15:12intercept this request with Bursuit.
  405. 15:14Bursuit is a proxy, that is, here I
  406. 15:16have Bursuit. Bursuit is a fairly
  407. 15:18essential tool in the context of web
  408. 15:20hacking and it is used first to
  409. 15:22intercept a request and then manipulate
  410. 15:25it. We can manipulate it, we can see
  411. 15:27how the information is sent, how it is
  412. 15:29processed behind the scenes and that is
  413. 15:31essential when exploiting a
  414. 15:32vulnerability, right? So, well, first I
  415. 15:34am going to open Bursuit because I want
  416. 15:36to see how this is being sent behind
  417. 15:37the scenes. Well, let's intercept.
  418. 15:40intercept is on. And now, inside the
  419. 15:42browser, in my case I use Firefox,
  420. 15:44let's go all the way down to where it
  421. 15:46says Network Settings, let's activate
  422. 15:48this: manual proxy configuration,
  423. 15:51saying:" Hey, from now on I want
  424. 15:53everything I do from the browser to go
  425. 15:55through the Bursuit proxy, which
  426. 15:57Bursuit runs on port 8080 of our local
  427. 15:59host by default. "Well, let's put it
  428. 16:02here and then right now, well, if I
  429. 16:05click submit here sending data, it will
  430. 16:08work. Look, admin, for example, admin
  431. 16:11submit and okay, perfect, we have
  432. 16:14received it with burso. Okay, now at
  433. 16:17this point, how can I, based on this
  434. 16:19information, specify it to Hydra, which
  435. 16:21is the tool used to perform brute force
  436. 16:23and make the attack work properly? Well
  437. 16:25, let's see a little bit about how it
  438. 16:26would be done. You see, the first thing
  439. 16:28will be to type hydra. Hydra-l and here
  440. 16:30, what happens is that we do not have a
  441. 16:32username or password, but in these
  442. 16:34cases, hey, we have to try to see if
  443. 16:37the admin user exists. So, we are going
  444. 16:39to type admin, which is usually a user
  445. 16:41that exists, it is worth testing. Well,
  446. 16:43we type men admin, we type men because
  447. 16:46the data that I do know is the data
  448. 16:48that we put in lowercase. And now gu p
  449. 16:51in uppercase, we put the data that I do
  450. 16:53not know, which is the password user
  451. 16:56ser gorlish, rogu, which is a
  452. 16:57dictionary that has many possible
  453. 17:00passwords. Okay, now next step. Well,
  454. 17:04here we are seeing that this request is
  455. 17:06being transmitted by post. Note here
  456. 17:07that it says post. Well then, this must
  457. 17:10be specified. You have to put http http
  458. 17:14post form. And now here we put a colon,
  459. 17:17slash, slash and we have to put exactly
  460. 17:19the path to get here. And well, what
  461. 17:21path is it? Well, this one here.
  462. 17:23cmsadminlogin.php. Perfect. We paste
  463. 17:26this and now here we put a colon and we
  464. 17:29have to put this here. username,
  465. 17:31password and login submit. We are going
  466. 17:34to copy this, we are going to paste it
  467. 17:35here. And now, yes, we are going to
  468. 17:37correct it. Okay, username is fine.
  469. 17:40Where it says admin, we are going to
  470. 17:42remove this and we have to put the
  471. 17:44circumflex symbol and we put uh user
  472. 17:46and close again, well, the circumflex
  473. 17:49symbol. Now we put password and in
  474. 17:51password we put exactly the same,
  475. 17:54circumflex and we put pass and
  476. 17:56circumflex again. And now a login
  477. 17:59submit equals submit. This is fine. And
  478. 18:02now we put a colon and we have to put
  479. 18:04basically the error message that
  480. 18:06appears for each failed login attempt
  481. 18:08because that way Hydra can know when an
  482. 18:10attempt has been successful and when
  483. 18:13not, that is something very important.
  484. 18:15So let's go here and paste it exactly
  485. 18:18as is. There it is. Username or
  486. 18:20password incorrect. Identical. We have
  487. 18:22to put everything the same. Well, if I
  488. 18:24execute this, we are going to do a
  489. 18:26little brute force attack. Well, it
  490. 18:28gives me a little error and okay, now I
  491. 18:29know why it failed and it is because I
  492. 18:31did not put the IP address. 172.17.0.2.
  493. 18:34A pretty silly mistake. And here now we
  494. 18:37put double slash and this should work
  495. 18:40correctly. We do the attack and well,
  496. 18:42it seems that it does, it seems to work
  497. 18:43. Done, it basically found the user
  498. 18:46adminate. Very good, let's test it.
  499. 18:49Let's go here to the browser, we put
  500. 18:51admin, password chocolate and let's see
  501. 18:53if it works. And it works. We are in.
  502. 18:55Perfect. Now, once this is done, we can
  503. 18:57follow the instructions of this exploit
  504. 18:59, because we are now inside the
  505. 19:01administration panel of this CMS. It
  506. 19:03says," Hey, log in as admin and then go
  507. 19:05to the out section. "Let's go to the
  508. 19:08Design Manager section. Design Manager
  509. 19:12and then Breath Cramps. Let's go here
  510. 19:14to Bridcamps which is here. Perfect.
  511. 19:16And it says now over here, okay? Well
  512. 19:18now, well, insert for example, uh this
  513. 19:21PU, for example, 7x and let's see if
  514. 19:23the calculation 49 is displayed within
  515. 19:26this URL. Let's test it. Let's remove
  516. 19:29all this. This outside. We paste this,
  517. 19:32click apply and well, now if we enter
  518. 19:35this URL of the index.php page
  519. 19:37templates, let's test it. Let's test it
  520. 19:40. We remove all this, paste this here
  521. 19:43and it works. Look, 49. We're seeing it
  522. 19:46here at this point. 49. Well, this is
  523. 19:48vulnerable to template injection, which
  524. 19:50you already know we have a video on my
  525. 19:52channel, since I did it a while ago.
  526. 19:54Let's go to Jitha. Jitha payloads all
  527. 19:57the things server temp injection. Let's
  528. 19:59see a little bit of the instructions.
  529. 20:01Here we have this wonderful repository
  530. 20:03that explains very well how to exploit
  531. 20:05this vulnerability in many different
  532. 20:07technologies. In this case, We are in
  533. 20:09PHP because this is a CMS that works
  534. 20:11with PHP. So, well, we have to locate
  535. 20:14ourselves here. PHP or Smarty or Dig,
  536. 20:16it depends on the template that is
  537. 20:18running behind. How can I check that?
  538. 20:21Well, by testing. Look, look, here it
  539. 20:23says," Hey, Smarty is, let's say, the
  540. 20:26PHP template. "Let's copy, for example,
  541. 20:28this, Smarty Version, and let's see if
  542. 20:30this interprets it for us. So, if this
  543. 20:32interprets it for us, well, we can
  544. 20:34confirm that the template is Smarty.
  545. 20:37Well, let's go. Here we paste this,
  546. 20:39apply it and right now, look, version
  547. 20:42421, it works. We are looking at a
  548. 20:45Smarty template. What happens? We are
  549. 20:47looking at version 4 421. And here,
  550. 20:49what happens? What is the issue? Well,
  551. 20:51look, look, here I could execute PHP
  552. 20:54commands, echo, ID, system, LS. And
  553. 20:56with this we could already do the
  554. 20:57intrusion, but what happens? Here it
  555. 20:59says compatible with version 3 and we
  556. 21:02are on version 4, so it will not work.
  557. 21:04I can do a test. I can paste this here,
  558. 21:07I click apply and we see that it does
  559. 21:10not work. Normally, it does not work,
  560. 21:12nothing happens. This website is
  561. 21:14vulnerable to CB7 Play Injeestion, but
  562. 21:16what happens is that from there we can
  563. 21:17derive it to an RC, to a remote
  564. 21:19execution of commands, that is already
  565. 21:20Another story. But hey, that's okay.
  566. 21:22Let's keep listing, let's go back and
  567. 21:24see what else we can do. CMSM simple
  568. 21:272219 remote code execution, remote
  569. 21:30command execution, exactly what we want
  570. 21:33. Well, log in as admin, go to the
  571. 21:35extensions section and go to user
  572. 21:37define tags. Let's go there. Let's go
  573. 21:39to the extensions section, user define
  574. 21:42tags. And it says," Okay, once you're
  575. 21:44there, well, for example, paste this
  576. 21:46hair here, which is the typical code in
  577. 21:47PHP to be able to execute a system
  578. 21:49command. For example, let's go here. "
  579. 21:51Okay, so we delete this code, this text
  580. 21:54, paste ours, and hit run. Yes. Okay,
  581. 21:58let's do it again. Let's see. And it
  582. 22:00works. Now, we are executing commands
  583. 22:03remotely. What happens when I manage to
  584. 22:06execute commands remotely? What is my
  585. 22:08goal? Well, my goal is to be able to
  586. 22:10get into the machine from here. How do
  587. 22:12we get in? By using a reverse proxy.
  588. 22:15There is a website called Repselles,
  589. 22:17which is 100%recommended. Here I can do
  590. 22:19something. I can first enter the IP of
  591. 22:22my attacking machine, which would be
  592. 22:24192.168.0.20, and for example, here I
  593. 22:27can enter a port to listen. Remember,
  594. 22:29if I want to know the IP of my
  595. 22:31attacking machine, we have the if
  596. 22:32config command. With the if config
  597. 22:34command. Here we are checking it.
  598. 22:36Interface eth0, the IP of my attacking
  599. 22:38machine, although in this case this one
  600. 22:41would have also worked, because we are
  601. 22:43using a Dockerlaps, in both cases it
  602. 22:46works, but anyway, I'm going to do it
  603. 22:48with this IP, point 20. Perfect. So
  604. 22:51let's copy all this from here. And well
  605. 22:54, if instead of the ID command I
  606. 22:56execute this, well, maybe we can get a
  607. 22:58reversal. And now with Netcat I start
  608. 23:01listening waiting for an incoming
  609. 23:03connection. And well, let's try it. If
  610. 23:05I send this, we send it. Well, nothing,
  611. 23:08again because this seems like it has to
  612. 23:10be clicked twice and mm it didn't work.
  613. 23:13It didn't work. Why didn't it work?
  614. 23:15Because this payload depends on the
  615. 23:17context, especially if we launch it
  616. 23:20from a web, it has to be encapsulated
  617. 23:22within bas C. And now, in quotes we put
  618. 23:25it like this. So, in this more
  619. 23:27encapsulated way, then it should work.
  620. 23:30Let's try it. We hit run. We see that
  621. 23:33nothing happens. Let's hit it again.
  622. 23:35And now it did work. We are now inside
  623. 23:38the machine. We have exploited two
  624. 23:40vulnerabilities, but one of them was an
  625. 23:42RCE, a remote command execution and
  626. 23:44That's what makes it so dangerous, well
  627. 23:46, having a website or something that is
  628. 23:48vulnerable to remote command execution,
  629. 23:50because that implies that we can enter
  630. 23:52the machine. Well, let's do a little
  631. 23:54TTI treatment, which is also a
  632. 23:56fundamental step when escalating
  633. 23:57privileges. What happens now? Well, if
  634. 23:59I type, for example, clear, you can see
  635. 24:01that this doesn't clear. If I type
  636. 24:02control C, I lose the connection. Well,
  637. 24:06how can I fix this? Well, I fix it this
  638. 24:08way, by doing TTI treatment. So, first,
  639. 24:11well, I'm going to go to the root and
  640. 24:14then we do script of nul minus cebas.
  641. 24:17We type this. Okay, now I type cr z
  642. 24:20stti raco. Fg. So now we type reset x
  643. 24:25term and right now I have to create two
  644. 24:27environment variables. Sport sell to
  645. 24:31base. We're going to use a base like
  646. 24:34sell and sport term equal to eh equal
  647. 24:37to x term. So now it's like this. Look,
  648. 24:39if I type control C. I don't lose the
  649. 24:41connection. If I can clear, the
  650. 24:43terminal is cleared. We're in now. Okay
  651. 24:46, what's the only thing? Okay, what's
  652. 24:48the last thing we need? Well, right now
  653. 24:50we have to put the columns. You see,
  654. 24:52let's go to my cali and put stt size.
  655. 24:57So, what I have to do is resize the
  656. 25:00size of this session, basically with
  657. 25:03the same dimension as my screen. So,
  658. 25:06well, it would be like this. Let's copy
  659. 25:08this 30 and this 134 and right now we
  660. 25:12put stti rowe. So rows are 30 and
  661. 25:15columns are 184. There we go. Now we
  662. 25:19have it. We already have 100%treatment
  663. 25:21of the TTI. Okay, now, what things do I
  664. 25:23have to do to be able to escalate
  665. 25:25privileges? Well, first we can execute
  666. 25:27the command sudo minus L, but it's not
  667. 25:29going to work to see if I can execute
  668. 25:31as root or as another user some binary
  669. 25:33or command. We can't. The second thing,
  670. 25:36basically execute binaries with suid
  671. 25:38enabled. Fine barrita perm errors to
  672. 25:44death null. I mean, this way, well, we
  673. 25:48could run binaries as root, but we
  674. 25:49can't because these that don't appear
  675. 25:51here are, let's say, normal. Well, what
  676. 25:54else can we look at? OPT directory,
  677. 25:56because hey, maybe there are
  678. 25:58interesting things here, right? But
  679. 26:00there are no hidden files either. Now
  680. 26:03let's look at the ETC Pass WD to see
  681. 26:05the existence of users in the system.
  682. 26:08There are none more. Well, we do have
  683. 26:10the CMS user, but this one, well, this
  684. 26:11one is nothing more. There are no more
  685. 26:13users. The only thing we have is the
  686. 26:16root user, su root, but we can't scale.
  687. 26:19What can we do at this point? Well,
  688. 26:21here we have two options. Well, on
  689. 26:23GitHub, a while ago I created this
  690. 26:26script which is sudo brosa, to a user
  691. 26:30within the Linux system, for example,
  692. 26:32to root or whoever. Well, you can
  693. 26:35simply pass it the Rogu, Mario user or
  694. 26:38root, whoever. In this case, it's root
  695. 26:40and this does brute force, right? And
  696. 26:41it finds the password, which, well,
  697. 26:43coincidentally, I put the same one, the
  698. 26:45password chocolate. Well, we can do
  699. 26:47that. In this case, I'm telling you
  700. 26:49that the password is chocolate, which
  701. 26:51is the same one that was inside the
  702. 26:53simple CMS M. Why did I do this?
  703. 26:55Because, well, password reuse is quite
  704. 26:57common and it's something that's worth
  705. 27:00keeping in mind at all times. When I
  706. 27:02come across a password, I should
  707. 27:03already have it in mind so that I can
  708. 27:05reuse it whenever I can. In that
  709. 27:07context, it's worth trying. So, the
  710. 27:09goal of this machine is also the same,
  711. 27:11to try reusing the same password,
  712. 27:13because as incredible as it may seem,
  713. 27:15it can work. How many people are there
  714. 27:18who, well, use the same password for
  715. 27:20everything? A lot, a lot of people. And
  716. 27:22I was the first one back in the day.
  717. 27:23Hey, be careful, hey, now it's won,
  718. 27:24obviously. Well, that's basically how
  719. 27:27an intrusion process is carried out on
  720. 27:29this machine, which is actually quite
  721. 27:31extensive, which is this machine, the
  722. 27:33Summer Vibes machine. I think it's very
  723. 27:35, very useful for understanding many
  724. 27:37things about hacking. Okay, let's
  725. 27:38remember, if I'm done with the machine,
  726. 27:41you know that in Dockerlabs, well, if I
  727. 27:43put control C in this autodeployment
  728. 27:45script, the script takes care of
  729. 27:46removing everything and we forget about
  730. 27:48it. This script is really wonderful,
  731. 27:51I'm really proud of it. I'm really
  732. 27:53proud of my little one. And well, look,
  733. 27:55there it is, it worked. Now there's no
  734. 27:57trace of this machine inside Docker.
  735. 28:00Look, well, there are many containers
  736. 28:02here, but these are for other things,
  737. 28:04right? It's because I'm doing a lot of
  738. 28:06machines and a lot of tests, so I don't
  739. 28:08care about this. Well, here we have the
  740. 28:10machine. As you know, guys. In
  741. 28:12Dockerlabs there are no flags, that is,
  742. 28:14there's no flash here like TR hand me
  743. 28:15hat from box in other tools. What there
  744. 28:17is is ROS, that is, when you make a
  745. 28:20machine, you can send me your right
  746. 28:22apps, well, let's put it this way. For
  747. 28:24example, this machine, the Summer
  748. 28:26machine. Vipes. Here we have, let's say
  749. 28:29, a small menu to send me your tutorial
  750. 28:31. You put the author and the URL. For
  751. 28:33example, if you have it on GitHub,
  752. 28:34Ritap, well, ideal. And that's how I
  753. 28:37would basically put it here in this
  754. 28:39section. So now you know that instead
  755. 28:41of having flags in Dockerlaps, what
  756. 28:43there are are rits, which I think is
  757. 28:45the best way to demonstrate that you
  758. 28:47have compromised a machine and that you
  759. 28:49have understood it by documenting
  760. 28:50everything, which is a very, very good
  761. 28:52practice. So, well, tremendous video,
  762. 28:55honestly, a pretty powerful video there
  763. 28:56, to say the least. I hope you have
  764. 28:58learned, I hope you have liked it. I
  765. 28:59really did. I think it is a video that
  766. 29:01summarizes very well an intrusion
  767. 29:03process from beginning to end and I
  768. 29:05think for those who are just starting
  769. 29:07out or also those who have been doing
  770. 29:09it for a while, I think you learn
  771. 29:10things, you learn things and it always
  772. 29:12comes in handy. Well, as you know, at
  773. 29:15DCAS we have a lot of machines, we have
  774. 29:17more In labs, we have a lot, and well,
  775. 29:19there will be many more each time, so
  776. 29:21here, well, you'll be able to practice
  777. 29:23a lot. And then here we have this from
  778. 29:26Cominum, which is a little surprise
  779. 29:27that I can't say anything more about. I
  780. 29:30won't say more, I won't say more, but
  781. 29:31well, I'll keep you informed right away
  782. 29:32. So, guys, I hope you liked it, I hope
  783. 29:34you learned, and I'll see you on this
  784. 29:36channel and on Twitch, because remember
  785. 29:38that we have Discord and Telegram
  786. 29:40channels, which are all in the video
  787. 29:41description. And then we also have a
  788. 29:43Twitch channel, where we go live twice
  789. 29:45or three times a week, depending, more
  790. 29:48or less live, so that we can learn
  791. 29:49everything, all together, this same
  792. 29:51thing, learning hacking. So, I'll say
  793. 29:53goodbye and I'll see you another time.
  794. 29:56Until next time. Yeah.

About this transcript

This page contains the full transcript of 🥷 Resumen de cómo DETECTAR y Explotar VULNERABILIDADES Paso a Paso | HACKING ÉTICO y Ciberseguridad by El Pingüino de Mario, generated from the public captions YouTube serves with the video. The transcript has 5,655 words across 794 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 translate the transcript into 100+ languages.

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, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.