Masquerade Address (PASV FTP IP) can be defined with --ip parameter

master
Pie Security 2016-08-17 00:34:52 +00:00
parent 15dfd3dd2b
commit c8fccff820
1 changed files with 5 additions and 3 deletions

View File

@ -10,7 +10,6 @@ import sys
from pyftpdlib.authorizers import DummyAuthorizer
from pyftpdlib.handlers import FTPHandler
from pyftpdlib.servers import FTPServer
import urllib
class Server:
@ -23,6 +22,10 @@ class Server:
self.port = int(cli_object.server_port)
else:
self.port = 21
if cli_object.ip:
self.ip = cli_object.ip
else:
self.ip = None
def serve(self):
# current directory
@ -46,8 +49,7 @@ class Server:
# Define a customized banner (string returned when client connects)
handler.banner = "Connecting to Egress-Assess's FTP server!"
#Define public address and passive ports making NAT configurations more predictable
public_ip = urllib.urlopen("http://api.ipify.org/").read()
handler.masquerade_address = public_ip
handler.masquerade_address = self.ip
handler.passive_ports = range(60000, 60100)
try: