Changeset 2540542
- Timestamp:
- 06/01/2021 08:08:14 AM (5 years ago)
- Location:
- wpscan
- Files:
-
- 24 edited
- 1 copied
-
tags/1.15.2 (copied) (copied from wpscan/trunk)
-
tags/1.15.2/app/Checks/System.php (modified) (2 diffs)
-
tags/1.15.2/app/Plugin.php (modified) (2 diffs)
-
tags/1.15.2/app/Report.php (modified) (5 diffs)
-
tags/1.15.2/app/Settings.php (modified) (3 diffs)
-
tags/1.15.2/app/Summary.php (modified) (2 diffs)
-
tags/1.15.2/app/ignoreVulnerabilities.php (modified) (1 diff)
-
tags/1.15.2/assets/css/style.css (modified) (2 diffs)
-
tags/1.15.2/assets/js/download-report.js (modified) (6 diffs)
-
tags/1.15.2/readme.txt (modified) (2 diffs)
-
tags/1.15.2/security-checks/debuglog-files/check.php (modified) (1 diff)
-
tags/1.15.2/views/report.php (modified) (3 diffs)
-
tags/1.15.2/wpscan.php (modified) (1 diff)
-
trunk/app/Checks/System.php (modified) (2 diffs)
-
trunk/app/Plugin.php (modified) (2 diffs)
-
trunk/app/Report.php (modified) (5 diffs)
-
trunk/app/Settings.php (modified) (3 diffs)
-
trunk/app/Summary.php (modified) (2 diffs)
-
trunk/app/ignoreVulnerabilities.php (modified) (1 diff)
-
trunk/assets/css/style.css (modified) (2 diffs)
-
trunk/assets/js/download-report.js (modified) (6 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/security-checks/debuglog-files/check.php (modified) (1 diff)
-
trunk/views/report.php (modified) (3 diffs)
-
trunk/wpscan.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wpscan/tags/1.15.2/app/Checks/System.php
r2511419 r2540542 25 25 // Current running events. 26 26 public $current_running = ''; 27 27 28 /** 28 29 * A list of registered checks. … … 156 157 echo "<div class='notice notice-error'><p>$msg</p></div>"; 157 158 } 158 }159 }160 161 /**162 * List vulnerabilities in the report.163 *164 * @param object $check - The check instance.165 *166 * @access public167 * @return string168 * @since 1.0.0169 *170 */171 public function list_check_vulnerabilities( $instance ) {172 $vulnerabilities = $instance->get_vulnerabilities();173 $count = $instance->get_vulnerabilities_count();174 $ignored = $this->parent->get_ignored_vulnerabilities();175 176 $not_checked_text = __( 'Not checked yet. Click the Run button to run a scan', 'wpscan' );177 178 if ( ! isset( $vulnerabilities ) ) {179 echo esc_html( $not_checked_text );180 } elseif ( empty( $vulnerabilities ) || 0 === $count ) {181 echo esc_html( $instance->success_message() );182 } else {183 $list = array();184 185 foreach ( $vulnerabilities as $item ) {186 if ( in_array( $item['id'], $ignored, true ) ) {187 continue;188 }189 190 $html = "<div class='vulnerability'>";191 $html .= "<span class='vulnerability-severity'>";192 $html .= "<span class='wpscan-" . esc_attr( $item['severity'] ) . "'>" . esc_html( $item['severity'] ) ."</span>";193 $html .= '</span>';194 $html .= "<div class='vulnerability-title'>" . wp_kses( $item['title'], array( 'a' => array( 'href' => array() ) ) ) . '</div>';195 $html .= "<div class='vulnerability-remediation'> <a href='" . $item['remediation_url'] . "' target='_blank'>Click here for further info</a></div>";196 $html .= '</div>';197 $list[] = $html;198 }199 200 echo join( '<br>', $list );201 }202 }203 204 /**205 * Return vulnerabilities in the report.206 *207 * @param object $check - The check instance.208 *209 * @access public210 * @return string211 * @since 1.14.4212 *213 */214 public function get_check_vulnerabilities( $instance ) {215 $vulnerabilities = $instance->get_vulnerabilities();216 $count = $instance->get_vulnerabilities_count();217 $ignored = $this->parent->get_ignored_vulnerabilities();218 219 $not_checked_text = __( 'Not checked yet. Click the Run button to run a scan', 'wpscan' );220 221 if ( ! isset( $vulnerabilities ) ) {222 return esc_html( $not_checked_text );223 } elseif ( empty( $vulnerabilities ) || 0 === $count ) {224 return esc_html( $instance->success_message() );225 } else {226 $list = array();227 228 foreach ( $vulnerabilities as $item ) {229 if ( in_array( $item['id'], $ignored, true ) ) {230 continue;231 }232 233 $html = "<div class='vulnerability'>";234 $html .= "<div class='vulnerability-severity'>";235 $html .= "<span class='wpscan-" . esc_attr( $item['severity'] ) . "'>" . esc_html( $item['severity'] ) . '</span>';236 $html .= '</div>';237 $html .= "<div class='vulnerability-title'>" . wp_kses( $item['title'], array( 'a' => array( 'href' => array() ) ) ) . '</div>';238 $html .= '</div>';239 $list[] = $html;240 }241 242 return join( '<br>', $list );243 159 } 244 160 } -
wpscan/tags/1.15.2/app/Plugin.php
r2529086 r2540542 15 15 class Plugin { 16 16 // Settings. 17 public $OPT_API_TOKEN = 'wpscan_api_token';17 public $OPT_API_TOKEN = 'wpscan_api_token'; 18 18 public $OPT_SCANNING_INTERVAL = 'wpscan_scanning_interval'; 19 public $OPT_SCANNING_TIME = 'wpscan_scanning_time'; 20 public $OPT_IGNORE_ITEMS = 'wpscan_ignore_items'; 19 public $OPT_SCANNING_TIME = 'wpscan_scanning_time'; 20 public $OPT_IGNORE_ITEMS = 'wpscan_ignore_items'; 21 public $OPT_DISABLE_CHECKS = 'wpscan_disable_security_checks'; 21 22 22 23 // Account. … … 555 556 556 557 // Security checks. 557 $this->report['security-checks'] = array(); 558 559 foreach ( $this->classes['checks/system']->checks as $id => $data ) { 560 $data['instance']->perform(); 561 $this->report['security-checks'][ $id ]['vulnerabilities'] = array(); 562 563 if ( $data['instance']->vulnerabilities ) { 564 $this->report['security-checks'][ $id ]['vulnerabilities'] = $data['instance']->get_vulnerabilities(); 565 566 $this->maybe_fire_issue_found_action( 'security-check', $id, $this->report['security-checks'][ $id ] ); 558 if ( get_option( $this->OPT_DISABLE_CHECKS, array() ) !== '1' ) { 559 $this->report['security-checks'] = array(); 560 561 foreach ( $this->classes['checks/system']->checks as $id => $data ) { 562 $data['instance']->perform(); 563 $this->report['security-checks'][ $id ]['vulnerabilities'] = array(); 564 565 if ( $data['instance']->vulnerabilities ) { 566 $this->report['security-checks'][ $id ]['vulnerabilities'] = $data['instance']->get_vulnerabilities(); 567 568 $this->maybe_fire_issue_found_action( 'security-check', $id, $this->report['security-checks'][ $id ] ); 569 } 567 570 } 568 }571 } 569 572 570 573 // Caching. -
wpscan/tags/1.15.2/app/Report.php
r2481423 r2540542 65 65 66 66 /** 67 * Get vulnerability status based on fixed_in 68 * 69 * @since 1.15.2 70 * @access public 71 * @return string 72 */ 73 public function status( $vulnerability ) { 74 return empty( $vulnerability->fixed_in ) 75 ? __( 'We are not aware of a fix for this vulnerability.', 'wpscan' ) 76 : sprintf( __( 'This vulnerability was fixed in version %s. We recommend that you update as soon as possible.', 'wpscan' ), esc_html( $vulnerability->fixed_in ) ); 77 } 78 79 /** 80 * HTML markup for the vulnerability details 81 * 82 * @since 1.15.2 83 * @access public 84 * @return string 85 */ 86 public function vulnerability_output( $vulnerability ) { 87 $html = '<div class="vulnerability">'; 88 $html .= '<p class="vulnerability-title"><b>' . esc_html( $vulnerability->title ) . '</b></p>'; 89 $html .= '<p class="vulnerability-status">' . $this->status( $vulnerability ) . '</p>'; 90 $html .= $this->vulnerability_severity( $vulnerability ); 91 $html .= '<br /><p class="vulnerability-link"><a href="' . esc_url( 'https://wpscan.com/vulnerability/' . $vulnerability->id ) . '" target="_blank">Click here for further details</a></p>'; 92 $html .= '</div>'; 93 94 return $html; 95 } 96 97 /** 67 98 * List vulnerabilities on screen 68 99 * … … 100 131 usort( $report['vulnerabilities'], array( 'self', 'sort_vulnerabilities' ) ); 101 132 102 foreach ( $report['vulnerabilities'] as $ item) {103 $id = 'security-checks' === $type ? $ item['id'] : $item->id;133 foreach ( $report['vulnerabilities'] as $vulnerability ) { 134 $id = 'security-checks' === $type ? $vulnerability['id'] : $vulnerability->id; 104 135 105 136 if ( in_array( $id, $ignored, true ) ) { … … 107 138 } 108 139 109 $html = '<div class="vulnerability">'; 110 $html .= $this->vulnerability_severity( $item ); 111 $html .= '<a href="' . esc_url( 'https://wpscan.com/vulnerability/' . $item->id ) . '" target="_blank">'; 112 $html .= $this->parent->get_sanitized_vulnerability_title( $item ); 113 $html .= '</a>'; 140 $list[] = $this->vulnerability_output( $vulnerability ); 141 } 142 143 echo empty( $list ) ? $null_text : join( '<br>', $list ); 144 145 } else { 146 echo esc_html( $null_text ); 147 } 148 } 149 150 /** 151 * List security check vulnerabilities in the report. 152 * This should be merged with the list_api_vulnerabilities() function, 153 * in the future, if anyone can figure out how... 154 * 155 * @param object $check - The check instance. 156 * 157 * @access public 158 * @return string 159 * @since 1.0.0 160 * 161 */ 162 public function list_security_check_vulnerabilities( $instance ) { 163 $vulnerabilities = $instance->get_vulnerabilities(); 164 $count = $instance->get_vulnerabilities_count(); 165 $ignored = $this->parent->get_ignored_vulnerabilities(); 166 167 $not_checked_text = __( 'Not checked yet. Click the Run button to run a scan', 'wpscan' ); 168 169 if ( ! isset( $vulnerabilities ) ) { 170 echo esc_html( $not_checked_text ); 171 } elseif ( empty( $vulnerabilities ) || 0 === $count ) { 172 echo esc_html( $instance->success_message() ); 173 } else { 174 $list = array(); 175 176 foreach ( $vulnerabilities as $vulnerability ) { 177 if ( in_array( $vulnerability['id'], $ignored, true ) ) { 178 continue; 179 } 180 181 $html = "<div class='vulnerability'>"; 182 $html .= "<p class='vulnerability-title'>" . wp_kses( $vulnerability['title'], array( 'a' => array( 'href' => array() ) ) ) . '</p><br />'; 183 $html .= "<p class='vulnerability-severity'>"; 184 $html .= "<span class='wpscan-" . esc_attr( $vulnerability['severity'] ) . "'>" . esc_html( $vulnerability['severity'] ) ." Severity</span>"; 185 $html .= '</p>'; 186 $html .= "<br /><br /><p class='vulnerability-link'><a href='" . esc_url( $vulnerability['remediation_url'] ) . "' target='_blank'>Click here for further details</a></p>"; 114 187 $html .= '</div>'; 115 188 … … 117 190 } 118 191 119 echo empty( $list ) ? $null_text : join( '<br>', $list ); 120 121 } else { 122 echo esc_html( $null_text ); 123 } 124 } 192 echo join( '<br>', $list ); 193 } 194 } 195 125 196 126 197 /** … … 156 227 if ( isset( $vulnerability->cvss->severity ) ) { 157 228 $severity = $vulnerability->cvss->severity; 158 $html .= "<span class='wpscan-" . esc_attr( $severity ) . "'>" . esc_html( $severity ) . ' </span>';229 $html .= "<span class='wpscan-" . esc_attr( $severity ) . "'>" . esc_html( $severity ) . ' Severity</span>'; 159 230 } 160 231 -
wpscan/tags/1.15.2/app/Settings.php
r2511419 r2540542 83 83 register_setting( $this->page, $this->parent->OPT_SCANNING_INTERVAL, 'sanitize_text_field' ); 84 84 register_setting( $this->page, $this->parent->OPT_SCANNING_TIME, 'sanitize_text_field' ); 85 register_setting( $this->page, $this->parent->OPT_DISABLE_CHECKS, array( 'type' => 'boolean', 'default' => '0' ) ); 85 86 86 87 $section = $this->page . '_section'; … … 113 114 __( 'Scanning Time', 'wpscan' ), 114 115 array( $this, 'field_scanning_time' ), 116 $this->page, 117 $section 118 ); 119 120 add_settings_field( 121 $this->parent->OPT_DISABLE_CHECKS, 122 __( 'Disable Security Checks', 'wpscan' ), 123 array( $this, 'field_disable_security_checks' ), 115 124 $this->page, 116 125 $section … … 323 332 324 333 echo '</p><br/>'; 334 } 335 /** 336 * Disable security checks field 337 * 338 * @since 1.15.2 339 * @access public 340 * @return string 341 */ 342 public function field_disable_security_checks() { 343 $opt = $this->parent->OPT_DISABLE_CHECKS; 344 345 $value = get_option( $opt, array() ); 346 $checked = $value === '1' ? 'checked' : null; 347 348 echo "<input name='{$opt}' type='checkbox' $checked value='1' >"; 325 349 } 326 350 -
wpscan/tags/1.15.2/app/Summary.php
r2511419 r2540542 26 26 add_action( 'admin_init', array( $this, 'add_meta_box_summary' ) ); 27 27 add_action( 'wp_ajax_wpscan_check_now', array( $this, 'ajax_check_now' ) ); 28 add_action( 'wp_ajax_wpscan_security_check_now', array( $this, 'ajax_security_check_now' ) ); 28 29 if ( get_option( $this->parent->OPT_DISABLE_CHECKS, array() ) !== '1' ) { 30 add_action( 'wp_ajax_wpscan_security_check_now', array( $this, 'ajax_security_check_now' ) ); 31 } 32 29 33 add_action( 'wp_ajax_' . $this->parent->WPSCAN_TRANSIENT_CRON, array( $this, 'ajax_doing_cron' ) ); 30 34 } … … 162 166 163 167 /** 164 * Ajax s curity check now168 * Ajax security check now 165 169 * 166 170 * @return void -
wpscan/tags/1.15.2/app/ignoreVulnerabilities.php
r2429586 r2540542 128 128 $this->list_vulnerabilities_to_ignore( 'themes', $this->parent->get_theme_slug( $name, $details ) ); 129 129 } 130 131 foreach ( $this->parent->classes['checks/system']->checks as $id => $data ) { 132 $this->list_vulnerabilities_to_ignore( 'security-checks', $id ); 130 131 if ( get_option( $this->parent->OPT_DISABLE_CHECKS, array() ) !== '1' ) { 132 foreach ( $this->parent->classes['checks/system']->checks as $id => $data ) { 133 $this->list_vulnerabilities_to_ignore( 'security-checks', $id ); 134 } 133 135 } 134 136 } -
wpscan/tags/1.15.2/assets/css/style.css
r2452411 r2540542 162 162 .vulnerability-severity { 163 163 float: left; 164 min-width: 60px; 165 margin-right: 20px; 166 } 167 168 .vulnerability-title { 164 min-width: 100px; 165 } 166 167 .vulnerability-title .vulnerability-status .vulnerability-link { 169 168 float: left; 170 169 } … … 176 175 border-radius: 3px; 177 176 font-size: 11px; 178 margin: 6px 0px 0px 0px;179 177 line-height: 19px; 180 min-width: 60px;178 min-width: 100px; 181 179 color: #4e645a; 182 180 background: #c6e1d5; -
wpscan/tags/1.15.2/assets/js/download-report.js
r2529086 r2540542 361 361 const topTableBorder = is_wordpress_section ? 'WPTableLine' : 'tableLine'; 362 362 363 // name 364 363 // Name 365 364 table.table.body[1].push({ 366 365 text: 'Name', … … 370 369 table.table.widths.push(149); 371 370 372 // version371 // Version 373 372 if (!is_security_checks) { 374 373 table.table.body[1].push({ … … 408 407 let row = []; 409 408 410 // Item title411 let itemTitle = $(this).find('.plugin-title strong').text().trim();412 409 // Item name 410 let itemTitle = is_wordpress_section ? 'WordPress' : $(this).find('.plugin-title strong').text().trim(); 411 413 412 if ($(this).find('.plugin-title .item-closed').length) { 414 413 itemTitle = … … 426 425 427 426 // Item version 427 let itemVersion = is_wordpress_section ? $(this).find('#wordpress-version').text().trim() : $(this).find('.plugin-title .item-version span').text().trim(); 428 428 429 if (!is_security_checks) { 429 430 row.push({ 430 text: $(this) 431 .find('.plugin-title .item-version span') 432 .text() 433 .trim(), 431 text: itemVersion, 434 432 style: 'resTable', 435 433 borderColor, … … 451 449 .each(function () { 452 450 let item = $(this).clone(); 453 let linkText = 454 item.find('.vulnerability-severity span').text().trim() + ' - '; 455 item.find('.vulnerability-severity span').remove(); 456 linkText = linkText + item.text().trim(); 457 linkText = linkText.charAt(0).toUpperCase() + linkText.slice(1); 458 459 col.stack.push({ 460 text: linkText, 461 link: $(this).attr('href'), 462 style: 'resTable', 463 lineHeight: 2, 464 borderColor, 465 }); 451 let title = item.find('.vulnerability-title').text().trim(); 452 let status = item.find('.vulnerability-status').text().trim(); 453 let severity = item.find('.vulnerability-severity span').text().trim(); 454 let link_text = item.find('.vulnerability-link').text().trim(); 455 let link_href = item.find('.vulnerability-link a').attr('href'); 456 457 let vulnerability_text = [ 458 { text: title, style: 'resTable' }, 459 { text: status, style: 'resTable' }, 460 { text: severity.charAt(0).toUpperCase() + severity.slice(1), style: 'resTable' }, 461 { text: link_text, link: link_href, style: 'resTable' } 462 ] 463 464 col.stack.push( vulnerability_text ); 466 465 }); 467 466 … … 479 478 }); 480 479 481 // push the table480 // Push the table 482 481 is_wordpress_section 483 482 ? wpscanReport.content.push(wordpressTable) -
wpscan/tags/1.15.2/readme.txt
r2529086 r2540542 4 4 Requires at least: 3.4 5 5 Tested up to: 5.6 6 Stable tag: 1.15. 16 Stable tag: 1.15.2 7 7 Requires PHP: 5.5 8 8 License: GPLv3 … … 90 90 91 91 == Changelog == 92 93 = 1.15.2 = 94 * Improve HTML and PDF report output 95 * Disable security checks setting 96 * Some refactoring 92 97 93 98 = 1.15.1 = -
wpscan/tags/1.15.2/security-checks/debuglog-files/check.php
r2511419 r2540542 69 69 70 70 if ( 200 === $code ) { 71 $this->add_vulnerability( __( 'A publicly accessible debug.log file was found in', 'wpscan' ) . " <a href='$url' target='_blank'>$url</a> .", 'high', sanitize_title( $file ), 'https://blog.wpscan.com/2021/03/18/wordpress-debug-log-files.html' );71 $this->add_vulnerability( __( 'A publicly accessible debug.log file was found in', 'wpscan' ) . " <a href='$url' target='_blank'>$url</a>", 'high', sanitize_title( $file ), 'https://blog.wpscan.com/2021/03/18/wordpress-debug-log-files.html' ); 72 72 } 73 73 } -
wpscan/tags/1.15.2/views/report.php
r2511419 r2540542 51 51 <th scope="row" class="check-column" style="text-align: center"> 52 52 <?php echo $this->get_status( 'wordpress', get_bloginfo( 'version' ) ) ?></th> 53 <td class="plugin-title column-primary"> 54 <strong>WordPress</strong> 55 <span class='item-version'> 56 <?php echo sprintf( __( 'Version <span>%s</span>', 'wpscan' ), get_bloginfo( 'version' ) ) ?> 57 </span> 53 <td class="wordpress-title column-primary"> 54 <strong>WordPress <span id="wordpress-version"><?php echo get_bloginfo( 'version' ) ?></span></strong> 58 55 </td> 59 56 <td class="vulnerabilities"> … … 94 91 95 92 <td class="plugin-title column-primary"> 96 <strong><?php echo esc_html( $details['Name']) ?></strong>93 <strong><?php echo esc_html( $details['Name'] ) ?></strong> 97 94 <span class='item-version'> 98 95 <?php echo sprintf( __( 'Version <span>%s</span>', 'wpscan' ), esc_html($details['Version']) ) ?> … … 163 160 </div> 164 161 165 <div class="wpscan-report-section security-checks"> 166 <h3><?php _e('Security Checks', 'wpscan') ?></h3> 167 168 <table class="wp-list-table widefat striped plugins"> 169 <thead> 170 <tr> 171 <td scope="col" class="manage-column check-column"></td> 172 <th scope="col" class="manage-column column-name column-primary"><?php _e('Name', 'wpscan') ?></th> 173 <th scope="col" class="manage-column column-description"><?php _e('Result', 'wpscan') ?></th> 174 <th scope="col" class="manage-column column-description"><?php _e('Actions', 'wpscan') ?></th> 175 </tr> 176 </thead> 177 <tbody id="report-themes"> 178 <?php foreach ( $this->parent->classes['checks/system']->checks as $id => $data ) : ?> 179 <tr> 180 <th scope="row" class="check-column" style="text-align: center"> 181 <?php echo $this->get_status('security-checks', $id) ?></th> 182 </th> 183 <td class="plugin-title column-primary"> 184 <strong title="<?php echo esc_attr($data['instance']->description()) ?>"> 185 <?php echo esc_html($data['instance']->title()) ?> 186 </strong> 187 </td> 188 <td class="vulnerabilities"> 189 <?php $this->parent->classes['checks/system']->list_check_vulnerabilities( $data['instance'] ) ?> 190 </td> 191 <td class="security-check-actions"> 192 <?php $this->parent->classes['checks/system']->list_actions($data['instance']) ?> 193 <span class="spinner"></span> 194 </td> 195 </tr> 196 <?php endforeach; ?> 197 </tbody> 198 </table> 199 </div> 162 <?php if ( get_option( $this->parent->OPT_DISABLE_CHECKS, array() ) !== '1' ) { ?> 163 164 <div class="wpscan-report-section security-checks"> 165 <h3><?php _e('Security Checks', 'wpscan') ?></h3> 166 167 <table class="wp-list-table widefat striped plugins"> 168 <thead> 169 <tr> 170 <td scope="col" class="manage-column check-column"></td> 171 <th scope="col" class="manage-column column-name column-primary"><?php _e('Name', 'wpscan') ?></th> 172 <th scope="col" class="manage-column column-description"><?php _e('Result', 'wpscan') ?></th> 173 <th scope="col" class="manage-column column-description"><?php _e('Actions', 'wpscan') ?></th> 174 </tr> 175 </thead> 176 <tbody id="report-themes"> 177 <?php foreach ( $this->parent->classes['checks/system']->checks as $id => $data ) : ?> 178 <tr> 179 <th scope="row" class="check-column" style="text-align: center"> 180 <?php echo $this->get_status('security-checks', $id) ?></th> 181 </th> 182 <td class="plugin-title column-primary"> 183 <strong title="<?php echo esc_attr($data['instance']->description()) ?>"> 184 <?php echo esc_html( $data['instance']->title() ) ?> 185 </strong> 186 </td> 187 <td class="vulnerabilities"> 188 <?php $this->list_security_check_vulnerabilities( $data['instance'] ) ?> 189 </td> 190 <td class="security-check-actions"> 191 <?php $this->parent->classes['checks/system']->list_actions($data['instance']) ?> 192 <span class="spinner"></span> 193 </td> 194 </tr> 195 <?php endforeach; ?> 196 </tbody> 197 </table> 198 </div> 199 200 <?php } ?> 200 201 201 202 <?php if ( get_option( $this->parent->OPT_API_TOKEN ) ) { ?> -
wpscan/tags/1.15.2/wpscan.php
r2529086 r2540542 4 4 * Plugin URI: http://wordpress.org/plugins/wpscan/ 5 5 * Description: WPScan WordPress Security Scanner. Scans your system for security vulnerabilities listed in the WPScan Vulnerability Database. 6 * Version: 1.15. 16 * Version: 1.15.2 7 7 * Author: WPScan Team 8 8 * Author URI: https://wpscan.com/ -
wpscan/trunk/app/Checks/System.php
r2511419 r2540542 25 25 // Current running events. 26 26 public $current_running = ''; 27 27 28 /** 28 29 * A list of registered checks. … … 156 157 echo "<div class='notice notice-error'><p>$msg</p></div>"; 157 158 } 158 }159 }160 161 /**162 * List vulnerabilities in the report.163 *164 * @param object $check - The check instance.165 *166 * @access public167 * @return string168 * @since 1.0.0169 *170 */171 public function list_check_vulnerabilities( $instance ) {172 $vulnerabilities = $instance->get_vulnerabilities();173 $count = $instance->get_vulnerabilities_count();174 $ignored = $this->parent->get_ignored_vulnerabilities();175 176 $not_checked_text = __( 'Not checked yet. Click the Run button to run a scan', 'wpscan' );177 178 if ( ! isset( $vulnerabilities ) ) {179 echo esc_html( $not_checked_text );180 } elseif ( empty( $vulnerabilities ) || 0 === $count ) {181 echo esc_html( $instance->success_message() );182 } else {183 $list = array();184 185 foreach ( $vulnerabilities as $item ) {186 if ( in_array( $item['id'], $ignored, true ) ) {187 continue;188 }189 190 $html = "<div class='vulnerability'>";191 $html .= "<span class='vulnerability-severity'>";192 $html .= "<span class='wpscan-" . esc_attr( $item['severity'] ) . "'>" . esc_html( $item['severity'] ) ."</span>";193 $html .= '</span>';194 $html .= "<div class='vulnerability-title'>" . wp_kses( $item['title'], array( 'a' => array( 'href' => array() ) ) ) . '</div>';195 $html .= "<div class='vulnerability-remediation'> <a href='" . $item['remediation_url'] . "' target='_blank'>Click here for further info</a></div>";196 $html .= '</div>';197 $list[] = $html;198 }199 200 echo join( '<br>', $list );201 }202 }203 204 /**205 * Return vulnerabilities in the report.206 *207 * @param object $check - The check instance.208 *209 * @access public210 * @return string211 * @since 1.14.4212 *213 */214 public function get_check_vulnerabilities( $instance ) {215 $vulnerabilities = $instance->get_vulnerabilities();216 $count = $instance->get_vulnerabilities_count();217 $ignored = $this->parent->get_ignored_vulnerabilities();218 219 $not_checked_text = __( 'Not checked yet. Click the Run button to run a scan', 'wpscan' );220 221 if ( ! isset( $vulnerabilities ) ) {222 return esc_html( $not_checked_text );223 } elseif ( empty( $vulnerabilities ) || 0 === $count ) {224 return esc_html( $instance->success_message() );225 } else {226 $list = array();227 228 foreach ( $vulnerabilities as $item ) {229 if ( in_array( $item['id'], $ignored, true ) ) {230 continue;231 }232 233 $html = "<div class='vulnerability'>";234 $html .= "<div class='vulnerability-severity'>";235 $html .= "<span class='wpscan-" . esc_attr( $item['severity'] ) . "'>" . esc_html( $item['severity'] ) . '</span>';236 $html .= '</div>';237 $html .= "<div class='vulnerability-title'>" . wp_kses( $item['title'], array( 'a' => array( 'href' => array() ) ) ) . '</div>';238 $html .= '</div>';239 $list[] = $html;240 }241 242 return join( '<br>', $list );243 159 } 244 160 } -
wpscan/trunk/app/Plugin.php
r2529086 r2540542 15 15 class Plugin { 16 16 // Settings. 17 public $OPT_API_TOKEN = 'wpscan_api_token';17 public $OPT_API_TOKEN = 'wpscan_api_token'; 18 18 public $OPT_SCANNING_INTERVAL = 'wpscan_scanning_interval'; 19 public $OPT_SCANNING_TIME = 'wpscan_scanning_time'; 20 public $OPT_IGNORE_ITEMS = 'wpscan_ignore_items'; 19 public $OPT_SCANNING_TIME = 'wpscan_scanning_time'; 20 public $OPT_IGNORE_ITEMS = 'wpscan_ignore_items'; 21 public $OPT_DISABLE_CHECKS = 'wpscan_disable_security_checks'; 21 22 22 23 // Account. … … 555 556 556 557 // Security checks. 557 $this->report['security-checks'] = array(); 558 559 foreach ( $this->classes['checks/system']->checks as $id => $data ) { 560 $data['instance']->perform(); 561 $this->report['security-checks'][ $id ]['vulnerabilities'] = array(); 562 563 if ( $data['instance']->vulnerabilities ) { 564 $this->report['security-checks'][ $id ]['vulnerabilities'] = $data['instance']->get_vulnerabilities(); 565 566 $this->maybe_fire_issue_found_action( 'security-check', $id, $this->report['security-checks'][ $id ] ); 558 if ( get_option( $this->OPT_DISABLE_CHECKS, array() ) !== '1' ) { 559 $this->report['security-checks'] = array(); 560 561 foreach ( $this->classes['checks/system']->checks as $id => $data ) { 562 $data['instance']->perform(); 563 $this->report['security-checks'][ $id ]['vulnerabilities'] = array(); 564 565 if ( $data['instance']->vulnerabilities ) { 566 $this->report['security-checks'][ $id ]['vulnerabilities'] = $data['instance']->get_vulnerabilities(); 567 568 $this->maybe_fire_issue_found_action( 'security-check', $id, $this->report['security-checks'][ $id ] ); 569 } 567 570 } 568 }571 } 569 572 570 573 // Caching. -
wpscan/trunk/app/Report.php
r2481423 r2540542 65 65 66 66 /** 67 * Get vulnerability status based on fixed_in 68 * 69 * @since 1.15.2 70 * @access public 71 * @return string 72 */ 73 public function status( $vulnerability ) { 74 return empty( $vulnerability->fixed_in ) 75 ? __( 'We are not aware of a fix for this vulnerability.', 'wpscan' ) 76 : sprintf( __( 'This vulnerability was fixed in version %s. We recommend that you update as soon as possible.', 'wpscan' ), esc_html( $vulnerability->fixed_in ) ); 77 } 78 79 /** 80 * HTML markup for the vulnerability details 81 * 82 * @since 1.15.2 83 * @access public 84 * @return string 85 */ 86 public function vulnerability_output( $vulnerability ) { 87 $html = '<div class="vulnerability">'; 88 $html .= '<p class="vulnerability-title"><b>' . esc_html( $vulnerability->title ) . '</b></p>'; 89 $html .= '<p class="vulnerability-status">' . $this->status( $vulnerability ) . '</p>'; 90 $html .= $this->vulnerability_severity( $vulnerability ); 91 $html .= '<br /><p class="vulnerability-link"><a href="' . esc_url( 'https://wpscan.com/vulnerability/' . $vulnerability->id ) . '" target="_blank">Click here for further details</a></p>'; 92 $html .= '</div>'; 93 94 return $html; 95 } 96 97 /** 67 98 * List vulnerabilities on screen 68 99 * … … 100 131 usort( $report['vulnerabilities'], array( 'self', 'sort_vulnerabilities' ) ); 101 132 102 foreach ( $report['vulnerabilities'] as $ item) {103 $id = 'security-checks' === $type ? $ item['id'] : $item->id;133 foreach ( $report['vulnerabilities'] as $vulnerability ) { 134 $id = 'security-checks' === $type ? $vulnerability['id'] : $vulnerability->id; 104 135 105 136 if ( in_array( $id, $ignored, true ) ) { … … 107 138 } 108 139 109 $html = '<div class="vulnerability">'; 110 $html .= $this->vulnerability_severity( $item ); 111 $html .= '<a href="' . esc_url( 'https://wpscan.com/vulnerability/' . $item->id ) . '" target="_blank">'; 112 $html .= $this->parent->get_sanitized_vulnerability_title( $item ); 113 $html .= '</a>'; 140 $list[] = $this->vulnerability_output( $vulnerability ); 141 } 142 143 echo empty( $list ) ? $null_text : join( '<br>', $list ); 144 145 } else { 146 echo esc_html( $null_text ); 147 } 148 } 149 150 /** 151 * List security check vulnerabilities in the report. 152 * This should be merged with the list_api_vulnerabilities() function, 153 * in the future, if anyone can figure out how... 154 * 155 * @param object $check - The check instance. 156 * 157 * @access public 158 * @return string 159 * @since 1.0.0 160 * 161 */ 162 public function list_security_check_vulnerabilities( $instance ) { 163 $vulnerabilities = $instance->get_vulnerabilities(); 164 $count = $instance->get_vulnerabilities_count(); 165 $ignored = $this->parent->get_ignored_vulnerabilities(); 166 167 $not_checked_text = __( 'Not checked yet. Click the Run button to run a scan', 'wpscan' ); 168 169 if ( ! isset( $vulnerabilities ) ) { 170 echo esc_html( $not_checked_text ); 171 } elseif ( empty( $vulnerabilities ) || 0 === $count ) { 172 echo esc_html( $instance->success_message() ); 173 } else { 174 $list = array(); 175 176 foreach ( $vulnerabilities as $vulnerability ) { 177 if ( in_array( $vulnerability['id'], $ignored, true ) ) { 178 continue; 179 } 180 181 $html = "<div class='vulnerability'>"; 182 $html .= "<p class='vulnerability-title'>" . wp_kses( $vulnerability['title'], array( 'a' => array( 'href' => array() ) ) ) . '</p><br />'; 183 $html .= "<p class='vulnerability-severity'>"; 184 $html .= "<span class='wpscan-" . esc_attr( $vulnerability['severity'] ) . "'>" . esc_html( $vulnerability['severity'] ) ." Severity</span>"; 185 $html .= '</p>'; 186 $html .= "<br /><br /><p class='vulnerability-link'><a href='" . esc_url( $vulnerability['remediation_url'] ) . "' target='_blank'>Click here for further details</a></p>"; 114 187 $html .= '</div>'; 115 188 … … 117 190 } 118 191 119 echo empty( $list ) ? $null_text : join( '<br>', $list ); 120 121 } else { 122 echo esc_html( $null_text ); 123 } 124 } 192 echo join( '<br>', $list ); 193 } 194 } 195 125 196 126 197 /** … … 156 227 if ( isset( $vulnerability->cvss->severity ) ) { 157 228 $severity = $vulnerability->cvss->severity; 158 $html .= "<span class='wpscan-" . esc_attr( $severity ) . "'>" . esc_html( $severity ) . ' </span>';229 $html .= "<span class='wpscan-" . esc_attr( $severity ) . "'>" . esc_html( $severity ) . ' Severity</span>'; 159 230 } 160 231 -
wpscan/trunk/app/Settings.php
r2511419 r2540542 83 83 register_setting( $this->page, $this->parent->OPT_SCANNING_INTERVAL, 'sanitize_text_field' ); 84 84 register_setting( $this->page, $this->parent->OPT_SCANNING_TIME, 'sanitize_text_field' ); 85 register_setting( $this->page, $this->parent->OPT_DISABLE_CHECKS, array( 'type' => 'boolean', 'default' => '0' ) ); 85 86 86 87 $section = $this->page . '_section'; … … 113 114 __( 'Scanning Time', 'wpscan' ), 114 115 array( $this, 'field_scanning_time' ), 116 $this->page, 117 $section 118 ); 119 120 add_settings_field( 121 $this->parent->OPT_DISABLE_CHECKS, 122 __( 'Disable Security Checks', 'wpscan' ), 123 array( $this, 'field_disable_security_checks' ), 115 124 $this->page, 116 125 $section … … 323 332 324 333 echo '</p><br/>'; 334 } 335 /** 336 * Disable security checks field 337 * 338 * @since 1.15.2 339 * @access public 340 * @return string 341 */ 342 public function field_disable_security_checks() { 343 $opt = $this->parent->OPT_DISABLE_CHECKS; 344 345 $value = get_option( $opt, array() ); 346 $checked = $value === '1' ? 'checked' : null; 347 348 echo "<input name='{$opt}' type='checkbox' $checked value='1' >"; 325 349 } 326 350 -
wpscan/trunk/app/Summary.php
r2511419 r2540542 26 26 add_action( 'admin_init', array( $this, 'add_meta_box_summary' ) ); 27 27 add_action( 'wp_ajax_wpscan_check_now', array( $this, 'ajax_check_now' ) ); 28 add_action( 'wp_ajax_wpscan_security_check_now', array( $this, 'ajax_security_check_now' ) ); 28 29 if ( get_option( $this->parent->OPT_DISABLE_CHECKS, array() ) !== '1' ) { 30 add_action( 'wp_ajax_wpscan_security_check_now', array( $this, 'ajax_security_check_now' ) ); 31 } 32 29 33 add_action( 'wp_ajax_' . $this->parent->WPSCAN_TRANSIENT_CRON, array( $this, 'ajax_doing_cron' ) ); 30 34 } … … 162 166 163 167 /** 164 * Ajax s curity check now168 * Ajax security check now 165 169 * 166 170 * @return void -
wpscan/trunk/app/ignoreVulnerabilities.php
r2429586 r2540542 128 128 $this->list_vulnerabilities_to_ignore( 'themes', $this->parent->get_theme_slug( $name, $details ) ); 129 129 } 130 131 foreach ( $this->parent->classes['checks/system']->checks as $id => $data ) { 132 $this->list_vulnerabilities_to_ignore( 'security-checks', $id ); 130 131 if ( get_option( $this->parent->OPT_DISABLE_CHECKS, array() ) !== '1' ) { 132 foreach ( $this->parent->classes['checks/system']->checks as $id => $data ) { 133 $this->list_vulnerabilities_to_ignore( 'security-checks', $id ); 134 } 133 135 } 134 136 } -
wpscan/trunk/assets/css/style.css
r2452411 r2540542 162 162 .vulnerability-severity { 163 163 float: left; 164 min-width: 60px; 165 margin-right: 20px; 166 } 167 168 .vulnerability-title { 164 min-width: 100px; 165 } 166 167 .vulnerability-title .vulnerability-status .vulnerability-link { 169 168 float: left; 170 169 } … … 176 175 border-radius: 3px; 177 176 font-size: 11px; 178 margin: 6px 0px 0px 0px;179 177 line-height: 19px; 180 min-width: 60px;178 min-width: 100px; 181 179 color: #4e645a; 182 180 background: #c6e1d5; -
wpscan/trunk/assets/js/download-report.js
r2529086 r2540542 361 361 const topTableBorder = is_wordpress_section ? 'WPTableLine' : 'tableLine'; 362 362 363 // name 364 363 // Name 365 364 table.table.body[1].push({ 366 365 text: 'Name', … … 370 369 table.table.widths.push(149); 371 370 372 // version371 // Version 373 372 if (!is_security_checks) { 374 373 table.table.body[1].push({ … … 408 407 let row = []; 409 408 410 // Item title411 let itemTitle = $(this).find('.plugin-title strong').text().trim();412 409 // Item name 410 let itemTitle = is_wordpress_section ? 'WordPress' : $(this).find('.plugin-title strong').text().trim(); 411 413 412 if ($(this).find('.plugin-title .item-closed').length) { 414 413 itemTitle = … … 426 425 427 426 // Item version 427 let itemVersion = is_wordpress_section ? $(this).find('#wordpress-version').text().trim() : $(this).find('.plugin-title .item-version span').text().trim(); 428 428 429 if (!is_security_checks) { 429 430 row.push({ 430 text: $(this) 431 .find('.plugin-title .item-version span') 432 .text() 433 .trim(), 431 text: itemVersion, 434 432 style: 'resTable', 435 433 borderColor, … … 451 449 .each(function () { 452 450 let item = $(this).clone(); 453 let linkText = 454 item.find('.vulnerability-severity span').text().trim() + ' - '; 455 item.find('.vulnerability-severity span').remove(); 456 linkText = linkText + item.text().trim(); 457 linkText = linkText.charAt(0).toUpperCase() + linkText.slice(1); 458 459 col.stack.push({ 460 text: linkText, 461 link: $(this).attr('href'), 462 style: 'resTable', 463 lineHeight: 2, 464 borderColor, 465 }); 451 let title = item.find('.vulnerability-title').text().trim(); 452 let status = item.find('.vulnerability-status').text().trim(); 453 let severity = item.find('.vulnerability-severity span').text().trim(); 454 let link_text = item.find('.vulnerability-link').text().trim(); 455 let link_href = item.find('.vulnerability-link a').attr('href'); 456 457 let vulnerability_text = [ 458 { text: title, style: 'resTable' }, 459 { text: status, style: 'resTable' }, 460 { text: severity.charAt(0).toUpperCase() + severity.slice(1), style: 'resTable' }, 461 { text: link_text, link: link_href, style: 'resTable' } 462 ] 463 464 col.stack.push( vulnerability_text ); 466 465 }); 467 466 … … 479 478 }); 480 479 481 // push the table480 // Push the table 482 481 is_wordpress_section 483 482 ? wpscanReport.content.push(wordpressTable) -
wpscan/trunk/readme.txt
r2529086 r2540542 4 4 Requires at least: 3.4 5 5 Tested up to: 5.6 6 Stable tag: 1.15. 16 Stable tag: 1.15.2 7 7 Requires PHP: 5.5 8 8 License: GPLv3 … … 90 90 91 91 == Changelog == 92 93 = 1.15.2 = 94 * Improve HTML and PDF report output 95 * Disable security checks setting 96 * Some refactoring 92 97 93 98 = 1.15.1 = -
wpscan/trunk/security-checks/debuglog-files/check.php
r2511419 r2540542 69 69 70 70 if ( 200 === $code ) { 71 $this->add_vulnerability( __( 'A publicly accessible debug.log file was found in', 'wpscan' ) . " <a href='$url' target='_blank'>$url</a> .", 'high', sanitize_title( $file ), 'https://blog.wpscan.com/2021/03/18/wordpress-debug-log-files.html' );71 $this->add_vulnerability( __( 'A publicly accessible debug.log file was found in', 'wpscan' ) . " <a href='$url' target='_blank'>$url</a>", 'high', sanitize_title( $file ), 'https://blog.wpscan.com/2021/03/18/wordpress-debug-log-files.html' ); 72 72 } 73 73 } -
wpscan/trunk/views/report.php
r2511419 r2540542 51 51 <th scope="row" class="check-column" style="text-align: center"> 52 52 <?php echo $this->get_status( 'wordpress', get_bloginfo( 'version' ) ) ?></th> 53 <td class="plugin-title column-primary"> 54 <strong>WordPress</strong> 55 <span class='item-version'> 56 <?php echo sprintf( __( 'Version <span>%s</span>', 'wpscan' ), get_bloginfo( 'version' ) ) ?> 57 </span> 53 <td class="wordpress-title column-primary"> 54 <strong>WordPress <span id="wordpress-version"><?php echo get_bloginfo( 'version' ) ?></span></strong> 58 55 </td> 59 56 <td class="vulnerabilities"> … … 94 91 95 92 <td class="plugin-title column-primary"> 96 <strong><?php echo esc_html( $details['Name']) ?></strong>93 <strong><?php echo esc_html( $details['Name'] ) ?></strong> 97 94 <span class='item-version'> 98 95 <?php echo sprintf( __( 'Version <span>%s</span>', 'wpscan' ), esc_html($details['Version']) ) ?> … … 163 160 </div> 164 161 165 <div class="wpscan-report-section security-checks"> 166 <h3><?php _e('Security Checks', 'wpscan') ?></h3> 167 168 <table class="wp-list-table widefat striped plugins"> 169 <thead> 170 <tr> 171 <td scope="col" class="manage-column check-column"></td> 172 <th scope="col" class="manage-column column-name column-primary"><?php _e('Name', 'wpscan') ?></th> 173 <th scope="col" class="manage-column column-description"><?php _e('Result', 'wpscan') ?></th> 174 <th scope="col" class="manage-column column-description"><?php _e('Actions', 'wpscan') ?></th> 175 </tr> 176 </thead> 177 <tbody id="report-themes"> 178 <?php foreach ( $this->parent->classes['checks/system']->checks as $id => $data ) : ?> 179 <tr> 180 <th scope="row" class="check-column" style="text-align: center"> 181 <?php echo $this->get_status('security-checks', $id) ?></th> 182 </th> 183 <td class="plugin-title column-primary"> 184 <strong title="<?php echo esc_attr($data['instance']->description()) ?>"> 185 <?php echo esc_html($data['instance']->title()) ?> 186 </strong> 187 </td> 188 <td class="vulnerabilities"> 189 <?php $this->parent->classes['checks/system']->list_check_vulnerabilities( $data['instance'] ) ?> 190 </td> 191 <td class="security-check-actions"> 192 <?php $this->parent->classes['checks/system']->list_actions($data['instance']) ?> 193 <span class="spinner"></span> 194 </td> 195 </tr> 196 <?php endforeach; ?> 197 </tbody> 198 </table> 199 </div> 162 <?php if ( get_option( $this->parent->OPT_DISABLE_CHECKS, array() ) !== '1' ) { ?> 163 164 <div class="wpscan-report-section security-checks"> 165 <h3><?php _e('Security Checks', 'wpscan') ?></h3> 166 167 <table class="wp-list-table widefat striped plugins"> 168 <thead> 169 <tr> 170 <td scope="col" class="manage-column check-column"></td> 171 <th scope="col" class="manage-column column-name column-primary"><?php _e('Name', 'wpscan') ?></th> 172 <th scope="col" class="manage-column column-description"><?php _e('Result', 'wpscan') ?></th> 173 <th scope="col" class="manage-column column-description"><?php _e('Actions', 'wpscan') ?></th> 174 </tr> 175 </thead> 176 <tbody id="report-themes"> 177 <?php foreach ( $this->parent->classes['checks/system']->checks as $id => $data ) : ?> 178 <tr> 179 <th scope="row" class="check-column" style="text-align: center"> 180 <?php echo $this->get_status('security-checks', $id) ?></th> 181 </th> 182 <td class="plugin-title column-primary"> 183 <strong title="<?php echo esc_attr($data['instance']->description()) ?>"> 184 <?php echo esc_html( $data['instance']->title() ) ?> 185 </strong> 186 </td> 187 <td class="vulnerabilities"> 188 <?php $this->list_security_check_vulnerabilities( $data['instance'] ) ?> 189 </td> 190 <td class="security-check-actions"> 191 <?php $this->parent->classes['checks/system']->list_actions($data['instance']) ?> 192 <span class="spinner"></span> 193 </td> 194 </tr> 195 <?php endforeach; ?> 196 </tbody> 197 </table> 198 </div> 199 200 <?php } ?> 200 201 201 202 <?php if ( get_option( $this->parent->OPT_API_TOKEN ) ) { ?> -
wpscan/trunk/wpscan.php
r2529086 r2540542 4 4 * Plugin URI: http://wordpress.org/plugins/wpscan/ 5 5 * Description: WPScan WordPress Security Scanner. Scans your system for security vulnerabilities listed in the WPScan Vulnerability Database. 6 * Version: 1.15. 16 * Version: 1.15.2 7 7 * Author: WPScan Team 8 8 * Author URI: https://wpscan.com/
Note: See TracChangeset
for help on using the changeset viewer.