Source Code for network and port scanner, TRW algorithm, and reduction method implementations.

1234567891011121314
  1. import socket
  2. import json
  3. import random
  4. s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
  5. for i in range (5):
  6. val = random.randint(1, 5)
  7. dataScript = {'sara':val, 'ale':4}
  8. message = json.dumps(dataScript)
  9. s.sendto(message, ('localhost', 2702))
  10. print "Sending %s message" % i
  11. print "Sent messages"