Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help code explanation
#1
Hello, I would like to understand what this code does, please.

I understood that it opens a connection with a machine by creating a socket in which it will use an ip and port then it will send a message to this machine. But what I do not understand is msg. This message includes a value that will be decoded in hex but why this message will block. In other words, this message will create a denial of service a DOS on the machine.

   # socket setup
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.connect((rhost, rport))
    msg = "00000000000a005a002800300000ff00".decode('hex')
    s.send(msg)
    s.close()
Reply
#2
salwa1215 Wrote:In other words, this message will create a denial of service a DOS on the machine.
Any kind of service could be listening at the other end of the socket. If you don't know which server your program is talking to, it is impossible to predict what it will do with the message.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020