Linux vmi2545633.contaboserver.net 6.1.0-32-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.129-1 (2025-03-06) x86_64
Apache/2.4.62 (Debian)
Server IP : 127.0.0.1 & Your IP : 127.0.0.1
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
sbin /
Delete
Unzip
Name
Size
Permission
Date
Action
a2disconf
15.86
KB
-rwxr-xr-x
2024-10-04 15:16
a2dismod
15.86
KB
-rwxr-xr-x
2024-10-04 15:16
a2dissite
15.86
KB
-rwxr-xr-x
2024-10-04 15:16
a2enconf
15.86
KB
-rwxr-xr-x
2024-10-04 15:16
a2enmod
15.86
KB
-rwxr-xr-x
2024-10-04 15:16
a2ensite
15.86
KB
-rwxr-xr-x
2024-10-04 15:16
a2query
9.6
KB
-rwxr-xr-x
2024-10-04 15:21
aa-remove-unknown
3.13
KB
-rwxr-xr-x
2023-02-14 11:49
aa-status
38.3
KB
-rwxr-xr-x
2023-02-14 11:49
aa-teardown
137
B
-rwxr-xr-x
2022-11-22 00:54
accessdb
14.46
KB
-rwxr-xr-x
2023-03-12 22:23
add-shell
1.03
KB
-rwxr-xr-x
2023-07-28 23:46
addgnupghome
3
KB
-rwxr-xr-x
2023-03-26 13:03
addgroup
47.25
KB
-rwxr-xr-x
2023-05-25 15:54
adduser
47.25
KB
-rwxr-xr-x
2023-05-25 15:54
agetty
67.49
KB
-rwxr-xr-x
2024-11-21 20:01
apache2
712.5
KB
-rwxr-xr-x
2024-10-04 15:21
apache2ctl
7.19
KB
-rwxr-xr-x
2024-10-04 15:16
apachectl
7.19
KB
-rwxr-xr-x
2024-10-04 15:16
apparmor_parser
1.39
MB
-rwxr-xr-x
2023-02-14 11:49
apparmor_status
38.3
KB
-rwxr-xr-x
2023-02-14 11:49
applygnupgdefaults
2.17
KB
-rwxr-xr-x
2023-03-26 13:03
arpd
104.48
KB
-rwxr-xr-x
2023-05-22 13:19
arptables
223.16
KB
-rwxr-xr-x
2023-01-16 13:44
arptables-nft
223.16
KB
-rwxr-xr-x
2023-01-16 13:44
arptables-nft-restore
223.16
KB
-rwxr-xr-x
2023-01-16 13:44
arptables-nft-save
223.16
KB
-rwxr-xr-x
2023-01-16 13:44
arptables-restore
223.16
KB
-rwxr-xr-x
2023-01-16 13:44
arptables-save
223.16
KB
-rwxr-xr-x
2023-01-16 13:44
aspell-autobuildhash
13.36
KB
-rwxr-xr-x
2023-03-14 21:17
badblocks
34.25
KB
-rwxr-xr-x
2023-03-05 03:16
biosdecode
27.13
KB
-rwxr-xr-x
2022-06-30 18:37
blkdeactivate
15.96
KB
-rwxr-xr-x
2022-10-19 19:37
blkdiscard
34.31
KB
-rwxr-xr-x
2024-11-21 20:01
blkid
122.34
KB
-rwxr-xr-x
2024-11-21 20:01
blkzone
78.31
KB
-rwxr-xr-x
2024-11-21 20:01
blockdev
78.31
KB
-rwxr-xr-x
2024-11-21 20:01
bridge
152.54
KB
-rwxr-xr-x
2023-05-22 13:19
capsh
53.29
KB
-rwxr-xr-x
2023-05-15 18:34
cfdisk
106.66
KB
-rwxr-xr-x
2024-11-21 20:01
chcpu
46.3
KB
-rwxr-xr-x
2024-11-21 20:01
check_forensic
952
B
-rwxr-xr-x
2011-04-26 15:10
chgpasswd
66.29
KB
-rwxr-xr-x
2023-03-23 12:40
chmem
66.31
KB
-rwxr-xr-x
2024-11-21 20:01
chpasswd
62.36
KB
-rwxr-xr-x
2023-03-23 12:40
chroot
46.98
KB
-rwxr-xr-x
2022-09-20 15:27
cpgr
60.43
KB
-rwxr-xr-x
2023-03-23 12:40
cppw
60.43
KB
-rwxr-xr-x
2023-03-23 12:40
cron
50.56
KB
-rwxr-xr-x
2023-03-02 07:33
ctrlaltdel
38.3
KB
-rwxr-xr-x
2024-11-21 20:01
dcb
144.6
KB
-rwxr-xr-x
2023-05-22 13:19
debugfs
233.83
KB
-rwxr-xr-x
2023-03-05 03:16
delgroup
16.33
KB
-rwxr-xr-x
2023-05-25 15:54
deluser
16.33
KB
-rwxr-xr-x
2023-05-25 15:54
depmod
174.27
KB
-rwxr-xr-x
2022-12-10 00:02
devlink
220.98
KB
-rwxr-xr-x
2023-05-22 13:19
dhclient
2.63
MB
-rwxr-xr-x
2023-04-17 12:20
dhclient-script
14.21
KB
-rwxr-xr-x
2023-04-17 12:20
discover
23.23
KB
-rwxr-xr-x
2022-01-09 07:48
discover-modprobe
4.9
KB
-rwxr-xr-x
2022-01-09 07:48
discover-pkginstall
5.66
KB
-rwxr-xr-x
2022-01-09 07:48
dmidecode
127.16
KB
-rwxr-xr-x
2022-06-30 18:37
dmsetup
166.98
KB
-rwxr-xr-x
2022-10-19 19:37
dmstats
166.98
KB
-rwxr-xr-x
2022-10-19 19:37
dpkg-fsys-usrunmess
16.99
KB
-rwxr-xr-x
2023-05-11 02:04
dpkg-preconfigure
3.83
KB
-rwxr-xr-x
2023-01-08 21:50
dpkg-reconfigure
4.38
KB
-rwxr-xr-x
2023-01-08 21:50
dumpe2fs
30.31
KB
-rwxr-xr-x
2023-03-05 03:16
e2freefrag
14.3
KB
-rwxr-xr-x
2023-03-05 03:16
e2fsck
348.27
KB
-rwxr-xr-x
2023-03-05 03:16
e2image
54.45
KB
-rwxr-xr-x
2023-03-05 03:16
e2label
114.52
KB
-rwxr-xr-x
2023-03-05 03:16
e2mmpstatus
30.31
KB
-rwxr-xr-x
2023-03-05 03:16
e2scrub
7.12
KB
-rwxr-xr-x
2023-03-05 03:16
e2scrub_all
5.27
KB
-rwxr-xr-x
2023-03-05 03:16
e2undo
22.3
KB
-rwxr-xr-x
2023-03-05 03:16
e4crypt
26.3
KB
-rwxr-xr-x
2023-03-05 03:16
e4defrag
30.23
KB
-rwxr-xr-x
2023-03-05 03:16
ebtables
223.16
KB
-rwxr-xr-x
2023-01-16 13:44
ebtables-nft
223.16
KB
-rwxr-xr-x
2023-01-16 13:44
ebtables-nft-restore
223.16
KB
-rwxr-xr-x
2023-01-16 13:44
ebtables-nft-save
223.16
KB
-rwxr-xr-x
2023-01-16 13:44
ebtables-restore
223.16
KB
-rwxr-xr-x
2023-01-16 13:44
ebtables-save
223.16
KB
-rwxr-xr-x
2023-01-16 13:44
ebtables-translate
223.16
KB
-rwxr-xr-x
2023-01-16 13:44
faillock
14.24
KB
-rwxr-xr-x
2023-09-21 20:55
fdisk
158.35
KB
-rwxr-xr-x
2024-11-21 20:01
filefrag
18.26
KB
-rwxr-xr-x
2023-03-05 03:16
findfs
14.3
KB
-rwxr-xr-x
2024-11-21 20:01
fsck
54.36
KB
-rwxr-xr-x
2024-11-21 20:01
fsck.cramfs
42.37
KB
-rwxr-xr-x
2024-11-21 20:01
fsck.ext2
348.27
KB
-rwxr-xr-x
2023-03-05 03:16
fsck.ext3
348.27
KB
-rwxr-xr-x
2023-03-05 03:16
fsck.ext4
348.27
KB
-rwxr-xr-x
2023-03-05 03:16
fsck.minix
122.34
KB
-rwxr-xr-x
2024-11-21 20:01
fsfreeze
14.3
KB
-rwxr-xr-x
2024-11-21 20:01
fstab-decode
14.23
KB
-rwxr-xr-x
2023-04-03 06:25
fstrim
74.31
KB
-rwxr-xr-x
2024-11-21 20:01
genl
116.51
KB
-rwxr-xr-x
2023-05-22 13:19
getcap
14.23
KB
-rwxr-xr-x
2023-05-15 18:34
getpcaps
14.23
KB
-rwxr-xr-x
2023-05-15 18:34
getty
67.49
KB
-rwxr-xr-x
2024-11-21 20:01
groupadd
99.04
KB
-rwxr-xr-x
2023-03-23 12:40
groupdel
90.85
KB
-rwxr-xr-x
2023-03-23 12:40
groupmems
66.33
KB
-rwxr-xr-x
2023-03-23 12:40
groupmod
99.01
KB
-rwxr-xr-x
2023-03-23 12:40
grpck
66.3
KB
-rwxr-xr-x
2023-03-23 12:40
grpconv
58.14
KB
-rwxr-xr-x
2023-03-23 12:40
grpunconv
58.14
KB
-rwxr-xr-x
2023-03-23 12:40
grub-bios-setup
934.42
KB
-rwxr-xr-x
2023-10-02 14:11
grub-install
1.14
MB
-rwxr-xr-x
2023-10-02 14:11
grub-macbless
922.26
KB
-rwxr-xr-x
2023-10-02 14:11
grub-mkconfig
8.46
KB
-rwxr-xr-x
2023-10-02 14:11
grub-mkdevicemap
216.7
KB
-rwxr-xr-x
2023-10-02 14:11
grub-probe
934.57
KB
-rwxr-xr-x
2023-10-02 14:11
grub-reboot
4.73
KB
-rwxr-xr-x
2023-10-02 14:11
grub-set-default
3.47
KB
-rwxr-xr-x
2023-10-02 14:11
halt
1.29
MB
-rwxr-xr-x
2025-03-06 14:56
httxt2dbm
14.23
KB
-rwxr-xr-x
2024-10-04 15:21
hwclock
86.44
KB
-rwxr-xr-x
2024-11-21 20:01
iconvconfig
30.84
KB
-rwxr-xr-x
2025-03-06 22:46
ifdown
86.16
KB
-rwxr-xr-x
2023-01-24 13:07
ifquery
86.16
KB
-rwxr-xr-x
2023-01-24 13:07
ifup
86.16
KB
-rwxr-xr-x
2023-01-24 13:07
init
90.38
KB
-rwxr-xr-x
2025-03-06 14:56
insmod
174.27
KB
-rwxr-xr-x
2022-12-10 00:02
install-sgmlcatalog
4.44
KB
-rwxr-xr-x
2022-10-06 18:03
installkernel
2.6
KB
-rwxr-xr-x
2023-07-28 23:46
invoke-rc.d
16.13
KB
-rwxr-xr-x
2022-07-02 15:23
ip
674.82
KB
-rwxr-xr-x
2023-05-22 13:19
ip6tables
223.16
KB
-rwxr-xr-x
2023-01-16 13:44
ip6tables-apply
6.87
KB
-rwxr-xr-x
2023-01-12 10:27
ip6tables-legacy
88.98
KB
-rwxr-xr-x
2023-01-16 13:44
ip6tables-legacy-restore
88.98
KB
-rwxr-xr-x
2023-01-16 13:44
ip6tables-legacy-save
88.98
KB
-rwxr-xr-x
2023-01-16 13:44
ip6tables-nft
223.16
KB
-rwxr-xr-x
2023-01-16 13:44
ip6tables-nft-restore
223.16
KB
-rwxr-xr-x
2023-01-16 13:44
ip6tables-nft-save
223.16
KB
-rwxr-xr-x
2023-01-16 13:44
ip6tables-restore
223.16
KB
-rwxr-xr-x
2023-01-16 13:44
ip6tables-restore-translate
223.16
KB
-rwxr-xr-x
2023-01-16 13:44
ip6tables-save
223.16
KB
-rwxr-xr-x
2023-01-16 13:44
ip6tables-translate
223.16
KB
-rwxr-xr-x
2023-01-16 13:44
iptables
223.16
KB
-rwxr-xr-x
2023-01-16 13:44
iptables-apply
6.87
KB
-rwxr-xr-x
2023-01-12 10:27
iptables-legacy
88.98
KB
-rwxr-xr-x
2023-01-16 13:44
iptables-legacy-restore
88.98
KB
-rwxr-xr-x
2023-01-16 13:44
iptables-legacy-save
88.98
KB
-rwxr-xr-x
2023-01-16 13:44
iptables-nft
223.16
KB
-rwxr-xr-x
2023-01-16 13:44
iptables-nft-restore
223.16
KB
-rwxr-xr-x
2023-01-16 13:44
iptables-nft-save
223.16
KB
-rwxr-xr-x
2023-01-16 13:44
iptables-restore
223.16
KB
-rwxr-xr-x
2023-01-16 13:44
iptables-restore-translate
223.16
KB
-rwxr-xr-x
2023-01-16 13:44
iptables-save
223.16
KB
-rwxr-xr-x
2023-01-16 13:44
iptables-translate
223.16
KB
-rwxr-xr-x
2023-01-16 13:44
isosize
30.31
KB
-rwxr-xr-x
2024-11-21 20:01
ispell-autobuildhash
15.52
KB
-rwxr-xr-x
2023-03-14 21:17
iucode-tool
58.26
KB
-rwxr-xr-x
2023-02-17 19:51
iucode_tool
58.26
KB
-rwxr-xr-x
2023-02-17 19:51
kbdrate
14.52
KB
-rwxr-xr-x
2023-03-23 09:34
killall5
26.31
KB
-rwxr-xr-x
2023-04-03 06:25
ldattach
34.31
KB
-rwxr-xr-x
2024-11-21 20:01
ldconfig
959.84
KB
-rwxr-xr-x
2025-03-06 22:46
locale-gen
1.38
KB
-rwxr-xr-x
2025-03-06 22:46
logrotate
98.16
KB
-rwxr-xr-x
2022-12-14 18:16
logsave
14.09
KB
-rwxr-xr-x
2023-03-05 03:16
losetup
114.42
KB
-rwxr-xr-x
2024-11-21 20:01
lsmod
174.27
KB
-rwxr-xr-x
2022-12-10 00:02
make-ssl-cert
6.65
KB
-rwxr-xr-x
2021-12-30 16:52
mariadbd
25.77
MB
-rwxr-xr-x
2025-02-19 00:56
mke2fs
138.58
KB
-rwxr-xr-x
2023-03-05 03:16
mkfs
14.3
KB
-rwxr-xr-x
2024-11-21 20:01
mkfs.bfs
34.31
KB
-rwxr-xr-x
2024-11-21 20:01
mkfs.cramfs
42.24
KB
-rwxr-xr-x
2024-11-21 20:01
mkfs.ext2
138.58
KB
-rwxr-xr-x
2023-03-05 03:16
mkfs.ext3
138.58
KB
-rwxr-xr-x
2023-03-05 03:16
mkfs.ext4
138.58
KB
-rwxr-xr-x
2023-03-05 03:16
mkfs.minix
110.32
KB
-rwxr-xr-x
2024-11-21 20:01
mkhomedir_helper
22.27
KB
-rwxr-xr-x
2023-09-21 20:55
mkinitramfs
12.4
KB
-rwxr-xr-x
2024-08-24 23:14
mklost+found
14.23
KB
-rwxr-xr-x
2023-03-05 03:16
mkswap
114.31
KB
-rwxr-xr-x
2024-11-21 20:01
modinfo
174.27
KB
-rwxr-xr-x
2022-12-10 00:02
modprobe
174.27
KB
-rwxr-xr-x
2022-12-10 00:02
mysqld
25.77
MB
-rwxr-xr-x
2025-02-19 00:56
newusers
102.92
KB
-rwxr-xr-x
2023-03-23 12:40
nfnl_osf
18.23
KB
-rwxr-xr-x
2023-01-16 13:44
nft
26.15
KB
-rwxr-xr-x
2023-09-16 05:47
nginx
1.2
MB
-rwxr-xr-x
2025-02-17 19:40
nologin
14.23
KB
-rwxr-xr-x
2023-03-23 12:40
ownership
14.38
KB
-rwxr-xr-x
2022-06-30 18:37
pam-auth-update
20.79
KB
-rwxr-xr-x
2023-09-21 20:55
pam_getenv
2.82
KB
-rwxr-xr-x
2023-09-21 20:55
pam_namespace_helper
467
B
-rwxr-xr-x
2023-09-21 20:55
pam_timestamp_check
14.24
KB
-rwxr-xr-x
2023-09-21 20:55
php-fpm8.4
5.68
MB
-rwxr-xr-x
2025-10-01 20:26
phpdismod
7.11
KB
-rwxr-xr-x
2025-03-09 16:33
phpenmod
7.11
KB
-rwxr-xr-x
2025-03-09 16:33
phpquery
6.24
KB
-rwxr-xr-x
2025-03-09 16:33
pivot_root
14.3
KB
-rwxr-xr-x
2024-11-21 20:01
poweroff
1.29
MB
-rwxr-xr-x
2025-03-06 14:56
pwck
58.26
KB
-rwxr-xr-x
2023-03-23 12:40
pwconv
54.13
KB
-rwxr-xr-x
2023-03-23 12:40
pwhistory_helper
18.24
KB
-rwxr-xr-x
2023-09-21 20:55
pwunconv
54.17
KB
-rwxr-xr-x
2023-03-23 12:40
qemu-ga
985.25
KB
-rwxr-xr-x
2025-01-04 14:47
readprofile
34.34
KB
-rwxr-xr-x
2024-11-21 20:01
reboot
1.29
MB
-rwxr-xr-x
2025-03-06 14:56
remove-default-ispell
2.86
KB
-rwxr-xr-x
2023-03-14 21:17
remove-default-wordlist
2.86
KB
-rwxr-xr-x
2023-03-14 21:17
remove-shell
1.08
KB
-rwxr-xr-x
2023-07-28 23:46
resize2fs
62.3
KB
-rwxr-xr-x
2023-03-05 03:16
rmmod
174.27
KB
-rwxr-xr-x
2022-12-10 00:02
rmt
59.02
KB
-rwxr-xr-x
2024-01-20 09:27
rmt-tar
59.02
KB
-rwxr-xr-x
2024-01-20 09:27
rtacct
44.37
KB
-rwxr-xr-x
2023-05-22 13:19
rtcwake
46.31
KB
-rwxr-xr-x
2024-11-21 20:01
rtmon
112.45
KB
-rwxr-xr-x
2023-05-22 13:19
runlevel
1.29
MB
-rwxr-xr-x
2025-03-06 14:56
runuser
70.31
KB
-rwxr-xr-x
2024-11-21 20:01
select-default-ispell
3.23
KB
-rwxr-xr-x
2023-03-14 21:17
select-default-wordlist
3.21
KB
-rwxr-xr-x
2023-03-14 21:17
service
8.89
KB
-rwxr-xr-x
2022-09-18 01:53
setcap
14.23
KB
-rwxr-xr-x
2023-05-15 18:34
setvesablank
14.51
KB
-rwxr-xr-x
2023-03-23 09:34
sfdisk
142.3
KB
-rwxr-xr-x
2024-11-21 20:01
shadowconfig
2.22
KB
-rwxr-xr-x
2022-11-11 08:28
shutdown
1.29
MB
-rwxr-xr-x
2025-03-06 14:56
split-logfile
2.36
KB
-rwxr-xr-x
2024-10-04 15:21
sshd
1.21
MB
-rwxr-xr-x
2025-02-14 13:06
start-stop-daemon
43.42
KB
-rwxr-xr-x
2023-05-11 02:04
sudo_logsrvd
244.57
KB
-rwxr-xr-x
2023-06-27 11:45
sudo_sendlog
151.41
KB
-rwxr-xr-x
2023-06-27 11:45
sulogin
54.31
KB
-rwxr-xr-x
2024-11-21 20:01
swaplabel
18.3
KB
-rwxr-xr-x
2024-11-21 20:01
swapoff
22.3
KB
-rwxr-xr-x
2024-11-21 20:01
swapon
50.3
KB
-rwxr-xr-x
2024-11-21 20:01
switch_root
18.3
KB
-rwxr-xr-x
2024-11-21 20:01
sysctl
30.31
KB
-rwxr-xr-x
2022-12-19 06:06
tarcat
936
B
-rwxr-xr-x
2024-01-20 09:27
tc
574
KB
-rwxr-xr-x
2023-05-22 13:19
tcptraceroute
1.56
KB
-rwxr-xr-x
2023-02-25 12:24
tcptraceroute.db
1.56
KB
-rwxr-xr-x
2023-02-25 12:24
telinit
1.29
MB
-rwxr-xr-x
2025-03-06 14:56
tipc
152.6
KB
-rwxr-xr-x
2023-05-22 13:19
traceroute
71.23
KB
-rwxr-xr-x
2023-02-25 12:24
tune2fs
114.52
KB
-rwxr-xr-x
2023-03-05 03:16
ufw
4.84
KB
-rwxr-xr-x
2023-05-18 14:03
unix_chkpwd
38.24
KB
-rwxr-sr-x
2023-09-21 20:55
unix_update
38.24
KB
-rwxr-xr-x
2023-09-21 20:55
update-ca-certificates
5.29
KB
-rwxr-xr-x
2023-03-11 08:47
update-catalog
9.17
KB
-rwxr-xr-x
2022-10-06 18:03
update-default-aspell
1
KB
-rwxr-xr-x
2023-03-14 21:17
update-default-ispell
9.68
KB
-rwxr-xr-x
2023-03-14 21:17
update-default-wordlist
7.5
KB
-rwxr-xr-x
2023-03-14 21:17
update-dictcommon-aspell
1
KB
-rwxr-xr-x
2023-03-14 21:17
update-dictcommon-hunspell
782
B
-rwxr-xr-x
2023-03-14 21:17
update-grub
64
B
-rwxr-xr-x
2023-10-02 14:11
update-grub2
64
B
-rwxr-xr-x
2023-10-02 14:11
update-initramfs
6.75
KB
-rwxr-xr-x
2024-08-22 19:30
update-locale
2.99
KB
-rwxr-xr-x
2025-03-06 22:46
update-mime
9.39
KB
-rwxr-xr-x
2021-11-29 13:07
update-passwd
38.49
KB
-rwxr-xr-x
2022-09-20 10:22
update-pciids
1.71
KB
-rwxr-xr-x
2023-01-17 23:50
update-rc.d
17.33
KB
-rwxr-xr-x
2022-07-02 15:23
update-shells
3.89
KB
-rwxr-xr-x
2023-07-28 23:46
update-xmlcatalog
16.88
KB
-rwxr-xr-x
2019-02-27 00:18
upgrade-from-grub-legacy
1.56
KB
-rwxr-xr-x
2023-10-02 14:11
useradd
155.8
KB
-rwxr-xr-x
2023-03-23 12:40
userdel
110.95
KB
-rwxr-xr-x
2023-03-23 12:40
usermod
143.61
KB
-rwxr-xr-x
2023-03-23 12:40
validlocale
1.73
KB
-rwxr-xr-x
2025-03-06 22:46
vcstime
14.38
KB
-rwxr-xr-x
2023-03-23 09:34
vdpa
116.66
KB
-rwxr-xr-x
2023-05-22 13:19
vigr
72.64
KB
-rwxr-xr-x
2023-03-23 12:40
vipw
72.64
KB
-rwxr-xr-x
2023-03-23 12:40
visudo
256.63
KB
-rwxr-xr-x
2023-06-27 11:45
vpddecode
14.51
KB
-rwxr-xr-x
2022-06-30 18:37
wipefs
46.31
KB
-rwxr-xr-x
2024-11-21 20:01
xtables-legacy-multi
88.98
KB
-rwxr-xr-x
2023-01-16 13:44
xtables-monitor
223.16
KB
-rwxr-xr-x
2023-01-16 13:44
xtables-nft-multi
223.16
KB
-rwxr-xr-x
2023-01-16 13:44
zic
58.73
KB
-rwxr-xr-x
2025-03-06 22:46
zramctl
114.42
KB
-rwxr-xr-x
2024-11-21 20:01
Save
Rename
#!/bin/bash # iptables-apply -- a safer way to update iptables remotely # # Usage: # iptables-apply [-hV] [-t timeout] [-w savefile] {[rulesfile]|-c [runcmd]} # # Versions: # * 1.0 Copyright 2006 Martin F. Krafft <madduck@madduck.net> # Original version # * 1.1 Copyright 2010 GW <gw.2010@tnode.com or http://gw.tnode.com/> # Added parameter -c (run command) # Added parameter -w (save successfully applied rules to file) # Major code cleanup # # Released under the terms of the Artistic Licence 2.0 # set -eu PROGNAME="${0##*/}" VERSION=1.1 ### Default settings DEF_TIMEOUT=10 MODE=0 # apply rulesfile mode # MODE=1 # run command mode case "$PROGNAME" in (*6*) SAVE=ip6tables-save RESTORE=ip6tables-restore DEF_RULESFILE="/etc/network/ip6tables.up.rules" DEF_SAVEFILE="$DEF_RULESFILE" DEF_RUNCMD="/etc/network/ip6tables.up.run" ;; (*) SAVE=iptables-save RESTORE=iptables-restore DEF_RULESFILE="/etc/network/iptables.up.rules" DEF_SAVEFILE="$DEF_RULESFILE" DEF_RUNCMD="/etc/network/iptables.up.run" ;; esac ### Functions function blurb() { cat <<-__EOF__ $PROGNAME $VERSION -- a safer way to update iptables remotely __EOF__ } function copyright() { cat <<-__EOF__ $PROGNAME has been published under the terms of the Artistic Licence 2.0. Original version - Copyright 2006 Martin F. Krafft <madduck@madduck.net>. Version 1.1 - Copyright 2010 GW <gw.2010@tnode.com or http://gw.tnode.com/>. __EOF__ } function about() { blurb echo copyright } function usage() { blurb echo cat <<-__EOF__ Usage: $PROGNAME [-hV] [-t timeout] [-w savefile] {[rulesfile]|-c [runcmd]} The script will try to apply a new rulesfile (as output by iptables-save, read by iptables-restore) or run a command to configure iptables and then prompt the user whether the changes are okay. If the new iptables rules cut the existing connection, the user will not be able to answer affirmatively. In this case, the script rolls back to the previous working iptables rules after the timeout expires. Successfully applied rules can also be written to savefile and later used to roll back to this state. This can be used to implement a store last good configuration mechanism when experimenting with an iptables setup script: $PROGNAME -w $DEF_SAVEFILE -c $DEF_RUNCMD When called as ip6tables-apply, the script will use ip6tables-save/-restore and IPv6 default values instead. Default value for rulesfile is '$DEF_RULESFILE'. Options: -t seconds, --timeout seconds Specify the timeout in seconds (default: $DEF_TIMEOUT). -w savefile, --write savefile Specify the savefile where successfully applied rules will be written to (default if empty string is given: $DEF_SAVEFILE). -c runcmd, --command runcmd Run command runcmd to configure iptables instead of applying a rulesfile (default: $DEF_RUNCMD). -h, --help Display this help text. -V, --version Display version information. __EOF__ } function checkcommands() { for cmd in "${COMMANDS[@]}"; do if ! command -v "$cmd" >/dev/null; then echo "Error: needed command not found: $cmd" >&2 exit 127 fi done } function revertrules() { echo -n "Reverting to old iptables rules... " "$RESTORE" <"$TMPFILE" echo "done." } ### Parsing and checking parameters TIMEOUT="$DEF_TIMEOUT" SAVEFILE="" SHORTOPTS="t:w:chV"; LONGOPTS="timeout:,write:,command,help,version"; OPTS=$(getopt -s bash -o "$SHORTOPTS" -l "$LONGOPTS" -n "$PROGNAME" -- "$@") || exit $? for opt in $OPTS; do case "$opt" in (-*) unset OPT_STATE ;; (*) case "${OPT_STATE:-}" in (SET_TIMEOUT) eval TIMEOUT=$opt;; (SET_SAVEFILE) eval SAVEFILE=$opt [ -z "$SAVEFILE" ] && SAVEFILE="$DEF_SAVEFILE" ;; esac ;; esac case "$opt" in (-t|--timeout) OPT_STATE="SET_TIMEOUT";; (-w|--write) OPT_STATE="SET_SAVEFILE";; (-c|--command) MODE=1;; (-h|--help) usage >&2; exit 0;; (-V|--version) about >&2; exit 0;; (--) break;; esac shift done # Validate parameters if [ "$TIMEOUT" -ge 0 ] 2>/dev/null; then TIMEOUT=$(($TIMEOUT)) else echo "Error: timeout must be a positive number" >&2 exit 1 fi if [ -n "$SAVEFILE" -a -e "$SAVEFILE" -a ! -w "$SAVEFILE" ]; then echo "Error: savefile not writable: $SAVEFILE" >&2 exit 8 fi case "$MODE" in (1) # Treat parameter as runcmd (run command mode) RUNCMD="${1:-$DEF_RUNCMD}" if [ ! -x "$RUNCMD" ]; then echo "Error: runcmd not executable: $RUNCMD" >&2 exit 6 fi # Needed commands COMMANDS=(mktemp "$SAVE" "$RESTORE" "$RUNCMD") checkcommands ;; (*) # Treat parameter as rulesfile (apply rulesfile mode) RULESFILE="${1:-$DEF_RULESFILE}"; if [ ! -r "$RULESFILE" ]; then echo "Error: rulesfile not readable: $RULESFILE" >&2 exit 2 fi # Needed commands COMMANDS=(mktemp "$SAVE" "$RESTORE") checkcommands ;; esac ### Begin work # Store old iptables rules to temporary file TMPFILE=`mktemp /tmp/$PROGNAME-XXXXXXXX` trap "rm -f $TMPFILE" EXIT HUP INT QUIT ILL TRAP ABRT BUS \ FPE USR1 SEGV USR2 PIPE ALRM TERM if ! "$SAVE" >"$TMPFILE"; then # An error occured if ! grep -q ipt /proc/modules 2>/dev/null; then echo "Error: iptables support lacking from the kernel" >&2 exit 3 else echo "Error: unknown error saving old iptables rules: $TMPFILE" >&2 exit 4 fi fi # Legacy to stop the fail2ban daemon if present [ -x /etc/init.d/fail2ban ] && /etc/init.d/fail2ban stop # Configure iptables case "$MODE" in (1) # Run command in background and kill it if it times out echo -n "Running command '$RUNCMD'... " "$RUNCMD" & CMD_PID=$! ( sleep "$TIMEOUT"; kill "$CMD_PID" 2>/dev/null; exit 0 ) & if ! wait "$CMD_PID"; then echo "failed." echo "Error: unknown error running command: $RUNCMD" >&2 revertrules exit 7 else echo "done." fi ;; (*) # Apply iptables rulesfile echo -n "Applying new iptables rules from '$RULESFILE'... " if ! "$RESTORE" <"$RULESFILE"; then echo "failed." echo "Error: unknown error applying new iptables rules: $RULESFILE" >&2 revertrules exit 5 else echo "done." fi ;; esac # Prompt user for confirmation echo -n "Can you establish NEW connections to the machine? (y/N) " read -n1 -t "$TIMEOUT" ret 2>&1 || : case "${ret:-}" in (y*|Y*) # Success echo if [ ! -z "$SAVEFILE" ]; then # Write successfully applied rules to the savefile echo "Writing successfully applied rules to '$SAVEFILE'..." if ! "$SAVE" >"$SAVEFILE"; then echo "Error: unknown error writing successfully applied rules: $SAVEFILE" >&2 exit 9 fi fi echo "... then my job is done. See you next time." ;; (*) # Failed echo if [ -z "${ret:-}" ]; then echo "Timeout! Something happened (or did not). Better play it safe..." else echo "No affirmative response! Better play it safe..." fi revertrules exit 255 ;; esac # Legacy to start the fail2ban daemon again [ -x /etc/init.d/fail2ban ] && /etc/init.d/fail2ban start exit 0 # vim:noet:sw=8