issue144:tutoriel3
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
issue144:tutoriel3 [2019/05/05 17:41] – d52fr | issue144:tutoriel3 [2019/05/08 14:38] (Version actuelle) – andre_domenech | ||
---|---|---|---|
Ligne 9: | Ligne 9: | ||
Any system administrator or hacker – we don't judge which way you lean – should have a solid understanding of netcat. Skilled system administrators can do almost all of their work using the built-in tools without having to install additional software, and, indeed, netcat is baked into most distributions.** | Any system administrator or hacker – we don't judge which way you lean – should have a solid understanding of netcat. Skilled system administrators can do almost all of their work using the built-in tools without having to install additional software, and, indeed, netcat is baked into most distributions.** | ||
+ | |||
+ | Site Web: http:// | ||
+ | Version: 0.7.1 (2004) | ||
+ | |||
+ | Netcat est un utilitaire qui utilise TCP/IP pour lire et écrire des données via des connexions réseau. Il est utilisé principalement pour tester les connexions TCP et UDP, mais il fait beaucoup plus. Certaines personnes l' | ||
+ | |||
+ | Si, pour une raison quelconque, vous ne l'avez pas, installez-le avec : | ||
+ | |||
+ | sudo apt install netcat | ||
+ | |||
+ | Tout administrateur système ou pirate - nous ne jugeons pas vers quel bord vous penchez - devrait avoir une bonne compréhension de netcat. Les administrateurs système expérimentés peuvent faire presque tout leur travail en utilisant les outils intégrés sans avoir à installer des logiciels supplémentaires, | ||
**Looking at the man page for netcat is bleh. Netcat is better understood with examples. Don't go rushing off installing bro pages, netcat is not listed in it yet. The basic syntax for netcat is: | **Looking at the man page for netcat is bleh. Netcat is better understood with examples. Don't go rushing off installing bro pages, netcat is not listed in it yet. The basic syntax for netcat is: | ||
Ligne 17: | Ligne 28: | ||
As stated before, netcat is a utility that does things via TCP/IP; should you require UDP, you have to specify the -u switch. If you are using ports 1-1024, you will require root privileges, anything else is fine as a normal user. You can add netcat to your scripts and it will work just fine. You can also use netcat to scan a range of ports (this is called port scanning), to test if your firewall setup was successful.** | As stated before, netcat is a utility that does things via TCP/IP; should you require UDP, you have to specify the -u switch. If you are using ports 1-1024, you will require root privileges, anything else is fine as a normal user. You can add netcat to your scripts and it will work just fine. You can also use netcat to scan a range of ports (this is called port scanning), to test if your firewall setup was successful.** | ||
+ | |||
+ | Un coup d'œil à la page man de netcat est... bof. Netcat se comprend beaucoup mieux avec des exemples. Ne vous jetez pas dans l' | ||
+ | |||
+ | netcat [options] host port | ||
+ | |||
+ | Vous pouvez l' | ||
+ | |||
+ | Comme dit plus haut, netcat est un utilitaire qui agit via TCP/IP ; si vous avez besoin de UDP, vous devez spécifier le commutateur -u. Si vous utilisez les ports 1-1024, vous devrez avoir les privilèges de root ; tout le reste se passe bien pour le simple utilisateur. Vous pouvez ajouter netcat à vos scripts et il fonctionnera bien. Vous pouvez aussi utiliser netcat pour scanner une plage de ports (c'est appelé le scanning des ports), pour tester si le paramétrage de votre pare-feu marche bien. | ||
**IMPORTANT - When scanning addresses on your internet connection, make sure that your ISP allows this, so that you do not get banned from the network. | **IMPORTANT - When scanning addresses on your internet connection, make sure that your ISP allows this, so that you do not get banned from the network. | ||
Ligne 27: | Ligne 46: | ||
z - don't send data to the ports | z - don't send data to the ports | ||
w - is just so that the listening times out and does not wait forever.** | w - is just so that the listening times out and does not wait forever.** | ||
+ | |||
+ | IMPORTANT - Lors d'un scan d' | ||
+ | |||
+ | Il est aussi très pratique pour vérifier les ports de votre routeur, en tenant compte de ceci : | ||
+ | |||
+ | Ici (présenté ci-dessous) j'ai scanné mon routeur, entre les ports 50 et 60 et j'ai découvert que le port 53 était ouvert. La raison que je le savais était que DNS utilise le port 53 (pour en savoir plus, lisez ceci, uniquement en anglais : https:// | ||
+ | v - sortie verbeuse ; | ||
+ | n - pas de requête DNS ; | ||
+ | z - ne pas envoyer de données vers les ports ; | ||
+ | w - il est là juste pour qu'il y ait une limite de temps et éviter une attente éternelle. | ||
+ | |||
**As you can see, crafting custom scans is very easy in netcat, which in turn, makes crafting your own tools very easy. | **As you can see, crafting custom scans is very easy in netcat, which in turn, makes crafting your own tools very easy. | ||
Ligne 41: | Ligne 71: | ||
dd if=/dev/sdc | gzip -c | nc 192.168.8.103 8888** | dd if=/dev/sdc | gzip -c | nc 192.168.8.103 8888** | ||
+ | |||
+ | Comme vous pouvez le voir, l' | ||
+ | |||
+ | L' | ||
+ | |||
+ | Ne vous leurrez pas sur la puissance de netcat. Les pirates peuvent l' | ||
+ | |||
+ | Dans un souci de tout dire, explorons ceci. Sur votre portable, lancez la commande suivante : | ||
+ | |||
+ | nc -lp 8888 | sudo dd of=/ | ||
+ | |||
+ | Puis, sur votre serveur, lancez : | ||
+ | |||
+ | dd if=/dev/sdc | gzip -c | nc 192.168.8.103 8888 | ||
**Now, in this example, my server was at 192.168.0.102, | **Now, in this example, my server was at 192.168.0.102, | ||
Ligne 49: | Ligne 93: | ||
cat / | cat / | ||
+ | |||
+ | Il se trouve que, dans cet exemple, mon serveur est à 192.168.0.102 et mon portable à 192.168.0.103 (en supposant que le port 8888 soit ouvert et parce que les VM (machines virtuelles) accueillies n'ont pas d' | ||
+ | |||
+ | nc -lp 8888 | gunzip -c | sudo dd of=/dev/sdc | ||
+ | |||
+ | et | ||
+ | |||
+ | cat / | ||
**The -lp switch is very handy; it listens on a specific port. In the old days before Teamviewer and the likes, we used the screen command to mirror a screen and chat to one another. Another way of chatting, server to server, or workstation to workstation, | **The -lp switch is very handy; it listens on a specific port. In the old days before Teamviewer and the likes, we used the screen command to mirror a screen and chat to one another. Another way of chatting, server to server, or workstation to workstation, | ||
+ | |||
+ | Le commutateur -lp est très pratique : il écoute sur un port précis. Autrefois, avant Teamviewer et consorts, nous utilisions la commande screen pour avoir une image miroir de l' | ||
**So far we have used netcat with IP addresses, you can also use domain names, which make it handy for testing your websites. The syntax is: | **So far we have used netcat with IP addresses, you can also use domain names, which make it handy for testing your websites. The syntax is: | ||
Ligne 63: | Ligne 117: | ||
while true; do sudo nc -lp 80 < index.html; done** | while true; do sudo nc -lp 80 < index.html; done** | ||
+ | |||
+ | Jusqu' | ||
+ | |||
+ | netcat domain.com port | ||
+ | |||
+ | Si vous avez un domaine vide, et si vous voulez y ranger quelque chose temporairement, | ||
+ | |||
+ | Créons une page d' | ||
+ | |||
+ | nano index.html | ||
+ | |||
+ | while true; do sudo nc -lp 80 < index.html; done | ||
**This keeps serving the page by looping, as if you did not, it would otherwise stop after serving the index page once. | **This keeps serving the page by looping, as if you did not, it would otherwise stop after serving the index page once. | ||
There is lots more netcat can do, and many ways a sharp mind can form this versatile tool. Examples include TCP banner grabber, relays, backdoor shell, etc. Hopefully, you now have an idea of the range of netcat' | There is lots more netcat can do, and many ways a sharp mind can form this versatile tool. Examples include TCP banner grabber, relays, backdoor shell, etc. Hopefully, you now have an idea of the range of netcat' | ||
+ | |||
+ | Ceci rafraîchit la page en boucle, car, si vous ne le faites pas, tout s' | ||
+ | |||
+ | Il y a beaucoup d' | ||
issue144/tutoriel3.1557070876.txt.gz · Dernière modification : 2019/05/05 17:41 de d52fr