Back to Top

@k7eon/bruteforce-security-checker master

showMetrics(metrics, interval)

NEW this method replace this.setMetrics and this.startShowingMetrics in to one method Create metrics object like counter to monitor custom metrics start interval showing metrics

Parameters

Name Type Description
metrics object

object of string like {'good':0, 'bad':0}

interval number

ms, interval of console.log

Returns

Void

createFilesIfNotExists(filesObj)

Creates files if they are not exists But directories must be created by hand

Parameters

Name Type Description
filesObj object

like {loggedIn: './loggedIn.log'}

Returns

Void

loadAccounts(opts)

  1. load accounts from file
  2. build they in like {email, password}[]

You can define own methods for mutate left and right line half. Please don`t load more than 1kk lines. It so slow.

Parameters

Name Type Description
opts object string
  • object or path string
opts.path string

required. Path to file with accounts

opts.leftName string

default 'email'. The of the left half

opts.rightName string

default 'password'. The of the right half.

opts.delimiter string

default /:|;/ . The delimiter between 'email' and 'password'

opts.leftCallback function

default null. May be (email) => {} Must return null, string or object

opts.rightCallback function

default null. May be (password) => {} Must return null, string or object

Examples

 let r = loadAccounts({
   path: 'files/source.txt',
   leftName: 'email',
   rightName: 'password',
   leftCallback: (email) => {
     // let login = email.split('@')[0];
     // return {login, email};
     // // or
     // return null;
     // // or
     return email;
   },
   rightCallback: (password) => {
     // return null;
     // // or
     return password;
     // // or
     // return {password, p2: password};
   },
 })
 // return {email, password}[]

Returns

Array

removeAccountsBy(by, path)

Remove all lines from this.accounts that includes 'email' attr in 'path' file Update this.accounts

Parameters

Name Type Description
by string

any attribute from this.accounts[0]

path string array

path/s to file whose lines will be removed from this.accounts through indexOf

Returns

Array

removeAccountsV2By(by, path)

More faster way than removeAccountsBy more than x10 Remove all lines from this.accounts that includes 'email' attr in 'path' file Update this.accounts

Parameters

Name Type Description
by string

any attribute from this.accounts[0]

path string array

path/s to file whose lines will be removed from this.accounts through indexOf

Returns

Array

loadProxies(path, silent)

todo http proxy support File contain lines like: "128.12.1.1:1080" Update this.proxies

Parameters

Name Type Description
path string

path to file

silent boolean

is need showing message after success loading proxies

Returns

Array

loadProxyAgents(path, type)

sometimes this works not "this.loadProxyAgentsV2" using const HttpsProxyAgent = require('https-proxy-agent'); const HttpProxyAgent = require('http-proxy-agent'); const SocksProxyAgent = require('socks-proxy-agent'); this libs

Parameters

Name Type Description
path string

path to file

type string

default='http'. ('http' or 'https' or 'socks')

Returns

Array

loadProxyAgentsV2(path, type)

sometimes this works not "this.loadProxyAgents" using const ProxyAgent = require('proxy-agent'); this libs

Parameters

Name Type Description
path string

path to file

type string

default='http'. ('http' or 'https' or 'socks')

Returns

Array

queueLeft()

Return count of left work in queue

Returns

number

getAgent()

this.agents.shift()

Returns

Agent

returnAgent(agent, timeout)

push(agent) after 'timeout'

Parameters

Name Type Description
agent Agent
timeout number

Returns

start(opts)

Start processing

Parameters

Name Type Description
opts object
opts.THREADS number

threads amount

opts.handlerFunc function

required.

opts.whatToQueue string

from this. context. ('accounts' or 'agents')

opts.startMessage string

this will print on bruteforce start checking

opts.drainMessage string

this will print when all tasks are processed

opts.drainCallback function

required. Callback when all tasks are processed

opts.useProxy boolean

default false

Examples

  // handlerFunc
  handlerFunc: async (task,agent) => {
    try { }
    catch(e) {}
    return {agent?}
  }.
  // if return {agent} then will call this.returnAgent

Returns

boolean

timeout(ms)

Async timeout implementation

Parameters

Name Type Description
ms number

Examples

  await this.timeout(5000)

Returns

Promise.<any>

reCheck(task)

Add task in queue to execute again

Parameters

Name Type Description
task

Returns

Void

save(path, line, metricsName)

write content to file + '\n' and increase metrics counter if needed

Parameters

Name Type Description
path

destination path

line

line to write

metricsName

what metrics must be increased by 1

Returns

Void

setMetrics(metrics)

DEPRECATED, use this.showMetics instead Create metrics object like counter to monitor custom metrics

Parameters

Name Type Description
metrics object

object of string like {'good':0, 'bad':0}

Returns

Void

startShowingMetrics(interval)

DEPRECATED, use this.showMetics instead start interval showing metrics

Parameters

Name Type Description
interval number

ms, interval of console.log

Returns

Void

loadRegisteredAccounts({string path)

DEPRECATED use this.loadAccounts instead

Parameters

Name Type Description
{string path

Returns

Array

like {login, email, password}[]

removeAccountsFrom(by, path)

DEPRECATED use this.removeAccountsBy instead

Parameters

Name Type Description
by string

any attribute from this.accounts[0]

path string

path to file whose lines must be removed from this.accounts

Returns

Array

new ProxyChecker()

This things are doing many times. I add this in module Support only socks proxy

Returns

Void

ProxyChecker.run(startPath, endPath, proxyType, THREADS, timeout)

Parameters

Name Type Description
startPath

file to load proxy. Lines like 123.321.321.33:31233

endPath

file to store valid proxies

proxyType

'http' or 'socks'

THREADS

amount of thread running in parallel

timeout

amount of milliseconds to wait response

Returns

Void

getSetCookies(rResponse)

retrieve 'set-cookie' header from 'request'.response

Parameters

Name Type Description
rResponse

Returns

parse(source, start, end)

Retrieve sub string by passing 'start' and 'end' substring example: parse('123baaz321', '123', '321') will return 'baaz'

Parameters

Name Type Description
source string

source string

start string

start substring

end string

end substring

Returns

string