sandervanvugt

Untitled

May 28th, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.09 KB | None | 0 0
  1. status -l httpd
  2. 583 setenforce 0
  3. 584 systemctl start httpd
  4. 585 systemctl status httpd
  5. 586 grep sealert /var/log/messages
  6. 587 sealert -l 74f98838-27de-42a8-bea8-22d84df69951 | less
  7. 588 semanage port -a -t http_port_t -p tcp 82
  8. 589 getenforce
  9. 590 setenforce enforcing
  10. 591 systemctl restart httpd
  11. 592 systemctl status httpd
  12. 593 history
  13. 594 reboot
  14. 595 history
  15. [root@server2 ~]# cd /etc/selinux/targeted/
  16. contexts/ logins/ policy/
  17. [root@server2 ~]# cd /etc/selinux/targeted/contexts/
  18. files/ users/
  19. [root@server2 ~]# cd /etc/selinux/targeted/contexts/files/
  20. [root@server2 files]# ls
  21. file_contexts file_contexts.homedirs file_contexts.local file_contexts.subs media
  22. file_contexts.bin file_contexts.homedirs.bin file_contexts.local.bin file_contexts.subs_dist
  23. [root@server2 files]# cat file_contexts.local
  24. # This file is auto-generated by libsemanage
  25. # Do not edit directly.
  26.  
  27. /web(/.*)? system_u:object_r:httpd_sys_content_t:s0
  28. [root@server2 files]# history
  29. 1 sudo useradd lisa
  30. 2 sudo userdel lida
  31. 3 sudo userdel lisa
  32. 4 sudo passwd lisa
  33. 5 sudo passwd root
  34. 6 exit
  35. 7 sudo passwd root
  36. 8 sudo passwd bob
  37. 9 exit
  38. 10 touch lindafile1
  39. 11 touch lindafile2
  40. 12 exit
  41. 13 cd /etc/sudoers.d/
  42. 14 ls
  43. 15 cat linda
  44. 16 yum provides */pbrun
  45. 17 cd /etc
  46. 18 ls sudoer*
  47. 19 cd /home/student/
  48. 20 ./countdown 12
  49. 21 man hier
  50. 22 cd /
  51. 23 ls
  52. 24 ls -l
  53. 25 cd boot
  54. 26 ls
  55. 27 cd /dev
  56. 28 ls
  57. 29 cd /etc
  58. 30 ls
  59. 31 cat sudoers
  60. 32 cat passwd
  61. 33 cd /
  62. 34 ls
  63. 35 cd home
  64. 36 ls
  65. 37 cd /root
  66. 38 ls
  67. 39 pwd
  68. 40 cd run
  69. 41 cd /run
  70. 42 ls
  71. 43 cd /tmp
  72. 44 ls
  73. 45 cd /usr
  74. 46 du -hs
  75. 47 ls
  76. 48 cd /var
  77. 49 ls
  78. 50 cd log
  79. 51 ls
  80. 52 cd /
  81. 53 ls -l
  82. 54 ls -il /etc/hosts
  83. 55 ln /etc/hosts /root/myhosts
  84. 56 ls -il /etc/hosts /root/myhosts
  85. 57 echo hello >> /etc/hosts
  86. 58 ls -il /etc/hosts /root/myhosts
  87. 59 cat /root/myhosts
  88. 60 cd
  89. 61 ln -s /root/myhosts /tmp/symhosts
  90. 62 ls -il /etc/hosts /root/myhosts /tmp/symhosts
  91. 63 cat /tmp/symhosts
  92. 64 rm /root/myhosts
  93. 65 ls -il /etc/hosts /root/myhosts /tmp/symhosts
  94. 66 cat /tmp/symhosts
  95. 67 ln /etc/hosts /root/myhosts
  96. 68 ls -il /etc/hosts /root/myhosts /tmp/symhosts
  97. 69 ln /etc /myetc
  98. 70 ln /boot/vmlinuz-4.18.0-147.el8.x86_64 mykernel
  99. 71 find / -samefile /etc/hosts
  100. 72 find / -samefile /etc/hosts
  101. 73 find / -samefile /etc/hosts 2> /dev/null
  102. 74 history
  103. 75 history | less
  104. 76 cp /tmp/symhosts .
  105. 77 ls -l
  106. 78 cat symhosts
  107. 79 man hier
  108. 80 lsblk
  109. 81 umount /dev/sdb1
  110. 82 lsblk
  111. 83 mount /dev/sdb1 /mnt
  112. 84 ls /mnt
  113. 85 umount /mnt
  114. 86 cd /home/student/
  115. 87 ls
  116. 88 countdown
  117. 89 echo $PATH
  118. 90 mv countdown /usr/bin
  119. 91 countdown 12
  120. 92 man -k user
  121. 93 man man
  122. 94 man apropos
  123. 95 man mandb
  124. 96 mandb
  125. 97 man -k user
  126. 98 man man
  127. 99 man -k user | grep 8
  128. 100 find / -name "hosts"
  129. 101 find / -name "*hosts*"
  130. 102 find / -user linda
  131. 103 find / -size +100M
  132. 104 find / -user linda -exec ls -l {} \;
  133. 105 find / -user linda -exec cp {} /root \;
  134. 106 ls
  135. 107 ls -la
  136. 108 su - linda
  137. 109 find / -user linda -exec cp {} /root \;
  138. 110 ls -l
  139. 111 pwd
  140. 112 cd /root
  141. 113 ls -l
  142. 114 history
  143. 115 ps aux
  144. 116 ps aux | grep ssh
  145. 117 grep linda /etc/*
  146. 118 grep linda /etc/* 2>/dev/null
  147. 119 grep -l linda /etc/* 2>/dev/null
  148. 120 grep -lR linda /etc/* 2>/dev/null
  149. 121 which vi
  150. 122 which vim
  151. 123 ls -l /bin/vi /bin/vim
  152. 124 exit
  153. 125 vim /etc/hosts
  154. 126 vim /etc/login.defs
  155. 127 echo $(( 99999 / 365 ))
  156. 128 vim /etc/login.defs
  157. 129 groupadd sales
  158. 130 groupadd account
  159. 131 useradd --help
  160. 132 useradd -G sales linda
  161. 133 id linda
  162. 134 usermod -aG sales linda
  163. 135 id linda
  164. 136 usermod -aG sales lisa
  165. 137 useradd -G account anna
  166. 138 useradd -G account anouk
  167. 139 history
  168. 140 tail -n 6 /etc/passwd
  169. 141 tail -n 3 /etc/group
  170. 142 tail -n 6 /etc/group
  171. 143 mkdir /data/sales
  172. 144 mkdir /data/sales -p
  173. 145 mkdir /data/account -p
  174. 146 cd /data
  175. 147 ls -l
  176. 148 id
  177. 149 chown :account account
  178. 150 ls -l
  179. 151 chgrp sales sales
  180. 152 ls -l
  181. 153 chmod 770 *
  182. 154 ls -l
  183. 155 su - lisa
  184. 156 su - linda
  185. 157 su - lisa
  186. 158 history
  187. 159 echo this is some text > rootfile
  188. 160 md5sum rootfile
  189. 161 md5sum rootfile > rootfile.md5
  190. 162 cat rootfile.md5
  191. 163 vim rootfile
  192. 164 md5sum rootfile
  193. 165 mkdir mydir
  194. 166 mkdir complete/path/of/directories
  195. 167 mkdir -p complete/path/of/directories
  196. 168 cp /etc/hosts /data/sales
  197. 169 cp /etc/hosts /data/sals
  198. 170 ls /data/sales
  199. 171 ls -l /data/sals
  200. 172 cat /data/sals
  201. 173 cp /etc/hosts /data/account/
  202. 174 cp /etc/hosts /data/accont/
  203. 175 history
  204. 176 vim rootfile
  205. 177 md5sum rootfile > newmd5.md5
  206. 178 diff rootfile.md5 newmd5.md5
  207. 179 cat rootfile.md5 newmd5.md5
  208. 180 vim /etc/group
  209. 181 cd /home/linda
  210. 182 vim playme
  211. 183 chmod +x playme
  212. 184 ./playme
  213. 185 chmod u+s playme
  214. 186 ls -l
  215. 187 su - linda
  216. 188 find / -perm /4000 -exec ls -l {} \;
  217. 189 ls -l /etc/shadow
  218. 190 cd /data/sales
  219. 191 su - linda
  220. 192 su - lisa
  221. 193 chmod g+s .
  222. 194 ls -l .
  223. 195 ls -ld .
  224. 196 su - lisa
  225. 197 chmod +t .
  226. 198 ls -ld .
  227. 199 su - lisa
  228. 200 id linda
  229. 201 grep linda /etc/group
  230. 202 grep linda /etc/passwd
  231. 203 less /var/log/messages
  232. 204 less /var/log/audit/audit.log
  233. 205 man auditctl
  234. 206 auditctl -w /etc/ -p wa
  235. 207 vim /etc/motd
  236. 208 less /var/log/audit/audit.log
  237. 209 cd ..
  238. 210 ls -l
  239. 211 rm r*
  240. 212 rm sals
  241. 213 rmdir mydir/ complete/
  242. 214 rm -rf complete/
  243. 215 ls -l
  244. 216 rm newmd5.md5
  245. 217 ls -l
  246. 218 getfacl sales
  247. 219 setfacl -m -R g:account:rx sales
  248. 220 setfacl -R -m g:account:rx sales
  249. 221 getfacl sales
  250. 222 cd sales
  251. 223 ls -l
  252. 224 man setfacl
  253. 225 cd ..
  254. 226 setfacl -R -x g:account sales
  255. 227 ls -l sales/
  256. 228 setfacl -R -m g:account:rX sales
  257. 229 getfacl sales
  258. 230 ls -l sales/
  259. 231 setfacl sales/lisa1
  260. 232 getfacl sales/lisa1
  261. 233 su - lisa
  262. 234 getfacl sales/newlisa
  263. 235 setfacl -m d:g:account:rx sales
  264. 236 getfacl sales
  265. 237 su - lisa
  266. 238 getfacl sales/lisa123
  267. 239 history
  268. 240 countdown 13
  269. 241 vim /etc/login.defs
  270. 242 groupadd profs students
  271. 243 groupadd profs
  272. 244 groupadd student
  273. 245 groupadd students
  274. 246 useradd mandy -aG students
  275. 247 useradd -aG students mandy
  276. 248 useradd -G students mandy
  277. 249 useradd -G students melanie
  278. 250 useradd -G profs boris
  279. 251 useradd -G profs bobob
  280. 252 history
  281. 253 usermod -aG students linda
  282. 254 usermod -aG students lisa
  283. 255 usermod -aG profs anna
  284. 256 usermod -aG profs anouk
  285. 257 chage -l linda
  286. 258 chage -l bob
  287. 259 chage -l bobob
  288. 260 chage bob
  289. 261 yum repolist
  290. 262 cd /etc/yum.repos.d/
  291. 263 ls
  292. 264 rm -f *
  293. 265 yum repolist
  294. 266 cd
  295. 267 dd if=/dev/sr0 of=/centos8.iso bs=1M
  296. 268 mkdir /repo
  297. 269 vim /etc/fstab
  298. 270 mount -a
  299. 271 cd /repo
  300. 272 ls
  301. 273 cd BaseOS/
  302. 274 ls
  303. 275 cd Packages/
  304. 276 ls
  305. 277 cd ../..
  306. 278 cd AppStream/
  307. 279 ls
  308. 280 cd Packages/
  309. 281 ls
  310. 282 cd ..
  311. 283 cd /etc/yum.repos.d/
  312. 284 vim baseos.repo
  313. 285 vim appstream.repo
  314. 286 yum repolist
  315. 287 vim appstream.repo
  316. 288 yum repolist
  317. 289 yum search nmap
  318. 290 yum install nmap
  319. 291 yum search seinfo
  320. 292 yum provides */seinfo
  321. 293 yum remove kernel
  322. 294 yum remove bash
  323. 295 cat appstream.repo baseos.repo
  324. 296 yum groups list
  325. 297 yum groups list --hidden
  326. 298 yum groups info "Virtualization Tools"
  327. 299 yum groups install "Virtualization Tools"
  328. 300 yum install -y epel-release
  329. 301 yum search epel
  330. 302 yum provides */kvm2
  331. 303 cd
  332. 304 countdown 12
  333. 305 ping google.com
  334. 306 yum modules list
  335. 307 yum module list
  336. 308 yum module list | less
  337. 309 yum modules provides httpd
  338. 310 yum module provides httpd
  339. 311 yum module info httpd
  340. 312 yum module install postgresql:9.6/devel
  341. 313 yum module info postgresql
  342. 314 yum module install postgresql:9.6/server
  343. 315 ip -h
  344. 316 ip a
  345. 317 ip addr add dev ens33 10.0.0.10/24
  346. 318 ip a
  347. 319 ping 10.0.0.10
  348. 320 ifconfig
  349. 321 ifconfig -a
  350. 322 man ifconfig
  351. 323 which ifconfig
  352. 324 rpm -qf $(which ifconfig)
  353. 325 rpm -ql net-tools
  354. 326 rpm -ql net-tools | grep bin
  355. 327 yum remove net-tools
  356. 328 ip route show
  357. 329 ip route del default via 192.168.4.2
  358. 330 ip route show
  359. 331 ping nu.nl
  360. 332 ip route add default via 192.168.4.2
  361. 333 ping nu.nl
  362. 334 vim /etc/resolv.conf
  363. 335 vim /etc/sysconfig/network-scripts/ifcfg-ens33
  364. 336 systemctl status NetworkManager
  365. 337 nmtui
  366. 338 ip a
  367. 339 ping nu.nl
  368. 340 vim /etc/sysconfig/network-scripts/ifcfg-ens33
  369. 341 vim /etc/resolv.conf
  370. 342 systemctl restart NetworkManager
  371. 343 vim /etc/resolv.conf
  372. 344 ip neigh
  373. 345 ip neigh -h
  374. 346 ip neigh help
  375. 347 ip neigh show
  376. 348 nmap -sn 192.168.4.0/24
  377. 349 ip neigh show
  378. 350 history
  379. 351 nmap -sn 192.168.4.0/24
  380. 352 ping 192.168.4.1
  381. 353 ping 192.168.4.254
  382. 354 ip neigh show
  383. 355 countdown 13
  384. 356 lsblk
  385. 357 poweroff
  386. 358 lsblk
  387. 359 fdisk /dev/sda
  388. 360 lsblk
  389. 361 mkfs.xfs /dev/sda3
  390. 362 mount /dev/sda3 /mnt
  391. 363 mount
  392. 364 mount | grep '^/'
  393. 365 vim /etc/fstab
  394. 366 mount -a
  395. 367 mkdir /myfiles
  396. 368 mount -a
  397. 369 mount | grep '^/'
  398. 370 umount /mnt
  399. 371 reboot
  400. 372 vim /etc/fstab
  401. 373 reboot
  402. 374 vim /etc/fstab
  403. 375 reboot
  404. 376 vim /etc/fstab
  405. 377 history
  406. 378 mkdir -p /data/profs /data/students
  407. 379 cd /data
  408. 380 ls -lk
  409. 381 chgrp students students
  410. 382 chgrp profs profs
  411. 383 ls -l
  412. 384 chown anna students
  413. 385 chown anna profs
  414. 386 chmod 3770 profs
  415. 387 chmod 3770 student
  416. 388 chmod 3770 students
  417. 389 ls -l
  418. 390 setfacl -R -m g:profs:rX students
  419. 391 setfacl -m d:g:profs:rx students
  420. 392 getfacl students/
  421. 393 cd /myrepo
  422. 394 mkdir /myrepo
  423. 395 cd /myrepo/
  424. 396 yum provides */yumdownloader
  425. 397 yum install -y yum-utils
  426. 398 yumdownloader nmap*
  427. 399 ls
  428. 400 yum provides */createrepo
  429. 401 yum install -y createrepo_c
  430. 402 createrepo /myrepo
  431. 403 ls
  432. 404 tree repodata/
  433. 405 cd /etc/yum.repos.d/
  434. 406 ls
  435. 407 vim myrepo.repo
  436. 408 yum repolist
  437. 409 yum provides */sealert
  438. 410 rpm -ql setroubleshoot-server
  439. 411 rpm -qc setroubleshoot-server
  440. 412 cd
  441. 413 fdisk -l /dev/sda
  442. 414 xxd -l 512 /dev/sda
  443. 415 fdisk /dev/sda
  444. 416 lsblk
  445. 417 mkfs.ext4 /dev/sda4
  446. 418 fdisk /dev/sda
  447. 419 fdisk -l /dev/sda
  448. 420 lsblk
  449. 421 partprobe /dev/sda
  450. 422 reboot
  451. 423 lsblk
  452. 424 mkfs.ext4 /dev/sda5
  453. 425 mkfs.xfs /dev/sda6
  454. 426 mkdir /sda5
  455. 427 mkdir /sda6
  456. 428 vim /etc/fstab
  457. 429 mount -a
  458. 430 mount
  459. 431 vim /etc/fstab
  460. 432 fdisk /dev/sda
  461. 433 reboot
  462. 434 fdisk -l
  463. 435 fdisk -l /dev/sda5
  464. 436 fdisk -l /dev/sda
  465. 437 xfs_admin --help
  466. 438 xfs_admin -L cow /dev/sda5
  467. 439 vim /etc/fstab
  468. 440 reboot
  469. 441 lsblk
  470. 442 blkid
  471. 443 vim /etc/fstab
  472. 444 fdisk /dev/sda
  473. 445 reboot
  474. 446 ss --help
  475. 447 ss -antZ
  476. 448 ss -antZ | grep 80
  477. 449 ss -aZ
  478. 450 man ss
  479. 451 ss -alZ
  480. 452 man ss
  481. 453 ss -Z
  482. 454 ss -sZ
  483. 455 yum install net-tools
  484. 456 netstat -Ztulpen
  485. 457 yum remove net-tools -y
  486. 458 vim /etc/httpd/conf/httpd.conf
  487. 459 systemctl restart httpd
  488. 460 systemctl status tuned
  489. 461 tuned-adm list
  490. 462 tuned-adm profile desktop
  491. 463 tuned-adm list
  492. 464 cat /etc/fstab
  493. 465 tuned-adm list
  494. 466 tuned-adm profile network-latency
  495. 467 sysctl -a
  496. 468 sysctl -a | wc
  497. 469 sysctl -a
  498. 470 countdown 13
  499. 471 lsblk
  500. 472 fdisk /dev/sda
  501. 473 lsblk
  502. 474 pvcreate --help
  503. 475 pvcreate /dev/sda7
  504. 476 pvs
  505. 477 vgcreate --help | less
  506. 478 vgcreate -s 8M vgdata /dev/sda7
  507. 479 vgs
  508. 480 pvs
  509. 481 lvcreat --help | less
  510. 482 lvcreate --help | less
  511. 483 lvcreate -n lvdata -L 2G vgdata
  512. 484 echo $(( 255 * 8 ))
  513. 485 lvcreate -n lvdata -l 100%FREE vgdata
  514. 486 lvs
  515. 487 mkfs.xfs /dev/vgdata/lvdata
  516. 488 mkdir /lvdata
  517. 489 vim /etc/fstab
  518. 490 mount -a
  519. 491 mount
  520. 492 ls -l /dev/vgdata/lvdata /dev/mapper/vgdata-lvdata
  521. 493 history
  522. 494 cat /etc/fstab
  523. 495 free -m
  524. 496 countdown 12
  525. 497 free -m
  526. 498 fdisk /dev/sda
  527. 499 lsblk
  528. 500 mkswap /dev/sda8
  529. 501 free -m
  530. 502 vim /etc/fstab
  531. 503 swapon -a
  532. 504 free -m
  533. 505 swapon -s
  534. 506 history
  535. 507 lsblk
  536. 508 cd /lvdata
  537. 509 df -h
  538. 510 dd if=/dev/zero of=bigfile
  539. 511 df -h
  540. 512 vgs
  541. 513 vgextend vgdata /dev/sda9
  542. 514 vgs
  543. 515 lvextend --help | less
  544. 516 man lvextend
  545. 517 lvextend -L +500M vgdata/lvdata
  546. 518 lvs
  547. 519 df -h
  548. 520 man -k resize
  549. 521 xfs_growfs /dev/vgdata/lvdata
  550. 522 resize2fs /dev/vgdata/lvdata
  551. 523 mount
  552. 524 xfs_growfs --help
  553. 525 xfs_growfs /lvdata
  554. 526 df -h
  555. 527 lvextend -l +20%FREE -r /dev/vgdata/lvdata
  556. 528 history
  557. 529 yum install -y httpd
  558. 530 systemctl start httpd
  559. 531 ps Zaux | grep httpd
  560. 532 ps Zaux | grep ssh
  561. 533 cd /var/www
  562. 534 ls -Z
  563. 535 cd ..
  564. 536 ls -Z
  565. 537 ss Ztupen
  566. 538 ss tupen
  567. 539 ss -tupen
  568. 540 ss -Ztupen
  569. 541 ss -Ztup
  570. 542 ss -ant
  571. 543 ss -antZ
  572. 544 ss -plantZ
  573. 545 ss -plantZ | grep 80
  574. 546 vim /etc/sysconfig/selinux
  575. 547 getenforce
  576. 548 setenforce permissive
  577. 549 getenforce
  578. 550 setenforce enforcing
  579. 551 cd
  580. 552 mkdir /web
  581. 553 vim /web/index.html
  582. 554 vim /etc/httpd/conf/httpd.conf
  583. 555 systemctl restart httpd
  584. 556 systemctl status httpd
  585. 557 curl http://localhost
  586. 558 ps Zaux | grep http
  587. 559 ls -Zd /web
  588. 560 setenforce permissive
  589. 561 curl http://localhost
  590. 562 ls -Zd /var/www/html/
  591. 563 setenforce enforcing
  592. 564 history
  593. 565 sleep 20; countdown 12
  594. 566 history
  595. 567 man semanage
  596. 568 ls -lZ /var/www
  597. 569 man semanage-fcontext
  598. 570 semanage fcontext -a -t httpd_sys_content_t "/web(/.*)?"
  599. 571 ls -lZd /web
  600. 572 restorecon -Rv /web
  601. 573 getenforce
  602. 574 curl http://localhost
  603. 575 man semanage-port
  604. 576 getsebool -a
  605. 577 getsebool -a | wc
  606. 578 getsebool -a | grep ftp
  607. 579 setsebool -P ftpd_anon_write on
  608. 580 systemctl status httpd
  609. 581 systemctl status httpd -l
  610. 582 systemctl status -l httpd
  611. 583 setenforce 0
  612. 584 systemctl start httpd
  613. 585 systemctl status httpd
  614. 586 grep sealert /var/log/messages
  615. 587 sealert -l 74f98838-27de-42a8-bea8-22d84df69951 | less
  616. 588 semanage port -a -t http_port_t -p tcp 82
  617. 589 getenforce
  618. 590 setenforce enforcing
  619. 591 systemctl restart httpd
  620. 592 systemctl status httpd
  621. 593 history
  622. 594 reboot
  623. 595 history
  624. 596 cd /etc/selinux/targeted/contexts/files/
  625. 597 ls
  626. 598 cat file_contexts.local
  627. 599 history
  628. [root@server2 files]# cat /etc/fstab
  629.  
  630. #
  631. # /etc/fstab
  632. # Created by anaconda on Tue May 26 13:38:27 2020
  633. #
  634. # Accessible filesystems, by reference, are maintained under '/dev/disk/'.
  635. # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.
  636. #
  637. # After editing this file, run 'systemctl daemon-reload' to update systemd
  638. # units generated from this file.
  639. #
  640. /dev/mapper/cl-root / xfs defaults 0 0
  641. UUID=801e0a7c-4089-4b37-b370-0848bfa46f36 /boot ext4 defaults 1 2
  642. /dev/mapper/cl-swap swap swap defaults 0 0
  643. /centos8.iso /repo iso9660 defaults 0 0
  644. /dev/sda3 /myfiles xfs defaults 0 0
  645. LABEL=cow /sda6 xfs defaults 0 0
  646. /dev/vgdata/lvdata /lvdata xfs defaults 0 0
  647. UUID=e3329178-af90-46fc-b75a-9f05032847cf swap swap defaults 0 0
Add Comment
Please, Sign In to add comment