Linux moodl-moodle-3s8bw1nuh5yqd9-5b875fdd66-8hs4m 4.4.0-186-generic #216-Ubuntu SMP Wed Jul 1 05:34:05 UTC 2020 x86_64
Apache/2.4.41 (Ubuntu)
: 10.39.0.36 | : 10.36.0.0
Cant Read [ /etc/named.conf ]
7.4.3
www-data
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
usr /
bin /
[ HOME SHELL ]
Name
Size
Permission
Action
2to3-2.7
96
B
-rwxr-xr-x
[
58.34
KB
-rwxr-xr-x
ab
58.34
KB
-rwxr-xr-x
addpart
30.23
KB
-rwxr-xr-x
apt
18.38
KB
-rwxr-xr-x
apt-cache
86.46
KB
-rwxr-xr-x
apt-cdrom
30.46
KB
-rwxr-xr-x
apt-config
26.38
KB
-rwxr-xr-x
apt-get
46.46
KB
-rwxr-xr-x
apt-key
27.28
KB
-rwxr-xr-x
apt-mark
62.46
KB
-rwxr-xr-x
arch
38.37
KB
-rwxr-xr-x
awk
158.74
KB
-rwxr-xr-x
b2sum
58.37
KB
-rwxr-xr-x
base32
42.34
KB
-rwxr-xr-x
base64
42.34
KB
-rwxr-xr-x
basename
38.34
KB
-rwxr-xr-x
bash
1.13
MB
-rwxr-xr-x
bashbug
6.63
KB
-rwxr-xr-x
bunzip2
38.23
KB
-rwxr-xr-x
bzcat
38.23
KB
-rwxr-xr-x
bzcmp
2.17
KB
-rwxr-xr-x
bzdiff
2.17
KB
-rwxr-xr-x
bzegrep
3.69
KB
-rwxr-xr-x
bzexe
4.76
KB
-rwxr-xr-x
bzfgrep
3.69
KB
-rwxr-xr-x
bzgrep
3.69
KB
-rwxr-xr-x
bzip2
38.23
KB
-rwxr-xr-x
bzip2recover
18.15
KB
-rwxr-xr-x
bzless
1.27
KB
-rwxr-xr-x
bzmore
1.27
KB
-rwxr-xr-x
c_rehash
6.18
KB
-rwxr-xr-x
captoinfo
90.41
KB
-rwxr-xr-x
cat
42.4
KB
-rwxr-xr-x
catchsegv
3.25
KB
-rwxr-xr-x
cautious-launcher
853
B
-rwxr-xr-x
chage
82.53
KB
-rwxr-sr-x
chattr
14.31
KB
-rwxr-xr-x
chcon
70.34
KB
-rwxr-xr-x
checkgid
14.15
KB
-rwxr-xr-x
chfn
83.07
KB
-rwsr-xr-x
chgrp
70.34
KB
-rwxr-xr-x
chmod
62.37
KB
-rwxr-xr-x
choom
50.23
KB
-rwxr-xr-x
chown
70.34
KB
-rwxr-xr-x
chrt
38.23
KB
-rwxr-xr-x
chsh
51.8
KB
-rwsr-xr-x
cksum
38.34
KB
-rwxr-xr-x
clear
14.31
KB
-rwxr-xr-x
clear_console
14.23
KB
-rwxr-xr-x
cmp
50.09
KB
-rwxr-xr-x
comm
42.37
KB
-rwxr-xr-x
compose
18.05
KB
-rwxr-xr-x
corelist
14.73
KB
-rwxr-xr-x
cp
150.37
KB
-rwxr-xr-x
cpan
7.96
KB
-rwxr-xr-x
cpan5.30-x86_64-linux-gnu
7.98
KB
-rwxr-xr-x
cpio
161.63
KB
-rwxr-xr-x
crontab
42.7
KB
-rwxr-sr-x
csplit
54.37
KB
-rwxr-xr-x
curl
234.23
KB
-rwxr-xr-x
curl-config
6.29
KB
-rwxr-xr-x
cut
46.37
KB
-rwxr-xr-x
dash
126.77
KB
-rwxr-xr-x
date
106.37
KB
-rwxr-xr-x
dd
78.38
KB
-rwxr-xr-x
deb-systemd-helper
20.83
KB
-rwxr-xr-x
deb-systemd-invoke
4.33
KB
-rwxr-xr-x
debconf
2.79
KB
-rwxr-xr-x
debconf-apt-progress
11.27
KB
-rwxr-xr-x
debconf-communicate
608
B
-rwxr-xr-x
debconf-copydb
1.68
KB
-rwxr-xr-x
debconf-escape
647
B
-rwxr-xr-x
debconf-set-selections
2.87
KB
-rwxr-xr-x
debconf-show
1.78
KB
-rwxr-xr-x
delpart
30.23
KB
-rwxr-xr-x
df
90.95
KB
-rwxr-xr-x
dh_python2
1.03
KB
-rwxr-xr-x
diff
214.34
KB
-rwxr-xr-x
diff3
66.21
KB
-rwxr-xr-x
dir
138.81
KB
-rwxr-xr-x
dircolors
46.34
KB
-rwxr-xr-x
dirname
38.34
KB
-rwxr-xr-x
dmesg
82.46
KB
-rwxr-xr-x
dnsdomainname
26.23
KB
-rwxr-xr-x
domainname
26.23
KB
-rwxr-xr-x
dpkg
302.68
KB
-rwxr-xr-x
dpkg-deb
174.54
KB
-rwxr-xr-x
dpkg-divert
150.59
KB
-rwxr-xr-x
dpkg-maintscript-helper
20.03
KB
-rwxr-xr-x
dpkg-query
162.59
KB
-rwxr-xr-x
dpkg-split
122.48
KB
-rwxr-xr-x
dpkg-statoverride
62.27
KB
-rwxr-xr-x
dpkg-trigger
82.49
KB
-rwxr-xr-x
du
106.37
KB
-rwxr-xr-x
echo
38.34
KB
-rwxr-xr-x
echo_supervisord_conf
419
B
-rwxr-xr-x
edit
18.05
KB
-rwxr-xr-x
egrep
28
B
-rwxr-xr-x
enc2xs
41.12
KB
-rwxr-xr-x
encguess
2.99
KB
-rwxr-xr-x
env
42.34
KB
-rwxr-xr-x
expand
42.37
KB
-rwxr-xr-x
expiry
30.58
KB
-rwxr-sr-x
expr
54.34
KB
-rwxr-xr-x
factor
78.37
KB
-rwxr-xr-x
faillog
22.59
KB
-rwxr-xr-x
fallocate
34.23
KB
-rwxr-xr-x
false
38.34
KB
-rwxr-xr-x
fcgistarter
14.15
KB
-rwxr-xr-x
fgrep
28
B
-rwxr-xr-x
file
26.47
KB
-rwxr-xr-x
fincore
34.27
KB
-rwxr-xr-x
find
312.66
KB
-rwxr-xr-x
findmnt
71.41
KB
-rwxr-xr-x
flock
34.3
KB
-rwxr-xr-x
fmt
46.34
KB
-rwxr-xr-x
fold
42.34
KB
-rwxr-xr-x
free
26.23
KB
-rwxr-xr-x
funzip
26.15
KB
-rwxr-xr-x
fuser
39.24
KB
-rwxr-xr-x
getconf
34.29
KB
-rwxr-xr-x
getent
38.65
KB
-rwxr-xr-x
getopt
22.23
KB
-rwxr-xr-x
git
2.95
MB
-rwxr-xr-x
git-receive-pack
2.95
MB
-rwxr-xr-x
git-shell
1.69
MB
-rwxr-xr-x
git-upload-archive
2.95
MB
-rwxr-xr-x
git-upload-pack
2.95
MB
-rwxr-xr-x
gpasswd
86.39
KB
-rwsr-xr-x
gpgv
447.15
KB
-rwxr-xr-x
grep
194.47
KB
-rwxr-xr-x
groups
38.34
KB
-rwxr-xr-x
gunzip
2.29
KB
-rwxr-xr-x
gzexe
6.23
KB
-rwxr-xr-x
gzip
95.21
KB
-rwxr-xr-x
h2ph
28.54
KB
-rwxr-xr-x
h2xs
59.44
KB
-rwxr-xr-x
head
46.37
KB
-rwxr-xr-x
hostid
38.34
KB
-rwxr-xr-x
hostname
26.23
KB
-rwxr-xr-x
htcacheclean
38.16
KB
-rwxr-xr-x
htdbm
26.15
KB
-rwxr-xr-x
htdigest
14.15
KB
-rwxr-xr-x
htpasswd
26.15
KB
-rwxr-xr-x
i386
26.5
KB
-rwxr-xr-x
iconv
66.41
KB
-rwxr-xr-x
id
46.37
KB
-rwxr-xr-x
infocmp
62.38
KB
-rwxr-xr-x
infotocap
90.41
KB
-rwxr-xr-x
install
154.41
KB
-rwxr-xr-x
instmodsh
4.27
KB
-rwxr-xr-x
ionice
30.23
KB
-rwxr-xr-x
ipcmk
34.3
KB
-rwxr-xr-x
ipcrm
34.23
KB
-rwxr-xr-x
ipcs
66.23
KB
-rwxr-xr-x
ischroot
14.2
KB
-rwxr-xr-x
join
54.37
KB
-rwxr-xr-x
json_pp
4.56
KB
-rwxr-xr-x
kill
30.23
KB
-rwxr-xr-x
killall
31.27
KB
-rwxr-xr-x
last
46.23
KB
-rwxr-xr-x
lastb
46.23
KB
-rwxr-xr-x
lastlog
31.66
KB
-rwxr-xr-x
lcf
7.6
KB
-rwxr-xr-x
ldd
5.3
KB
-rwxr-xr-x
less
175.84
KB
-rwxr-xr-x
lessecho
14.31
KB
-rwxr-xr-x
lessfile
8.36
KB
-rwxr-xr-x
lesskey
23.72
KB
-rwxr-xr-x
lesspipe
8.36
KB
-rwxr-xr-x
libnetcfg
15.41
KB
-rwxr-xr-x
link
38.34
KB
-rwxr-xr-x
linux32
26.5
KB
-rwxr-xr-x
linux64
26.5
KB
-rwxr-xr-x
ln
74.38
KB
-rwxr-xr-x
locale
57.56
KB
-rwxr-xr-x
locale-check
14.16
KB
-rwxr-xr-x
localedef
326.96
KB
-rwxr-xr-x
logger
50.82
KB
-rwxr-xr-x
login
55.77
KB
-rwxr-xr-x
logname
38.34
KB
-rwxr-xr-x
logresolve
14.16
KB
-rwxr-xr-x
ls
138.81
KB
-rwxr-xr-x
lsattr
14.31
KB
-rwxr-xr-x
lsblk
130.23
KB
-rwxr-xr-x
lscpu
98.23
KB
-rwxr-xr-x
lsipc
94.23
KB
-rwxr-xr-x
lslocks
38.55
KB
-rwxr-xr-x
lslogins
66.23
KB
-rwxr-xr-x
lsmem
66.23
KB
-rwxr-xr-x
lsns
50.23
KB
-rwxr-xr-x
lzcat
78.5
KB
-rwxr-xr-x
lzcmp
6.48
KB
-rwxr-xr-x
lzdiff
6.48
KB
-rwxr-xr-x
lzegrep
5.5
KB
-rwxr-xr-x
lzfgrep
5.5
KB
-rwxr-xr-x
lzgrep
5.5
KB
-rwxr-xr-x
lzless
1.76
KB
-rwxr-xr-x
lzma
78.5
KB
-rwxr-xr-x
lzmainfo
14.23
KB
-rwxr-xr-x
lzmore
2.11
KB
-rwxr-xr-x
mailq
34.3
KB
-rwxr-xr-x
man
320
B
-rwxr-xr-x
mawk
158.74
KB
-rwxr-xr-x
mcookie
34.3
KB
-rwxr-xr-x
md5sum
46.37
KB
-rwxr-xr-x
md5sum.textutils
46.37
KB
-rwxr-xr-x
mesg
14.23
KB
-rwxr-xr-x
mkdir
86.34
KB
-rwxr-xr-x
mkfifo
66.34
KB
-rwxr-xr-x
mknod
70.34
KB
-rwxr-xr-x
mktemp
46.34
KB
-rwxr-xr-x
more
42.15
KB
-rwxr-xr-x
mount
54.23
KB
-rwsr-xr-x
mountpoint
14.23
KB
-rwxr-xr-x
mt
86.78
KB
-rwxr-xr-x
mt-gnu
86.78
KB
-rwxr-xr-x
mv
146.38
KB
-rwxr-xr-x
myisam_ftdump
6.34
MB
-rwxr-xr-x
mysql
6.95
MB
-rwxr-xr-x
mysql_config_editor
166.16
KB
-rwxr-xr-x
mysqladmin
6.81
MB
-rwxr-xr-x
mysqlanalyze
6.81
MB
-rwxr-xr-x
mysqlcheck
6.81
MB
-rwxr-xr-x
mysqldump
6.88
MB
-rwxr-xr-x
mysqldumpslow
7.51
KB
-rwxr-xr-x
mysqlimport
6.8
MB
-rwxr-xr-x
mysqloptimize
6.81
MB
-rwxr-xr-x
mysqlpump
7.18
MB
-rwxr-xr-x
mysqlrepair
6.81
MB
-rwxr-xr-x
mysqlreport
38.1
KB
-rwxr-xr-x
mysqlshow
6.8
MB
-rwxr-xr-x
mysqlslap
6.81
MB
-rwxr-xr-x
namei
34.23
KB
-rwxr-xr-x
nawk
158.74
KB
-rwxr-xr-x
nc
42.64
KB
-rwxr-xr-x
nc.openbsd
42.64
KB
-rwxr-xr-x
netcat
42.64
KB
-rwxr-xr-x
newaliases
34.3
KB
-rwxr-xr-x
newgrp
43.73
KB
-rwsr-xr-x
nice
42.34
KB
-rwxr-xr-x
nisdomainname
26.23
KB
-rwxr-xr-x
nl
42.43
KB
-rwxr-xr-x
nohup
42.34
KB
-rwxr-xr-x
nproc
42.34
KB
-rwxr-xr-x
nsenter
34.43
KB
-rwxr-xr-x
numfmt
66.4
KB
-rwxr-xr-x
od
70.37
KB
-rwxr-xr-x
openssl
735.68
KB
-rwxr-xr-x
pager
175.84
KB
-rwxr-xr-x
partx
118.23
KB
-rwxr-xr-x
passwd
66.61
KB
-rwsr-xr-x
paste
42.37
KB
-rwxr-xr-x
patch
190.52
KB
-rwxr-xr-x
pathchk
38.34
KB
-rwxr-xr-x
pdb2
45.02
KB
-rwxr-xr-x
pdb2.7
45.02
KB
-rwxr-xr-x
pdb3
61.21
KB
-rwxr-xr-x
pdb3.8
61.21
KB
-rwxr-xr-x
peekfd
14.15
KB
-rwxr-xr-x
perl
3.32
MB
-rwxr-xr-x
perl5.30-x86_64-linux-gnu
14.3
KB
-rwxr-xr-x
perl5.30.0
3.32
MB
-rwxr-xr-x
perlbug
45.28
KB
-rwxr-xr-x
perldoc
125
B
-rwxr-xr-x
perlivp
10.61
KB
-rwxr-xr-x
perlthanks
45.28
KB
-rwxr-xr-x
pgrep
30.24
KB
-rwxr-xr-x
phar
14.54
KB
-rwxr-xr-x
phar.phar
14.54
KB
-rwxr-xr-x
phar.phar7.4
14.54
KB
-rwxr-xr-x
phar7.4
14.54
KB
-rwxr-xr-x
php
4.55
MB
-rwxr-xr-x
php7.4
4.55
MB
-rwxr-xr-x
piconv
8.16
KB
-rwxr-xr-x
pidof
26.38
KB
-rwxr-xr-x
pidproxy
393
B
-rwxr-xr-x
pinky
42.37
KB
-rwxr-xr-x
pkill
30.24
KB
-rwxr-xr-x
pl2pm
4.43
KB
-rwxr-xr-x
pldd
22.37
KB
-rwxr-xr-x
pmap
34.24
KB
-rwxr-xr-x
pod2html
4.04
KB
-rwxr-xr-x
pod2man
14.68
KB
-rwxr-xr-x
pod2text
10.55
KB
-rwxr-xr-x
pod2usage
3.86
KB
-rwxr-xr-x
podchecker
3.57
KB
-rwxr-xr-x
podselect
2.47
KB
-rwxr-xr-x
pr
74.43
KB
-rwxr-xr-x
print
18.05
KB
-rwxr-xr-x
printenv
38.34
KB
-rwxr-xr-x
printf
58.34
KB
-rwxr-xr-x
prlimit
38.74
KB
-rwxr-xr-x
prove
13.33
KB
-rwxr-xr-x
prtstat
22.23
KB
-rwxr-xr-x
ps
134.46
KB
-rwxr-xr-x
pslog
14.15
KB
-rwxr-xr-x
pstree
35.16
KB
-rwxr-xr-x
pstree.x11
35.16
KB
-rwxr-xr-x
ptar
3.47
KB
-rwxr-xr-x
ptardiff
2.57
KB
-rwxr-xr-x
ptargrep
4.29
KB
-rwxr-xr-x
ptx
78.4
KB
-rwxr-xr-x
pwd
42.34
KB
-rwxr-xr-x
pwdx
14.23
KB
-rwxr-xr-x
pwgen
31.4
KB
-rwxr-xr-x
py3clean
7.63
KB
-rwxr-xr-x
py3compile
11.84
KB
-rwxr-xr-x
py3versions
11.44
KB
-rwxr-xr-x
pyclean
4.03
KB
-rwxr-xr-x
pycompile
11.62
KB
-rwxr-xr-x
pydoc2
79
B
-rwxr-xr-x
pydoc2.7
79
B
-rwxr-xr-x
pydoc3
79
B
-rwxr-xr-x
pydoc3.8
79
B
-rwxr-xr-x
pygettext2
21.56
KB
-rwxr-xr-x
pygettext2.7
21.56
KB
-rwxr-xr-x
pygettext3
21.03
KB
-rwxr-xr-x
pygettext3.8
21.03
KB
-rwxr-xr-x
python2
3.46
MB
-rwxr-xr-x
python2.7
3.46
MB
-rwxr-xr-x
python3
5.23
MB
-rwxr-xr-x
python3.8
5.23
MB
-rwxr-xr-x
pyversions
14.76
KB
-rwxr-xr-x
rbash
1.13
MB
-rwxr-xr-x
rcp
114.3
KB
-rwxr-xr-x
readlink
50.34
KB
-rwxr-xr-x
realpath
50.37
KB
-rwxr-xr-x
rename.ul
22.23
KB
-rwxr-xr-x
renice
14.23
KB
-rwxr-xr-x
reset
30.31
KB
-rwxr-xr-x
resizepart
62.23
KB
-rwxr-xr-x
rev
14.23
KB
-rwxr-xr-x
rgrep
30
B
-rwxr-xr-x
rlogin
770.95
KB
-rwxr-xr-x
rm
70.37
KB
-rwxr-xr-x
rmail
18.15
KB
-rwxr-xr-x
rmdir
46.34
KB
-rwxr-xr-x
rotatelogs
26.23
KB
-rwxr-xr-x
rsh
770.95
KB
-rwxr-xr-x
run-mailcap
18.05
KB
-rwxr-xr-x
run-parts
26.51
KB
-rwxr-xr-x
runcon
38.34
KB
-rwxr-xr-x
savelog
10.24
KB
-rwxr-xr-x
scp
114.3
KB
-rwxr-xr-x
script
54.23
KB
-rwxr-xr-x
scriptreplay
30.23
KB
-rwxr-xr-x
sdiff
50.09
KB
-rwxr-xr-x
sed
118.45
KB
-rwxr-xr-x
see
18.05
KB
-rwxr-xr-x
select-editor
2.38
KB
-rwxr-xr-x
sensible-browser
1.2
KB
-rwxr-xr-x
sensible-editor
1.14
KB
-rwxr-xr-x
sensible-pager
452
B
-rwxr-xr-x
seq
50.34
KB
-rwxr-xr-x
setarch
26.5
KB
-rwxr-xr-x
setpriv
46.23
KB
-rwxr-xr-x
setsid
14.23
KB
-rwxr-xr-x
setterm
46.23
KB
-rwxr-xr-x
sftp
166.51
KB
-rwxr-xr-x
sg
43.73
KB
-rwsr-xr-x
sh
126.77
KB
-rwxr-xr-x
sha1sum
50.37
KB
-rwxr-xr-x
sha224sum
58.37
KB
-rwxr-xr-x
sha256sum
58.37
KB
-rwxr-xr-x
sha384sum
66.37
KB
-rwxr-xr-x
sha512sum
66.37
KB
-rwxr-xr-x
shasum
9.74
KB
-rwxr-xr-x
shred
62.37
KB
-rwxr-xr-x
shuf
58.34
KB
-rwxr-xr-x
skill
30.23
KB
-rwxr-xr-x
slabtop
22.23
KB
-rwxr-xr-x
sleep
38.34
KB
-rwxr-xr-x
slogin
770.95
KB
-rwxr-xr-x
snice
30.23
KB
-rwxr-xr-x
sort
114.63
KB
-rwxr-xr-x
splain
18.7
KB
-rwxr-xr-x
split
58.77
KB
-rwxr-xr-x
ssh
770.95
KB
-rwxr-xr-x
ssh-add
362.28
KB
-rwxr-xr-x
ssh-agent
342.29
KB
-rwxr-sr-x
ssh-argv0
1.42
KB
-rwxr-xr-x
ssh-copy-id
10.41
KB
-rwxr-xr-x
ssh-keygen
466.3
KB
-rwxr-xr-x
ssh-keyscan
454.3
KB
-rwxr-xr-x
stat
86.37
KB
-rwxr-xr-x
stdbuf
50.34
KB
-rwxr-xr-x
stty
82.37
KB
-rwxr-xr-x
su
66.23
KB
-rwsr-xr-x
sum
46.34
KB
-rwxr-xr-x
supervisorctl
403
B
-rwxr-xr-x
supervisord
399
B
-rwxr-xr-x
sync
38.34
KB
-rwxr-xr-x
tabs
18.3
KB
-rwxr-xr-x
tac
42.34
KB
-rwxr-xr-x
tail
70.4
KB
-rwxr-xr-x
tar
437.61
KB
-rwxr-xr-x
taskset
34.23
KB
-rwxr-xr-x
tee
42.37
KB
-rwxr-xr-x
tempfile
14.02
KB
-rwxr-xr-x
test
54.34
KB
-rwxr-xr-x
tic
90.41
KB
-rwxr-xr-x
timeout
42.77
KB
-rwxr-xr-x
tload
22.24
KB
-rwxr-xr-x
toe
22.3
KB
-rwxr-xr-x
top
126.05
KB
-rwxr-xr-x
touch
98.37
KB
-rwxr-xr-x
tput
26.34
KB
-rwxr-xr-x
tr
50.34
KB
-rwxr-xr-x
true
38.34
KB
-rwxr-xr-x
truncate
42.34
KB
-rwxr-xr-x
tset
30.31
KB
-rwxr-xr-x
tsort
42.34
KB
-rwxr-xr-x
tty
38.34
KB
-rwxr-xr-x
tzselect
15.02
KB
-rwxr-xr-x
ucf
39.73
KB
-rwxr-xr-x
ucfq
18.91
KB
-rwxr-xr-x
ucfr
10.47
KB
-rwxr-xr-x
umount
38.23
KB
-rwsr-xr-x
uname
38.37
KB
-rwxr-xr-x
uncompress
2.29
KB
-rwxr-xr-x
unexpand
42.37
KB
-rwxr-xr-x
uniq
50.37
KB
-rwxr-xr-x
unlink
38.34
KB
-rwxr-xr-x
unlzma
78.5
KB
-rwxr-xr-x
unshare
42.43
KB
-rwxr-xr-x
unxz
78.5
KB
-rwxr-xr-x
unzip
182.29
KB
-rwxr-xr-x
unzipsfx
82.27
KB
-rwxr-xr-x
update-alternatives
54.41
KB
-rwxr-xr-x
uptime
14.23
KB
-rwxr-xr-x
users
38.34
KB
-rwxr-xr-x
utmpdump
30.23
KB
-rwxr-xr-x
vdir
138.81
KB
-rwxr-xr-x
vmstat
38.25
KB
-rwxr-xr-x
w
22.23
KB
-rwxr-xr-x
w.procps
22.23
KB
-rwxr-xr-x
wall
34.23
KB
-rwxr-sr-x
watch
26.57
KB
-rwxr-xr-x
wc
46.34
KB
-rwxr-xr-x
wdctl
34.23
KB
-rwxr-xr-x
wget
535.71
KB
-rwxr-xr-x
whereis
34.66
KB
-rwxr-xr-x
which
946
B
-rwxr-xr-x
who
58.37
KB
-rwxr-xr-x
whoami
38.34
KB
-rwxr-xr-x
x86_64
26.5
KB
-rwxr-xr-x
xargs
74.37
KB
-rwxr-xr-x
xauth
54.97
KB
-rwxr-xr-x
xsubpp
5.04
KB
-rwxr-xr-x
xz
78.5
KB
-rwxr-xr-x
xzcat
78.5
KB
-rwxr-xr-x
xzcmp
6.48
KB
-rwxr-xr-x
xzdiff
6.48
KB
-rwxr-xr-x
xzegrep
5.5
KB
-rwxr-xr-x
xzfgrep
5.5
KB
-rwxr-xr-x
xzgrep
5.5
KB
-rwxr-xr-x
xzless
1.76
KB
-rwxr-xr-x
xzmore
2.11
KB
-rwxr-xr-x
yes
38.34
KB
-rwxr-xr-x
ypdomainname
26.23
KB
-rwxr-xr-x
zcat
1.94
KB
-rwxr-xr-x
zcmp
1.64
KB
-rwxr-xr-x
zdiff
5.74
KB
-rwxr-xr-x
zdump
26.21
KB
-rwxr-xr-x
zegrep
29
B
-rwxr-xr-x
zfgrep
29
B
-rwxr-xr-x
zforce
2.03
KB
-rwxr-xr-x
zgrep
7.41
KB
-rwxr-xr-x
zipdetails
49.53
KB
-rwxr-xr-x
zipgrep
2.88
KB
-rwxr-xr-x
zipinfo
182.29
KB
-rwxr-xr-x
zless
2.15
KB
-rwxr-xr-x
zmore
1.8
KB
-rwxr-xr-x
znew
4.45
KB
-rwxr-xr-x
Delete
Unzip
Zip
${this.title}
Close
Code Editor : apt-key
#!/bin/sh set -e unset GREP_OPTIONS GPGHOMEDIR CURRENTTRAP export IFS="$(printf "\n\b")" MASTER_KEYRING='/usr/share/keyrings/ubuntu-master-keyring.gpg' eval "$(apt-config shell MASTER_KEYRING APT::Key::MasterKeyring)" ARCHIVE_KEYRING='/usr/share/keyrings/ubuntu-archive-keyring.gpg' eval "$(apt-config shell ARCHIVE_KEYRING APT::Key::ArchiveKeyring)" REMOVED_KEYS='/usr/share/keyrings/ubuntu-archive-removed-keys.gpg' eval "$(apt-config shell REMOVED_KEYS APT::Key::RemovedKeys)" ARCHIVE_KEYRING_URI='http://archive.ubuntu.com/ubuntu/project/ubuntu-archive-keyring.gpg' eval "$(apt-config shell ARCHIVE_KEYRING_URI APT::Key::ArchiveKeyringURI)" aptkey_echo() { echo "$@"; } find_gpgv_status_fd() { while [ -n "$1" ]; do if [ "$1" = '--status-fd' ]; then shift echo "$1" break fi shift done } GPGSTATUSFD="$(find_gpgv_status_fd "$@")" apt_warn() { if [ -z "$GPGHOMEDIR" ]; then echo >&2 'W:' "$@" else echo 'W:' "$@" > "${GPGHOMEDIR}/aptwarnings.log" fi if [ -n "$GPGSTATUSFD" ]; then echo >&${GPGSTATUSFD} '[APTKEY:] WARNING' "$@" fi } apt_error() { if [ -z "$GPGHOMEDIR" ]; then echo >&2 'E:' "$@" else echo 'E:' "$@" > "${GPGHOMEDIR}/aptwarnings.log" fi if [ -n "$GPGSTATUSFD" ]; then echo >&${GPGSTATUSFD} '[APTKEY:] ERROR' "$@" fi } cleanup_gpg_home() { if [ -z "$GPGHOMEDIR" ]; then return; fi if [ -s "$GPGHOMEDIR/aptwarnings.log" ]; then cat >&2 "$GPGHOMEDIR/aptwarnings.log" fi if command_available 'gpgconf'; then GNUPGHOME="${GPGHOMEDIR}" gpgconf --kill all >/dev/null 2>&1 || true fi rm -rf "$GPGHOMEDIR" } # gpg needs (in different versions more or less) files to function correctly, # so we give it its own homedir and generate some valid content for it later on create_gpg_home() { # for cases in which we want to cache a homedir due to expensive setup if [ -n "$GPGHOMEDIR" ]; then return fi if [ -n "$TMPDIR" ]; then # tmpdir is a directory and current user has rwx access to it # same tests as in apt-pkg/contrib/fileutl.cc GetTempDir() if [ ! -d "$TMPDIR" ] || [ ! -r "$TMPDIR" ] || [ ! -w "$TMPDIR" ] || [ ! -x "$TMPDIR" ]; then unset TMPDIR fi fi GPGHOMEDIR="$(mktemp --directory --tmpdir 'apt-key-gpghome.XXXXXXXXXX')" CURRENTTRAP="${CURRENTTRAP} cleanup_gpg_home;" trap "${CURRENTTRAP}" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM if [ -z "$GPGHOMEDIR" ]; then apt_error "Could not create temporary gpg home directory in $TMPDIR (wrong permissions?)" exit 28 fi chmod 700 "$GPGHOMEDIR" } requires_root() { if [ "$(id -u)" -ne 0 ]; then apt_error "This command can only be used by root." exit 1 fi } command_available() { if [ -x "$1" ]; then return 0; fi # command -v "$1" >/dev/null 2>&1 # not required by policy, see #747320 # which "$1" >/dev/null 2>&1 # is in debianutils (essential) but not on non-debian systems local OLDIFS="$IFS" IFS=: for p in $PATH; do if [ -x "${p}/${1}" ]; then IFS="$OLDIFS" return 0 fi done IFS="$OLDIFS" return 1 } escape_shell() { echo "$@" | sed -e "s#'#'\"'\"'#g" } get_fingerprints_of_keyring() { aptkey_execute "$GPG_SH" --keyring "$1" --with-colons --fingerprint | while read publine; do # search for a public key if [ "${publine%%:*}" != 'pub' ]; then continue; fi # search for the associated fingerprint (should be the very next line) while read fprline; do if [ "${fprline%%:*}" = 'sub' ]; then break; # should never happen elif [ "${fprline%%:*}" != 'fpr' ]; then continue; fi echo "$fprline" | cut -d':' -f 10 done # order in the keyring shouldn't be important done | sort } add_keys_with_verify_against_master_keyring() { ADD_KEYRING="$1" MASTER="$2" if [ ! -f "$ADD_KEYRING" ]; then apt_error "Keyring '$ADD_KEYRING' to be added not found" return fi if [ ! -f "$MASTER" ]; then apt_error "Master-Keyring '$MASTER' not found" return fi # when adding new keys, make sure that the archive-master-keyring # is honored. so: # all keys that are exported must have a valid signature # from a key in the $distro-master-keyring add_keys="$(get_fingerprints_of_keyring "$ADD_KEYRING")" all_add_keys="$(aptkey_execute "$GPG_SH" --keyring "$ADD_KEYRING" --with-colons --list-keys | grep ^[ps]ub | cut -d: -f5)" master_keys="$(aptkey_execute "$GPG_SH" --keyring "$MASTER" --with-colons --list-keys | grep ^pub | cut -d: -f5)" # ensure there are no colisions LP: #857472 for all_add_key in $all_add_keys; do for master_key in $master_keys; do if [ "$all_add_key" = "$master_key" ]; then echo >&2 "Keyid collision for '$all_add_key' detected, operation aborted" return 1 fi done done for add_key in $add_keys; do # export the add keyring one-by-one local TMP_KEYRING="${GPGHOMEDIR}/tmp-keyring.gpg" aptkey_execute "$GPG_SH" --batch --yes --keyring "$ADD_KEYRING" --output "$TMP_KEYRING" --export "$add_key" if ! aptkey_execute "$GPG_SH" --batch --yes --keyring "$TMP_KEYRING" --import "$MASTER" > "${GPGHOMEDIR}/gpgoutput.log" 2>&1; then cat >&2 "${GPGHOMEDIR}/gpgoutput.log" false fi # check if signed with the master key and only add in this case ADDED=0 for master_key in $master_keys; do if aptkey_execute "$GPG_SH" --keyring "$TMP_KEYRING" --check-sigs --with-colons "$add_key" \ | grep '^sig:!:' | cut -d: -f5 | grep -q "$master_key"; then aptkey_execute "$GPG_SH" --batch --yes --keyring "$ADD_KEYRING" --export "$add_key" \ | aptkey_execute "$GPG" --batch --yes --import ADDED=1 fi done if [ $ADDED = 0 ]; then echo >&2 "Key '$add_key' not added. It is not signed with a master key" fi rm -f "${TMP_KEYRING}" done } # update the current archive signing keyring from a network URI # the archive-keyring keys needs to be signed with the master key # (otherwise it does not make sense from a security POV) net_update() { local APT_DIR='/' eval $(apt-config shell APT_DIR Dir) # Disabled for now as code is insecure (LP: #1013639 (and 857472, 1013128)) APT_KEY_NET_UPDATE_ENABLED="" eval $(apt-config shell APT_KEY_NET_UPDATE_ENABLED APT::Key::Net-Update-Enabled) if [ -z "$APT_KEY_NET_UPDATE_ENABLED" ]; then exit 1 fi if [ -z "$ARCHIVE_KEYRING_URI" ]; then apt_error 'Your distribution is not supported in net-update as no uri for the archive-keyring is set' exit 1 fi # in theory we would need to depend on wget for this, but this feature # isn't usable in debian anyway as we have no keyring uri nor a master key if ! command_available 'wget'; then apt_error 'wget is required for a network-based update, but it is not installed' exit 1 fi if [ ! -d "${APT_DIR}/var/lib/apt/keyrings" ]; then mkdir -p "${APT_DIR}/var/lib/apt/keyrings" fi keyring="${APT_DIR}/var/lib/apt/keyrings/$(basename "$ARCHIVE_KEYRING_URI")" old_mtime=0 if [ -e $keyring ]; then old_mtime=$(stat -c %Y "$keyring") fi (cd "${APT_DIR}/var/lib/apt/keyrings"; wget --timeout=90 -q -N "$ARCHIVE_KEYRING_URI") if [ ! -e "$keyring" ]; then return fi new_mtime=$(stat -c %Y "$keyring") if [ $new_mtime -ne $old_mtime ]; then aptkey_echo "Checking for new archive signing keys now" add_keys_with_verify_against_master_keyring "$keyring" "$MASTER_KEYRING" fi } update() { if [ -z "$APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE" ]; then echo >&2 "Warning: 'apt-key update' is deprecated and should not be used anymore!" if [ -z "$ARCHIVE_KEYRING" ]; then echo >&2 "Note: In your distribution this command is a no-op and can therefore be removed safely." exit 0 fi fi if [ ! -f "$ARCHIVE_KEYRING" ]; then apt_error "Can't find the archive-keyring (Is the ubuntu-keyring package installed?)" exit 1 fi # add new keys from the package; # we do not use add_keys_with_verify_against_master_keyring here, # because "update" is run on regular package updates. A # attacker might as well replace the master-archive-keyring file # in the package and add his own keys. so this check wouldn't # add any security. we *need* this check on net-update though import_keyring_into_keyring "$ARCHIVE_KEYRING" '' && cat "${GPGHOMEDIR}/gpgoutput.log" if [ -r "$REMOVED_KEYS" ]; then # remove no-longer supported/used keys get_fingerprints_of_keyring "$(dearmor_filename "$REMOVED_KEYS")" | while read key; do foreach_keyring_do 'remove_key_from_keyring' "$key" done else apt_warn "Removed keys keyring '$REMOVED_KEYS' missing or not readable" fi } remove_key_from_keyring() { local KEYRINGFILE="$1" shift # non-existent keyrings have by definition no keys if [ ! -e "$KEYRINGFILE" ]; then return fi local FINGERPRINTS="${GPGHOMEDIR}/keyringfile.keylst" local DEARMOR="$(dearmor_filename "$KEYRINGFILE")" get_fingerprints_of_keyring "$DEARMOR" > "$FINGERPRINTS" for KEY in "$@"; do # strip leading 0x, if present: KEY="$(echo "${KEY#0x}" | tr -d ' ')" # check if the key is in this keyring if ! grep -iq "^[0-9A-F]*${KEY}$" "$FINGERPRINTS"; then continue fi if [ ! -w "$KEYRINGFILE" ]; then apt_warn "Key ${KEY} is in keyring ${KEYRINGFILE}, but can't be removed as it is read only." continue fi # check if it is the only key in the keyring and if so remove the keyring altogether if [ '1' = "$(uniq "$FINGERPRINTS" | wc -l)" ]; then mv -f "$KEYRINGFILE" "${KEYRINGFILE}~" # behave like gpg return fi # we can't just modify pointed to files as these might be in /usr or something local REALTARGET if [ -L "$DEARMOR" ]; then REALTARGET="$(readlink -f "$DEARMOR")" mv -f "$DEARMOR" "${DEARMOR}.dpkg-tmp" cp -a "$REALTARGET" "$DEARMOR" fi # delete the key from the keyring aptkey_execute "$GPG_SH" --keyring "$DEARMOR" --batch --delete-keys --yes "$KEY" if [ -n "$REALTARGET" ]; then # the real backup is the old link, not the copy we made mv -f "${DEARMOR}.dpkg-tmp" "${DEARMOR}~" fi if [ "$DEARMOR" != "$KEYRINGFILE" ]; then mv -f "$KEYRINGFILE" "${KEYRINGFILE}~" create_new_keyring "$KEYRINGFILE" aptkey_execute "$GPG_SH" --keyring "$DEARMOR" --armor --export > "$KEYRINGFILE" fi get_fingerprints_of_keyring "$DEARMOR" > "$FINGERPRINTS" done } accessible_file_exists() { if ! test -s "$1"; then return 1 fi if test -r "$1"; then return 0 fi apt_warn "The key(s) in the keyring $1 are ignored as the file is not readable by user '$USER' executing apt-key." return 1 } is_supported_keyring() { # empty files are always supported if ! test -s "$1"; then return 0 fi local FILEEXT="${1##*.}" if [ "$FILEEXT" = 'gpg' ]; then # 0x98, 0x99 and 0xC6 via octal as hex isn't supported by dashs printf if printf '\231' | cmp --silent --bytes=1 - "$1"; then true elif printf '\230' | cmp --silent --bytes=1 - "$1"; then true elif printf '\306' | cmp --silent --bytes=1 - "$1"; then true else apt_warn "The key(s) in the keyring $1 are ignored as the file has an unsupported filetype." return 1 fi elif [ "$FILEEXT" = 'asc' ]; then true #dearmor_filename will deal with them else # most callers ignore unsupported extensions silently apt_warn "The key(s) in the keyring $1 are ignored as the file has an unsupported filename extension." return 1 fi return 0 } foreach_keyring_do() { local ACTION="$1" shift # if a --keyring was given, just work on this one if [ -n "$FORCED_KEYRING" ]; then $ACTION "$FORCED_KEYRING" "$@" else # otherwise all known keyrings are up for inspection if accessible_file_exists "$TRUSTEDFILE" && is_supported_keyring "$TRUSTEDFILE"; then $ACTION "$TRUSTEDFILE" "$@" fi local TRUSTEDPARTS="/etc/apt/trusted.gpg.d" eval "$(apt-config shell TRUSTEDPARTS Dir::Etc::TrustedParts/d)" if [ -d "$TRUSTEDPARTS" ]; then TRUSTEDPARTS="$(readlink -f "$TRUSTEDPARTS")" local TRUSTEDPARTSLIST="$(cd /; find "$TRUSTEDPARTS" -mindepth 1 -maxdepth 1 \( -name '*.gpg' -o -name '*.asc' \))" for trusted in $(echo "$TRUSTEDPARTSLIST" | sort); do if accessible_file_exists "$trusted" && is_supported_keyring "$trusted"; then $ACTION "$trusted" "$@" fi done fi fi } list_keys_in_keyring() { local KEYRINGFILE="$1" shift # fingerprint and co will fail if key isn't in this keyring aptkey_execute "$GPG_SH" --keyring "$(dearmor_filename "$KEYRINGFILE")" "$@" > "${GPGHOMEDIR}/gpgoutput.log" 2> "${GPGHOMEDIR}/gpgoutput.err" || true if [ ! -s "${GPGHOMEDIR}/gpgoutput.log" ]; then return fi # we fake gpg header here to refer to the real asc file rather than a temp file if [ "${KEYRINGFILE##*.}" = 'asc' ]; then if expr match "$(sed -n '2p' "${GPGHOMEDIR}/gpgoutput.log")" '^-\+$' >/dev/null 2>&1; then echo "$KEYRINGFILE" echo "$KEYRINGFILE" | sed 's#[^-]#-#g' sed '1,2d' "${GPGHOMEDIR}/gpgoutput.log" || true else cat "${GPGHOMEDIR}/gpgoutput.log" fi else cat "${GPGHOMEDIR}/gpgoutput.log" fi if [ -s "${GPGHOMEDIR}/gpgoutput.err" ]; then cat >&2 "${GPGHOMEDIR}/gpgoutput.err" fi } export_key_from_to() { local FROM="$1" local TO="$2" shift 2 if ! aptkey_execute "$GPG_SH" --keyring "$(dearmor_filename "$FROM")" --export "$@" > "$TO" 2> "${GPGHOMEDIR}/gpgoutput.log"; then cat >&2 "${GPGHOMEDIR}/gpgoutput.log" false else chmod 0644 -- "$TO" fi } import_keyring_into_keyring() { local FROM="${1:-${GPGHOMEDIR}/pubring.gpg}" local TO="${2:-${GPGHOMEDIR}/pubring.gpg}" shift 2 rm -f "${GPGHOMEDIR}/gpgoutput.log" # the idea is simple: We take keys from one keyring and copy it to another # we do this with so many checks in between to ensure that WE control the # creation, so we know that the (potentially) created $TO keyring is a # simple keyring rather than a keybox as gpg2 would create it which in turn # can't be read by gpgv. # BEWARE: This is designed more in the way to work with the current # callers, than to have a well defined it would be easy to add new callers to. if [ ! -s "$TO" ]; then if [ -s "$FROM" ]; then if [ -z "$2" ]; then local OPTS if [ "${TO##*.}" = 'asc' ]; then OPTS='--armor' fi export_key_from_to "$(dearmor_filename "$FROM")" "$TO" $OPTS ${1:+"$1"} else create_new_keyring "$TO" fi else create_new_keyring "$TO" fi elif [ -s "$FROM" ]; then local EXPORTLIMIT="$1" if [ -n "$1$2" ]; then shift; fi local DEARMORTO="$(dearmor_filename "$TO")" if ! aptkey_execute "$GPG_SH" --keyring "$(dearmor_filename "$FROM")" --export ${EXPORTLIMIT:+"$EXPORTLIMIT"} \ | aptkey_execute "$GPG_SH" --keyring "$DEARMORTO" --batch --import "$@" > "${GPGHOMEDIR}/gpgoutput.log" 2>&1; then cat >&2 "${GPGHOMEDIR}/gpgoutput.log" false fi if [ "$DEARMORTO" != "$TO" ]; then export_key_from_to "$DEARMORTO" "${DEARMORTO}.asc" --armor if ! cmp -s "$TO" "${DEARMORTO}.asc" 2>/dev/null; then cp -a "$TO" "${TO}~" mv -f "${DEARMORTO}.asc" "$TO" fi fi fi } dearmor_keyring() { # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=831409#67 # The awk script is more complex through to skip surrounding garbage and # to support multiple keys in one file (old gpgs generate version headers # which get printed with the original and hence result in garbage input for base64 awk '/^-----BEGIN/{ x = 1; } /^$/{ if (x == 1) { x = 2; }; } /^[^=-]/{ if (x == 2) { print $0; }; } /^-----END/{ x = 0; }' | base64 -d } dearmor_filename() { if [ "${1##*.}" = 'asc' ]; then local trusted="${GPGHOMEDIR}/${1##*/}.gpg" if [ -s "$1" ]; then dearmor_keyring < "$1" > "$trusted" fi echo "$trusted" elif [ "${1##*.}" = 'gpg' ]; then echo "$1" elif [ "$(head -n 1 "$1" 2>/dev/null)" = '-----BEGIN PGP PUBLIC KEY BLOCK-----' ]; then local trusted="${GPGHOMEDIR}/${1##*/}.gpg" dearmor_keyring < "$1" > "$trusted" echo "$trusted" else echo "$1" fi } catfile() { cat "$(dearmor_filename "$1")" >> "$2" } merge_all_trusted_keyrings_into_pubring() { # does the same as: # foreach_keyring_do 'import_keys_from_keyring' "${GPGHOMEDIR}/pubring.gpg" # but without using gpg, just cat and find local PUBRING="$(readlink -f "${GPGHOMEDIR}")/pubring.gpg" rm -f "$PUBRING" touch "$PUBRING" foreach_keyring_do 'catfile' "$PUBRING" } import_keys_from_keyring() { import_keyring_into_keyring "$1" "$2" } merge_keys_into_keyrings() { import_keyring_into_keyring "$2" "$1" '' --import-options 'merge-only' } merge_back_changes() { if [ -n "$FORCED_KEYRING" ]; then # if the keyring was forced merge is already done if [ "$FORCED_KEYRING" != "$TRUSTEDFILE" ]; then mv -f "$FORCED_KEYRING" "${FORCED_KEYRING}~" export_key_from_to "$TRUSTEDFILE" "$FORCED_KEYRING" --armor fi return fi if [ -s "${GPGHOMEDIR}/pubring.gpg" ]; then # merge all updated keys foreach_keyring_do 'merge_keys_into_keyrings' "${GPGHOMEDIR}/pubring.gpg" fi # look for keys which were added or removed get_fingerprints_of_keyring "${GPGHOMEDIR}/pubring.orig.gpg" > "${GPGHOMEDIR}/pubring.orig.keylst" get_fingerprints_of_keyring "${GPGHOMEDIR}/pubring.gpg" > "${GPGHOMEDIR}/pubring.keylst" comm -3 "${GPGHOMEDIR}/pubring.keylst" "${GPGHOMEDIR}/pubring.orig.keylst" > "${GPGHOMEDIR}/pubring.diff" # key isn't part of new keyring, so remove cut -f 2 "${GPGHOMEDIR}/pubring.diff" | while read key; do if [ -z "$key" ]; then continue; fi foreach_keyring_do 'remove_key_from_keyring' "$key" done # key is only part of new keyring, so we need to import it cut -f 1 "${GPGHOMEDIR}/pubring.diff" | while read key; do if [ -z "$key" ]; then continue; fi import_keyring_into_keyring '' "$TRUSTEDFILE" "$key" done } setup_merged_keyring() { if [ -n "$FORCED_KEYID" ]; then merge_all_trusted_keyrings_into_pubring FORCED_KEYRING="${GPGHOMEDIR}/forcedkeyid.gpg" TRUSTEDFILE="${FORCED_KEYRING}" echo "#!/bin/sh exec sh '($(escape_shell "${GPG}")' --keyring '$(escape_shell "${TRUSTEDFILE}")' \"\$@\"" > "${GPGHOMEDIR}/gpg.1.sh" GPG="${GPGHOMEDIR}/gpg.1.sh" # ignore error as this "just" means we haven't found the forced keyid and the keyring will be empty import_keyring_into_keyring '' "$TRUSTEDFILE" "$FORCED_KEYID" || true elif [ -z "$FORCED_KEYRING" ]; then merge_all_trusted_keyrings_into_pubring if [ -r "${GPGHOMEDIR}/pubring.gpg" ]; then cp -a "${GPGHOMEDIR}/pubring.gpg" "${GPGHOMEDIR}/pubring.orig.gpg" else touch "${GPGHOMEDIR}/pubring.gpg" "${GPGHOMEDIR}/pubring.orig.gpg" fi echo "#!/bin/sh exec sh '$(escape_shell "${GPG}")' --keyring '$(escape_shell "${GPGHOMEDIR}/pubring.gpg")' \"\$@\"" > "${GPGHOMEDIR}/gpg.1.sh" GPG="${GPGHOMEDIR}/gpg.1.sh" else TRUSTEDFILE="$(dearmor_filename "$FORCED_KEYRING")" create_new_keyring "$TRUSTEDFILE" echo "#!/bin/sh exec sh '$(escape_shell "${GPG}")' --keyring '$(escape_shell "${TRUSTEDFILE}")' \"\$@\"" > "${GPGHOMEDIR}/gpg.1.sh" GPG="${GPGHOMEDIR}/gpg.1.sh" fi } create_new_keyring() { # gpg defaults to mode 0600 for new keyrings. Create one with 0644 instead. if ! [ -e "$1" ]; then if [ -w "$(dirname "$1")" ]; then touch -- "$1" chmod 0644 -- "$1" fi fi } aptkey_execute() { sh "$@"; } usage() { echo "Usage: apt-key [--keyring file] [command] [arguments]" echo echo "Manage apt's list of trusted keys" echo echo " apt-key add <file> - add the key contained in <file> ('-' for stdin)" echo " apt-key del <keyid> - remove the key <keyid>" echo " apt-key export <keyid> - output the key <keyid>" echo " apt-key exportall - output all trusted keys" echo " apt-key update - update keys using the keyring package" echo " apt-key net-update - update keys using the network" echo " apt-key list - list keys" echo " apt-key finger - list fingerprints" echo " apt-key adv - pass advanced options to gpg (download key)" echo echo "If no specific keyring file is given the command applies to all keyring files." } while [ -n "$1" ]; do case "$1" in --keyring) shift if [ -z "$FORCED_KEYRING" -o "$FORCED_KEYRING" = '/dev/null' ]; then TRUSTEDFILE="$1" FORCED_KEYRING="$1" elif [ "$TRUSTEDFILE" = "$FORCED_KEYRING" ]; then create_gpg_home FORCED_KEYRING="${GPGHOMEDIR}/mergedkeyrings.gpg" echo -n '' > "$FORCED_KEYRING" chmod 0644 -- "$FORCED_KEYRING" catfile "$TRUSTEDFILE" "$FORCED_KEYRING" catfile "$1" "$FORCED_KEYRING" else catfile "$1" "$FORCED_KEYRING" fi ;; --keyid) shift if [ -n "$FORCED_KEYID" ]; then apt_error 'Specifying --keyid multiple times is not supported' exit 1 fi FORCED_KEYID="$1" ;; --secret-keyring) shift FORCED_SECRET_KEYRING="$1" ;; --readonly) merge_back_changes() { true; } create_new_keyring() { if [ ! -r "$FORCED_KEYRING" ]; then TRUSTEDFILE='/dev/null'; FORCED_KEYRING="$TRUSTEDFILE"; fi; } ;; --fakeroot) requires_root() { true; } ;; --quiet) aptkey_echo() { true; } ;; --debug1) # some cmds like finger redirect stderr to /dev/null … aptkey_execute() { echo 'EXEC:' "$@"; sh "$@"; } ;; --debug2) # … other more complicated ones pipe gpg into gpg. aptkey_execute() { echo >&2 'EXEC:' "$@"; sh "$@"; } ;; --homedir) # force usage of a specific homedir instead of creating a temporary shift GPGHOMEDIR="$1" ;; --*) echo >&2 "Unknown option: $1" usage exit 1;; *) break;; esac shift done if [ -z "$TRUSTEDFILE" ]; then TRUSTEDFILE="/etc/apt/trusted.gpg" eval $(apt-config shell TRUSTEDFILE Apt::GPGV::TrustedKeyring) eval $(apt-config shell TRUSTEDFILE Dir::Etc::Trusted/f) fi command="$1" if [ -z "$command" ]; then usage exit 1 fi shift prepare_gpg_home() { # crude detection if we are called from a maintainerscript where the # package depends on gnupg or not. We accept recommends here as # well as the script hopefully uses apt-key optionally then like e.g. # debian-archive-keyring for (upgrade) cleanup did if [ -n "$DPKG_MAINTSCRIPT_PACKAGE" ] && [ -z "$APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE" ]; then if ! dpkg-query --show --showformat '${Pre-Depends}${Depends}${Recommends}\n' "$DPKG_MAINTSCRIPT_PACKAGE" 2>/dev/null | grep -q gnupg; then cat >&2 <<EOF Warning: The $DPKG_MAINTSCRIPT_NAME maintainerscript of the package $DPKG_MAINTSCRIPT_PACKAGE Warning: seems to use apt-key (provided by apt) without depending on gnupg or gnupg2. Warning: This will BREAK in the future and should be fixed by the package maintainer(s). Note: Check first if apt-key functionality is needed at all - it probably isn't! EOF fi fi eval "$(apt-config shell GPG_EXE Apt::Key::gpgcommand)" if [ -n "$GPG_EXE" ] && command_available "$GPG_EXE"; then true elif command_available 'gpg'; then GPG_EXE="gpg" elif command_available 'gpg2'; then GPG_EXE="gpg2" elif command_available 'gpg1'; then GPG_EXE="gpg1" else apt_error 'gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation' exit 255 fi create_gpg_home # now tell gpg that it shouldn't try to maintain this trustdb file echo "#!/bin/sh exec '$(escape_shell "${GPG_EXE}")' --ignore-time-conflict --no-options --no-default-keyring \\ --homedir '$(escape_shell "${GPGHOMEDIR}")' --no-auto-check-trustdb --trust-model always \"\$@\"" > "${GPGHOMEDIR}/gpg.0.sh" GPG_SH="${GPGHOMEDIR}/gpg.0.sh" GPG="$GPG_SH" # create the trustdb with an (empty) dummy keyring # older gpgs required it, newer gpgs even warn that it isn't needed, # but require it nonetheless for some commands, so we just play safe # here for the foreseeable future and create a dummy one touch "${GPGHOMEDIR}/empty.gpg" if ! "$GPG_EXE" --ignore-time-conflict --no-options --no-default-keyring \ --homedir "$GPGHOMEDIR" --quiet --check-trustdb --keyring "${GPGHOMEDIR}/empty.gpg" >"${GPGHOMEDIR}/gpgoutput.log" 2>&1; then cat >&2 "${GPGHOMEDIR}/gpgoutput.log" false fi # We don't usually need a secret keyring, of course, but # for advanced operations, we might really need a secret keyring after all if [ -n "$FORCED_SECRET_KEYRING" ] && [ -r "$FORCED_SECRET_KEYRING" ]; then if ! aptkey_execute "$GPG" -v --batch --import "$FORCED_SECRET_KEYRING" >"${GPGHOMEDIR}/gpgoutput.log" 2>&1; then # already imported keys cause gpg1 to fail for some reason… ignore this error if ! grep -q 'already in secret keyring' "${GPGHOMEDIR}/gpgoutput.log"; then cat >&2 "${GPGHOMEDIR}/gpgoutput.log" false fi fi else # and then, there are older versions of gpg which panic and implode # if there isn't one available - and writeable for imports # and even if not output is littered with the creation of a secring, # so lets call import once to have it create what it wants in silence echo -n | aptkey_execute "$GPG" --batch --import >/dev/null 2>&1 || true fi } warn_on_script_usage() { if [ -n "$APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE" ]; then return fi # (Maintainer) scripts should not be using apt-key if [ -n "$DPKG_MAINTSCRIPT_PACKAGE" ]; then echo >&2 "Warning: apt-key should not be used in scripts (called from $DPKG_MAINTSCRIPT_NAME maintainerscript of the package ${DPKG_MAINTSCRIPT_PACKAGE})" elif [ ! -t 1 ]; then echo >&2 "Warning: apt-key output should not be parsed (stdout is not a terminal)" fi } if [ "$command" != 'help' ] && [ "$command" != 'verify' ]; then prepare_gpg_home fi case "$command" in add) warn_on_script_usage requires_root setup_merged_keyring aptkey_execute "$GPG" --quiet --batch --import "$@" merge_back_changes aptkey_echo "OK" ;; del|rm|remove) # no script warning here as removing 'add' usage needs 'del' for cleanup requires_root foreach_keyring_do 'remove_key_from_keyring' "$@" aptkey_echo "OK" ;; update) warn_on_script_usage requires_root setup_merged_keyring update merge_back_changes ;; net-update) requires_root setup_merged_keyring net_update merge_back_changes ;; list|finger*) warn_on_script_usage foreach_keyring_do 'list_keys_in_keyring' --fingerprint "$@" ;; export|exportall) warn_on_script_usage merge_all_trusted_keyrings_into_pubring aptkey_execute "$GPG_SH" --keyring "${GPGHOMEDIR}/pubring.gpg" --armor --export "$@" ;; adv*) warn_on_script_usage setup_merged_keyring aptkey_echo "Executing: $GPG" "$@" aptkey_execute "$GPG" "$@" merge_back_changes ;; verify) GPGV='' eval $(apt-config shell GPGV Apt::Key::gpgvcommand) if [ -n "$GPGV" ] && command_available "$GPGV"; then true; elif command_available 'gpgv'; then GPGV='gpgv'; elif command_available 'gpgv2'; then GPGV='gpgv2'; elif command_available 'gpgv1'; then GPGV='gpgv1'; else apt_error 'gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed' exit 29 fi # for a forced keyid we need gpg --export, so full wrapping required if [ -n "$FORCED_KEYID" ]; then prepare_gpg_home else create_gpg_home fi setup_merged_keyring if [ -n "$FORCED_KEYRING" ]; then "$GPGV" --homedir "${GPGHOMEDIR}" --keyring "$(dearmor_filename "${FORCED_KEYRING}")" --ignore-time-conflict "$@" else "$GPGV" --homedir "${GPGHOMEDIR}" --keyring "${GPGHOMEDIR}/pubring.gpg" --ignore-time-conflict "$@" fi ;; help) usage ;; *) usage exit 1 ;; esac
Close