Using scapy through RPyC

153 views
Skip to first unread message

Pavel Pasynok

unread,
Jul 12, 2016, 8:46:43 AM7/12/16
to rpyc
Hello. 

I'd like to use scapy on remote server through RPyC to dump traffic like this

sniff(filter='icmp', iface='eth1', timeout=5)


To connect to remote server I'm using RPyC.

conn = rpyc.classic.connect(HOST_IP)


but I can not understand how to use scapy on remote server. 

conn.modules.scapy.sendrecv.sniff(filter='icmp', iface='eth1', timeout=5)

========= Remote Traceback (1) =========
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/rpyc/core/protocol.py", line 305, in _dispatch_request
    res = self._HANDLERS[handler](self, *args)
  File "/usr/local/lib/python2.7/dist-packages/rpyc/core/protocol.py", line 541, in _handle_getattr
    return self._access_attr(oid, name, (), "_rpyc_getattr", "allow_getattr", getattr)
  File "/usr/local/lib/python2.7/dist-packages/rpyc/core/protocol.py", line 507, in _access_attr
    return accessor(obj, name, *args)
AttributeError: 'module' object has no attribute 'sendrecv'

The conn.modules.scapy does not work.

Can anybody give an advice how to call scapy sniff function (or any ether) on remote server through RPyC? 

Thanks in advance.

Alex Sandro

unread,
Jul 26, 2016, 11:35:21 AM7/26/16
to rpyc
Try: 
conn.modules['scapy'].sendrecv.sniff

Make sure the object  "sendrecv" is part of the module.
Reply all
Reply to author
Forward
0 new messages