mirror of
https://github.com/cliffe/SecGen.git
synced 2026-02-21 11:18:06 +00:00
Filezilla Config File Generator
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
#!/usr/bin/ruby
|
||||
require_relative '../../../../../lib/objects/local_string_generator.rb'
|
||||
require 'erb'
|
||||
require 'fileutils'
|
||||
class FilezillaConfigFileGenerator < StringGenerator
|
||||
attr_accessor :ftp_user
|
||||
attr_accessor :ftp_pass
|
||||
attr_accessor :proxy_user
|
||||
attr_accessor :proxy_pass
|
||||
LOCAL_DIR = File.expand_path('../../',__FILE__)
|
||||
TEMPLATE_PATH = "#{LOCAL_DIR}/templates/filezilla_config.md.erb"
|
||||
|
||||
def initialize
|
||||
super
|
||||
self.ftp_user = 'admin'
|
||||
self.ftp_pass = 'admin'
|
||||
self.proxy_user = ''
|
||||
self.proxy_pass = ''
|
||||
end
|
||||
|
||||
def get_options_array
|
||||
super + [['--ftp_user', GetoptLong::REQUIRED_ARGUMENT],
|
||||
['--ftp_pass', GetoptLong::REQUIRED_ARGUMENT],
|
||||
['--proxy_user', GetoptLong::OPTIONAL_ARGUMENT],
|
||||
['--proxy_pass', GetoptLong::OPTIONAL_ARGUMENT]]
|
||||
end
|
||||
|
||||
def process_options(opt, arg)
|
||||
super
|
||||
case opt
|
||||
when '--ftp_user'
|
||||
self.ftp_user << arg;
|
||||
when '--ftp_pass'
|
||||
self.ftp_pass << arg;
|
||||
when '--proxy_user'
|
||||
self.proxy_user << arg;
|
||||
when '--proxy_pass'
|
||||
self.proxy_pass << arg;
|
||||
end
|
||||
end
|
||||
def generate
|
||||
|
||||
template_out = ERB.new(File.read(TEMPLATE_PATH), 0, '<>-')
|
||||
self.outputs << template_out.result(self.get_binding)
|
||||
end
|
||||
|
||||
# Returns binding for erb files (access to variables in this classes scope)
|
||||
# @return binding
|
||||
def get_binding
|
||||
binding
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
FilezillaConfigFileGenerator.new.run
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<generator xmlns="http://www.github/cliffe/SecGen/generator"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.github/cliffe/SecGen/generator">
|
||||
|
||||
<name>Filezilla Config File Generator</name>
|
||||
<author>Jack Biggs</author>
|
||||
<module_license>MIT</module_license>
|
||||
<description>Creates a Filezilla config file which includes either 1 or 2 sets of plaintext credentials</description>
|
||||
|
||||
<type>string_generator</type>
|
||||
<type>local_calculation</type>
|
||||
<platform>linux</platform>
|
||||
|
||||
<read_fact>ftp_user</read_fact>
|
||||
<read_fact>ftp_pass</read_fact>
|
||||
<read_fact>ftp_user</read_fact>
|
||||
<read_fact>ftp_pass</read_fact>
|
||||
|
||||
<!-- START: ftp_user input -->
|
||||
<default_input into="ftp_user">
|
||||
<encoder type="string_selector">
|
||||
<input into="strings_to_encode">
|
||||
<value>Nothing to see here</value>
|
||||
</input>
|
||||
</encoder>
|
||||
</default_input>
|
||||
<!-- END: ftp_user input -->
|
||||
|
||||
<!-- START: ftp_pass input -->
|
||||
<default_input into="ftp_pass">
|
||||
<generator type="password_generator"/>
|
||||
</default_input>
|
||||
<!-- END: ftp_pass input -->
|
||||
|
||||
<!-- START proxy_user input -->
|
||||
<default_input into="proxy_user">
|
||||
<encoder type="string_selector">
|
||||
<input into="strings_to_encode">
|
||||
<value>Nothing to see here</value>
|
||||
</input>
|
||||
</encoder>
|
||||
</default_input>
|
||||
<!-- END: proxy_user input -->
|
||||
<!-- START: proxy_pass input -->
|
||||
<default_input into="proxy_pass">
|
||||
<generator type="password_generator"/>
|
||||
</default_input>
|
||||
<!-- END: proxy_pass input -->
|
||||
<output_type>generated_strings</output_type>
|
||||
</generator>
|
||||
@@ -0,0 +1,149 @@
|
||||
<FileZilla3 version="3.60.2" platform="*nix">
|
||||
<Settings>
|
||||
<Setting name="Use Pasv mode">1</Setting>
|
||||
<Setting name="Limit local ports">0</Setting>
|
||||
<Setting name="Limit ports low">6000</Setting>
|
||||
<Setting name="Limit ports high">7000</Setting>
|
||||
<Setting name="Limit ports offset">0</Setting>
|
||||
<Setting name="External IP mode">0</Setting>
|
||||
<Setting name="External IP"/>
|
||||
<Setting name="External address resolver">http://ip.filezilla-project.org/ip.php</Setting>
|
||||
<Setting name="Last resolved IP"/>
|
||||
<Setting name="No external ip on local conn">1</Setting>
|
||||
<Setting name="Pasv reply fallback mode">0</Setting>
|
||||
<Setting name="Timeout">20</Setting>
|
||||
<Setting name="Logging Debug Level">0</Setting>
|
||||
<Setting name="Logging Raw Listing">0</Setting>
|
||||
<Setting name="Allow transfermode fallback">1</Setting>
|
||||
<Setting name="Reconnect count">2</Setting>
|
||||
<Setting name="Reconnect delay">5</Setting>
|
||||
<Setting name="Enable speed limits">0</Setting>
|
||||
<Setting name="Speedlimit inbound">1000</Setting>
|
||||
<Setting name="Speedlimit outbound">100</Setting>
|
||||
<Setting name="Speedlimit burst tolerance">0</Setting>
|
||||
<Setting name="Preallocate space">0</Setting>
|
||||
<Setting name="View hidden files">0</Setting>
|
||||
<Setting name="Preserve timestamps">0</Setting>
|
||||
<Setting name="Socket recv buffer size (v2)">4194304</Setting>
|
||||
<Setting name="Socket send buffer size (v2)">262144</Setting>
|
||||
<Setting name="FTP Keep-alive commands">0</Setting>
|
||||
<Setting name="FTP Proxy type">0</Setting>
|
||||
<Setting name="FTP Proxy host"/>
|
||||
<Setting name="FTP Proxy user"><%= self.ftp_user %></Setting>
|
||||
<Setting name="FTP Proxy password"><%= self.ftp_pass %></Setting>
|
||||
<Setting name="FTP Proxy login sequence"/>
|
||||
<Setting name="SFTP keyfiles" platform="unix"/>
|
||||
<Setting name="SFTP compression">0</Setting>
|
||||
<Setting name="Proxy type">0</Setting>
|
||||
<Setting name="Proxy host"/>
|
||||
<Setting name="Proxy port">0</Setting>
|
||||
<Setting name="Proxy user"><%= self.proxy_user %></Setting>
|
||||
<Setting name="Proxy password"><%= self.proxy_pass %></Setting>
|
||||
<Setting name="Logging file" platform="unix"/>
|
||||
<Setting name="Logging filesize limit">10</Setting>
|
||||
<Setting name="Size format">0</Setting>
|
||||
<Setting name="Size thousands separator">1</Setting>
|
||||
<Setting name="Size decimal places">1</Setting>
|
||||
<Setting name="TCP Keepalive Interval">15</Setting>
|
||||
<Setting name="Cache TTL">600</Setting>
|
||||
<Setting name="Minimum TLS Version">2</Setting>
|
||||
<Setting name="Kiosk mode">0</Setting>
|
||||
<Setting name="Master password encryptor"/>
|
||||
<Setting name="Trust system trust store">0</Setting>
|
||||
<Setting name="Ascii Binary mode">0</Setting>
|
||||
<Setting name="Auto Ascii files">
|
||||
ac|am|asp|bat|c|cfm|cgi|conf|cpp|css|dhtml|diff|diz|h|hpp|htm|html|in|inc|java|js|jsp|lua|m4|mak|md5|nfo|nsh|nsi|pas|patch|pem|php|phtml|pl|po|pot|py|qmail|sh|sha1|sha256|sha512|shtml|sql|svg|tcl|tpl|txt|vbs|xhtml|xml|xrc
|
||||
</Setting>
|
||||
<Setting name="Auto Ascii no extension">1</Setting>
|
||||
<Setting name="Auto Ascii dotfiles">1</Setting>
|
||||
<Setting name="Comparison threshold">1</Setting>
|
||||
<Setting name="Cache directory" platform="unix"/>
|
||||
<Setting name="Number of Transfers">2</Setting>
|
||||
<Setting name="Language Code"/>
|
||||
<Setting name="Concurrent download limit">0</Setting>
|
||||
<Setting name="Concurrent upload limit">0</Setting>
|
||||
<Setting name="Show debug menu">0</Setting>
|
||||
<Setting name="File exists action download">0</Setting>
|
||||
<Setting name="File exists action upload">0</Setting>
|
||||
<Setting name="Allow ascii resume">0</Setting>
|
||||
<Setting name="Greeting resources"/>
|
||||
<Setting name="Onetime Dialogs"/>
|
||||
<Setting name="Show Tree Local">1</Setting>
|
||||
<Setting name="Show Tree Remote">1</Setting>
|
||||
<Setting name="File Pane Layout">0</Setting>
|
||||
<Setting name="File Pane Swap">0</Setting>
|
||||
<Setting name="Filelist directory sort">0</Setting>
|
||||
<Setting name="Filelist name sort">1</Setting>
|
||||
<Setting name="Queue successful autoclear">0</Setting>
|
||||
<Setting name="Time Format"/>
|
||||
<Setting name="Date Format"/>
|
||||
<Setting name="Show message log">1</Setting>
|
||||
<Setting name="Show queue">1</Setting>
|
||||
<Setting name="Default editor" platform="unix"/>
|
||||
<Setting name="Always use default editor">0</Setting>
|
||||
<Setting name="File associations (v2)" platform="unix"/>
|
||||
<Setting name="Comparison mode">1</Setting>
|
||||
<Setting name="Site Manager position"/>
|
||||
<Setting name="Icon theme">default</Setting>
|
||||
<Setting name="Icon scale">125</Setting>
|
||||
<Setting name="Timestamp in message log">0</Setting>
|
||||
<Setting name="Sitemanager last selected"/>
|
||||
<Setting name="Filelist status bar">1</Setting>
|
||||
<Setting name="Filter toggle state">0</Setting>
|
||||
<Setting name="Show quickconnect bar">1</Setting>
|
||||
<Setting name="Messagelog position">0</Setting>
|
||||
<Setting name="File doubleclick action">0</Setting>
|
||||
<Setting name="Dir doubleclick action">0</Setting>
|
||||
<Setting name="Minimize to tray">0</Setting>
|
||||
<Setting name="Search column widths"/>
|
||||
<Setting name="Search column shown"/>
|
||||
<Setting name="Search column order"/>
|
||||
<Setting name="Search window size"/>
|
||||
<Setting name="Comparison hide identical">0</Setting>
|
||||
<Setting name="Search sort order"/>
|
||||
<Setting name="Edit track local">1</Setting>
|
||||
<Setting name="Prevent idle sleep">1</Setting>
|
||||
<Setting name="Filteredit window size"/>
|
||||
<Setting name="Enable invalid char filter">1</Setting>
|
||||
<Setting name="Invalid char replace">_</Setting>
|
||||
<Setting name="Already connected choice">0</Setting>
|
||||
<Setting name="Edit status dialog size"/>
|
||||
<Setting name="Display current speed">0</Setting>
|
||||
<Setting name="Toolbar hidden">0</Setting>
|
||||
<Setting name="Strip VMS revisions">0</Setting>
|
||||
<Setting name="Startup action">0</Setting>
|
||||
<Setting name="Persistent Choices">0</Setting>
|
||||
<Setting name="Queue completion action">1</Setting>
|
||||
<Setting name="Queue completion command"/>
|
||||
<Setting name="Drag and Drop disabled">0</Setting>
|
||||
<Setting name="Disable update footer">0</Setting>
|
||||
<Setting name="Highest shown overlay id">0</Setting>
|
||||
<Setting name="Greeting version">3.60.2</Setting>
|
||||
<Setting name="Prompt password save">1</Setting>
|
||||
<Setting name="Queue column widths">180 60 180 80 60 150</Setting>
|
||||
<Setting name="Local filelist colwidths">170 80 120 120</Setting>
|
||||
<Setting name="Remote filelist colwidths">150 75 80 100 80 85</Setting>
|
||||
<Setting name="Window position and size">0 680 262 1190 825 </Setting>
|
||||
<Setting name="Splitter positions (v2)">97 -130 500000000 233 233 500000000</Setting>
|
||||
<Setting name="Local filelist shown columns">1111</Setting>
|
||||
<Setting name="Remote filelist shown columns">111111</Setting>
|
||||
<Setting name="Local filelist column order">0,1,2,3</Setting>
|
||||
<Setting name="Remote filelist column order">0,1,2,3,4,5</Setting>
|
||||
<Setting name="Tab data" sensitive="1">
|
||||
<Tabs>
|
||||
<Tab selected="1">
|
||||
<Host/>
|
||||
<Port>21</Port>
|
||||
<Protocol>-1</Protocol>
|
||||
<Logontype>0</Logontype>
|
||||
<BypassProxy>0</BypassProxy>
|
||||
<Site/>
|
||||
<RemotePath/>
|
||||
<LocalPath>/home/jack/</LocalPath>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
</Setting>
|
||||
<Setting name="Local filelist sortorder">0 0</Setting>
|
||||
<Setting name="Remote filelist sortorder">0 0</Setting>
|
||||
</Settings>
|
||||
</FileZilla3>
|
||||
Reference in New Issue
Block a user