Ports are now taken from elastic_fingerprint module

This commit is contained in:
Vakaris 2018-08-29 16:52:29 +03:00
parent d4262ef0bd
commit 4d6472cce1
1 changed files with 3 additions and 3 deletions

View File

@ -9,6 +9,7 @@ import logging
import requests
from exploit.web_rce import WebRCE
from model import WGET_HTTP_UPLOAD
from network.elasticfinger import ES_PORT, ES_SERVICE
import re
@ -44,9 +45,8 @@ class ElasticGroovyExploiter(WebRCE):
def get_open_service_ports(self, port_list, names):
# We must append elastic port we get from elastic fingerprint module because It's not marked as 'http' service
valid_ports = super(ElasticGroovyExploiter, self).get_open_service_ports(port_list, names)
elastic_service = [service for service in self.host.services if 'elastic-search' in service][0]
elastic_port = [elastic_service.lstrip('elastic-search-'), False]
valid_ports.append(elastic_port)
if ES_SERVICE in self.host.services:
valid_ports.append([ES_PORT, False])
return valid_ports
def exploit(self, url, command):