OWASP/pysap

how send RFC request

Closed this issue · 3 comments

vah13 commented

Hi.
I want to simulate RFC request with pysap but have some issue.
I was saw SAPRFC.py and SAPRFC class, init it, but how I can send request to remote gateway.


def main():
SAPRFC(version=3,req_type=0,address="172.16.10.63",padd1=0,service="",codepage="1100",padd2="\x00" * 6,appc_header_version=6,accept_info=1,
echo_data="AAA",cmd="ACT_EXTPGM_TRACE" )


Hi ! Current RFC support is only for some specific gateway monitor actions. I'm planning to add something to be able to handle RFC calls, but that would require reversing a little bit some of the packets and the general data flow. I expect to have this but only in a few months probably.

vah13 commented

Oh. Thank you, sorry :-)

No problem. Anyway, if you want to interact and send packets to the gateway service you can use something like:

from pysap.SAPRFC import SAPRFC
from pysap.SAPNI import SAPNIStreamSocket

conn = SAPNIStreamSocket.get_nisocket(remote_host, remote_port)
p = SAPRFC(version=2, req_type=3, lu=client, tp=tp)
response = conn.sr(p)[SAPRFC]
response.show()