sandervanvugt

examlabs oct23

Oct 12th, 2023
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.65 KB | None | 0 0
  1. @localhost system]# history
  2. 3 vim countdown
  3. 4 cat countdown
  4. 5 chmod +x countdown
  5. 6 ./countdown 1
  6. 7 ./countdown 10
  7. 8 find / -type f -links +1 2> /dev/null
  8. 9 man find
  9. 10 cp /etc/hosts .
  10. 11 ln hosts myhosts
  11. 12 ls -il *
  12. 13 find . -type f -links +1 2> /dev/null
  13. 14 find . -type f -exec ls -i {} \;
  14. 15 find . -type f -exec ls -i {} \; awk '{ print $1 }'
  15. 16 find . -type f -exec ls -i {} \;| awk '{ print $1 }'
  16. 17 find . -type f -exec ls -i {} \;| awk '{ print $1 }' | sort
  17. 18 find . -type f -exec ls -i {} \;| awk '{ print $1 }' | sort | uniq -d
  18. 19 man uniq
  19. 20 find . -type f -exec ls -i {} \;| awk '{ print $1 }' | sort | uniq -d | wc -l
  20. 21 find / -type f -exec ls -i {} \;| awk '{ print $1 }' | sort | uniq -d | wc -l
  21. 22 find / -type f -links +1 -exec ls -i {} \;| awk '{ print $1 }' | sort | uniq -d | wc -l
  22. 23 history
  23. 24 find / -type f -links +1 -exec ls -i {} \; 2>/dev/null | awk '{ print $1 }' | sort | uniq -d | wc -l
  24. 25 find . -type f -links
  25. 26 find . -type f -links +1
  26. 27 find . -type f -links 1
  27. 28 ./countdown 12
  28. 29 ./countdown 10
  29. 30 groupadd support
  30. 31 useradd -G support linda
  31. 32 useradd -G support lori
  32. 33 useradd -G support anna
  33. 34 id anna
  34. 35 visudo
  35. 36 for i in anna lori linda; do echo password | passwd --stdin $i; done
  36. 37 su - lori
  37. 38 which login
  38. 39 ldd $(which login)
  39. 40 man -k pam
  40. 41 mandb
  41. 42 man -k pam
  42. 43 cd /etc/pam.d/
  43. 44 ls
  44. 45 vim passwd
  45. 46 vim system-auth
  46. 47 man pam_pwquality
  47. 48 vim /etc/security/pwquality.conf
  48. 49 useradd bob
  49. 50 passwd bob
  50. 51 cd
  51. 52 ./countdown 12
  52. 53 exit
  53. 54 df -h
  54. 55 dd if=/dev/zero of=/diskfile bs=1M count=1024
  55. 56 losetup -fP /diskfile
  56. 57 losetup -a
  57. 58 fdisk /dev/loop0
  58. 59 mount | grep files
  59. 60 exit
  60. 61 history
  61. 62 lsblk
  62. 63 gdisk /dev/sdb
  63. 64 mkfs.ext3 /dev/sdb1
  64. 65 man tune2fs
  65. 66 man mount
  66. 67 man -k mount
  67. 68 tunefs -o journal_data /dev/sdb1
  68. 69 tune2fs -o journal_data /dev/sdb1
  69. 70 tune2fs -l /dev/sdb1 | less
  70. 71 mkdir /files
  71. 72 blkid
  72. 73 vim /etc/fstab
  73. 74 mount -a
  74. 75 systemctl daemon-reload
  75. 76 mount -a
  76. 77 mount
  77. 78 history
  78. 79 gdisk /dev/sdb
  79. 80 pvcreate /dev/sdb2
  80. 81 vgcreate vgfiles /dev/sdb2
  81. 82 vgs
  82. 83 lvcreate -n lvjason -l 100%FREE vgdata
  83. 84 vts
  84. 85 vgs
  85. 86 lvcreate -n lvjason -l 100%FREE vgfiles
  86. 87 vgs
  87. 88 mkfs.ext4 /dev/vgdata/lvjason
  88. 89 mkfs.ext4 /dev/vgfiles/lvjason
  89. 90 vim /etc/fstab
  90. 91 mount -a
  91. 92 mkdir /lvfiles
  92. 93 mount -a
  93. 94 mount
  94. 95 ls -l /dev/vgfiles/lvjason /dev/mapper/vgfiles-lvjason
  95. 96 reboot
  96. 97 exit
  97. 98 cd examlabs/
  98. 99 ls
  99. 100 cd fingerd/
  100. 101 ls
  101. 102 less README.md
  102. 103 cat autogen.sh
  103. 104 ./autogen.sh
  104. 105 ls
  105. 106 ./configure
  106. 107 ls
  107. 108 make
  108. 109 ls
  109. 110 make install
  110. 111 cd
  111. 112 history
  112. 113 exit
  113. 114 lsblk
  114. 115 df -h
  115. 116 vgs
  116. 117 vgextend vgfiles /dev/sdb3
  117. 118 vgs
  118. 119 lvextend --help | less
  119. 120 lvextend -l +100%FREE -r /dev/vgfiles/lvjason
  120. 121 df -h
  121. 122 history
  122. 123 mkdir -p /data/support
  123. 124 chgrp support /data/support
  124. 125 chmod g+w /data/support
  125. 126 ls -l /data/support/
  126. 127 ls -ld /data/support/
  127. 128 chown lori /data/support
  128. 129 chmod 070 /data/support
  129. 130 id lori
  130. 131 su - lori
  131. 132 chmod 770 /data/support
  132. 133 chown root /data/support
  133. 134 ls -ld /data/support
  134. 135 setfacl -m d:u:lori:wX /data/support
  135. 136 su - lori
  136. 137 history
  137. 138 su - linda
  138. 139 ls -lrt /tmp
  139. 140 journactl
  140. 141 journalctl
  141. 142 su -
  142. 143 su - linda
  143. 144 journalctl -G
  144. 145 journalctl -F
  145. 146 journalctl -f
  146. 147 ls -lrt /tmp
  147. 148 history
  148. 150 history
  149. 151 cat /proc/cmdline
  150. 152 systemctl list-dependencies
  151. 153 systemctl cat systemd-remount-fs.service
  152. 154 systemctl cat ostree-remount.service
  153. 155 systemctl list-dependencies
  154. 156 ./countdown 8
  155. 157 man sshd_config
  156. 158 vim /etc/ssh/sshd_config
  157. 159 cat /etc/passwd
  158. 160 useradd lisa
  159. 161 passwd lisa
  160. 162 systemctl restart sshd
  161. 163 ssh lisa@localhost
  162. 164 ssh bob@localhost
  163. 165 ssh linda@localhost
  164. 166 man sshd_config
  165. 167 vim /etc/ssh/sshd_config
  166. 168 systemctl restart sshd
  167. 169 su - anna
  168. 170 vim /etc/ssh/sshd_config
  169. 171 history
  170. 172 iptables -t nat -A PREROUTING -p tcp --dport 81 -j REDIRECT --to-port 9080
  171. 173 firewall-cmd --help
  172. 174 firewall-cmd --help | grep forward
  173. 175 firewall-cmd --add-forward-port=80:proto=tcp:toport=9080 --permanent
  174. 176 firewall-cmd --add-forward-port=port=80:proto=tcp:toport=9080 --permanent
  175. 177 firewall-cmd --add-forward-port=port=80:proto=tcp:toport=9080
  176. 178 man -k firewalld
  177. 179 history
  178. 180 dnf install -y vsftpd
  179. 181 vim /etc/vsftpd/vsftpd.conf
  180. 182 dnf install -y lftp
  181. 183 lftp localhost
  182. 184 systemctl enable --now vsftpd
  183. 185 lftp localhost
  184. 186 getenforce
  185. 187 setenforce permissive
  186. 188 lftp localhost
  187. 189 grep ftp /etc/passwd
  188. 190 cd /var/ftp
  189. 191 ls -l
  190. 192 chmod 777 pub
  191. 193 lftp localhost
  192. 194 rm pub/hosts
  193. 195 setenforce enforcing
  194. 196 lftp localhost
  195. 197 journalctl | grep sealert
  196. 198 sealert -l 757f8114-688f-4b93-ac3d-3e3aa373b064| less
  197. 199 dnf install -y httpd
  198. 200 systemctl start httpd
  199. 201 ps Zaux | grep httpd
  200. 202 ls -Z /var/www
  201. 203 ls -Z
  202. 204 sealert -l 757f8114-688f-4b93-ac3d-3e3aa373b064| less
  203. 205 # semanage fcontext -a -t public_content_rw_t pub
  204. 206 # restorecon -R -v pub
  205. 207 semenage fcontext -a -t public_content_rw_t /var/ftp/pub(/.*)?
  206. 208 semenage fcontext -a -t public_content_rw_t "/var/ftp/pub(/.*)?"
  207. 209 semanage fcontext -a -t public_content_rw_t "/var/ftp/pub(/.*)?"
  208. 210 restorecon -Rv /var/ftp/pub
  209. 211 getsebool -a | grep ftp
  210. 212 sealert -l 757f8114-688f-4b93-ac3d-3e3aa373b064| less
  211. 213 setsebool -P allow_ftpd_anon_write 1
  212. 214 getsebool -a | grep ftp
  213. 215 lftp localhost
  214. 216 getenforce
  215. 217 history
  216. 218 vim /etc/vsftpd/vsftpd.conf
  217. 219 cat /etc/passwd
  218. 220 man -k ulimit
  219. 221 ulimit --help
  220. 222 man bash
  221. 223 vim /etc/security/limits.conf
  222. 224 su - lisa
  223. 225 vim /etc/security/limits.conf
  224. 226 su - lisa
  225. 227 systemctl show sshd.service
  226. 228 systemctl edit sshd.service
  227. 229 systemctl cat sshd.service
  228. 230 systemctl restart sshd
  229. 231 systemctl status sshd
  230. 232 history
  231. 233 cd
  232. 234 git clone https://github.com/sandervanvugt/examlabs
  233. 235 cd examlabs/
  234. 236 ls
  235. 237 cd
  236. 238 dd if=/dev/zero of=/big.log bs=1M count=10
  237. 239 df -h
  238. 240 find / -name "*log" -size +5M
  239. 241 find / -name "*log" -size +5M -exec rm -f {} \;
  240. 242 find / -name "*log" -size +5M
  241. 243 history
  242. 244 systemctl status tuned
  243. 245 tuned-adm --help
  244. 246 tuned-adm recommend
  245. 247 tuned-adm virtual-guest
  246. 248 tuned-adm profile virtual-guest
  247. 249 tuned-adm active
  248. 250 systemctl cat tuned
  249. 251 history
  250. 252 dnf groups install "C Development Tools and Libraries"
  251. 253 dnf groups list
  252. 254 dnf groups install "C Development Tools"
  253. 255 dnf groups install "Development Tools"
  254. 256 exit
  255. 257 history
  256. 258 cd examlabs/
  257. 259 ls
  258. 260 cd docker/
  259. 261 cat Dockerfile
  260. 262 podman build -t examlab .
  261. 263 podman images
  262. 264 setenforce 0
  263. 265 #podman run -dt --name examlab -v /tmp:/tmp localhost/examlab
  264. 266 man podman-run
  265. 267 podman run -m=128M --name examlab -v /tmp:/tmp localhost/examlab
  266. 268 vim Dockerfile
  267. 269 podman build -t examlab .
  268. 270 podman run -m=128M --name examlab -v /tmp:/tmp localhost/examlab
  269. 271 podman rm examlab
  270. 272 podman run -m=128M --name examlab -v /tmp:/tmp localhost/examlab
  271. 273 podman ps
  272. 274 podman ps -a
  273. 275 ls -lrt /tmp
  274. 276 vim Dockerfile
  275. 277 ls -lrt /tmp
  276. 278 history
  277. 279 cd ..
  278. 280 ls
  279. 281 history
  280. 282 ls
  281. 283 openssl x509 -in tls.crt -noout -subject
  282. 284 openssl x509 -in tls.crt -noout -text
  283. 285 cd /etc/pki/tls/certs
  284. 286 ls
  285. 287 cd
  286. 288 history
  287. 289 cd /usr/lib/systemd/system
  288. 290 vim sshd.service
  289. 291 cp sshd.service /etc/systemd/system/sleep.service
  290. 292 cd /etc/systemd/system/
  291. 293 vim sleep.service
  292. 294 systemctl daemon-reload
  293. 295 systemctl enable --now sleep.service
  294. 296 ps aux | grep sleep
  295. 297 systemctl status sleep.service
  296. 298 kill -9 49463
  297. 299 systemctl status sleep.service
  298. 300 history
  299.  
Advertisement
Add Comment
Please, Sign In to add comment