hacktricks/network-services-pentesting/pentesting-irc.md

101 lines
5.4 KiB
Markdown
Raw Normal View History

# 194,6667,6660-7000 - Pentesting IRC
<details>
<summary><strong>Apprenez le piratage AWS de zéro à héros avec</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (HackTricks AWS Red Team Expert)</strong></a><strong>!</strong></summary>
Autres moyens de soutenir HackTricks :
* Si vous souhaitez voir votre **entreprise annoncée dans HackTricks** ou **télécharger HackTricks en PDF**, consultez les [**PLANS D'ABONNEMENT**](https://github.com/sponsors/carlospolop)!
* Obtenez le [**merchandising officiel PEASS & HackTricks**](https://peass.creator-spring.com)
* Découvrez [**La Famille PEASS**](https://opensea.io/collection/the-peass-family), notre collection d'[**NFTs**](https://opensea.io/collection/the-peass-family) exclusifs
* **Rejoignez le** 💬 [**groupe Discord**](https://discord.gg/hRep4RUj7f) ou le [**groupe Telegram**](https://t.me/peass) ou **suivez** moi sur **Twitter** 🐦 [**@carlospolopm**](https://twitter.com/carlospolopm)**.**
* **Partagez vos astuces de piratage en soumettant des PR aux dépôts github** [**HackTricks**](https://github.com/carlospolop/hacktricks) et [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud).
</details>
2023-06-03 13:10:46 +00:00
## Informations de base
2022-04-28 16:01:33 +00:00
IRC était **à l'origine un protocole en texte clair** (bien que plus tard étendu), qui sur demande s'est vu attribuer le port **194/TCP par l'IANA**. Cependant, la norme de facto a toujours été de **faire fonctionner IRC sur 6667/TCP** et des numéros de port proches (par exemple les ports TCP 66606669, 7000) pour **éviter** de devoir exécuter le logiciel IRCd avec des **privilèges root**.
Pour se connecter à un serveur, il suffit d'un **pseudonyme**. Une fois la connexion établie, la première chose que fait le serveur est un reverse-dns sur votre ip :
2021-11-30 16:46:07 +00:00
![](https://lh5.googleusercontent.com/C9AbjS9Jn4GvZJ-syptvebGU2jtI4p1UmLsmkBj3--utdFjft1B3Qfij3GDiUqxyp9wq\_mbupVdUtfW-\_rSo1W\_EPFZzCQ7iHSn7-DK3l4-BfylIHluQBNrDWxO0lxCuAMz8EkQ9oi9jwDlH6A)
Il semble qu'en général **il y a deux types d'utilisateurs** : les **opérateurs** et les **utilisateurs ordinaires**. Pour se connecter en tant qu'**opérateur**, il est nécessaire d'avoir un **nom d'utilisateur** et un **mot de passe** (et dans de nombreux cas un nom d'hôte particulier, une ip et même un hostmask particulier). Parmi les opérateurs, il existe différents niveaux de privilèges où l'administrateur a le privilège le plus élevé.
2023-06-03 13:10:46 +00:00
**Ports par défaut :** 194, 6667, 6660-7000
```
PORT STATE SERVICE
6667/tcp open irc
```
2023-06-03 13:10:46 +00:00
## Énumération
2023-06-03 13:10:46 +00:00
### Bannière
IRC peut supporter **TLS**.
```bash
nc -vn <IP> <PORT>
openssl s_client -connect <IP>:<PORT> -quiet
```
2023-06-03 13:10:46 +00:00
### Manuel
Ici, vous pouvez voir comment se connecter et accéder à l'IRC en utilisant un **pseudonyme aléatoire** puis énumérer des informations intéressantes. Vous pouvez apprendre plus de commandes IRC [ici](https://en.wikipedia.org/wiki/List\_of\_Internet\_Relay\_Chat\_commands#USERIP).
```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>
```
2023-06-03 13:10:46 +00:00
Vous pouvez également essayer de vous connecter au serveur avec un mot de passe. Le mot de passe par défaut pour ngIRCd est 'wealllikedebian'.
2022-06-13 19:39:23 +10:00
```bash
PASS wealllikedebian
NICK patrick
USER test1 test2 <IP> :test3
```
2023-06-03 13:10:46 +00:00
### **Trouver et scanner les services IRC**
```bash
nmap -sV --script irc-botnet-channels,irc-info,irc-unrealircd-backdoor -p 194,6660-7000 <ip>
```
2022-05-01 13:25:53 +00:00
### [Brute Force](../generic-methodologies-and-resources/brute-force.md#irc)
2022-05-01 13:25:53 +00:00
### Shodan
2023-06-03 13:10:46 +00:00
* `recherche de votre nom d'hôte`
2022-04-28 16:01:33 +00:00
<details>
<summary><strong>Apprenez le hacking AWS de zéro à héros avec</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (HackTricks AWS Red Team Expert)</strong></a><strong>!</strong></summary>
2022-04-28 16:01:33 +00:00
Autres moyens de soutenir HackTricks :
2022-04-28 16:01:33 +00:00
* Si vous souhaitez voir votre **entreprise annoncée dans HackTricks** ou **télécharger HackTricks en PDF**, consultez les [**PLANS D'ABONNEMENT**](https://github.com/sponsors/carlospolop)!
* Obtenez le [**merchandising officiel PEASS & HackTricks**](https://peass.creator-spring.com)
* Découvrez [**La Famille PEASS**](https://opensea.io/collection/the-peass-family), notre collection d'[**NFTs**](https://opensea.io/collection/the-peass-family) exclusifs
* **Rejoignez le** 💬 [**groupe Discord**](https://discord.gg/hRep4RUj7f) ou le [**groupe telegram**](https://t.me/peass) ou **suivez**-moi sur **Twitter** 🐦 [**@carlospolopm**](https://twitter.com/carlospolopm)**.**
* **Partagez vos astuces de hacking en soumettant des PR aux dépôts github** [**HackTricks**](https://github.com/carlospolop/hacktricks) et [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud).
2022-04-28 16:01:33 +00:00
</details>