OWASP / pysap

pysap is an open source Python library that provides modules for crafting and sending packets using SAP's NI, Diag, Enqueue, Router, MS, SNC, IGS, RFC and HDB protocols.
https://owasp.org/www-project-core-business-application-security/
GNU General Public License v2.0
219 stars 61 forks source link

How to connect to SAP #8

Closed mamiu closed 7 years ago

mamiu commented 7 years ago

Hi,

I'm trying to connect to SAP but I don't know where to start. I've read the docs and taken a look at your examples but couldn't figure out how to do it. In the PyRFC library from SAP there is something like this:

>>> def get_connection(connmeta):
...     """Get connection"""
...     print 'Connecting ...', connmeta['ashost']
...     return Connection(**connmeta)

>>> from pyrfc import Connection

>>> SAPROUTER = '/H/111.22.33.44/S/3299/W/e5ngxs/H/555.66.777.888/H/'

>>> TEST = {
...    'user'      : 'me',
...    'passwd'    : 'secret',
...    'ashost'    : '10.0.0.1',
...    'saprouter' : SAPROUTER,
...    'sysnr'     : '00',
...    'client'    : '100',
...    'trace' : '3', #optional, in case you want to trace
...    'lang'      : 'EN'
... }

>>> conn = get_connection(TEST)
Connecting ... 10.0.0.1

>>>c.alive
True

Could you show me how to solve something like this with your library? I've all the connection parameters.

martingalloar commented 7 years ago

Hi! The RFC protocol is not fully implemented in pysap, only some messages related to the gateway monitor are available, so the kind of connection you're doing using PyRFC it's not currently possible with pysap.

mamiu commented 7 years ago

Oh ok. Then I'll have to try the PyRFC library.

Thanks anyway!

martingalloar commented 7 years ago

No problem, good luck with that! Hope to have that functionality in pysap at some point! Any feedback is welcomed :)