Child pages
  • WHM API 1 Functions - get_cphulk_user_brutes
Skip to end of metadata
Go to start of metadata

Description

This function lists brute force attack entries from the cPHulk database, ordered by user accounts.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/json-api/get_cphulk_user_brutes?api.version=1
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/json-api/get_cphulk_user_brutes?api.version=1
 Command Line
whmapi1 get_cphulk_user_brutes


Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{
 "data": {
    "user_brutes": [
      {
        "exptime": "2014-11-07 00:00:00",
        "timeleft": "14",
        "user": "example",
        "service": "ftp",
        "authservice": "qut",
        "logintime": "2014-10-20 00:00:00",
        "ip": "192.168.0.1"
      },
      {
        "exptime": "2014-11-20 00:00:00",
        "timeleft": "8",
        "user": "example",
        "service": "ftp",
        "authservice": "qut",
        "logintime": "2014-10-20 00:00:00",
        "ip": "192.168.0.2"
      },
    ]
  },
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": 1,
    "command": "get_cphulk_user_brutes"
  }
}
 Output (XML)
<result>
    <data>
        <user_brutes>
            <exptime>2014-11-07 00:00:00</exptime>
            <timeleft>14</timeleft>
            <user>example</user>
            <service>ftp</service>
            <authservice>qut</authservice>
            <logintime>2014-10-20 00:00:00</logintime>
            <ip>192.168.0.2</ip>
        </user_brutes>
        <user_brutes>
            <exptime>2014-11-20 00:00:00</exptime>
            <timeleft>8</timeleft>
            <user>example</user>
            <service>ftp</service>
            <authservice>qut</authservice>
            <logintime>2014-10-20 00:00:00</logintime>
            <ip>192.168.0.2</ip>
        </user_brutes>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>get_cphulk_user_brutes</command>
    </metadata>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible valuesExample
user_brutesarray of hashesAn array of hashes of information about each brute force attack.This array includes the exptime, timeleft, service, authservice, logintime, user, and ip returns. 

exptime

string

When the login request will time out.

The function returns this value in the user_brutes array of hashes.

A valid time in YYYY-MM-DD hh:mm:ss format, where:

  • YYYY represents the year.
  • MM represents the month.
  • DD represents the day.
  • hh represents the hour.
  • mm represents the minute.
  • ss represents the second.
2014-12-07 00:00:00

timeleft

integer

The number of minutes that remain before cPHulk removes the block.

The function returns this value in the user_brutes array of hashes.

A positive integer that represents a number of minutes.14

user

string

The username for which login attempt occurred.

The function returns this value in the user_brutes array of hashes.

A valid cPanel user name.example

service

string

The service on which the login attempt occurred.

The function returns this value in the user_brutes array of hashes.

A valid cPanel service name.ftp

authservice

string

The authentication service on which the login attempt occurred.

The function returns this value in the user_brutes array of hashes.

A valid authentication service name.null

logintime

string

When the login attempt occurred.

The function returns this value in the user_brutes array of hashes.

A valid time in YYYY-MM-DD hh:mm:ss format, where:

  • YYYY represents the year.
  • MM represents the month.
  • DD represents the day.
  • hh represents the hour.
  • mm represents the minute.
  • ss represents the second.
2014-11-20 00:00:00

ip

string

The IP address of the login attempt.

The function returns this value in the user_brutes array of hashes.

A valid IP address.192.168.0.1