Linux tsuru-no-tsurugi 5.15.0-186-generic #196-Ubuntu SMP Sat Jun 20 16:09:34 UTC 2026 x86_64
Apache/2.4.52 (Ubuntu)
Server IP : 192.168.0.18 & Your IP : 216.73.217.105
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
ModemManager
2.09
MB
-rwxr-xr-x
2024-07-18 23:24
NetworkManager
3.1
MB
-rwxr-xr-x
2026-03-19 21:34
a2disconf
15.89
KB
-rwxr-xr-x
2024-03-18 22:41
a2dismod
15.89
KB
-rwxr-xr-x
2024-03-18 22:41
a2dissite
15.89
KB
-rwxr-xr-x
2024-03-18 22:41
a2enconf
15.89
KB
-rwxr-xr-x
2024-03-18 22:41
a2enmod
15.89
KB
-rwxr-xr-x
2024-03-18 22:41
a2ensite
15.89
KB
-rwxr-xr-x
2024-03-18 22:41
a2query
9.64
KB
-rwxr-xr-x
2026-07-07 01:41
aa-remove-unknown
3
KB
-rwxr-xr-x
2025-08-15 21:17
aa-status
62.62
KB
-rwxr-xr-x
2025-08-15 21:17
aa-teardown
137
B
-rwxr-xr-x
2022-02-10 09:45
accessdb
14.55
KB
-rwxr-xr-x
2022-03-18 04:03
add-shell
1.03
KB
-rwxr-xr-x
2022-03-23 22:49
addgnupghome
3
KB
-rwxr-xr-x
2026-01-06 07:14
addgroup
37.35
KB
-rwxr-xr-x
2021-01-06 15:16
adduser
37.35
KB
-rwxr-xr-x
2021-01-06 15:16
agetty
55.56
KB
-rwxr-xr-x
2026-03-07 01:10
apache2
740.95
KB
-rwxr-xr-x
2026-07-07 01:41
apache2ctl
7.06
KB
-rwxr-xr-x
2024-03-18 22:41
apachectl
7.06
KB
-rwxr-xr-x
2024-03-18 22:41
apparmor_parser
1.48
MB
-rwxr-xr-x
2025-08-15 21:17
apparmor_status
62.62
KB
-rwxr-xr-x
2025-08-15 21:17
applygnupgdefaults
2.17
KB
-rwxr-xr-x
2026-01-06 07:14
arp
61.61
KB
-rwxr-xr-x
2025-05-28 22:13
arpd
26.33
KB
-rwxr-xr-x
2025-10-03 22:53
arptables
219.04
KB
-rwxr-xr-x
2024-01-17 06:14
arptables-nft
219.04
KB
-rwxr-xr-x
2024-01-17 06:14
arptables-nft-restore
219.04
KB
-rwxr-xr-x
2024-01-17 06:14
arptables-nft-save
219.04
KB
-rwxr-xr-x
2024-01-17 06:14
arptables-restore
219.04
KB
-rwxr-xr-x
2024-01-17 06:14
arptables-save
219.04
KB
-rwxr-xr-x
2024-01-17 06:14
badblocks
34.32
KB
-rwxr-xr-x
2023-10-09 10:50
bcache-super-show
14.3
KB
-rwxr-xr-x
2022-03-23 18:42
biosdecode
23.2
KB
-rwxr-xr-x
2024-10-15 05:28
blkdeactivate
15.97
KB
-rwxr-xr-x
2024-11-28 04:04
blkdiscard
22.38
KB
-rwxr-xr-x
2026-03-07 01:10
blkid
50.41
KB
-rwxr-xr-x
2026-03-07 01:10
blkzone
34.38
KB
-rwxr-xr-x
2026-03-07 01:10
blockdev
30.38
KB
-rwxr-xr-x
2026-03-07 01:10
bridge
92.49
KB
-rwxr-xr-x
2025-10-03 22:53
cache_check
1.33
MB
-rwxr-xr-x
2022-03-18 21:36
cache_dump
1.33
MB
-rwxr-xr-x
2022-03-18 21:36
cache_metadata_size
1.33
MB
-rwxr-xr-x
2022-03-18 21:36
cache_repair
1.33
MB
-rwxr-xr-x
2022-03-18 21:36
cache_restore
1.33
MB
-rwxr-xr-x
2022-03-18 21:36
cache_writeback
1.33
MB
-rwxr-xr-x
2022-03-18 21:36
capsh
30.3
KB
-rwxr-xr-x
2026-04-10 00:04
cfdisk
94.73
KB
-rwxr-xr-x
2026-03-07 01:10
cgdisk
150.48
KB
-rwxr-xr-x
2022-03-23 22:53
chat
34.31
KB
-rwxr-xr-x
2022-02-25 02:14
chcpu
30.38
KB
-rwxr-xr-x
2026-03-07 01:10
check_forensic
952
B
-rwxr-xr-x
2011-04-27 00:10
chgpasswd
58.13
KB
-rwxr-xr-x
2024-02-06 21:54
chmem
34.38
KB
-rwxr-xr-x
2026-03-07 01:10
chpasswd
54.16
KB
-rwxr-xr-x
2024-02-06 21:54
chroot
38.51
KB
-rwxr-xr-x
2026-01-23 19:51
cpgr
48.29
KB
-rwxr-xr-x
2024-02-06 21:54
cppw
48.29
KB
-rwxr-xr-x
2024-02-06 21:54
cron
50.58
KB
-rwxr-xr-x
2022-03-23 22:49
cryptdisks_start
1.51
KB
-rwxr-xr-x
2022-01-14 06:44
cryptdisks_stop
844
B
-rwxr-xr-x
2022-01-14 06:44
cryptsetup
169.55
KB
-rwxr-xr-x
2024-11-14 12:21
cryptsetup-reencrypt
90.38
KB
-rwxr-xr-x
2024-11-14 12:21
cryptsetup-ssh
23.53
KB
-rwxr-xr-x
2024-11-14 12:21
ctrlaltdel
14.38
KB
-rwxr-xr-x
2026-03-07 01:10
dcb
80.52
KB
-rwxr-xr-x
2025-10-03 22:53
debugfs
229.8
KB
-rwxr-xr-x
2023-10-09 10:50
delgroup
16.11
KB
-rwxr-xr-x
2021-01-06 15:16
deluser
16.11
KB
-rwxr-xr-x
2021-01-06 15:16
depmod
166.36
KB
-rwxr-xr-x
2026-04-30 21:32
devlink
142.86
KB
-rwxr-xr-x
2025-10-03 22:53
dhclient
442.66
KB
-rwxr-xr-x
2023-02-01 06:54
dhclient-script
15.92
KB
-rwxr-xr-x
2023-02-01 06:54
dmeventd
50.38
KB
-rwxr-xr-x
2024-11-28 04:04
dmidecode
122.98
KB
-rwxr-xr-x
2024-10-15 05:28
dmsetup
171.02
KB
-rwxr-xr-x
2024-11-28 04:04
dmstats
171.02
KB
-rwxr-xr-x
2024-11-28 04:04
dnsmasq
480.24
KB
-rwxr-xr-x
2026-07-14 07:13
dosfsck
82.38
KB
-rwxr-xr-x
2022-03-23 22:51
dosfslabel
38.38
KB
-rwxr-xr-x
2022-03-23 22:51
dovecot
94.43
KB
-rwxr-xr-x
2026-05-29 06:49
dpkg-preconfigure
3.58
KB
-rwxr-xr-x
2022-02-20 23:42
dpkg-reconfigure
4.38
KB
-rwxr-xr-x
2022-02-20 23:42
dumpe2fs
30.31
KB
-rwxr-xr-x
2023-10-09 10:50
e2freefrag
14.3
KB
-rwxr-xr-x
2023-10-09 10:50
e2fsck
351.84
KB
-rwxr-xr-x
2023-10-09 10:50
e2image
42.31
KB
-rwxr-xr-x
2023-10-09 10:50
e2label
102.55
KB
-rwxr-xr-x
2023-10-09 10:50
e2mmpstatus
30.31
KB
-rwxr-xr-x
2023-10-09 10:50
e2scrub
7.13
KB
-rwxr-xr-x
2023-10-09 10:50
e2scrub_all
5.27
KB
-rwxr-xr-x
2023-10-09 10:50
e2undo
22.3
KB
-rwxr-xr-x
2023-10-09 10:50
e4crypt
30.38
KB
-rwxr-xr-x
2023-10-09 10:50
e4defrag
30.3
KB
-rwxr-xr-x
2023-10-09 10:50
ebtables
219.04
KB
-rwxr-xr-x
2024-01-17 06:14
ebtables-nft
219.04
KB
-rwxr-xr-x
2024-01-17 06:14
ebtables-nft-restore
219.04
KB
-rwxr-xr-x
2024-01-17 06:14
ebtables-nft-save
219.04
KB
-rwxr-xr-x
2024-01-17 06:14
ebtables-restore
219.04
KB
-rwxr-xr-x
2024-01-17 06:14
ebtables-save
219.04
KB
-rwxr-xr-x
2024-01-17 06:14
era_check
1.33
MB
-rwxr-xr-x
2022-03-18 21:36
era_dump
1.33
MB
-rwxr-xr-x
2022-03-18 21:36
era_invalidate
1.33
MB
-rwxr-xr-x
2022-03-18 21:36
era_restore
1.33
MB
-rwxr-xr-x
2022-03-18 21:36
escapesrc
22.45
KB
-rwxr-xr-x
2021-11-04 15:01
ethtool
551.48
KB
-rwxr-xr-x
2025-03-07 11:22
eventlogadm
482.38
KB
-rwxr-xr-x
2026-05-22 02:08
faillock
14.15
KB
-rwxr-xr-x
2025-06-12 23:45
fatlabel
38.38
KB
-rwxr-xr-x
2022-03-23 22:51
fdisk
110.42
KB
-rwxr-xr-x
2026-03-07 01:10
filefrag
18.32
KB
-rwxr-xr-x
2023-10-09 10:50
findfs
14.38
KB
-rwxr-xr-x
2026-03-07 01:10
firewalld
7.98
KB
-rwxr-xr-x
2022-03-28 16:48
fixparts
58.48
KB
-rwxr-xr-x
2022-03-23 22:53
fsadm
23.94
KB
-rwxr-xr-x
2024-11-28 04:04
fsck
42.42
KB
-rwxr-xr-x
2026-03-07 01:10
fsck.btrfs
1.16
KB
-rwxr-xr-x
2022-02-25 02:39
fsck.cramfs
30.44
KB
-rwxr-xr-x
2026-03-07 01:10
fsck.ext2
351.84
KB
-rwxr-xr-x
2023-10-09 10:50
fsck.ext3
351.84
KB
-rwxr-xr-x
2023-10-09 10:50
fsck.ext4
351.84
KB
-rwxr-xr-x
2023-10-09 10:50
fsck.fat
82.38
KB
-rwxr-xr-x
2022-03-23 22:51
fsck.minix
54.41
KB
-rwxr-xr-x
2026-03-07 01:10
fsck.msdos
82.38
KB
-rwxr-xr-x
2022-03-23 22:51
fsck.vfat
82.38
KB
-rwxr-xr-x
2022-03-23 22:51
fsck.xfs
1.89
KB
-rwxr-xr-x
2024-10-17 15:49
fsfreeze
14.38
KB
-rwxr-xr-x
2026-03-07 01:10
fstab-decode
18.3
KB
-rwxr-xr-x
2021-12-15 06:17
fstrim
42.38
KB
-rwxr-xr-x
2026-03-07 01:10
gdisk
174.48
KB
-rwxr-xr-x
2022-03-23 22:53
genccode
14.73
KB
-rwxr-xr-x
2021-11-04 15:01
gencmn
14.73
KB
-rwxr-xr-x
2021-11-04 15:01
genl
90.44
KB
-rwxr-xr-x
2025-10-03 22:53
gennorm2
62.9
KB
-rwxr-xr-x
2021-11-04 15:01
gensprep
26.8
KB
-rwxr-xr-x
2021-11-04 15:01
getcap
14.3
KB
-rwxr-xr-x
2026-04-10 00:04
getpcaps
14.3
KB
-rwxr-xr-x
2026-04-10 00:04
getty
55.56
KB
-rwxr-xr-x
2026-03-07 01:10
groupadd
66.91
KB
-rwxr-xr-x
2024-02-06 21:54
groupdel
62.73
KB
-rwxr-xr-x
2024-02-06 21:54
groupmems
54.19
KB
-rwxr-xr-x
2024-02-06 21:54
groupmod
66.82
KB
-rwxr-xr-x
2024-02-06 21:54
grpck
58.13
KB
-rwxr-xr-x
2024-02-06 21:54
grpconv
50.01
KB
-rwxr-xr-x
2024-02-06 21:54
grpunconv
50.01
KB
-rwxr-xr-x
2024-02-06 21:54
grub-install
1.15
MB
-rwxr-xr-x
2022-12-19 06:21
grub-macbless
929.11
KB
-rwxr-xr-x
2022-12-19 06:21
grub-mkconfig
8.6
KB
-rwxr-xr-x
2022-12-19 06:21
grub-mkdevicemap
215.7
KB
-rwxr-xr-x
2022-12-19 06:21
grub-probe
941.36
KB
-rwxr-xr-x
2022-12-19 06:21
grub-reboot
4.73
KB
-rwxr-xr-x
2022-12-19 06:21
grub-set-default
3.47
KB
-rwxr-xr-x
2022-12-19 06:21
halt
1.06
MB
-rwxr-xr-x
2026-06-06 00:40
hdparm
139.43
KB
-rwxr-xr-x
2022-03-23 22:57
httxt2dbm
14.3
KB
-rwxr-xr-x
2026-07-07 01:41
hwclock
50.5
KB
-rwxr-xr-x
2026-03-07 01:10
iconvconfig
30.4
KB
-rwxr-xr-x
2026-01-30 17:20
icupkg
23.1
KB
-rwxr-xr-x
2021-11-04 15:01
ifconfig
77.17
KB
-rwxr-xr-x
2025-05-28 22:13
init
1.76
MB
-rwxr-xr-x
2026-06-06 00:40
insmod
166.36
KB
-rwxr-xr-x
2026-04-30 21:32
installkernel
2.6
KB
-rwxr-xr-x
2022-03-23 22:49
integritysetup
54.07
KB
-rwxr-xr-x
2024-11-14 12:21
invoke-rc.d
16.12
KB
-rwxr-xr-x
2021-12-08 06:55
ip
702.05
KB
-rwxr-xr-x
2025-10-03 22:53
ip6tables
219.04
KB
-rwxr-xr-x
2024-01-17 06:14
ip6tables-apply
6.89
KB
-rwxr-xr-x
2021-01-16 07:03
ip6tables-legacy
96.95
KB
-rwxr-xr-x
2024-01-17 06:14
ip6tables-legacy-restore
96.95
KB
-rwxr-xr-x
2024-01-17 06:14
ip6tables-legacy-save
96.95
KB
-rwxr-xr-x
2024-01-17 06:14
ip6tables-nft
219.04
KB
-rwxr-xr-x
2024-01-17 06:14
ip6tables-nft-restore
219.04
KB
-rwxr-xr-x
2024-01-17 06:14
ip6tables-nft-save
219.04
KB
-rwxr-xr-x
2024-01-17 06:14
ip6tables-restore
219.04
KB
-rwxr-xr-x
2024-01-17 06:14
ip6tables-restore-translate
219.04
KB
-rwxr-xr-x
2024-01-17 06:14
ip6tables-save
219.04
KB
-rwxr-xr-x
2024-01-17 06:14
ip6tables-translate
219.04
KB
-rwxr-xr-x
2024-01-17 06:14
ipmaddr
18.3
KB
-rwxr-xr-x
2025-05-28 22:13
ipset
14.15
KB
-rwxr-xr-x
2022-03-24 20:57
ipset-translate
14.15
KB
-rwxr-xr-x
2022-03-24 20:57
iptables
219.04
KB
-rwxr-xr-x
2024-01-17 06:14
iptables-apply
6.89
KB
-rwxr-xr-x
2021-01-16 07:03
iptables-legacy
96.95
KB
-rwxr-xr-x
2024-01-17 06:14
iptables-legacy-restore
96.95
KB
-rwxr-xr-x
2024-01-17 06:14
iptables-legacy-save
96.95
KB
-rwxr-xr-x
2024-01-17 06:14
iptables-nft
219.04
KB
-rwxr-xr-x
2024-01-17 06:14
iptables-nft-restore
219.04
KB
-rwxr-xr-x
2024-01-17 06:14
iptables-nft-save
219.04
KB
-rwxr-xr-x
2024-01-17 06:14
iptables-restore
219.04
KB
-rwxr-xr-x
2024-01-17 06:14
iptables-restore-translate
219.04
KB
-rwxr-xr-x
2024-01-17 06:14
iptables-save
219.04
KB
-rwxr-xr-x
2024-01-17 06:14
iptables-translate
219.04
KB
-rwxr-xr-x
2024-01-17 06:14
iptunnel
18.3
KB
-rwxr-xr-x
2025-05-28 22:13
irqbalance
66.86
KB
-rwxr-xr-x
2023-10-16 18:22
irqbalance-ui
34.38
KB
-rwxr-xr-x
2023-10-16 18:22
isadump
14.3
KB
-rwxr-xr-x
2022-04-01 06:07
isaset
14.3
KB
-rwxr-xr-x
2022-04-01 06:07
iscsi-iname
14.3
KB
-rwxr-xr-x
2025-02-11 12:06
iscsi_discovery
5.17
KB
-rwxr-xr-x
2021-09-06 08:32
iscsiadm
398.46
KB
-rwxr-xr-x
2025-02-11 12:06
iscsid
298.55
KB
-rwxr-xr-x
2025-02-11 12:06
iscsistart
278.56
KB
-rwxr-xr-x
2025-02-11 12:06
isosize
14.38
KB
-rwxr-xr-x
2026-03-07 01:10
iucode-tool
58.34
KB
-rwxr-xr-x
2021-10-07 19:13
iucode_tool
58.34
KB
-rwxr-xr-x
2021-10-07 19:13
iwpmd
50.59
KB
-rwxr-xr-x
2022-01-28 03:57
kbdrate
18.16
KB
-rwxr-xr-x
2022-12-16 23:14
killall5
30.38
KB
-rwxr-xr-x
2021-12-15 06:17
kpartx
46.16
KB
-rwxr-xr-x
2023-11-01 07:21
ldattach
26.38
KB
-rwxr-xr-x
2026-03-07 01:10
ldconfig
387
B
-rwxr-xr-x
2026-01-30 17:20
ldconfig.real
1.16
MB
-rwxr-xr-x
2026-01-30 17:20
locale-gen
4.29
KB
-rwxr-xr-x
2025-07-15 18:40
logrotate
102.24
KB
-rwxr-xr-x
2022-05-25 23:10
logsave
14.16
KB
-rwxr-xr-x
2023-10-09 10:50
losetup
70.52
KB
-rwxr-xr-x
2026-03-07 01:10
lsmod
166.36
KB
-rwxr-xr-x
2026-04-30 21:32
luksformat
3.32
KB
-rwxr-xr-x
2022-01-14 06:44
lvchange
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
lvconvert
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
lvcreate
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
lvdisplay
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
lvextend
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
lvm
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
lvmconfig
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
lvmdiskscan
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
lvmdump
10.07
KB
-rwxr-xr-x
2024-11-28 04:04
lvmpolld
236.2
KB
-rwxr-xr-x
2024-11-28 04:04
lvmsadc
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
lvmsar
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
lvreduce
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
lvremove
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
lvrename
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
lvresize
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
lvs
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
lvscan
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
make-bcache
22.38
KB
-rwxr-xr-x
2022-03-23 18:42
make-ssl-cert
6.65
KB
-rwxr-xr-x
2021-12-31 01:52
mdadm
601.31
KB
-rwxr-xr-x
2023-04-11 12:22
mdmon
258.44
KB
-rwxr-xr-x
2023-04-11 12:22
mii-tool
26.73
KB
-rwxr-xr-x
2025-05-28 22:13
mkdosfs
50.83
KB
-rwxr-xr-x
2022-03-23 22:51
mke2fs
130.62
KB
-rwxr-xr-x
2023-10-09 10:50
mkfs
14.38
KB
-rwxr-xr-x
2026-03-07 01:10
mkfs.bfs
22.38
KB
-rwxr-xr-x
2026-03-07 01:10
mkfs.btrfs
471.25
KB
-rwxr-xr-x
2022-02-25 02:39
mkfs.cramfs
34.32
KB
-rwxr-xr-x
2026-03-07 01:10
mkfs.ext2
130.62
KB
-rwxr-xr-x
2023-10-09 10:50
mkfs.ext3
130.62
KB
-rwxr-xr-x
2023-10-09 10:50
mkfs.ext4
130.62
KB
-rwxr-xr-x
2023-10-09 10:50
mkfs.fat
50.83
KB
-rwxr-xr-x
2022-03-23 22:51
mkfs.minix
42.39
KB
-rwxr-xr-x
2026-03-07 01:10
mkfs.msdos
50.83
KB
-rwxr-xr-x
2022-03-23 22:51
mkfs.ntfs
70.38
KB
-rwxr-xr-x
2026-07-12 00:55
mkfs.vfat
50.83
KB
-rwxr-xr-x
2022-03-23 22:51
mkfs.xfs
382.77
KB
-rwxr-xr-x
2024-10-17 15:49
mkhomedir_helper
22.17
KB
-rwxr-xr-x
2025-06-12 23:45
mkinitramfs
12.16
KB
-rwxr-xr-x
2024-03-19 21:06
mklost+found
14.3
KB
-rwxr-xr-x
2023-10-09 10:50
mkntfs
70.38
KB
-rwxr-xr-x
2026-07-12 00:55
mksmbpasswd
228
B
-rwxr-xr-x
2026-05-22 02:08
mkswap
46.38
KB
-rwxr-xr-x
2026-03-07 01:10
modinfo
166.36
KB
-rwxr-xr-x
2026-04-30 21:32
modprobe
166.36
KB
-rwxr-xr-x
2026-04-30 21:32
mount.fuse
18.3
KB
-rwxr-xr-x
2022-03-23 22:53
mount.fuse3
18.3
KB
-rwxr-xr-x
2022-03-23 22:53
mount.lowntfs-3g
114.98
KB
-rwxr-xr-x
2026-07-12 00:55
mount.ntfs
159.01
KB
-rwxr-xr-x
2026-07-12 00:55
mount.ntfs-3g
159.01
KB
-rwxr-xr-x
2026-07-12 00:55
mpathpersist
31.05
KB
-rwxr-xr-x
2023-11-01 07:21
multipath
34.15
KB
-rwxr-xr-x
2023-11-01 07:21
multipathd
134.26
KB
-rwxr-xr-x
2023-11-01 07:21
mysqld
53.01
MB
-rwxr-xr-x
2026-06-20 20:54
nameif
14.48
KB
-rwxr-xr-x
2025-05-28 22:13
needrestart
38.73
KB
-rwxr-xr-x
2025-09-11 04:15
netplan
802
B
-rwxr-xr-x
2023-12-13 01:56
newusers
74.73
KB
-rwxr-xr-x
2024-02-06 21:54
nfnl_osf
18.3
KB
-rwxr-xr-x
2024-01-17 06:14
nft
26.23
KB
-rwxr-xr-x
2026-02-24 17:38
nginx
1.18
MB
-rwxr-xr-x
2026-07-21 04:12
nmbd
262.33
KB
-rwxr-xr-x
2026-05-22 02:08
nologin
14.3
KB
-rwxr-xr-x
2024-02-06 21:54
ntfsclone
50.38
KB
-rwxr-xr-x
2026-07-12 00:55
ntfscp
34.38
KB
-rwxr-xr-x
2026-07-12 00:55
ntfslabel
22.38
KB
-rwxr-xr-x
2026-07-12 00:55
ntfsresize
62.39
KB
-rwxr-xr-x
2026-07-12 00:55
ntfsundelete
50.38
KB
-rwxr-xr-x
2026-07-12 00:55
on_ac_power
3.7
KB
-rwxr-xr-x
2025-06-04 23:47
overlayroot-chroot
2.45
KB
-rwxr-xr-x
2020-08-18 01:00
ovs-bugtool
45.51
KB
-rwxr-xr-x
2026-03-25 00:13
ovs-vswitchd
2.57
MB
-rwxr-xr-x
2026-03-25 00:13
ovsdb-server
580.05
KB
-rwxr-xr-x
2026-03-25 00:13
ownership
14.45
KB
-rwxr-xr-x
2024-10-15 05:28
pam-auth-update
20.5
KB
-rwxr-xr-x
2024-11-17 19:17
pam_extrausers_chkpwd
22.15
KB
-rwxr-sr-x
2025-06-12 23:45
pam_extrausers_update
30.15
KB
-rwxr-xr-x
2025-06-12 23:45
pam_getenv
2.82
KB
-rwxr-xr-x
2024-11-17 19:17
pam_timestamp_check
14.15
KB
-rwxr-xr-x
2025-06-12 23:45
paperconfig
4.07
KB
-rwxr-xr-x
2022-03-24 21:14
parted
86.4
KB
-rwxr-xr-x
2022-03-25 01:22
partprobe
14.38
KB
-rwxr-xr-x
2022-03-25 01:22
pdata_tools
1.33
MB
-rwxr-xr-x
2022-03-18 21:36
phpdismod
7.11
KB
-rwxr-xr-x
2025-11-24 22:54
phpenmod
7.11
KB
-rwxr-xr-x
2025-11-24 22:54
phpquery
6.24
KB
-rwxr-xr-x
2025-11-24 22:54
pivot_root
14.38
KB
-rwxr-xr-x
2026-03-07 01:10
plipconfig
14.3
KB
-rwxr-xr-x
2025-05-28 22:13
plymouthd
150.55
KB
-rwxr-xr-x
2022-03-18 19:45
postalias
22.3
KB
-rwxr-xr-x
2026-05-06 00:48
postcat
22.37
KB
-rwxr-xr-x
2026-05-06 00:48
postconf
183.8
KB
-rwxr-xr-x
2026-05-06 00:48
postdrop
22.42
KB
-r-xr-sr-x
2026-05-06 00:48
postfix
18.38
KB
-rwxr-xr-x
2026-05-06 00:48
postfix-add-filter
4.84
KB
-rwxr-xr-x
2026-05-06 00:48
postfix-add-policy
3.77
KB
-rwxr-xr-x
2026-05-06 00:48
postfix-collate
2.87
KB
-rwxr-xr-x
2026-05-06 00:48
postkick
14.3
KB
-rwxr-xr-x
2026-05-06 00:48
postlock
14.3
KB
-rwxr-xr-x
2026-05-06 00:48
postlog
14.45
KB
-rwxr-xr-x
2026-05-06 00:48
postmap
22.3
KB
-rwxr-xr-x
2026-05-06 00:48
postmulti
30.69
KB
-rwxr-xr-x
2026-05-06 00:48
postqueue
22.38
KB
-r-xr-sr-x
2026-05-06 00:48
postsuper
30.59
KB
-rwxr-xr-x
2026-05-06 00:48
posttls-finger
42.38
KB
-rwxr-xr-x
2026-05-06 00:48
poweroff
1.06
MB
-rwxr-xr-x
2026-06-06 00:40
pppd
414.56
KB
-rwsr-xr--
2022-02-25 02:14
pppdump
18.39
KB
-rwxr-xr-x
2022-02-25 02:14
pppoe-discovery
22.3
KB
-rwxr-xr-x
2022-02-25 02:14
pppstats
18.3
KB
-rwxr-xr-x
2022-02-25 02:14
pptp
63.05
KB
-rwxr-xr-x
2022-03-25 01:23
pptpsetup
6.46
KB
-rwxr-xr-x
2022-03-25 01:23
pvchange
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
pvck
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
pvcreate
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
pvdisplay
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
pvmove
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
pvremove
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
pvresize
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
pvs
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
pvscan
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
pwck
50.13
KB
-rwxr-xr-x
2024-02-06 21:54
pwconv
46.01
KB
-rwxr-xr-x
2024-02-06 21:54
pwunconv
42.01
KB
-rwxr-xr-x
2024-02-06 21:54
qmqp-sink
18.3
KB
-rwxr-xr-x
2026-05-06 00:48
qmqp-source
22.31
KB
-rwxr-xr-x
2026-05-06 00:48
qshape
12.55
KB
-rwxr-xr-x
2026-05-06 00:48
rarp
32.33
KB
-rwxr-xr-x
2025-05-28 22:13
rdma-ndd
22.38
KB
-rwxr-xr-x
2022-01-28 03:57
readprofile
22.41
KB
-rwxr-xr-x
2026-03-07 01:10
reboot
1.06
MB
-rwxr-xr-x
2026-06-06 00:40
remove-shell
1.07
KB
-rwxr-xr-x
2022-03-23 22:49
resize2fs
66.3
KB
-rwxr-xr-x
2023-10-09 10:50
rmail
18.3
KB
-rwxr-xr-x
2026-05-06 00:48
rmmod
166.36
KB
-rwxr-xr-x
2026-04-30 21:32
rmt
58.57
KB
-rwxr-xr-x
2026-07-15 23:39
rmt-tar
58.57
KB
-rwxr-xr-x
2026-07-15 23:39
route
64.27
KB
-rwxr-xr-x
2025-05-28 22:13
rsyslogd
767.19
KB
-rwxr-xr-x
2022-05-03 03:45
rtacct
28.31
KB
-rwxr-xr-x
2025-10-03 22:53
rtcwake
34.38
KB
-rwxr-xr-x
2026-03-07 01:10
rtmon
90.39
KB
-rwxr-xr-x
2025-10-03 22:53
runlevel
1.06
MB
-rwxr-xr-x
2026-06-06 00:40
runuser
54.38
KB
-rwxr-xr-x
2026-03-07 01:10
samba
42.33
KB
-rwxr-xr-x
2026-05-22 02:08
samba-gpupdate
4.75
KB
-rwxr-xr-x
2026-05-22 02:08
samba_dnsupdate
32.23
KB
-rwxr-xr-x
2026-05-22 02:08
samba_downgrade_db
4.07
KB
-rwxr-xr-x
2026-05-22 02:08
samba_kcc
11.9
KB
-rwxr-xr-x
2026-05-22 02:08
samba_spnupdate
7.88
KB
-rwxr-xr-x
2026-05-22 02:08
samba_upgradedns
21.65
KB
-rwxr-xr-x
2026-05-22 02:08
sendmail
30.45
KB
-rwxr-xr-x
2026-05-06 00:48
sensors-detect
212.98
KB
-rwxr-xr-x
2022-04-01 06:07
service
8.88
KB
-rwxr-xr-x
2022-02-16 07:32
setcap
14.3
KB
-rwxr-xr-x
2026-04-10 00:04
setvesablank
14.23
KB
-rwxr-xr-x
2022-12-16 23:14
setvtrgb
14.29
KB
-rwxr-xr-x
2022-12-16 23:14
sfdisk
102.38
KB
-rwxr-xr-x
2026-03-07 01:10
sgdisk
162.48
KB
-rwxr-xr-x
2022-03-23 22:53
shadowconfig
885
B
-rwxr-xr-x
2021-11-12 00:42
shutdown
1.06
MB
-rwxr-xr-x
2026-06-06 00:40
slattach
36.08
KB
-rwxr-xr-x
2025-05-28 22:13
smbd
106.38
KB
-rwxr-xr-x
2026-05-22 02:08
smtp-sink
35.27
KB
-rwxr-xr-x
2026-05-06 00:48
smtp-source
30.32
KB
-rwxr-xr-x
2026-05-06 00:48
split-logfile
2.36
KB
-rwxr-xr-x
2026-07-07 01:41
sshd
899.7
KB
-rwxr-xr-x
2026-07-10 03:38
start-stop-daemon
47.35
KB
-rwxr-xr-x
2025-09-10 05:09
sudo_logsrvd
200.1
KB
-rwxr-xr-x
2026-03-02 22:08
sudo_sendlog
107.34
KB
-rwxr-xr-x
2026-03-02 22:08
sulogin
42.38
KB
-rwxr-xr-x
2026-03-07 01:10
swaplabel
18.38
KB
-rwxr-xr-x
2026-03-07 01:10
swapoff
22.38
KB
-rwxr-xr-x
2026-03-07 01:10
swapon
42.38
KB
-rwxr-xr-x
2026-03-07 01:10
switch_root
22.38
KB
-rwxr-xr-x
2026-03-07 01:10
sysctl
30.23
KB
-rwxr-xr-x
2023-10-31 20:36
tarcat
936
B
-rwxr-xr-x
2026-07-15 23:39
tc
618.08
KB
-rwxr-xr-x
2025-10-03 22:53
tcptraceroute
1.56
KB
-rwxr-xr-x
2016-08-30 00:45
tcptraceroute.db
1.56
KB
-rwxr-xr-x
2016-08-30 00:45
telinit
1.06
MB
-rwxr-xr-x
2026-06-06 00:40
thermald
554.6
KB
-rwxr-xr-x
2023-08-10 16:36
thin_check
1.33
MB
-rwxr-xr-x
2022-03-18 21:36
thin_delta
1.33
MB
-rwxr-xr-x
2022-03-18 21:36
thin_dump
1.33
MB
-rwxr-xr-x
2022-03-18 21:36
thin_ls
1.33
MB
-rwxr-xr-x
2022-03-18 21:36
thin_metadata_size
1.33
MB
-rwxr-xr-x
2022-03-18 21:36
thin_repair
1.33
MB
-rwxr-xr-x
2022-03-18 21:36
thin_restore
1.33
MB
-rwxr-xr-x
2022-03-18 21:36
thin_rmap
1.33
MB
-rwxr-xr-x
2022-03-18 21:36
thin_trim
1.33
MB
-rwxr-xr-x
2022-03-18 21:36
tipc
90.44
KB
-rwxr-xr-x
2025-10-03 22:53
traceroute
67.16
KB
-rwxr-xr-x
2016-08-30 00:45
tune2fs
102.55
KB
-rwxr-xr-x
2023-10-09 10:50
tzconfig
106
B
-rwxr-xr-x
2026-06-23 21:42
u-d-c-print-pci-ids
517
B
-rwxr-xr-x
2024-07-05 17:55
ufw
4.82
KB
-rwxr-xr-x
2023-07-17 22:55
umount.udisks2
14.3
KB
-rwxr-xr-x
2025-08-21 23:17
unix_chkpwd
26.15
KB
-rwxr-sr-x
2025-06-12 23:45
unix_update
30.15
KB
-rwxr-xr-x
2025-06-12 23:45
update-ca-certificates
5.29
KB
-rwxr-xr-x
2026-06-16 01:17
update-grub
64
B
-rwxr-xr-x
2022-12-03 00:18
update-grub2
64
B
-rwxr-xr-x
2022-12-03 00:18
update-gsfontmap
470
B
-rwxr-xr-x
2025-09-26 01:42
update-info-dir
1.66
KB
-rwxr-xr-x
2022-02-06 21:48
update-initramfs
6.74
KB
-rwxr-xr-x
2024-03-19 21:05
update-locale
2.99
KB
-rwxr-xr-x
2025-07-15 18:40
update-mime
9.39
KB
-rwxr-xr-x
2026-07-03 22:05
update-passwd
34.56
KB
-rwxr-xr-x
2022-03-23 18:42
update-pciids
1.71
KB
-rwxr-xr-x
2021-08-30 11:45
update-rc.d
16.92
KB
-rwxr-xr-x
2021-12-08 06:55
update-secureboot-policy
7.43
KB
-rwxr-xr-x
2024-01-24 18:14
update-shells
3.72
KB
-rwxr-xr-x
2022-03-23 22:49
usb_modeswitch
59.66
KB
-rwxr-xr-x
2022-03-25 18:53
usb_modeswitch_dispatcher
26.78
KB
-rwxr-xr-x
2022-03-25 18:53
usbmuxd
86.6
KB
-rwxr-xr-x
2025-12-11 22:43
useradd
127.66
KB
-rwxr-xr-x
2024-02-06 21:54
userdel
86.85
KB
-rwxr-xr-x
2024-02-06 21:54
usermod
123.46
KB
-rwxr-xr-x
2024-02-06 21:54
uuidd
30.85
KB
-rwxr-xr-x
2026-03-07 01:10
validlocale
1.73
KB
-rwxr-xr-x
2025-07-15 18:40
vcstime
14.15
KB
-rwxr-xr-x
2022-12-16 23:14
vdpa
30.56
KB
-rwxr-xr-x
2025-10-03 22:53
veritysetup
43.76
KB
-rwxr-xr-x
2024-11-14 12:21
vgcfgbackup
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
vgcfgrestore
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
vgchange
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
vgck
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
vgconvert
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
vgcreate
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
vgdisplay
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
vgexport
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
vgextend
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
vgimport
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
vgimportclone
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
vgmerge
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
vgmknodes
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
vgreduce
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
vgremove
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
vgrename
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
vgs
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
vgscan
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
vgsplit
2.89
MB
-rwxr-xr-x
2024-11-28 04:04
vigr
56.53
KB
-rwxr-xr-x
2024-02-06 21:54
vipw
56.53
KB
-rwxr-xr-x
2024-02-06 21:54
visudo
219.79
KB
-rwxr-xr-x
2026-03-02 22:08
vpddecode
14.58
KB
-rwxr-xr-x
2024-10-15 05:28
wipefs
38.38
KB
-rwxr-xr-x
2026-03-07 01:10
wpa_action
1.69
KB
-rwxr-xr-x
2025-08-05 20:55
wpa_cli
140.31
KB
-rwxr-xr-x
2026-02-05 08:33
wpa_supplicant
3.24
MB
-rwxr-xr-x
2026-02-05 08:33
xfs_admin
1.37
KB
-rwxr-xr-x
2024-10-17 15:49
xfs_bmap
695
B
-rwxr-xr-x
2024-10-17 15:49
xfs_copy
82.48
KB
-rwxr-xr-x
2024-10-17 15:49
xfs_db
652.44
KB
-rwxr-xr-x
2024-10-17 15:49
xfs_estimate
14.16
KB
-rwxr-xr-x
2024-10-17 15:49
xfs_freeze
800
B
-rwxr-xr-x
2024-10-17 15:49
xfs_fsr
42.18
KB
-rwxr-xr-x
2024-10-17 15:49
xfs_growfs
38.28
KB
-rwxr-xr-x
2024-10-17 15:49
xfs_info
1.26
KB
-rwxr-xr-x
2024-10-17 15:49
xfs_io
199.55
KB
-rwxr-xr-x
2024-10-17 15:49
xfs_logprint
78.33
KB
-rwxr-xr-x
2024-10-17 15:49
xfs_mdrestore
26.17
KB
-rwxr-xr-x
2024-10-17 15:49
xfs_metadump
782
B
-rwxr-xr-x
2024-10-17 15:49
xfs_mkfile
1.02
KB
-rwxr-xr-x
2024-10-17 15:49
xfs_ncheck
685
B
-rwxr-xr-x
2024-10-17 15:49
xfs_quota
90.16
KB
-rwxr-xr-x
2024-10-17 15:49
xfs_repair
599.38
KB
-rwxr-xr-x
2024-10-17 15:49
xfs_rtcp
18.15
KB
-rwxr-xr-x
2024-10-17 15:49
xfs_scrub
106.27
KB
-rwxr-xr-x
2024-10-17 15:49
xfs_scrub_all
5.87
KB
-rwxr-xr-x
2024-10-17 15:49
xfs_spaceman
42.3
KB
-rwxr-xr-x
2024-10-17 15:49
xtables-legacy-multi
96.95
KB
-rwxr-xr-x
2024-01-17 06:14
xtables-monitor
219.04
KB
-rwxr-xr-x
2024-01-17 06:14
xtables-nft-multi
219.04
KB
-rwxr-xr-x
2024-01-17 06:14
zerofree
14.15
KB
-rwxr-xr-x
2022-03-25 18:54
zic
62.32
KB
-rwxr-xr-x
2026-01-30 17:20
zramctl
54.52
KB
-rwxr-xr-x
2026-03-07 01:10
Save
Rename
#!/usr/bin/python3 # # Unix SMB/CIFS implementation. # Copyright (C) Amitay Isaacs <amitay@gmail.com> 2012 # # Upgrade DNS provision from BIND9_FLATFILE to BIND9_DLZ or SAMBA_INTERNAL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. import sys import os import errno import optparse import logging import grp from base64 import b64encode import shlex import ldb import samba from samba import param from samba.auth import system_session from samba.ndr import ( ndr_pack, ndr_unpack ) import samba.getopt as options from samba.upgradehelpers import ( get_paths, get_ldbs ) from samba.dsdb import DS_DOMAIN_FUNCTION_2003 from samba.provision import ( find_provision_key_parameters, interface_ips_v4, interface_ips_v6 ) from samba.provision.common import ( setup_path, setup_add_ldif, FILL_FULL) from samba.provision.sambadns import ( ARecord, AAAARecord, CNAMERecord, NSRecord, SOARecord, SRVRecord, TXTRecord, get_dnsadmins_sid, add_dns_accounts, create_dns_partitions, fill_dns_data_partitions, create_dns_dir, secretsdb_setup_dns, create_dns_dir_keytab_link, create_samdb_copy, create_named_conf, create_named_txt ) from samba.dcerpc import security import dns.zone, dns.rdatatype __docformat__ = 'restructuredText' def find_bind_gid(): """Find system group id for bind9 """ for name in ["bind", "named"]: try: return grp.getgrnam(name)[2] except KeyError: pass return None def convert_dns_rdata(rdata, serial=1): """Convert resource records in dnsRecord format """ if rdata.rdtype == dns.rdatatype.A: rec = ARecord(rdata.address, serial=serial) elif rdata.rdtype == dns.rdatatype.AAAA: rec = AAAARecord(rdata.address, serial=serial) elif rdata.rdtype == dns.rdatatype.CNAME: rec = CNAMERecord(rdata.target.to_text(), serial=serial) elif rdata.rdtype == dns.rdatatype.NS: rec = NSRecord(rdata.target.to_text(), serial=serial) elif rdata.rdtype == dns.rdatatype.SRV: rec = SRVRecord(rdata.target.to_text(), int(rdata.port), priority=int(rdata.priority), weight=int(rdata.weight), serial=serial) elif rdata.rdtype == dns.rdatatype.TXT: slist = shlex.split(rdata.to_text()) rec = TXTRecord(slist, serial=serial) elif rdata.rdtype == dns.rdatatype.SOA: rec = SOARecord(rdata.mname.to_text(), rdata.rname.to_text(), serial=int(rdata.serial), refresh=int(rdata.refresh), retry=int(rdata.retry), expire=int(rdata.expire), minimum=int(rdata.minimum)) else: rec = None return rec def import_zone_data(samdb, logger, zone, serial, domaindn, forestdn, dnsdomain, dnsforest): """Insert zone data in DNS partitions """ labels = dnsdomain.split('.') labels.append('') domain_root = dns.name.Name(labels) domain_prefix = "DC=%s,CN=MicrosoftDNS,DC=DomainDnsZones,%s" % (dnsdomain, domaindn) tmp = "_msdcs.%s" % dnsforest labels = tmp.split('.') labels.append('') forest_root = dns.name.Name(labels) dnsmsdcs = "_msdcs.%s" % dnsforest forest_prefix = "DC=%s,CN=MicrosoftDNS,DC=ForestDnsZones,%s" % (dnsmsdcs, forestdn) # Extract @ record at_record = zone.get_node(domain_root) zone.delete_node(domain_root) # SOA record rdset = at_record.get_rdataset(dns.rdataclass.IN, dns.rdatatype.SOA) soa_rec = ndr_pack(convert_dns_rdata(rdset[0])) at_record.delete_rdataset(dns.rdataclass.IN, dns.rdatatype.SOA) # NS record rdset = at_record.get_rdataset(dns.rdataclass.IN, dns.rdatatype.NS) ns_rec = ndr_pack(convert_dns_rdata(rdset[0])) at_record.delete_rdataset(dns.rdataclass.IN, dns.rdatatype.NS) # A/AAAA records ip_recs = [] for rdset in at_record: for r in rdset: rec = convert_dns_rdata(r) ip_recs.append(ndr_pack(rec)) # Add @ record for domain dns_rec = [soa_rec, ns_rec] + ip_recs msg = ldb.Message(ldb.Dn(samdb, 'DC=@,%s' % domain_prefix)) msg["objectClass"] = ["top", "dnsNode"] msg["dnsRecord"] = ldb.MessageElement(dns_rec, ldb.FLAG_MOD_ADD, "dnsRecord") try: samdb.add(msg) except Exception: logger.error("Failed to add @ record for domain") raise logger.debug("Added @ record for domain") # Add @ record for forest dns_rec = [soa_rec, ns_rec] msg = ldb.Message(ldb.Dn(samdb, 'DC=@,%s' % forest_prefix)) msg["objectClass"] = ["top", "dnsNode"] msg["dnsRecord"] = ldb.MessageElement(dns_rec, ldb.FLAG_MOD_ADD, "dnsRecord") try: samdb.add(msg) except Exception: logger.error("Failed to add @ record for forest") raise logger.debug("Added @ record for forest") # Add remaining records in domain and forest for node in zone.nodes: name = node.relativize(forest_root).to_text() if name == node.to_text(): name = node.relativize(domain_root).to_text() dn = "DC=%s,%s" % (name, domain_prefix) fqdn = "%s.%s" % (name, dnsdomain) else: dn = "DC=%s,%s" % (name, forest_prefix) fqdn = "%s.%s" % (name, dnsmsdcs) dns_rec = [] for rdataset in zone.nodes[node]: for rdata in rdataset: rec = convert_dns_rdata(rdata, serial) if not rec: logger.warn("Unsupported record type (%s) for %s, ignoring" % dns.rdatatype.to_text(rdata.rdatatype), name) else: dns_rec.append(ndr_pack(rec)) msg = ldb.Message(ldb.Dn(samdb, dn)) msg["objectClass"] = ["top", "dnsNode"] msg["dnsRecord"] = ldb.MessageElement(dns_rec, ldb.FLAG_MOD_ADD, "dnsRecord") try: samdb.add(msg) except Exception: logger.error("Failed to add DNS record %s" % (fqdn)) raise logger.debug("Added DNS record %s" % (fqdn)) def cleanup_remove_file(file_path): try: os.remove(file_path) except OSError as e: if e.errno not in [errno.EEXIST, errno.ENOENT]: pass else: logger.debug("Could not remove %s: %s" % (file_path, e.strerror)) def cleanup_remove_dir(dir_path): try: for root, dirs, files in os.walk(dir_path, topdown=False): for name in files: os.remove(os.path.join(root, name)) for name in dirs: os.rmdir(os.path.join(root, name)) os.rmdir(dir_path) except OSError as e: if e.errno not in [errno.EEXIST, errno.ENOENT]: pass else: logger.debug("Could not delete dir %s: %s" % (dir_path, e.strerror)) def cleanup_obsolete_dns_files(paths): cleanup_remove_file(os.path.join(paths.private_dir, "named.conf")) cleanup_remove_file(os.path.join(paths.private_dir, "named.conf.update")) cleanup_remove_file(os.path.join(paths.private_dir, "named.txt")) cleanup_remove_dir(os.path.join(paths.private_dir, "dns")) # dnsprovision creates application partitions for AD based DNS mainly if the existing # provision was created using earlier snapshots of samba4 which did not have support # for DNS partitions if __name__ == '__main__': # Setup command line parser parser = optparse.OptionParser("upgradedns [options]") sambaopts = options.SambaOptions(parser) credopts = options.CredentialsOptions(parser) parser.add_option_group(options.VersionOptions(parser)) parser.add_option_group(sambaopts) parser.add_option_group(credopts) parser.add_option("--dns-backend", type="choice", metavar="<BIND9_DLZ|SAMBA_INTERNAL>", choices=["SAMBA_INTERNAL", "BIND9_DLZ"], default="SAMBA_INTERNAL", help="The DNS server backend, default SAMBA_INTERNAL") parser.add_option("--migrate", type="choice", metavar="<yes|no>", choices=["yes","no"], default="yes", help="Migrate existing zone data, default yes") parser.add_option("--verbose", help="Be verbose", action="store_true") opts = parser.parse_args()[0] if opts.dns_backend is None: opts.dns_backend = 'SAMBA_INTERNAL' if opts.migrate: autofill = False else: autofill = True # Set up logger logger = logging.getLogger("upgradedns") logger.addHandler(logging.StreamHandler(sys.stdout)) logger.setLevel(logging.INFO) if opts.verbose: logger.setLevel(logging.DEBUG) lp = sambaopts.get_loadparm() lp.load(lp.configfile) creds = credopts.get_credentials(lp) logger.info("Reading domain information") paths = get_paths(param, smbconf=lp.configfile) paths.bind_gid = find_bind_gid() ldbs = get_ldbs(paths, creds, system_session(), lp) names = find_provision_key_parameters(ldbs.sam, ldbs.secrets, ldbs.idmap, paths, lp.configfile, lp) if names.domainlevel < DS_DOMAIN_FUNCTION_2003: logger.error("Cannot create AD based DNS for OS level < 2003") sys.exit(1) domaindn = names.domaindn forestdn = names.rootdn dnsdomain = names.dnsdomain.lower() dnsforest = dnsdomain site = names.sitename hostname = names.hostname dnsname = '%s.%s' % (hostname, dnsdomain) domainsid = names.domainsid domainguid = names.domainguid ntdsguid = names.ntdsguid # Check for DNS accounts and create them if required try: msg = ldbs.sam.search(base=domaindn, scope=ldb.SCOPE_DEFAULT, expression='(sAMAccountName=DnsAdmins)', attrs=['objectSid']) dnsadmins_sid = ndr_unpack(security.dom_sid, msg[0]['objectSid'][0]) except IndexError: logger.info("Adding DNS accounts") add_dns_accounts(ldbs.sam, domaindn) dnsadmins_sid = get_dnsadmins_sid(ldbs.sam, domaindn) else: logger.info("DNS accounts already exist") # Import dns records from zone file if os.path.exists(paths.dns): logger.info("Reading records from zone file %s" % paths.dns) try: zone = dns.zone.from_file(paths.dns, relativize=False) rrset = zone.get_rdataset("%s." % dnsdomain, dns.rdatatype.SOA) serial = int(rrset[0].serial) except Exception as e: logger.warn("Error parsing DNS data from '%s' (%s)" % (paths.dns, str(e))) autofill = True else: logger.info("No zone file %s (normal)" % paths.dns) autofill = True # Create DNS partitions if missing and fill DNS information try: expression = '(|(dnsRoot=DomainDnsZones.%s)(dnsRoot=ForestDnsZones.%s))' % \ (dnsdomain, dnsforest) msg = ldbs.sam.search(base=names.configdn, scope=ldb.SCOPE_DEFAULT, expression=expression, attrs=['nCName']) ncname = msg[0]['nCName'][0] except IndexError: logger.info("Creating DNS partitions") logger.info("Looking up IPv4 addresses") hostip = interface_ips_v4(lp) try: hostip.remove('127.0.0.1') except ValueError: pass if not hostip: logger.error("No IPv4 addresses found") sys.exit(1) else: hostip = hostip[0] logger.debug("IPv4 addresses: %s" % hostip) logger.info("Looking up IPv6 addresses") hostip6 = interface_ips_v6(lp) if not hostip6: hostip6 = None else: hostip6 = hostip6[0] logger.debug("IPv6 addresses: %s" % hostip6) create_dns_partitions(ldbs.sam, domainsid, names, domaindn, forestdn, dnsadmins_sid, FILL_FULL) logger.info("Populating DNS partitions") if autofill: logger.warn("DNS records will be automatically created") fill_dns_data_partitions(ldbs.sam, domainsid, site, domaindn, forestdn, dnsdomain, dnsforest, hostname, hostip, hostip6, domainguid, ntdsguid, dnsadmins_sid, autofill=autofill) if not autofill: logger.info("Importing records from zone file") import_zone_data(ldbs.sam, logger, zone, serial, domaindn, forestdn, dnsdomain, dnsforest) else: logger.info("DNS partitions already exist") # Mark that we are hosting DNS partitions try: dns_nclist = [ 'DC=DomainDnsZones,%s' % domaindn, 'DC=ForestDnsZones,%s' % forestdn ] msgs = ldbs.sam.search(base=names.serverdn, scope=ldb.SCOPE_DEFAULT, expression='(objectclass=nTDSDSa)', attrs=['hasPartialReplicaNCs', 'msDS-hasMasterNCs']) msg = msgs[0] master_nclist = [] ncs = msg.get("msDS-hasMasterNCs") if ncs: for nc in ncs: master_nclist.append(str(nc)) partial_nclist = [] ncs = msg.get("hasPartialReplicaNCs") if ncs: for nc in ncs: partial_nclist.append(str(nc)) modified_master = False modified_partial = False for nc in dns_nclist: if nc not in master_nclist: master_nclist.append(nc) modified_master = True if nc in partial_nclist: partial_nclist.remove(nc) modified_partial = True if modified_master or modified_partial: logger.debug("Updating msDS-hasMasterNCs and hasPartialReplicaNCs attributes") m = ldb.Message() m.dn = msg.dn if modified_master: m["msDS-hasMasterNCs"] = ldb.MessageElement(master_nclist, ldb.FLAG_MOD_REPLACE, "msDS-hasMasterNCs") if modified_partial: if partial_nclist: m["hasPartialReplicaNCs"] = ldb.MessageElement(partial_nclist, ldb.FLAG_MOD_REPLACE, "hasPartialReplicaNCs") else: m["hasPartialReplicaNCs"] = ldb.MessageElement(ncs, ldb.FLAG_MOD_DELETE, "hasPartialReplicaNCs") ldbs.sam.modify(m) except Exception: raise # Special stuff for DLZ backend if opts.dns_backend == "BIND9_DLZ": config_migration = False if (paths.private_dir != paths.binddns_dir and os.path.isfile(os.path.join(paths.private_dir, "named.conf"))): config_migration = True # Check if dns-HOSTNAME account exists and create it if required secrets_msgs = ldbs.secrets.search(expression='(samAccountName=dns-%s)' % hostname, attrs=['secret']) msg = ldbs.sam.search(base=domaindn, scope=ldb.SCOPE_DEFAULT, expression='(sAMAccountName=dns-%s)' % (hostname), attrs=[]) if len(secrets_msgs) == 0 or len(msg) == 0: logger.info("Adding dns-%s account" % hostname) if len(secrets_msgs) == 1: dn = secrets_msgs[0].dn ldbs.secrets.delete(dn) if len(msg) == 1: dn = msg[0].dn ldbs.sam.delete(dn) dnspass = samba.generate_random_password(128, 255) setup_add_ldif(ldbs.sam, setup_path("provision_dns_add_samba.ldif"), { "DNSDOMAIN": dnsdomain, "DOMAINDN": domaindn, "DNSPASS_B64": b64encode(dnspass.encode('utf-16-le')).decode('utf8'), "HOSTNAME" : hostname, "DNSNAME" : dnsname } ) res = ldbs.sam.search(base=domaindn, scope=ldb.SCOPE_DEFAULT, expression='(sAMAccountName=dns-%s)' % (hostname), attrs=["msDS-KeyVersionNumber"]) if "msDS-KeyVersionNumber" in res[0]: dns_key_version_number = int(res[0]["msDS-KeyVersionNumber"][0]) else: dns_key_version_number = None secretsdb_setup_dns(ldbs.secrets, names, paths.private_dir, paths.binddns_dir, realm=names.realm, dnsdomain=names.dnsdomain, dns_keytab_path=paths.dns_keytab, dnspass=dnspass, key_version_number=dns_key_version_number) else: logger.info("dns-%s account already exists" % hostname) if not os.path.exists(paths.binddns_dir): # This directory won't exist if we're restoring from an offline backup. os.mkdir(paths.binddns_dir, 0o770) create_dns_dir_keytab_link(logger, paths) # This forces a re-creation of dns directory and all the files within # It's an overkill, but it's easier to re-create a samdb copy, rather # than trying to fix a broken copy. create_dns_dir(logger, paths) # Setup a copy of SAM for BIND9 create_samdb_copy(ldbs.sam, logger, paths, names, domainsid, domainguid) create_named_conf(paths, names.realm, dnsdomain, opts.dns_backend, logger) create_named_txt(paths.namedtxt, names.realm, dnsdomain, dnsname, paths.binddns_dir, paths.dns_keytab) cleanup_obsolete_dns_files(paths) if config_migration: logger.info("ATTENTION: The BIND configuration and keytab has been moved to: %s", paths.binddns_dir) logger.info(" Please update your BIND configuration accordingly.") else: logger.info("See %s for an example configuration include file for BIND", paths.namedconf) logger.info("and %s for further documentation required for secure DNS " "updates", paths.namedtxt) elif opts.dns_backend == "SAMBA_INTERNAL": # Make sure to remove everything from the bind-dns directory to avoid # possible security issues with the named group having write access # to all AD partions cleanup_remove_file(os.path.join(paths.binddns_dir, "dns.keytab")) cleanup_remove_file(os.path.join(paths.binddns_dir, "named.conf")) cleanup_remove_file(os.path.join(paths.binddns_dir, "named.conf.update")) cleanup_remove_file(os.path.join(paths.binddns_dir, "named.txt")) cleanup_remove_dir(os.path.dirname(paths.dns)) try: os.chmod(paths.private_dir, 0o700) os.chown(paths.private_dir, -1, 0) except: logger.warn("Failed to restore owner and permissions for %s", (paths.private_dir)) # Check if dns-HOSTNAME account exists and delete it if required try: dn_str = 'samAccountName=dns-%s,CN=Principals' % hostname msg = ldbs.secrets.search(expression='(dn=%s)' % dn_str, attrs=[]) dn = msg[0].dn except IndexError: dn = None if dn is not None: try: ldbs.secrets.delete(dn) except Exception: logger.info("Failed to delete %s from secrets.ldb" % dn) try: msg = ldbs.sam.search(base=domaindn, scope=ldb.SCOPE_DEFAULT, expression='(sAMAccountName=dns-%s)' % (hostname), attrs=[]) dn = msg[0].dn except IndexError: dn = None if dn is not None: try: ldbs.sam.delete(dn) except Exception: logger.info("Failed to delete %s from sam.ldb" % dn) logger.info("Finished upgrading DNS") services = lp.get("server services") for service in services: if service == "dns": if opts.dns_backend.startswith("BIND"): logger.info("You have switched to using %s as your dns backend," " but still have the internal dns starting. Please" " make sure you add '-dns' to your server services" " line in your smb.conf." % opts.dns_backend) break else: if opts.dns_backend == "SAMBA_INTERNAL": logger.info("You have switched to using %s as your dns backend," " but you still have samba starting looking for a" " BIND backend. Please remove the -dns from your" " server services line." % opts.dns_backend)