scapy.layers.msrpce.rpcclient module

DCE/RPC client as per [MS-RPCE]

class scapy.layers.msrpce.rpcclient.DCERPC_Client(transport, ndr64=False, ndrendian='little', verb=True, **kwargs)[source]

Bases: object

A basic DCE/RPC client

Parameters:

ndr64 – Should ask for NDR64 when binding (default False)

alter_context(interface)[source]

Alter context: post-bind context negotiation

bind(interface)[source]

Bind the client to an interface

bind_or_alter(interface)[source]

Bind the client to an interface or alter the context if already bound

close()[source]
close_smbpipe()[source]

Close the previously opened pipe

connect(ip, port=None, timeout=5, smb_kwargs={})[source]

Initiate a connection

connect_and_bind(ip, interface, port=None, smb_kwargs={})[source]

Asks the Endpoint Mapper what address to use to connect to the interface, then uses connect() followed by a bind()

epm_map(interface)[source]

Calls ept_map (the EndPoint Manager)

Build a DCERPC_Client from a SMB_Client.smblink directly

get_bind_context(interface)[source]
open_smbpipe(name)[source]

Open a certain filehandle with the SMB automaton

send(pkt, **kwargs)[source]
sr1(pkt, **kwargs)[source]
sr1_req(pkt, **kwargs)[source]
scapy.layers.msrpce.rpcclient.get_endpoint(ip, interface, transport=DCERPC_Transport.NCACN_IP_TCP, ndrendian='little', verb=True, smb_kwargs={})[source]

Call the endpoint mapper on a remote IP to find an interface

Parameters:
  • ip

  • interface

  • mode

  • verb

Returns:

a list of connection tuples for this interface