Question: client.py import socket s = socket.socket() port = 12345 msg = raw_input(Message to send: ) s.connect(('127.0.0.1', port)) s.send(msg) print s.recv(1024) # close the connection s.close()
client.py import socket s = socket.socket() port = 12345
msg = raw_input("Message to send: ") s.connect(('127.0.0.1', port))
s.send(msg) print s.recv(1024) # close the connection s.close() --------------------------------------
server.py
import socket
last_message = "NONE"
s = socket.socket() print "Socket successfully created" port = 12345
s.bind(('', port)) print "socket binded to %s" %(port) s.listen(5) print "socket is listening"
while True: c, addr = s.accept() print 'Got connection from', addr
print 'Sending last message' c.send(last_message)
msg = c.recv(1024) print 'new message recieved:' print msg last_message = msg c.close()
Given the client and server programs, write a third program to either masquerade or spoof packets. The work must be done from a Kali VM only
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
