YouTube2Text

Master Nmap in 27 Minutes: 60 Commands Every Hacker Needs — Transcript

by HackLab by CyberSentinel · 4,552 words · 764 segments · language en · Watch on YouTube

Full transcript

  1. 0:00This is Sentinel. 60 Nmap commands, 27
  2. 0:03minutes, one live lab. No boring theory,
  3. 0:06no endless slides, just real commands,
  4. 0:08real targets, and real [music] results.
  5. 0:10We're testing network discovery, stealth
  6. 0:12techniques, firewall behavior, and
  7. 0:14attack surfaces across isolated Windows,
  8. 0:16Ubuntu, and Metasploitable machines.
  9. 0:18Everything is running inside a private
  10. 0:20VirtualBox lab for educational purposes.
  11. 0:2260 commands, 27 minutes. Let's start.
  12. 0:25Command one, the foundation. The most
  13. 0:27basic scan. We just type Nmap followed
  14. 0:30by our target IP, 192.168.56.106.
  15. 0:35Why start here? Because by default, Nmap
  16. 0:38automatically scans the top 1,000 most
  17. 0:40common TCP ports. Look at the screen. In
  18. 0:42just 2.27 seconds, we have our result.
  19. 0:45The system tells us 998 ports are
  20. 0:48closed, but port 22 for SSH and port
  21. 0:513,000 for PPP are wide open. In a
  22. 0:54real-world external pen test, these two
  23. 0:56open ports would be our immediate attack
  24. 0:58vectors. This is basic reconnaissance.
  25. 1:00Command two, who else is hiding on our
  26. 1:03network? In a real scenario, you rarely
  27. 1:05know your target's exact IP up front. We
  28. 1:07need to map the environment. We use the
  29. 1:09dash SN flag, also known as a ping scan.
  30. 1:12We are telling Nmap, "Don't waste time
  31. 1:14checking ports. Just sweep the entire
  32. 1:16subnet and tell me who is alive." Look
  33. 1:18at the output. In 7.42 seconds, it swept
  34. 1:21all 256 addresses, and we have exactly
  35. 1:24six active hosts on our network. This
  36. 1:27confirms our primary targets at the 105,
  37. 1:29106, and 107 addresses are up and
  38. 1:32running. Command three, surgical
  39. 1:34precision. Sometimes we don't need all
  40. 1:37the noise. If you're specifically
  41. 1:38hunting for web servers, scanning
  42. 1:40thousands of ports will just trigger the
  43. 1:42admin's alarms. To stay quiet and save
  44. 1:44time, we use the dash P flag followed by
  45. 1:46port 80. Our request to the
  46. 1:48Metasploitable machine came back in just
  47. 1:502.12 seconds, confirming that port 80 is
  48. 1:53indeed open for HTTP traffic. Fast,
  49. 1:56clean, and highly targeted. Command
  50. 1:57four, scanning a specific range. What if
  51. 2:00we only want to check the most critical
  52. 2:02system ports? They usually reside within
  53. 2:04the first thousand. By typing {dash} P1
  54. 2:07{dash} 1000, we scan our Windows 10
  55. 2:09machine strictly within this boundary.
  56. 2:12The result shows that out of 1000 ports,
  57. 2:14995 are closed, but critical Windows
  58. 2:17services like port 80, 135 for MSRP, 139
  59. 2:22for NetBIOS, 443, and 445 are sitting
  60. 2:26wide open. We know exactly where to
  61. 2:28strike. Command five, the exhaustive
  62. 2:30[music]
  63. 2:31sweep. Nothing stays hidden. Imagine a
  64. 2:33clever sysadmin hiding critical services
  65. 2:36on high, non-standard ports to avoid
  66. 2:38detection. How do we find them? We use
  67. 2:40{dash} P {dash}. That single {dash}
  68. 2:43tells Nmap to relentlessly scan every
  69. 2:45single one of the 65,535
  70. 2:48available TCP ports. It's loud, [music]
  71. 2:50but it works. Look at the result. In
  72. 2:5214.21 seconds, we've exposed every
  73. 2:55secret on the Metasploitable system.
  74. 2:57We're not just seeing the standard port
  75. 2:5922 or 80. We've uncovered unknown
  76. 3:01services hiding way up on ports 8180,
  77. 3:048787, and even 53541.
  78. 3:07Command six, the mistake. In
  79. 3:09cybersecurity, one missing letter can
  80. 3:12ruin an operation. Watch the screen
  81. 3:14closely. I tried to scan a TCP port 80
  82. 3:17and a UDP port 53 at the same time. But
  83. 3:19look, a yellow wing ring popped [music]
  84. 3:21up in the terminal. What is Nmap telling
  85. 3:23us? You requested a UDP port, but you
  86. 3:26forgot to include the {minus} SU flag
  87. 3:28for UDP scanning. Look how smart this
  88. 3:30tool is. It caught the error, ignored
  89. 3:32the UDP request, and just returned the
  90. 3:34TCP result. Always double-check your
  91. 3:36syntax. Command seven, the race against
  92. 3:39time. In live operations, time is your
  93. 3:41most expensive resource. If you don't
  94. 3:43have time for a full 1000 port scan, you
  95. 3:45use {dash} F for fast mode. Nmap uses
  96. 3:48its internal database to filter down and
  97. 3:50scan only the top 100 most commonly
  98. 3:52exploited ports in the world. And the
  99. 3:54result? Our Windows 10 machine was
  100. 3:57scanned in a blazing 3.23 seconds,
  101. 3:59handing us the most critical attack
  102. 4:01surfaces on a silver platter. Command
  103. 4:03eight, live monitoring. When your scan
  104. 4:05is targeting hundreds of machines and
  105. 4:06taking hours, you can't just stare at a
  106. 4:08blank terminal. You need to see what the
  107. 4:10system is doing in the background. We
  108. 4:12achieve this with dash V for versus
  109. 4:14mode. Now, instead of waiting until the
  110. 4:16very end, Nmap instantly prints
  111. 4:18discovered open port to the screen the
  112. 4:20exact millisecond it finds one. This
  113. 4:22gives you absolute real-time control
  114. 4:24over the operation.
  115. 4:28Command nine, the microscopic view. If
  116. 4:31one dash V gives you updates, what does
  117. 4:33double verbose dash VV do? It explains
  118. 4:36exactly why Nmap is making its
  119. 4:37decisions. Pay attention to the output.
  120. 4:40It doesn't just say port 22 is open. It
  121. 4:42explains why it thinks it's open,
  122. 4:44explicitly stating syn-ack TTL 64. This
  123. 4:47means the target server actively replied
  124. 4:49to our probe with a positive syn-ack
  125. 4:51flag. You aren't just using a tool, you
  126. 4:53are watching network protocols talk to
  127. 4:55each other. Command 10, the missing
  128. 4:57list. Mass scanning.
  129. 5:00Hackers don't sit there typing dozens of
  130. 5:02IP addresses manually. They load them
  131. 5:04all into a text file and feed it to the
  132. 5:06scanner. Let's type -iL
  133. 5:10throws an error. Failed to open input
  134. 5:13file targets.txt.
  135. 5:15File not found. The reason is simple. I
  136. 5:17forgot to actually create the target
  137. 5:19list file before running the command.
  138. 5:21The software won't think for you. Always
  139. 5:23prep your workspace and verify your
  140. 5:25files before launching an attack.
  141. 5:26Command 11, full connection, loud but
  142. 5:29reliable.
  143. 5:30The most classic port scanning method is
  144. 5:32-sT, the TCP connect scan. Nmap
  145. 5:36completes the full three-way handshake
  146. 5:38with every single port. It's incredibly
  147. 5:40reliable, but I guarantee you will leave
  148. 5:42massive footprints in the target's
  149. 5:44firewall logs. Let's check the screen.
  150. 5:46In 2.29 seconds, we successfully mapped
  151. 5:49every open port on the Metasploitable
  152. 5:50system from 21 FTP all the way up to
  153. 5:538180. Command 12, ninja mode. What if
  154. 5:57you don't want to end up in the security
  155. 5:58logs? We use {dash} SS, the SYN stealth
  156. 6:01scan. In this mode, Nmap never finishes
  157. 6:04the connection. It sends a SYN packet,
  158. 6:06gets the response, and immediately drops
  159. 6:08the connection before it's logged. On
  160. 6:10our Ubuntu machine, this command
  161. 6:11executed in a stealthy 2.22 seconds,
  162. 6:14silently finding port 22 and port 3000
  163. 6:17without raising alarms. Command 13, the
  164. 6:20UDP headache. Watch carefully. We are
  165. 6:22scanning UDP ports with {dash} SU.
  166. 6:24[music]
  167. 6:25Notice how the process completely froze.
  168. 6:27Look at the terminal. 6 minutes and 36
  169. 6:29seconds have passed, and Nmap says it's
  170. 6:31only 45.53%
  171. 6:34done. Why? Because UDP is
  172. 6:36connectionless. Firewalls silently
  173. 6:38swallow the packets, and Nmap just sits
  174. 6:40there waiting, thinking maybe the packet
  175. 6:42got lost, retrying endlessly. We are
  176. 6:44hitting control plus C. We don't have
  177. 6:46time for this. Command 14, the UDP speed
  178. 6:49hack. Let's take control. To make UDP
  179. 6:52scanning viable, we add {dash} F to scan
  180. 6:54only the top 100 ports, and {dash} T4 to
  181. 6:57force aggressive timing. Even though
  182. 6:59Nmap warns us about retransmission cap
  183. 7:01hit, we pulled the results in just 31.08
  184. 7:04seconds.
  185. 7:05>> [music]
  186. 7:05>> We successfully confirmed that the 137
  187. 7:07NetBIOS {dash} NS port is wide open via
  188. 7:10UDP on our Windows 10 machine. Command
  189. 7:1215, unmasking the services. Knowing a
  190. 7:15port is open is useless if you don't
  191. 7:17know what's running behind it. We need
  192. 7:19the exact software version to find
  193. 7:20[music] an exploit. The {dash} SV flag
  194. 7:23performs service version detection.
  195. 7:25In 13.93 seconds, it revealed that port
  196. 7:2821 isn't just FTP, it's explicitly
  197. 7:31running vsftpd 2.3.4, and port 80 is
  198. 7:34running Apache HTTPD 2.2.8. This is
  199. 7:37exactly the intelligence a hacker needs
  200. 7:39to find a working payload. Command 16,
  201. 7:42the deep interrogation. In our previous
  202. 7:44scans, Ubuntu's port 3000 just showed up
  203. 7:47as a generic PPP service. Let's apply
  204. 7:49pressure by adding missions intensity
  205. 7:51five. We force Nmap to interrogate the
  206. 7:53port heavily. Look at the screen. In
  207. 7:5613.58 seconds, Nmap didn't just identify
  208. 7:59the service. It ripped the raw HTML code
  209. 8:01right out of the web page, fully
  210. 8:03exposing that the famous vulnerable
  211. 8:04OWASP Juice Shop application is running
  212. 8:07there. That is brilliant analysis.
  213. 8:09Command 17, the light touch. If high
  214. 8:11intensity alerts the target or takes too
  215. 8:13long, you use version light. We scanned
  216. 8:16our Windows 10 machine using this fast
  217. 8:18lightweight method. In 16.76 seconds, we
  218. 8:21easily identified Apache HTTPD 2.4.58 on
  219. 8:25port 80 and the MariaDB database running
  220. 8:27on port 3306.
  221. 8:29Command 18, maximum effort. Let's
  222. 8:32unleash Nmap completely. The version all
  223. 8:34flag throws every single detection probe
  224. 8:36in Nmap's database at the target. In
  225. 8:3913.6 e-ro seconds, we stripped the
  226. 8:41Metasploitable system bare, generating a
  227. 8:43highly detailed report that exposes
  228. 8:45exact database versions like MySQL
  229. 8:485.0.51a
  230. 8:51and PostgreSQL 8.3.0.
  231. 8:54Command 19, two birds, one stone. Why
  232. 8:57run two scans when you can run one? We
  233. 8:59combine version detection -sV and
  234. 9:02operating system detection -O. In just
  235. 9:0414.97 seconds, we needed to know what
  236. 9:07architecture our Ubuntu system was
  237. 9:08running. Nmap proudly prints operating
  238. 9:11system details, Linux 4.15.5.19,
  239. 9:14[music]
  240. 9:14right to the terminal. We now hold the
  241. 9:16target's complete technical passport.
  242. 9:18Command 20, aggressive mode. This is why
  243. 9:20Nmap is the king of scanners. We trigger
  244. 9:23the -A flag. With one command, it
  245. 9:25simultaneously performs OS detection,
  246. 9:27version scanning, script scanning, and
  247. 9:29traceroute. Look at this massive
  248. 9:3128-second analysis.
  249. 9:33>> [music]
  250. 9:33>> It instantly warns us that anonymous FTP
  251. 9:35login allowed is wide open, identifies
  252. 9:37the exact Samba smbd 3.0.20 version, and
  253. 9:41even dumps the expiration dates of the
  254. 9:43SSL certificates. This isn't just a port
  255. 9:45scan. It's a full-scale intelligence
  256. 9:47operation. Command 21, targeting Windows
  257. 9:50SMB. If we are hunting Windows networks,
  258. 9:53we focus on the weakest links. Ports 139
  259. 9:56and 445 are the standard for file
  260. 9:59sharing and printers via the SMB
  261. 10:01protocol. In just 8.71 seconds, we
  262. 10:04confirm that both the NetBIOS SSN and
  263. 10:07Microsoft DS services are active on our
  264. 10:09Windows 10 target. Why is this critical?
  265. 10:12Because devastating ransomware, like
  266. 10:13WannaCry and the EternalBlue exploit,
  267. 10:15use these exact ports to compromise
  268. 10:17millions of systems worldwide.
  269. 10:20Command 22, OS fingerprinting. Let's
  270. 10:23find out exactly what build of Windows
  271. 10:25we are dealing with. The dash O command
  272. 10:27analyzes the specific way the target
  273. 10:29responds to TCP UDP packets, its
  274. 10:31fingerprint, to determine the OS. In
  275. 10:344.71 seconds, Nmap confidently mapped
  276. 10:37this machine as Microsoft Windows 10,
  277. 10:39specifically pinning it between builds
  278. 10:411709 and 21H2. This level of detail even
  279. 10:44hints at whether the system is fully
  280. 10:46patched.
  281. 10:47Command 23, the art of guessing.
  282. 10:50Systems don't always give themselves up
  283. 10:53easily. Hardened servers often drop
  284. 10:55packets to avoid detection. What do we
  285. 10:57tell Nmap to do? We use double dash
  286. 10:59Oscan-guess to allow it to make an
  287. 11:01educated assumption.
  288. 11:03In 3.58 seconds, Nmap analyzed the
  289. 11:06Metasploitable machine and
  290. 11:07cross-referenced its database to guess
  291. 11:09that it is running a Linux kernel
  292. 11:10between 2.6.9
  293. 11:12and 2.6.33.
  294. 11:14Even when the scanner isn't 100% sure,
  295. 11:17it gives you the best possible
  296. 11:18intelligence.
  297. 11:20Command 24, the time-saver. When
  298. 11:23auditing a corporate network with
  299. 11:25thousands of endpoints, you cannot
  300. 11:26afford to waste time analyzing dead
  301. 11:28hosts. The double dash Oscan-limit flag
  302. 11:32is irreplaceable.
  303. 11:33It tells Nmap to only attempt OS
  304. 11:35detection on hosts that have at least
  305. 11:37one open and one closed port, the
  306. 11:39perfect conditions for an accurate read.
  307. 11:41Our Ubuntu machine met the criteria, and
  308. 11:43in 3.62 seconds, its Linux 4.15.5.19
  309. 11:48identity was confirmed.
  310. 11:51Command 25, mapping the route. How far
  311. 11:54away is our target? Seeing the routers
  312. 11:56and hops between our machine and the
  313. 11:57target is vital for security analysis.
  314. 12:00We use the double-dash traceroute
  315. 12:01command to map the path. Look at the
  316. 12:03screen under the traceroute section. Our
  317. 12:05target is just one hop away, sitting at
  318. 12:07a 3.19 ms distance.
  319. 12:09>> [music]
  320. 12:09>> If we were scanning across the internet,
  321. 12:11you would see dozens of intermediate IP
  322. 12:13addresses listed here.
  323. 12:15Command 26, the invisible trace.
  324. 12:18What if you want to find the exact route
  325. 12:20to a device without poking its ports and
  326. 12:22triggering security alarms? We combine
  327. 12:24{dash}sn, do not port scan, with
  328. 12:26double-dash traceroute. Instantly, in
  329. 12:28just 2.08 seconds, we mapped the
  330. 12:31location of the Ubuntu machine with a
  331. 12:32blazing 0.74 ms ping speed, a flawless
  332. 12:36geographical trace with absolutely zero
  333. 12:38port noise.
  334. 12:41Command 27, local network dominance.
  335. 12:44>> [music]
  336. 12:44>> On a local area network, standard IP
  337. 12:46packets aren't always the best choice.
  338. 12:48ARP scanning is the ultimate guaranteed
  339. 12:51method for local discovery.
  340. 12:53The {if}tpr command sweeps the network
  341. 12:55using ARP requests, which no local
  342. 12:57operating system firewall can block or
  343. 12:59hide from. Although sweeping the entire
  344. 13:01subnet took 2.13 seconds, the result is
  345. 13:04definitive. Out of 256 possible
  346. 13:06addresses, it mapped exactly six active
  347. 13:08devices in real time.
  348. 13:11Command 28, bypassing ICMP blocks. What
  349. 13:15do you do when a strict firewall blocks
  350. 13:17all traditional ICMP pings? Most
  351. 13:19computers will appear dead to the
  352. 13:21scanner. This is where UDP ping shines.
  353. 13:23Using {dash}pu53, we send a probe
  354. 13:26directly to port 53, the DNS port.
  355. 13:28Firewalls almost always allow DNS
  356. 13:30traffic through and look at [music]
  357. 13:32that, the Windows 10 machine revealed
  358. 13:34itself returning a response in just
  359. 13:350.022 s latency confirming the host is
  360. 13:39up.
  361. 13:41Command 29, the classic ping.
  362. 13:44Sometimes the simplest tool is the most
  363. 13:46reliable. We use the dash PE flag to
  364. 13:48send a standard ICMP echo request to the
  365. 13:51target. This is the most widely used
  366. 13:53method to verify if a system is online.
  367. 13:56As you can see on the terminal, the
  368. 13:57Metasploitable system replied in 2.29
  369. 13:59seconds proving our request traveled and
  370. 14:02returned with a latency of just 0.0020
  371. 14:05s. Command 30, Nmap's x-ray machine.
  372. 14:08Watch the screen closely. If you want to
  373. 14:10see exactly what Nmap is doing behind
  374. 14:12the scenes, double dash packet dash
  375. 14:14trace is your x-ray vision. Look at this
  376. 14:16massive flood of data hitting the
  377. 14:18terminal.
  378. 14:19From the initial ARP requests to
  379. 14:20hundreds of TCP connections, you see
  380. 14:22every sent and RCVD line. We are
  381. 14:25watching every single byte of data
  382. 14:27leaving our machine and returning from
  383. 14:28the target live.
  384. 14:30When a scan fails or a firewall blocks
  385. 14:32you, elite engineers read this raw
  386. 14:33traffic trace to find the exact point of
  387. 14:35failure.
  388. 14:37Command 31, exposing the reasoning.
  389. 14:40How does Nmap actually know a port is
  390. 14:41open?
  391. 14:42It doesn't just guess. By adding the
  392. 14:44double reason flag, we force the scanner
  393. 14:46to justify its results. Look at the
  394. 14:48terminal. Next to every open port, it
  395. 14:50explicitly prints SYNACKTTL64.
  396. 14:54This proves that the target machine
  397. 14:55actively responded to our TCP SYN
  398. 14:58packets with an acknowledgement. Trust,
  399. 15:00but verify.
  400. 15:03Command 32. Unleashing the Nmap
  401. 15:06scripting engine. Port scanning is just
  402. 15:08the beginning. The dash SC flag runs a
  403. 15:10batch of default safe scripts against
  404. 15:12the target. It's like sending an army of
  405. 15:14automated mini hackers. In 79.83
  406. 15:17seconds, it extracted SSH host keys,
  407. 15:20identified the MySQL salt, and flagged
  408. 15:22that anonymous FTP login is permitted.
  409. 15:25We are moving from reconnaissance to
  410. 15:26active vulnerability hunting.
  411. 15:30Command 33, auditing authentication. We
  412. 15:33want to know how the target system
  413. 15:35allows users to log in. We run the
  414. 15:37authentication scripts against our
  415. 15:38Ubuntu machine. Instantly, Nmap probes
  416. 15:41the SSH service on port 22 and reveals
  417. 15:44the supported authentication methods,
  418. 15:46public key [music] and password. It even
  419. 15:48checks if any public keys are accepted
  420. 15:50by default. This tells us exactly which
  421. 15:53brute force methods might work.
  422. 15:55Command 34, the system crash. Watch
  423. 15:57closely. I trigger the default and safe
  424. 15:59scripts simultaneously and the terminal
  425. 16:02completely crashes. ZSH segmentation
  426. 16:05fault. This is raw cyber security.
  427. 16:08Sometimes, the scripts within Nmap have
  428. 16:10memory management conflicts with the
  429. 16:12operating system when querying specific
  430. 16:13targets. When your tools break, [music]
  431. 16:15you don't panic. You drop the unstable
  432. 16:17script and move to the next vector.
  433. 16:20Command 35, hitting Windows where it
  434. 16:22hurts. When you are auditing a corporate
  435. 16:24environment, the SMB protocol is usually
  436. 16:27your gold mine. Instead of just guessing
  437. 16:29the OS, we run the SMB OS discovery
  438. 16:32script. In exactly 2.69 seconds, Nmap
  439. 16:36reaches directly into the Windows 10
  440. 16:37machine and pulls out the exact
  441. 16:39operating system details over the
  442. 16:40network.
  443. 16:41>> [music]
  444. 16:41>> If a system administrator left SMB
  445. 16:43exposed, they just gave us the blueprint
  446. 16:45to their machine.
  447. 16:48Command 36.
  448. 16:50>> [music]
  449. 16:50>> Now that we know it's Windows, we throw
  450. 16:51every known SMB vulnerability script at
  451. 16:53it using the wildcard SMB-VULN asterisk.
  452. 16:57This checks for devastating flaws like
  453. 16:59MS10-061.
  454. 17:01But, look at the result taking 7.75
  455. 17:03seconds. Could not negotiate a
  456. 17:05connection. Failed to receive bytes.
  457. 17:07What does this mean? The Windows 10
  458. 17:09firewall or patching system actively
  459. 17:11rejected the malicious payload
  460. 17:13negotiation. The defense held up. We
  461. 17:15have to find another way in.
  462. 17:18Command 37, reading the web without
  463. 17:20opening a browser. If you visit a
  464. 17:22target's IP in Google Chrome, you leave
  465. 17:24browser fingerprints in their access
  466. 17:26logs. We don't want that. We target port
  467. 17:2880 using the HTTP-title script. In just
  468. 17:322.20 seconds, Nmap quietly grabs the
  469. 17:35hidden webpage title, returning
  470. 17:36Metasploitable 2 Linux. We now know
  471. 17:39exactly what web application framework
  472. 17:41is running without ever visiting the
  473. 17:42site.
  474. 17:44Command 38, web administrators often
  475. 17:47think hiding a folder makes it secure.
  476. 17:49Let's prove them wrong. We use the
  477. 17:51HTTP-enum script to blindly brute force
  478. 17:54hidden directories [music] on the web
  479. 17:55server. In just 4.97 seconds, Nmap
  480. 17:58exposes critical unlinked folders. Look
  481. 18:01at the terminal. /phpmyadmin/,
  482. 18:04/doc/, and /tikiwiki/
  483. 18:07are sitting right there. We just mapped
  484. 18:09the web server's internal admin
  485. 18:10structure without a single click.
  486. 18:13Command 39, testing the front doors.
  487. 18:16File Transfer Protocol on port 21 is
  488. 18:18notorious for misconfigurations. The
  489. 18:21FTP-anon script checks the most common
  490. 18:23one. Look at the output. Anonymous FTP
  491. 18:25login allowed.
  492. 18:26>> [music]
  493. 18:27>> The server is literally letting anyone
  494. 18:28log in without a password. In a
  495. 18:30real-world scenario, this is where you
  496. 18:32drop a reverse shell or extract
  497. 18:34sensitive company data. Command 40, the
  498. 18:36brute force assault. If there are no
  499. 18:38easy misconfigurations, we force our way
  500. 18:40in. We launch a relentless SSH brute
  501. 18:43attack against the Ubuntu system. Look
  502. 18:45at the terminal. This is automated
  503. 18:47intrusion in real time. Nmap is firing
  504. 18:49hundreds of login combinations per
  505. 18:51minute. Root, root, admin, admin, user,
  506. 18:54password. It is actively battering the
  507. 18:56SSH port, testing the strength of the
  508. 18:58target's password policy.
  509. 19:05Command 41, moving to the back end.
  510. 19:08Databases are the crown jewels of any
  511. 19:10network. We aim at port 3,306
  512. 19:13and run my SQL {dash} info in a
  513. 19:16lightning fast 2.14 seconds. We don't
  514. 19:18just see that my SQL is open. We pull
  515. 19:21the exact 5.0.51
  516. 19:23{a-3} Ubuntu 5 version, its
  517. 19:25capabilities, and most dangerously, we
  518. 19:27expose its cryptographic salt. We are
  519. 19:29gathering the puzzle pieces needed to
  520. 19:31break their encryption. Command 42, the
  521. 19:34holy grail. We drop the hammer. We run
  522. 19:36the legendary double script vault.
  523. 19:38Notice how this scan takes much longer,
  524. 19:40nearly 5 and 1/2 minutes. It is
  525. 19:42aggressively testing the system against
  526. 19:44a massive database of known exploits.
  527. 19:46And look at the screen bleed red. The
  528. 19:48scan rips the target apart, revealing
  529. 19:50the infamous vsftpd version 2.3.4
  530. 19:53backdoor, the SSL poodle information
  531. 19:56leak, and CCS injection. It even found a
  532. 19:58trojan unreal IRCD backdoor. This
  533. 20:01machine is completely compromised.
  534. 20:03Command 43, Nmap is not just a scanner,
  535. 20:06it is a weapon. Finding a hole is one
  536. 20:08thing, proving it can be breached is
  537. 20:09another. By running the exploit script,
  538. 20:12we command Nmap to actively test the
  539. 20:13attack vectors it just found. In 42
  540. 20:16seconds, it verifies the vsftpd backdoor
  541. 20:19and attempts to establish a foothold. We
  542. 20:21have crossed the line from passive
  543. 20:22reconnaissance to active exploitation.
  544. 20:25Command 44, the raw reality of hacking.
  545. 20:28Watch closely. I try to run the not
  546. 20:30intrusive scripts against our Ubuntu
  547. 20:31target and boom, the terminal completely
  548. 20:34crashes, throwing a ZSH segmentation
  549. 20:36fault. This is unfiltered cybersecurity.
  550. 20:39Sometimes, complex script loads cause
  551. 20:41memory management failures between Nmap
  552. 20:43and your operating system. When your
  553. 20:44tools break in the field, you don't
  554. 20:46panic. You adapt, drop the unstable
  555. 20:48script, and keep moving.
  556. 20:52Command 45, the human error. I command
  557. 20:55Nmap [music] to execute a highly
  558. 20:57targeted brute force attack using my own
  559. 20:59custom dictionaries. The result, error
  560. 21:01parsing username list users.txt, no such
  561. 21:04file or directory. I failed to prepare
  562. 21:06my payload files before launching the
  563. 21:07attack. The scanner is an unforgiving
  564. 21:09machine. It demands absolute precision.
  565. 21:12Always prep your workspace.
  566. 21:14Command 46, the privilege block. I try
  567. 21:17to update the Nmap vulnerability
  568. 21:18database to get the latest scripts by
  569. 21:20typing double-script-updatedb.
  570. 21:23The system fires back, permission
  571. 21:25denied. Why? Because modifying the core
  572. 21:27security database requires root
  573. 21:29privileges. You cannot bypass local
  574. 21:31security policies without using sudo.
  575. 21:33It's a reminder that even the attacker
  576. 21:35must follow the rules of their own
  577. 21:36operating system.
  578. 21:39Command 47, advanced evasion tactics.
  579. 21:42How do we bypass a strict intrusion
  580. 21:44detection system? We shatter our
  581. 21:46footprint. The dash f flag fragments our
  582. 21:49IP packets into tiny 8-byte pieces.
  583. 21:52When these broken fragments hit the
  584. 21:53firewall, it becomes incredibly hard for
  585. 21:55defensive filters to assemble and read
  586. 21:57the malicious signature. In 2.82
  587. 21:59seconds, we slip right through the net.
  588. 22:01Command 48, total control over the
  589. 22:04network layer. To be stealthier than
  590. 22:06standard fragmentation, we use
  591. 22:08double-mtu-24.
  592. 22:10This manually forces the maximum
  593. 22:12transmission unit to just 24 bytes. The
  594. 22:15result [music] is a highly customized
  595. 22:16and unusual packet stream, and Windows
  596. 22:1910's deep packet inspection is
  597. 22:20completely blinded by the weird traffic.
  598. 22:22We retrieve the open ports in just 2.64
  599. 22:25seconds. Command 49, smoke and mirrors.
  600. 22:28If you don't want the admin to block
  601. 22:30your IP, you mask it. [music] We use the
  602. 22:32dash drnd:10
  603. 22:34flag. This incredible feature hides our
  604. 22:36real scan behind 10 randomly generated
  605. 22:39fake IP addresses. When the Ubuntu
  606. 22:41server's security logs check who's
  607. 22:42scanning them, they see a chaotic flood
  608. 22:44of 11 different IP addresses, making it
  609. 22:47nearly impossible to pinpoint the real
  610. 22:49attacker. Command 50, framing the
  611. 22:51innocent. Random IPs are good, but
  612. 22:53specific decoys are [music] better. We
  613. 22:55tell Nmap to make the scan look like
  614. 22:57it's coming from the Windows machine,
  615. 22:58the Ubuntu machine, and our real IP
  616. 23:01labeled as me all at the same time. The
  617. 23:04Metasploitable system thinks its own
  618. 23:05trusted network neighbors are attacking
  619. 23:07it. This is how you weaponize internal
  620. 23:09[music] trust.
  621. 23:11Command 51, the total spoofing attempt.
  622. 23:14We try to completely fake our source IP
  623. 23:16using the dash S flag, making it look
  624. 23:18like the Windows machine is doing the
  625. 23:20scan alone. But Nmap throws a critical
  626. 23:22warning, "Failed to determine route."
  627. 23:24This is a vital networking lesson. You
  628. 23:26cannot perfectly spoof an IP address if
  629. 23:29your machine's routing table isn't
  630. 23:30explicitly configured to handle the
  631. 23:32return traffic for the deception. The
  632. 23:34packet can be faked, but the network
  633. 23:36still needs a route back. Command 52,
  634. 23:38disguising the attack vector. Firewalls
  635. 23:41are paranoid, but they often blindly
  636. 23:43trust certain types of traffic like DNS.
  637. 23:46By using {dash} {dash} source port 53,
  638. 23:49we manipulate our packets so the
  639. 23:50firewall thinks our invasive scan is
  640. 23:52just harmless domain name system
  641. 23:54traffic. The security rules let us right
  642. 23:56in, and we map the target in just 2.64
  643. 23:59seconds. Command 53, breaking the
  644. 24:01signatures. Advanced firewalls know what
  645. 24:03a standard Nmap packet looks like based
  646. 24:05on its exact size. So, we change the
  647. 24:08size.
  648. 24:08>> [music]
  649. 24:09>> After a quick typo correction in the
  650. 24:10terminal, we use {dash} {dash} data
  651. 24:12length 25. This injects 25 bytes of
  652. 24:15random garbage data into every packet.
  653. 24:17The firewall's signature database no
  654. 24:19longer recognizes our traffic, and we
  655. 24:21bypass the alarm systems. Command 54,
  656. 24:23scrambling the radar. When you scan an
  657. 24:25entire subnet, going sequentially from
  658. 24:27IP.1 to 255 can trigger automated
  659. 24:30defense systems almost instantly
  660. 24:32>> [music]
  661. 24:32>> because the traffic looks artificial. We
  662. 24:34use {dash} {dash} randomize hosts to
  663. 24:36scramble the scanning order across 256
  664. 24:39IP addresses. Instead of moving in a
  665. 24:41predictable sequence, the scan sweeps
  666. 24:43across the network in a completely
  667. 24:44unpredictable, chaotic pattern, making
  668. 24:46it much harder for sequential detection
  669. 24:48algorithms to identify the scanning
  670. 24:50pattern.
  671. 24:52Command 55, probing the armor. At At
  672. 24:55local network layer, your MAC address is
  673. 24:57your true identity. We try to spoof it
  674. 24:59to an unknown vendor using {dash} {dash}
  675. 25:02{spoof} {dash} {MAC} zero, but look at
  676. 25:04the result. Host seems down. The Windows
  677. 25:06firewall or the network switch caught
  678. 25:08the unusual MAC address and dropped our
  679. 25:10connection. This is an important
  680. 25:12security lesson. True security systems
  681. 25:15don't just watch IP addresses, they
  682. 25:17watch the hardware, too. Command 56,
  683. 25:19testing packet integrity. We send
  684. 25:22intentionally corrupted packets using
  685. 25:24{dash} {dash} bad sum. If a system
  686. 25:26replies to a packet with a bad checksum,
  687. 25:28it can reveal that the traffic isn't
  688. 25:29being properly filtered, but our target
  689. 25:31ignores all 1,000 ports returning
  690. 25:34filtered. That tells us something
  691. 25:35important. A security device is sitting
  692. 25:37in front of the target inspecting the
  693. 25:39traffic before it reaches the host.
  694. 25:41Every packet is being checked and
  695. 25:43anything that fails the integrity check
  696. 25:44is dropped.
  697. 25:46Command 57, mapping the rules. The
  698. 25:49{dash} {SA} TCP ACK scan isn't meant to
  699. 25:52find open ports. It's designed to map
  700. 25:55out firewall rule sets. By sending an
  701. 25:57acknowledgement packet out of nowhere,
  702. 25:58we wait to see what the firewall does.
  703. 26:00Does it drop the packet or does it send
  704. 26:02a reset? In our test, all 1,000 ports
  705. 26:05are reported as unfiltered on the
  706. 26:06Windows machine. That gives us critical
  707. 26:08intelligence. The firewall is not
  708. 26:10actively blocking our specific IP range.
  709. 26:12The rules are mapped. Now we know where
  710. 26:15the barrier isn't.
  711. 26:17Command 58, the ultimate stealth
  712. 26:19sequence begins. We send a null scan
  713. 26:22using {dash} {SN} with absolutely zero
  714. 26:24TCP flags set. It's an unusual packet,
  715. 26:27one that shouldn't normally exist.
  716. 26:29Windows drops it, but the Linux-based
  717. 26:30Ubuntu machine reacts differently.
  718. 26:32[music]
  719. 26:33It returns an open or filtered response
  720. 26:35for our target ports. We are exploiting
  721. 26:37a fundamental difference in how
  722. 26:38operating systems handle unexpected
  723. 26:40protocol traffic. Same packet, different
  724. 26:43operating system, different response.
  725. 26:45Command 59, the infamous Xmas scan.
  726. 26:49If zero flags didn't work, what about
  727. 26:51all of them? We use {dash} sx. This sets
  728. 26:55the fin, psh, and [music] urg flags
  729. 26:58simultaneously, lighting up the packet
  730. 27:00like a Christmas tree. This chaotic
  731. 27:02packet is designed to bypass standard,
  732. 27:04poorly configured router firewalls,
  733. 27:06especially those that only look for syn
  734. 27:08packets. Different flags, different
  735. 27:10packet, different detection challenge.
  736. 27:13Command 60. For our final command, we
  737. 27:15execute the ghost protocol, {dash} t0,
  738. 27:17the paranoid timing template. Look at
  739. 27:19the terminal. I hit space, but it's
  740. 27:21completely frozen at 0.00%
  741. 27:24done. Nmap is now waiting 5 full minutes
  742. 27:26between sending every single packet. The
  743. 27:28goal, to minimize detection by intrusion
  744. 27:30detection systems. A full scan like this
  745. 27:32could take weeks to finish. So, we're
  746. 27:34pulling the plug here. And that's
  747. 27:35command 60, exactly 27 minutes.
  748. 27:3960 practical, [music] raw, and sometimes
  749. 27:42broken commands executed in a live lab.
  750. 27:45You saw firsthand that real
  751. 27:47cybersecurity isn't a movie.
  752. 27:49Files go missing, syntax errors happen,
  753. 27:52scripts crash, and firewalls fight back.
  754. 27:55The true skill lies in how you
  755. 27:56troubleshoot, and how you adapt when
  756. 27:58those defenses fight back.
  757. 28:01So, which of these 60 commands was your
  758. 28:03favorite? And which one are you going to
  759. 28:05test in your own lab? Let me know in the
  760. 28:08comments below. If this operation
  761. 28:10upgraded your arsenal, hit the like
  762. 28:11button and subscribe to Sentinel. Keep
  763. 28:14your defenses strong, and I'll see you
  764. 28:16in the next operation.

About this transcript

This page contains the full transcript of Master Nmap in 27 Minutes: 60 Commands Every Hacker Needs by HackLab by CyberSentinel, generated from the public captions YouTube serves with the video. The transcript has 4,552 words across 764 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.