Parv's Case Download Utility (PCDU)
|
|
3 mēneši atpakaļ | |
|---|---|---|
| Icons | 3 mēneši atpakaļ | |
| README.md | 3 mēneši atpakaļ |
____ _ ____ ____ _ _
| _ \ __ _ _ ____ _( )___ / ___| _ \| | | |
| |_) / _` | '__\ \ / /|// __|| | | | | | | | |
| __/ (_| | | \ V / \__ \| |___| |_| | |_| |
|_| \__,_|_| \_/ |___(_)____|____/ \___/
Parv's Case Download Utility (Parv's CDU)
================================================================================
Parv's Case Download Utility (PCDU) is a Windows batch script designed to automate the download of NetScaler case files from remote analysis servers.
It efficiently retrieves:
The tool organizes downloaded files into a structured directory format for easy analysis and review.
================================================================================
✓ Automatic Case File Discovery
✓ Selective Download
✓ Smart Organization
✓ Performance Optimized
✓ Comprehensive Logging
✓ Dual SCP Support
================================================================================
Operating System:
Required Software (ONE of the following):
Option A - PuTTY Suite (Recommended):
- pscp.exe (PuTTY Secure Copy)
- plink.exe (PuTTY Link)
Download: https://www.putty.org/
Option B - OpenSSH Client:
- Built into Windows 10 (1809+) and Windows 11
- Enable via: Settings > Apps > Optional Features > OpenSSH Client
Network Requirements:
Permissions:
================================================================================
Download the getlog.bat file to a convenient location: C:\Tools\PCDU\getlog.bat
Option A - PuTTY (Recommended):
Option B - OpenSSH:
Open Command Prompt and run: pscp.exe
OR
scp
You should see usage information (not "command not found").
================================================================================
Double-click getlog.bat or run from command prompt:
getlog.bat
You'll be prompted for:
Syntax: getlog.bat [CASE_NUMBER] [USERNAME] [PASSWORD]
Examples:
Interactive mode:
getlog.bat
Case number only (prompts for credentials):
getlog.bat 909801482
Case + Username (prompts for password):
getlog.bat 909801482 john.doe
Fully automated (for scripts):
getlog.bat 909801482 john.doe MyP@ssw0rd
================================================================================
Edit these variables in getlog.bat if needed:
Line ~45:
set "REMOTE_SERVER=myanalysis.web.server.local"
Line ~46:
set "REMOTE_BASE_PATH=/upload/logs/cases"
Default download location: %USERPROFILE%\Downloads\SJLNT<CASE_NUMBER>
To change, edit line ~75: set "DEST=%USERPROFILE%\Downloads\SJLNT\%CASENO%"
Example custom location: set "DEST=D:\CaseFiles\%CASENO%"
To add/remove file types, edit the find command around line ~185:
Current filters: *.cap, *.pcap, *.pcapng - Packet captures *.sslkeys, *.keys - SSL key files *.har - HTTP Archive files *.xml - XML files *.jpg, *.jpeg, *.png, etc. - Image files *.txt, *.log, *.csv - Text/log files *.json - JSON files
================================================================================
After download, files are organized as follows:
%USERPROFILE%\Downloads\SJLNT<CASE_NUMBER>\ │ ├── configs\ │ ├── ns.conf_collector_P192.168.10.195_ │ ├── ns.conf_collector_S192.168.10.196_ │ ├── ns_running_config.conf_collectorP_ │ └── ns_running_config.conf_collectorS_ │ ├── captures\ │ ├── nstrace.cap │ ├── nstrace.pcap │ ├── traffic.sslkeys │ └── browser_session.har │ ├── media\ │ ├── error_screenshot.png │ ├── config_page.jpg │ └── network_diagram.png │ ├── config.xml ├── casenotes.txt ├── troubleshooting.log └── download.log
Configuration files from collector bundles are suffixed with collector name to prevent conflicts:
Original: ns.conf Downloaded as: ns.confcollector
This allows you to distinguish between Primary and Secondary configs when
multiple collector bundles exist. Each case download generates a log file:
download_.log
Contains: ================================================================================ ISSUE: "pscp.exe not found" or "scp not found"
SOLUTION: ISSUE: "SSH connection failed"
SOLUTION: ISSUE: "Case directory not found"
SOLUTION: ISSUE: "No collector bundles found"
SOLUTION: ISSUE: Files downloading slowly
SOLUTION: ISSUE: "Unable to identify Keyboard-interactive authentication prompts"
SOLUTION: ISSUE: Download incomplete
SOLUTION: ISSUE: Password prompt not working
SOLUTION: ================================================================================ Q: Is it safe to run the script multiple times on the same case?
A: Yes. The script will overwrite existing files. Useful for resuming
interrupted downloads. Q: Can I automate this for multiple cases?
A: Yes. Create a wrapper script: Q: Does it download the entire collector bundle?
A: No. It selectively downloads only ns.conf and running config from inside
bundles. Other files come from case root only. Q: What about support.tgz files?
A: These are intentionally excluded to save time and bandwidth. Q: Can I change the destination folder?
A: Yes. Edit the DEST variable (see Section 6). Q: Does this work with SFTP servers?
A: No. Currently supports SCP/SSH only. SFTP support may be added in future. Q: Will this work on Linux or Mac?
A: No. This is a Windows batch script. However, the logic can be adapted to
bash scripts for Unix-like systems. Q: How do I update PCDU?
A: Download the latest getlog.bat and replace the old file. Q: Is password stored anywhere?
A: No. Password is stored only in memory during script execution and is not
logged or saved to disk. Q: Can I use SSH keys instead of password?
A: Yes, if using OpenSSH. Configure SSH keys in ~/.ssh/ and remove password
prompts from script. Q: What if I have multiple collector bundles (Primary/Secondary)?
A: Script downloads configs from all collectors found and names them
accordingly. ================================================================================ [+] Initial release
[+] Auto-discovery of collector bundles
[+] Selective config download from collectors
[+] Case root file download (captures, media, logs)
[+] Organized directory structure
[+] Comprehensive logging
[+] Dual SCP support (PuTTY/OpenSSH)
[+] Performance optimization (single SSH scan)
[+] Keyboard-interactive message filtering
[+] Progress indicators and summary
[+] ASCII art branding [ ] Multi-case batch processing
[ ] Resume capability for interrupted downloads
[ ] SSH key authentication support
[ ] Custom file type filters via config file
[ ] Download only specific file types (flags)
[ ] Compression of downloaded files
[ ] Email notification on completion
[ ] GUI version
[ ] Linux/Mac bash script version
[ ] Progress bars for large files
[ ] Bandwidth limiting option ================================================================================ Developed by: Parv
Version: 1.0
Date: February 2026 This tool is provided "as-is" without warranty of any kind. You are free to: Please: This tool is designed for authorized use only. Ensure you have proper
authorization before connecting to remote servers and downloading case files. The author is not responsible for: Special thanks to: ================================================================================ Thank you for using Parv's Case Download Utility (PCDU)! ================================================================================DOWNLOAD LOG
FOR %%C IN (909801482 101801843 101801844) DO (
getlog.bat %%C username password
)
v1.0 - February 2026
PLANNED FEATURES (Future Versions)
AUTHOR
LICENSE
DISCLAIMER
ACKNOWLEDGMENTS