Adding Additional Protocols to Hydra

Hydra is structured in a very modular way, and therefore adding support for an additional protocol requires that Hydra support the defined module interface.

Each protocol is implemented in a file called hydra- <service name> .c containing a function prototype:

void service_<service name> (unsigned long int ip, int sp, unsigned char options,
            char *miscptr, FILE *fp, int port);

The options passed to the service function are outlined in Table 3-2.

Table 3-2. Service function parameters

Parameter

Description

ip

ip is the IP address of the target host.

sp

sp is a socket used to read login (username) and password pairs for this task.

options

options is for user options. Currently this is 0, or OPTION_SSL if the user has specified to use Secure Sockets Layer (SSL).

miscptr

miscptr is a user-supplied additional parameter. This is for services that require more information than is supplied by default. Example modules using this parameter include the http, https, http-proxy, smbnt, ldap, cisco-enable, and SAP/R3 modules.

fp

fp is a socket used to report found login (username) and password pairs for this task.

port

If the user has defined a port to connect to, it is contained in port. This is used when services are run on nonstandard ports.

Once the service file has been written, integrating the modules into Hydra is simple:

  • Add the new hydra- <service> into the relevant areas within the Makefile.am file.

  • Edit the hydra.c file to add a reference ...

Get Network Security Tools now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.