Advertisement
sandervanvugt

examlabs oct23

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