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 /
lib /
python3 /
dist-packages /
uaclient /
cli /
[ HOME SHELL ]
Name
Size
Permission
Action
__pycache__
[ DIR ]
drwxr-xr-x
api.py
2.4
KB
-rw-r--r--
attach.py
5.48
KB
-rw-r--r--
auto_attach.py
958
B
-rw-r--r--
cli_util.py
8.08
KB
-rw-r--r--
collect_logs.py
1.6
KB
-rw-r--r--
commands.py
3.68
KB
-rw-r--r--
config.py
10.72
KB
-rw-r--r--
cve.py
6.73
KB
-rw-r--r--
cves.py
3.78
KB
-rw-r--r--
detach.py
3.38
KB
-rw-r--r--
disable.py
10.65
KB
-rw-r--r--
enable.py
17.02
KB
-rw-r--r--
fix.py
28.63
KB
-rw-r--r--
formatter.py
8.75
KB
-rw-r--r--
help.py
1.67
KB
-rw-r--r--
__init__.py
9.28
KB
-rw-r--r--
parser.py
2.72
KB
-rw-r--r--
refresh.py
2.42
KB
-rw-r--r--
security_status.py
2.79
KB
-rw-r--r--
status.py
2.37
KB
-rw-r--r--
system.py
1.05
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : cves.py
import sys from uaclient import exceptions, messages from uaclient.api.u.pro.security.cves.v1 import CVEsOptions, _cves from uaclient.cli import cli_util from uaclient.cli.commands import ProArgument, ProArgumentGroup, ProCommand from uaclient.cli.formatter import Table, create_link from uaclient.cli.parser import HelpCategory from uaclient.config import UAConfig @cli_util.with_spinner(msg=messages.CLI_CVES_SPINNER_MSG) def _get_cve_vulnerabilities(args, *, cfg: UAConfig, **kwargs): cve_options = CVEsOptions( fixable=args.fixable, unfixable=args.unfixable, ) try: result = _cves(options=cve_options, cfg=cfg) except exceptions.VulnerabilityDataNotFound: result = None return result def _get_cve_table_rows(cve_vulnerabilities): rows = [] for package_name, package_info in cve_vulnerabilities.packages.items(): for cve in package_info.cves: cve_info = cve_vulnerabilities.cves.get(cve.name) if cve_info: rows.append( ( package_name, cve_info.priority, cve.fix_origin or "-", cve.name, ) ) return rows def _format_cve_rows(cve_rows): formatted_rows = [] for row in sorted( cve_rows, key=lambda row: ( row[0], ("critical", "high", "medium", "low", "negligible").index(row[1]), ), ): formatted_rows.append( ( row[0], cli_util.colorize_priority(row[1]), row[2], create_link( text=row[3], url="https://ubuntu.com/security/{}".format(row[3]), ), ) ) return formatted_rows def _list_cves(args, cfg: UAConfig): cve_vulnerabilities = _get_cve_vulnerabilities(args, cfg=cfg) if not cve_vulnerabilities: raise exceptions.VulnerabilityDataNotFound() if cve_vulnerabilities.packages: rows = _format_cve_rows(_get_cve_table_rows(cve_vulnerabilities)) if rows: print( Table( headers=["Package", "Priority", "Origin", "Vulnerability"], rows=rows, ) ) else: if args.unfixable: print(messages.CLI_UNFIXABLE_CVES_NOT_AFFECTED) elif args.fixable: print(messages.CLI_FIXABLE_CVES_NOT_AFFECTED) else: print(messages.CLI_CVES_NOT_AFFECTED) else: if args.unfixable: print(messages.CLI_UNFIXABLE_CVES_NOT_AFFECTED) elif args.fixable: print(messages.CLI_FIXABLE_CVES_NOT_AFFECTED) else: print(messages.CLI_CVES_NOT_AFFECTED) def action_cves(args, *, cfg: UAConfig, **kwargs): if args.unfixable and args.fixable: raise exceptions.InvalidOptionCombination( option1="unfixable", option2="fixable" ) try: _list_cves(args=args, cfg=cfg) except BrokenPipeError: sys.stderr.close() cves_command = ProCommand( "cves", help=messages.CLI_CVES, description=messages.CLI_CVES_DESC, action=action_cves, help_category=HelpCategory.SECURITY, preserve_description=True, argument_groups=[ ProArgumentGroup( arguments=[ ProArgument( "--unfixable", help=messages.CLI_CVES_UNFIXABLE, action="store_true", ), ProArgument( "--fixable", help=messages.CLI_CVES_FIXABLE, action="store_true", ), ] ) ], )
Close