FileZillaServer
Author: Andrew Rathbun
description
FileZilla Server Logs
paths
collection commands
# PowerShell Artifact Collection Script
# Target: FileZillaServer
# Run as Administrator
#Requires -RunAsAdministrator
$ErrorActionPreference = "Continue"
$SourceRoot = "C:"
$DestBase = "D:\Evidence"
$Summary = @{ Copied = 0; Missed = 0; Errors = 0 }
function Collect-Artifact {
param(
[Parameter(Mandatory)][string]$SourceDir,
[Parameter(Mandatory)][string]$FolderName,
[string]$FileMask = "*"
)
# Expand wildcards in any path segment (e.g. 'Program Files*',
# 'ScreenConnect Client*'). robocopy itself does not glob the source.
$sources = @(Get-Item -Path $SourceDir -ErrorAction SilentlyContinue |
Where-Object { $_.PSIsContainer })
if ($sources.Count -eq 0) {
$Summary.Missed++
return
}
$FullDest = Join-Path -Path $DestBase -ChildPath $FolderName
$null = New-Item -ItemType Directory -Force -Path $FullDest -ErrorAction SilentlyContinue
foreach ($src in $sources) {
robocopy $src.FullName "$FullDest" "$FileMask" /E /COPY:DAT /R:0 /W:0 /NP /NFL /NDL /NJH /NJS 2>$null | Out-Null
if ($LASTEXITCODE -le 7) { $Summary.Copied++ } else { $Summary.Errors++ }
}
}
# 1. FileZilla Log Files
Collect-Artifact -SourceDir "C:\Program Files (x86)\FileZilla Server\Logs" -FileMask "*.log*" -FolderName "FileZilla_Log_Files"
# Iterate every user profile under the source drive
Get-ChildItem "$SourceRoot\Users" -Directory -ErrorAction SilentlyContinue |
Where-Object { $_.Name -notin @('All Users', 'Default', 'Default User', 'Public') } |
ForEach-Object {
$UserName = $_.Name
# FileZilla Server XML Log Files
$UserPath = "$($_.FullName)\AppData\Roaming\FileZilla Server"
Collect-Artifact -SourceDir $UserPath -FileMask "*.xml*" -FolderName "FileZilla_Server_XML_Log_Files_$UserName"
}
Write-Host ("Collection complete. Copied: {0} Missed: {1} Errors: {2}" -f $Summary.Copied, $Summary.Missed, $Summary.Errors) -ForegroundColor Green› Save as .ps1 and run as Administrator. Use: powershell -ExecutionPolicy Bypass -File script.ps1
references
notes
FileZilla Server Interface.xml will display the following information:
<FileZillaServer>
<Settings>
<Item name="Last Server Address" type="string">localhost</Item>
<Item name="Last Server Port" type="numeric">12345</Item>
<Item name="Last Server Password" type="string" />
<Item name="Always use last server" type="numeric">0</Item>
<Item name="Start Minimized" type="numeric">0</Item>
</Settings>
</FileZillaServer>
FileZilla Server.log will display the following information:
(000018) 4/3/2021 11:08:27 AM - (not logged in) (192.168.131.1)> USER Andrew
(000018) 4/3/2021 11:08:27 AM - (not logged in) (192.168.131.1)> 331 Password required for andrew
(000018) 4/3/2021 11:08:27 AM - (not logged in) (192.168.131.1)> PASS
(000018) 4/3/2021 11:08:27 AM - andrew (192.168.131.1)> 230 Logged on
(000017) 4/3/2021 11:08:27 AM - andrew (192.168.131.1)> CWD /EVT
(000017) 4/3/2021 11:08:27 AM - andrew (192.168.131.1)> 250 CWD successful. "/EVT" is current directory.
(000017) 4/3/2021 11:08:27 AM - andrew (192.168.131.1)> TYPE I
(000017) 4/3/2021 11:08:27 AM - andrew (192.168.131.1)> 200 Type set to I
(000018) 4/3/2021 11:08:27 AM - andrew (192.168.131.1)> CWD /EVT
(000018) 4/3/2021 11:08:27 AM - andrew (192.168.131.1)> 250 CWD successful. "/EVT" is current directory.
(000017) 4/3/2021 11:08:27 AM - andrew (192.168.131.1)> PASV
(000017) 4/3/2021 11:08:27 AM - andrew (192.168.131.1)> 227 Entering Passive Mode (192,168,131,128,204,144)
(000018) 4/3/2021 11:08:27 AM - andrew (192.168.131.1)> TYPE I
(000018) 4/3/2021 11:08:27 AM - andrew (192.168.131.1)> 200 Type set to I
(000017) 4/3/2021 11:08:27 AM - andrew (192.168.131.1)> RETR Internet.evt
(000018) 4/3/2021 11:08:27 AM - andrew (192.168.131.1)> PASV
(000018) 4/3/2021 11:08:27 AM - andrew (192.168.131.1)> 227 Entering Passive Mode (192,168,131,128,255,124)
(000017) 4/3/2021 11:08:27 AM - andrew (192.168.131.1)> 150 Opening data channel for file download from server of "/EVT/Internet.evt"
(000018) 4/3/2021 11:08:27 AM - andrew (192.168.131.1)> RETR AppEvent.Evt
(000018) 4/3/2021 11:08:27 AM - andrew (192.168.131.1)> 150 Opening data channel for file download from server of "/EVT/AppEvent.Evt"
(000018) 4/3/2021 11:08:27 AM - andrew (192.168.131.1)> 226 Successfully transferred "/EVT/AppEvent.Evt"
(000017) 4/3/2021 11:08:27 AM - andrew (192.168.131.1)> 226 Successfully transferred "/EVT/Internet.evt"
The above example shows me downloading two test .EVT files to my host machine shortly after reconnecting to the FTP Server administered by FileZilla Server which was running within a Windows 10 VM.