networking commands:
python3 -m http.server portip apingping google.com- sends data packets to see if it responds or not. can also add-c packetnumberto specify how many packets to sendgpingis a solid alternate to ping as well btwdigdig +short google.com- the short switch gives a short answer as the name suggests, just giving the ip addresses
netstattcpdumptcpdump -i (interface such as eth0) -n
ifconfigandiwconfig(self explanatory)- traceroute to see route
- nslookup to see dns lookup info
- route to see routing table
navigation and stuff:
cdshortcuts:- can do just / for root
- can also do username to jump to home
lsls -lah- lists all files with linux file perms and stuff listed out including hidden files
- the
-hswitch shows human readable sizes instead of bytes
- ls -i
mkdirmkdir -p path-pmakes parents directories as well if they dont exist
- mkdir -p /dirname{1..9}
cpcp -r /source /destination-rlets you copy subdirectories and stuff as well
findfind /path -name "filename"- theres other switches as well. like -type as well
- -iname ignores case sensitivity
- find
- finds shit from a db of saved paths
- needs the database to be updated to find new stuff
- do updatedb to update the database
grepgrep -r "text" /path-rsearches through subdirectories- -E lets you specify other notations in the query string
catandless- use
lessfor longer files cat file1 file2 > combined.txt- can do this as well to combine files :D
cat /etc/update-motd.d/00-header
- use
file stuff and STROPS (STRing OPerationS):
- room link: https://tryhackme.com/room/linuxmodules
file stuff:
touchto create files- touch filename{1..20} creates 20 files with indexes
nanoorvimormousepadorcodeto use as an editorecho- can be used with
>or>>or other stuff with pipes n shit to do more advanced stuff. can do the same withcatas well
- can be used with
>to insert and>>to appendln -s filename newfilenamehead -5 filenametail -5 filenamesplit -l 10exiftool filename- to see metadata :D
strings filename- to see human readable stuff
STROPS
trcat grep.txt | tr -d '[a-zA-Z]'- delete stuff in the specified setcat grep.txt | tr -s '[a-z]' '[A-Z]'- replace stuff. source set then replace set
awk- scripting lang for manipulating data and generating reports. no need to compile shitawk '{print}' filename- cat altawk '/searchTerm/' filename- grep altawk '{print $1,$2}' filename- default field seperator is space. not doing a comma concatinates the feilds. field seperator can be specified with-Flike below. include theNRvariable with$0to get row countawk -F: '{print $1}' /etc/passwdawk 'BEGIN{OFS=":"} {print $1,$2,$3} END{print "Total Rows= " NR}' filename
sed(stream editor)sed -i 's/(the text you wanna replace)/(the text you wanna replace it with)/g' filename-iedits the file in placesstands for substitute- can specify the line number before
sto specify which line number to apply the substitution to
- can specify the line number before
gis global. basically applies the change to all occurrences
sed 'nd' filenamenspecify the line you wanna delete like 2 if you wanna delete the 2nd linedspecifies that you wanna delete it
sed '/^$/d' file- removes empty lines
sortsort filename -o filename- saves the sorted file into itself
- can do
-uto get unique lines as well
uniqpastepaste -d: unames cpasses > newcredsls | paste - - - -
system commands
envto view all env variablesxdg-open filename- opens the file with the default application. quite handy if you ask me :D
service start/stop/restart- apache2 for webservers
jobsto see suspended jobsfg %IDto foreground suspended jobsbg %IDto background jobnohupto give a running process immortality hqhqhqhqproc cpuinfodu --time -d 1 . -h(ls alt)statps -ef- gives a snapshot of all processes in a detailed format
hostnamectllsb_release -a(can also check /etc/os-release)run-parts /etc/update-motd.d/- tests what MOTD looks like without logging out
top,htop,bpytop:Dopenssl passwd -6 --salt salt "PASSWORD"
other stuff:
passwd- changes the pass for the specified user
sudo passwd root
xfwm4- to troubleshoot UI tweaking
rmvariants:rm -r dirname
- ill document tool installation with apt and pip later. i already have everything setup in my kali machine so im feeling kinda lazy. and ill look into pimpmykali later as well.
- 192.168.10.0/30
fun stuff to try out:
(make sure to add /usr/games to PATH for commands to work)
cmatrix- wont be installed by default. install it with apt
rev filename- wont be installed by default either
- basically revereses all the strings it can find in a file and outputs it xD or you can type in what you wanna reverse and enter to get the reversed string as well
cowsay string- ASCII cow says stuff
- just like the other stuff, wont be installed by default
oneko- cute neko chasing the cursor (*^-^*)
sl- ls typo funi hqhqhq
rig- generates random identities
yes string- repeats a string infinitely or repeats
yinfinitely. can be piped into other commands to automate annoying confirmation dialogues and stuff
xeyes- eyes that follow the cursor :D
hollywood- emulates hollywood hacking scenes lol. install it with apt as well
cool-retro-term- self explanatory tbh :v
aafire -extended- installation:
apt install libaa-bin
fortune- fortunes :D (pipe into cowsay if you want :3)
figlet string`showfigfonts` to see figlet fonts
toilet string- ASCII banners of strings :3 (tip: pipe through
lolcatto make rgb banners :D)
nyancat- :3
pipes -p 20 -r 0 -R- installation:
apt install pipes-sh
espeak -a 200 skibidi -p 20 -s 20- goofy ahh terminal talking hqhqhq
asciiquariumfactor number- outputs the factors of the given number
for i in {1..12}; do for j in $(seq 1 $i); do echo -ne $i×$j=$((i*j))\\t;done; echo;done- multiplication table :D
:(){ :|: & };:- fork bomb :D
bb- bb
echo "awughwauhgoahoiwhi;thaoi;hfgoai;ghioaghfkajfkajwbfauwkbgaoiwgbaoiwgbaiowgbao'wbgiaowbgoaibgoiawbgo;awbgioabgoa;wgbao" | pv -qL 50- text typewriting effect
aview image.jpg- image to ASCII art :D
mplayer -vo aa movie.avi- watch a movie in ASCII :D
mplayer -vo caca $filename.mp4
pacman4console- exactly what it sounds like
curl parrot.live- parrot partyyyyyyyyyyyyyyyyyyyyyy
curl -L http://bit.ly/10hA8iC | bash- xD
telnet mapscii.me- ascii map :D
LC_ALL=C tr -c "[:digit:]" " " < /dev/urandom | dd cbs=$COLUMNS conv=unblock | GREP_COLOR="1;32" grep --color "[^ ]"- random numbers all over the terminal
echo -e "1"; while $t; do for i in `seq 1 30`;do r="$[($RANDOM % 2)]";h="$[($RANDOM % 4)]";if [ $h -eq 1 ]; then v="0 $r";else v="1 $r";fi;v2="$v2 $v";done;echo -e $v2;v2="";done;- binary spam from 2013. similar to modern day cmatrix but way more primitive
while (true) do echo -n "balls"; done- repeat spam in terminal :D put anything in the quotes to spam https://github.com/jrcharney/hacktop/wiki/Linux-Toys