MODULE - Network scan : code cleaning

pull/2/head
Swissky 2018-10-17 00:24:03 +02:00
parent ed066d4622
commit 0fa1af8839
1 changed files with 4 additions and 25 deletions

View File

@ -1,26 +1,3 @@
"""
network scan
swissky@crashlab ~
$ curl -v "http://192.168.43.57"
* Rebuilt URL to: http://192.168.43.57/
* Trying 192.168.43.57...
* TCP_NODELAY set
* connect to 192.168.43.57 port 80 failed: Connexion refusée
* Failed to connect to 192.168.43.57 port 80: Connexion refusée
* Closing connection 0
curl: (7) Failed to connect to 192.168.43.57 port 80: Connexion refusée
swissky@crashlab ~
$ curl -v "http://192.168.43.56" 7
* Rebuilt URL to: http://192.168.43.56/
* Trying 192.168.43.56...
* TCP_NODELAY set
* connect to 192.168.43.56 port 80 failed: Aucun chemin d'accès pour atteindre l'hôte cible
* Failed to connect to 192.168.43.56 port 80: Aucun chemin d'accès pour atteindre l'hôte cible
* Closing connection 0
curl: (7) Failed to connect to 192.168.43.56 port 80: Aucun chemin d'accès pour atteindre l'hôte cible
swissky@crashlab ~
"""
from core.utils import * from core.utils import *
from datetime import datetime from datetime import datetime
import sys, struct, socket import sys, struct, socket
@ -40,8 +17,10 @@ class exploit():
# concurrent requests in order to limit the time # concurrent requests in order to limit the time
self.add_range("192.168.1.0/24") # Default network self.add_range("192.168.1.0/24") # Default network
self.add_range("192.168.0.0/24") # Default network self.add_range("192.168.0.0/24") # Default network
self.add_range("172.17.0.0/16") # Docker network
self.add_range("172.18.0.0/16") # Docker network # Uncomment these lines if you need to scan more networks
# self.add_range("172.17.0.0/16") # Docker network
# self.add_range("172.18.0.0/16") # Docker network
with concurrent.futures.ThreadPoolExecutor(max_workers=None) as executor: with concurrent.futures.ThreadPoolExecutor(max_workers=None) as executor:
future_to_url = {executor.submit(self.concurrent_request, requester, args.param, ip, "80"): ip for ip in self.ips} future_to_url = {executor.submit(self.concurrent_request, requester, args.param, ip, "80"): ip for ip in self.ips}