<commit_before>
/**
 * wpscan module wp-login.js
 * Scan WordPress login page for mistakes
 */


/**
 * Required modules
 */

const request = require( 'request' ).defaults( { followRedirect: false } )
const fs = require( '../fs' )
const log = require( '../log' )


/**
 * Initiator method
 *
 * @param   {Object}  data  Data object with request values
 * @return  void
 */

exports.fire = ( data ) => {

    const { wpURL, userAgent, silentMode } = data

    const filterName = fs.fileName( __filename, '.js' )

    const logObj = { silentMode, filterName }

    const targetURL = `${wpURL}/wp-login.php`

    request( {
        'url': targetURL,
        'method': 'HEAD',
        'headers': { 'User-Agent': userAgent }
    }, ( error, response ) => {

        if ( error || response.statusCode === 404 ) {
            return log.info( `${targetURL} is not found`, logObj )
        }

        if ( response.request.uri.protocol !== 'https:' ) {
            log.info( `${targetURL} is not use HTTPS protocol`, logObj )
        } else {
            log.ok( `${targetURL} use HTTPS protocol`, logObj )
        }

        if ( ! [401, 403].includes( response.statusCode ) ) {
            return log.info( `${targetURL} is not protected by HTTP Auth`, logObj )
        }

        return log.ok( `${targetURL} is protected by HTTP Auth`, logObj )

    } )
}<commit_msg>Fixes grammar for output on wp-config.php. (#32)<commit_after>
/**
 * wpscan module wp-login.js
 * Scan WordPress login page for mistakes
 */


/**
 * Required modules
 */

const request = require( 'request' ).defaults( { followRedirect: false } )
const fs = require( '../fs' )
const log = require( '../log' )


/**
 * Initiator method
 *
 * @param   {Object}  data  Data object with request values
 * @return  void
 */

exports.fire = ( data ) => {

    const { wpURL, userAgent, silentMode } = data

    const filterName = fs.fileName( __filename, '.js' )

    const logObj = { silentMode, filterName }

    const targetURL = `${wpURL}/wp-login.php`

    request( {
        'url': targetURL,
        'method': 'HEAD',
        'headers': { 'User-Agent': userAgent }
    }, ( error, response ) => {

        if ( error || response.statusCode === 404 ) {
            return log.info( `${targetURL} is not found`, logObj )
        }

        if ( response.request.uri.protocol !== 'https:' ) {
            log.info( `${targetURL} doesn't use HTTPS protocol`, logObj )
        } else {
            log.ok( `${targetURL} uses HTTPS protocol`, logObj )
        }

        if ( ! [401, 403].includes( response.statusCode ) ) {
            return log.info( `${targetURL} is not protected by HTTP Auth`, logObj )
        }

        return log.ok( `${targetURL} is protected by HTTP Auth`, logObj )

    } )
}
{'fraction_non_alphanumeric': 0.15092290988056462, 'fraction_numerical': 0.007238508867173362, 'mean_word_length': 2.2787663107947806, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1164650', 'n_tokens_mistral': 859, 'n_tokens_neox': 822, 'n_words': 245}