File manager - Edit - /usr/local/cpanel/base/frontend/jupiter/cpguard/scanner/cms_detail.php
Back
<?php include_once dirname(__DIR__) . "/includes/init.php"; include_once $base_dir . "/classes/language.class.php"; $lang = new Language('scanner_logs'); include_once dirname(__DIR__) . "/classes/api.class.php"; $api = new Api($current_user); $cmd_id = filter_var($_GET['cms_id']); $data = ['id' => $cmd_id]; $result = $api->request('cmsDetails', $data); if ($result) { $cms_row = &$result['info']; function print_cve($cves) { echo "<div class=\"accordion cve-accordian\">\n"; foreach ($cves as $cve) { ?> <div class="cve"> <h4 class="expand"><i class="las la-caret-square-right"></i> <?php echo $cve['title']; ?></h4> <div class="details"> <h5><?php echo $cve['cvss_rating'] . ' ' . $cve['cvss_score']; ?></h5> <p><?php echo $cve['description']; ?></p> <?php if (isset($cve['remediation'])) { ?> <h5>Remediation</h5> <p><?php echo $cve['remediation']; ?></p> <?php } ?> <?php if (!empty($cve['patched_versions'])) { ?> <h5>Patched version: </h5> <p><?php echo $cve['patched_versions']; ?></p> <?php } ?> </div> </div> <?php } echo "</div>\n"; } ?> <style> .cve-accordian { .cve { background: #136f9517; padding: 5px 10px; margin-bottom: 5px; border-radius: 5px; } .cve:hover { background: #136f9521; } h4 { font-size: .9rem; font-weight: 600; } h5 { font-weight: 600; } .details { border-top: 1px solid #d0cfd1; padding: 10px; padding-top: 0; } } .details-container { max-height: calc(100vh - 300px); overflow-x: hidden; overflow-y: scroll; padding: 20px; } .cms-detail-title { padding-left: 20px; } .cms-detail-title h3 { padding-bottom: 10px; } .cms-detail-title button { float: right; position: absolute; top: 0; right: 0; background-color: red; outline: none; border: none; padding: 8px; color: #fff; cursor: pointer; } .cms-detail-modal .table td { padding: 10px; } .cms-detail-modal .table th { padding: 10px; } .cms-widget i { float: left; padding: 7px; border-radius: 5px; margin-right: 10px; font-size: 4em; } .widget-primary i { background-color: #2196f329; color: #007298; } .widget-success i { background-color: #8bc34a3b; color: #8bc34a; } .widget-warning i { background-color: #ffeb3b75; color: #ff5722; } .cms-widget p { padding-top: 5px; float: left; } .cms-widget p strong { font-size: 1.5em; font-weight: 500; } .cms-detail-modal .card { box-shadow: none; border-color: #F7FAFF; padding: 10px; margin-top: 20px; background-color: #F7FAFF; } .tab-pane{ min-height:200px; } .accordion { .expand { cursor: pointer; } .details { display: none; } .expand .sign:after { content: "+"; display: inline-block; } .expand .sign:after { content: "-"; } } </style> <div class="cms-detail-title" style="border-bottom: solid 1px #e7e7e7;"> <h3>CMS Details <span class="badge badge-danger">BETA</span></h3> <button onclick="unBlockUI()"><i class="la la-times"></i></button> </div> <div class="details-container"> <div class="row"> <div class="cms-widget widget-primary col-sm-6"> <i class="la la-wordpress"></i> <p><strong><?php echo $cms_row['domain']; ?></strong><br /><?php echo (strlen($cms_row['path']) > 40 ? '...' : '') . substr($cms_row['path'], -40, 40); ?> </p> </div> <div class="cms-widget <?php echo $cms_row['version_status'] == 'latest' ? 'widget-success text-success' : 'widget-warning text-danger'; ?> col-sm-6"> <i class="la la-puzzle-piece"></i> <p> <strong>Version <?php echo $cms_row['version']; ?></strong><br /> <?php echo $cms_row['version_status'] == 'latest' ? 'latest (secure)' : $cms_row['version_status'] . ' (update)'; ?> </p> </div> </div> <?php if (!$cms_row['status']) { ?> <div class="alert alert-warning" style="margin-top:20px;" role="alert"> <i class="las la-exclamation text-danger"></i> This wordpress installation appears to be broken. To be safe, try to fix it or remove if unwanted. </div> <?php } $core_issues_count = count($result['core_vulernabilities']['vulnerabilities']); $plugin_issues_count = $theme_issues_count = 0; if (isset($result['plugin'])) { foreach ($result['plugin'] as $plugin) { $plugin_issues_count += count($plugin['vulnerabilities']); } } else { $result['plugin'] = []; } if (isset($result['theme'])) { foreach ($result['theme'] as $theme) { $theme_issues_count += count($theme['vulnerabilities']); } } else { $result['theme'] = []; } $threats_count = count($result['threat']); ?> <ul class="nav nav-tabs" style="margin-top:30px" id="virusActionTab" role="tablist"> <li class="nav-item"> <a class="nav-link active" id="plugins-tab" data-toggle="tab" href="#plugins" role="tab" aria-controls="plugins" aria-selected="true">Plugins <?php echo $plugin_issues_count ? '<span class="badge badge-pill badge-warning">' . $plugin_issues_count . '</span>' : ''; ?></a> </li> <li class="nav-item"> <a class="nav-link" id="themes-tab" data-toggle="tab" href="#themes" role="tab" aria-controls="themes" aria-selected="false">Themes <?php echo $theme_issues_count ? '<span class="badge badge-pill badge-warning">' . $theme_issues_count . '</span>' : ''; ?></a> </li> <li class="nav-item"> <a class="nav-link" id="cve-tab" data-toggle="tab" href="#cve" role="tab" aria-controls="cve" aria-selected="true">Core issues <?php echo $core_issues_count ? '<span class="badge badge-pill badge-warning">' . $core_issues_count . '</span>' : ''; ?></a> </li> <li class="nav-item"> <a class="nav-link" id="threats-tab" data-toggle="tab" href="#threats" role="tab" aria-controls="threats" aria-selected="false">Threats <?php echo $threats_count ? '<span class="badge badge-pill badge-warning">' . $threats_count . '</span>' : ''; ?></a> </li> </ul> <div class="tab-content" id="virusActionTabContent"> <div class="tab-pane fade" id="cve" role="tabpanel" aria-labelledby="cve-tab"> <div style="padding-top:20px;"> <?php if (count($result['core_vulernabilities']['vulnerabilities'])) { print_cve($result['core_vulernabilities']['vulnerabilities']); } else { ?> <p style="background: url(<?php assets_url(); ?>/img/all_ok.svg) no-repeat;background-size: contain;padding-left: 2.2rem;font-size: .9rem;color: #19b48a;">No core issues</p> <?php } ?> </div> </div> <div class="tab-pane show " id="plugins" role="tabpanel" aria-labelledby="plugins-tab"> <table class="table table-hover accordion"> <thead> <th width="">Name</th> <th width="8%">Version</th> <th width="12%">Update available</th> <th width="12%">CVE</th> <th width="10%"></th> </thead> <?php if (count($result['plugin']) <= 0) { echo '<tr><td colspan="5"> No plugins or data unavailable</td></tr>'; } foreach ($result['plugin'] as $component) { $text_color = $component['update_available'] ? 'text-danger font-weight-bold' : ''; $issue_count = count($component['vulnerabilities']); ?> <tr class="<?php echo empty($component['vulnerabilities']) ? '' : 'expand'; ?>"> <td><?php echo '<i class="fa ' . ($component['status'] ? 'la-toggle-on text-success" title="Enabled"' : 'la-toggle-off text-muted" title="Disabled"') . '></i>'; ?> <?php echo $component['name']; ?> </td> <td class="<?php echo $text_color; ?>"><?php echo $component['version']; ?></td> <td class="<?php echo $text_color; ?>"> <?php echo $component['update_available'] ? '<span>yes</span>' : ''; ?> </td> <td style="text-transform: capitalize;"> <?php echo $component['cvss_rating'] . ' <span class="badge badge-pill badge-warning">' . ($component['cvss_score'] > 0 ? $component['cvss_score'] : '') . '</span>' ?> </td> <td class="text-right"> <?php if ($issue_count) { echo $issue_count . ' issue' . ($issue_count > 1 ? 's' : '') . ' <i class="accordion-arrow la la-angle-right"></i>'; } ?> </td> </tr> <?php if ($issue_count) { ?> <tr class="details"> <td colspan="6" style="padding:10px 5px;"> <?php print_cve($component['vulnerabilities']); ?> </td> </tr> <?php } ?> <?php } ?> </table> </div> <div class="tab-pane fade" id="themes" role="tabpanel" aria-labelledby="themes-tab"> <table class="table table-hover accordion"> <thead> <th width="">Name</th> <th width="8%">Version</th> <th width="12%">Update available</th> <th width="12%">CVE</th> <th width="10%"></th> </thead> <?php if (count($result['theme']) <= 0) { echo '<tr><td colspan="5"> No themes or data unavailable</td></tr>'; } foreach ($result['theme'] as $component) { $text_color = $component['update_available'] ? 'text-danger font-weight-bold' : ''; $issue_count = count($component['vulnerabilities']); ?> <tr class="<?php echo empty($component['vulnerabilities']) ? '' : 'expand'; ?>"> <td><?php echo '<i class="fa ' . ($component['status'] ? 'la-toggle-on text-success" title="Enabled"' : 'la-toggle-off text-muted" title="Disabled"') . '></i>'; ?> <?php echo $component['name']; ?> </td> <td class="<?php echo $text_color; ?>"><?php echo $component['version']; ?></td> <td class="<?php echo $text_color; ?>"> <?php echo $component['update_available'] ? '<span>yes</span>' : ''; ?> </td> <td style="text-transform: capitalize;"> <?php echo $component['cvss_rating'] . ' <span class="badge badge-pill badge-warning">' . ($component['cvss_score'] > 0 ? $component['cvss_score'] : '') . '</span>' ?> </td> <td class="text-right"> <?php if ($issue_count) { echo $issue_count . ' issue' . ($issue_count > 1 ? 's' : '') . ' <i class="accordion-arrow la la-angle-right"></i>'; } ?> </td> </tr> <?php if ($issue_count) { ?> <tr class="details"> <td colspan="6" style="padding:10px 5px;"> <?php print_cve($component['vulnerabilities']); ?> </td> </tr> <?php } ?> <?php } ?> </table> </div> <div class="tab-pane fade" id="threats" role="tabpanel" aria-labelledby="threats-tab"> <table class="table table-hover accordion"> <thead> <th width="">Path</th> <th width="8%">Reason</th> <th width="12%">Serverity</th> <th width="12%">Action</th> <th width="10%"></th> </thead> <?php if (count($result['threat']) <= 0) { echo '<tr><td colspan="5"> No threats or data unavailable</td></tr>'; } foreach ($result['threat'] as $threat) { ?> <tr> <td><?php echo $threat['path']; ?></td> <td><?php echo $threat['reason']; ?></td> <td><?php echo $threat['severity']; ?></td> <td><?php echo $threat['file_status']; ?></td> </tr> <?php } ?> </table> </div> </div> </div> <script> cjQ('.details-container .nav-tabs .nav-link').click(function (e) { e.preventDefault(); var target = cjQ(this).attr('href'); cjQ('.details-container .nav-link').removeClass('show active'); cjQ(this).addClass('show active'); cjQ('.details-container .tab-pane').removeClass('show active').addClass('fade'); cjQ(target).removeClass('fade').addClass('show active'); }); cjQ('.expand').click(function () { cjQ(this).next('.details').slideToggle(100); }); cjQ('.virus-actions button').click(function () { cjQ('.virus-actions button').attr('disabled', true); }); </script> <?php } ?>
| ver. 1.4 |
Github
|
.
| PHP 8.1.34 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings