75 lines
2.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 194,6667,6660-7000 - Pentesting IRC
{{#include ../banners/hacktricks-training.md}}
## 基本信息
IRC最初是一个**纯文本协议**由IANA分配了**194/TCP**,但通常在**6667/TCP**和类似端口上运行,以避免需要**root权限**进行操作。
连接到服务器只需要一个**昵称**。连接后服务器会对用户的IP进行反向DNS查找。
用户分为**操作员**和普通**用户**,操作员需要**用户名**和**密码**以获得更多访问权限。操作员的权限级别各不相同,管理员位于最高层。
**默认端口:** 194, 6667, 6660-7000
```
PORT STATE SERVICE
6667/tcp open irc
```
## 枚举
### 横幅
IRC 可以支持 **TLS**
```bash
nc -vn <IP> <PORT>
openssl s_client -connect <IP>:<PORT> -quiet
```
### 手动
在这里,您可以看到如何使用一些 **随机昵称** 连接和访问 IRC然后枚举一些有趣的信息。您可以在 [这里](https://en.wikipedia.org/wiki/List_of_Internet_Relay_Chat_commands#USERIP) 学习更多 IRC 命令。
```bash
#Connection with random nickname
USER ran213eqdw123 0 * ran213eqdw123
NICK ran213eqdw123
#If a PING :<random> is responded you need to send
#PONG :<received random>
VERSION
HELP
INFO
LINKS
HELPOP USERCMDS
HELPOP OPERCMDS
OPERATOR CAPA
ADMIN #Admin info
USERS #Current number of users
TIME #Server's time
STATS a #Only operators should be able to run this
NAMES #List channel names and usernames inside of each channel -> Nombre del canal y nombre de las personas que estan dentro
LIST #List channel names along with channel banner
WHOIS <USERNAME> #WHOIS a username
USERHOST <USERNAME> #If available, get hostname of a user
USERIP <USERNAME> #If available, get ip of a user
JOIN <CHANNEL_NAME> #Connect to a channel
#Operator creds Brute-Force
OPER <USERNAME> <PASSWORD>
```
您还可以尝试使用密码登录服务器。ngIRCd 的默认密码是 `wealllikedebian`
```bash
PASS wealllikedebian
NICK patrick
USER test1 test2 <IP> :test3
```
### **查找和扫描IRC服务**
```bash
nmap -sV --script irc-botnet-channels,irc-info,irc-unrealircd-backdoor -p 194,6660-7000 <ip>
```
### [暴力破解](../generic-hacking/brute-force.md#irc)
### Shodan
- `查找您的主机名`
{{#include ../banners/hacktricks-training.md}}