OXIESEC PANEL
- Current Dir:
/
/
opt
/
alt
/
python311
/
lib
/
python3.11
/
site-packages
/
pyroute2
/
ndb
Server IP: 2a02:4780:11:1084:0:327f:3464:10
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/08/2024 06:42:21 PM
rwxr-xr-x
📄
__init__.py
0 bytes
05/08/2024 06:42:21 PM
rw-r--r--
📁
__pycache__
-
05/08/2024 06:42:21 PM
rwxr-xr-x
📄
auth_manager.py
2.58 KB
05/08/2024 06:42:21 PM
rw-r--r--
📄
cli.py
2.25 KB
05/08/2024 06:42:21 PM
rw-r--r--
📄
cluster.py
1003 bytes
05/08/2024 06:42:21 PM
rw-r--r--
📄
compat.py
2.2 KB
05/08/2024 06:42:21 PM
rw-r--r--
📄
events.py
2.02 KB
05/08/2024 06:42:21 PM
rw-r--r--
📄
main.py
20.96 KB
05/08/2024 06:42:21 PM
rw-r--r--
📄
messages.py
246 bytes
05/08/2024 06:42:21 PM
rw-r--r--
📄
noipdb.py
5.03 KB
05/08/2024 06:42:21 PM
rw-r--r--
📁
objects
-
05/08/2024 06:42:21 PM
rwxr-xr-x
📄
query.py
4.75 KB
05/08/2024 06:42:21 PM
rw-r--r--
📄
report.py
11.86 KB
05/08/2024 06:42:21 PM
rw-r--r--
📄
schema.py
32.04 KB
05/08/2024 06:42:21 PM
rw-r--r--
📄
source.py
16.56 KB
05/08/2024 06:42:21 PM
rw-r--r--
📄
task_manager.py
9.58 KB
05/08/2024 06:42:21 PM
rw-r--r--
📄
transaction.py
11.05 KB
05/08/2024 06:42:21 PM
rw-r--r--
📄
transport.py
6.2 KB
05/08/2024 06:42:21 PM
rw-r--r--
📄
view.py
16.5 KB
05/08/2024 06:42:21 PM
rw-r--r--
Editing: cli.py
Close
#!/usr/bin/env python import argparse import json import sys from pyroute2.cli.console import Console from pyroute2.cli.server import Server try: from pyroute2.cli.auth.auth_keystone import OSAuthManager except ImportError: OSAuthManager = None try: from pyroute2.cli.auth.auth_radius import RadiusAuthManager except ImportError: RadiusAuthManager = None try: import readline except ImportError: readline = None def run(): argp = argparse.ArgumentParser() for spec in ( ('-a', '[S] IP address to listen on'), ('-c', '[C] Command line to run'), ('-l', '[C,S] Log spec'), ('-m', 'Set mode (C,S)'), ('-p', '[S] Port to listen on'), ('-r', '[C] Load rc file'), ('-s', '[C,S] Load sources from a json file'), ('-x', '[S] Strict auth'), ): argp.add_argument(spec[0], help=spec[1]) argp.add_argument('script', nargs='*', help='script to run') args = argp.parse_args() commands = [] sources = None if args.s: with open(args.s, 'r') as f: sources = json.loads(f.read()) if args.m in ('S', 'server'): if args.p: port = int(args.p) else: port = 8080 auth_plugins = {} if OSAuthManager is not None: auth_plugins['keystone'] = OSAuthManager if RadiusAuthManager is not None: auth_plugins['radius:cleartext'] = RadiusAuthManager server = Server( address=args.a or 'localhost', port=port, log=args.l, sources=sources, auth_strict=args.x, auth_plugins=auth_plugins, ) server.serve_forever() return 0 else: console = Console(log=args.l, sources=sources) if readline is not None: console.set_completer(readline) if args.r: console.loadrc(args.r) for script in args.script: console.loadrc(script) if args.c: commands.append(args.c) console.interact(readfunc=lambda x: commands.pop(0)) elif not args.script: console.interact() return 1 if console.session.errors > 0 else 0 if __name__ == '__main__': rcode = run() sys.exit(rcode)