MCPcopy
hub / github.com/fortra/impacket / test_3

Method test_3

tests/SMB_RPC/test_rpch.py:102–128  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

100 self.assertEqual(server_cmds[1].getData(), cookie.getData())
101
102 def test_3(self):
103 # CONN/A3
104 resp = b'\x05\x00\x14\x03\x10\x00\x00\x00\x1c\x00\x00\x00\x00\x00' + \
105 b'\x00\x00\x00\x00\x01\x00\x02\x00\x00\x00\xc0\xd4\x01\x00'
106
107 packet = rpch.RTSHeader(resp)
108 packet.dump()
109
110 pduData = packet['pduData']
111 numberOfCommands = packet['NumberOfCommands']
112
113 server_cmds = []
114 while numberOfCommands > 0:
115 numberOfCommands -= 1
116
117 cmd_type = unpack('<L', pduData[:4])[0]
118 cmd = rpch.COMMANDS[cmd_type](pduData)
119 server_cmds.append(cmd)
120 pduData = pduData[len(cmd):]
121
122 for cmd in server_cmds:
123 cmd.dump()
124
125 connectionTimeout = rpch.ConnectionTimeout()
126 connectionTimeout['ConnectionTimeout'] = 120000
127
128 self.assertEqual(server_cmds[0].getData(), connectionTimeout.getData())
129
130 def test_4(self):
131 # PING

Callers

nothing calls this directly

Calls 3

appendMethod · 0.80
dumpMethod · 0.45
getDataMethod · 0.45

Tested by

no test coverage detected