MCPcopy
hub / github.com/Xyntax/POC-T / ClientQuery

Function ClientQuery

script/rsync-weakpass.py:73–95  ·  view source on GitHub ↗

查询所有的模块名 @return module name

(socket_pre)

Source from the content-addressed store, hash-verified

71
72
73def ClientQuery(socket_pre):
74 '''
75 查询所有的模块名
76 @return module name
77 '''
78 s = socket_pre
79 payload = struct.pack("!s", "\n") # query
80 modulelist = []
81 try:
82 s.send(payload)
83 while True:
84 data = s.recv(1024) # Module List lenth 17
85 moduletemp = struct.unpack("!" + str(len(data)) + "s", data)
86 modulename = moduletemp[0].replace(" ", "").split("\n")
87 for i in range(len(modulename)):
88 realname = modulename[i].split("\t")
89 if realname[0] != "":
90 modulelist.append(realname[0])
91 if modulename[-2] == "@RSYNCD:EXIT":
92 break
93 except Exception, e:
94 pass
95 return modulelist
96
97
98def ClientCommand(host, port, cmd):

Callers 1

initialisationFunction · 0.85

Calls 2

splitMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected