Thumbnail: jekyll

TCM PEH Linux Notes

on under Certs
3 minute read

NOTE: Pasting my CherryTree notes into github without formatting is turning out to be some real hell.
I really don’t want to start typing “&nbsp” everywhere in my notes.
The alternative is that my notes will look like crap when I post them into the blog.
I am not altogether against it. Below I’ve opted to paste my notes into an online page break converter.
Maybe I should write a python tool to convert my raw notes into markdown, as practice.
NOTENOTE: Taking the old addage “Someone already made that tool”, I’ve found some online markdown converters and repasted my notes.
I have lost the tab formatting, but at least everything below is readable and special characters converted.

These are the notes I’ve taken for TheCyberMentor Academy’s Practical Ethical Hacking - Intro to Linux section

new kali and sudo
new kali uses non-privileged user
use sudo to run as root now, duh
su - to switch to root with kali’s pw, duh

navigating filesystem
print present working directory
cd …
change dir up one dir
ls -lha
list contents (long, human readable, all)
shorthand for home dir
mkdir newFolder
make directory newFolder here
echo “this text” > newfile
output “this text” overwritten into newfile
cp /location/A/file /location/B/file
copy file from A to B
mv /path/A/file /path/B/FILE
move and rename file from A to B
update cache of locations and paths
do this semi-frequently
change current user password
enter twice to over-ride complexity rules
man command
manpage for command
command --help
abbreviated manpage (sometimes)

Users and Privileges
rwx/rwx/rwx owner group
owner/group/all owner group
rwx = 421 bits
777 = rwxrwxrwx
111 = r–r--r–
123 = r—w-rw-
chmod -switch file
switch can be bits or switch
switch can set sticky bit too
set sticky bit = u+s
remove sticky bit = u-s
check the man for the cool switches
again check the man for the cool options
delete user
modify user
passwd -switch username
su username
switch to user username

Common Network Commands
legacy ip addr
ip addr
replaced ifconfig
ip addr | grep ‘inet ’
ping -c n ip
ping n times this ip
arp -a
check ip and mac directly associated
view connections
netstat -ant
netstat -anu
prints routing table

Installing and Updating Tools
sudo apt-get update -y && sudo apt-get upgrade -y
sudo apt-get dist-upgrade -y
sudo apt-get install pip3
rm -rf pimpmykali/
git clone
cd pimpmykali
sudo ./
select 0
sudo apt install gedit -y
sudo apt install flameshot -y

Viewing, Creating, and Editing Files
echo ‘string’ > textfile
echo ‘string’ >> textfile
appends the data
cat filename
more filename
less filename
less is more than more
head -n filename
list first n lines of filename
tail -n filename
list last n lines of filename
tail -f filename
cats tail of filename perpetually, good for logs
touch filename
changes timestamp to time touched
creates file that did not previously exist

Linux, Certs
comments powered by Disqus