Giter VIP home page Giter VIP logo

itemir / apache_2fa Goto Github PK

View Code? Open in Web Editor NEW
73.0 14.0 31.0 130 KB

Apache two-factor (2FA) authentication with Google Authenticator based on Time-based One-Time Password (TOTP) or HMAC-based one-time password (HOTP) Algorithms.

License: BSD 2-Clause "Simplified" License

Python 81.23% Shell 1.39% HTML 17.38%
apache 2fa totp google-authenticator authy two-factor-authentication two-factor hotp

apache_2fa's Introduction

Apache Two-Factor (2FA) Authentication with Google Authenticator

Two-factor authentication also known as 2FA, adds an extra step to a basic authentication procedure. Without 2FA, a user only enters username and password. In this case, the password is the single factor of authentication. With 2FA an additional authentication mechanism is used, that is preferably performed out-of-band.

Google Authenticator is an application that implements two-factor authentication services using the Time-based One-time Password Algorithm (TOTP).

Apache provides basic authentication mechanism with mod_auth_basic or mod_auth_digest. For more secure applications, it is often required to have an additional layer of authentication. This repository provides necessary code and instructions to add two-factor authentication to basic Apache authentication. This method is transparent to underlying applications so it can be used for any Apache served web site whether it is static, dynamic (PHP, Django, Flask etc.) or pre-packaged (Wiki, CRM, CMS etc.).

Specific instructions are provided below for configuring two-factor authentication with mod_auth_digest, but the same code and approach can be used with different Apache authentication mechanisms with slight modifications. Similarly, it is also possible to use the same code with slight modifications and the same approach to provide 2FA based on HMAC-based one-time password (HOTP) algorithm.

Instructions

Clone the repository and install dependencies:

$ git clone https://github.com/itemir/apache_2fa
$ cd apache_2fa
$ pip install -r requirements # Might require sudo

Create a directory for storing states:

$ mkdir state

Adjust permissions to allow access only to Apache (replace www-data with the user id of Apache process as needed):

$ sudo chown www-data:www-data state
$ sudo chown www-data:www-data tokens.json
$ sudo chmod 750 state
$ sudo chmod 640 tokens.json

Enable mod_rewrite, mod_auth_digest and mod_cgid if not already enabled (you will need to restart Apache):

$ sudo a2enmod rewrite
$ sudo a2enmod auth_digest
$ sudo a2enmod cgid
$ sudo service apache2 restart

Add the following configuration to Apache configuration under appropriate VirtualHost:

RewriteEngine On

RewriteCond %{REQUEST_URI} !^/auth/
RewriteCond %{HTTP_COOKIE} !^.*2FA_Auth=([a-zA-Z0-9]+)
RewriteRule ^(.*)$ /auth/auth?$1?%{QUERY_STRING} [L,R=302]

RewriteCond %{REQUEST_URI} !^/auth/
RewriteCond %{HTTP_COOKIE} ^.*2FA_Auth=([a-zA-Z0-9]+)
RewriteCond <path to apache_2fa>/state/%1 !-f
RewriteRule ^(.*)$ /auth/auth?$1?%{QUERY_STRING} [L,R=302]

ScriptAlias /auth/ <path to_apache 2fa (note the trailing slash)>/

<Directory <path to apache_2fa>>
    AuthType Digest
    AuthName "yourdomain.com"
    AuthDigestDomain /
    AuthDigestProvider file
    AuthUserFile <path to apache_2fa>/apache_credentials
    Require valid-user
</Directory>

<Directory <path to protected directory>>
    AuthType Digest
    AuthName "yourdomain.com"
    AuthDigestDomain /
    AuthDigestProvider file
    AuthUserFile <path to apache_2fa>/apache_credentials
    Require valid-user
</Directory>

Replace path to apache_2fa with the full path of cloned repository, path to protected directory with the actual path of the site you are trying to protect. If you change yourdomain.com make sure to make corresponding changes in apache_credentials file. Pay special attention to trailing slashes where present. You may be able to combine two Directory configurations into one depending on your directory structure, just make sure both paths are covered by the same auhentication mechanism.

NOTE: This configuration is for https. For a setup like this, using http is not recommended. However, if you want to test it with http you need to make changes to the auth script and comment out the following two lines:

cookie['2FA_Auth']['secure'] = True
cookie['2FA_Auth']['httponly'] = True

Test the configuration and reload Apache if no errors. If there are errors, verify steps above and make sure if you have all necessary modules enabled.

$ sudo apachectl configtest
$ sudo service apache2 reload

If all went well, you can now test the application. Go to a protected web page. You should be prompted to enter a username and password. Use test_user / test_password. You should now be prompted for an Authentication Token. If test_user authentication fails, change the password with the following command:

$ htdigest apache_credentials yourdomain.com test_user

In order to obtain Authentication Token, download Google Authenticator for iOS or Android and create a profile by scanning the following QR code:

QR Code

Alternatively, you can use the R24UZEAOIUAZHY62IEB5XJOVKT6PYGOYNDKVVU3KS4DZCYOOSIF6M6TFYEWVZAOX secret key. There are many other applications that provide the same capability with additional features, you can basically use any application that supports TOTP. Once you define a profile, Google Authenticator will create a token that you can use in this form.

If the test is successful, edit apache_credentials and tokens.json files and remove test_user.

Maintenance

You can create new users with the following command:

$ htdigest apache_credentials yourdomain.com <username>

You can create corresponding OTP secrets with the following command:

$ ./create_token.py <username> # May require sudo

This will create a new token in tokens.json file and create <username>.png file with the QR code you can scan with your authenticator app.

For every successful authentication session, a new file will be created under /state directory. This file is relevant until the cookie expires (default value is 6 hours for expiration). You will eventually want to clean stale entries in this directory. state_clean utility that is included the repository can be used to delete state files that are older than 6 hours. You can call it from a cron job every hour which also prevents users from manually increasing the expiration timer of cookies to delay token re-authorization:

0 * * * * <path to apache_2fa>/state_clean

apache_2fa's People

Contributors

bitwiser73 avatar hightowe avatar itemir avatar markclowes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

apache_2fa's Issues

Is this broken?

Running on apache 2.4.50.
I get redirected to /auth/auth?/%3f every time

Destroy token?

I'm new to 2FA and just set it up for my private web services.
Now I'm wondering if we aren't missing a "destroy token" functionality which could be triggered when a user logs out from an application. As only logging out of the application would still leave the token valid.

Before I start adding the related functionality, I thought I ask for your thoughts, just to make sure I didn't miss something here.

Instructions should specify pip3, perhaps

I'm not a Python expert, but using Ubuntu 16.04 I found the current instructions apparently start python3 by default. In Linux, "python" start Python v2.x while "python3" starts Python v3.x. Meanwhile, "pip" starts the package manager for Python v2.x, so the instruction to install the onetimepass resulted in python3 being unable to import the module.

To fix, I installed pip3:
sudo apt install python3-pip

Then added onetimepass:
sudo -H pip3 install onetimepass

Then everything worked as expected. Thanks very much for Apache_2fa!

Proxy instead of Directory (Question)

Hi Itemir,

I have no experienced background in Apache and Virtual Hosts, but I would like to implement the following. I have one amazon server instance (linux) with a running Jenkins on 'localhost:8080'. I want the user to use Multifactor authentication on Port 80, and provide the user access to Jenkins via the Proxy after authentication.
Regretfully it is not possible to set up a Proxy using the Directory block, or I at least don't know how. Do you see a possibility to use your code in combination with a Proxy?

Kind Regards,
Bert

500 Error

I've followed README.md, but still have issues:

After all is said and do, I go to the page, and I'm prompted with an auth prompt, which I successfully complete, and when I'm supposed to be forwarded to the google authenticator phase, I get a 500 error, and the error log says:

[cgid:error] [pid 9002] [client xxx.xxx.xxx.xxx:54750] End of script output before headers: auth

Not sure what the issue is. Any suggestions

ERR_TOO_MANY_REDIRECTS

I'm getting this error using ispconfig3:

This page isn’t working
mydomain.com redirected you too many times.
Try clearing your cookies.
ERR_TOO_MANY_REDIRECTS

I followed your instructions carefully. Is there anything I should do or test?

Blank page with : Contact your administrator to obtain your 2FA secret.

Hi,

French guy, apache 2.4, ubuntu 18.04

After installing all, web site ask me for login and password then show me only a white page with :

Contact your administrator to obtain your 2FA secret.

What i am doing wrong ? Thanks !

`

<VirtualHost *:1443>
ServerName denis.xxx.com

 RewriteEngine On
 RewriteCond %{REQUEST_URI} !^/auth/
 RewriteCond %{HTTP_COOKIE} !^.*2FA_Auth=([a-zA-Z0-9]+)
 RewriteRule ^(.*)$ /auth/auth?$1?%{QUERY_STRING} [L,R=302]

 RewriteCond %{REQUEST_URI} !^/auth/
 RewriteCond %{HTTP_COOKIE} ^.*2FA_Auth=([a-zA-Z0-9]+)
 RewriteCond /etc/apache2/2fa/apache_2fa/state/%1 !-f
 RewriteRule ^(.*)$ /auth/auth?$1?%{QUERY_STRING} [L,R=302]

 ScriptAlias /auth/ /etc/apache2/2fa/apache_2fa/

 <Directory /etc/apache2/2fa/apache_2fa>
   AuthType Digest
   AuthName "denis.xxx.com"
   AuthDigestDomain /
   AuthDigestProvider file
   AuthUserFile /etc/apache2/2fa/apache_2fa/apache_credentials
   Require valid-user
 </Directory>

 <Directory /var/www/html/android>
   AuthType Digest
   AuthName "denis.xxx.com"
   AuthDigestDomain /
   AuthDigestProvider file
   AuthUserFile /etc/apache2/2fa/apache_2fa/apache_credentials
   Require valid-user
 </Directory>

 Include ssl.conf

`

AuthDigest not recommended for security reasons

From the Apache http documentation regarding AuthDigest which is used as an example in this project's documentation:

This module implements HTTP Digest Authentication (RFC2617), and provides an alternative to mod_auth_basic where the password is not transmitted as cleartext. However, this does not lead to a significant security advantage over basic authentication. On the other hand, the password storage on the server is much less secure with digest authentication than with basic authentication. Therefore, using basic auth and encrypting the whole connection using mod_ssl is a much better alternative.

https://httpd.apache.org/docs/2.4/mod/mod_auth_digest.html

Looks like token is accepted, but i'm redirected to auth page again and again

Thank you for your Authenticator code.
It almost works for me... but I'm stuck at page asking me token...
Can't understand what I did wrong.

My setup: ubuntu server 17.04 with default apache setup (with default index.html page i'm trying to protect)
Website page located at: /var/www/html/
Your code was cloned to: /var/www/a2fa/

I added lines listed below to my /etc/apache2/sites-available/000-default.conf:

RewriteEngine On

RewriteCond %{REQUEST_URI} !^/auth/
RewriteCond %{HTTP_COOKIE} !^.*2FA_Auth=([a-zA-Z0-9]+)
RewriteRule ^(.*)$ /auth/auth?$1?%{QUERY_STRING} [L,R=302]

RewriteCond %{REQUEST_URI} !^/auth/
RewriteCond %{HTTP_COOKIE} ^.*2FA_Auth=([a-zA-Z0-9]+)
RewriteCond /var/www/a2fa/state/%1 !-f
RewriteRule ^(.*)$ /auth/auth?$1?%{QUERY_STRING} [L,R=302]

ScriptAlias /auth/ /var/www/a2fa/

<Directory /var/www/a2fa>
     AuthType Digest
     AuthName "yourdomain.com"
     AuthDigestDomain /
     AuthDigestProvider file
     AuthUserFile /var/www/a2fa/apache_credentials
     Require valid-user
</Directory>
 
<Directory /var/www/html>
     AuthType Digest
     AuthName "yourdomain.com"
     AuthDigestDomain /
     AuthDigestProvider file
     AuthUserFile /var/www/a2fa/apache_credentials
     Require valid-user
</Directory>

I can pass apache digest authentication. But OTP token is not accepted, and google auth page is shown again and again.
I can see that cookie files appear in /var/www/a2fa/state folder, so it means that token is valid... but it seems that apache rewrite rules fail somewhere.
Could you please advise.

Unable to Complete

I have completed 1st step of authentication, but after successful authenticate google authenticate page will not come, straight redirect to protected directory. Not sure why?

Can you please help me out?

My Virtual Host file look like below

i am working in xampp on localhost in ubuntu

RewriteEngine On

RewriteCond %{REQUEST_URI} !^/auth/
#RewriteCond %{HTTP_COOKIE} !^.*2FA_Auth=([a-zA-Z0-9]+)
RewriteRule ^(.*)$ /auth/auth?$1?%{QUERY_STRING} [L,R=302]

RewriteCond %{REQUEST_URI} !^/auth/
#RewriteCond %{HTTP_COOKIE} ^.*2FA_Auth=([a-zA-Z0-9]+)
RewriteCond /opt/lampp/htdocs/2factor/apache_2fa/state/%1 !-f
RewriteRule ^(.*)$ /auth/auth?$1?%{QUERY_STRING} [L,R=302]

ScriptAlias /auth/ /opt/lampp/htdocs/2factor/apache_2fa/

<Directory /opt/lampp/htdocs/2factor/apache_2fa>
AuthType Digest
AuthName "dev.apache2fa.com"
AuthDigestDomain /
AuthDigestProvider file
AuthUserFile /opt/lampp/htdocs/2factor/apache_2fa/apache_credentials
Require valid-user

    <Directory /opt/lampp/htdocs/Temp>
        AuthType Digest
        AuthName "dev.apache2fa.com"
        AuthDigestDomain /
        AuthDigestProvider file
        AuthUserFile /opt/lampp/htdocs/2factor/apache_2fa/apache_credentials
        Require valid-user
    </Directory>

You don't have permission to access /auth/auth on this server.

Hi,

Thank You for this great package.

I am stuck and can't access my website anymore.

My apache2.conf looks like this:

<
Options -Indexes
Options FollowSymLinks
AllowOverride None
Require all denied

<Directory /usr/share>
AllowOverride None
Require all granted

<Directory /var/www/html/private_website/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted

My Virtual Host looks like:

ServerAdmin admin@localhost ServerName mywebsite.com ServerAlias mywebsite.com DocumentRoot /var/www/html/private_website/ ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined SSLEngine on SSLCertificateFile /etc/apache2/ssl/apache.crt SSLCertificateKeyFile /etc/apache2/ssl/apache.key SSLCompression off SSLOptions +StdEnvVars SSLOptions +StdEnvVars BrowserMatch "MSIE [2-6]" \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0 BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown

RewriteEngine On

RewriteCond %{REQUEST_URI} !^/auth/
RewriteCond %{HTTP_COOKIE} !^.2FA_Auth=([a-zA-Z0-9]+)
RewriteRule ^(.
)$ /auth/auth?$1?%{QUERY_STRING} [L,R=302]

RewriteCond %{REQUEST_URI} !^/auth/
RewriteCond %{HTTP_COOKIE} ^.2FA_Auth=([a-zA-Z0-9]+)
RewriteCond </home/pi/apache_2fa>/state/%1 !-f
RewriteRule ^(.
)$ /auth/auth?$1?%{QUERY_STRING} [L,R=302]

ScriptAlias /auth/ </home/pi/apache_2fa>/

<Directory </home/pi/apache_2fa/>>
AuthType Digest
AuthName "mywebsite.com"
AuthDigestDomain /
AuthDigestProvider file
AuthUserFile </home/pi/apache_2fa>/apache_credentials
Require valid-user

<Directory </var/www/html/private_website/>>
AuthType Digest
AuthName "mywebsite.com"
AuthDigestDomain /
AuthDigestProvider file
AuthUserFile </home/pi/apache_2fa>/apache_credentials
Require valid-user

I get the error 403 Forbidden.

before all worked fine with ssl certificate etc.

The file I access is the index.html file

I type into the browser:

https://mywebsite.com:1111/private_website/

and the rewrite creates: https://mywebsite.com:1111/auth/auth?/private_website/%3f

Website and the folder name are changed, but illustrate the same issue.

I hope you can help me :)

Rewrite rule applies to whole site

I got your script to work and authenticate users/passwords/otps

but i think because the rewrite rules any page request gets send to the 2fa screen, for me to only protect folder /new/ i had to add
RewriteCond %{REQUEST_URI} ^/new/
before any of other rewrite conditions.

Clean_state

At the end of your Guide you Mixed Up clean_state

The files Name is state_clean
But your cronjob dass clean_state

Have an good day and thank you.

apache_2fa generates different token than Google Authenticator

When implementing this solution I am not able to gain access to the protected page.

By printing the generated token on the auth page I was able to see that the token is not the same as google authenticator generates on my phone.

I have checked the file for the secret key and they are the same.

Secret keys

Hi,

head -10 /dev/urandom | md5sum | cut -b 1-30

However, when I do that and the key contains an "8" character, Google Authenticator says "illegal character".

  • Google Authenticator asks for a Time based or a Counter based setting. What should be used?
    Cheers,
  • how should the token.json be formatted? I tried to put several entries between the curly brackets but I got 500 errors after that.

thanks!

BC

Use with mod_proxy?

I'm using mod_proxy in front of an internal https server. I'm using a location as follows:

AuthType Digest AuthName "Please login" AuthDigestUserFile /usr/local/apache/accounts.pwd Require valid-user ProxyPass https://internal server/ ProxyPassReverse https://internal server/ Order allow,deny Allow from all

This works great and authenticates perfectly before proxying the traffic. I would love to use Google Authenticator with this, but this module seems to require it's config to be in a directory, not location. Is there any way to make this work with Location so I can utility mod_proxy?

Thanks,
Bob

500 Internal Server Error - No Module Named 'onetimepass'

Hi,

I've followed the instructions in the readme file to the letter, for a test domain.

When I attempt to authenticate, the redirect URL changes to the following:

http://test/auth/auth?/%3f

When I look at the Apache error logs, I can see the following:

End of script output before headers: auth.

I noticed someone else reported this previously so I attempted to run the ./auth script directly yet this comes up with the following:

No module named 'onetimepass'

This module was previously installed using sudo pip install onetimepass, yet when I attempt to install it again, I see the following message:

sudo pip install onetimepass
The directory '/home/<user>/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/<user>/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: onetimepass in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied: six in /usr/lib/python2.7/dist-packages (from onetimepass)

Any clues would be greatly appreciated.

Question -Bypassing Authentication For A Given IP Range

Using the Apache 2FA authentication method, how can I bypass authentication for an IP address range? The idea being that any external requests coming in via the internet are always required to authenticate but requests coming from within our company network will not be authenticated.

proxypass after 2fa

Hi,

Nice work on the 2fa part, i am building a proxy that uses this but i want to be able to proxy requests to an internal machine, and im about to pull my hair out.....

Where to put the proxy in, so it wont skip auth/2fa?

AH01790: user `user_test' in realm `home.me' not found: /auth/aut

Hi, could you please me to resolve issue, all has been done as required . Only auth triggers fail

[Wed Apr 22 17:44:52.088407 2020] [authz_core:error] [pid 5392:tid 140583272183552] [client 10.9.9.97:51653] AH01630: client denied by server configuration: /etc/apache2/apache_2faauth
[Wed Apr 22 17:44:52.133027 2020] [authz_core:error] [pid 5392:tid 140583247005440] [client 10.9.9.97:51653] AH01630: client denied by server configuration: /etc/apache2/apache_2faauth
[Wed Apr 22 17:45:14.550158 2020] [mpm_event:notice] [pid 4969:tid 140583751044032] AH00493: SIGUSR1 received. Doing graceful restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.3. Set the 'ServerName' directive globally to suppress this message
[Wed Apr 22 17:45:14.602942 2020] [mpm_event:notice] [pid 4969:tid 140583751044032] AH00489: Apache/2.4.29 (Ubuntu) configured -- resuming normal operations
[Wed Apr 22 17:45:14.602957 2020] [core:notice] [pid 4969:tid 140583751044032] AH00094: Command line: '/usr/sbin/apache2'
[Wed Apr 22 17:45:37.082281 2020] [auth_digest:error] [pid 5475:tid 140583660463872] [client 10.9.9.97:51656] AH01790: user user_test' in realm home.me' not found: /auth/auth

<VirtualHost *:80>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/auth/
RewriteCond %{HTTP_COOKIE} !^.2FA_Auth=([a-zA-Z0-9]+)
RewriteRule ^(.
)$ /auth/auth?$1?%{QUERY_STRING} [L,R=302]

RewriteCond %{REQUEST_URI} !^/auth/
RewriteCond %{HTTP_COOKIE} ^.2FA_Auth=([a-zA-Z0-9]+)
RewriteCond /etc/apache2/apache_2fa/state/%1 !-f
RewriteRule ^(.
)$ /auth/auth?$1?%{QUERY_STRING} [L,R=302]

ScriptAlias /auth/ /etc/apache2/apache_2fa/

<Directory /etc/apache2/apache_2fa/>
AuthType Digest
AuthName "home.me"
AuthDigestDomain /
AuthDigestProvider file
AuthUserFile /etc/apache2/apache_2fa/apache_credentials
Require valid-user

<Directory /var/www/>
AuthType Digest
AuthName "home.me"
AuthDigestDomain /
AuthDigestProvider file
AuthUserFile /etc/apache2/apache_2fa/apache_credentials
Require valid-user

getting an error. after successfully getting password to work, and the 2 factor code, get a server error. Server log info inside

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

from the log:
[Sat Jun 15 15:37:06.764580 2024] [cgi:error] [pid 23207] [client 24.199.22.194:5770] AH01215: Traceback (most recent call last):: /var/www/chaotica.org/apache_2fa/auth, referer: https://chaotica.org/auth/auth?%3f
[Sat Jun 15 15:37:06.764664 2024] [cgi:error] [pid 23207] [client 24.199.22.194:5770] AH01215: File "/var/www/chaotica.org/apache_2fa/auth", line 61, in : /var/www/chaotica.org/apache_2fa/auth, referer: https://chaotica.org/auth/auth?%3f
[Sat Jun 15 15:37:06.764682 2024] [cgi:error] [pid 23207] [client 24.199.22.194:5770] AH01215: if onetimepass.valid_totp(token=token_user, secret=user_secret, window=1):: /var/www/chaotica.org/apache_2fa/auth, referer: https://chaotica.org/auth/auth?%3f
[Sat Jun 15 15:37:06.764704 2024] [cgi:error] [pid 23207] [client 24.199.22.194:5770] AH01215: File "/usr/local/lib/python3.9/dist-packages/onetimepass/init.py", line 268, in valid_totp: /var/www/chaotica.org/apache_2fa/auth, referer: https://chaotica.org/auth/auth?%3f
[Sat Jun 15 15:37:06.765038 2024] [cgi:error] [pid 23207] [client 24.199.22.194:5770] AH01215: if int(token) == get_totp(: /var/www/chaotica.org/apache_2fa/auth, referer: https://chaotica.org/auth/auth?%3f
[Sat Jun 15 15:37:06.765060 2024] [cgi:error] [pid 23207] [client 24.199.22.194:5770] AH01215: File "/usr/local/lib/python3.9/dist-packages/onetimepass/init.py", line 164, in get_totp: /var/www/chaotica.org/apache_2fa/auth, referer: https://chaotica.org/auth/auth?%3f
[Sat Jun 15 15:37:06.765066 2024] [cgi:error] [pid 23207] [client 24.199.22.194:5770] AH01215: return get_hotp(: /var/www/chaotica.org/apache_2fa/auth, referer: https://chaotica.org/auth/auth?%3f
[Sat Jun 15 15:37:06.765086 2024] [cgi:error] [pid 23207] [client 24.199.22.194:5770] AH01215: File "/usr/local/lib/python3.9/dist-packages/onetimepass/init.py", line 113, in get_hotp: /var/www/chaotica.org/apache_2fa/auth, referer: https://chaotica.org/auth/auth?%3f
[Sat Jun 15 15:37:06.765098 2024] [cgi:error] [pid 23207] [client 24.199.22.194:5770] AH01215: key = base64.b32decode(secret, casefold=casefold): /var/www/chaotica.org/apache_2fa/auth, referer: https://chaotica.org/auth/auth?%3f
[Sat Jun 15 15:37:06.765112 2024] [cgi:error] [pid 23207] [client 24.199.22.194:5770] AH01215: File "/usr/lib/python3.9/base64.py", line 205, in b32decode: /var/www/chaotica.org/apache_2fa/auth, referer: https://chaotica.org/auth/auth?%3f
[Sat Jun 15 15:37:06.765123 2024] [cgi:error] [pid 23207] [client 24.199.22.194:5770] AH01215: raise binascii.Error('Incorrect padding'): /var/www/chaotica.org/apache_2fa/auth, referer: https://chaotica.org/auth/auth?%3f
[Sat Jun 15 15:37:06.765132 2024] [cgi:error] [pid 23207] [client 24.199.22.194:5770] AH01215: binascii.Error: Incorrect padding: /var/www/chaotica.org/apache_2fa/auth, referer: https://chaotica.org/auth/auth?%3f
[Sat Jun 15 15:37:06.771282 2024] [cgi:error] [pid 23207] [client 24.199.22.194:5770] End of script output before headers: auth, referer: https://chaotica.org/auth/auth?%3f

Brute Force Attack

Hi,

I tried to make a pull request, but it somehow doesn't work.

So I ask here.

Is there a some blocking timer after too many attempts of the wrong 6 digit Auth key?

So is there any way to prevent a Brute Force Attack?

I am using apache with mod_evasive, too.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.