SSHDIG(1)   SSHDIG(1)

sshdig - فراهم کردن رابط‌هایی برای ضبط فراخوان‌های سیستمی از یک میزبان راه‌دور از طریق SSH با استفاده از باینری ضبط راه‌دور

sshdig [ --help ] [ --version ] [ --extcap-interfaces ] [ --extcap-dlts ] [ --extcap-interface=<interface> ] [ --extcap-config ] [ --extcap-capture-filter=<capture filter> ] [ --capture ] [ --fifo=<path to file or pipe> ] [ --remote-host=<IP address> ] [ --remote-port=<TCP port> ] [ --remote-username=<username> ] [ --remote-password=<password> ] [ --sshkey=<private key path> ] [ --sshkey-passphrase=<private key passphrase> ] [ --proxycommand=<SSH proxy command> ] [ --remote-capture-command-select=<capture command selection> ] [ --remote-capture-command=<capture command> ] [ --remote-priv=<privilege elevation command selection> ] [ --remote-priv-user=<privileged user name> ] [ --remote-filter=<remote capture filter> ] [ --remote-count=<number> ] [ --remote-modern-bpf ] [ --remote-io-snaplen=<snapshot length> ]

sshdig --extcap-interfaces

sshdig --extcap-interface=<interface> --extcap-dlts

sshdig --extcap-interface=<interface> --extcap-config

sshdig --extcap-interface=<interface> --fifo=<path to file or pipe> --capture --remote-host=myremotehost --remote-port=22 --remote-username=user --remote-capture-command='sysdig --unbuffered --write=-'

ابزار Sshdig یک ابزار extcap است که امکان ضبط فراخوان‌های سیستمی (system calls) را از طریق اتصال SSH فراهم می‌کند. شما باید مجوزهای لازم برای ضبط فراخوان‌های سیستمی در سیستم راه‌دور را داشته باشید.

این قابلیت از نظر عملکردی معادل دستورهای زیر است:

$ ssh remoteuser@remotehost -p 22222 'sysdig --unbuffered -w -' > FILE &
$ stratoshark FILE

معمولاً sshdig به‌طور مستقیم اجرا نمی‌شود؛ در عوض می‌توان آن را از طریق رابط گرافیکی کاربر Stratoshark یا خط فرمان آن پیکربندی کرد. دستور زیر Stratoshark را اجرا کرده و ضبط را از میزبان remotehost آغاز می‌کند:

$ stratoshark '-oextcap.sshdig.remotehost:myserver.home.arpa' -i sshdig -k

رابط‌های پشتیبانی‌شده:

1.sshdig

--help

نمایش آرگومان‌های برنامه.

--version

نمایش نسخه برنامه.

--extcap-interfaces

فهرست کردن رابط‌های موجود.

--extcap-interface=<interface>

استفاده از رابط‌های مشخص‌شده.

--extcap-dlts

فهرست کردن DLTهای رابط مشخص‌شده.

--extcap-config

فهرست کردن گزینه‌های پیکربندی رابط مشخص‌شده.

--extcap-capture-filter=<capture filter>;

فیلتر ضبط. این مقدار متناظر با مقداری است که از طریق گزینه tshark -f و فیلد Capture Filter در کنار فهرست رابط‌ها در رابط کاربری Stratoshark ارائه می‌شود.

--capture

آغاز ضبط از رابط مشخص‌شده و نوشتن داده‌های خام بسته در مکانی که توسط --fifo مشخص شده است.

--fifo=<path to file or pipe>;

ذخیره بسته ضبط‌شده در فایل یا ارسال آن از طریق لوله (pipe).

--remote-host=<remote host>;

نشانی میزبان راه‌دور برای ضبط.

--remote-port=<remote port>;

درگاه SSH میزبان راه‌دور.

--remote-username=<username>

نام کاربری برای احراز هویت SSH.

--remote-password=<password>

گذرواژه مورد استفاده (در صورتی که از ssh-agent و کلید عمومی استفاده نشود). هشدار: گذرواژه‌ها به صورت متن ساده (plaintext) ذخیره می‌شوند و برای تمام کاربران این سیستم قابل مشاهده هستند. توصیه می‌شود از فایل‌های کلید به همراه یک SSH agent استفاده شود.

--sshkey=<SSH private key path>;

مسیر کلید خصوصی برای احراز هویت. نکته: تنها قالب جفت کلید/مقدار OPENSSH پشتیبانی می‌شود.

--sshkey-passphrase=<SSH private key passphrase>;

عبارت عبور کلید خصوصی برای احراز هویت.

--proxycommand=<proxy command>;

دستوری که به عنوان پراکسی برای اتصال SSH استفاده می‌شود.

--remote-capture-command-select=<capture command-selection>

دستوری که باید در سیستم راه‌دور اجرا شود. این مقدار یا sysdig برای دستور ضبط راه‌دور با استفاده از sysdig است، یا other، که در آن دستور ضبط راه‌دور باید با گزینه --remote-capture-command ارائه شود.

--remote-capture-command=<capture command>;

یک دستور سفارشی ضبط راه‌دور که جریان راه‌دوری را تولید می‌کند که در Stratoshark نشان داده می‌شود. این دستور باید قادر به تولید یک جریان .scap باشد که در STDOUT نوشته می‌شود.

--remote-priv=<privilege elevation command selection>;

دستوری که برای ارتقای سطح دسترسی جهت ضبط در میزبان راه‌دور استفاده می‌شود. یکی از مقادیر none، sudo یا doas.

--remote-priv-user=<privileged user name>;

اگر دستوری که برای ارتقای سطح دسترسی جهت ضبط در میزبان راه‌دور به کار می‌رود نیاز به نام کاربری داشته باشد، می‌توان آن را در اینجا مشخص کرد.

--remote-filter=<capture filter>;

فیلتر ضبط راه‌دور. این فیلتر به برنامه ضبط راه‌دور ارسال می‌شود و باید با قواعد دستوری (syntax) آن مطابقت داشته باشد.

--remote-count=<number>

تعداد رویدادها برای ضبط.

--remote-modern-bpf

ضبط با استفاده از کاوشگر eBPF به جای ماژول هسته.

--remote-io-snaplen=<snapshot length>;

تعداد بایت‌ها برای ضبط در هر رویداد ورودی/خروجی (I/O).

برای مشاهده آرگومان‌های برنامه:

sshdig --help

برای مشاهده نسخه برنامه:

sshdig --version

برای مشاهده رابط‌ها:

sshdig --extcap-interfaces

تنها یک رابط (sshdig) پشتیبانی می‌شود.

خروجی نمونه

interface {value=sshdig}{display=SSH remote syscall capture}

برای مشاهده DLTهای رابط:

sshdig --extcap-interface=sshdig --extcap-dlts

خروجی نمونه

dlt {number=147}{name=sshdig}{display=Remote capture dependent DLT}

برای مشاهده گزینه‌های پیکربندی رابط:

sshdig --extcap-interface=sshdig --extcap-config

خروجی نمونه

arg {number=0}{call=--remote-host}{display=Remote SSH server address}{type=string}{tooltip=The remote SSH host. It can be both an IP address or a hostname}{required=true}{group=Server}
arg {number=1}{call=--remote-port}{display=Remote SSH server port}{type=unsigned}{default=22}{tooltip=The remote SSH host port (1-65535)}{range=1,65535}{group=Server}
arg {number=2}{call=--remote-username}{display=Remote SSH server username}{type=string}{tooltip=The remote SSH username. If not provided, the current user will be used}{group=Authentication}
arg {number=3}{call=--remote-password}{display=Remote SSH server password}{type=password}{tooltip=The SSH password, used when other methods (SSH agent or key files) are unavailable.}{group=Authentication}
arg {number=4}{call=--sshkey}{display=Path to SSH private key}{type=fileselect}{tooltip=The path on the local filesystem of the private SSH key (OpenSSH format)}{mustexist=true}{group=Authentication}
arg {number=5}{call=--sshkey-passphrase}{display=SSH key passphrase}{type=password}{tooltip=Passphrase to unlock the SSH private key}{group=Authentication}
arg {number=6}{call=--proxycommand}{display=ProxyCommand}{type=string}{tooltip=The command to use as proxy for the SSH connection}{group=Authentication}
arg {number=7}{call=--ssh-sha1}{display=Support SHA-1 keys (deprecated)}{type=boolflag}{tooltip=Support keys and key exchange algorithms using SHA-1 (deprecated)}{group=Authentication}
arg {number=8}{call=--remote-capture-command-select}{display=Remote capture command selection}{type=radio}{tooltip=The remote capture command to build a command line for}{group=Capture}
value {arg=8}{value=sysdig}{display=sysdig}
value {arg=8}{value=other}{display=Other:}
arg {number=9}{call=--remote-capture-command}{display=Remote capture command}{type=string}{tooltip=The remote command used to capture}{group=Capture}
arg {number=10}{call=--remote-priv}{display=Gain capture privilege on the remote machine}{type=radio}{tooltip=Optionally prepend the capture command with sudo or doas on the remote machine}{group=Capture}
value {arg=10}{value=none}{display=none}{default=true}
value {arg=10}{value=sudo}{display=sudo}
value {arg=10}{value=doas -n}{display=doas}
arg {number=11}{call=--remote-priv-user}{display=Privileged user name for sudo or doas}{type=string}{tooltip=User name of privileged user to execute the capture command on the remote machine}{group=Capture}
{group=Capture}
arg {number=12}{call=--remote-count}{display=Packets to capture}{type=unsigned}{default=0}{tooltip=The number of remote packets to capture. (Default: inf)}{group=Capture}
arg {number=13}{call=--log-level}{display=Set the log level}{type=selector}{tooltip=Set the log level}{required=false}{group=Debug}
value {arg=13}{value=message}{display=Message}{default=true}
value {arg=13}{value=info}{display=Info}
value {arg=13}{value=debug}{display=Debug}
value {arg=13}{value=noisy}{display=Noisy}
arg {number=14}{call=--log-file}{display=Use a file for logging}{type=fileselect}{tooltip=Set a file where log messages are written}{required=false}{group=Debug}

برای ضبط:

sshdig --extcap-interface=sshdig --fifo=/tmp/ssh.scap --capture --remote-host 192.168.1.10
--remote-username user

نکته

برای اطمینان از خاتمه تمیز فرآیند، باید از CTRL + C برای متوقف کردن ضبط استفاده شود.

فایل باینری sshdig را می‌توان برای پشتیبانی از چندین نمونه تغییر نام داد. برای مثال اگر بخواهیم sshdig دو بار در Stratoshark نمایش داده شود (مثلاً برای مدیریت چندین نمایه)، می‌توانیم sshdig را به sshdig-host1 و sshdig-host2 کپی کنیم. هر فایل باینری نام رابطی یکسان با نام فایل اجرایی را نشان خواهد داد. فایل‌های اجرایی که «sshdig» نباشند، در توضیحات منبع ضبط به‌عنوان «custom version» نمایش داده خواهند شد..SH "همچنین ببینید (SEE ALSO)"

stratoshark(1), strato(1), dumpcap(1), extcap(4)

Sshdig بخشی از توزیع Stratoshark است. آخرین نسخه از Stratoshark را می‌توان در این نشانی یافت: https://www.wireshark.org.

نسخه‌های HTML صفحات راهنمای پروژهٔ Stratoshark در این نشانی در دسترس هستند: https://www.wireshark.org/docs/man-pages.

نویسنده اصلی
Dario Lombardo <lomato[AT]gmail.com>

2026-09-03