Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Protostar net2

Shulou Source: shulou.com Published: 2022-06-01 02:46:58 10月04日 Update

This level is at / opt/protostar/bin/net2 * /

Srandom (time (NULL))

Run ()

}

This problem is also extended from the previous question, through the analysis of the problem, we can get the program through a for cycle to generate 4 random numbers, divided into four sizes to sizeof (result) to send, with another variable to save the sum of four variables, if the client returns the sum of four numbers can be equal.

#! / usr/bin/env python

From socket import *

From struct import *

From optparse import OptionParser

Def main (hostname,port):

S = socket (AF_INET,SOCK_STREAM)

S.connect ((hostname,port))

Result = 0

For i in range (4):

Rec = s.recv (4)

Num = unpack ("

Tags: Variable number size client client program result random number topic previous analysis loop generate run Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Microsoft Shulou Information MySQL Xiaomi