sandervanvugt

LFCS day1 feb2022

Feb 1st, 2022
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.21 KB | None | 0 0
  1. #### on UBUNTU
  2. student@student-virtual-machine:~$ history
  3. 1 sudo useradd -s /bin/bash -m anna
  4. 2 #echo Defaults timestamp_type=global,timestamp_timeout=240
  5. 3 sudo ls -a /root
  6. 4 sudo visudo
  7. 5 man 5 sudoers
  8. 6 sudo useradd -s /bin/bash -m linda
  9. 7 sudo useradd -s /bin/bash -m lisa
  10. 8 visudo
  11. 9 sudo visudo
  12. 10 sudo passwd lisa
  13. 11 su - lisa
  14. 12 su - anna
  15. 13 sudo passwd anna
  16. 14 su - anna
  17. 15 sudo visudo
  18. 16 history
  19. 17 history -w
  20. 18 sudo useradd -s /bin/bash -m anna
  21. 19 #echo Defaults timestamp_type=global,timestamp_timeout=240
  22. 20 sudo ls -a /root
  23. 21 sudo visudo
  24. 22 man 5 sudoers
  25. 23 sudo useradd -s /bin/bash -m linda
  26. 24 sudo useradd -s /bin/bash -m lisa
  27. 25 visudo
  28. 26 sudo visudo
  29. 27 sudo passwd lisa
  30. 28 su - lisa
  31. 29 su - anna
  32. 30 sudo passwd anna
  33. 31 su - anna
  34. 32 sudo visudo
  35. 33 history
  36. 34 history -w
  37. 35 exit
  38. 36 history
  39. 37 sudo apt install openssh-server
  40. 38 sudo apt install finger
  41. 39 sudo apt-cache search seinfo
  42. 40 tail -5 /etc/passwd
  43. 41 useradd --help | less
  44. 42 useradd -m -s /bin/bash -c "some user" linda
  45. 43 sudo useradd -m -s /bin/bash -c "some user" linda
  46. 44 finger linda
  47. 45 history
  48. 46 ip a
  49. 47 exit
  50.  
  51. ##### ON CENTOS9
  52. v/loop0p1 246M 15K 234M 1% /loop0
  53. tmpfs 389M 104K 389M 1% /run/user/1000
  54. /dev/sr0 7.9G 7.9G 0 100% /run/media/student/CentOS-Stream-9-BaseOS-x86_64
  55. [root@localhost ~]# history
  56. 1 find / -name "hosts"
  57. 2 find / -name "*hosts*"
  58. 3 locate hosts
  59. 4 history
  60. 5 updatedb
  61. 6 locate hosts
  62. 7 touch sander
  63. 8 locate sander
  64. 9 find / -name "sander"
  65. 10 find / -user student
  66. 11 find / -user student | wc
  67. 12 w
  68. 13 useradd linda
  69. 14 find / -user linda
  70. 15 find / -user linda -exec cp {} /root/linda/ \;
  71. 16 mkdir /root/linda ; find / -user linda -exec cp {} /root/linda/ \;
  72. 17 ls -a linda
  73. 18 ls -l
  74. 19 cd linda
  75. 20 ls -l
  76. 21 -a
  77. 22 ls -a
  78. 23 find / -perm /4000
  79. 24 man find
  80. 25 find / -type f -size +100M
  81. 26 mkdir -p find/content; find /etc -exec grep -l student {} \; -exec cp {} find/content/ \; 2>/dev/null
  82. 27 ls
  83. 28 tree find/
  84. 29 find /etc/ -name '*' -type f | xargs grep '127.0.0.1'
  85. 30 vim /etc/dummy
  86. 31 find /etc/ -name '*' -type f | xargs grep '127.0.0.1'
  87. 32 find /etc/ -name '*' -type f | xargs grep '127\.0\.0\.1'
  88. 33 cd
  89. 34 vim countdown
  90. 35 history
  91. 36 bash countdown 13
  92. 37 sed -n 5p /etc/passwd
  93. 38 vim myfile
  94. 39 sed -i 's/old/new/' myfile
  95. 40 cat myfile
  96. 41 sed -i 's/old/new/g' myfile
  97. 42 cat myfile
  98. 43 sed -i -e '2d' myfile
  99. 44 cat myfile
  100. 45 awk -F : '{ print $4 }' /etc/passwd
  101. 46 awk -F : '/linda/ { print $3 }' /etc/passwd
  102. 47 man awk
  103. 48 pinfo awk
  104. 49 last
  105. 50 which last
  106. 51 ls -l /bin/last
  107. 52 vim /etc/login.defs
  108. 53 cd /etc/skel/
  109. 54 ls -al
  110. 55 echo hello > hello
  111. 56 pwd
  112. 57 useradd -m -s /bin/bash bob
  113. 58 cd /home/bob
  114. 59 ls -al
  115. 60 ls -ld .
  116. 61 passwd -S bob
  117. 62 chage -l bob
  118. 63 id bob
  119. 64 tail /etc/passwd
  120. 65 man 5 passwd
  121. 66 finger bob
  122. 67 usermod -s /usr/bin/passwd bob
  123. 68 tail -1 /etc/passwd
  124. 69 passwd bob
  125. 70 su - bob
  126. 71 password
  127. 72 finger
  128. 73 yum provides */finger
  129. 74 yum install -y epel-release
  130. 76 cd
  131. 77 countdown 12
  132. 78 ./countdown 12
  133. 79 bash countdown 12
  134. 80 useradd -G wheel -s /usr/bin/passwd anna
  135. 81 chage anna
  136. 82 grep anna /etc/passwd /etc/shadow /etc/group
  137. 83 passwd --help
  138. 84 usermod -s /bin/bash anna
  139. 85 passwd anna
  140. 86 passwd -e anna
  141. 87 su - anna
  142. 88 su - student
  143. 90 #make sure the following is entered after doing visudo: Defaults timestamp_type=global,timestamp_timeout=240
  144. 91 history
  145. 92 history -d 90
  146. 93 history
  147. 94 touch myfile
  148. 95 ls -l myfile
  149. 96 chattr +i myfile
  150. 97 rm -f myfile
  151. 98 lsattr myfile
  152. 99 chattr -i myfile
  153. 100 lsattr myfile
  154. 101 rm myfile
  155. 102 ls
  156. 103 countdown
  157. 104 echo $PATH
  158. 105 ./countdown
  159. 106 ls -l
  160. 107 chmod +x countdown
  161. 108 ./countdown
  162. 109 cd /home/linda
  163. 110 touch wortel
  164. 111 su - linda
  165. 112 cd
  166. 113 groupadd sales
  167. 114 groupadd account
  168. 115 usermod -aG sales linda
  169. 116 usermod -aG sales lisa
  170. 117 useradd -G sales lisa
  171. 118 usermod -aG account anna
  172. 119 useradd -G account anouk
  173. 120 grep -E {account|sales} /etc/group
  174. 121 grep -E '{account|sales}' /etc/group
  175. 122 tail -2 /etc/group
  176. 123 tail -10 /etc/group
  177. 124 mkdir -p /data/account /data/sales
  178. 125 cd /data
  179. 126 ls -l
  180. 127 chmod 770 *
  181. 128 ls -l
  182. 129 chgrp account account
  183. 130 chgrp sales sales
  184. 131 ls -l
  185. 132 id anna
  186. 133 usermod -G sales anna
  187. 134 id anna
  188. 135 usermod -aG account,wheel anna
  189. 136 id anna
  190. 137 usermod -G account,wheel anna
  191. 138 su - anna
  192. 139 su - anouk
  193. 140 chmod +t *
  194. 141 chmod g+s *
  195. 142 ls -l
  196. 143 su - anna
  197. 144 su - anoukt
  198. 145 su - anouk
  199. 146 history
  200. 147 cd
  201. 148 ./countdown 21
  202. 149 ls -l /data
  203. 150 man chattr
  204. 151 umask
  205. 152 cd /etc
  206. 153 grep -R 'umask' *
  207. 154 vim bashrc
  208. 155 cd skel/
  209. 156 ls -a
  210. 157 vim .bashrc
  211. 158 awk -F : ' $3 > 1000 { print $1 }'
  212. 159 awk -F : ' $3 > 1000 { print $1 }' /etc/passwd
  213. 160 which passwd
  214. 161 ls -l $(which passwd)
  215. 162 for i in $(awk -F : ' $3 > 1000 { print $1 }' /etc/passwd); echo $i; done
  216. 163 for i in $(awk -F : ' $3 > 1000 { print $1 }' /etc/passwd); do echo $i; done
  217. 164 for i in $(awk -F : ' $3 > 1000 { print $1 }' /etc/passwd); do cp .bashrc /home/$i/; done
  218. 165 for i in $(awk -F : ' $3 > 1000 { print $1 }' /etc/passwd); do cp -f .bashrc /home/$i/; done
  219. 166 su - anna
  220. 167 su - anouk
  221. 168 cd
  222. 169 cd /data
  223. 170 ls -l
  224. 171 su - linda
  225. 172 history
  226. 173 ls -l `which ls`
  227. 174 ls -l `which passwd`
  228. 175 ls -l $(which passwd)
  229. 176 df -h
  230. 177 poweroff
  231. 178 setenforce 0
  232. 179 su - linda
  233. 180 setenforce
  234. 181 setenforce 1
  235. 182 su - linda
  236. 183 exit
  237. 184 cat /etc/passwd
  238. 185 su - anouk
  239. 186 lsblk
  240. 187 df -h
  241. 188 dd if=/dev/zero of=/diskfile.img bs=1M count=1024
  242. 189 dd if=/dev/zero of=/diskfile2.img bs=1M count=1024
  243. 190 losetup -fP /diskfile.img
  244. 191 losetup -fP /diskfile2.img
  245. 192 losetup -a
  246. 193 lsblk
  247. 194 ./countdown 12
  248. 195 history
  249. 196 lsblk
  250. 197 fdisk /dev/loop0
  251. 198 mkfs.ext2 /dev/loop0p1
  252. 199 lsblk
  253. 200 mount /dev/loop0p1 /mnt
  254. 201 cd /mnt
  255. 202 touch loop1file
  256. 203 ls -kl
  257. 204 cd
  258. 205 umount /mnt
  259. 206 ls /mnt
  260. 207 vim /etc/fstab
  261. 208 mount -a
  262. 209 mkdir /loop0
  263. 210 mount -a
  264. 211 mount
  265. 212 ls /loop0
  266. 213 reboot
  267. 214 losetup -a
  268. 215 losetup -fP diskfile.img
  269. 216 losetup -fP /diskfile.img
  270. 217 lsblk
  271. 218 mount -a
  272. 219 mount
  273. 220 tail -1 /etc/fstab
  274. 221 su - anouk
  275. 222 su - anna
  276. 223 su - anouk
  277. 224 su - anna
  278. 225 history
  279. 226 df -h
  280. 227 history
  281.  
Advertisement
Add Comment
Please, Sign In to add comment