--- 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.[[1]](#references)[[2]](#references) 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.[[2]](#references) 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 openssl s_client -connect : -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.[[5]](#references) ```bash #Connection with random nickname USER ran213eqdw123 0 * ran213eqdw123 NICK ran213eqdw123 #If a PING : is responded you need to send #PONG : 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 #WHOIS a username USERHOST #If available, get hostname of a user USERIP #If available, get ip of a user JOIN #Connect to a channel #Operator creds Brute-Force OPER ``` 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.[[3]](#references) ```bash PASS wealllikedebian NICK patrick USER test1 test2 :test3 ``` ### **Find and scan IRC services** ```bash nmap -sV --script irc-botnet-channels,irc-info,irc-unrealircd-backdoor -p 194,6660-7000 ``` The NSE documentation describes the probes, output, and safety classification for these scripts.[[4]](#references) ### [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)