OXIESEC PANEL
- Current Dir:
/
/
snap
/
core
/
17210
/
usr
/
lib
/
python3
/
dist-packages
/
probert
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
10/02/2024 07:52:55 PM
rwxr-xr-x
📄
__init__.py
731 bytes
11/08/2016 11:35:29 PM
rw-r--r--
📁
__pycache__
-
10/02/2024 07:52:55 PM
rwxr-xr-x
📄
_nl80211.cpython-35m-x86_64-linux-gnu.so
23.2 KB
02/17/2017 02:26:30 AM
rw-r--r--
📄
_nl80211module.c
18.07 KB
11/08/2016 11:35:29 PM
rw-r--r--
📄
_rtnetlink.cpython-35m-x86_64-linux-gnu.so
19.11 KB
02/17/2017 02:26:30 AM
rw-r--r--
📄
_rtnetlinkmodule.c
10.13 KB
02/17/2017 01:05:06 AM
rw-r--r--
📄
log.py
1.44 KB
07/27/2016 11:12:20 AM
rw-r--r--
📄
network.py
15.57 KB
02/17/2017 01:05:06 AM
rw-r--r--
📄
prober.py
2 KB
12/21/2016 09:06:10 PM
rw-r--r--
📄
storage.py
5.51 KB
11/21/2016 01:43:53 AM
rw-r--r--
📁
tests
-
10/02/2024 07:52:55 PM
rwxr-xr-x
📄
utils.py
7.86 KB
12/21/2016 09:06:10 PM
rw-r--r--
Editing: prober.py
Close
# Copyright 2015 Canonical, Ltd. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. from probert.storage import Storage from probert.network import Network class Prober(): def __init__(self, options, results={}): self.options = options self.results = results ''' build a list of probe_ methods of this class, excluding probe_all so we don't recurse. This allows probe_all method to call all probe_ methods as we add it without maintaining a list in the code. ''' exclude = ['probe_all'] self.probes = [getattr(self, fn) for fn in filter(lambda x: callable(getattr(self, x)) and x.startswith('probe_') and x not in exclude, dir(self))] def probe(self): # find out what methods to call by looking options for fn in [x for x in dir(self.options) if self.options.__getattribute__(x) is True]: getattr(self, fn)() def probe_all(self): for fn in self.probes: fn() def probe_storage(self): storage = Storage() results = storage.probe() self.results['storage'] = results def probe_network(self): network = Network() results = network.probe() self.results['network'] = results def get_results(self): return self.results