WebShell Manager
Linux Stag-Enterprise-Staging-20-04 5.11.0-1019-aws #20~20.04.1-Ubuntu SMP Tue Sep 21 10:40:39 UTC 2021 x86_64
Apache
Server: 172.31.9.152
Your IP: 216.73.216.236
System Info
HOME
snap
core18
2979
usr
bin
Command Execution
Execute
File Upload
Upload
New Folder
New File
Name
Type
Size
Permissions
Modified
Actions
..
Parent
-
drwxr-xr-x
2026-01-05 10:20:57
-
[
File
50.18 KB
0755
2018-01-18 09:43:49
aa-enabled
File
22.16 KB
0755
2023-06-13 14:19:14
aa-exec
File
22.16 KB
0755
2023-06-13 14:19:14
addpart
File
22.08 KB
0755
2020-09-16 18:43:15
apt
File
77 B
0755
2026-01-05 10:19:00
apt-cache
File
77 B
0755
2026-01-05 10:19:00
apt-get
File
77 B
0755
2026-01-05 10:19:00
arch
File
34.21 KB
0755
2018-01-18 09:43:49
awk
File
122.48 KB
0755
2018-04-03 12:34:18
b2sum
File
54.21 KB
0755
2018-01-18 09:43:49
base32
File
38.18 KB
0755
2018-01-18 09:43:49
base64
File
38.18 KB
0755
2018-01-18 09:43:49
basename
File
34.18 KB
0755
2018-01-18 09:43:49
bashbug
File
6.95 KB
0755
2022-04-18 15:08:18
bootctl
File
34.13 KB
0755
2024-08-16 14:54:17
busctl
File
66.09 KB
0755
2024-08-16 14:54:17
c_rehash
File
6.65 KB
0755
2025-09-17 14:05:41
captoinfo
File
82.11 KB
0755
2024-03-06 14:37:58
catchsegv
File
3.26 KB
0755
2025-05-26 08:18:50
cautious-launcher
File
853 B
0755
2016-07-15 12:06:12
chage
File
70.13 KB
2755
2024-02-06 12:31:54
chardet3
File
389 B
0755
2017-06-18 21:51:08
chardetect3
File
389 B
0755
2017-06-18 21:51:08
chattr
File
14 KB
0755
2022-06-02 14:37:00
chcon
File
62.18 KB
0755
2018-01-18 09:43:49
chfn
File
74.7 KB
4755
2024-02-06 12:31:54
chrt
File
30.08 KB
0755
2020-09-16 18:43:15
chsh
File
43.48 KB
4755
2024-02-06 12:31:54
cksum
File
34.18 KB
0755
2018-01-18 09:43:49
clear
File
10 KB
0755
2024-03-06 14:37:58
clear_console
File
10.07 KB
0755
2022-04-18 15:08:18
cloud-id
File
396 B
0755
2025-06-25 21:46:01
cloud-init
File
400 B
0755
2025-06-25 21:46:01
cloud-init-per
File
2.06 KB
0755
2023-04-20 21:31:09
cmp
File
46.09 KB
0755
2017-08-04 21:20:16
comm
File
38.21 KB
0755
2018-01-18 09:43:49
compose
File
17.74 KB
0755
2016-07-15 12:06:12
console-conf
File
2.86 KB
0755
2020-07-22 14:34:46
core-sshd-host-keygen
File
1.53 KB
0755
2026-01-05 10:17:00
csplit
File
50.21 KB
0755
2018-01-18 09:43:49
ctstat
File
22.35 KB
0755
2021-01-26 13:33:08
cut
File
42.21 KB
0755
2018-01-18 09:43:49
dbus-cleanup-sockets
File
9.98 KB
0755
2022-10-25 13:03:19
dbus-daemon
File
231.04 KB
0755
2022-10-25 13:03:19
dbus-monitor
File
21.99 KB
0755
2022-10-25 13:03:19
dbus-run-session
File
9.98 KB
0755
2022-10-25 13:03:19
dbus-send
File
25.98 KB
0755
2022-10-25 13:03:19
dbus-update-activation-environment
File
13.98 KB
0755
2022-10-25 13:03:19
dbus-uuidgen
File
9.98 KB
0755
2022-10-25 13:03:19
deb-systemd-helper
File
19.67 KB
0755
2017-10-25 15:38:42
deb-systemd-invoke
File
4.33 KB
0755
2017-10-25 15:38:42
delpart
File
22.08 KB
0755
2020-09-16 18:43:15
dh_bash-completion
File
2.49 KB
0755
2018-04-02 02:16:46
diff
File
142.34 KB
0755
2017-08-04 21:20:16
diff3
File
62.21 KB
0755
2017-08-04 21:20:16
dircolors
File
46.19 KB
0755
2018-01-18 09:43:49
dirname
File
30.18 KB
0755
2018-01-18 09:43:49
dpkg-deb
File
150.34 KB
0755
2022-05-25 11:14:56
du
File
98.21 KB
0755
2018-01-18 09:43:49
ec2metadata
File
7.13 KB
0755
2018-04-13 13:07:55
edit
File
17.74 KB
0755
2016-07-15 12:06:12
editor
File
1.06 MB
0755
2025-10-02 22:59:18
env
File
34.18 KB
0755
2018-01-18 09:43:49
ex
File
1.06 MB
0755
2025-10-02 22:59:18
expand
File
38.21 KB
0755
2018-01-18 09:43:49
expiry
File
22.27 KB
2755
2024-02-06 12:31:54
expr
File
46.18 KB
0755
2018-01-18 09:43:49
factor
File
74.21 KB
0755
2018-01-18 09:43:49
faillog
File
18.29 KB
0755
2024-02-06 12:31:54
fallocate
File
26.08 KB
0755
2020-09-16 18:43:15
finalrd
File
2.1 KB
0755
2020-09-10 14:54:08
find
File
232.5 KB
0755
2017-11-05 17:16:48
flock
File
30.16 KB
0755
2020-09-16 18:43:15
fmt
File
42.18 KB
0755
2018-01-18 09:43:49
fold
File
34.18 KB
0755
2018-01-18 09:43:49
free
File
18.08 KB
0755
2023-10-31 11:35:42
gdbserver
File
645.52 KB
0755
2024-06-13 03:15:46
getconf
File
30.13 KB
0755
2025-05-26 08:18:50
getent
File
30.49 KB
0755
2025-05-26 08:18:50
getopt
File
14.07 KB
0755
2020-09-16 18:43:15
gpasswd
File
74.05 KB
4755
2024-02-06 12:31:54
gpgv
File
431.02 KB
0755
2025-12-04 13:13:02
groups
File
34.18 KB
0755
2018-01-18 09:43:49
growpart
File
21.37 KB
0755
2018-04-13 13:07:55
head
File
42.21 KB
0755
2018-01-18 09:43:49
helpztags
File
2.46 KB
0755
2024-08-27 05:37:55
hostid
File
30.18 KB
0755
2018-01-18 09:43:49
hostnamectl
File
18.07 KB
0755
2024-08-16 14:54:17
i386
File
18.34 KB
0755
2020-09-16 18:43:15
iconv
File
62.25 KB
0755
2025-05-26 08:18:50
id
File
42.21 KB
0755
2018-01-18 09:43:49
infocmp
File
58.07 KB
0755
2024-03-06 14:37:58
infotocap
File
82.11 KB
0755
2024-03-06 14:37:58
install
File
142.25 KB
0755
2018-01-18 09:43:49
ionice
File
26.08 KB
0755
2020-09-16 18:43:15
ipcmk
File
26.14 KB
0755
2020-09-16 18:43:15
ipcrm
File
26.08 KB
0755
2020-09-16 18:43:15
ipcs
File
50.08 KB
0755
2020-09-16 18:43:15
iptables-xml
File
0 B
0
1970-01-01 00:00:00
ischroot
File
10.04 KB
0755
2017-12-30 18:15:02
join
File
46.21 KB
0755
2018-01-18 09:43:49
jsondiff
File
1018 B
0755
2017-10-28 20:10:15
jsonpatch
File
3.58 KB
0755
2017-10-28 20:10:15
jsonpointer
File
1.31 KB
0755
2016-05-01 23:14:11
jsonschema
File
398 B
0755
2017-11-15 19:43:29
kernel-install
File
4.4 KB
0755
2018-01-28 15:58:17
last
File
42.08 KB
0755
2020-09-16 18:43:15
lastb
File
42.08 KB
0755
2020-09-16 18:43:15
lastlog
File
18.07 KB
0755
2024-02-06 12:31:54
lcf
File
7.6 KB
0755
2018-02-26 00:58:23
ldd
File
5.3 KB
0755
2025-05-26 08:18:50
less
File
175.84 KB
0755
2024-04-28 11:42:44
lessecho
File
14.31 KB
0755
2024-04-28 11:42:44
lessfile
File
8.36 KB
0755
2019-09-03 04:41:52
lesskey
File
23.72 KB
0755
2024-04-28 11:42:44
lesspipe
File
8.36 KB
0755
2019-09-03 04:41:52
link
File
30.18 KB
0755
2018-01-18 09:43:49
linux32
File
18.34 KB
0755
2020-09-16 18:43:15
linux64
File
18.34 KB
0755
2020-09-16 18:43:15
lnstat
File
22.35 KB
0755
2021-01-26 13:33:08
locale
File
49.41 KB
0755
2025-05-26 08:18:50
locale-check
File
10 KB
0755
2024-01-02 17:19:18
localectl
File
22.07 KB
0755
2024-08-16 14:54:17
localedef
File
330.8 KB
0755
2025-05-26 08:18:50
logger
File
46.67 KB
0755
2020-09-16 18:43:15
logname
File
30.18 KB
0755
2018-01-18 09:43:49
lsattr
File
10 KB
0755
2022-06-02 14:37:00
lscpu
File
70.08 KB
0755
2020-09-16 18:43:15
lsipc
File
70.08 KB
0755
2020-09-16 18:43:15
lslocks
File
34.41 KB
0755
2020-09-16 18:43:15
lslogins
File
62.08 KB
0755
2020-09-16 18:43:15
lsmem
File
42.08 KB
0755
2020-09-16 18:43:15
lsns
File
38.08 KB
0755
2020-09-16 18:43:15
mawk
File
122.48 KB
0755
2018-04-03 12:34:18
mcookie
File
30.14 KB
0755
2020-09-16 18:43:15
md5sum
File
42.21 KB
0755
2018-01-18 09:43:49
md5sum.textutils
File
42.21 KB
0755
2018-01-18 09:43:49
mesg
File
10.07 KB
0755
2020-09-16 18:43:15
miniterm
File
34.28 KB
0755
2018-04-09 11:57:25
mkfifo
File
62.18 KB
0755
2018-01-18 09:43:49
mksquashfs
File
184.99 KB
0755
2021-09-14 08:43:17
mkswapfile
File
865 B
0755
2026-01-05 10:17:00
namei
File
26.08 KB
0755
2020-09-16 18:43:15
nawk
File
122.48 KB
0755
2018-04-03 12:34:18
newgrp
File
39.4 KB
4755
2024-02-06 12:31:54
nice
File
34.18 KB
0755
2018-01-18 09:43:49
nl
File
42.27 KB
0755
2018-01-18 09:43:49
no-apt
File
77 B
0755
2026-01-05 10:19:00
nohup
File
34.18 KB
0755
2018-01-18 09:43:49
nproc
File
34.18 KB
0755
2018-01-18 09:43:49
nsenter
File
30.28 KB
0755
2020-09-16 18:43:15
nstat
File
26.07 KB
0755
2021-01-26 13:33:08
numfmt
File
62.24 KB
0755
2018-01-18 09:43:49
od
File
66.21 KB
0755
2018-01-18 09:43:49
openssl
File
706.98 KB
0755
2025-09-17 14:05:41
pager
File
166.76 KB
0755
2024-04-28 11:42:19
partx
File
86.08 KB
0755
2020-09-16 18:43:15
passwd
File
58.24 KB
4755
2024-02-06 12:31:54
paste
File
34.21 KB
0755
2018-01-18 09:43:49
pathchk
File
34.18 KB
0755
2018-01-18 09:43:49
pdb3
File
59.87 KB
0755
2025-11-18 13:14:54
pdb3.6
File
59.87 KB
0755
2025-11-18 13:14:54
perl
File
2 MB
0755
2023-05-23 17:17:19
perl5.26.1
File
2 MB
0755
2023-05-23 17:17:19
pgrep
File
26.09 KB
0755
2023-10-31 11:35:42
pinky
File
38.21 KB
0755
2018-01-18 09:43:49
pkill
File
26.09 KB
0755
2023-10-31 11:35:42
pldd
File
14.22 KB
0755
2025-05-26 08:18:50
pmap
File
30.09 KB
0755
2023-10-31 11:35:42
pr
File
70.27 KB
0755
2018-01-18 09:43:49
print
File
17.74 KB
0755
2016-07-15 12:06:12
printenv
File
30.18 KB
0755
2018-01-18 09:43:49
printf
File
50.18 KB
0755
2018-01-18 09:43:49
prlimit
File
34.59 KB
0755
2020-09-16 18:43:15
probert
File
2.09 KB
0755
2018-10-15 10:49:55
ptx
File
70.24 KB
0755
2018-01-18 09:43:49
pwdx
File
10.07 KB
0755
2023-10-31 11:35:42
py3clean
File
7.63 KB
0755
2018-10-25 11:11:00
py3compile
File
11.83 KB
0755
2018-10-25 11:11:00
py3versions
File
11.44 KB
0755
2018-10-25 11:11:00
pydoc3
File
79 B
0755
2025-11-18 13:14:54
pydoc3.6
File
79 B
0755
2025-11-18 13:14:54
pygettext3
File
21.04 KB
0755
2025-11-18 13:14:54
pygettext3.6
File
21.04 KB
0755
2025-11-18 13:14:54
pyjwt3
File
372 B
0755
2022-07-19 06:23:32
python3
File
4.32 MB
0755
2025-11-18 13:14:54
python3-jsondiff
File
1018 B
0755
2017-10-28 20:10:15
python3-jsonpatch
File
3.58 KB
0755
2017-10-28 20:10:15
python3-jsonpointer
File
1.31 KB
0755
2016-05-01 23:14:11
python3-jsonschema
File
398 B
0755
2017-11-15 19:43:29
python3.6
File
4.32 MB
0755
2025-11-18 13:14:54
python3.6m
File
4.32 MB
0755
2025-11-18 13:14:54
python3m
File
4.32 MB
0755
2025-11-18 13:14:54
rcp
File
98.14 KB
0755
2025-02-18 13:44:19
rdma
File
26.07 KB
0755
2021-01-26 13:33:08
realpath
File
46.21 KB
0755
2018-01-18 09:43:49
rename.ul
File
14.07 KB
0755
2020-09-16 18:43:15
renice
File
14.07 KB
0755
2020-09-16 18:43:15
reset
File
22 KB
0755
2024-03-06 14:37:58
resizepart
File
38.08 KB
0755
2020-09-16 18:43:15
rev
File
10.07 KB
0755
2020-09-16 18:43:15
rgrep
File
30 B
0755
2017-07-11 13:19:59
rlogin
File
710.79 KB
0755
2025-02-18 13:44:19
routef
File
208 B
0755
2021-01-26 13:33:08
routel
File
1.62 KB
0755
2021-01-26 13:33:08
rsh
File
710.79 KB
0755
2025-02-18 13:44:19
rtstat
File
22.35 KB
0755
2021-01-26 13:33:08
run-mailcap
File
17.74 KB
0755
2016-07-15 12:06:12
runcon
File
34.18 KB
0755
2018-01-18 09:43:49
rview
File
1.06 MB
0755
2025-10-02 22:59:18
savelog
File
10.22 KB
0755
2017-12-30 18:15:02
scp
File
98.14 KB
0755
2025-02-18 13:44:19
script
File
30.07 KB
0755
2020-09-16 18:43:15
scriptreplay
File
26.08 KB
0755
2020-09-16 18:43:15
sdiff
File
50.09 KB
0755
2017-08-04 21:20:16
see
File
17.74 KB
0755
2016-07-15 12:06:12
select-editor
File
2.38 KB
0755
2018-03-12 10:17:53
sensible-browser
File
1.18 KB
0755
2018-03-12 10:17:53
sensible-editor
File
1.08 KB
0755
2018-03-12 10:17:53
sensible-pager
File
433 B
0755
2018-03-12 10:17:53
seq
File
46.18 KB
0755
2018-01-18 09:43:49
setarch
File
18.34 KB
0755
2020-09-16 18:43:15
setsid
File
10.07 KB
0755
2020-09-16 18:43:15
setterm
File
42.08 KB
0755
2020-09-16 18:43:15
sftp
File
150.35 KB
0755
2025-02-18 13:44:19
sg
File
39.4 KB
4755
2024-02-06 12:31:54
sha1sum
File
46.21 KB
0755
2018-01-18 09:43:49
sha224sum
File
54.21 KB
0755
2018-01-18 09:43:49
sha256sum
File
54.21 KB
0755
2018-01-18 09:43:49
sha384sum
File
58.21 KB
0755
2018-01-18 09:43:49
sha512sum
File
58.21 KB
0755
2018-01-18 09:43:49
shred
File
58.21 KB
0755
2018-01-18 09:43:49
shuf
File
54.18 KB
0755
2018-01-18 09:43:49
skill
File
26.08 KB
0755
2023-10-31 11:35:42
slabtop
File
18.08 KB
0755
2023-10-31 11:35:42
slogin
File
710.79 KB
0755
2025-02-18 13:44:19
snap
File
22.43 MB
0755
2026-06-29 12:01:19
snapctl
File
0 B
0
1970-01-01 00:00:00
snice
File
26.08 KB
0755
2023-10-31 11:35:42
sort
File
110.47 KB
0755
2018-01-18 09:43:49
split
File
54.63 KB
0755
2018-01-18 09:43:49
ssh
File
710.79 KB
0755
2025-02-18 13:44:19
ssh-add
File
338.13 KB
0755
2025-02-18 13:44:19
ssh-agent
File
354.14 KB
2755
2025-02-18 13:44:19
ssh-argv0
File
1.42 KB
0755
2022-03-30 13:17:14
ssh-copy-id
File
10.41 KB
0755
2017-10-02 19:34:26
ssh-keygen
File
410.16 KB
0755
2025-02-18 13:44:19
ssh-keyscan
File
414.16 KB
0755
2025-02-18 13:44:19
stat
File
78.21 KB
0755
2018-01-18 09:43:49
stdbuf
File
46.18 KB
0755
2018-01-18 09:43:49
sudo
File
145.59 KB
4755
2025-06-25 20:14:55
sudoedit
File
145.59 KB
4755
2025-06-25 20:14:55
sudoreplay
File
54.81 KB
0755
2025-06-25 20:14:55
sum
File
38.19 KB
0755
2018-01-18 09:43:49
systemd-analyze
File
1.49 MB
0755
2024-08-16 14:54:17
systemd-cat
File
10.07 KB
0755
2024-08-16 14:54:17
systemd-cgls
File
14.07 KB
0755
2024-08-16 14:54:17
systemd-cgtop
File
30.09 KB
0755
2024-08-16 14:54:17
systemd-delta
File
22.07 KB
0755
2024-08-16 14:54:17
systemd-detect-virt
File
10.06 KB
0755
2024-08-16 14:54:17
systemd-mount
File
42.09 KB
0755
2024-08-16 14:54:17
systemd-path
File
10.06 KB
0755
2024-08-16 14:54:17
systemd-resolve
File
86.07 KB
0755
2024-08-16 14:54:17
systemd-run
File
42.07 KB
0755
2024-08-16 14:54:17
systemd-socket-activate
File
18.07 KB
0755
2024-08-16 14:54:17
systemd-stdio-bridge
File
14.07 KB
0755
2024-08-16 14:54:17
systemd-umount
File
42.09 KB
0755
2024-08-16 14:54:17
tabs
File
13.99 KB
0755
2024-03-06 14:37:58
tac
File
38.18 KB
0755
2018-01-18 09:43:49
tail
File
66.24 KB
0755
2018-01-18 09:43:49
taskset
File
30.08 KB
0755
2020-09-16 18:43:15
tee
File
34.21 KB
0755
2018-01-18 09:43:49
test
File
46.18 KB
0755
2018-01-18 09:43:49
tic
File
82.11 KB
0755
2024-03-06 14:37:58
timedatectl
File
815 B
0755
2026-01-05 10:18:59
timedatectl.real
File
22.07 KB
0755
2024-08-16 14:54:17
timeout
File
38.63 KB
0755
2018-01-18 09:43:49
tload
File
14.09 KB
0755
2023-10-31 11:35:42
toe
File
13.99 KB
0755
2024-03-06 14:37:58
top
File
105.77 KB
0755
2023-10-31 11:35:42
touch
File
98.37 KB
0755
2019-09-05 10:38:40
tput
File
18.02 KB
0755
2024-03-06 14:37:58
tr
File
46.18 KB
0755
2018-01-18 09:43:49
truncate
File
38.18 KB
0755
2018-01-18 09:43:49
tset
File
22 KB
0755
2024-03-06 14:37:58
tsort
File
34.18 KB
0755
2018-01-18 09:43:49
tty
File
30.18 KB
0755
2018-01-18 09:43:49
tzselect
File
15.04 KB
0755
2025-05-26 08:18:50
ucf
File
39.73 KB
0755
2018-02-26 00:58:23
ucfq
File
18.91 KB
0755
2018-02-26 00:58:23
ucfr
File
10.47 KB
0755
2018-02-26 00:58:23
unexpand
File
38.21 KB
0755
2018-01-18 09:43:49
uniq
File
42.21 KB
0755
2018-01-18 09:43:49
unlink
File
30.18 KB
0755
2018-01-18 09:43:49
unshare
File
18.27 KB
0755
2020-09-16 18:43:15
unsquashfs
File
99.71 KB
0755
2021-09-14 08:43:17
update-alternatives
File
46.01 KB
0755
2022-05-25 11:14:56
uptime
File
10.07 KB
0755
2023-10-31 11:35:42
users
File
34.18 KB
0755
2018-01-18 09:43:49
utmpdump
File
22.07 KB
0755
2020-09-16 18:43:15
vcs-run
File
6.75 KB
0755
2018-04-13 13:07:55
vi
File
1.06 MB
0755
2025-10-02 22:59:18
view
File
1.06 MB
0755
2025-10-02 22:59:18
vim.tiny
File
1.06 MB
0755
2025-10-02 22:59:18
vmstat
File
34.09 KB
0755
2023-10-31 11:35:42
w
File
18.07 KB
0755
2023-10-31 11:35:42
w.procps
File
18.07 KB
0755
2023-10-31 11:35:42
wall
File
30.08 KB
2755
2020-09-16 18:43:15
watch
File
22.41 KB
0755
2023-10-31 11:35:42
wc
File
42.19 KB
0755
2018-01-18 09:43:49
whereis
File
26.51 KB
0755
2020-09-16 18:43:15
which
File
946 B
0755
2019-12-07 02:13:44
who
File
50.21 KB
0755
2018-01-18 09:43:49
whoami
File
30.18 KB
0755
2018-01-18 09:43:49
wpa_passphrase
File
62 KB
0755
2024-08-05 14:28:52
x86_64
File
18.34 KB
0755
2020-09-16 18:43:15
xargs
File
70.21 KB
0755
2017-11-05 17:16:48
xdg-open
File
38 B
0755
2026-01-05 10:18:59
xdg-settings
File
1.68 KB
0755
2026-01-05 10:18:59
xxd
File
18.12 KB
0755
2025-10-02 22:59:18
yes
File
30.18 KB
0755
2018-01-18 09:43:49
zdump
File
18.05 KB
0755
2025-05-26 08:18:50
0
items selected
Choose Action...
Delete Selected
Zip Selected
Unzip Selected
Execute Action
Clear Selection
© Ultimate WebShell | Auto Bypass Enabled
Create New Folder
Create New File
Edit File: edit
#! /usr/bin/perl ############################################################################### # # Run-Mailcap: Run a program specified in the mailcap file based on a mime # type. # # Written by Brian White <bcwhite@pobox.com> # This file has been placed in the public domain (the only true "free"). # ############################################################################### use Encode qw(decode); use I18N::Langinfo qw(langinfo CODESET); use File::Spec; $debug=($ENV{RUN_MAILCAP_DEBUG} || 0); $norun=0; $nopager=0; $etcmimetyp="/etc/mime.types"; $shrmimetyp="/usr/share/etc/mime.types"; $locmimetyp="/usr/local/etc/mime.types"; $usrmimetyp="$ENV{HOME}/.mime.types"; $xtermprgrm="/usr/bin/x-terminal-emulator"; # xterm? $defmimetyp="application/octet-stream"; $quotedsemi=chr(255); $quotedprct=chr(254); $retcode=0; sub Usage { my($error) = @_; print STDERR $error,"\n\n" if $error; print STDERR "Use: $0 <--action=VAL> [--debug] [MIME-TYPE:[ENCODING:]]FILE [...]\n\n"; print STDERR "Options:\n"; print STDERR " action specify what action to do on these files (default=view)\n"; print STDERR " debug be verbose about what's going on\n"; print STDERR " nopager ignore any \"copiousoutput\" directives and never use a \"pager\"\n"; print STDERR " norun just print but don't execute the command (useful with --debug)\n"; print STDERR "\n"; print STDERR "Mime-Type:\n"; print STDERR " any standard mime type designation in the form <class>/<subtype> -- if\n"; print STDERR " not specified, it will be determined from the filename extension\n\n"; print STDERR "Encoding:\n"; print STDERR " how the file (and type) has been encoded (only \"gzip\", \"bzip2,\"\n"; print STDERR " \"xz\" and \"compress\" are supported) -- if not specified, it will be\n"; print STDERR " determined from the filename extension\n\n"; exit ($error ? 1 : 0); } sub EncodingForFile { my($file) = @_; my $encoding; if ($file =~ m/\.gz$/) { $encoding = "gzip"; } if ($file =~ m/\.bz2$/) { $encoding = "bzip2"; } if ($file =~ m/\.xz$/) { $encoding = "xz"; } if ($file =~ m/\.Z$/) { $encoding = "compress"; } print STDERR " - file \"$file\" has encoding \"$encoding\"\n" if $debug && $encoding; return $encoding; } sub ReadMimetypes { my($file) = @_; print STDERR " - Reading mime.types file \"$file\"...\n" if $debug; unless (open(MIMETYPES,'<',$file)) { # Quietly ignore an unreadable file, perhaps non-existent, perhaps # permission denied. print STDERR " could not read \"$file\" -- $!\n" if $debug; return; } while (<MIMETYPES>) { chomp; s/\#.*$//; next if (m/^\s*$/); $_=lc($_); my($type,@exts) = split; foreach (@exts) { $mimetypes{$_} = $type unless exists $mimetypes{$_}; } } close MIMETYPES; } sub ReadMailcap { my($file) = @_; my $line = ""; print STDERR " - Reading mailcap file \"$file\"...\n" if $debug; unless (open(MAILCAP,'<',$file)) { # Quietly ignore an unreadable file, perhaps non-existent, perhaps # permission denied. print STDERR " could not read \"$file\" -- $!\n" if $debug; return; } while (<MAILCAP>) { chomp; s/^\s+// if $line; $line .= $_; next unless $line; if ($line =~ m/^\s*\#/) { $line = ""; next; } if ($line =~ m/\\$/) { $line =~ s/\\$//; } else { $line =~ s/\\;/$quotedsemi/go; $line =~ s/\\%/$quotedprct/go; push @mailcap,$line; $line = ""; } } close MAILCAP; } sub TempFile { my($template) = @_; my($cmd,$head,$tail,$tmpfile); $template = "" unless (defined $template); ($head,$tail) = split(/%s/,$template,2); # $tmpfile = POSIX::tmpnam($name); # unlink($tmpfile); $cmd = "tempfile --mode=600"; $cmd .= " --prefix $head" if $head; $cmd .= " --suffix $tail" if $tail; $tmpfile = `$cmd`; chomp($tmpfile); # $tmpfile = $ENV{TMPDIR}; # $tmpfile = "/tmp" unless $tmpfile; # $tmpfile.= "/$name"; # unlink($tmpfile); return $tmpfile; } sub SaveStdin { my($match) = @_; my($tmpfile,$amt,$buf); $tmpfile = $1 if ($match =~ m/nametemplate=(.*?)\s*($|;)/); $tmpfile = TempFile($tmpfile); open(TMPFILE,">$tmpfile") || die "Error: could not write \"$tmpfile\" -- $!\n"; do { $amt = read(STDIN,$buf,102400); print TMPFILE $buf if $amt; } while ($amt != 0); close(TMPFILE); return $tmpfile; } sub DecodeFile { my($efile,$encoding,$action) = @_; my($file,$res); $file = $efile; $file =~ s!^.*/!!; # remove leading directories $file =~ s!\.[^\.]*$!!; # remove encoding extension $file =~ s!^\.?[^\.]*!%s!; # replace name with placeholder $file = undef if ($efile eq '-'); my $tmpfile = TempFile($file); print STDERR " - decoding \"$efile\" as \"$tmpfile\"\n" if $debug; # unlink($tmpfile); # should still be acceptable for "compose" output even if exists return $tmpfile if (($efile ne '-' && ! -e $efile) || $action eq 'compose'); if ($encoding eq "gzip") { if ($efile eq '-') { $res = system "gzip -d >\Q$tmpfile\E"; } else { $res = system "gzip -dc \Q$efile\E >\Q$tmpfile\E"; } } elsif ($encoding eq "bzip2") { if ($efile eq '-') { $res = system "bzip2 -d >\Q$tmpfile\E"; } else { $res = system "bzip2 -dc <\Q$efile\E >\Q$tmpfile\E"; } } elsif ($encoding eq "xz") { if ($efile eq '-') { $res = system "xz -d >\Q$tmpfile\E"; } else { $res = system "xz -dc <\Q$efile\E >\Q$tmpfile\E"; } } elsif ($encoding eq "compress") { if ($efile eq '-') { $res = system "uncompress >\Q$tmpfile\E"; } else { $res = system "uncompress <\Q$efile\E >\Q$tmpfile\E"; } } else { die "Fatal: unknown encoding \"$encoding\" at"; } $res = int($res/256); if ($res != 0) { print STDERR "Error: could not decode \"$efile\" -- $!\n"; $retcode = 2 if ($retcode < 2); unlink($tmpfile); return; } # chmod 0600,$tmpfile; # done already by TempFile return $tmpfile; } sub EncodeFile { my($dfile,$efile,$encoding) = @_; my($res); print STDERR " - encoding \"$dfile\" as \"$efile\"\n"; if ($encoding eq "gzip") { if ($efile eq '-') { $res = system "gzip -c \Q$dfile\E"; } else { $res = system "gzip -c \Q$dfile\E >\Q$efile\E"; } } elsif ($encoding eq "xz") { if ($efile eq '-') { $res = system "xz < \Q$dfile\E"; } else { $res = system "xz < \Q$dfile\E >\Q$efile\E"; } } elsif ($encoding eq "compress") { if ($efile eq '-') { $res = system "compress <\Q$dfile\E"; } else { $res = system "compress <\Q$dfile\E >\Q$efile\E"; } } else { die "Fatal: unknown encoding \"$encoding\" at"; } $res = int($res/256); if ($res != 0) { print STDERR "Error: could not encode \"$efile\" (left as \"$dfile\")\n"; $retcode = 2 if ($retcode < 2); return; } return $dfile; } sub ExtensionMimetype { my($file) = @_; my($ext) = ($file =~ m!\.([^/\.]+)$!); my($typ); if ($ext) { unless ($donemimetypes) { ReadMimetypes($usrmimetyp); ReadMimetypes($locmimetyp); ReadMimetypes($shrmimetyp); ReadMimetypes($etcmimetyp); $donemimetypes = 1; } $typ = $mimetypes{lc($ext)}; print STDERR " - extension \"$ext\" maps to mime-type \"$typ\"\n" if $debug; } return $typ; } sub MagicMimetype { my($file) = @_; my($typ); if (`which file`) { open(READER, "-|", "file", "-b", "--mime-type", "-e", "tokens", "-L", "-z", $file); $typ = <READER>; chomp $typ; print STDERR " - file command returned mime-type \"$typ\"\n" if $debug; } return $typ; } @files = (); foreach (@ARGV) { print STDERR " - parsing parameter \"$_\"\n" if $debug; if (m!^(-h|--help)$!) { Usage(); exit(0); } elsif (m!^--(.*?)=(.*)$!) { print STDERR "Warning: definition of \"$1=$2\" overrides value \"${$1}\"\n" if ($ {$1} && $ {$1} != $2); $ {$1}=$2; } elsif (m!^--(.*?)$!) { print STDERR "Warning: definition of \"$1=$2\" overrides value \"${$1}\"\n" if ($ {$1} && $ {$1} != 1); $ {$1}=1; } elsif (m!^[^/:]+/[^/:]+:[^/:]+:!) { push @files,$_; } elsif (m!^([^/:]+/[^/:]+):(.*)! && ! -e $_) { my $file = $_; my $type = $1; my $file = $2; my $code = EncodingForFile($file); push @files,"${type}:${code}:${file}"; print STDERR " - file \"$file\" does not exist -- assuming mime-type specification of \"${type}\"\n" if $debug; } else { my $file = $_; my $code = EncodingForFile($file); my $type; if ($code) { my $efile = $file; $efile =~ s/\.[^\.]+$//; $type = ExtensionMimetype($efile); } else { $type = ExtensionMimetype($file); } $type = MagicMimetype($file) unless $type; if ($type) { push @files,"${type}:${code}:${file}"; } else { print STDERR "Warning: unknown mime-type for \"$file\" -- using \"$defmimetyp\"\n"; push @files,"${defmimetyp}:${code}:${file}"; } } } # Pass --debug to sub-calls to this program. $ENV{RUN_MAILCAP_DEBUG} = 1 if $debug; unless ($action) { if ($0 =~ m!(^|/)(mime-)?view$!) { $action="view"; } elsif ($0 =~ m!(^|/)(mime-)?see$!) { $action="view"; } elsif ($0 =~ m!(^|/)(mime-)?cat$!) { $action="cat"; } elsif ($0 =~ m!(^|/)(mime-)?edit$!) { $action="edit"; } elsif ($0 =~ m!(^|/)(mime-)?change$!) { $action="edit"; } elsif ($0 =~ m!(^|/)(mime-)?compose$!) { $action="compose";} elsif ($0 =~ m!(^|/)(mime-)?print$!) { $action="print"; } elsif ($0 =~ m!(^|/)(mime-)?create$!) { $action="compose";} else { $action="view"; } } $mailcaps = $ENV{MAILCAPS}; $mailcaps = "$ENV{HOME}/.mailcap:/etc/mailcap:/usr/local/etc/mailcap:/usr/share/etc/mailcap:/usr/etc/mailcap" unless $mailcaps; foreach (split(/:/,$mailcaps)) { ReadMailcap($_); } foreach (@files) { my($type,$code,$file) = m/^(.*?):(.*?):(.*)$/; print STDERR "Processing file \"$file\" of type \"$type\" (encoding=",$code?$code:"none",")...\n" if $debug; if ($file ne '-') { if ($action eq 'compose' || $action eq 'edit') { if (-e $file) { if (! -w $file) { print STDERR "Error: no write permission for file \"$file\"\n"; $retcode = 2 if ($retcode < 2); next; } } else { if (open(TEST,">$file")) { close(TEST); unlink($file); } else { print STDERR "Error: no write permission for file \"$file\"\n"; $retcode = 2 if ($retcode < 2); next; } } } else { if (! -e $file) { print STDERR "Error: no such file \"$file\"\n"; $retcode = 2 if ($retcode < 2); next; } if (! -r $file) { print STDERR "Error: no read permission for file \"$file\"\n"; $retcode = 2 if ($retcode < 2); next; } } } my(@matches,$entry,$res,$efile); if ($code) { $efile = $file; $file = DecodeFile($efile,$code,$action); next unless $file; } foreach $entry (@mailcap) { $entry =~ m/^(.*?)\s*;/; $_ = "\Q$1\E"; s/\\\*/\.\*/g; push @matches,$entry if ($type =~ m!^$_$!i); } @matches = grep(/\Q$action\E=/,@matches) unless ($action eq "view" || $action eq "cat"); my $done=0; my $fail=0; my $needsterminal; foreach $match (@matches) { my $comm; print STDERR " - checking mailcap entry \"$match\"\n" if $debug; if ($action eq "view" || $action eq "cat") { ($comm) = ($match =~ m/^.*?;\s*(.*?)\s*($|;)/); } else { ($comm) = ($match =~ m/\Q$action\E=(.*?)\s*($|;)/); } next if (!$comm || $comm =~ m!(^|/)false$!i); print STDERR " - program to execute: $comm\n" if $debug; if ($action eq 'cat' && $match !~ m/;\s*copiousoutput\s*($|;)/) { print STDERR " - \"copiousoutput\" is required for \"cat\" action\n" if $debug; $fail++; next; } my($tmpfile,$tmplink); if ($action ne 'print' && $match =~ m/;\s*needsterminal\s*($|;)/) { $needsterminal = 1; if (-t STDOUT) { print STDERR " - needsterminal is satisfied by stdout\n" if $debug; } else { if ($ENV{DISPLAY}) { $comm = "$xtermprgrm -T '$file ($type)' -e $0 --action=$action '${type}:%s'"; } else { print STDERR " - no terminal available for rule (needsterminal)\n" if $debug; $fail++; next; } } } elsif ($action eq 'view' && !$nopager && $match =~ m/;\s*copiousoutput\s*($|;)/ && $type ne 'text/plain') { $comm .= " | $0 --action=$action text/plain:-"; } if ($match =~ m/;\s*test=(.*?)\s*($|;)/) { my $test; print STDERR " - running test: $1 " if $debug; $test = system "$1 >/dev/null 2>&1"; $test >>= 8; print STDERR " (result=$test=",($test!=0?"false":"true"),")\n" if $debug; if ($test) { $fail++; next; } } if ($file ne "-") { # Resolve file name to an absolute path $file = File::Spec->rel2abs($file); if (decode(langinfo(CODESET()), $file) =~ m![^[:alnum:],.:/@%^+=_-]!i) { $match =~ m/nametemplate=(.*?)\s*($|;)/; my $prefix = $1; my $linked = 0; while (!$linked) { $tmplink = TempFile($prefix); unlink($tmplink); $linked = symlink($file,$tmplink); } $file = $tmplink; print STDERR " - filename contains shell meta-characters; aliased to '$tmplink'\n" if $debug; } if ($comm =~ m/[^%]%s/) { $comm =~ s/([^%])%s/$1$file/g; } else { if ($comm =~ m/\|/) { $comm =~ s/\|/<\Q$file\E \|/; } else { $comm .= " <\Q$file\E"; } if ($action eq 'edit' || $action eq 'compose') { $comm .= " >\Q$file\E"; } } } else { if ($comm =~ m/[^%]%s/) { $tmpfile = SaveStdin($match); $comm =~ s/([^%])%s/$1$tmpfile/g; # If needsterminal then redirect stdin to the tty which is # on stdout, rather than leaving it as the input data stream # which has now been read through to EOF. # # Some programs such as "more" and "less" already use # /dev/tty rather than stdin. But "vim" on non-tty stdin # gives a warning message and then leaves the tty in raw # mode on exit. Or "nvi" refuses to run at all unless both # stdin and stdout are the tty. # # RFC 1524 is silent on exactly what a program with # "needsterminal" should expect, but it seems sensible to # arrange that both stdin and stdout are the terminal for # "needsterminal" with "%s". # if ($needsterminal) { $comm .= ' <&1'; } } else { # no name means same as "-"... read from stdin } } $comm =~ s!([^%])%t!$1$type!g; $comm =~ s!([^%])%F!$1!g; $comm =~ s!%\{(.*?)}!$_="'$ENV{$1}'";s/\`//g;s/\'\'//g;$_!ge; $comm =~ s!\\(.)!$1!g; $comm =~ s!\'\'!\'!g; $comm =~ s!$quotedsemi!;!go; $comm =~ s!$quotedprct!%!go; print STDERR " - executing: $comm\n" if $debug; if ($norun) { print $comm,"\n"; $res = 0; } else { $res = system $comm; $res = int($res/256); } if ($res != 0) { print STDERR "Warning: program returned non-zero exit code \#$res\n"; $retcode = $res; } $done=1; unlink $tmpfile if $tmpfile; unlink $tmplink if $tmplink; last; } if (!$done) { if ($fail) { print STDERR "Error: no \"$action\" rule for type \"$type\" passed its test case\n"; print STDERR " (for more information, add \"--debug=1\" on the command line)\n"; $retcode = 3 if ($retcode < 3); } else { print STDERR "Error: no \"$action\" mailcap rules found for type \"$type\"\n"; $retcode = 3 if ($retcode < 3); } unlink $file if $code; $retcode = 1 unless $retcode; next; } if ($code) { if ($action eq 'edit' || $action eq 'compose') { my $file = EncodeFile($file,$efile,$code); unlink $file if $file; } else { unlink $file; } } } exit($retcode);
Rename
Change Permissions
Common permissions: 755 (rwxr-xr-x), 644 (rw-r--r--), 777 (rwxrwxrwx)
System Information
Uname: Linux Stag-Enterprise-Staging-20-04 5.11.0-1019-aws #20~20.04.1-Ubuntu SMP Tue Sep 21 10:40:39 UTC 2021 x86_64 Software: Apache PHP Version: 7.4.3-4ubuntu2.29 Protocol: HTTP/1.1 Server IP: 172.31.9.152 Your IP: 216.73.216.236 Mail: ON Curl: ON Owner: www-data MySQL: ON Disabled Functions: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Auto Bypass: ENABLED