| @@ -28,8 +28,8 @@ Usage: cpanel-ftp-audit.sh [-v] <cpanel_username> | |||
| 28 | 28 | -v verbose: show all failed attempts and transfers, plus raw FTP log lines | |
| 29 | 29 | ||
| 30 | 30 | Examples: | |
| 31 | - | curl -fsSL https://YOUR-HOST/cpanel-ftp-audit.sh | bash -s -- dafaeeaa | |
| 32 | - | bash <(curl -fsSL https://YOUR-HOST/cpanel-ftp-audit.sh) -v dafaeeaa | |
| 31 | + | curl -fsSL https://gist.veru.se/Veruse/cpanel-ftp-audit/raw/HEAD/cpanel-ftp-audit.sh | bash -s -- dafaeeaa | |
| 32 | + | bash <(curl -fsSL https://gist.veru.se/Veruse/cpanel-ftp-audit/raw/HEAD/cpanel-ftp-audit.sh) -v dafaeeaa | |
| 33 | 33 | EOF | |
| 34 | 34 | } | |
| 35 | 35 | ||
Veruse / cPanel FTP Audit
Last active 1 hour ago
bash <(curl -fsSL https://gist.veru.se/Veruse/cpanel-ftp-audit/raw/HEAD/cpanel-ftp-audit.sh)
Veruse revised this gist 1 hour ago · 9dfbd12
1 file changed, 2 insertions, 2 deletions
Veruse revised this gist 1 hour ago · f7fa80d
1 file changed, 5 insertions, 9 deletions
| @@ -8,15 +8,15 @@ | |||
| 8 | 8 | # | |
| 9 | 9 | # Usage (as root): | |
| 10 | 10 | # bash cpanel-ftp-audit.sh [-v] [cpanel_username] | |
| 11 | - | # curl -fsSL https://YOUR-HOST/cpanel-ftp-audit.sh | bash -s -- [-v] cpanel_username | |
| 12 | - | # bash <(curl -fsSL https://YOUR-HOST/cpanel-ftp-audit.sh) # prompts for username | |
| 11 | + | # curl -fsSL https://gist.veru.se/Veruse/cpanel-ftp-audit/raw/HEAD/cpanel-ftp-audit.sh | bash -s -- [-v] cpanel_username | |
| 12 | + | # bash <(curl -fsSL https://gist.veru.se/Veruse/cpanel-ftp-audit/raw/HEAD/cpanel-ftp-audit.sh) # prompts for username | |
| 13 | 13 | # | |
| 14 | 14 | # -v verbose: list every failed attempt and every transfer (not just the | |
| 15 | 15 | # top/latest 50), plus every raw FTP log line for the account | |
| 16 | 16 | # (uploads, deletes, logouts, timeouts...) | |
| 17 | 17 | # | |
| 18 | - | # Read-only: changes nothing on the server. A copy of the report is saved to | |
| 19 | - | # /root/ftp-audit-<user>-<timestamp>.txt | |
| 18 | + | # Read-only: changes nothing on the server and writes no report file (only a | |
| 19 | + | # temporary working directory, which is removed when the script exits). | |
| 20 | 20 | # | |
| 21 | 21 | # Everything is inside functions and only runs on the last line, so it is safe | |
| 22 | 22 | # to pipe from curl straight into bash. | |
| @@ -279,11 +279,7 @@ main() { | |||
| 279 | 279 | }' \ | |
| 280 | 280 | | sort -u | cut -f2- > "$TMP/xfer.tsv" | |
| 281 | 281 | ||
| 282 | - | umask 077 | |
| 283 | - | REPORT="/root/ftp-audit-${CPUSER}-$(date +%Y%m%d-%H%M%S).txt" | |
| 284 | - | report | tee "$REPORT" | |
| 285 | - | echo | |
| 286 | - | echo "Report saved to $REPORT" >&2 | |
| 282 | + | report | |
| 287 | 283 | } | |
| 288 | 284 | ||
| 289 | 285 | main "$@" | |
Veruse revised this gist 2 hours ago · 6ebfa23
1 file changed, 289 insertions
Diff is too large to be shown