You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if dpkg -L $prog| grep 'does not contain any files'>/dev/null 2>&1;then
89
97
echo -e "$prog 安装中......"
90
98
apt install -y "$prog">/dev/null 2>&1
99
+
apt install -y silversearcher-ag >/dev/null 2>&1
91
100
fi
92
101
93
102
fi
@@ -138,8 +147,8 @@ base_check() {
138
147
cpu=$(ps aux | grep -v ^'USER'| sort -rn -k3 | head -15)2>/dev/null
139
148
echo -e "\e[00;31m[+]CPU TOP15: \e[00m\n${cpu}\n"| tee -a "$filename"
140
149
#内存占用TOP 15
141
-
cpu=$(ps aux | grep -v ^'USER'| sort -rn -k3| head -15)2>/dev/null
142
-
echo -e "\e[00;31m[+]内存占用 TOP15: \e[00m\n${cpu}\n"| tee -a "$filename"
150
+
mem=$(ps aux | grep -v ^'USER'| sort -rn -k4| head -15)2>/dev/null
151
+
echo -e "\e[00;31m[+]内存占用 TOP15: \e[00m\n${mem}\n"| tee -a "$filename"
143
152
#内存占用
144
153
echo -e "\e[00;31m[+]内存占用\e[00m"| tee -a "$filename"
145
154
free -mh | tee -a "$filename"
@@ -457,7 +466,7 @@ rootkit_check() {
457
466
echo -e "############ Rootkit检查 ############\n"| tee -a "$vuln"
458
467
#lsmod 可疑模块
459
468
echo -e "\e[00;31m[+]lsmod 可疑模块\e[00m"| tee -a "$vuln"
460
-
lsmod | ag -v "ablk_helper|ac97_bus|acpi_power_meter|aesni_intel|ahci|ata_generic|ata_piix|auth_rpcgss|binfmt_misc|bluetooth|bnep|bnx2|bridge|cdrom|cirrus|coretemp|crc_t10dif|crc32_pclmul|crc32c_intel|crct10dif_common|crct10dif_generic|crct10dif_pclmul|cryptd|dca|dcdbas|dm_log|dm_mirror|dm_mod|dm_region_hash|drm|drm_kms_helper|drm_panel_orientation_quirks|e1000|ebtable_broute|ebtable_filter|ebtable_nat|ebtables|edac_core|ext4|fb_sys_fops|floppy|fuse|gf128mul|ghash_clmulni_intel|glue_helper|grace|i2c_algo_bit|i2c_core|i2c_piix4|i7core_edac|intel_powerclamp|ioatdma|ip_set|ip_tables|ip6_tables|ip6t_REJECT|ip6t_rpfilter|ip6table_filter|ip6table_mangle|ip6table_nat|ip6ta ble_raw|ip6table_security|ipmi_devintf|ipmi_msghandler|ipmi_si|ipmi_ssif|ipt_MASQUERADE|ipt_REJECT|iptable_filter|iptable_mangle|iptable_nat|iptable_raw|iptable_security|iTCO_vendor_support|iTCO_wdt|jbd2|joydev|kvm|kvm_intel|libahci|libata|libcrc32c|llc|lockd|lpc_ich|lrw|mbcache|megaraid_sas|mfd_core|mgag200|Module|mptbase|mptscsih|mptspi|nf_conntrack|nf_conntrack_ipv4|nf_conntrack_ipv6|nf_defrag_ipv4|nf_defrag_ipv6|nf_nat|nf_nat_ipv4|nf_nat_ipv6|nf_nat_masquerade_ipv4|nfnetlink|nfnetlink_log|nfnetlink_queue|nfs_acl|nfsd|parport|parport_pc|pata_acpi|pcspkr|ppdev|rfkill|sch_fq_codel|scsi_transport_spi|sd_mod|serio_raw|sg|shpchp|snd|snd_ac97_codec|snd_ens1371|snd_page_alloc|snd_pcm|snd_rawmidi|snd_seq|snd_seq_device|snd_seq_midi|snd_seq_midi_event|snd_timer|soundcore|sr_mod|stp|sunrpc|syscopyarea|sysfillrect|sysimgblt|tcp_lp|ttm|tun|uvcvideo|videobuf2_core|videobuf2_memops|videobuf2_vmalloc|videodev|virtio|virtio_balloon|virtio_console|virtio_net|virtio_pci|virtio_ring|virtio_scsi|vmhgfs|vmw_balloon|vmw_vmci|vmw_vsock_vmci_transport|vmware_balloon|vmwgfx|vsock|xfs|xt_CHECKSUM|xt_conntrack|xt_state|raid*|tcpbbr|btrfs|.*diag|psmouse|ufs|linear|msdos|cpuid|veth|xt_tcpudp|xfrm_user|xfrm_algo|xt_addrtype|br_netfilter|input_leds|sch_fq|ib_iser|rdma_cm|iw_cm|ib_cm|ib_core|.*scsi.*|tcp_bbr|pcbc|autofs4|multipath|hfs.*|minix|ntfs|vfat|jfs|usbcore|usb_common|ehci_hcd|uhci_hcd|ecb|crc32c_generic|button|hid|usbhid|evdev|hid_generic|overlay|xt_nat|qnx4|sb_edac|acpi_cpufreq|ixgbe|pf_ring|tcp_htcp|cfg80211|x86_pkg_temp_thermal|mei_me|mei|processor|thermal_sys|lp|enclosure|ses|ehci_pci|igb|i2c_i801|pps_core|isofs|nls_utf8|xt_REDIRECT|xt_multiport|iosf_mbi|qxl|cdc_ether|usbnet" | tee -a "$vuln"
469
+
lsmod | ag -v "ablk_helper|ac97_bus|acpi_power_meter|aesni_intel|ahci|ata_generic|ata_piix|auth_rpcgss|binfmt_misc|bluetooth|bnep|bnx2|bridge|cdrom|cirrus|coretemp|crc_t10dif|crc32_pclmul|crc32c_intel|crct10dif_common|crct10dif_generic|crct10dif_pclmul|cryptd|dca|dcdbas|dm_log|dm_mirror|dm_mod|dm_region_hash|drm|drm_kms_helper|drm_panel_orientation_quirks|e1000|ebtable_broute|ebtable_filter|ebtable_nat|ebtables|edac_core|ext4|fb_sys_fops|floppy|fuse|gf128mul|ghash_clmulni_intel|glue_helper|grace|i2c_algo_bit|i2c_core|i2c_piix4|i7core_edac|intel_powerclamp|ioatdma|ip_set|ip_tables|ip6_tables|ip6t_REJECT|ip6t_rpfilter|ip6table_filter|ip6table_mangle|ip6table_nat|ip6ta ble_raw|ip6table_security|ipmi_devintf|ipmi_msghandler|ipmi_si|ipmi_ssif|ipt_MASQUERADE|ipt_REJECT|iptable_filter|iptable_mangle|iptable_nat|iptable_raw|iptable_security|iTCO_vendor_support|iTCO_wdt|jbd2|joydev|kvm|kvm_intel|libahci|libata|libcrc32c|llc|lockd|lpc_ich|lrw|mbcache|megaraid_sas|mfd_core|mgag200|Module|mptbase|mptscsih|mptspi|nf_conntrack|nf_conntrack_ipv4|nf_conntrack_ipv6|nf_defrag_ipv4|nf_defrag_ipv6|nf_nat|nf_nat_ipv4|nf_nat_ipv6|nf_nat_masquerade_ipv4|nfnetlink|nfnetlink_log|nfnetlink_queue|nfs_acl|nfsd|parport|parport_pc|pata_acpi|pcspkr|ppdev|rfkill|sch_fq_codel|scsi_transport_spi|sd_mod|serio_raw|sg|shpchp|snd|snd_ac97_codec|snd_ens1371|snd_page_alloc|snd_pcm|snd_rawmidi|snd_seq|snd_seq_device|snd_seq_midi|snd_seq_midi_event|snd_timer|soundcore|sr_mod|stp|sunrpc|syscopyarea|sysfillrect|sysimgblt|tcp_lp|ttm|tun|uvcvideo|videobuf2_core|videobuf2_memops|videobuf2_vmalloc|videodev|virtio|virtio_balloon|virtio_console|virtio_net|virtio_pci|virtio_ring|virtio_scsi|vmhgfs|vmw_balloon|vmw_vmci|vmw_vsock_vmci_transport|vmware_balloon|vmwgfx|vsock|xfs|xt_CHECKSUM|xt_conntrack|xt_state|raid*|tcpbbr|btrfs|.*diag|psmouse|ufs|linear|msdos|cpuid|veth|xt_tcpudp|xfrm_user|xfrm_algo|xt_addrtype|br_netfilter|input_leds|sch_fq|ib_iser|rdma_cm|iw_cm|ib_cm|ib_core|.*scsi.*|tcp_bbr|pcbc|autofs4|multipath|hfs.*|minix|ntfs|vfat|jfs|usbcore|usb_common|ehci_hcd|uhci_hcd|ecb|crc32c_generic|button|hid|usbhid|evdev|hid_generic|overlay|xt_nat|qnx4|sb_edac|acpi_cpufreq|ixgbe|pf_ring|tcp_htcp|cfg80211|x86_pkg_temp_thermal|mei_me|mei|processor|thermal_sys|lp|enclosure|ses|ehci_pci|igb|i2c_i801|pps_core|isofs|nls_utf8|xt_REDIRECT|xt_multiport|iosf_mbi|qxl|cdc_ether|usbnet|ip6table_raw|skx_edac|intel_rapl|wmi|acpi_pad|ast|i40e|ptp|nfit|libnvdimm|bpfilter|failover" | tee -a "$vuln"
461
470
echo -e "\n"| tee -a "$vuln"
462
471
463
472
echo -e "\e[00;31m[+]Rootkit 内核模块\e[00m"| tee -a "$vuln"
@@ -471,7 +480,7 @@ rootkit_check() {
471
480
echo -e "\n"| tee -a "$vuln"
472
481
473
482
echo -e "\e[00;31m[+]可疑的.ko模块\e[00m"| tee -a "$vuln"
474
-
find / ! -path "/proc/*"! -path "/usr/lib/modules/*"! -path "/boot/*" -regextype posix-extended -regex '.*\.ko'| tee -a "$vuln"
483
+
find / ! -path "/proc/*"! -path "/usr/lib/modules/*"! -path "/lib/modules/*"! -path "/boot/*" -regextype posix-extended -regex '.*\.ko'| tee -a "$vuln"
475
484
echo -e "\n"| tee -a "$vuln"
476
485
}
477
486
@@ -501,13 +510,23 @@ ssh_check() {
501
510
fi
502
511
echo -e "\n"| tee -a "$vuln"
503
512
513
+
#ssh后门配置检查
514
+
echo -e "\e[00;31m[+]SSH 软连接后门 \e[00m"| tee -a "$vuln"
515
+
if ps -ef | ag '\s+\-oport=\d+'>/dev/null 2>&1;then
516
+
ps -ef | ag '\s+\-oport=\d+'| tee -a "$vuln"
517
+
else
518
+
echo"未检测到SSH软连接后门"| tee -a "$vuln"
519
+
520
+
fi
521
+
echo -e "\n"| tee -a "$vuln"
522
+
504
523
echo -e "\e[00;31m[+]SSH inetd后门检查 \e[00m"| tee -a "$vuln"
505
524
if [ -e"/etc/inetd.conf" ];then
506
525
grep -E '(bash -i)'</etc/inetd.conf | tee -a "$vuln"
507
526
fi
508
527
echo -e "\n"| tee -a "$vuln"
509
528
510
-
echo -e "\e[00;31m[+]SSH key\e[00m"| tee -a "$filename"
529
+
echo -e "\e[00;31m[+]SSH key\e[00m"| tee -a "$vuln"
511
530
sshkey=${HOME}/.ssh/authorized_keys
512
531
if [ -e"${sshkey}" ];then
513
532
# shellcheck disable=SC2002
@@ -562,26 +581,6 @@ miner_check() {
562
581
echo -e "\n"| tee -a "$vuln"
563
582
}
564
583
565
-
rkhunter_install() {
566
-
echo -e "############ Rkhunter 安装 ############\n"| tee -a "$filename"
567
-
echo -e "\e[00;31m[+]Rkhunter查杀\e[00m"| tee -a "$filename"
568
-
if rkhunter >/dev/null 2>&1;then
569
-
rkhunter --checkall --sk | ag -v 'OK|Not found|None found'
570
-
else
571
-
if [ -e"/tmp/rkhunter.tar.gz" ];then
572
-
cd /tmp && tar -zxvf /tmp/rkhunter.tar.gz >/dev/null 2>&1
573
-
cd /tmp/rkhunter-1.4.6/ && ./installer.sh --install >/dev/null 2>&1
574
-
rkhunter --checkall --sk | ag -v 'OK|Not found|None found'
0 commit comments