Что такое брутфорс и как его использовать

Countermeasures[edit]

In case of an offline attack where the attacker has access to the encrypted material, one can try key combinations without the risk of discovery or interference. However database and directory administrators can take countermeasures against online attacks, for example by limiting the number of attempts that a password can be tried, by introducing time delays between successive attempts, increasing the answer’s complexity (e.g. requiring a CAPTCHA answer or verification code sent via cellphone), and/or locking accounts out after unsuccessful login attempts.[page needed] Website administrators may prevent a particular IP address from trying more than a predetermined number of password attempts against any account on the site.

Steps to Protect Passwords for Professionals

To keep yourself and your network safe, you’ll want to take your precautions and help others do so as well. User behavior and network security systems will both need reinforcement.

For IT specialists and users alike, you’ll want to take a few general pieces of advice to heart:

  • Use an advanced username and password. Protect yourself with credentials that are stronger than admin and password1234 to keep out these attackers. The stronger this combination is, the harder it will be for anyone to penetrate it.
  • Remove any unused accounts with high-level permissions. These are the cyber equivalent of doors with weak locks that make breaking in easy. Unmaintained accounts are a vulnerability you can’t risk. Throw them away as soon as possible.

Once you’ve got the basics down, you’ll want to bolster your security and get users on board.

We’ll begin with what you can do on the backend, then give tips to support safe habits.

Passive Backend Protections for Passwords

High encryption rates: to make it harder for brute force attacks to succeed, system administrators should ensure that passwords for their systems are encrypted with the highest encryption rates possible, such as 256-bit encryption. The more bits in the encryption scheme, the harder the password is to crack.

Salt the hash: administrators should also randomize password hashes by adding a random string of letters and numbers (called salt) to the password itself. This string should be stored in a separate database and retrieved and added to the password before it’s hashed. By salting the hash, users with the same password have different hashes.

Two-factor authentication (2FA): additionally, administrators can require two-step authentication and install an intrusion detection system that detects brute force attacks. This requires users to follow-up a login attempt with a second factor, like a physical USB key or fingerprint biometrics scan.

Limit number of login re-tries: limiting the number of attempts also reduces susceptibility to brute-force attacks. For example, allowing three attempts to enter the correct password before locking out the user for several minutes can cause significant delays and cause hackers to move on to easier targets.

Account lockdown after excessive login attempts: if a hacker can endlessly keep retrying passwords even after a temporary lockout, they can return to try again. Locking the account and requiring the user to contact IT for an unlock will deter this activity. Short lockout timers are more convenient for users, but convenience can be a vulnerability. To balance this, you might consider using the long-term lockdown if there are excessive failed logins after the short one.

Throttle rate of repeated logins: you can further slow an attacker’s efforts by creating space between each single login attempt. Once a login fails, a timer can deny login until a short amount of time has passed. This will leave lag-time for your real-time monitoring team to spot and work on stopping this threat. Some hackers might stop trying if the wait is not worth it.

Required Captcha after repeated login attempts: manual verification does stop robots from brute-forcing their way into your data. Captcha comes in many types, including retyping the text in an image, checking a checkbox, or identifying objects in pictures. Regardless of what you use, you can use this before the first login and after each failed attempt to protect further.

Use an IP denylist to block known attackers. Be sure that this list is constantly updated by those who manage it.

Active IT Support Protections for Passwords

Password education: user behavior is essential to password security. Educate users on safe practices and tools to help them keep track of their passwords. Services like Kaspersky Password Manager allow users to save their complex, hard-to-remember passwords in an encrypted “vault” instead of unsafely writing them down on sticky notes. Since users tend to compromise their safety for the sake of convenience, be sure to help them put convenient tools in their hands that will keep them safe.

Watch accounts in real-time for strange activity: Odd login locations, excessive login attempts etc. Work to find trends in unusual activity and take measures to block any potential attackers in real-time. Look out for IP address blocks, account lockdown, and contact users to determine if account activity is legitimate (if it looks suspicious).

Types of Brute Force Attacks

The most basic brute force attack is a dictionary attack, where the attacker works through a dictionary of possible passwords and tries them all. Dictionary attacks start with some assumptions about common passwords to try to guess from the list in the dictionary. These attacks tend to be somewhat outdated, given newer and more effective techniques.

Recent computers manufactured within the last 10ish years can brute force crack an 8 character alphanumeric password – capitals and lowercase letters, numbers, and special characters – in about two hours. Computers are so fast that they can brute force decrypt a weak encryption hash in mere months. These kinds of brute force attacks are known as an exhaustive key search, where the computer tries every possible combination of every possible character to find the right combination.

Credential recycling is another type of brute force attack that reuses usernames and passwords from other data breaches to try to break into other systems.

The reverse brute-force attack uses a common password like “password,” and subsequently tries to brute force a username to go with that password. Since password is one of the most common password in 2017, this technique is more successful than you might think.

Hydra and Other Popular Brute Force Attack Tools

Security analysts use the THC-Hydra tool to identify vulnerabilities in client systems. Hydra quickly runs through a large number of password combinations, either simple brute force or dictionary-based. It can attack more than 50 protocols and multiple operating systems. Hydra is an open platform; the security community and attackers constantly develop new modules.

Hydra brute force attack

Other top brute force tools are:

  • Aircrack-ng—can be used on Windows, Linux, iOS, and Android. It uses a dictionary of widely used passwords to breach wireless networks.
  • John the Ripper—runs on 15 different platforms including Unix, Windows, and OpenVMS. Tries all possible combinations using a dictionary of possible passwords.
  • L0phtCrack—a tool for cracking Windows passwords. It uses rainbow tables, dictionaries, and multiprocessor algorithms.
  • Hashcat—works on Windows, Linux, and Mac OS. Can perform simple brute force, rule-based, and hybrid attacks.
  • DaveGrohl—an open-source tool for cracking Mac OS. Can be distributed across multiple computers.
  • Ncrack—a tool for cracking network authentication. It can be used on Windows, Linux, and BSD.

How can it happen?

However, If You are interested in cracking passwords, you will have to use the computer.If you are a good coder then it will be easier to code the lines which can code the program easily.

Let’s suppose that you have developed a password that breaks the program which tries 1000 combinations per second but it takes around a minimum of 7 years.

Even if you want to do it faster!

You need a supercomputer. So, if we calculate the supercomputer then in just 22 seconds, all 218 trillion will be tested. But Can a Hacker purchase or create a supercomputer to perform this function?

Computing resources of this kind are not available for the common people. The password hackers are not common people who can collect the computing resources by different means for developing a powerful computing engine via software.

The calculation which are the possible combinations of an 8-character-password.but think if your password is the 10th combination or the 100th combinations. Why it is essential to have additional layers of the security in order to detect and deflect any password breaching attempt.

Hacker’s Motive Behind Every Act

The Brute Force attack which is done by the threat actor has some motive behind that even they try to gain illegal access to the target website and utilize it in either executing another kind of attack or stealing valuable data which simply used to break.

How Can I Prevent It?

You can take some precautionary measures :

  • Password length
  • Modifying .htaccess file
  • Using captcha
  • Two-factor Authentication.
  • Cloudflare.
  • Password Complexity.
  • Limit login attempts.

Password length & Complexity :

The first step towards the Brute Force Attack prevention should be longer password length like “ I love* “ and “12345” instead of using these types of passwords to make sure to make it complex. The complexity of the password delays the cracking process.

Modifying .htaccess file

When you add a few rules in.htaccess file which further hardens to the security of your WordPress site. The objective is to allow the wp-admin which can only specific IP addresses listed in .htaccess file.

So open your .htaccess  file and modify it like :

<Files /wp-login>

order deny, allow

allow from IP1

allow from IP2

deny from all

 </Files>”

IP1 and IP2 will be the Ip that you allowed to access.Using Captcha :

If you are using captchas are most commonly used in websites. Even they prevent the boats from executing the automated scripts, mainly used in brute force attacks. The installing captcha in your WordPress site is fairly easy.

Two-factor Authentication :

The two-factor authentication is an extra line for the defense which can defend your account from the Brute Force attack. The chances of successfully executing the Brute Force Attack on the 2FA protected sites.

Cloudflare

Cloudflare is a renowned service for WordPress which usually deals with the CDN and caching.this company offers the protective shield against the Brute Force Attacks. Users can set rules for accessing the login pages and set Browser Integrity Check.

Limit the Login Attempts :

The powerful action is to limit the login attempts on WordPress which admin or another admin panel for that matter.

Found this article informative? Follow Vednam on , , Mix, Tumbler, and Linkedin to know more exclusive content we post.

You can Also read Articles :

Using the patator for brute-force web forms that transmit data using the POST method

Now let us move on to the brute force web login page when the data is sent using POST.

I will practice in OWASP Mutillidae II, installed in Web Security Dojo.

There is the login page http://localhost/mutillidae/index.php?page=login.php, it sends data using the POST method. Let us start, of course, with the analysis, enter any data into the form and click Login:

As you can see, I failed to authorize, important notes:

  • we stayed on the http://localhost/mutillidae/index.php?page=login.php page, i.e. most likely, the data is sent to this file, and the POST method is most likely used
  • when credentials is wrong, the ‘Password incorrect’ is displayed.

Now go to Burp Suite:

Here the lines are important:

  • POST /mutillidae/index.php?page=login.php
  • Referer: http://localhost/mutillidae/index.php?page=login.php
  • Cookie: showhints=1; PHPSESSID=1n3b0ma83kl75996udoiufuvc2
  • username=admin&password=password&login-php-submit-button=Login

They tell us that the data is transferred by the POST method to the page /mutillidae/index.php?page=login.php. Also the cookies are transmitted, which contain ‘PHPSESSID=1n3b0ma83kl75996udoiufuvc2’. The data itself is in the form: ‘username=admin&password=password&login-php-submit-button=Login’.

Analyzes the server’s response:

There are no redirects or new cookies.

We begin to compose our command.

  • It starts with ./patator.py http_fuzz (program file and the module being used).
  • Next, with the url option, we specify the address of the page to which the data is sent: url=»localhost/mutillidae/index.php?page=login.php»
  • Via method option, we specify the method for sending data: method=POST
  • With patator, we have not yet used the body option, now it is time. With the option, we transfer the data to the server. Do not forget to add placeholders FILE0 and FILE1: body=’username=FILE0&password=FILE1&login-php-submit-button=Login’
  • With the 0= and 1= options we pass to the program dictionaries of user names and passwords: 0=namelist_new.txt 1=500-worst-passwords.txt
  • Since we already have some cookies, they were automatically recorded, most likely when the site was first opened. It is unclear how often they will change, but it is clear that this will happen automatically, as well as the first time, so we specify: accept_cookie=1. This option means to accept cookies from the web application and send them at the next login and password check.
  • And again we choose to ignore (not show us) all login attempts, if the answer contains the word ‘incorrect’: -x ignore:fgrep=’incorrect
  • After the -t option, you can specify the number of threads: -t 50

All together:

./patator.py http_fuzz url="localhost/mutillidae/index.php?page=login.php" method=POST body='username=FILE0&password=FILE1&login-php-submit-button=Login' 0=namelist_new.txt 1=500-worst-passwords.txt accept_cookie=1 -x ignore:fgrep='incorrect' -t 50

As you can see, we got the results:

With my options, sometimes there was an 500 Internal Server Error, which in this situation means only that I DoSed the server.

Дополнительные инструменты

Программы для брута хешей — это лишь малая часть софта из арсенала хешкрекера. Вернее, это его самая простая часть — взял файл с хешами, настроил нужные атаки и запустил. Всё — программа может крутиться сутками. Только поглядывай, сколько процентов хешей сломано.

Обычно через хешкрекера проходит множество всевозможных текстовых файлов:

  • списки хешей в разных видах и форматах, часто с перемешанными хешами разных типов, и нужно извлечь хеши отдельно по каждому алгоритму;
  • словари, которые надо чистить, сортировать, удалять повторы;
  • накопленные результаты брута, в которых часто перемешаны и несоленые хеши с паролями, и соленые хеши с паролями,
    и так далее.

В общем, сотни и тысячи подобных разнородных файлов — это еще та головная боль. И все выкручиваются по-разному — кто-то в том же линуксе делает часть работы командами самой ОС (например, grep), кто-то пишет себе скрипты на Perl, кто-то использует различные программы. Но факт очевиден — помимо брутфорсеров, нужны еще инструменты, которые должны работать с текстовыми файлами: сортировать, чистить, конвертировать из одного формата в другой, извлекать или переставлять данные, проверять формат и так далее.

Без этих инструментов работать крайне сложно, и поэтому с каждым брутфорсером обычно поставляется свой комплект различных утилит. И hashcat имеет такой комплект, и JtR тоже, но самый крупный комплект утилит под Windows имеет программа Hash Manager. В ней более 70 инструментов, построенных по принципу одна функция = один файл. Таким образом, из них, как из кирпичиков, можно собрать BAT-файл, выполняющий обработку файлов любой сложности. А 64-битные версии инструментов позволяют обрабатывать файлы неограниченного размера.

Вот пример BAT-файла, демонстрирующий, как из списка, в котором перемешаны хеши разных типов, вытащить только хеши от Magento с двухсимвольной солью:

REM Извлекаем только строки длиной 35 символов ExtractLinesByLen.exe %1 35 35
REM Переименовываем файл с извлеченными строками в файл 2.txt
MOVE /Y %1.Lines 2.txt
REM Проверяем формат хешей IsCharset.exe 2.txt ?h 1
REM Проверяем формат соли IsCharsetInPos.exe 2.txt 33 ':' IsCharsetInPos.exe 2.txt 34 ?l?u?d
IsCharsetInPos.exe 2.txt 35 ?l?u?d
REM Готово! В файле 2.txt остались только хеши от Magento

В дистрибутиве программы Hash Manager, в папке , можно найти около 30 готовых примеров, выполняющих различные полезные функции для хешкрекера.

Анализ риска

Риски от применения брутфорса зависят от количества объектов, на которые нацелены атаки, и намерений злоумышленника. С каждым годом появляются новые технологии, которые могут применяться как в благих, так и в преступных целях. Так, несколько лет назад на конференции DEF CON общественности был представлен WASP — беспилотник, который может собирать статистику домашних сетей Wi-Fi. Мощный компьютер на борту аппарата среди прочих функций имел возможность автоматического взлома паролей с помощью брутфорса.

Не так давно была замечена новая ботнет-сеть, проникающая в компьютерные системы с помощью подбора паролей SSH. Методы защиты, обычно применяемые против атак методом «грубой силы», не дают желаемого результата. Как в таком случае повысить уровень безопасности, можно узнать из нашей статьи.

Проблем со взломом через брутфорс можно избежать, если:

  • создавать длинный пароль из букв, цифр и спецсимволов,
  • не использовать в пароле личную информацию или какие-либо элементы логина,
  • для всех аккаунтов создавать свои уникальные пароли,
  • регулярно, примерно один раз в месяц, менять пароли,
  • на веб-сайтах защищать вход от многочисленных попыток ввода данных.

Sidebar: Using CAPTCHAS

A completely automated public Turing test to tell computers and humans apart, or CAPTCHA, is a program that allows you to distinguish between humans and computers.
First widely used by Alta Vista to prevent automated search submissions, CAPTCHAs are particularly effective in stopping any kind of automated abuse, including brute-force attacks.

They work by presenting some test that is easy for humans to pass but difficult for computers to pass; therefore, they can conclude with some certainty whether there is a human on the other end.

For a CAPTCHA to be effective, humans must be able to answer the test correctly as close to 100 percent of the time as possible.
Computers must fail as close to 100 percent of the time as possible.
Researchers at Carnegie Mellon’s School of Computer Science continually work to improve and introduce new CAPTCHAs.

If you are developing your own CAPTCHA, keep in mind that it is not how hard the question is that matters-it is how likely it is that a computer will get the correct answer.
I once saw a CAPTCHA that presents the user with a picture of three zebras, with a multiple-choice question asking how many zebras were in the picture.
To answer the question, you click one of three buttons.

Nevertheless, a simple CAPTCHA may still be effective against brute-force attacks.
When you combine the chance of an attacker sending a correct username and password guess with the chance of guessing the CAPTCHA correctly, combined with other techniques described in this chapter, even a simple CAPTCHA could prove effective.

Description

A brute force attack can manifest itself in many different ways, but
primarily consists in an attacker configuring predetermined values,
making requests to a server using those values, and then analyzing the
response. For the sake of efficiency, an attacker may use a dictionary
attack (with or without mutations) or a traditional brute-force attack
(with given classes of characters e.g.: alphanumeric, special, case
(in)sensitive). Considering a given method, number of tries, efficiency
of the system which conducts the attack, and estimated efficiency of the
system which is attacked the attacker is able to calculate approximately
how long it will take to submit all chosen predetermined values.

Cookies, headers, hidden fields, random data in hidden fields

It is necessary to remember about such possible models of behavior of the web application as:

  • assign a cookie with a session to anyone who opened a web form, and when receiving data from it, to check whether there is such a session. If there is no session, then do not accept even the correct password. Therefore, before each attempt it is required to get a web page with the form, while retaining the received cookies for sending them along with the candidates for logins and passwords;
  • each time you request the page, it is updated, the form can contain hidden fields with random data. This requires before each attempt to obtain a form, extracting these random data, adding them to the requesting body transmitted with the login and password;
  • can be simplified versions: static cookies and static data in hidden form fields. This does not require receiving them at every login attempt. However, you need to remember to add the value of hidden fields to the body of the request, and about cookies remember that the session can expire and you need to get a new cookie.

Утёкшие пароли

Утёкшие или украденные с сайтов пароли. Из списков намеренно удалены имена / почтовые адреса и т.д.

Лучшее их применение – это генерация или тестирования списков словарей.

Примечание: Даты приблизительные.

Имя Название файла / ссылка на скачивание Дата Примечание
Rockyou rockyou.txt.bz2 (60,498,886 bytes) 2009-12 Лучший из доступных списков; огромный, украдены в незашифрованном виде
Rockyou со счётчиком rockyou-withcount.txt.bz2 (59,500,255 bytes)
phpbb phpbb.txt.bz2 (868,606 bytes) 2009-01 Отсортированы по частоте использования
Взломаны Brandon Enright из md5 
(покрытие 97%+)
phpbb со счётчиком phpbb-withcount.txt.bz2 (872,867 bytes)
phpbb с md5 phpbb-withmd5.txt.bz2 (4,117,887 bytes)
MySpace myspace.txt.bz2 (175,970 bytes) 2006-10 Получены фишингом
MySpace — со счётчиком myspace-withcount.txt.bz2 (179,929 bytes)
Hotmail hotmail.txt.bz2 (47,195 bytes) Неизвестно Не до конца понятно, как они были украдены
Hotmail со счётчиком hotmail-withcount.txt.bz2 (47,975 bytes)
Faithwriters faithwriters.txt.bz2 (39,327 bytes) 2009-03 Религиозные пароли
Faithwriters — со счётчиком faithwriters-withcount.txt.bz2 (40,233 bytes)
Elitehacker elitehacker.txt.bz2 (3,690 bytes) 2009-07 Часть из zf05.txt
Elitehacker — со счётчиком elitehacker-withcount.txt.bz2 (3,846 bytes)
Hak5 hak5.txt.bz2 (16,490 bytes) 2009-07 Часть из zf05.txt
Hak5 — со счётчиком hak5-withcount.txt.bz2 (16,947 bytes)
Älypää alypaa.txt.bz2 (5,178 bytes) 2010-03 Финские пароли
alypaa — со счётчиком alypaa-withcount.txt.bz2 (6,013 bytes)
Facebook (Pastebay)  (375 bytes) 2010-04 Найдены на Pastebay;
судя по всему, украдены зловредным ПО.
Facebook (Pastebay) — со счётчиком  (407 bytes)
Unknown porn site porn-unknown.txt.bz2 (30,600 bytes) 2010-08 Найдены на angelfire.com. Неизвестно, откуда они, но определённо с порно сайта.
Unknown porn site — со счётчиком porn-unknown-withcount.txt.bz2 (31,899 bytes)
Ultimate Strip Club List tuscl.txt.bz2 (176,291 bytes) 2010-09 Спасибо Mark Baggett за находку!
Ultimate Strip Club List — со счётчиком tuscl-withcount.txt.bz2 (182,441 bytes)
 (14,457 bytes) 2010-09 Спасибо Andrew Orr за наводку
Facebook Phished — со счётчиком  (14,941 bytes)
Carders.cc carders.cc.txt.bz2 (8,936 bytes) 2010-05  
Carders.cc — со счётчиком carders.cc-withcount.txt.bz2 (9,774 bytes)
Singles.org singles.org.txt.bz2 (50,697 bytes) 2010-10  
Singles.org — со счётчиком singles.org-withcount.txt.bz2 (52,884 bytes)
Unnamed financial site (reserved) 2010-12  
Unnamed financial site — со счётчиком (reserved)
Gawker (reserved) 2010-12  
Gawker — со счётчиком (reserved)
Free-Hack.com (reserved) 2010-12  
Free-Hack.com со счётчиком (reserved)
Carders.cc (second time hacked) (reserved) 2010-12  
Carders.cc со счётчиком (second time hacked) (reserved)

Взлом страницы входа роутера

Чтобы иметь представления об HTTP аутентификации начнём с выдержки из справки Router Scan by Stas’M:

Формально можно разделить устройства на два типа — те, которые используют аутентификацию на уровне протокола HTTP, — и другие, которые её не используют — в их число входят устройства, использующие HTTP формы для авторизации.

Первый тип устройств довольно легко отличить от второго, открыв устройство в интернет браузере: у них в самом начале всегда появляется всплывающее окно с названием устройства и предложением ввести логин и пароль. Устройства второго типа не выдают подобного приглашения, а сразу открывают веб страницу, на которой также можно авторизоваться.

Но, если вы затрудняетесь визуально определить тип аутентификации, можно изучить HTTP заголовки ответа устройства, а конкретно заголовок WWW-Authenticate — именно он указывает на использование аутентификации на уровне протокола.

Для подбора пароля к таким устройствам Router Scan использует словари пар логин/пароль. Программой поддерживаются два метода аутентификации на уровне протокола:

  • Basic — базовая аутентификация, имя пользователя и пароль обрабатываются обратимым шифром и отправляются в заголовках (подробнее).
  • Digest — дайджест аутентификация, данные для входа необратимо хешируются алгоритмом MD5 и отправляются в заголовках (подробнее).

Для остальных устройств, не использующих эти методы, перебор по словарям не поддерживается (за исключением некоторых моделей, для которых была добавлена поддержка словаря Form аутентификации). Но можно воспользоваться функцией Use credentials в главном окне программы, которая проверяет пару логин/пароль независимо от метода аутентификации.

Итак, Router Scan использует брут-форс форм для авторизации на роутере не для всех моделей, в результате можно получить следующую картину:

Это несколько кучных подсетей в которых в избытке водится роутер ZTE F668. Скажу больше — почти во всех них стандартные логины и пароли, но ни Router Scan, ни RouterSploit не извлекает из них информацию, поскольку на роутере вход выполняется с помощью веб-формы, а для этой модели брут-форс не поддерживается.

Отключение xmlrpc.php

Атаки путем запросов к файлу xmlrpc.php очень популярны, поскольку таким образом за один запрос возможно перебрать десятки тысяч комбинаций различных логинов и паролей. Поэтому очень важная часть защиты админ-панели — это отключение или ограничение доступа к данному файлу. В WordPress протокол XML-RPC используется для взаимодействия движка с различными внешними приложениями, например, Jetpack. Как показывает практика, в 99% сайтов файл xmlrpc.php не используется вообще. Если вы сомневаетесь, используется он у вас или нет, то создайте резервную копию файлов, которые вы будете изменять перед выполнением дальнейших инструкций.

Отключение xmlrpc.php при помощи плагинов

Для отключения xmlrpc.php можно использовать различные плагины, которых на данный момент уже достаточно много. Просто напишите в поиске в маркетплейсе плагинов «xmlrpc»:

После установки не забудьте активировать плагин и включить саму защиту в настройках выбранного плагина.

Запрет доступа к  xmlrpc.php при помощи .htaccess

Первый вариант:

<IfModule mod_alias.c>
RedirectMatch 403 (?i)/xmlrpc.php
</IfModule>

Этот способ будет полезен, если у вас в одной папке несколько установок WordPress в разных подпапках. Достаточно разместить код настройки в главном .htaccess-файле, который располагается уровнем выше папок с WordPress, и все сайты будут защищены. Также защита регистронезависимая, то есть будет работать в случае атаки запросами с заглавными буквами.

Второй вариант:

<Files xmlrpc.php>
Require all denied
Require ip 127.0.0.1 #разрешить локальные подключения
Require ip 23.45.67.89 #один адрес
Require ip 10.20.30.40 #еще один адре
</Files>

Этот способ удобен тем, что можно закрыть доступ для всех или оставить доступ с некоторых доверенных адресов, если требуется.

Запрет доступа к  xmlrpc.php при помощи Nginx

Если на вашем сервере не используется Apache, то запрет доступа через Nginx будет выглядеть так:

location /xmlrpc.php
{
allow 23.45.67.89; #один адрес
allow 123.123.123.0/24; #блок адресов
deny all; #запрет всем остальным
}

Отключение xmlrpc.php при помощи пользовательской функции

Еще один вариант защиты связан с добавлением пользовательской функции в файл вашей темы сайта. В конце functions.php вашей темы добавьте код:

function shapeSpace_disable_xmlrpc_multicall($methods) {
unset($methods);
return $methods;
}
add_filter('xmlrpc_methods', 'shapeSpace_disable_xmlrpc_multicall');

Данный метод позволяет не затрагивать настройки Apache или Nginx и будет полезен, если у вас ограниченный доступ к серверу, где расположен сайт. Но недостаток в том, что защита привязана к конкретной теме и при ее изменении или обновлении настройку нужно добавлять повторно.

Examples

Brute-force attacks are often used for attacking authentication and
discovering hidden content/pages within a web application. These attacks
are usually sent via GET and POST requests to the server. In regards to
authentication, brute force attacks are often mounted when an
is not in place.

Example 1

A web application can be attacked via brute force by taking a word list
of known pages, for instance from a popular content management system,
and simply requesting each known page then analyzing the HTTP response
code
to determine if the page exists on the target server.

DirBuster
is a tool that does exactly this.

Other tools for this type of attack are as follows:

— dirb
— WebRoot

dirb is capable of:

— setting cookies
— adding any HTTP header
— using PROXY
— mutating objects which were found
— testing http(s) connections
— seeking catalogues or files using defined dictionaries and templates
— and much much more

The simplest test to perform is:

In the output the attacker is informed that directory was
found. The attacker has now found a potential directory of interest
within this application. In dirb’s templates there are, among others, a
dictionary containing information about invalid httpd configurations.
This dictionary will detect weaknesses of this kind.

The application
WebRoot.pl, written by
CIRT.DK, has embedded mechanisms for parsing server responses, and based
on the phrase specified by the attacker, measures if the server response
is expected.

For example:

Np.

Another example is to examine ranges of the variable’s values:

Road Blocks:

One of the main issues with tools like dirb/dirbuster consist in the
analysis of server responses. With more advanced server configuration
(e.g. with mod_rewrite) automatic tools are sometimes unable to
determine “File not found” errors due to the server response being an
HTTP response code 200 but the page itself indicates “File not found”.
This can lead to false positives if the brute force tool is only relying
on HTTP response codes.

Burp Suite, can be used to parse specific parts of
the page returned, looking for certain strings in an effort to reduce
false positives.

Example 2

In regards to authentication, when no password policy is in place an
attacker can use lists of common username and passwords to brute force a
username or password field until successful authentication.

Оптимизация брут-форса путём атаки сразу на несколько целей

Одна попытка в минуту это довольно медленно. Кстати, ведь в рассматриваемых условиях мы можем делать по три попытки в минуту, затем делать паузу. Не уверен, можно ли это сделать встроенным средствами patator.

Зато в patator есть очень полезный алгоритм, который используется по умолчанию при брут-форсе большого количества объектов. Можно запустить перебор учётных данных сразу на множестве роутеров. Для этого в качестве цели с опцией url укажите файл, например, url=FILE2, также укажите путь до самого файла: 2=routers_IP.txt. patator будет работать следующим образом: пробовать один логин:пароль на первом роутере, затем переходить ко второму роутеру и там пробовать один логин:пароль, затем к следующему, пока список не кончится. Когда список завершится, то patator зайдёт на второй круг и для первого роутера попробует вторую пару логин:пароль, затем перейдёт к следующему роутеру и так далее. В результате возникает естественная задержка между попытками ввода на одном роутере — пока делаются попытки входа на следующих в списке, каждому роутеру даётся время «передышки». Это позволяет значительно сократить значение —rate-limit или вовсе не использовать, так как если одновременно брут-форсятся десятки тысяч роутеров, то очередь до каждого роутера может доходить более чем через минуту. Номер файла имеет значение! То есть в начале полный круг проходится для файлов с номером . Это могут быть, например, имена пользователей. Если вы будете брать адреса роутеров для брут-форса из файла с номером , то patator будет атаковать только первый в списке роутер и перейдёт к следующему только тогда, когда закончатся логины и пароли для проверки.

На случай если найдены верные логин:пароль, то вместо команды quit (выход из программы), нужно использовать команду free (остановка тестирования хоста после нахождения валидного пароля) примерно следующим образом: -x free=url:code=302

The goal of a brute force attack

Once a hacker makes a successful login attempt, what’s next? The answer is a whole range of things can be carried out. Here are some of the main ones:

  • Stealing or exposing users’ personal information found inside online accounts
  • Harvesting sets of credentials for sale to third parties
  • Posing as account owners to spread fake content or phishing links
  • Stealing system resources for use in other activities
  • Defacement of a website through gaining access to admin credentials
  • Spreading malware or spam content or redirecting domains to malicious content

As mentioned, brute force attacks can also be used to test for vulnerabilities in the system, so are not always malicious.

Web application behavior when retrieving login data

Checking the success of authorization

How do we know if we are logged in? That is, how to understand that the password was successfully guessed? To do this, the page which is sent after the login attempt is analyzed. Sometimes we cannot know what is shown after successful authorization, because we do not have a valid account. Therefore, we can use only the inverse method: we try to enter any login and password and look at the error. For example, it can be ‘Account does not exist’. Next, the brute force compares the pages it receives, and if there is no ‘Account does not exist’, it means that the password is cracked.

Brute-force programs can also work with strings that are displayed when the input is successful.

The behavior of a web application with a successful or unsuccessful login is not limited to just displaying a message. Also, together, or even instead of displaying a message, the web application can:

  • redirect (for example, in case of a successful login the user is redirected to the admin panel or to his own page);
  • write the cookies (in the case of a valid login and password, the server sends cookies with session data, and based on these cookies, the web application shows the logged in user the edit button, the link to the admin panel, etc.).

And more about the displayed data — many popular web applications support many languages. This is also important to consider, because you expect to get ‘Account does not exist’ but instead it will show ‘ไม่มี บัญชี อยู่’…

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Adblock
detector