Contact us in messengers or by phone.

whatsapp telegram viber phone email
+79214188555

Password Interceptors for Operating System Users

Joined
Feb 17, 2010
Messages
226
Reaction score
0
Points
16
Age
34
Location
Новосибирск
Security Concerns: Computer Security

Password Interceptors for Operating System Users


Introduction

The task of protecting information stored in computer systems from unauthorized access (unauthorized access) is very relevant. To solve this problem, a whole range of tools is used, including hardware, software and hardware, and administrative measures to protect information.

As the means of protecting computer systems develop, so do the means of attack. Attackers-hackers are inventing more and more attacks on various elements of the protection subsystems of computer systems. One of the most dangerous is the attack of a protected system through software bookmarks. A software bookmark is a program or a fragment of a program that is covertly embedded in a protected system and allows the attacker who implemented it to subsequently carry out unauthorized access to certain resources of the protected system.

The main danger of software bookmarks is that, a program bookmark, being part of a protected system, is able to take active measures to mask its presence in the system. When bookmarks are introduced into the system in a protected system, a hidden channel of information exchange is created, which, as a rule, goes unnoticed by system administrators for a long time. Almost all known software bookmarks, used at different times by various attackers, were detected either due to errors made when programming the bookmark, or purely by accident.

In this paper, we consider one of the most common classes of software bookmarks - bookmarks that intercept passwords of users of operating systems (password interceptors). Password interceptors were developed at different times for a variety of operating systems, including OS / 370, MS-DOS, and many versions of Windows and UNIX. The password interceptor, embedded in the operating system, in one way or another gets access to the passwords entered by users at the login. Having intercepted the next password, the bookmark writes it to a special file or to any other place accessible to the attacker who introduced the bookmark into the system.

This article is devoted to the classification of password interceptors, a description of the architecture of typical password interceptors, and methods of protection against them.

Password interceptors of the first kind.

Password interceptors of the first kind operate according to the following algorithm. An attacker launches a program that simulates an invitation

user to login and waiting for input. When a user enters a username and password, the bookmark saves them in a place accessible to the attacker, after which he shuts down and logs out the malicious user (in most operating systems, the user can log out of the system programmatically). At the end of the bookmark, a real prompt appears for the user to enter the system.

A user who is a victim of a bookmark sees that he is not logged in, and that he is again asked to enter a name and password. The user assumes that an error occurred while entering the password, and re-enters the name and password. After that, the user logs into the system, and his further work proceeds normally. Some bookmarks operating according to this scheme, before shutting down, display a plausible error message, for example: “Password is entered incorrectly. Try again".

The main advantage of this class of password interceptors is that writing such a software bookmark does not require any special qualification from the attacker. Any user who can program at least in the BASIC language can write such a program in a matter of hours. The only problem that may arise here is the software implementation of user logout. However, the corresponding system call is documented for all multi-user operating systems known to the author. If the attacker is not too lazy to carefully study the documentation for the operating system, then he will solve this problem very quickly.

Password type interceptors of the first kind pose the greatest danger to those operating systems in which the invitation to the user to enter has a very simple form. For example, on most versions of UNIX OS, this prompt looks like this:

login: user

password:

The task of creating a program that fakes such an invitation is trivial.

Protection against password interceptors of the first kind.

The complication of the appearance of the invitation to enter the system makes it somewhat difficult to solve the problem of intercepting passwords, but does not create any fundamental difficulties for the attacker. In order to significantly complicate the implementation of the first kind of password interceptors into the system, more complex security measures are needed. An example of an operating system where such measures are implemented is Windows NT.

In Windows NT, normal user work and user authentication at login are performed on different desktop fields. The Windows NT workspace is a collection of windows that are simultaneously visible on the screen. Only processes whose windows are located on the same working field can interact with each other using the Windows GUI. The Windows NT workspace concept is close to the UNIX terminal concept.

The Winlogon process, which receives a user name and password, is executed on a separate work field (authentication work field). No other process, including password interceptor, has access to this working field. Therefore, the invitation to the user to enter the system, displayed by the first-kind password interceptor, can only be located on the working field of the application programs where all the programs launched by the user are executed.

Switching the computer screen from one working field to another is done by pressing the Ctrl-Alt-Del key combination. The Win32 subsystem of Windows NT processes this combination in a special way - the message about pressing Ctrl-Alt-Del is sent only to the Winlogon process. For all other processes, in particular, for all application programs launched by the user, pressing this key combination is completely invisible.

When the system starts, the authentication work field is initially displayed on the computer screen. However, the user does not enter the name and password immediately, but only after pressing Ctrl-Alt-Del. When a user finishes a session with the system, the authentication working field is also displayed, and, as in the previous case, a new user can enter a password to enter the system only after pressing Ctrl-Alt-Del.

If a password type interceptor of the first kind is introduced into the system, then in order for it to be able to intercept the user's password, it must at least handle the user pressing Ctrl-Alt-Del. Otherwise, when the user presses this key combination, the user switches to the authentication working field, the application working field becomes inactive, and the password interceptor simply cannot intercept anything - messages about the user pressing the keys will come to another working field. However, for all applications, the fact that the user presses Ctrl-Alt-Del always goes unnoticed. Therefore, the password will not be accepted by the program bookmark, but by the Winlogon process.

Of course, a password interceptor can imitate not the first prompt of the operating system where the user is prompted to press Ctrl-Alt-Del, but the prompt that is displayed after the user presses this combination. However, under normal conditions (in the absence of a software bookmark), this second prompt is automatically canceled after a fairly short time (from 30 seconds to 1 minute, depending on the version of Windows NT). If the second prompt is present on the computer screen for a long time, this fact should alert the user. In addition, experience shows that users who have been working with Windows NT for a long time get the habit of starting work with the system by pressing Ctrl-Alt-Del regardless of what is displayed on the screen.

Protecting Windows NT from password sniffers of the first kind is highly reliable. Apparently, when developing measures to protect the operating system from password interceptors of the first kind, one should focus on a mechanism similar to the one described above. Particular attention should be paid to the following two conditions, the fulfillment of which is necessary to ensure reliable protection against password interceptors of the first kind:

A program that receives a user name and password when entering the system runs on an isolated terminal (authentication terminal) that is inaccessible to application programs.
The fact of switching the user console to the authentication terminal is invisible to application programs. Applications cannot prevent the console from switching to the authentication terminal.
If the operating system does not support these features (and no operating system known to the author, except Windows NT, supports these features), the security of the system from password interceptors of the first kind can be increased by administrative measures. Each user of the system should be instructed that if he cannot log into the system several times in a row the first time, he should contact the administrator.



Password interceptors of the second kind.

Password type interceptors of the second kind intercept all data entered by the user from the keyboard. The simplest software bookmarks of this type simply dump all this data on the computer’s hard drive or in any other place accessible to the attacker. More advanced bookmarks analyze the intercepted data and filter out information that is obviously not related to passwords. Several such bookmarks were written at different times for the MS-DOS operating system, some of them were used in practice, and very efficiently. One of these bookmarks and an example of its effective use are described in [6].

These bookmarks are resident programs that intercept one or more processor interrupts related to working with the keyboard. The information about the pressed key and the entered character returned by these interrupts is used by bookmarks for their own purposes.

At the end of 1997, Internet hackers of the second kind for Windows 3.x and Windows 95 appeared on Internet hacker servers. Examples of their use by attackers to implement unauthorized access have not yet been encountered in practice. In Internet teleconferences (newsgroups), several times there were reports of attacks of Windows 95 by password interceptors of the second kind. However, this information has never been confirmed.

Creating such software bookmarks is not associated with significant difficulties. The Win16 and Win32 programming interfaces support a special filter mechanism (hooks) that can be used to intercept user passwords. Using this mechanism, application programs and the operating system itself solve a number of problems, including the task of supporting national keyboard layouts. Any keyboard crack running in the Windows environment intercepts all information entered by the user from the keyboard, including passwords. It is easy to write a crack so that, in addition to its main functions, it would also perform the functions of a password interceptor. Writing a keyboard localization program is a fairly simple task. In many reference books and textbooks on programming this task is described in detail, in some publications, for example, in [5], the source texts of the simplest crack crack are given. Moreover, Windows supports filter chains, with the help of which several programs can simultaneously access the information entered from the keyboard and process it as they see fit, if necessary, transferring the processed information further down the chain. You can embed the password interceptor in the filter chain before or after the crack, so that all the information entered by the user from the keyboard passes through both the crack and the password interceptor. In this case, the task of writing a software bookmark that intercepts the passwords of Windows users becomes so simple that it practically does not require special qualifications from the author.

In general, in most cases the following statement is true. If the operating system allows switching the keyboard layout when entering the password, then for this operating system you can write a password interceptor of the second kind. Indeed, if a keyboard layout localization program exists for the operating system, and if this program is used when entering a password, after a slight change in the source text, this program turns into a password interceptor of the second kind. If this program is written in C, in the simplest case, it’s enough to add four operators to the program that look something like this:

StoreFile = fopen (FileName, "a + b");

fseek (StoreFile, 0, SEEK_END);

fputc (NewSymbol, StoreFile);

fclose (StoreFile);

For some operating systems, you can do with three operators.

Protection against password interceptors of the second kind.

To organize protection from password sniffers of the second kind, it is necessary to achieve the following three conditions in the operating system:

Switching the keyboard layout during password entry is not possible. Otherwise, the task of creating a password interceptor of the second kind is greatly simplified.
Configuring the chain of software modules involved in obtaining the user's password by the operating system is available only to system administrators.
Write access to the files of these program modules is granted only to system administrators.

To increase the stability of the protection system to administrator errors, the last condition can be formulated as follows:

Write access to the files of program modules involved in obtaining a user password is not granted to anyone. Write access to the security attributes of these files is granted only to administrators. Any calls for the purpose of writing to these files, as well as to their security attributes, are recorded in the system audit log.
If the system meets the third condition in the second formulation, the administration of the operating system in terms of keyboard maintenance (in particular, installing and changing keyboard layouts) is somewhat complicated.


In order for the above conditions to be fulfilled, it is necessary that the security subsystem of the operating system supports access control and auditing.

For most modern operating systems, all conditions, except the first, can be provided by organizational measures. The first condition in non-Russian versions of operating systems is usually fulfilled automatically. For most Russian-language versions of operating systems (in particular, for the Russian version of Windows NT 4.0) it is impossible to achieve this condition - the ability to create users with Russian names is embedded in the operating system software. In all English versions of Windows NT and all versions of UNIX known to the author, it is possible to create and maintain a security policy under which all three of the following conditions are met.

If it is impossible to ensure the fulfillment of the first condition in this operating system, it is necessary to achieve the fulfillment of the second and third conditions. The fulfillment of these conditions significantly increases the security of the system from password sniffers of the second kind.

Password interceptors of the third kind.


Type 3 password interceptors include software bookmarks that completely or partially replace the authentication subsystem of the operating system. Since the task of creating such a program bookmark is much more complicated than the task of creating a password interceptor of the first or second kind, this class of program bookmarks has appeared recently. The author is still not aware of any software bookmarks of this class. There are two demos of the third kind of password interceptors (both for Windows NT), one of which was written by the author. Cases of the use of third-order password interceptors by attackers have not yet been encountered.

The third kind of password interceptor can be written for any multi-user operating system. The complexity of creating such a password interceptor depends on the complexity of the algorithms implemented by the authentication subsystem, the complexity of the interface between its individual modules, and the degree of documenting the authentication subsystem of the operating system. In general, the task of creating a password interceptor of the third kind is much more complicated than the task of creating a password interceptor of the first or second kind. Apparently, this explains a small number of program bookmarks of this class. However, due to the increasingly widespread use of the Microsoft Windows NT operating system, which contains sufficiently powerful built-in protection against password interceptors of the first and second kind, the use of third-order password interceptors for unauthorized access is possible in the very near future.

Protection against password interceptors of the third kind.

Since the third-kind password interceptors partially assume the functions of the operating system security subsystem, the third-type password interceptor, when implemented in the system, must perform at least one of the following actions:

Replace one or more system files
infiltrate into one or more system files using one of the “viral” algorithms;
use the interface connections supported by the operating system between the software modules of the security subsystem to embed themselves in a chain of software modules that process the password entered by the user;
use for the same purpose low-level interface communications of the operating system used by the security subsystem to solve their problems.

Each of these actions leaves traces in the operating system that can be detected using the following protection measures:

Compliance with an adequate security policy. The authentication subsystem must be the most secure location in the operating system. The measures required to maintain an adequate security policy vary widely across operating systems.
Subject to an adequate security policy, the introduction of a third kind of password interceptor into the system, like any other software bookmark, is impossible. However, since administrators, like all people, tend to make mistakes in their work, maintaining an adequate security policy for a long time seems an almost impossible task. In addition, adherence to an adequate security policy protects only against the entry of a software bookmark into the system. As soon as a password interceptor is implemented into the system, measures to maintain the security policy become meaningless - if the system has a software bookmark, the security policy cannot be adequate, no matter what the system administrators think about it. Therefore, additional protective measures are needed.

Monitoring the integrity of executable files of the operating system. It is necessary to control not only the files included in the security subsystem, but also the libraries containing the low-level functions of the operating system.
Monitoring the integrity of interface communications within the security subsystem, as well as the interface communications used by the security subsystem to solve low-level tasks.
The construction of an absolutely reliable defense against password interceptors of the third kind seems impossible. Since the machine code for password interceptors of the third kind is not executed in the context of the user, but in the context of the operating system, the password interceptor of the third kind can take measures that make it difficult for system administrators to detect it, in particular:

interception of system calls that can be used by administrators to identify a software bookmark in order to replace the returned information;
filtering logged audit messages.
Apparently, there is a “fight between the shield and the sword”, when a reliable defense against it can be built for any known attack, and an attack can be realized for any known defense, which allows it to be effectively overcome.


Conclusion .


Password interceptors pose a very real threat to the security of operating systems. Protection against this threat is implemented by a set of measures and means, which includes both hardware and software and administrative protection measures.

In order for reliable protection against password interceptors to be built, it is necessary for the operating system to support certain features that impede the operation of password interceptors (see paragraphs 3.5). Since these capabilities are not supported by all operating systems, it is not possible to build effective protection against password interceptors in any operating system. The only operating system known to the author in which the construction of such protection is possible is Microsoft Windows NT. Organizing reliable protection against password interceptors in other operating systems, including MS-DOS, Windows 3.x, Windows 95, and all versions of UNIX known to the author, will require considerable work to create additional security features.

However, even in Windows NT it is impossible to build effective protection against password interceptors without the use of additional software tools. In particular, additional software is needed that implements integrity control of system files and interface connections of the authentication subsystem.

In order for protection against password interceptors to be effective, the security policy adopted in the system must satisfy the following requirements:

Configuring the chain of software modules involved in obtaining the user's password by the operating system is available only to system administrators.
Write access to the files of these program modules is granted only to system administrators.
Configuring the authentication subsystem is available only to system administrators.
Write access to system files is granted only to system administrators.
When organizing protection against password interceptors, it should be borne in mind that neither strict adherence to an adequate security policy, nor the fulfillment of the requirements for the operating system software, nor the implementation of the integrity monitoring system individually provide guarantees of reliable protection. All these measures must be taken in tandem.


Any protection against password interceptors can be reliable only if the system administrators strictly adhere to an adequate security policy. Given that:

administrators, like all people, from time to time make mistakes in work,
to introduce a password interceptor into the system, just one administrator error is enough,
after being introduced into the system, the password interceptor gets the opportunity to take active measures to disguise its presence; the construction of absolutely reliable protection against password interceptors seems almost impossible. This is where the “shield and sword fight” takes place, when a reliable defense against it can be built for any known attack, and an attack can be realized for any known defense, allowing it to be effectively overcome.


/ Assoc. Institute of Cryptography, Communications and Informatics, Academy of the FSB of Russia V. G. Proskurin
 
Original message
Проблемы безопасности: компьютерная безопасность

Перехватчики паролей пользователей операционных систем


Введение.

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

По мере развития средств защиты компьютерных систем развиваются и средства нападения. Злоумышленники-хакеры изобретают все новые и новые атаки на различные элементы подсистем защиты компьютерных систем. Одной из наиболее опасных является атака защищенной системы посредством программных закладок. Программная закладка – это программа или фрагмент программы, скрытно внедряемый в защищенную систему и позволяющий злоумышленнику, внедрившему его, осуществлять в дальнейшем НСД к тем или иным ресурсам защищенной системы.

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

В предлагаемой работе рассматривается один из наиболее распространенных классов программных закладок – закладки, перехватывающие пароли пользователей операционных систем (перехватчики паролей). Перехватчики паролей были разработаны в разное время для целого ряда операционных систем, включая OS/370, MS-DOS и многие версии Windows и UNIX. Перехватчик паролей, внедренный в операционную систему, тем или иным способом получает доступ к паролям, вводимым пользователями при входе в систему. Перехватив очередной пароль, закладка записывает его в специальный файл или в любое другое место, доступное злоумышленнику, внедрившему закладку в систему.

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

Перехватчики паролей первого рода.

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

пользователю для входа в систему и ждет ввода. Когда пользователь вводит имя и пароль, закладка сохраняет их в доступном злоумышленнику месте, после чего завершает работу и осуществляет выход из системы пользователя-злоумышленника (в большинстве операционных систем выход пользователя из системы можно осуществить программно). По окончании работы закладки на экране появляется настоящее приглашение для входа пользователя в систему.

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

Основным достоинством этого класса перехватчиков паролей является то, что написание подобной программной закладки не требует от злоумышленника никакой специальной квалификации. Любой пользователь, умеющий программировать хотя бы на языке BASIC, может написать такую программу за считанные часы. Единственная проблема, которая может здесь возникнуть, заключается в программной реализации выхода пользователя из системы. Однако соответствующий системный вызов документирован для всех многопользовательских операционных систем, известных автору. Если злоумышленник не поленится внимательно изучить документацию по операционной системе, то он решит данную проблему очень быстро.

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

login: user

password:

Задача создания программы, подделывающей такое приглашение, тривиальна.

Защита от перехватчиков паролей первого рода.

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

В Windows NT обычная работа пользователя и аутентификация пользователя при входе в систему осуществляются на разных рабочих полях (desktops). Рабочее поле Windows NT представляет собой совокупность окон, одновременно видимых на экране. Только процессы, окна которых расположены на одном рабочем поле, могут взаимодействовать между собой, используя средства Windows GUI. Понятие рабочего поля Windows NT близко к понятию терминала UNIX.

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

Переключение экрана компьютера с одного рабочего поля на другое производится при нажатии комбинации клавиш Ctrl-Alt-Del. Win32-подсистема Windows NT обрабатывает эту комбинацию по-особому – сообщение о нажатии Ctrl-Alt-Del посылается только процессу Winlogon. Для всех других процессов, в частности, для всех прикладных программ, запущенных пользователем, нажатие этой комбинации клавиш совершенно незаметно.

При старте системы на экран компьютера вначале отображается рабочее поле аутентификации. Однако пользователь вводит имя и пароль не сразу, а только после нажатия Ctrl-Alt-Del. Когда пользователь завершает сеанс работы с системой, на экран также выводится рабочее поле аутентификации, и, так же как и в предыдущем случае, новый пользователь может ввести пароль для входа в систему только после нажатия Ctrl-Alt-Del.

Если в систему внедрен перехватчик паролей первого рода, то, для того, чтобы он смог перехватить пароль пользователя, он должен по крайней мере обработать нажатие пользователем Ctrl-Alt-Del. В противном случае при нажатии пользователем этой комбинации клавиш произойдет переключение на рабочее поле аутентификации, рабочее поле прикладных программ станет неактивным, и перехватчик паролей просто не сможет ничего перехватить – сообщения о нажатии пользователем клавиш будут приходить на другое рабочее поле. Однако для всех прикладных программ факт нажатия пользователем Ctrl-Alt-Del всегда остается незамеченным. Поэтому пароль будет воспринят не программной закладкой, а процессом Winlogon.

Конечно, перехватчик паролей может имитировать не первое приглашение операционной системы, где пользователю предлагается нажать Ctrl-Alt-Del, а то приглашение, которое высвечивается после нажатия пользователем этой комбинации. Однако в обычных условиях (при отсутствии программной закладки) это второе приглашение автоматически отменяется через достаточно короткое время (от 30 секунд до 1 минуты, зависит от версии Windows NT). Если второе приглашение присутствует на экране компьютера долгое время, этот факт должен насторожить пользователя. Кроме того, как показывает опыт, пользователи, долгое время работающие с Windows NT, приобретают привычку начинать работу с системой с нажатия Ctrl-Alt-Del независимо от того, что отображается на экране.

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

Программа, получающая от пользователя имя и пароль при входе в систему, выполняется на изолированном терминале (терминале аутентификации), недоступном прикладным программам.
Факт переключения пользовательской консоли на терминал аутентификации незаметен прикладным программам. Прикладные программы не могут запретить переключение консоли на терминал аутентификации.
Если операционная система не поддерживает эти возможности (а ни одна операционная система, известная автору, кроме Windows NT, эти возможности не поддерживает), защищенность системы от перехватчиков паролей первого рода можно повысить административными мерами. Каждый пользователь системы должен быть проинструктирован, что если он несколько раз подряд не может войти в систему с первого раза, он должен обратиться к администратору.



Перехватчики паролей второго рода.

Перехватчики паролей второго рода перехватывают все данные, вводимые пользователем с клавиатуры. Простейшие программные закладки данного типа просто сбрасывают все эти данные на жесткий диск компьютера или в любое другое место, доступное злоумышленнику. Более совершенные закладки анализируют перехваченные данные и отсеивают информацию, заведомо не имеющую отношения к паролям. Несколько подобных закладок были в разное время написаны для операционной системы MS-DOS, некоторые из них использовались на практике, причем весьма эффективно. Одна из таких закладок и пример ее эффективного использования описаны в [6].

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

В конце 1997 года на хакерских серверах Internet появились перехватчики паролей второго рода для Windows 3.x и Windows 95. Примеры их использования злоумышленниками для осуществления НСД пока не встречались на практике. В телеконференциях Internet (newsgroups) несколько раз встречались сообщения об атаках Windows 95 перехватчиками паролей второго рода. Однако эта информация ни разу не подтверждалась.

Создание подобных программных закладок не связано со значительными трудностями. Программные интерфейсы Win16 и Win32 поддерживают специальный механизм фильтров (hooks), который может быть использован для перехвата паролей пользователей. С помощью этого механизма прикладные программы и сама операционная система решают целый ряд задач, в том числе и задачу поддержки национальных раскладок клавиатуры. Любой русификатор клавиатуры, работающий в среде Windows, перехватывает всю информацию, вводимую пользователем с клавиатуры, в том числе и пароли. Несложно написать русификатор так, чтобы он, помимо своих основных функций, выполнял бы и функции перехватчика паролей. Написание программы локализации клавиатуры является достаточно простой задачей. Во многих справочниках и учебниках по программированию эта задача подробно описана, в некоторых изданиях, например в [5], приведены исходные тексты простейшего русификатора клавиатуры. Более того, Windows поддерживает цепочки фильтров, с помощью которых несколько программ могут одновременно получать доступ к информации, вводимой с клавиатуры, и обрабатывать ее так, как считают нужным, при необходимости передавая обработанную информацию дальше по цепочке. Можно встроить перехватчик паролей в цепочку фильтров перед русификатором или после него, так, что вся информация, вводимая пользователем с клавиатуры, проходит и через русификатор, и через перехватчик паролей. В этом случае задача написания программной закладки, перехватывающей пароли пользователей Windows, становится настолько простой, что практически не требует от автора закладки специальной квалификации.

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

StoreFile = fopen (FileName, "a+b");

fseek (StoreFile, 0, SEEK_END);

fputc (NewSymbol, StoreFile);

fclose (StoreFile);

Для некоторых операционных систем можно обойтись тремя операторами.

Защита от перехватчиков паролей второго рода.

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

Переключение раскладки клавиатуры в процессе ввода пароля невозможно. В противном случае задача создания перехватчика паролей второго рода существенно упрощается.
Конфигурирование цепочки программных модулей, участвующих в получении операционной системой пароля пользователя, доступно только администраторам системы.
Доступ на запись к файлам этих программных модулей предоставляется только администраторам системы.

Для повышения устойчивости системы защиты к ошибкам администраторов можно сформулировать последнее условие следующим образом:

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


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

Для большинства современных операционных систем все условия, кроме первого, могут быть обеспечены организационными мерами. Первое условие в нерусскоязычных версиях операционных систем обычно выполняется автоматически. Для большинства русскоязычных версий операционных систем (в частности, для русской версии Windows NT 4.0) добиться выполнения этого условия невозможно – возможность создавать пользователей с русскими именами заложена в программное обеспечение операционных систем. Во всех англоязычных версиях Windows NT и всех известных автору версиях UNIX возможно создание и поддержание политики безопасности, при которой выполняются все три перечисленные условия.

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

Перехватчики паролей третьего рода.


К перехватчикам паролей третьего рода относятся программные закладки, полностью или частично подменяющие собой подсистему аутентификации операционной системы. Поскольку задача создания такой программной закладки гораздо сложнее, чем задача создания перехватчика паролей первого или второго рода, этот класс программных закладок появился совсем недавно. Автору до сих пор неизвестно ни одной программной закладки данного класса. Существуют две демонстрационные версии перехватчиков паролей третьего рода (обе для Windows NT), одна из которых написана автором. Случаи применения злоумышленниками перехватчиков паролей третьего рода пока не встречались.

Перехватчик паролей третьего рода может быть написан для любой многопользовательской операционной системы. Сложность создания такого перехватчика паролей зависит от сложности алгоритмов, реализуемых подсистемой аутентификации, сложности интерфейса между ее отдельными модулями, а также от степени документированности подсистемы аутентификации операционной системы. В целом задача создания перехватчика паролей третьего рода гораздо сложнее задачи создания перехватчика паролей первого или второго рода. Видимо, этим и объясняется небольшое количество программных закладок данного класса. Однако, в связи со все более широким распространением операционной системы Microsoft Windows NT, содержащей достаточно мощные встроенные средства защиты от перехватчиков паролей первого и второго рода, использование перехватчиков паролей третьего рода в целях осуществления несанкционированного доступа возможно в самом ближайшем будущем.

Защита от перехватчиков паролей третьего рода.

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

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

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

Соблюдение адекватной политики безопасности. Подсистема аутентификации должна быть самым защищенным местом операционной системы. Меры, необходимые для поддержания адекватной политики безопасности, сильно различаются для разных операционных систем.
При соблюдении адекватной политики безопасности внедрение в систему перехватчика паролей третьего рода, как и любой другой программной закладки, невозможно. Однако, поскольку администраторы, как и все люди, склонны допускать ошибки в своей работе, поддержание адекватной политики безопасности в течение длительного времени представляется практически невыполнимой задачей. Кроме того, соблюдение адекватной политики безопасности защищает только от проникновения программной закладки в систему. Как только перехватчик паролей внедрен в систему, меры по поддержанию политики безопасности становится бессмысленными – при наличии в системе программной закладки политика безопасности не может быть адекватной, чтобы ни думали по этому поводу администраторы системы. Поэтому необходимы дополнительные меры защиты.

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

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


Заключение.


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

Для того, чтобы надежная защита от перехватчиков паролей могла быть построена, необходимо, чтобы операционная система поддерживала определенные возможности, затрудняющие функционирование перехватчиков паролей (см. пп. 3,5). Поскольку эти возможности поддерживаются не всеми операционными системами, не в любой операционной системе возможно построение эффективной защиты от перехватчиков паролей. Единственной операционной системой из числа известных автору, в которой построение такой защиты возможно, является Microsoft Windows NT. Для организации надежной защиты от перехватчиков паролей в других операционных системах, включая MS-DOS, Windows 3.x, Windows 95 и все известные автору версии UNIX, потребуется значительная работа по созданию дополнительных средств защиты.

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

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

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


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

администраторы, как и все люди, время от времени допускают ошибки в работе,
для внедрения в систему перехватчика паролей достаточно всего одной ошибки администратора,
перехватчик паролей после внедрения в систему получает возможность предпринимать активные меры по маскировке своего присутствия, построение абсолютно надежной защиты от перехватчиков паролей представляется практически невозможным. Здесь имеет место “борьба щита и меча”, когда для любой известной атаки может быть построена надежная защита от нее, и для любой известной защиты может быть реализована атака, позволяющая ее эффективно преодолевать.


/доц. Института криптографии, связи и информатики Академии ФСБ России В. Г. Проскурин

Матушкин Андрей Николаевич

Президент IAPD
Staff member
Private access level
Full members of NP "MOD"
Joined
Jan 1, 1970
Messages
21,442
Reaction score
3,531
Points
113
Age
52
Location
Россия,
Website
o-d-b.ru
Thank!
 
Original message
Спасибо!