!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: nginx/1.23.4. PHP/5.6.40-65+ubuntu20.04.1+deb.sury.org+1 

uname -a: Linux foro-restaurado-2 5.15.0-1040-oracle #46-Ubuntu SMP Fri Jul 14 21:47:21 UTC 2023
aarch64
 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/snap/core18/2889/usr/lib/python3/dist-packages/probert/tests/   drwxr-xr-x
Free 0 B of 49.13 MB (0%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     test_network.py (3.93 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
import testtools
import json

from probert.network import Network, NetworkInfo
from probert.tests.fakes import FAKE_PROBE_ALL_JSON


class ProbertTestNetwork(testtools.TestCase):
    def setUp(self):
        super(ProbertTestNetwork, self).setUp()
        self.results = json.load(open(FAKE_PROBE_ALL_JSON))
        self.network = Network(results=self.results)

    def test_network_init(self):
        self.assertNotEqual(None, self.network)

    def test_network_get_interfaces(self):
        ifaces = self.results['network'].keys()
        self.assertEqual(sorted(ifaces), sorted(self.network.get_interfaces()))

    def test_network_get_interfaces_no_nics(self):
        ifaces = []
        n = Network()
        self.assertEqual(ifaces, n.get_interfaces())

    def test_network_get_ips(self):
        for iface in self.network.get_interfaces():
            ip = self.results['network'][iface]['ip']
            self.assertEqual(ip, self.network.get_ips(iface))

    def test_network_get_ips_no_ips(self):
        n = Network()
        self.assertEqual([], n.get_ips('noiface'))

    def test_network_get_hwaddr(self):
        for iface in self.network.get_interfaces():
            hwaddr = \
                self.results['network'][iface]['hardware']['attrs']['address']
            self.assertEqual(hwaddr, self.network.get_hwaddr(iface))

    def test_network_get_iface_type(self):
        # TODO: mock out open/read of sysfs
        #       and use _get_iface_type()
        self.assertEqual('eth', self.network.get_iface_type('eth0'))

    # needs mocking of pyudev.Context()
    # and return mock data
    #def test_network_probe(self):

class ProbertTestNetworkInfo(testtools.TestCase):
    ''' properties:
        .name = eth7
        .type = eth
        .vendor = Innotec
        .model = SuperSonicEtherRocket
        .driver = sser
        .devpath = /devices
        .hwaddr = aa:bb:cc:dd:ee:ff
        .addr = 10.2.7.2
        .netmask = 255.255.255.0
        .broadcast = 10.2.7.255
        .addr6 =
        .is_virtual =
        .raw = {raw dictionary}
        .ip = {ip dict}
        .bond = {bond dict}
        .bridge = {bridge_dict}
    '''
    def setUp(self):
        super(ProbertTestNetworkInfo, self).setUp()
        self.results = json.load(open(FAKE_PROBE_ALL_JSON))

    def test_networkinfo_init(self):
        probe_data = {
            'em1': {
                'bond': {
                    'is_slave': False,
                    'is_master': False,
                    'slaves': [],
                    'mode': None,
                },
                "bridge": {
                    "interfaces": [],
                    "is_bridge": False,
                    "is_port": False,
                    "options": {}
                },
                'hardware': {
                    'attrs': {
                        'address': '00:11:22:33:44:55',
                    }
                },
                'type': 'eth',
                'ip' : {},
            }
        }
        ni = NetworkInfo(probe_data)
        self.assertNotEqual(ni, None)

    def test_networkinfo_attributes(self):
        eth0 = {'eth0': self.results.get('network').get('eth0')}
        ni = NetworkInfo(probe_data=eth0)
        props = {
            'name': 'eth0',
            'type': 'eth',
            'vendor': 'ASIX Electronics Corp.',
            'model': 'AX88179',
            'driver': 'ax88179_178a',
            'devpath': '/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2.1/3-2.1.1/3-2.1.1:1.0/net/eth0',
            'hwaddr': '00:0a:cd:26:45:33',
            'addr': '192.168.11.58',
            'netmask': '255.255.255.0',
            'broadcast': '192.168.11.255',
            'is_virtual': False,
            'raw': eth0.get('eth0'),
            'bond': eth0.get('eth0').get('bond'),
            'bridge': eth0.get('eth0').get('bridge'),
            'ip': eth0.get('eth0').get('ip'),
        }
        for (prop, value) in props.items():
            self.assertEqual(getattr(ni, prop), value)


:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by HackingTool | HackingTool | Generation time: 0.0037 ]--