Current Dir: /usr/sbin/

[FILE] a2disconf [ edit | delete | rename ]
[FILE] a2dismod [ edit | delete | rename ]
[FILE] a2dissite [ edit | delete | rename ]
[FILE] a2enconf [ edit | delete | rename ]
[FILE] a2enmod [ edit | delete | rename ]
[FILE] a2ensite [ edit | delete | rename ]
[FILE] a2query [ edit | delete | rename ]
[FILE] aa-load [ edit | delete | rename ]
[FILE] aa-remove-unknown [ edit | delete | rename ]
[FILE] aa-status [ edit | delete | rename ]
[FILE] aa-teardown [ edit | delete | rename ]
[FILE] accessdb [ edit | delete | rename ]
[FILE] add-shell [ edit | delete | rename ]
[FILE] addgnupghome [ edit | delete | rename ]
[FILE] addgroup [ edit | delete | rename ]
[FILE] adduser [ edit | delete | rename ]
[FILE] agetty [ edit | delete | rename ]
[FILE] apache2 [ edit | delete | rename ]
[FILE] apache2ctl [ edit | delete | rename ]
[FILE] apachectl [ edit | delete | rename ]
[FILE] apparmor_parser [ edit | delete | rename ]
[FILE] apparmor_status [ edit | delete | rename ]
[FILE] applygnupgdefaults [ edit | delete | rename ]
[FILE] argdist-bpfcc [ edit | delete | rename ]
[FILE] arpd [ edit | delete | rename ]
[FILE] arptables [ edit | delete | rename ]
[FILE] arptables-nft [ edit | delete | rename ]
[FILE] arptables-nft-restore [ edit | delete | rename ]
[FILE] arptables-nft-save [ edit | delete | rename ]
[FILE] arptables-restore [ edit | delete | rename ]
[FILE] arptables-save [ edit | delete | rename ]
[FILE] badblocks [ edit | delete | rename ]
[FILE] bashreadline-bpfcc [ edit | delete | rename ]
[FILE] bashreadline.bt [ edit | delete | rename ]
[FILE] bcache-super-show [ edit | delete | rename ]
[FILE] bindsnoop-bpfcc [ edit | delete | rename ]
[FILE] biolatency-bpfcc [ edit | delete | rename ]
[FILE] biolatency-kp.bt [ edit | delete | rename ]
[FILE] biolatency.bt [ edit | delete | rename ]
[FILE] biolatpcts-bpfcc [ edit | delete | rename ]
[FILE] biopattern-bpfcc [ edit | delete | rename ]
[FILE] biosdecode [ edit | delete | rename ]
[FILE] biosnoop-bpfcc [ edit | delete | rename ]
[FILE] biosnoop.bt [ edit | delete | rename ]
[FILE] biostacks.bt [ edit | delete | rename ]
[FILE] biotop-bpfcc [ edit | delete | rename ]
[FILE] bitesize-bpfcc [ edit | delete | rename ]
[FILE] bitesize.bt [ edit | delete | rename ]
[FILE] blkdeactivate [ edit | delete | rename ]
[FILE] blkdiscard [ edit | delete | rename ]
[FILE] blkid [ edit | delete | rename ]
[FILE] blkzone [ edit | delete | rename ]
[FILE] blockdev [ edit | delete | rename ]
[FILE] bpflist-bpfcc [ edit | delete | rename ]
[FILE] bpftool [ edit | delete | rename ]
[FILE] bridge [ edit | delete | rename ]
[FILE] btrfsdist-bpfcc [ edit | delete | rename ]
[FILE] btrfsslower-bpfcc [ edit | delete | rename ]
[FILE] cachestat-bpfcc [ edit | delete | rename ]
[FILE] cachetop-bpfcc [ edit | delete | rename ]
[FILE] cache_check [ edit | delete | rename ]
[FILE] cache_dump [ edit | delete | rename ]
[FILE] cache_metadata_size [ edit | delete | rename ]
[FILE] cache_repair [ edit | delete | rename ]
[FILE] cache_restore [ edit | delete | rename ]
[FILE] cache_writeback [ edit | delete | rename ]
[FILE] capable-bpfcc [ edit | delete | rename ]
[FILE] capable.bt [ edit | delete | rename ]
[FILE] capsh [ edit | delete | rename ]
[FILE] cfdisk [ edit | delete | rename ]
[FILE] cgdisk [ edit | delete | rename ]
[FILE] chcpu [ edit | delete | rename ]
[FILE] check_forensic [ edit | delete | rename ]
[FILE] chgpasswd [ edit | delete | rename ]
[FILE] chmem [ edit | delete | rename ]
[FILE] chpasswd [ edit | delete | rename ]
[FILE] chroot [ edit | delete | rename ]
[FILE] cobjnew-bpfcc [ edit | delete | rename ]
[FILE] compactsnoop-bpfcc [ edit | delete | rename ]
[FILE] cpgr [ edit | delete | rename ]
[FILE] cppw [ edit | delete | rename ]
[FILE] cpudist-bpfcc [ edit | delete | rename ]
[FILE] cpuunclaimed-bpfcc [ edit | delete | rename ]
[FILE] cpuwalk.bt [ edit | delete | rename ]
[FILE] criticalstat-bpfcc [ edit | delete | rename ]
[FILE] cron [ edit | delete | rename ]
[FILE] cryptdisks_start [ edit | delete | rename ]
[FILE] cryptdisks_stop [ edit | delete | rename ]
[FILE] cryptsetup [ edit | delete | rename ]
[FILE] ctrlaltdel [ edit | delete | rename ]
[FILE] dbslower-bpfcc [ edit | delete | rename ]
[FILE] dbstat-bpfcc [ edit | delete | rename ]
[FILE] dcb [ edit | delete | rename ]
[FILE] dcsnoop-bpfcc [ edit | delete | rename ]
[FILE] dcsnoop.bt [ edit | delete | rename ]
[FILE] dcstat-bpfcc [ edit | delete | rename ]
[FILE] deadlock-bpfcc [ edit | delete | rename ]
[FILE] debugfs [ edit | delete | rename ]
[FILE] delgroup [ edit | delete | rename ]
[FILE] deluser [ edit | delete | rename ]
[FILE] depmod [ edit | delete | rename ]
[FILE] devlink [ edit | delete | rename ]
[FILE] dhcpcd [ edit | delete | rename ]
[FILE] dirtop-bpfcc [ edit | delete | rename ]
[FILE] dmeventd [ edit | delete | rename ]
[FILE] dmidecode [ edit | delete | rename ]
[FILE] dmsetup [ edit | delete | rename ]
[FILE] dmstats [ edit | delete | rename ]
[FILE] dosfsck [ edit | delete | rename ]
[FILE] dosfslabel [ edit | delete | rename ]
[FILE] dpkg-preconfigure [ edit | delete | rename ]
[FILE] dpkg-reconfigure [ edit | delete | rename ]
[FILE] drsnoop-bpfcc [ edit | delete | rename ]
[FILE] dumpe2fs [ edit | delete | rename ]
[FILE] e2freefrag [ edit | delete | rename ]
[FILE] e2fsck [ edit | delete | rename ]
[FILE] e2image [ edit | delete | rename ]
[FILE] e2label [ edit | delete | rename ]
[FILE] e2mmpstatus [ edit | delete | rename ]
[FILE] e2scrub [ edit | delete | rename ]
[FILE] e2scrub_all [ edit | delete | rename ]
[FILE] e2undo [ edit | delete | rename ]
[FILE] e4crypt [ edit | delete | rename ]
[FILE] e4defrag [ edit | delete | rename ]
[FILE] ebtables [ edit | delete | rename ]
[FILE] ebtables-nft [ edit | delete | rename ]
[FILE] ebtables-nft-restore [ edit | delete | rename ]
[FILE] ebtables-nft-save [ edit | delete | rename ]
[FILE] ebtables-restore [ edit | delete | rename ]
[FILE] ebtables-save [ edit | delete | rename ]
[FILE] ebtables-translate [ edit | delete | rename ]
[FILE] era_check [ edit | delete | rename ]
[FILE] era_dump [ edit | delete | rename ]
[FILE] era_invalidate [ edit | delete | rename ]
[FILE] era_restore [ edit | delete | rename ]
[FILE] escapesrc [ edit | delete | rename ]
[FILE] ethtool [ edit | delete | rename ]
[FILE] execsnoop-bpfcc [ edit | delete | rename ]
[FILE] execsnoop.bt [ edit | delete | rename ]
[FILE] exitsnoop-bpfcc [ edit | delete | rename ]
[FILE] ext4dist-bpfcc [ edit | delete | rename ]
[FILE] ext4slower-bpfcc [ edit | delete | rename ]
[FILE] faillock [ edit | delete | rename ]
[FILE] fatlabel [ edit | delete | rename ]
[FILE] fdisk [ edit | delete | rename ]
[FILE] filefrag [ edit | delete | rename ]
[FILE] filegone-bpfcc [ edit | delete | rename ]
[FILE] filelife-bpfcc [ edit | delete | rename ]
[FILE] fileslower-bpfcc [ edit | delete | rename ]
[FILE] filetop-bpfcc [ edit | delete | rename ]
[FILE] findfs [ edit | delete | rename ]
[FILE] fixparts [ edit | delete | rename ]
[FILE] fsadm [ edit | delete | rename ]
[FILE] fsck [ edit | delete | rename ]
[FILE] fsck.btrfs [ edit | delete | rename ]
[FILE] fsck.cramfs [ edit | delete | rename ]
[FILE] fsck.ext2 [ edit | delete | rename ]
[FILE] fsck.ext3 [ edit | delete | rename ]
[FILE] fsck.ext4 [ edit | delete | rename ]
[FILE] fsck.fat [ edit | delete | rename ]
[FILE] fsck.minix [ edit | delete | rename ]
[FILE] fsck.msdos [ edit | delete | rename ]
[FILE] fsck.vfat [ edit | delete | rename ]
[FILE] fsck.xfs [ edit | delete | rename ]
[FILE] fsfreeze [ edit | delete | rename ]
[FILE] fstab-decode [ edit | delete | rename ]
[FILE] fstrim [ edit | delete | rename ]
[FILE] funccount-bpfcc [ edit | delete | rename ]
[FILE] funcinterval-bpfcc [ edit | delete | rename ]
[FILE] funclatency-bpfcc [ edit | delete | rename ]
[FILE] funcslower-bpfcc [ edit | delete | rename ]
[FILE] gdisk [ edit | delete | rename ]
[FILE] genccode [ edit | delete | rename ]
[FILE] gencmn [ edit | delete | rename ]
[FILE] genl [ edit | delete | rename ]
[FILE] gennorm2 [ edit | delete | rename ]
[FILE] gensprep [ edit | delete | rename ]
[FILE] getcap [ edit | delete | rename ]
[FILE] gethostlatency-bpfcc [ edit | delete | rename ]
[FILE] gethostlatency.bt [ edit | delete | rename ]
[FILE] getpcaps [ edit | delete | rename ]
[FILE] getty [ edit | delete | rename ]
[FILE] groupadd [ edit | delete | rename ]
[FILE] groupdel [ edit | delete | rename ]
[FILE] groupmems [ edit | delete | rename ]
[FILE] groupmod [ edit | delete | rename ]
[FILE] grpck [ edit | delete | rename ]
[FILE] grpconv [ edit | delete | rename ]
[FILE] grpunconv [ edit | delete | rename ]
[FILE] grub-bios-setup [ edit | delete | rename ]
[FILE] grub-install [ edit | delete | rename ]
[FILE] grub-macbless [ edit | delete | rename ]
[FILE] grub-mkconfig [ edit | delete | rename ]
[FILE] grub-mkdevicemap [ edit | delete | rename ]
[FILE] grub-probe [ edit | delete | rename ]
[FILE] grub-reboot [ edit | delete | rename ]
[FILE] grub-set-default [ edit | delete | rename ]
[FILE] halt [ edit | delete | rename ]
[FILE] hardirqs-bpfcc [ edit | delete | rename ]
[FILE] hdparm [ edit | delete | rename ]
[FILE] httxt2dbm [ edit | delete | rename ]
[FILE] iconvconfig [ edit | delete | rename ]
[FILE] icupkg [ edit | delete | rename ]
[FILE] init [ edit | delete | rename ]
[FILE] inject-bpfcc [ edit | delete | rename ]
[FILE] insmod [ edit | delete | rename ]
[FILE] install-sgmlcatalog [ edit | delete | rename ]
[FILE] installkernel [ edit | delete | rename ]
[FILE] integritysetup [ edit | delete | rename ]
[FILE] invoke-rc.d [ edit | delete | rename ]
[FILE] ip [ edit | delete | rename ]
[FILE] ip6tables [ edit | delete | rename ]
[FILE] ip6tables-apply [ edit | delete | rename ]
[FILE] ip6tables-legacy [ edit | delete | rename ]
[FILE] ip6tables-legacy-restore [ edit | delete | rename ]
[FILE] ip6tables-legacy-save [ edit | delete | rename ]
[FILE] ip6tables-nft [ edit | delete | rename ]
[FILE] ip6tables-nft-restore [ edit | delete | rename ]
[FILE] ip6tables-nft-save [ edit | delete | rename ]
[FILE] ip6tables-restore [ edit | delete | rename ]
[FILE] ip6tables-restore-translate [ edit | delete | rename ]
[FILE] ip6tables-save [ edit | delete | rename ]
[FILE] ip6tables-translate [ edit | delete | rename ]
[FILE] iptables [ edit | delete | rename ]
[FILE] iptables-apply [ edit | delete | rename ]
[FILE] iptables-legacy [ edit | delete | rename ]
[FILE] iptables-legacy-restore [ edit | delete | rename ]
[FILE] iptables-legacy-save [ edit | delete | rename ]
[FILE] iptables-nft [ edit | delete | rename ]
[FILE] iptables-nft-restore [ edit | delete | rename ]
[FILE] iptables-nft-save [ edit | delete | rename ]
[FILE] iptables-restore [ edit | delete | rename ]
[FILE] iptables-restore-translate [ edit | delete | rename ]
[FILE] iptables-save [ edit | delete | rename ]
[FILE] iptables-translate [ edit | delete | rename ]
[FILE] iscsi-iname [ edit | delete | rename ]
[FILE] iscsiadm [ edit | delete | rename ]
[FILE] iscsid [ edit | delete | rename ]
[FILE] iscsistart [ edit | delete | rename ]
[FILE] iscsi_discovery [ edit | delete | rename ]
[FILE] isosize [ edit | delete | rename ]
[FILE] javacalls-bpfcc [ edit | delete | rename ]
[FILE] javaflow-bpfcc [ edit | delete | rename ]
[FILE] javagc-bpfcc [ edit | delete | rename ]
[FILE] javaobjnew-bpfcc [ edit | delete | rename ]
[FILE] javastat-bpfcc [ edit | delete | rename ]
[FILE] javathreads-bpfcc [ edit | delete | rename ]
[FILE] kbdrate [ edit | delete | rename ]
[FILE] killall5 [ edit | delete | rename ]
[FILE] killsnoop-bpfcc [ edit | delete | rename ]
[FILE] killsnoop.bt [ edit | delete | rename ]
[FILE] klockstat-bpfcc [ edit | delete | rename ]
[FILE] kpartx [ edit | delete | rename ]
[FILE] kvmexit-bpfcc [ edit | delete | rename ]
[FILE] ldattach [ edit | delete | rename ]
[FILE] ldconfig [ edit | delete | rename ]
[FILE] ldconfig.real [ edit | delete | rename ]
[FILE] llcstat-bpfcc [ edit | delete | rename ]
[FILE] loads.bt [ edit | delete | rename ]
[FILE] locale-gen [ edit | delete | rename ]
[FILE] logrotate [ edit | delete | rename ]
[FILE] logsave [ edit | delete | rename ]
[FILE] losetup [ edit | delete | rename ]
[FILE] lsmod [ edit | delete | rename ]
[FILE] luksformat [ edit | delete | rename ]
[FILE] lvchange [ edit | delete | rename ]
[FILE] lvconvert [ edit | delete | rename ]
[FILE] lvcreate [ edit | delete | rename ]
[FILE] lvdisplay [ edit | delete | rename ]
[FILE] lvextend [ edit | delete | rename ]
[FILE] lvm [ edit | delete | rename ]
[FILE] lvmconfig [ edit | delete | rename ]
[FILE] lvmdiskscan [ edit | delete | rename ]
[FILE] lvmdump [ edit | delete | rename ]
[FILE] lvmpolld [ edit | delete | rename ]
[FILE] lvmsadc [ edit | delete | rename ]
[FILE] lvmsar [ edit | delete | rename ]
[FILE] lvreduce [ edit | delete | rename ]
[FILE] lvremove [ edit | delete | rename ]
[FILE] lvrename [ edit | delete | rename ]
[FILE] lvresize [ edit | delete | rename ]
[FILE] lvs [ edit | delete | rename ]
[FILE] lvscan [ edit | delete | rename ]
[FILE] lxc [ edit | delete | rename ]
[FILE] lxd [ edit | delete | rename ]
[FILE] make-bcache [ edit | delete | rename ]
[FILE] make-ssl-cert [ edit | delete | rename ]
[FILE] mdadm [ edit | delete | rename ]
[FILE] mdflush-bpfcc [ edit | delete | rename ]
[FILE] mdflush.bt [ edit | delete | rename ]
[FILE] mdmon [ edit | delete | rename ]
[FILE] memleak-bpfcc [ edit | delete | rename ]
[FILE] mkdosfs [ edit | delete | rename ]
[FILE] mke2fs [ edit | delete | rename ]
[FILE] mkfs [ edit | delete | rename ]
[FILE] mkfs.bfs [ edit | delete | rename ]
[FILE] mkfs.btrfs [ edit | delete | rename ]
[FILE] mkfs.cramfs [ edit | delete | rename ]
[FILE] mkfs.ext2 [ edit | delete | rename ]
[FILE] mkfs.ext3 [ edit | delete | rename ]
[FILE] mkfs.ext4 [ edit | delete | rename ]
[FILE] mkfs.fat [ edit | delete | rename ]
[FILE] mkfs.minix [ edit | delete | rename ]
[FILE] mkfs.msdos [ edit | delete | rename ]
[FILE] mkfs.ntfs [ edit | delete | rename ]
[FILE] mkfs.vfat [ edit | delete | rename ]
[FILE] mkfs.xfs [ edit | delete | rename ]
[FILE] mkhomedir_helper [ edit | delete | rename ]
[FILE] mkinitramfs [ edit | delete | rename ]
[FILE] mklost+found [ edit | delete | rename ]
[FILE] mkntfs [ edit | delete | rename ]
[FILE] mkswap [ edit | delete | rename ]
[FILE] ModemManager [ edit | delete | rename ]
[FILE] modinfo [ edit | delete | rename ]
[FILE] modprobe [ edit | delete | rename ]
[FILE] mount.fuse [ edit | delete | rename ]
[FILE] mount.fuse3 [ edit | delete | rename ]
[FILE] mount.lowntfs-3g [ edit | delete | rename ]
[FILE] mount.ntfs [ edit | delete | rename ]
[FILE] mount.ntfs-3g [ edit | delete | rename ]
[FILE] mountsnoop-bpfcc [ edit | delete | rename ]
[FILE] mpathpersist [ edit | delete | rename ]
[FILE] multipath [ edit | delete | rename ]
[FILE] multipathc [ edit | delete | rename ]
[FILE] multipathd [ edit | delete | rename ]
[FILE] mysqld [ edit | delete | rename ]
[FILE] mysqld_qslower-bpfcc [ edit | delete | rename ]
[FILE] naptime.bt [ edit | delete | rename ]
[FILE] needrestart [ edit | delete | rename ]
[FILE] netplan [ edit | delete | rename ]
[FILE] netqtop-bpfcc [ edit | delete | rename ]
[FILE] newusers [ edit | delete | rename ]
[FILE] nfnl_osf [ edit | delete | rename ]
[FILE] nfsdist-bpfcc [ edit | delete | rename ]
[FILE] nfsslower-bpfcc [ edit | delete | rename ]
[FILE] nft [ edit | delete | rename ]
[FILE] nginx [ edit | delete | rename ]
[FILE] nodegc-bpfcc [ edit | delete | rename ]
[FILE] nodestat-bpfcc [ edit | delete | rename ]
[FILE] nologin [ edit | delete | rename ]
[FILE] ntfsclone [ edit | delete | rename ]
[FILE] ntfscp [ edit | delete | rename ]
[FILE] ntfslabel [ edit | delete | rename ]
[FILE] ntfsresize [ edit | delete | rename ]
[FILE] ntfsundelete [ edit | delete | rename ]
[FILE] offcputime-bpfcc [ edit | delete | rename ]
[FILE] offwaketime-bpfcc [ edit | delete | rename ]
[FILE] on_ac_power [ edit | delete | rename ]
[FILE] oomkill-bpfcc [ edit | delete | rename ]
[FILE] oomkill.bt [ edit | delete | rename ]
[FILE] opendkim [ edit | delete | rename ]
[FILE] opendkim-atpszone [ edit | delete | rename ]
[FILE] opendkim-expire [ edit | delete | rename ]
[FILE] opendkim-gengraphs [ edit | delete | rename ]
[FILE] opendkim-genkey [ edit | delete | rename ]
[FILE] opendkim-genstats [ edit | delete | rename ]
[FILE] opendkim-genzone [ edit | delete | rename ]
[FILE] opendkim-importstats [ edit | delete | rename ]
[FILE] opendkim-stats [ edit | delete | rename ]
[FILE] opendkim-testkey [ edit | delete | rename ]
[FILE] opendkim-testmsg [ edit | delete | rename ]
[FILE] opensnoop-bpfcc [ edit | delete | rename ]
[FILE] opensnoop.bt [ edit | delete | rename ]
[FILE] overlayroot-chroot [ edit | delete | rename ]
[FILE] ownership [ edit | delete | rename ]
[FILE] pam-auth-update [ edit | delete | rename ]
[FILE] pam_extrausers_chkpwd [ edit | delete | rename ]
[FILE] pam_extrausers_update [ edit | delete | rename ]
[FILE] pam_getenv [ edit | delete | rename ]
[FILE] pam_namespace_helper [ edit | delete | rename ]
[FILE] pam_timestamp_check [ edit | delete | rename ]
[FILE] paperconfig [ edit | delete | rename ]
[FILE] parted [ edit | delete | rename ]
[FILE] partprobe [ edit | delete | rename ]
[FILE] pdata_tools [ edit | delete | rename ]
[FILE] perlcalls-bpfcc [ edit | delete | rename ]
[FILE] perlflow-bpfcc [ edit | delete | rename ]
[FILE] perlstat-bpfcc [ edit | delete | rename ]
[FILE] pg_updatedicts [ edit | delete | rename ]
[FILE] phpcalls-bpfcc [ edit | delete | rename ]
[FILE] phpdismod [ edit | delete | rename ]
[FILE] phpenmod [ edit | delete | rename ]
[FILE] phpflow-bpfcc [ edit | delete | rename ]
[FILE] phpquery [ edit | delete | rename ]
[FILE] phpstat-bpfcc [ edit | delete | rename ]
[FILE] pidpersec-bpfcc [ edit | delete | rename ]
[FILE] pidpersec.bt [ edit | delete | rename ]
[FILE] pivot_root [ edit | delete | rename ]
[FILE] plocate-build [ edit | delete | rename ]
[FILE] plymouthd [ edit | delete | rename ]
[FILE] postalias [ edit | delete | rename ]
[FILE] postcat [ edit | delete | rename ]
[FILE] postconf [ edit | delete | rename ]
[FILE] postdrop [ edit | delete | rename ]
[FILE] postfix [ edit | delete | rename ]
[FILE] postfix-add-filter [ edit | delete | rename ]
[FILE] postfix-add-policy [ edit | delete | rename ]
[FILE] postfix-collate [ edit | delete | rename ]
[FILE] postkick [ edit | delete | rename ]
[FILE] postlock [ edit | delete | rename ]
[FILE] postlog [ edit | delete | rename ]
[FILE] postmap [ edit | delete | rename ]
[FILE] postmulti [ edit | delete | rename ]
[FILE] postqueue [ edit | delete | rename ]
[FILE] postsuper [ edit | delete | rename ]
[FILE] posttls-finger [ edit | delete | rename ]
[FILE] poweroff [ edit | delete | rename ]
[FILE] ppchcalls-bpfcc [ edit | delete | rename ]
[FILE] profile-bpfcc [ edit | delete | rename ]
[FILE] pvchange [ edit | delete | rename ]
[FILE] pvck [ edit | delete | rename ]
[FILE] pvcreate [ edit | delete | rename ]
[FILE] pvdisplay [ edit | delete | rename ]
[FILE] pvmove [ edit | delete | rename ]
[FILE] pvremove [ edit | delete | rename ]
[FILE] pvresize [ edit | delete | rename ]
[FILE] pvs [ edit | delete | rename ]
[FILE] pvscan [ edit | delete | rename ]
[FILE] pwck [ edit | delete | rename ]
[FILE] pwconv [ edit | delete | rename ]
[FILE] pwhistory_helper [ edit | delete | rename ]
[FILE] pwunconv [ edit | delete | rename ]
[FILE] pythoncalls-bpfcc [ edit | delete | rename ]
[FILE] pythonflow-bpfcc [ edit | delete | rename ]
[FILE] pythongc-bpfcc [ edit | delete | rename ]
[FILE] pythonstat-bpfcc [ edit | delete | rename ]
[FILE] qemu-ga [ edit | delete | rename ]
[FILE] qmqp-sink [ edit | delete | rename ]
[FILE] qmqp-source [ edit | delete | rename ]
[FILE] qshape [ edit | delete | rename ]
[FILE] rdmaucma-bpfcc [ edit | delete | rename ]
[FILE] readahead-bpfcc [ edit | delete | rename ]
[FILE] readprofile [ edit | delete | rename ]
[FILE] reboot [ edit | delete | rename ]
[FILE] remove-shell [ edit | delete | rename ]
[FILE] reset-trace-bpfcc [ edit | delete | rename ]
[FILE] resize2fs [ edit | delete | rename ]
[FILE] resolvconf [ edit | delete | rename ]
[FILE] rmail [ edit | delete | rename ]
[FILE] rmmod [ edit | delete | rename ]
[FILE] rmt [ edit | delete | rename ]
[FILE] rmt-tar [ edit | delete | rename ]
[FILE] rsyslogd [ edit | delete | rename ]
[FILE] rtacct [ edit | delete | rename ]
[FILE] rtcwake [ edit | delete | rename ]
[FILE] rtmon [ edit | delete | rename ]
[FILE] rubycalls-bpfcc [ edit | delete | rename ]
[FILE] rubyflow-bpfcc [ edit | delete | rename ]
[FILE] rubygc-bpfcc [ edit | delete | rename ]
[FILE] rubyobjnew-bpfcc [ edit | delete | rename ]
[FILE] rubystat-bpfcc [ edit | delete | rename ]
[FILE] runlevel [ edit | delete | rename ]
[FILE] runqlat-bpfcc [ edit | delete | rename ]
[FILE] runqlat.bt [ edit | delete | rename ]
[FILE] runqlen-bpfcc [ edit | delete | rename ]
[FILE] runqlen.bt [ edit | delete | rename ]
[FILE] runqslower-bpfcc [ edit | delete | rename ]
[FILE] runuser [ edit | delete | rename ]
[FILE] sendmail [ edit | delete | rename ]
[FILE] service [ edit | delete | rename ]
[FILE] setcap [ edit | delete | rename ]
[FILE] setuids.bt [ edit | delete | rename ]
[FILE] setvesablank [ edit | delete | rename ]
[FILE] setvtrgb [ edit | delete | rename ]
[FILE] sfdisk [ edit | delete | rename ]
[FILE] sgdisk [ edit | delete | rename ]
[FILE] shadowconfig [ edit | delete | rename ]
[FILE] shmsnoop-bpfcc [ edit | delete | rename ]
[FILE] shutdown [ edit | delete | rename ]
[FILE] slabratetop-bpfcc [ edit | delete | rename ]
[FILE] smtp-sink [ edit | delete | rename ]
[FILE] smtp-source [ edit | delete | rename ]
[FILE] sofdsnoop-bpfcc [ edit | delete | rename ]
[FILE] softirqs-bpfcc [ edit | delete | rename ]
[FILE] solisten-bpfcc [ edit | delete | rename ]
[FILE] split-logfile [ edit | delete | rename ]
[FILE] sshd [ edit | delete | rename ]
[FILE] ssllatency.bt [ edit | delete | rename ]
[FILE] sslsniff-bpfcc [ edit | delete | rename ]
[FILE] sslsnoop.bt [ edit | delete | rename ]
[FILE] stackcount-bpfcc [ edit | delete | rename ]
[FILE] start-stop-daemon [ edit | delete | rename ]
[FILE] statsnoop-bpfcc [ edit | delete | rename ]
[FILE] statsnoop.bt [ edit | delete | rename ]
[FILE] sudo_logsrvd [ edit | delete | rename ]
[FILE] sudo_sendlog [ edit | delete | rename ]
[FILE] sulogin [ edit | delete | rename ]
[FILE] swapin.bt [ edit | delete | rename ]
[FILE] swaplabel [ edit | delete | rename ]
[FILE] swapoff [ edit | delete | rename ]
[FILE] swapon [ edit | delete | rename ]
[FILE] switch_root [ edit | delete | rename ]
[FILE] syncsnoop-bpfcc [ edit | delete | rename ]
[FILE] syncsnoop.bt [ edit | delete | rename ]
[FILE] syscount-bpfcc [ edit | delete | rename ]
[FILE] syscount.bt [ edit | delete | rename ]
[FILE] sysctl [ edit | delete | rename ]
[FILE] tarcat [ edit | delete | rename ]
[FILE] tc [ edit | delete | rename ]
[FILE] tclcalls-bpfcc [ edit | delete | rename ]
[FILE] tclflow-bpfcc [ edit | delete | rename ]
[FILE] tclobjnew-bpfcc [ edit | delete | rename ]
[FILE] tclstat-bpfcc [ edit | delete | rename ]
[FILE] tcpaccept-bpfcc [ edit | delete | rename ]
[FILE] tcpaccept.bt [ edit | delete | rename ]
[FILE] tcpcong-bpfcc [ edit | delete | rename ]
[FILE] tcpconnect-bpfcc [ edit | delete | rename ]
[FILE] tcpconnect.bt [ edit | delete | rename ]
[FILE] tcpconnlat-bpfcc [ edit | delete | rename ]
[FILE] tcpdrop-bpfcc [ edit | delete | rename ]
[FILE] tcpdrop.bt [ edit | delete | rename ]
[FILE] tcplife-bpfcc [ edit | delete | rename ]
[FILE] tcplife.bt [ edit | delete | rename ]
[FILE] tcpretrans-bpfcc [ edit | delete | rename ]
[FILE] tcpretrans.bt [ edit | delete | rename ]
[FILE] tcprtt-bpfcc [ edit | delete | rename ]
[FILE] tcpstates-bpfcc [ edit | delete | rename ]
[FILE] tcpsubnet-bpfcc [ edit | delete | rename ]
[FILE] tcpsynbl-bpfcc [ edit | delete | rename ]
[FILE] tcpsynbl.bt [ edit | delete | rename ]
[FILE] tcptop-bpfcc [ edit | delete | rename ]
[FILE] tcptracer-bpfcc [ edit | delete | rename ]
[FILE] telinit [ edit | delete | rename ]
[FILE] thin_check [ edit | delete | rename ]
[FILE] thin_delta [ edit | delete | rename ]
[FILE] thin_dump [ edit | delete | rename ]
[FILE] thin_ls [ edit | delete | rename ]
[FILE] thin_metadata_size [ edit | delete | rename ]
[FILE] thin_repair [ edit | delete | rename ]
[FILE] thin_restore [ edit | delete | rename ]
[FILE] thin_rmap [ edit | delete | rename ]
[FILE] thin_trim [ edit | delete | rename ]
[FILE] threadsnoop-bpfcc [ edit | delete | rename ]
[FILE] threadsnoop.bt [ edit | delete | rename ]
[FILE] tipc [ edit | delete | rename ]
[FILE] tplist-bpfcc [ edit | delete | rename ]
[FILE] trace-bpfcc [ edit | delete | rename ]
[FILE] ttysnoop-bpfcc [ edit | delete | rename ]
[FILE] tune2fs [ edit | delete | rename ]
[FILE] ucalls [ edit | delete | rename ]
[FILE] uflow [ edit | delete | rename ]
[FILE] ufw [ edit | delete | rename ]
[FILE] ugc [ edit | delete | rename ]
[FILE] umount.udisks2 [ edit | delete | rename ]
[FILE] undump.bt [ edit | delete | rename ]
[FILE] unix_chkpwd [ edit | delete | rename ]
[FILE] unix_update [ edit | delete | rename ]
[FILE] uobjnew [ edit | delete | rename ]
[FILE] update-ca-certificates [ edit | delete | rename ]
[FILE] update-catalog [ edit | delete | rename ]
[FILE] update-fonts-alias [ edit | delete | rename ]
[FILE] update-fonts-dir [ edit | delete | rename ]
[FILE] update-fonts-scale [ edit | delete | rename ]
[FILE] update-grub [ edit | delete | rename ]
[FILE] update-grub-gfxpayload [ edit | delete | rename ]
[FILE] update-grub2 [ edit | delete | rename ]
[FILE] update-gsfontmap [ edit | delete | rename ]
[FILE] update-icon-caches [ edit | delete | rename ]
[FILE] update-ieee-data [ edit | delete | rename ]
[FILE] update-info-dir [ edit | delete | rename ]
[FILE] update-initramfs [ edit | delete | rename ]
[FILE] update-locale [ edit | delete | rename ]
[FILE] update-mime [ edit | delete | rename ]
[FILE] update-passwd [ edit | delete | rename ]
[FILE] update-pciids [ edit | delete | rename ]
[FILE] update-rc.d [ edit | delete | rename ]
[FILE] update-secureboot-policy [ edit | delete | rename ]
[FILE] update-shells [ edit | delete | rename ]
[FILE] update-xmlcatalog [ edit | delete | rename ]
[FILE] updatedb.plocate [ edit | delete | rename ]
[FILE] upgrade-from-grub-legacy [ edit | delete | rename ]
[FILE] usb_modeswitch [ edit | delete | rename ]
[FILE] usb_modeswitch_dispatcher [ edit | delete | rename ]
[FILE] useradd [ edit | delete | rename ]
[FILE] userdel [ edit | delete | rename ]
[FILE] usermod [ edit | delete | rename ]
[FILE] ustat [ edit | delete | rename ]
[FILE] uthreads [ edit | delete | rename ]
[FILE] uuidd [ edit | delete | rename ]
[FILE] validlocale [ edit | delete | rename ]
[FILE] vcstime [ edit | delete | rename ]
[FILE] vdpa [ edit | delete | rename ]
[FILE] veritysetup [ edit | delete | rename ]
[FILE] vfscount-bpfcc [ edit | delete | rename ]
[FILE] vfscount.bt [ edit | delete | rename ]
[FILE] vfsstat-bpfcc [ edit | delete | rename ]
[FILE] vfsstat.bt [ edit | delete | rename ]
[FILE] vgcfgbackup [ edit | delete | rename ]
[FILE] vgcfgrestore [ edit | delete | rename ]
[FILE] vgchange [ edit | delete | rename ]
[FILE] vgck [ edit | delete | rename ]
[FILE] vgconvert [ edit | delete | rename ]
[FILE] vgcreate [ edit | delete | rename ]
[FILE] vgdisplay [ edit | delete | rename ]
[FILE] vgexport [ edit | delete | rename ]
[FILE] vgextend [ edit | delete | rename ]
[FILE] vgimport [ edit | delete | rename ]
[FILE] vgimportclone [ edit | delete | rename ]
[FILE] vgmerge [ edit | delete | rename ]
[FILE] vgmknodes [ edit | delete | rename ]
[FILE] vgreduce [ edit | delete | rename ]
[FILE] vgremove [ edit | delete | rename ]
[FILE] vgrename [ edit | delete | rename ]
[FILE] vgs [ edit | delete | rename ]
[FILE] vgscan [ edit | delete | rename ]
[FILE] vgsplit [ edit | delete | rename ]
[FILE] vigr [ edit | delete | rename ]
[FILE] vipw [ edit | delete | rename ]
[FILE] virtiostat-bpfcc [ edit | delete | rename ]
[FILE] visudo [ edit | delete | rename ]
[FILE] vpddecode [ edit | delete | rename ]
[FILE] wakeuptime-bpfcc [ edit | delete | rename ]
[FILE] wipefs [ edit | delete | rename ]
[FILE] writeback.bt [ edit | delete | rename ]
[FILE] xfsdist-bpfcc [ edit | delete | rename ]
[FILE] xfsdist.bt [ edit | delete | rename ]
[FILE] xfsslower-bpfcc [ edit | delete | rename ]
[FILE] xfs_admin [ edit | delete | rename ]
[FILE] xfs_bmap [ edit | delete | rename ]
[FILE] xfs_copy [ edit | delete | rename ]
[FILE] xfs_db [ edit | delete | rename ]
[FILE] xfs_estimate [ edit | delete | rename ]
[FILE] xfs_freeze [ edit | delete | rename ]
[FILE] xfs_fsr [ edit | delete | rename ]
[FILE] xfs_growfs [ edit | delete | rename ]
[FILE] xfs_info [ edit | delete | rename ]
[FILE] xfs_io [ edit | delete | rename ]
[FILE] xfs_logprint [ edit | delete | rename ]
[FILE] xfs_mdrestore [ edit | delete | rename ]
[FILE] xfs_metadump [ edit | delete | rename ]
[FILE] xfs_mkfile [ edit | delete | rename ]
[FILE] xfs_ncheck [ edit | delete | rename ]
[FILE] xfs_quota [ edit | delete | rename ]
[FILE] xfs_repair [ edit | delete | rename ]
[FILE] xfs_rtcp [ edit | delete | rename ]
[FILE] xfs_scrub [ edit | delete | rename ]
[FILE] xfs_scrub_all [ edit | delete | rename ]
[FILE] xfs_spaceman [ edit | delete | rename ]
[FILE] xtables-legacy-multi [ edit | delete | rename ]
[FILE] xtables-monitor [ edit | delete | rename ]
[FILE] xtables-nft-multi [ edit | delete | rename ]
[FILE] zerofree [ edit | delete | rename ]
[FILE] zfsdist-bpfcc [ edit | delete | rename ]
[FILE] zfsslower-bpfcc [ edit | delete | rename ]
[FILE] zic [ edit | delete | rename ]
[FILE] zramctl [ edit | delete | rename ]

Viewing: /usr/sbin/tcpconnect-bpfcc

#! /usr/bin/python3
# @lint-avoid-python-3-compatibility-imports
#
# tcpconnect    Trace TCP connect()s.
#               For Linux, uses BCC, eBPF. Embedded C.
#
# USAGE: tcpconnect [-h] [-c] [-t] [-p PID] [-P PORT [PORT ...]] [-4 | -6]
#
# All connection attempts are traced, even if they ultimately fail.
#
# This uses dynamic tracing of kernel functions, and will need to be updated
# to match kernel changes.
#
# Copyright (c) 2015 Brendan Gregg.
# Licensed under the Apache License, Version 2.0 (the "License")
#
# 25-Sep-2015   Brendan Gregg   Created this.
# 14-Feb-2016      "      "     Switch to bpf_perf_output.
# 09-Jan-2019   Takuma Kume     Support filtering by UID
# 30-Jul-2019   Xiaozhou Liu    Count connects.
# 07-Oct-2020   Nabil Schear    Correlate connects with DNS responses
# 08-Mar-2021   Suresh Kumar    Added LPORT option

from __future__ import print_function
from bcc import BPF
from bcc.containers import filter_by_containers
from bcc.utils import printb
import argparse
from socket import inet_ntop, ntohs, AF_INET, AF_INET6
from struct import pack
from time import sleep
from datetime import datetime

# arguments
examples = """examples:
    ./tcpconnect           # trace all TCP connect()s
    ./tcpconnect -t        # include timestamps
    ./tcpconnect -d        # include DNS queries associated with connects
    ./tcpconnect -p 181    # only trace PID 181
    ./tcpconnect -P 80     # only trace port 80
    ./tcpconnect -P 80,81  # only trace port 80 and 81
    ./tcpconnect -4        # only trace IPv4 family
    ./tcpconnect -6        # only trace IPv6 family
    ./tcpconnect -U        # include UID
    ./tcpconnect -u 1000   # only trace UID 1000
    ./tcpconnect -c        # count connects per src ip and dest ip/port
    ./tcpconnect -L        # include LPORT while printing outputs
    ./tcpconnect --cgroupmap mappath  # only trace cgroups in this BPF map
    ./tcpconnect --mntnsmap mappath   # only trace mount namespaces in the map
"""
parser = argparse.ArgumentParser(
    description="Trace TCP connects",
    formatter_class=argparse.RawDescriptionHelpFormatter,
    epilog=examples)
parser.add_argument("-t", "--timestamp", action="store_true",
    help="include timestamp on output")
parser.add_argument("-p", "--pid",
    help="trace this PID only")
parser.add_argument("-P", "--port",
    help="comma-separated list of destination ports to trace.")
group = parser.add_mutually_exclusive_group()
group.add_argument("-4", "--ipv4", action="store_true",
    help="trace IPv4 family only")
group.add_argument("-6", "--ipv6", action="store_true",
    help="trace IPv6 family only")
parser.add_argument("-L", "--lport", action="store_true",
    help="include LPORT on output")
parser.add_argument("-U", "--print-uid", action="store_true",
    help="include UID on output")
parser.add_argument("-u", "--uid",
    help="trace this UID only")
parser.add_argument("-c", "--count", action="store_true",
    help="count connects per src ip and dest ip/port")
parser.add_argument("--cgroupmap",
    help="trace cgroups in this BPF map only")
parser.add_argument("--mntnsmap",
    help="trace mount namespaces in this BPF map only")
parser.add_argument("-d", "--dns", action="store_true",
    help="include likely DNS query associated with each connect")
parser.add_argument("--ebpf", action="store_true",
    help=argparse.SUPPRESS)
args = parser.parse_args()
debug = 0

# define BPF program
bpf_text = """
#include <uapi/linux/ptrace.h>
#include <net/sock.h>
#include <bcc/proto.h>

BPF_HASH(currsock, u32, struct sock *);

// separate data structs for ipv4 and ipv6
struct ipv4_data_t {
    u64 ts_us;
    u32 pid;
    u32 uid;
    u32 saddr;
    u32 daddr;
    u64 ip;
    u16 lport;
    u16 dport;
    char task[TASK_COMM_LEN];
};
BPF_PERF_OUTPUT(ipv4_events);

struct ipv6_data_t {
    u64 ts_us;
    u32 pid;
    u32 uid;
    unsigned __int128 saddr;
    unsigned __int128 daddr;
    u64 ip;
    u16 lport;
    u16 dport;
    char task[TASK_COMM_LEN];
};
BPF_PERF_OUTPUT(ipv6_events);

// separate flow keys per address family
struct ipv4_flow_key_t {
    u32 saddr;
    u32 daddr;
    u16 dport;
};
BPF_HASH(ipv4_count, struct ipv4_flow_key_t);

struct ipv6_flow_key_t {
    unsigned __int128 saddr;
    unsigned __int128 daddr;
    u16 dport;
};
BPF_HASH(ipv6_count, struct ipv6_flow_key_t);

int trace_connect_entry(struct pt_regs *ctx, struct sock *sk)
{
    if (container_should_be_filtered()) {
        return 0;
    }

    u64 pid_tgid = bpf_get_current_pid_tgid();
    u32 pid = pid_tgid >> 32;
    u32 tid = pid_tgid;
    FILTER_PID

    u32 uid = bpf_get_current_uid_gid();
    FILTER_UID

    // stash the sock ptr for lookup on return
    currsock.update(&tid, &sk);

    return 0;
};

static int trace_connect_return(struct pt_regs *ctx, short ipver)
{
    int ret = PT_REGS_RC(ctx);
    u64 pid_tgid = bpf_get_current_pid_tgid();
    u32 pid = pid_tgid >> 32;
    u32 tid = pid_tgid;

    struct sock **skpp;
    skpp = currsock.lookup(&tid);
    if (skpp == 0) {
        return 0;   // missed entry
    }

    if (ret != 0) {
        // failed to send SYNC packet, may not have populated
        // socket __sk_common.{skc_rcv_saddr, ...}
        currsock.delete(&tid);
        return 0;
    }

    // pull in details
    struct sock *skp = *skpp;
    u16 lport = skp->__sk_common.skc_num;
    u16 dport = skp->__sk_common.skc_dport;

    FILTER_PORT

    FILTER_FAMILY

    if (ipver == 4) {
        IPV4_CODE
    } else /* 6 */ {
        IPV6_CODE
    }

    currsock.delete(&tid);

    return 0;
}

int trace_connect_v4_return(struct pt_regs *ctx)
{
    return trace_connect_return(ctx, 4);
}

int trace_connect_v6_return(struct pt_regs *ctx)
{
    return trace_connect_return(ctx, 6);
}
"""

struct_init = {'ipv4':
        {'count':
               """
               struct ipv4_flow_key_t flow_key = {};
               flow_key.saddr = skp->__sk_common.skc_rcv_saddr;
               flow_key.daddr = skp->__sk_common.skc_daddr;
               flow_key.dport = ntohs(dport);
               ipv4_count.increment(flow_key);""",
          'trace':
               """
               struct ipv4_data_t data4 = {.pid = pid, .ip = ipver};
               data4.uid = bpf_get_current_uid_gid();
               data4.ts_us = bpf_ktime_get_ns() / 1000;
               data4.saddr = skp->__sk_common.skc_rcv_saddr;
               data4.daddr = skp->__sk_common.skc_daddr;
               data4.lport = lport;
               data4.dport = ntohs(dport);
               bpf_get_current_comm(&data4.task, sizeof(data4.task));
               ipv4_events.perf_submit(ctx, &data4, sizeof(data4));"""
               },
        'ipv6':
        {'count':
               """
               struct ipv6_flow_key_t flow_key = {};
               bpf_probe_read_kernel(&flow_key.saddr, sizeof(flow_key.saddr),
                   skp->__sk_common.skc_v6_rcv_saddr.in6_u.u6_addr32);
               bpf_probe_read_kernel(&flow_key.daddr, sizeof(flow_key.daddr),
                   skp->__sk_common.skc_v6_daddr.in6_u.u6_addr32);
               flow_key.dport = ntohs(dport);
               ipv6_count.increment(flow_key);""",
          'trace':
               """
               struct ipv6_data_t data6 = {.pid = pid, .ip = ipver};
               data6.uid = bpf_get_current_uid_gid();
               data6.ts_us = bpf_ktime_get_ns() / 1000;
               bpf_probe_read_kernel(&data6.saddr, sizeof(data6.saddr),
                   skp->__sk_common.skc_v6_rcv_saddr.in6_u.u6_addr32);
               bpf_probe_read_kernel(&data6.daddr, sizeof(data6.daddr),
                   skp->__sk_common.skc_v6_daddr.in6_u.u6_addr32);
               data6.lport = lport;
               data6.dport = ntohs(dport);
               bpf_get_current_comm(&data6.task, sizeof(data6.task));
               ipv6_events.perf_submit(ctx, &data6, sizeof(data6));"""
               }
               }

# This defines an additional BPF program that instruments udp_recvmsg system
# call to locate DNS response packets on UDP port 53. When these packets are
# located, the data is copied to user-space where python will parse them with
# dnslib.
#
# uses a percpu array of length 1 to store the dns_data_t off the stack to
# allow for a maximum DNS packet length of 512 bytes.
dns_bpf_text = """
#include <net/inet_sock.h>

#define MAX_PKT 512
struct dns_data_t {
    u8  pkt[MAX_PKT];
};

BPF_PERF_OUTPUT(dns_events);

// store msghdr pointer captured on syscall entry to parse on syscall return
BPF_HASH(tbl_udp_msg_hdr, u64, struct msghdr *);

// single element per-cpu array to hold the current event off the stack
BPF_PERCPU_ARRAY(dns_data,struct dns_data_t,1);

int trace_udp_recvmsg(struct pt_regs *ctx)
{
    __u64 pid_tgid = bpf_get_current_pid_tgid();
    struct sock *sk = (struct sock *)PT_REGS_PARM1(ctx);
    struct inet_sock *is = inet_sk(sk);

    // only grab port 53 packets, 13568 is ntohs(53)
    if (is->inet_dport == 13568) {
        struct msghdr *msghdr = (struct msghdr *)PT_REGS_PARM2(ctx);
        tbl_udp_msg_hdr.update(&pid_tgid, &msghdr);
    }
    return 0;
}

int trace_udp_ret_recvmsg(struct pt_regs *ctx)
{
    __u64 pid_tgid = bpf_get_current_pid_tgid();
    u32 zero = 0;
    struct msghdr **msgpp = tbl_udp_msg_hdr.lookup(&pid_tgid);
    if (msgpp == 0)
        return 0;

    struct msghdr *msghdr = (struct msghdr *)*msgpp;
    if (msghdr->msg_iter.TYPE_FIELD != ITER_IOVEC)
        goto delete_and_return;

    int copied = (int)PT_REGS_RC(ctx);
    if (copied < 0)
        goto delete_and_return;
    size_t buflen = (size_t)copied;

    if (buflen > msghdr->msg_iter.iov->iov_len)
        goto delete_and_return;

    if (buflen > MAX_PKT)
        buflen = MAX_PKT;

    struct dns_data_t *data = dns_data.lookup(&zero);
    if (!data) // this should never happen, just making the verifier happy
        return 0;

    void *iovbase = msghdr->msg_iter.iov->iov_base;
    bpf_probe_read(data->pkt, buflen, iovbase);
    dns_events.perf_submit(ctx, data, buflen);

delete_and_return:
    tbl_udp_msg_hdr.delete(&pid_tgid);
    return 0;
}

#include <uapi/linux/udp.h>

int trace_udpv6_recvmsg(struct pt_regs *ctx)
{
    struct sk_buff *skb = (struct sk_buff *)PT_REGS_PARM2(ctx);
    struct udphdr *hdr = (void*)skb->head + skb->transport_header;
    struct dns_data_t *event;
    int zero = 0;
    void *data;

    /* hex(53) = 0x0035, htons(0x0035) = 0x3500 */
    if (hdr->source != 0x3500)
        return 0;

    /* skip UDP header */
    data = skb->data + 8;

    event = dns_data.lookup(&zero);
    if (!event)
        return 0;

    bpf_probe_read(event->pkt, sizeof(event->pkt), data);
    dns_events.perf_submit(ctx, event, sizeof(*event));
    return 0;
}
"""

if args.count and args.dns:
    print("Error: you may not specify -d/--dns with -c/--count.")
    exit()

# code substitutions
if args.count:
    bpf_text = bpf_text.replace("IPV4_CODE", struct_init['ipv4']['count'])
    bpf_text = bpf_text.replace("IPV6_CODE", struct_init['ipv6']['count'])
else:
    bpf_text = bpf_text.replace("IPV4_CODE", struct_init['ipv4']['trace'])
    bpf_text = bpf_text.replace("IPV6_CODE", struct_init['ipv6']['trace'])

if args.pid:
    bpf_text = bpf_text.replace('FILTER_PID',
        'if (pid != %s) { return 0; }' % args.pid)
if args.port:
    dports = [int(dport) for dport in args.port.split(',')]
    dports_if = ' && '.join(['dport != %d' % ntohs(dport) for dport in dports])
    bpf_text = bpf_text.replace('FILTER_PORT',
        'if (%s) { currsock.delete(&tid); return 0; }' % dports_if)
if args.ipv4:
    bpf_text = bpf_text.replace('FILTER_FAMILY',
        'if (ipver != 4) { return 0; }')
elif args.ipv6:
    bpf_text = bpf_text.replace('FILTER_FAMILY',
        'if (ipver != 6) { return 0; }')
if args.uid:
    bpf_text = bpf_text.replace('FILTER_UID',
        'if (uid != %s) { return 0; }' % args.uid)
bpf_text = filter_by_containers(args) + bpf_text

bpf_text = bpf_text.replace('FILTER_PID', '')
bpf_text = bpf_text.replace('FILTER_PORT', '')
bpf_text = bpf_text.replace('FILTER_FAMILY', '')
bpf_text = bpf_text.replace('FILTER_UID', '')

if args.dns:
    if BPF.kernel_struct_has_field(b'iov_iter', b'iter_type') == 1:
        dns_bpf_text = dns_bpf_text.replace('TYPE_FIELD', 'iter_type')
    else:
        dns_bpf_text = dns_bpf_text.replace('TYPE_FIELD', 'type')
    bpf_text += dns_bpf_text

if debug or args.ebpf:
    print(bpf_text)
    if args.ebpf:
        exit()

# process event
def print_ipv4_event(cpu, data, size):
    event = b["ipv4_events"].event(data)
    global start_ts
    if args.timestamp:
        if start_ts == 0:
            start_ts = event.ts_us
        printb(b"%-9.3f" % ((float(event.ts_us) - start_ts) / 1000000), nl="")
    if args.print_uid:
        printb(b"%-6d" % event.uid, nl="")
    dest_ip = inet_ntop(AF_INET, pack("I", event.daddr)).encode()
    if args.lport:
        printb(b"%-7d %-12.12s %-2d %-16s %-6d %-16s %-6d %s" % (event.pid,
            event.task, event.ip,
            inet_ntop(AF_INET, pack("I", event.saddr)).encode(), event.lport,
            dest_ip, event.dport, print_dns(dest_ip)))
    else:
        printb(b"%-7d %-12.12s %-2d %-16s %-16s %-6d %s" % (event.pid,
            event.task, event.ip,
            inet_ntop(AF_INET, pack("I", event.saddr)).encode(),
            dest_ip, event.dport, print_dns(dest_ip)))

def print_ipv6_event(cpu, data, size):
    event = b["ipv6_events"].event(data)
    global start_ts
    if args.timestamp:
        if start_ts == 0:
            start_ts = event.ts_us
        printb(b"%-9.3f" % ((float(event.ts_us) - start_ts) / 1000000), nl="")
    if args.print_uid:
        printb(b"%-6d" % event.uid, nl="")
    dest_ip = inet_ntop(AF_INET6, event.daddr).encode()
    if args.lport:
        printb(b"%-7d %-12.12s %-2d %-16s %-6d %-16s %-6d %s" % (event.pid,
            event.task, event.ip,
            inet_ntop(AF_INET6, event.saddr).encode(), event.lport,
            dest_ip, event.dport, print_dns(dest_ip)))
    else:
        printb(b"%-7d %-12.12s %-2d %-16s %-16s %-6d %s" % (event.pid,
            event.task, event.ip,
            inet_ntop(AF_INET6, event.saddr).encode(),
            dest_ip, event.dport, print_dns(dest_ip)))

def depict_cnt(counts_tab, l3prot='ipv4'):
    for k, v in sorted(counts_tab.items(),
                       key=lambda counts: counts[1].value, reverse=True):
        depict_key = ""
        if l3prot == 'ipv4':
            depict_key = "%-25s %-25s %-20s" % \
                         ((inet_ntop(AF_INET, pack('I', k.saddr))),
                          inet_ntop(AF_INET, pack('I', k.daddr)), k.dport)
        else:
            depict_key = "%-25s %-25s %-20s" % \
                         ((inet_ntop(AF_INET6, k.saddr)),
                          inet_ntop(AF_INET6, k.daddr), k.dport)

        print("%s %-10d" % (depict_key, v.value))

def print_dns(dest_ip):
    if not args.dns:
        return b""

    dnsname, timestamp = dns_cache.get(dest_ip, (None, None))
    if timestamp is not None:
        diff = datetime.now() - timestamp
        diff = float(diff.seconds) * 1000 + float(diff.microseconds) / 1000
    else:
        diff = 0
    if dnsname is None:
        dnsname = b"No DNS Query"
        if dest_ip == b"127.0.0.1" or dest_ip == b"::1":
            dnsname = b"localhost"
    retval = b"%s" % dnsname
    if diff > DELAY_DNS:
        retval += b" (%.3fms)" % diff
    return retval

if args.dns:
    try:
        import dnslib
        from cachetools import TTLCache
    except ImportError:
        print("Error: The python packages dnslib and cachetools are required "
                "to use the -d/--dns option.")
        print("Install this package with:")
        print("\t$ pip3 install dnslib cachetools")
        print("   or")
        print("\t$ sudo apt-get install python3-dnslib python3-cachetools "
              "(on Ubuntu 18.04+)")
        exit(1)

    # 24 hours
    DEFAULT_TTL = 86400

    # Cache Size in entries
    DNS_CACHE_SIZE = 10240

    # delay in ms in which to warn users of long delay between the query
    # and the connect that used the IP
    DELAY_DNS = 100

    dns_cache = TTLCache(maxsize=DNS_CACHE_SIZE, ttl=DEFAULT_TTL)

    # process event
    def save_dns(cpu, data, size):
        event = b["dns_events"].event(data)
        payload = event.pkt[:size]

        # pass the payload to dnslib for parsing
        dnspkt = dnslib.DNSRecord.parse(payload)
        # lets only look at responses
        if dnspkt.header.qr != 1:
            return
        # must be some questions in there
        if dnspkt.header.q != 1:
            return
        # make sure there are answers
        if dnspkt.header.a == 0 and dnspkt.header.aa == 0:
            return

        # lop off the trailing .
        question = ("%s" % dnspkt.q.qname)[:-1].encode('utf-8')

        for answer in dnspkt.rr:
            # skip all but A and AAAA records
            if answer.rtype == 1 or answer.rtype == 28:
                dns_cache[str(answer.rdata).encode('utf-8')] = (question,
                                                              datetime.now())

# initialize BPF
b = BPF(text=bpf_text)
b.attach_kprobe(event="tcp_v4_connect", fn_name="trace_connect_entry")
b.attach_kprobe(event="tcp_v6_connect", fn_name="trace_connect_entry")
b.attach_kretprobe(event="tcp_v4_connect", fn_name="trace_connect_v4_return")
b.attach_kretprobe(event="tcp_v6_connect", fn_name="trace_connect_v6_return")
if args.dns:
    b.attach_kprobe(event="udp_recvmsg", fn_name="trace_udp_recvmsg")
    b.attach_kretprobe(event="udp_recvmsg", fn_name="trace_udp_ret_recvmsg")
    b.attach_kprobe(event="udpv6_queue_rcv_one_skb", fn_name="trace_udpv6_recvmsg")

print("Tracing connect ... Hit Ctrl-C to end")
if args.count:
    try:
        while True:
            sleep(99999999)
    except KeyboardInterrupt:
        pass

    # header
    print("\n%-25s %-25s %-20s %-10s" % (
        "LADDR", "RADDR", "RPORT", "CONNECTS"))
    depict_cnt(b["ipv4_count"])
    depict_cnt(b["ipv6_count"], l3prot='ipv6')
# read events
else:
    # header
    if args.timestamp:
        print("%-9s" % ("TIME(s)"), end="")
    if args.print_uid:
        print("%-6s" % ("UID"), end="")
    if args.lport:
        print("%-7s %-12s %-2s %-16s %-6s %-16s %-6s" % ("PID", "COMM", "IP", "SADDR",
            "LPORT", "DADDR", "DPORT"), end="")
    else:
        print("%-7s %-12s %-2s %-16s %-16s %-6s" % ("PID", "COMM", "IP", "SADDR",
            "DADDR", "DPORT"), end="")
    if args.dns:
        print(" QUERY")
    else:
        print()

    start_ts = 0

    # read events
    b["ipv4_events"].open_perf_buffer(print_ipv4_event)
    b["ipv6_events"].open_perf_buffer(print_ipv6_event)
    if args.dns:
        b["dns_events"].open_perf_buffer(save_dns)
    while True:
        try:
            b.perf_buffer_poll()
        except KeyboardInterrupt:
            exit()

Upload File: