-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathreadpath.sh
More file actions
89 lines (78 loc) · 2.13 KB
/
readpath.sh
File metadata and controls
89 lines (78 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/bash
curdir=`$pwd`
if [ `echo $PATH |grep "$curdir"` ]; then
echo "Current directory exists in PATH"
else
echo "Not Found"
fi
str=`expr $PATH`
dir1=`echo $str | awk -F":" '{print $1}'`
dir2=`echo $str | awk -F":" '{print $2}'`
dir3=`echo $str | awk -F":" '{print $3}'`
dir4=`echo $str | awk -F":" '{print $4}'`
dir5=`echo $str | awk -F":" '{print $5}'`
dir6=`echo $str | awk -F":" '{print $6}'`
echo $dir1 $dir2 $dir3 $dir4 $dir5 $dir6
echo "files with setuid bit on and writable by non-owner "
for i in `find $dir1 -perm /o=w,o=s` # setuid bit on and writable by non-owner first,
do
echo $i
done
for i in `find $dir2 -perm /o=w,o=s` # setuid bit on and writable by non-owner first,
do
echo $i
done
for i in `find $dir3 -perm /0=w,o=s` # setuid bit on and writable by non-owner first,
do
echo $i
done
for i in `find $dir4 -perm /o=w,o=s` # setuid bit on and writable by non-owner first,
do
echo $i
done
for i in `find $dir5 -perm /o=w,o=s` # setuid bit on and writable by non-owner first,
do
echo $i
done
echo "setuid bit on but only writable by the owner "
for i in `find $dir1 -perm /u=w,u=s` # setuid bit on but only writable by the owner second, and
do
echo $i
done
for i in `find $dir2 -perm /u=w,u=s` # setuid bit on but only writable by the owner second, and
do
echo $i
done
for i in `find $dir3 -perm /u=w,u=s` # setuid bit on but only writable by the owner second, and
do
echo $i
done
for i in `find $dir4 -perm /u=w,u=s` # setuid bit on but only writable by the owner second, and
do
echo $i
done
for i in `find $dir5 -perm /u=w,u=s` # setuid bit on but only writable by the owner second, and
do
echo $i
done
echo "setuid bit off and writable by non-owner "
for i in `find $dir1 -perm /0022` # setuid bit off and writable by non-owner
do
echo $i
done
for i in `find $dir2 -perm /0022` # setuid bit off and writable by non-owner
do
echo $i
done
for i in `find $dir3 -perm /0022` # setuid bit off and writable by non-owner
do
echo $i
done
for i in `find $dir4 -perm /0022` # setuid bit off and writable by non-owner
do
echo $i
done
for i in `find $dir5 -perm /0022` # setuid bit off and writable by non-owner
do
echo $i
done