123456789101112131415161718192021222324252627 |
- import requests
- surl = 'https://localhost:32768'
- auth = {'username': 'salt', 'password':'foobar', 'eauth':'sharedsecret'}
- ver = False
- with requests.Session() as s:
- res = s.post(url=f'{surl}/login', json=auth, verify=ver)
- print(res.text)
- resp = s.post('https://localhost:32768', json=[{
- 'client': 'local',
- 'tgt': '*',
- 'fun': 'network.ipaddrs'
- }],
- verify=False)
- print(resp.text)
- resp = s.post('https://localhost:32768', json=[{
- 'client': 'local',
- 'tgt': '*',
- 'fun': 'file.readdir',
- 'arg': ['/etc/']
- }],
- verify=False)
- print(resp.text)
|