---
title: "194,6667,6660-7000 - Pentesting IRC"
section: "Network Services"
sectionSlug: "network-services-pentesting"
sourcePath: "src/network-services-pentesting/pentesting-irc.md"
sourceUrl: "https://github.com/HackTricks-wiki/hacktricks/blob/188de82beb54e70956b2952367a0af91d26758b8/src/network-services-pentesting/pentesting-irc.md"
sha: "188de82beb54e70956b2952367a0af91d26758b8"
isIndex: false
modified: true
license: "CC-BY-NC-4.0"
---
# 194,6667,6660-7000 - Pentesting IRC
## Basic Information
IRC is a text protocol. IANA assigns TCP 194 to IRC, while deployments have historically used TCP 6667 and adjacent unprivileged ports; modern networks also commonly offer TLS on 6697.<sup>[[1]](#references)</sup><sup>[[2]](#references)</sup>
Registration normally requires at least `NICK` and `USER`; a server may additionally require `PASS`, SASL, or other network-specific authentication. Reverse-DNS lookup is implementation/configuration dependent.<sup>[[2]](#references)</sup>
Users are divided into **operators**, who need a **username** and **password** for more access, and regular **users**. Operators have varying levels of privileges, with administrators at the top.
**Default ports:** 194, 6667, 6660-7000
```text
PORT STATE SERVICE
6667/tcp open irc
```
## Enumeration
### Banner
IRC can support **TLS**.
```bash
nc -vn <IP> <PORT>
openssl s_client -connect <IP>:<PORT> -quiet
```
### Manual
The following raw session registers a random nickname and exercises useful enumeration commands. Command availability and permissions vary by daemon and network; the IRC command index provides additional commands to test where supported.<sup>[[5]](#references)</sup>
```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>
```
You can also test server-password authentication when the service advertises or requires it. `wealllikedebian` appeared in an old Debian/ngIRCd sample configuration and is worth testing only when that specific legacy setup is identified; it is not a universal ngIRCd default.<sup>[[3]](#references)</sup>
```bash
PASS wealllikedebian
NICK patrick
USER test1 test2 <IP> :test3
```
### **Find and scan IRC services**
```bash
nmap -sV --script irc-botnet-channels,irc-info,irc-unrealircd-backdoor -p 194,6660-7000 <ip>
```
The NSE documentation describes the probes, output, and safety classification for these scripts.<sup>[[4]](#references)</sup>
### [Brute Force](https://github.com/HackTricks-wiki/hacktricks/blob/188de82beb54e70956b2952367a0af91d26758b8/src/generic-hacking/brute-force.md#irc)
### Shodan
- `looking up your hostname`
## References
- [1] [IANA Service Name and Transport Protocol Port Number Registry](https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml)
- [2] [RFC 2812 - Internet Relay Chat: Client Protocol](https://www.rfc-editor.org/rfc/rfc2812)
- [3] [Debian ngIRCd sample configuration](https://sources.debian.org/src/ngircd/0.10.0-1.1/debian/ngircd.conf/)
- [4] [Nmap NSE - `irc-info`](https://nmap.org/nsedoc/scripts/irc-info.html)
- [5] [List of IRC commands](https://en.wikipedia.org/wiki/List_of_Internet_Relay_Chat_commands#USERIP)