Advertisement
sandervanvugt

LFCS july21 day1

Jul 1st, 2021
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.62 KB | None | 0 0
  1. [root@rocky2 ~]# history
  2. 1 git clone https://github.com/sandervanvugt/luth
  3. 2 git clone https://github.com/sandervanvugt/lfcs
  4. 3 cd lfcs
  5. 4 ls
  6. 5 ./countdown 12
  7. 6 find / -name "hosts"
  8. 7 find / -name "*hosts*"
  9. 8 useradd linda
  10. 9 find / -user linda
  11. 10 find / -user linda 2>/dev/null
  12. 11 mkdir /root/linda; find / -user linda -exec cp {} /root/linda/ \; 2>/dev/null
  13. 12 ls -a /root/linda
  14. 13 find / -perm /4000
  15. 14 find / -perm /4000 > ~/suidfiles.txt
  16. 15 ls ihiuhiu; who
  17. 16 ls ukhiuiu && who
  18. 17 echo $?
  19. 18 ls ukhiuiu || who
  20. 19 ls || who
  21. 20 man find
  22. 21 find / -perm /4111
  23. 22 find / -perm /4000
  24. 23 find / -perm 4111
  25. 24 find / -perm /4000 -exec ls -l {} \;
  26. 25 find / -perm -4111
  27. 26 man find
  28. 27 find / -type f -size +100M
  29. 28 mkdir find/contents; find /etc -exec grep -l student {} \; -exec cp {} find/contents/ \; 2>/dev/null
  30. 29 mkdir -p find/contents; find /etc -exec grep -l student {} \; -exec cp {} find/contents/ \; 2>/dev/null
  31. 30 find /etc/ -name '*' -type f | xargs grep '127.0.0.1'
  32. 31 sed -n 5p /etc/passwd
  33. 32 ls
  34. 33 cd ..
  35. 34 ls
  36. 35 vim mythings
  37. 36 sed -i 's/apple/beer/g' mythings
  38. 37 cat suidfiles.txt
  39. 38 cat mythings
  40. 39 sed -i -e '2d' mythings
  41. 40 cat mythings
  42. 41 awk -F : '{ print $4 }' /etc/passwd
  43. 42 awk -F : '{ print $4 }' /etc/passwd | sort -n
  44. 43 cut -d -f 4 /etc/passwd | sort -n
  45. 44 cut -d : -f 4 /etc/passwd
  46. 45 awk -F : '/linda/ { print $4 }' /etc/passwd
  47. 46 vim demo1.txt
  48. 47 vim /etc/login.defs
  49. 48 cd /etc/skel/
  50. 49 ls
  51. 50 ls -a
  52. 51 touch hello
  53. 52 groupadd sales
  54. 53 groupadd account
  55. 54 useradd -G sales linda
  56. 55 usermod -aG sales linda
  57. 56 useradd lisa
  58. 57 id lisa
  59. 58 usermod -aG sales lisa
  60. 59 id lisa
  61. 60 usermod -G wheel lisa
  62. 61 id lisa
  63. 62 usermod -aG sales lisa
  64. 63 id lisa
  65. 64 useradd -aG account anna
  66. 65 useradd -G account anna
  67. 66 id anna
  68. 67 useradd -G account anouk
  69. 68 cat demo1.txt
  70. 69 for user in lisa linda anna anouk; do echo password | passwd --stdin $user; done
  71. 70 passwd lisa
  72. 71 history
  73. 72 history -d 68
  74. 73 tail -4 /etc/passwd
  75. 74 tail -4 /etc/shadow
  76. 75 passwd -l lisa
  77. 76 tail -4 /etc/shadow
  78. 77 luth/countdown 12
  79. 78 touch removeme
  80. 79 lsattr
  81. 80 chattr +o removeme
  82. 81 chattr +i removeme
  83. 82 ls -l
  84. 83 rm -f removeme
  85. 84 chattr -i removeme
  86. 85 rm -f removeme
  87. 86 ls
  88. 87 vim demo2.txt
  89. 88 mkdir -p /data/sales
  90. 89 mkdir -p /data/account
  91. 90 cd /data
  92. 91 ls -l
  93. 92 chown anna:account account
  94. 93 ls -l
  95. 94 chown anna:sales sales
  96. 95 cat ~/demo2.txt
  97. 96 id linda
  98. 97 su - linda
  99. 98 chmod g+w *
  100. 99 ls -l
  101. 100 su - linda
  102. 101 su - lisa
  103. 102 ls -l
  104. 103 chmod g+s sales
  105. 104 ls -l
  106. 105 su - lisa
  107. 106 ls -l
  108. 107 chmod +t *
  109. 108 ls -l
  110. 109 su - lisa
  111. 110 su - anna
  112. 111 cd /home/linda
  113. 112 whoami
  114. 113 echo hellowortel > wortelfile
  115. 114 ls -l
  116. 115 echo hellobrocolli > brofile
  117. 116 su - linda
  118. 117 lsattr
  119. 118 chattr +i hello
  120. 119 rm -f hello
  121. 120 chattr -i hello
  122. 121 lsattr
  123. 122 cd /data
  124. 123 ls -al
  125. 124 ls -ld sales/
  126. 125 cd
  127. 126 luth/countdown 18
  128. 127 find / -perm /4000 2>/dev/null
  129. 128 ls -l $(which passwd)
  130. 129 ls -l /etc/shadow
  131. 130 cd /home/linda
  132. 131 ls
  133. 132 vim playme
  134. 133 chmod +x playme
  135. 134 exit
  136. 135 cd /home/linda
  137. 136 chmod u+s playme
  138. 137 ls -l
  139. 138 history
  140. 139 cat playme
  141. 140 cd
  142. 141 yum repolist
  143. 142 yum search zsh
  144. 143 yum install zsh
  145. 144 yum update
  146. 145 yum list installed
  147. 146 yum provides */sealert
  148. 147 which dnf
  149. 148 which yum
  150. 149 ls -l /usr/bin/yum
  151. 150 yum groups list
  152. 151 yum groups install "Virtualization Host"
  153. 152 man yum
  154. 153 yum --help | less
  155. 154 ip a
  156. 155 ip a a dev ens33 10.0.0.10/24
  157. 156 ip a
  158. 157 ping 10.0.0.10
  159. 158 ifconfig
  160. 159 ip --help | less
  161. 160 rpm -qf $(which ifconfig)
  162. 161 rpm -ql net-tools | grep bin
  163. 162 yum remove net-tools
  164. 163 man ifconfig
  165. 164 luth/countdown 12
  166. 165 systemctl status NetworkManager
  167. 166 nmtui
  168. 167 ip a
  169. 168 lsblk
  170. 169 history
  171.  
  172. [root@rocky ~]# history
  173. 1 lsblk
  174. 2 fdisk /dev/sda
  175. 3 reboot
  176. 4 lsblk
  177. 5 mkfs.xfs /dev/sda5
  178. 6 mkfs.ext4 /dev/sda6
  179. 7 mkdir /ext4 /xfs
  180. 8 vim /etc/fstab
  181. 9 history
  182. 10 vim /etc/fstab
  183. 11 mount -a
  184. 12 mount
  185. 13 mount | grep '^/'
  186. 14 history
  187.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement