# Man of procfs [TOC] # `/proc/uptime` システムのuptimeを表示する. # `/proc/diskstats` ディスクデバイスのIOの統計情報を表示する. https://www.kernel.org/doc/Documentation/iostats.txt このファイルが表示するフォーマットはカーネルのバージョンによりいくつかの変種が存在する. + 2.4 ``` 3 0 39082680 hda 446216 784926 9550688 4382310 424847 312726 5922052 19310380 0 3376340 23705160 3 1 9221278 hda1 35486 0 35496 38030 0 0 0 0 0 38030 38030 ``` + 2.6以降 2.6+ diskstats: ``` 3 0 hda 446216 784926 9550688 4382310 424847 312726 5922052 19310380 0 3376340 23705160 3 1 hda1 35486 38030 38030 38030 ``` + 4.18以降 ``` 3 0 hda 446216 784926 9550688 4382310 424847 312726 5922052 19310380 0 3376340 23705160 0 0 0 0 ``` 各フィールドの意味は以下の通り. | フィールド | 意味 | | -------------------- | ---- | | 1 | ディスクデバイスのメジャー番号 | | 2 | ディスクデバイスのマイナー番号 | | 3 | ディスクからの読み出しが成功した総回数.| | 4 | Reads and writes which are adjacent to each other may be merged for efficiency. Thus two 4K reads may become one 8K read before it is ultimately handed to the disk, and so it will be counted (and queued) as only one I/O. This field lets you know how often this was done. | | 5 | 読み出しに成功したセクタ数. | | 6 | 読み出しにかかった時間(ミリ秒)の合計. (`from __make_request()`関数から`end_that_request_last()`までの時間で測定). | | 7 | ディスクへの書き込みが成功した総回数. | | 8 | See the description of field 2 | | 9 | 書き込みに成功したセクタの数 | | 10 | 書き込みにかかった時間(ミリ秒)の合計(`from __make_request()`関数から`end_that_request_last()`までの時間で測定) | | 11 | of I/Os currently in progress. The only field that should go to zero. Incremented as requests are given to appropriate struct request_queue and decremented as they finish. | 12 | I/Oにかかった時間(ミリ秒) | | 13 | weighted # of milliseconds spent doing I/Os. This field is incremented at each I/O start, I/O completion, I/O merge, or read of these stats by the number of I/Os in progress (field 9) times the number of milliseconds spent doing I/O since the last update of this field. This can provide an easy measure of both I/O completion time and the backlog that may be accumulating. | | 14 | | 15 | discardした回数 | 16 | | 17 | | 15 | | Field 13 -- # of discards merged See the description of field 2 Field 16 -- # of sectors discarded This is the total number of sectors discarded successfully. Field 15 -- # of milliseconds spent discarding This is the total number of milliseconds spent by all discards (as measured from __make_request() to end_that_request_last()). `sar`/`iostat`コマンドがこの情報を利用している. `awk`でパースするエイリアスを書いておいた. # `/proc/partitions` + 2.6以降の`sysfs` ``` 446216 784926 9550688 4382310 424847 312726 5922052 19310380 0 3376340 23705160 35486 38030 38030 38030 ``` # `/proc/kallsyms` 稼働しているカーネルのシンボルを表示する. # `/proc/kcore` システムの物理メモリをELFコアファイル形式で表現したファイル. ```shell! root@Ubu2204x64:now# cat /proc/kcore | hexdump -C | head -n20 00000000 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 |.ELF............| 00000010 04 00 3e 00 01 00 00 00 00 00 00 00 00 00 00 00 |..>.............| 00000020 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |@...............| ``` `/proc/kcore`と,非`stripped`なカーネルのバイナリ(vmlinux)があれば, デバッガはカーネル内の任意のデータ構造の現在の状態を調べられる. このファイルの大きさは物理メモリー (RAM) のサイズに 4KB を加えた値である。 # `/proc/modules` システムがロードしているカーネルモジュールについての情報が表示される. ::: spoiler Ubunut22.04での例 ```shell! root@Ubu2204x64:my_ctf_tools# cat /proc/modules xt_nat 16384 0 - Live 0xffffffffc0bc4000 xt_tcpudp 20480 0 - Live 0xffffffffc0baf000 veth 32768 0 - Live 0xffffffffc0bbb000 isofs 53248 2 - Live 0xffffffffc0b9f000 cpuid 16384 0 - Live 0xffffffffc0a84000 tls 118784 0 - Live 0xffffffffc0b7f000 xt_conntrack 16384 8 - Live 0xffffffffc0a7f000 nft_chain_nat 16384 3 - Live 0xffffffffc0a6e000 xt_MASQUERADE 20480 8 - Live 0xffffffffc0b75000 nf_nat 49152 3 xt_nat,nft_chain_nat,xt_MASQUERADE, Live 0xffffffffc0b58000 nf_conntrack_netlink 53248 0 - Live 0xffffffffc0b67000 nf_conntrack 176128 5 xt_nat,xt_conntrack,xt_MASQUERADE,nf_nat,nf_conntrack_netlink, Live 0xffffffffc0b2c000 nf_defrag_ipv6 24576 1 nf_conntrack, Live 0xffffffffc0a78000 nf_defrag_ipv4 16384 1 nf_conntrack, Live 0xffffffffc0a73000 xfrm_user 45056 1 - Live 0xffffffffc0a62000 xfrm_algo 16384 1 xfrm_user, Live 0xffffffffc0a5a000 xt_addrtype 16384 2 - Live 0xffffffffc0a55000 nft_compat 20480 18 - Live 0xffffffffc0986000 nf_tables 278528 330 nft_chain_nat,nft_compat, Live 0xffffffffc0ae7000 libcrc32c 16384 3 nf_nat,nf_conntrack,nf_tables, Live 0xffffffffc09c7000 nfnetlink 20480 4 nf_conntrack_netlink,nft_compat,nf_tables, Live 0xffffffffc0a43000 br_netfilter 32768 0 - Live 0xffffffffc09f8000 bridge 331776 1 br_netfilter, Live 0xffffffffc0a95000 stp 16384 1 bridge, Live 0xffffffffc0994000 llc 16384 2 bridge,stp, Live 0xffffffffc0981000 overlay 163840 0 - Live 0xffffffffc0a1a000 bnep 28672 2 - Live 0xffffffffc0803000 vsock_loopback 16384 0 - Live 0xffffffffc097c000 vmw_vsock_virtio_transport_common 45056 1 vsock_loopback, Live 0xffffffffc0a89000 intel_rapl_msr 20480 0 - Live 0xffffffffc0967000 vmw_vsock_vmci_transport 32768 2 - Live 0xffffffffc0a4c000 intel_rapl_common 40960 1 intel_rapl_msr, Live 0xffffffffc0a0f000 vsock 49152 7 vsock_loopback,vmw_vsock_virtio_transport_common,vmw_vsock_vmci_transport, Live 0xffffffffc0a02000 snd_ens1371 28672 2 - Live 0xffffffffc07e7000 kvm_amd 167936 0 - Live 0xffffffffc099d000 snd_ac97_codec 176128 1 snd_ens1371, Live 0xffffffffc09cc000 vmw_balloon 28672 0 - Live 0xffffffffc098c000 gameport 24576 1 snd_ens1371, Live 0xffffffffc0960000 ccp 110592 1 kvm_amd, Live 0xffffffffc07cb000 ac97_bus 16384 1 snd_ac97_codec, Live 0xffffffffc07c6000 binfmt_misc 24576 1 - Live 0xffffffffc07bf000 kvm 1138688 1 kvm_amd, Live 0xffffffffc0849000 crct10dif_pclmul 16384 1 - Live 0xffffffffc07f1000 snd_pcm 159744 2 snd_ens1371,snd_ac97_codec, Live 0xffffffffc0821000 snd_seq_midi 20480 0 - Live 0xffffffffc0720000 ghash_clmulni_intel 16384 0 - Live 0xffffffffc0740000 snd_seq_midi_event 16384 1 snd_seq_midi, Live 0xffffffffc075a000 aesni_intel 376832 0 - Live 0xffffffffc0762000 crypto_simd 16384 1 aesni_intel, Live 0xffffffffc074a000 nls_iso8859_1 16384 1 - Live 0xffffffffc0745000 joydev 32768 0 - Live 0xffffffffc0751000 cryptd 24576 2 ghash_clmulni_intel,crypto_simd, Live 0xffffffffc0704000 input_leds 16384 0 - Live 0xffffffffc0726000 snd_rawmidi 45056 2 snd_ens1371,snd_seq_midi, Live 0xffffffffc0612000 serio_raw 20480 0 - Live 0xffffffffc0574000 btusb 61440 0 - Live 0xffffffffc0730000 btrtl 24576 1 btusb, Live 0xffffffffc070b000 btbcm 24576 1 btusb, Live 0xffffffffc06fd000 snd_seq 77824 2 snd_seq_midi,snd_seq_midi_event, Live 0xffffffffc06e9000 snd_seq_device 16384 3 snd_seq_midi,snd_rawmidi,snd_seq, Live 0xffffffffc072b000 btintel 40960 1 btusb, Live 0xffffffffc0715000 btmtk 16384 1 btusb, Live 0xffffffffc081c000 snd_timer 40960 2 snd_pcm,snd_seq, Live 0xffffffffc080c000 bluetooth 827392 13 bnep,btusb,btrtl,btbcm,btintel,btmtk, Live 0xffffffffc061e000 snd 114688 11 snd_ens1371,snd_ac97_codec,snd_pcm,snd_rawmidi,snd_seq,snd_seq_device,snd_timer, Live 0xffffffffc05f5000 ecdh_generic 16384 1 bluetooth, Live 0xffffffffc05f0000 ecc 40960 1 ecdh_generic, Live 0xffffffffc05e2000 soundcore 16384 1 snd, Live 0xffffffffc05d9000 vmw_vmci 90112 2 vmw_vsock_vmci_transport,vmw_balloon, Live 0xffffffffc0480000 mac_hid 16384 0 - Live 0xffffffffc047b000 sch_fq_codel 24576 2 - Live 0xffffffffc046f000 vmwgfx 372736 6 - Live 0xffffffffc057d000 drm_ttm_helper 16384 1 vmwgfx, Live 0xffffffffc0438000 ttm 98304 2 vmwgfx,drm_ttm_helper, Live 0xffffffffc055b000 drm_kms_helper 200704 1 vmwgfx, Live 0xffffffffc0529000 fb_sys_fops 16384 1 drm_kms_helper, Live 0xffffffffc0433000 syscopyarea 16384 1 drm_kms_helper, Live 0xffffffffc0420000 sysfillrect 20480 1 drm_kms_helper, Live 0xffffffffc042d000 sysimgblt 20480 1 drm_kms_helper, Live 0xffffffffc0427000 ipmi_devintf 20480 0 - Live 0xffffffffc0320000 ipmi_msghandler 77824 1 ipmi_devintf, Live 0xffffffffc040c000 msr 16384 0 - Live 0xffffffffc0476000 parport_pc 53248 0 - Live 0xffffffffc0461000 ppdev 24576 0 - Live 0xffffffffc0405000 ramoops 32768 0 - Live 0xffffffffc0458000 lp 28672 0 - Live 0xffffffffc0450000 reed_solomon 28672 1 ramoops, Live 0xffffffffc02d7000 parport 73728 3 parport_pc,ppdev,lp, Live 0xffffffffc043d000 drm 581632 10 vmwgfx,drm_ttm_helper,ttm,drm_kms_helper, Live 0xffffffffc049a000 pstore_blk 16384 0 - Live 0xffffffffc0362000 pstore_zone 32768 1 pstore_blk, Live 0xffffffffc03fc000 efi_pstore 16384 0 - Live 0xffffffffc0310000 ip_tables 32768 0 - Live 0xffffffffc03c7000 x_tables 57344 7 xt_nat,xt_tcpudp,xt_conntrack,xt_MASQUERADE,xt_addrtype,nft_compat,ip_tables, Live 0xffffffffc03ed000 autofs4 45056 2 - Live 0xffffffffc03e1000 hid_generic 16384 0 - Live 0xffffffffc034e000 usbhid 65536 0 - Live 0xffffffffc03d0000 hid 159744 2 hid_generic,usbhid, Live 0xffffffffc039f000 crc32_pclmul 16384 0 - Live 0xffffffffc02df000 psmouse 180224 0 - Live 0xffffffffc0372000 mptspi 24576 2 - Live 0xffffffffc0367000 mptscsih 49152 1 mptspi, Live 0xffffffffc0355000 mptbase 106496 2 mptspi,mptscsih, Live 0xffffffffc0333000 ahci 49152 2 - Live 0xffffffffc0326000 scsi_transport_spi 32768 1 mptspi, Live 0xffffffffc0317000 e1000 159744 0 - Live 0xffffffffc02e4000 libahci 49152 1 ahci, Live 0xffffffffc02ac000 i2c_piix4 32768 0 - Live 0xffffffffc029f000 pata_acpi 16384 0 - Live 0xffffffffc0297000 floppy 118784 0 - Live 0xffffffffc02b9000 root@Ubu2204x64:my_ctf_tools# ``` ::: # `/proc/self/cwd` そのプロセスが動いているカレントディレクトリ. **扱った問題** + Read me @seccon beginners 2020 + https://qiita.com/deko2369/items/5a648a6aa8ff0eef1833#readme # `/proc/[pid]/environ` そのプロセスが利用している環境変数を表示する. **扱った問題** + Util Ironhand@seccon beginners CTF 2022 (Web) + https://hi120ki.github.io/blog/posts/20220605-2/ # `/proc/[pid]/maps` メモリマップを表示する. https://pwn3r.tistory.com/entry/33C3-CTF-tea # `/proc/[pid]/mem` そのプロセスのメモリを直接読み書き化. `Writable`な領域ではないメモリ領域にも値を書き込むことができる. :::success ただしseekする必要あり. ::: **扱った問題** + Write me@seccon beginners 2021(Misc) + https://qiita.com/satoki/items/36837fce2fff7a584947#misc-writeme # `/proc/[pid]/wchan` https://qiita.com/SIGABRT/items/b4c9b9f513600a24a689 抜粋すると, :::info プロセスやスレッドがカーネル内で待ちに入る時は, schedule()という関数を呼び出す. プロセススケジューラが呼び出され、他の走行可能なタスクが一つ選択されてタスク切り替えが行われる (または、走行可能なタスクがない場合はCPUが止まる)。mutex待ち、セマフォ待ちなどを行う時も、mutex_lock()やdown()などの先で、schedule()が呼ばれる。 ::: 待機状態のプロセスorスレッドが, 止まっているカーネルの関数名が入る. 待機していない場合は`0`が入る. 例えば`ps`コマンドでは, 各プロセスやスレッドのWCHANを表示することができる. ![](https://drive.google.com/uc?export=view&id=1HbA7bNj_yOpHzFQM9ccAD5yhozA8NeAW) **扱った問題** + [NetFS@zer0pts CTF 2023(Misc)](https://hackmd.io/@1u991yuz4k1/rk4Db8Sqh) # `/proc/[pid]/stack` プロセスのカーネルスタックのダンプを出力する. 2.6.29以降のカーネルで`CONFIG_STACKTRACE`が有効でビルドされている場合に使用できる. また, 通常非rootユーザは, 権限が落とされていて見ることができない. > `Permission Denied`でRead不可. ```shell! root@Ubu2204x64:now# cat /proc/self/stack [<0>] proc_pid_stack+0xbe/0x140 [<0>] proc_single_show+0x56/0xe0 [<0>] seq_read_iter+0x135/0x4c0 [<0>] seq_read+0xe0/0x120 [<0>] vfs_read+0x9f/0x1b0 [<0>] ksys_read+0x67/0xf0 [<0>] __x64_sys_read+0x19/0x30 [<0>] do_syscall_64+0x5c/0x90 [<0>] entry_SYSCALL_64_after_hwframe+0x63/0xcd root@Ubu2204x64:now# ``` # `/proc/[pid]/syscall` 2.6.27以降のカーネルで, `CONFIG_HAVE_ARCH_TRACEHOK`が有効な場合に使用できる. プロセスによって今実行されているシステムコールのシステムコール番号とその引数(レジスタの値)を出力する. This file exposes the system call number and argument registers for the system call currently being executed by the process, followed by the values of the stack pointer and program counter registers. The values of all six argument registers are exposed, although most system calls use fewer registers. もしプロセスがシステムコール以外でブロックされている場合, このファイルはシステムコール番号の位置(1番目の値)に`-1`を表示する. **扱った問題** + Treasure@seccon4b ctf 2023 (Misc) # `/proc/[pid]/cwd` そのプロセスのカレントディレクトリを表示する. **扱った問題** + readme@seccon 4b CTF (Misc) # `/proc/[pid]/root` プロセスのルートディレクトリを指すシンボリックリンク. > Unix系OSでは, `chroot`を利用することで, プロセスごとに指定することができる. **扱った問題** + WeCTF 2022 Request-Bin(Web) + https://github.com/wectf/2022#request-bin + https://gist.github.com/arkark/51e6dee1c548616ed35ac64fbe006fc1 # `/proc/[pid]/stat` **扱った問題** + mailman@1337UP LIVE CTF 2022 (Cloud/Kubernetes) + https://github.com/pymivn/ctf/blob/main/2022-1337UP-LIVE-CTF/mailman.md # `/proc/[pid]/statm` ページ単位のメモリ使用量. ```shell! root@Ubu2204x64:now# cat /proc/self/statm # 左から # size: プログラムサイズの合計 # resident: メモリ使用率 # share: 共有ページ(ファイルと関連付けられているページ) # text: コード領域の使用ページ # lib: ライブラリ領域の使用ページ # data: BSS/(RO)DATA/Stackの使用ページ # dt: ダーティページ 4553 256 234 4 0 123 0 root@Ubu2204x64:now# ``` **扱った問題** + # `/proc/[pid]/status` そのプロセスの状態やメモリ使用率,Capabilityなどを表示する. **扱った問題** + ranger@32c3 CTF (pwn) + https://kitctf.de/writeups/32c3ctf/ranger # `/proc/[pid]/exe` 実行ファイルへのシンボリックリンク.(という単純な話ではないっぽい) **扱った問題** + go away@Aero CTF 2022(Reversing) - https://ctftime.org/writeup/18566 + DFRS@DEADFACE CTF 2022(Web) - https://jackfromeast.site/2022-10/deadface-ctf-2022-writeup.html CTFではないがこちらも参照. + https://stackoverflow.com/questions/28953307/how-to-handle-readlink-of-proc-self-exe-when-executable-is-replaced-during + https://blog.tiqwab.com/2021/10/25/cve-2019-5736-and-proc-self-exe.html # `/proc/sys/fs/suid_dumpable` ptr-yudai氏のWriteupでApache + PHPを題材に説明されているが, バイナリ中で権限を落とした後, プロセスは`/proc/self/mem`にアクセスすることができない. > (当然だが, そこから`fork`した子プロセスも同様にアクセスできない.) しかしながら, これをバイパスする仕組みは存在する. それが`/proc/sys/fs/suid_dumpable`である. 何らかの方法で, ```shell! echo 1 > /proc/sys/fs/suid_dumpable ``` としておくか, 権限を持ったバイナリから ```clike= prctl(PR_SET_DUMPABLE, 1); ``` すると, 権限を落としたバイナリであっても, `/proc/self/mem`へのアクセスが許可される. `man`を読むとこの値はデフォルトで`0`になっているとのことだが, Ubuntuの場合はデフォルトで`1`になっている. (2023年7月現在) ```shell! root@Ubu2204x64:# cat /proc/sys/fs/suid_dumpable 2 root@Ubu2204x64:# ``` **扱った問題** + GuestFS:RCE@zer0pts CTF 2021 + https://hackmd.io/@ptr-yudai/B1T8EIXIP ## `/proc/sys/kernel/acct` https://manpages.ubuntu.com/manpages/trusty/ja/man5/acct.5.html 左から, `highwater`/`lowwater`/`frequency`の値を示す. カーネルで, BSD-style process accountingが有効になっている場合(**CONFIG_BSD_PROCESS_ACCT=y**である場合), これら3つの値が動作を制御す る。 ログファイルが配置されるファイルシステムの空き領域が`lowwater`パーセント以下になった場合, ログファイルのあるファイルシステムの空き領域が lowwater パーセント以下になった ログ記録を一時停止する. 空き領域が`highwater`パーセント以上になった場合に, ログ記録を再開する. `frequency`はカーネルが空き領域のチェックをする頻度である. (単位は秒) デフォルトの値は、`4, 2, 30`である。 つまり、空き領域が 2% 以下になると ログ記録を一時停止し、 空き領域が 4% 以上となったときに再開する。 空き領域について の情報は 30 秒間有効である点に注意すること root@Ubu2404x64:my_ctf_tools# ls -l /proc/sys/kernel/ 合計 0 -rw-r--r-- 1 root root 0 4月 26 23:10 acct -rw-r--r-- 1 root root 0 4月 26 23:10 acpi_video_flags -rw------- 1 root root 0 4月 26 23:10 apparmor_display_secid_mode -rw------- 1 root root 0 4月 26 23:10 apparmor_restrict_unprivileged_io_uring -rw-r--r-- 1 root root 0 4月 26 23:10 apparmor_restrict_unprivileged_unconfined -rw-r--r-- 1 root root 0 4月 26 13:29 apparmor_restrict_unprivileged_userns -rw------- 1 root root 0 4月 26 23:10 apparmor_restrict_unprivileged_userns_complain -rw------- 1 root root 0 4月 26 23:10 apparmor_restrict_unprivileged_userns_force -r--r--r-- 1 root root 0 4月 26 23:10 arch -rw-r--r-- 1 root root 0 4月 26 23:10 auto_msgmni -r--r--r-- 1 root root 0 4月 26 23:10 bootloader_type -r--r--r-- 1 root root 0 4月 26 23:10 bootloader_version -rw-r--r-- 1 root root 0 4月 26 23:10 bpf_stats_enabled -rw------- 1 root root 0 4月 26 23:10 cad_pid -r--r--r-- 1 root root 0 4月 26 13:29 cap_last_cap -rw-r--r-- 1 root root 0 4月 26 13:29 core_pattern -rw-r--r-- 1 root root 0 4月 26 13:29 core_pipe_limit -rw-r--r-- 1 root root 0 4月 26 23:10 core_uses_pid -rw-r--r-- 1 root root 0 4月 26 23:10 ctrl-alt-del -rw-r--r-- 1 root root 0 4月 26 23:10 dmesg_restrict -rw-r--r-- 1 root root 0 4月 26 13:29 domainname dr-xr-xr-x 1 root root 0 4月 26 23:10 firmware_config -rw-r--r-- 1 root root 0 4月 26 23:10 ftrace_dump_on_oops -rw-r--r-- 1 root root 0 4月 26 23:10 ftrace_enabled -rw-r--r-- 1 root root 0 4月 26 23:10 hardlockup_all_cpu_backtrace -rw-r--r-- 1 root root 0 4月 26 23:10 hardlockup_panic -rw-r--r-- 1 root root 0 4月 26 13:29 hostname -rw-r--r-- 1 root root 0 4月 26 23:10 hotplug -rw-r--r-- 1 root root 0 4月 26 23:10 hung_task_all_cpu_backtrace -rw-r--r-- 1 root root 0 4月 26 23:10 hung_task_check_count -rw-r--r-- 1 root root 0 4月 26 23:10 hung_task_check_interval_secs -rw-r--r-- 1 root root 0 4月 26 23:10 hung_task_panic -rw-r--r-- 1 root root 0 4月 26 23:10 hung_task_timeout_secs -rw-r--r-- 1 root root 0 4月 26 23:10 hung_task_warnings -rw-r--r-- 1 root root 0 4月 26 23:10 io_delay_type -rw-r--r-- 1 root root 0 4月 26 23:10 io_uring_disabled -rw-r--r-- 1 root root 0 4月 26 23:10 io_uring_group -rw-r--r-- 1 root root 0 4月 26 23:10 kexec_load_disabled -rw-r--r-- 1 root root 0 4月 26 23:10 kexec_load_limit_panic -rw-r--r-- 1 root root 0 4月 26 23:10 kexec_load_limit_reboot dr-xr-xr-x 1 root root 0 4月 26 13:29 keys -rw-r--r-- 1 root root 0 4月 26 13:29 kptr_restrict -rw-r--r-- 1 root root 0 4月 26 23:10 latencytop -rw-r--r-- 1 root root 0 4月 26 23:10 max_lock_depth -rw-r--r-- 1 root root 0 4月 26 23:10 max_rcu_stall_to_panic -rw-r--r-- 1 root root 0 4月 26 23:10 modprobe -rw-r--r-- 1 root root 0 4月 26 23:10 modules_disabled -r--r--r-- 1 root root 0 4月 26 23:10 msg_next_id -rw-r--r-- 1 root root 0 4月 26 23:10 msgmax -rw-r--r-- 1 root root 0 4月 26 23:10 msgmnb -rw-r--r-- 1 root root 0 4月 26 23:10 msgmni -r--r--r-- 1 root root 0 4月 26 13:29 ngroups_max -rw-r--r-- 1 root root 0 4月 26 23:10 nmi_watchdog -rw-rw-rw- 1 root root 0 4月 26 23:10 ns_last_pid -rw-r--r-- 1 root root 0 4月 26 23:10 numa_balancing -rw-r--r-- 1 root root 0 4月 26 23:10 numa_balancing_promote_rate_limit_MBps -rw-r--r-- 1 root root 0 4月 26 23:10 oops_all_cpu_backtrace -rw-r--r-- 1 root root 0 4月 26 23:10 oops_limit -r--r--r-- 1 root root 0 4月 26 13:29 osrelease -r--r--r-- 1 root root 0 4月 26 23:10 ostype -rw-r--r-- 1 root root 0 4月 26 13:29 overflowgid -rw-r--r-- 1 root root 0 4月 26 13:29 overflowuid -rw-r--r-- 1 root root 0 4月 26 23:10 panic -rw-r--r-- 1 root root 0 4月 26 23:10 panic_on_io_nmi -rw-r--r-- 1 root root 0 4月 26 23:10 panic_on_oops -rw-r--r-- 1 root root 0 4月 26 23:10 panic_on_rcu_stall -rw-r--r-- 1 root root 0 4月 26 23:10 panic_on_unrecovered_nmi -rw-r--r-- 1 root root 0 4月 26 23:10 panic_on_warn -rw-r--r-- 1 root root 0 4月 26 23:10 panic_print -rw-r--r-- 1 root root 0 4月 26 23:10 perf_cpu_time_max_percent -rw-r--r-- 1 root root 0 4月 26 23:10 perf_event_max_contexts_per_stack -rw-r--r-- 1 root root 0 4月 26 23:10 perf_event_max_sample_rate -rw-r--r-- 1 root root 0 4月 26 23:10 perf_event_max_stack -rw-r--r-- 1 root root 0 4月 26 23:10 perf_event_mlock_kb -rw-r--r-- 1 root root 0 4月 26 23:10 perf_event_paranoid -rw-r--r-- 1 root root 0 4月 26 13:29 pid_max -rw-r--r-- 1 root root 0 4月 26 23:10 poweroff_cmd -rw-r--r-- 1 root root 0 4月 26 23:10 print-fatal-signals -rw-r--r-- 1 root root 0 4月 26 13:29 printk -rw-r--r-- 1 root root 0 4月 26 23:10 printk_delay -rw-r--r-- 1 root root 0 4月 26 13:29 printk_devkmsg -rw-r--r-- 1 root root 0 4月 26 23:10 printk_ratelimit -rw-r--r-- 1 root root 0 4月 26 23:10 printk_ratelimit_burst dr-xr-xr-x 1 root root 0 4月 26 13:30 pty dr-xr-xr-x 1 root root 0 4月 26 13:29 random -rw-r--r-- 1 root root 0 4月 26 22:55 randomize_va_space -rw-r--r-- 1 root root 0 4月 26 23:10 real-root-dev -rw-r--r-- 1 root root 0 4月 26 23:10 sched_autogroup_enabled -rw-r--r-- 1 root root 0 4月 26 23:10 sched_cfs_bandwidth_slice_us -rw-r--r-- 1 root root 0 4月 26 23:10 sched_deadline_period_max_us -rw-r--r-- 1 root root 0 4月 26 23:10 sched_deadline_period_min_us -rw-r--r-- 1 root root 0 4月 26 23:10 sched_energy_aware -rw-r--r-- 1 root root 0 4月 26 23:10 sched_rr_timeslice_ms -rw-r--r-- 1 root root 0 4月 26 23:10 sched_rt_period_us -rw-r--r-- 1 root root 0 4月 26 23:10 sched_rt_runtime_us -rw-r--r-- 1 root root 0 4月 26 23:10 sched_schedstats -rw-r--r-- 1 root root 0 4月 26 23:10 sched_util_clamp_max -rw-r--r-- 1 root root 0 4月 26 23:10 sched_util_clamp_min -rw-r--r-- 1 root root 0 4月 26 23:10 sched_util_clamp_min_rt_default dr-xr-xr-x 1 root root 0 4月 26 13:29 seccomp -rw-r--r-- 1 root root 0 4月 26 23:10 sem -r--r--r-- 1 root root 0 4月 26 23:10 sem_next_id -r--r--r-- 1 root root 0 4月 26 23:10 shm_next_id -rw-r--r-- 1 root root 0 4月 26 23:10 shm_rmid_forced -rw-r--r-- 1 root root 0 4月 26 23:10 shmall -rw-r--r-- 1 root root 0 4月 26 23:10 shmmax -rw-r--r-- 1 root root 0 4月 26 23:10 shmmni -rw-r--r-- 1 root root 0 4月 26 23:10 soft_watchdog -rw-r--r-- 1 root root 0 4月 26 23:10 softlockup_all_cpu_backtrace -rw-r--r-- 1 root root 0 4月 26 23:10 softlockup_panic -rw-r--r-- 1 root root 0 4月 26 23:10 split_lock_mitigate -rw-r--r-- 1 root root 0 4月 26 23:10 stack_tracer_enabled -rw-r--r-- 1 root root 0 4月 26 23:10 sysctl_writes_strict -rw-r--r-- 1 root root 0 4月 26 13:29 sysrq -rw-r--r-- 1 root root 0 4月 26 23:10 tainted -rw-r--r-- 1 root root 0 4月 26 23:10 task_delayacct -rw-r--r-- 1 root root 0 4月 26 13:29 threads-max -rw-r--r-- 1 root root 0 4月 26 23:10 timer_migration -rw-r--r-- 1 root root 0 4月 26 23:10 traceoff_on_warning -rw-r--r-- 1 root root 0 4月 26 23:10 tracepoint_printk -rw-r--r-- 1 root root 0 4月 26 23:10 unknown_nmi_panic -rw-r--r-- 1 root root 0 4月 26 23:10 unprivileged_bpf_disabled -rw------- 1 root root 0 4月 26 23:10 unprivileged_userns_apparmor_policy -rw-r--r-- 1 root root 0 4月 26 13:29 unprivileged_userns_clone -rw-r--r-- 1 root root 0 4月 26 23:10 user_events_max dr-xr-xr-x 1 root root 0 4月 26 23:10 usermodehelper -r--r--r-- 1 root root 0 4月 26 23:10 version -rw-r--r-- 1 root root 0 4月 26 23:10 warn_limit -rw-r--r-- 1 root root 0 4月 26 23:10 watchdog -rw-r--r-- 1 root root 0 4月 26 23:10 watchdog_cpumask -rw-r--r-- 1 root root 0 4月 26 23:10 watchdog_thresh dr-xr-xr-x 1 root root 0 4月 26 13:29 yama root@Ubu2404x64:my_ctf_tools# # `/proc/slabinfo` ```shell= [root@kali2104x64]~# cat /proc/slabinfo | head -n20 slabinfo - version: 2.1 # name <active_objs> <num_objs> <objsize> <objperslab> <pagesperslab> : tunables <limit> <batchcount> <sharedfactor> : slabdata <active_slabs> <num_slabs> <sharedavail> nf_conntrack 342 425 320 25 2 : tunables 0 0 0 : slabdata 17 17 0 QIPCRTR 78 78 832 39 8 : tunables 0 0 0 : slabdata 2 2 0 ovl_inode 44 44 720 22 4 : tunables 0 0 0 : slabdata 2 2 0 kvm_async_pf 0 0 136 30 1 : tunables 0 0 0 : slabdata 0 0 0 kvm_vcpu 0 0 11008 1 4 : tunables 0 0 0 : slabdata 0 0 0 kvm_mmu_page_header 0 0 184 22 1 : tunables 0 0 0 : slabdata 0 0 0 x86_emulator 0 0 2688 12 8 : tunables 0 0 0 : slabdata 0 0 0 fat_inode_cache 42 42 776 21 4 : tunables 0 0 0 : slabdata 2 2 0 fat_cache 0 0 40 102 1 : tunables 0 0 0 : slabdata 0 0 0 fuse_request 0 0 152 26 1 : tunables 0 0 0 : slabdata 0 0 0 fuse_inode 0 0 832 39 8 : tunables 0 0 0 : slabdata 0 0 0 ext4_groupinfo_4k 3717 3717 192 21 1 : tunables 0 0 0 : slabdata 177 177 0 ext4_fc_dentry_update 0 0 96 42 1 : tunables 0 0 0 : slabdata 0 0 0 ext4_inode_cache 66265 66285 1192 27 8 : tunables 0 0 0 : slabdata 2455 2455 0 ext4_allocation_context 224 224 144 28 1 : tunables 0 0 0 : slabdata 8 8 0 ext4_system_zone 306 306 40 102 1 : tunables 0 0 0 : slabdata 3 3 0 ext4_io_end 512 512 64 64 1 : tunables 0 0 0 : slabdata 8 8 0 ext4_extent_status 29238 29274 40 102 1 : tunables 0 0 0 : slabdata 287 287 0 [root@kali2104x64]~# ``` 各列の意味は次の通り. | 列 | 意味 | | --- | --- | | `name`| キャッシュの名前 | | `active_objs` | 現在アクティブなオブジェクトの数 | | ``利用可能なオブジェクトの総数、 各オブジェクトのサイズ (バイト単位)、少なくとも一つのアクティブな オブジェクトを有するページの数、アロケートされたページの総数、 slab あたりのページ数、が与えられている。