This page defines the HELLOWORLD protocol for which a basic dissector module will be created for.

Protocol Definition

helloworldstarts (16 byte protocol string)
<Message to be sent> (8 byte message)
helloworldending (16 byte protocol string)

TCP socket connection:

helloworldstarts<Message to be sent>helloworldending


- Client makes a TCP connection to Server
- Client sends a HELLOWORLD protocol message containing the 8 byte message "hiserver"
    actual bytes sent:
- TCP connection is closed

Python Code

Message Sender (client)

#!/usr/bin/env python

# Python Message Sender
import socket

HOST = ''    # The remote host
PORT = 2233               # The same port as used by the server
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
s.send(bytes("helloworldstartsmessage1helloworldending", 'ascii'))
#data = s.recv(1024)
print('message sent\n')

Message Receiver (server)

#!/usr/bin/env python

# Python Message Receiver
import socket

HOST = ''                 # Symbolic name meaning the local host
PORT = 2233               # Arbitrary non-privileged port
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((HOST, PORT))
conn, addr = s.accept()
print('Connected by', addr)
data = conn.recv(40)
print('Data: ' + data)
print('Message: ' + data[16:24:1])
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki