Skip to content

Commit

Permalink
Network Forensics completed
Browse files Browse the repository at this point in the history
  • Loading branch information
subhayuroy committed Sep 16, 2020
1 parent d3b6a72 commit 102fe08
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Network Forensics/client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import socket

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

host = socket.gethostname()
port = 8080

s.connect((host, port))

tm = s.recv(1024)
print("The client is waiting for connection")
s.close()
Binary file added Network Forensics/network_programming.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions Network Forensics/server.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import socket
import time

serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

host = socket.gethostname()
port = 8080

serversocket.bind((host, port))

serversocket.listen(5)

while True:
clientsocket,addr = serversocket.accept()
print("Got a connection from %s" % str(addr))
currentTime = time.ctime(time.time()) + "\r\n"
clientsocket.send(currentTime.encode('ascii'))
clientsocket.close()

0 comments on commit 102fe08

Please sign in to comment.