blob: f95157dee4c31af793621e797759004702396364 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# System dump script
Dump various system informations into base64 encoded values and print them as json.
# Usage
Run a dump:
> ./sysdump.sh > dump.json
Run a dump on a remote machine using ssh:
> cat sysdump.sh | ssh user@host /bin/bash > dump.json
To explore a dump (require `jq`), see help as follow:
> ./sysdump.sh -h
# Useful entries
Important note: Depending on the system, some entries may not be available.
| Entry | Description |
|--------------------------|------------------------------------------------------------------|
| compgen | List all available commands in current shell |
| ping | Check if ping succeed (internet is available) |
| boot_folder | Recursive listing of /boot/ |
| root_folder | Content of / |
| home_folder | Content of $HOME |
| cmd_\<command\>_version | Get the version of some specific commands (e.g: gcc, python etc) |
| /proc/cmdline | See kernel parameters |
| /boot/config-$(uname -r) | Get kernel config |
| users | List logged users |
| declare | Get all shell defined variables, functions etc |
# Notes
- Some commands require root permissions.
If `sysdump.sh` is not run as root, these commands will not be executed and the entries
will not be reported in the dump file.
|