Brute force Attack

1 Introduction

A common threat that webdevelopers face is a password-guessing attack known as a brute force attack. Abrute-force attack is an attempt to discover a password by systematicallytrying every possible combination of letters, numbers, and symbols until youdiscover
the one correct combination that works. If your web site requires userauthentication, you are a good target for a brute-force attack.

2 Solution

2.1 Enforce password strength

Complex password is veryhard to guess. Strong password is always a good way to protect from brute forceattack.

2.1.1 Advantage

We have implemented thelogic in our production. It doesn’t need any change in code.

2.1.2 Disadvantage

This needs PM to persuadeour customer to enforce the strong password policy which is controlled bypassword option in site admin. If some customers don’t want to use the strongpolicy of the password, we still need some other measure to protect brute forceattack.

This can only be used forrequest with password.

2.2 Answer a question

When a user signs up, userneeds choose or create a question or several questions.  Before user login, user need answer thequestion in advance.

2.2.1 Advantage

This can protect from bruteforce effectively if the answer of the question is long enough. It is equals tomake the password longer. It is also not hard to implement it.

2.2.2 Disadvantage

For the users which alreadyare in our system, there is no this kind questions. It needs PM to talk withthem to use this feature.

At the same time, it changesthe logic of login; this can cause changes for all modules that use login API.

2.3 Send code to mobile or mail

When user signs up, userneed provide a valid email or phone number. Each time, when user logins, systemwill send a code, which is 6 digits, to the registered email or phone number,user need enter the code before login. System need check the password and
thecode together. Only permit user to login or visit the object if both of themare correct.

2.3.1 Advantage

Attacker cannot brute forcethe password without the code which can only be accepted by mobile or email.Currently, some big companies, like google, have use this way, but not enforceit.

2.3.2 Disadvantage

For email, we can implementit easily. But, it is inconvenient.  Forexample, for mobile user, s/he need change screen to visit email to get thecode.

For mobile, currently, thereis no this function. We need implement a system to send message to mobile.

At the same time, it changesthe logic of login; this can cause changes for all modules/APIs that use thisto avoid brute force.

2.4 CAPTCHA

A CAPTCHA (an acronym for"Completely Automated Public Turing test to tell Computers and HumansApart") is a type of challenge-response test used in computing to determinewhether or not the user is human.

2.4.1 Advantage

There have already been manyimplementation can be used directly. It is also a common way for many web sitesto protect from brute force. As user can get the code from screen, it will notaffect user experience much.

2.4.2 Disadvantage

If the CAPTCH is complex, itis hard for user to read it. If the CAPTCH is not complex, it will be easy tobe guess by some tools. It is not easy to get an appropriate degree. But, wemay choose the CAPTCH to show a multi-choice question, server needs checkwhether
the answer of the question is correct. It will be much harder to bypass.

2.5 Lock out user

The most obvious way toblock brute-force attacks is to simply lock out accounts after a defined numberof incorrect password attempts. Account lockouts can last a specific duration,such as one hour, or the accounts could remain locked until manually unlockedby
an administrator. However, account lockout is not always the best solution,because someone could easily abuse the security measure and lock out hundredsof user accounts. In fact, some Web sites experience so many attacks that theyare unable to enforce a lockout
policy because they would constantly beunlocking customer accounts.

2.5.1 Advantage

It is easy to implement andwill not affect the current business logic much. It has no effect on themodules that use login API.

2.5.2 Disadvantage

An attacker can cause adenial of service (DoS) by locking out large numbers of accounts.

Because you cannot lock outan account that does not exist, only valid account names will lock. An attackercould use this fact to harvest usernames from the site, depending on the errorresponses.

An attacker can cause adiversion by locking out many accounts and flooding the help desk with supportcalls.

An attacker can continuouslylock out the same account, even seconds after an administrator unlocks it,effectively disabling the account.

Account lockout isineffective against slow attacks that try only a few passwords every hour.

Account lockout isineffective against attacks that try one password against a large list ofusernames.

Account lockout isineffective if the attacker is using a username/password combo list and guessescorrectly on the first couple of attempts.

Powerful accounts such asadministrator accounts often bypass lockout policy, but these are the mostdesirable accounts to attack. Some systems lock out administrator accounts onlyon network-based logins.

Even once you lock out anaccount, the attack may continue, consuming valuable human and computerresources.

3 Summary

After comparing the solutionabove, the best way is to enforce password strength, it is also need few effortsfrom engineer team.  But, this can onlybe used for request with password.

For request with or withoutpassword, we may choose CAPTCHA; it is still an effective way to against bruteforce attack.  For not impact the userexperience, we may choose show CAPTCHA after failed 3 times.

时间: 2024-10-13 02:41:55

Brute force Attack的相关文章

DVWA系列(三)----Brute Force(暴力(破解))

一.攻击模块1:Brute Force(暴力破解) 暴力破解一般指穷举法,穷举法的基本思想是根据题目的部分条件确定答案的大致范围,并在此范围内对所有可能的情况逐一验证,直到全部情况验证完毕.若某个情况验证符合题目的全部条件,则为本问题的一个解:若全部情况验证后都不符合题目的全部条件,则本题无解.穷举法也称为枚举法.       二.源码分析(文件地址:./DVWA/vulnerabilities/brute/source/low.PHP)   [html] view plain copy <?p

DVWA之Brute Force

DVWA简介 DVWA(Damn Vulnerable Web Application)是一个用来进行安全脆弱性鉴定的PHP/MySQL Web应用,旨在为安全专业人员测试自己的专业技能和工具提供合法的环境,帮助web开发者更好的理解web应用安全防范的过程. DVWA共有十个模块,分别是Brute Force(暴力(破解)).Command Injection(命令行注入).CSRF(跨站请求伪造).File Inclusion(文件包含).File Upload(文件上传).Insecure

hdoj 4971 A simple brute force problem. 【最大闭合权 --&gt; 最小割】

题目:hdoj 4971 A simple brute force problem. 题意:给出 n 个任务和 m 项技术,完成某个任务需要其中几项技术,完成某个任务有奖金,学习某个技术需要钱,技术之间有父子关系,某项技术可能需要先学习其他技术,然后问你选择做那些任务获得收益最大? 分析:看题意的黑体字部分,就是一个标准的闭合权问题,这个题目的关键忽悠点在于技术之间的关系,导致很多人想到了dp以及树形dp. 其实就是一个闭合权问题模板,官方题解说如果技术之间存在相互的关系需要缩点,其实不用缩点也

HDU 4971 A simple brute force problem.(dp)

HDU 4971 A simple brute force problem. 题目链接 官方题解写的正解是最大闭合权,但是比赛的时候用状态压缩的dp也过掉了- -,还跑得挺快 思路:先利用dfs预处理出每个项目要完成的技术集合,那么dp[i][j]表示第i个项目,已经完成了j集合的技术,由于j这维很大,所以利用map去开数组 代码: #include <cstdio> #include <cstring> #include <algorithm> #include &l

【最小割】HDU 4971 A simple brute force problem.

说是最大权闭合图.... 比赛时没敢写.... 题意 一共有n个任务,m个技术 完成一个任务可盈利一些钱,学习一个技术要花费钱 完成某个任务前需要先学习某几个技术 但是可能在学习一个任务前需要学习另几个任务 求最多能赚多少钱咯 先将缩点将需要一起学掉的技术缩成一个点 建s--任务 权值为该任务盈利多少钱 建技术(缩点后)-t 权值为学习这技术的花费(总) 任务-技术 (完成该任务所需的每个技术都需要建边)权值为INF #include<stdio.h> #include<stdlib.h

小白日记46:kali渗透测试之Web渗透-SqlMap自动注入(四)-sqlmap参数详解- Enumeration,Brute force,UDF injection,File system,OS,Windows Registry,General,Miscellaneous

sqlmap自动注入 Enumeration[数据枚举] --privileges -U username[CU 当前账号] -D dvwa -T users -C user --columns  [指定数据库,表,列] --exclude-sysdbs [排除系统层的库] ******************************************************************************* #查具体数据 [前提:当前数据库用户有权读取informatio

HDU 4971 A simple brute force problem.(最小割,最大权闭合图)

http://acm.hdu.edu.cn/showproblem.php?pid=4971 A simple brute force problem. Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 182    Accepted Submission(s): 115 Problem Description There's a com

初二DVWA之Brute Force (密码爆破)

初学安全,我也不知道从哪里开始,网上找了点教程,接触了DVWA,我用自己的服务器搭建了一个平台,从头开始看.第一个模块就是Brute Force,说白了就是暴力破解.然后我发现,我操,这玩意儿跟我写的爬虫贼像???? 原理应该就是先抓包,然后伪造一个header,不停的改变密码,然后post上去,找到一个可能的密码...教程上介绍了这么一个工具,burpsuite,原理就应该是上面说的,不过里面功能很多,我只看了最简单了,就是爆破. 首先浏览器界面接换到你要登录的界面,然后在浏览器里面设置代理,

HDU - 4971 A simple brute force problem. (DP)

Problem Description There's a company with several projects to be done. Finish a project will get you profits. However, there are some technical problems for some specific projects. To solve the problem, the manager will train his employee which may