Customize the captcha page

Estimated reading time: 1 min

You can make the BitNinja captcha page more user-friendly by customizing it. For example, you can include your company logo. This way, users will be more familiar with it The captcha page can be customized on a per-server basis.

The default captcha page is stored in the /opt/bitninja/modules/CaptchaHttp/lib/www/ directory.
However, if you place your custom captcha pages into the /etc/bitninja/CaptchaHttp/www/ then these pages will be served to the Challange listed visitors.

Step-by-step guide:

  1. Copy the contents of the /opt/bitninja/modules/CaptchaHttp/lib/www/ directory to the /etc/bitninja/CaptchaHttp/www/ directory.
    You can do this from your preferred SFTP, FTP, or SCP client. Or use the command below.
    cp -R /opt/bitninja/modules/CaptchaHttp/lib/www/ /etc/bitninja/CaptchaHttp/www/
  2. Open the /etc/bitninja/CaptchaHttp/www/captcha_challenge_template.html file and modify its contents.
    You can do this with your preferred HTML editor or code editor after downloading the files to your computer via SFTP, FTP, or, SCP client.
    Or edit the file in the terminal using nano like this:
    nano /etc/bitninja/CaptchaHttp/www/captcha_challenge_template.html
  3. Save the changes and exit the file editor.
  4. Restart BitNinja with the service bitninja restart command.

Change the text of the captcha

The text of the captcha page can be changed in the /etc/bitninja/CaptchaHttp/www/captcha_challenge_template.html file by editing the SUBTITLE: section at the corresponding languages.

Change the logo on the Captcha page

The BitNinja logo is inserted into the page as SVG. You can find the logo in the text if you search for “bn-logo”. Then replace the SVG with your own. Or replace the SVG logo with your .png logo.

The best practice is to use a link to refer to the logo in the captcha page to avoid uploading the picture to each server.

You can press Ctrl + W to find the corresponding div in nano. Search for “bn-logo”.

Delete the <svg> and </svg> tags and the lines between them in the div.
In nano, you can delete complete lines by pressing Ctrl + K.

Add your logo in this format:
<img src="https://link.to/my/company/logo.png" alt="logo">

Please make sure to leave the %remote_addr% and %recaptcha_html% parts of the HTML code unchanged, otherwise users might be unable to delist their IP addresses in case of a false positive catch.

After the logo and the text is changed you will need to restart the BitNinja agent so the changes will take effect.
Issue the service bitninja restart command to restart the BitNinja agent.

Was this article helpful?
It was not helpful
Views: 943