moloch-- / sliver-py

A Python gRPC Client Library for Sliver
GNU General Public License v3.0
66 stars 13 forks source link

Fix generate command #9

Closed jamesgol closed 2 years ago

jamesgol commented 2 years ago

Prior to this patch the following code

    c2 = client_pb2.ImplantC2(URL="mtls://localhost:4444")
    mtls_config = client_pb2.ImplantConfig(GOOS="linux", GOARCH="amd64", ObfuscateSymbols=True, C2=[c2], Format=client_pb2.OutputFormat.Value("EXECUTABLE"))
    res = await client.generate(mtls_config)

would generate this error

Traceback (most recent call last):
  File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/home/james/projects/sliverpy/test.py", line 29, in main
    res = await client.generate(mtls_config)
  File "/var/data/python/lib/python3.9/site-packages/sliver/client.py", line 525, in generate
    req.ImplantConfig = config
AttributeError: 'GenerateReq' object has no attribute 'ImplantConfig'

I don't see an ImplantConfig in the protobuf https://github.com/BishopFox/sliver/blob/master/protobuf/clientpb/client.proto#L350-L352