Linux server.nvwebsoft.co.in 3.10.0-1160.114.2.el7.x86_64 #1 SMP Wed Mar 20 15:54:52 UTC 2024 x86_64
Apache
: 162.240.12.249 | : 52.15.71.146
202 Domain
8.1.31
nbspublicschool
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
usr /
libexec /
[ HOME SHELL ]
Name
Size
Permission
Action
awk
[ DIR ]
drwxr-xr-x
cloud-init
[ DIR ]
drwxr-xr-x
coreutils
[ DIR ]
drwxr-xr-x
dbus-1
[ DIR ]
drwxr-xr-x
dovecot
[ DIR ]
drwxr-xr-x
gcc
[ DIR ]
drwxr-xr-x
getconf
[ DIR ]
drwxr-xr-x
git-core
[ DIR ]
drwxr-xr-x
grubby
[ DIR ]
drwxr-xr-x
imunify-notifier
[ DIR ]
drwxr-xr-x
initscripts
[ DIR ]
drwxr-xr-x
iptables
[ DIR ]
drwxr-xr-x
linux-boot-probes
[ DIR ]
drwxr-xr-x
lsm.d
[ DIR ]
drwxr-xr-x
man-db
[ DIR ]
drwxr-xr-x
microcode_ctl
[ DIR ]
drwxr-xr-x
openldap
[ DIR ]
drwxr-xr-x
openssh
[ DIR ]
drwxr-xr-x
os-probes
[ DIR ]
drwxr-xr-x
p11-kit
[ DIR ]
drwxr-xr-x
psacct
[ DIR ]
drwxr-xr-x
selinux
[ DIR ]
drwxr-xr-x
smartmontools
[ DIR ]
drwxr-xr-x
sudo
[ DIR ]
drwxr-xr-x
systemtap
[ DIR ]
drwxr-xr-x
tuned
[ DIR ]
drwxr-xr-x
utempter
[ DIR ]
drwxr-xr-x
abrt-action-generate-machine-i...
5.69
KB
-rwxr-xr-x
abrt-action-install-debuginfo-...
14.98
KB
-rwxr-xr-x
abrt-action-ureport
5.7
KB
-rwxr-xr-x
abrt-gdb-exploitable
27.43
KB
-rwxr-xr-x
abrt-handle-event
15.01
KB
-rwxr-xr-x
abrt-hook-ccpp
31.14
KB
-rwxr-xr-x
chrony-helper
6.37
KB
-rwxr-xr-x
ebtables
1.66
KB
-rwxr-xr-x
exim.daemon
758
B
-rwxr-xr-x
fprintd
45.24
KB
-rwxr-xr-x
generate-rndc-key.sh
546
B
-rwxr-xr-x
gnupg-pcsc-wrapper
19.3
KB
-rwxr-xr-x
gpg-check-pattern
102.95
KB
-rwxr-xr-x
gpg-preset-passphrase
86.39
KB
-rwxr-xr-x
gpg-protect-tool
185.57
KB
-rwxr-xr-x
gpg2keys_curl
44.81
KB
-rwxr-xr-x
gpg2keys_finger
61.34
KB
-rwxr-xr-x
gpg2keys_hkp
53
KB
-rwxr-xr-x
gpg2keys_ldap
61.02
KB
-rwxr-xr-x
grepconf.sh
253
B
-rwxr-xr-x
newns
7.03
KB
-rwxr-xr-x
ntpdate-wrapper
806
B
-rwxr-xr-x
platform-python
6.98
KB
-rwxr-xr-x
report-command-error
7.29
MB
-rwxr-xr-x
run-with-intensity
9.14
MB
-rwxr-xr-x
tcawmgr.cgi
19.56
KB
-rwxr-xr-x
urlgrabber-ext-down
2.54
KB
-rwxr-xr-x
virt-what-cpuid-helper
7.02
KB
-rwxr-xr-x
Delete
Unzip
Zip
${this.title}
Close
Code Editor : abrt-action-generate-machine-id
#!/usr/bin/python ## Copyright (C) 2014 ABRT team <abrt-devel-list@redhat.com> ## Copyright (C) 2014 Red Hat, Inc. ## 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., 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA """This module provides algorithms for generating Machine IDs. """ import os import sys from argparse import ArgumentParser from subprocess import check_output, CalledProcessError import logging import hashlib def generate_machine_id_dmidecode(): """Generate a machine_id based off dmidecode fields The function generates the same result as sosreport-uploader Returns a machine ID as string or throws RuntimeException """ if not os.path.isfile("/usr/sbin/dmidecode"): raise RuntimeError("Could not find dmidecode. It might not be available for this " \ "architecture.") # What to look for keys = ['system-manufacturer', 'system-product-name', 'system-serial-number', 'system-uuid'] # Create a sha256 of ^ for machine_id machine_id = hashlib.sha256() # Run dmidecode command for k in keys: try: data = check_output(["dmidecode", "-s", k]).strip() except (OSError, CalledProcessError) as ex: raise RuntimeError("Execution of dmidecode failed: {0}".format(str(ex))) # Update the hash as we find the fields we are looking for machine_id.update(data) # Create sha256 digest return machine_id.hexdigest() def generate_machine_id_systemd(): """Generate a machine_id equals to a one generated by systemd This function returns contents of /etc/machine-id Returns a machine ID as string or throws RuntimeException. """ try: with open('/etc/machine-id', 'r') as midf: return "".join((l.strip() for l in midf)) except IOError as ex: raise RuntimeError("Could not use systemd's machine-id: {0}" .format(str(ex))) GENERATORS = { 'sosreport_uploader-dmidecode' : generate_machine_id_dmidecode, 'systemd' : generate_machine_id_systemd } def generate_machine_id(generators): """Generates all requested machine id with all required generators Keyword arguments: generators -- a list of generator names Returns a dictionary where keys are generators and associated values are products of those generators. """ ids = {} workers = GENERATORS for sd in generators: try: ids[sd] = workers[sd]() except RuntimeError as ex: logging.error("Machine-ID generator '{0}' failed: {1}" .format(sd, ex.message)) return ids def print_result(ids, outfile, prefixed): """Writes a dictionary of machine ids to a file Each dictionary entry is written on a single line. The function does not print trailing new-line if the dictionary contains only one item as it is common format of one-liners placed in a dump directory. Keyword arguments: ids -- a dictionary [generator name: machine ids] outfile -- output file prefixed -- use 'generator name=' prefix or not """ fmt = '{0}={1}' if prefixed else '{1}' if len(ids) > 1: fmt += '\n' for sd, mid in ids.iteritems(): outfile.write(fmt.format(sd,mid)) def print_generators(outfile=None): """Prints requested generators Keyword arguments: outfile -- output file (default: sys.stdout) """ if outfile is None: outfile = sys.stdout for sd in GENERATORS.iterkeys(): outfile.write("{0}\n".format(sd)) if __name__ == '__main__': CMDARGS = ArgumentParser(description = "Generate a machine_id") CMDARGS.add_argument('-o', '--output', type=str, help="Output file") CMDARGS.add_argument('-g', '--generators', nargs='+', type=str, help="Use given generators only") CMDARGS.add_argument('-l', '--list-generators', action='store_true', default=False, help="Print out a list of usable generators") CMDARGS.add_argument('-n', '--noprefix', action='store_true', default=False, help="Do not use generator name as prefix for IDs") OPTIONS = CMDARGS.parse_args() ARGS = vars(OPTIONS) logging.basicConfig(format='%(message)s') if ARGS['list_generators']: print_generators() sys.exit(0) requested_generators = None if ARGS['generators']: requested_generators = ARGS['generators'] else: requested_generators = GENERATORS.keys() machineids = generate_machine_id(requested_generators) if ARGS['output']: try: with open(ARGS['output'], 'w') as fout: print_result(machineids, fout, not ARGS['noprefix']) except IOError as ex: logging.error("Could not open output file: {0}".format(str(ex))) sys.exit(1) else: print_result(machineids, sys.stdout, not ARGS['noprefix']) # print_results() omits new-line for one-liners if len(machineids) == 1: sys.stdout.write('\n') sys.exit(len(requested_generators) - len(machineids.keys()))
Close