In the cult film of the beginning of the two thousandth “Password“ Swordfish ”, a talented hacker needs to pick up a password within one minute. In this he is helped by a friend who carefully holds a pistol at his temple and a temperamental blonde hiding under the table. What if there are no such friends nearby, and you need to pick a password? For example, during penetration testing ...
A small but important warning: if the approach proposed in the article is not used in security testing projects, then your actions can easily fall under Article 272 of the Criminal Code of the Russian Federation (Illegal access to computer information).
In order to come up with an effective password selection strategy, an ethical hacker must try to get into the heads of users and administrators.
You can name at least the following three:
What can users easily remember?
Consider the things that are easiest for us to remember:
1) The, that before eyes.
Before our eyes most often appear trademarks of monitors, laptops, computer mice and keyboards, the inscription "password:". It is said that the choice of such a trivial password as “password” by the head of the election campaign of Hilary Clinton had a disastrous effect on the results of the American elections.
2) What is important.
For a person are important:
3) What the fingers remember:
4) What is the system / site:
In 2014, there was a big leak of Gmail, Yandex and Mail.ru passwords. The password lists were analyzed by varagian in the article "Analysis of the lost passwords of Gmail, Yandex and Mail.Ru" and you can see that users choose passwords according to the considered scheme.
To protect users in many systems, developers have a password policy mechanism, which, unfortunately (fortunately for ethical hackers), is not always used. Consider the limitations and how they are performed / treated by creative users.
Typical restrictions on password policy:
To come up with a password longer than 8 characters is not difficult, but to use characters in different registers is already difficult, as you need to remember for which character in its password the upper case was chosen. The most obvious and likely solution: choose the first or last character.
If the system forces you to add numbers, then here users are slightly more inventive:
Understanding these small tricks of users, it is quite simple for an ethical hacker to narrow down the list of candidate words for a password.
If the password will be used by many users, for example, system administrators or students in the classroom, then it is usually specifically made not very difficult (for example, coinciding with the account name), and is often left as it was set by the vendor default.
Having dealt with the nuances of choosing a password by users, we can develop a password guessing strategy during penetration testing.
Fix the initial conditions:
To successfully authorize a single password, as a rule, is not enough, you also need to know the name of the account. We will figure out how to get it.
Option 1. Getting a list of accounts using a vulnerability in the system.
For example, a Windows domain controller can be configured to allow an anonymous user to get a list of user accounts.
Anyone can check their domain controller for this opportunity, for example, using the command line utility rpcclient from the “Scanner-VS” :
Option 2. Formation of the list on the basis of “intelligence” and analysis.
User names, even in small organizations, are defined by administrators based on some standard. The most common options are: the first letter of the name + surname: adorofeev, the same, but through the dot a.dorofeev, the full name + surname: alexander.dorofeev. Also, the names of internal accounts often coincide with the e-mail account. Accordingly, the rule of forming a user name can be determined simply by “running” the addresses of employees lit up on the Internet, and a complete list can be generated based on the list of employees that can be obtained from the internal telephone directory, as well as social networks. In a pinch, you can form combinations of the most common first and last names using the most common rules for forming account names.
Option 3. The most common accounts and default entries.
Many systems have default accounts. At a minimum, this is admin or administrator. There are a lot of them in some systems, so in Oracle you can find SYSTEM, SYS, ANONYMOUS, CTXSYS, DBSNMP, LBACSYS, MDSYS, OLAPSYS, ORDPLUGINS, ORDSYS, OUTLN, SCOTT, WKSYS, WMSYS, XDB. Accordingly, it makes sense to look into the manuals of system administrators that you want to test.
Often, there are accounts in the systems that are very easy to calculate, for example, if the company has a training class, then the probability of having a teacher and student accounts is quite high. And how many systems in which, someone did not create an account test?
Understanding which accounts in which systems in the tested IT infrastructure we plan to compromise, we can determine the sequence of systems to attack:
No | System class | Accounts | Passwords |
---|---|---|---|
one | Domain controller | Employee accounts, administrative, typical. | The most common. |
2 | Business applications | Employee accounts, administrative, typical. | The most common. |
3 | DBMS | Employee Accounts, Administrative, Sample, Default. | The most common, default |
four | Special systems and services: backup, ftp, etc. | Administrative, default. | The most common, default. |
five | Active network equipment | Administrative, default. | The most common, default. |
If in the systems account locking is turned on after several unsuccessful attempts (as a rule, the number 5 is chosen), and testing time is limited, and we cannot set a timeout between attempts to reset the counter, it makes sense to run through all users checking the following likely passwords:
Having picked up passwords for accounts, the first thing an ethical hacker has to do is log in and see what he has access to.
If access is received to the file system, then the following files should be searched:
An ethical hacker to note: in large organizations often there are environments for testing that use data recovered from a not very old backup copy of a combat system database. At the same time, test environments are usually poorly protected, for example, there may be several administrative administrator accounts and simple passwords. Compromising such a system results in testing specialists gaining access to user password hashes, which are often relevant to the combat system.
The thc-hydra command line utility is a classic tool for online password guessing , and for ethical hackers and administrators who love comfort, this functionality with an intuitive interface is available in our Scanner-VS complex :
Also, a key factor in the successful selection of a password is the availability of well-composed dictionaries, but with this there are problems. Dictionaries supplied with modern domestic security analysis tools do not always contain really useful sets of words. For example, include a standard dictionary distributed with one free utility. The solution, of course, is simple, but not very effective. Is it possible to imagine a Russian user who chose passwords such as: soccer, cutiepie, maganda or mustang. How many on average Russian city of lucky owners of a Ford Mustang? Sometimes they include a great dictionary, based mostly on passwords left by default, but they completely forget about regular users and their favorite passwords.
We decided to correct this annoying situation and compiled our password lists, which are now available not only to users of our Scanner-VS security testing suite, but also to everyone on the website of our solution in the Passwords section :
Password Lists:
Account Lists:
Hacker from the movie "Password" Swordfish "was lucky and, despite the distractions and the chaotic style of work, he was able to pick up a password and stay alive. Using a structured approach, ethical hackers increase their chances of success in penetration testing and rely less on luck. This approach will work until passwords are chosen by people.
Source: https://habr.com/ru/post/420017/
All Articles