\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{Hey Mensh (HeyMensh)} \pdfinfo{ /Title (pentesting-with-linux-commands-gpen-based.pdf) /Creator (Cheatography) /Author (Hey Mensh (HeyMensh)) /Subject (Pentesting with Linux commands (GPEN based) Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{A3A3A3} \definecolor{LightBackground}{HTML}{F3F3F3} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Pentesting with Linux commands (GPEN based) Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Hey Mensh (HeyMensh)} via \textcolor{DarkBackground}{\uline{cheatography.com/150100/cs/35659/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}Hey Mensh (HeyMensh) \\ \uline{cheatography.com/heymensh} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Not Yet Published.\\ Updated 24th November, 2022.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{2} \begin{tabularx}{8.4cm}{p{0.8 cm} p{0.8 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{{\bf{Gather info}}}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{} \tn % Row Count 0 (+ 0) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4.16 cm} x{3.84 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Processes}} \tn % Row 0 \SetRowColor{LightBackground} `ps faux` & lists processes in a tree-like format \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} `ps -ef` & lists services running \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} `systemctl status\textless{}service\textgreater{}` & Get status of aprocess \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} `systemctl list-units -{}-type=service -{}-state=active` & list all running services in systemd \tn % Row Count 9 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.2 cm} x{4.8 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Network}} \tn % Row 0 \SetRowColor{LightBackground} `ifconfig -a` & Get IP address for all net interfaces \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} `netstat -a` & Get connections info \tn % Row Count 3 (+ 1) % Row 2 \SetRowColor{LightBackground} `netstat -nap` & show listening ports \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} `netstat —nap | less` & Look for "LISTENING" and "ESTABLISHED" \tn % Row Count 6 (+ 2) % Row 4 \SetRowColor{LightBackground} `lsof -i | less` & List and read open connections by processes \tn % Row Count 8 (+ 2) % Row 5 \SetRowColor{white} `netstat -plnt` & ports/process in LISTEN state \tn % Row Count 10 (+ 2) % Row 6 \SetRowColor{LightBackground} `netstat -rn` OR `route -v` & Get GW and routing table \tn % Row Count 12 (+ 2) % Row 7 \SetRowColor{white} `arp -a` & Get arp table \tn % Row Count 13 (+ 1) % Row 8 \SetRowColor{LightBackground} `ip addr` & Get IP address for all net interfaces \tn % Row Count 15 (+ 2) % Row 9 \SetRowColor{white} `ss -a` & Get connections info \tn % Row Count 16 (+ 1) % Row 10 \SetRowColor{LightBackground} `ss -plnt` & ports/process in LISTEN state \tn % Row Count 18 (+ 2) % Row 11 \SetRowColor{white} `ping6 -i eth0 ff02::1` & use this multicast address for all link-local IPv6 nodes \tn % Row Count 21 (+ 3) % Row 12 \SetRowColor{LightBackground} `ping6 -i eth0 ff02::2` & use this multicast address for all link-local IPv6 routers \tn % Row Count 24 (+ 3) % Row 13 \SetRowColor{white} `ip neigh` & Get arp table / host in same BRD domain \tn % Row Count 26 (+ 2) % Row 14 \SetRowColor{LightBackground} `ip route` & Get GW and routing table \tn % Row Count 27 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.04 cm} x{4.96 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Users and Groups}} \tn % Row 0 \SetRowColor{LightBackground} `cat /etc/passwd` & Get local user info \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} `cat /etc/shadow` & Get user hashes \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} `cat /etc/group` & Get all local groups \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} `finger` OR `who` & See who is currentlylogged in \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} `w` & See what they are doing \tn % Row Count 9 (+ 1) % Row 5 \SetRowColor{white} `cat \seqsplit{/etc/nsswitch.conf`} & get config about auth mechanisms \tn % Row Count 11 (+ 2) % Row 6 \SetRowColor{LightBackground} `getent passwd` & Get user accounts, regardless of back-end auth mechanism \tn % Row Count 14 (+ 3) % Row 7 \SetRowColor{white} `getent group` & Get groups, regardless of back-end auth mechanism \tn % Row Count 17 (+ 3) % Row 8 \SetRowColor{LightBackground} `getent shadow` & If SSSD or PAM is configured, get hashes for all users, regardless of back-end auth mechanism \tn % Row Count 21 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Remote information Gathering}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{} \tn % Row Count 0 (+ 0) % Row 1 \SetRowColor{white} `finger @{[}targetIP{]}` & See who is currentlylogged in \tn % Row Count 2 (+ 2) % Row 2 \SetRowColor{LightBackground} `ypcat passwd` & If NIS is in use, get users \tn % Row Count 4 (+ 2) % Row 3 \SetRowColor{white} `ypcat group` & If NIS is in use, get ugroups and memberships \tn % Row Count 7 (+ 3) % Row 4 \SetRowColor{LightBackground} `ssh \seqsplit{vagrant@192.168.1.25} "id;hostname"` & runs id and hostname on the dest host \tn % Row Count 9 (+ 2) % Row 5 \SetRowColor{white} `scp \seqsplit{root@x.x.x.x:/root/.ssh/id\_rsa} .` (with point at the end)) & copy remote file to current location \tn % Row Count 13 (+ 4) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{{\bf{wget}}} \tn % Row Count 14 (+ 1) % Row 7 \SetRowColor{white} `-nd` & No directories, puts all files in one directory \tn % Row Count 17 (+ 3) % Row 8 \SetRowColor{LightBackground} `-r` & Recursive Download / web spider function \tn % Row Count 19 (+ 2) % Row 9 \SetRowColor{white} `-P {[}directory{]}` & Prefix output fule locations with {[}directory{]} \tn % Row Count 22 (+ 3) % Row 10 \SetRowColor{LightBackground} `-R/A` & Restrict or alow file types or patterns \tn % Row Count 24 (+ 2) % Row 11 \SetRowColor{white} `{\bf{Example1: wget -nd -r -R htm,html,php,asp ,aspx,cgi -P /home /560 /CourseFiles/ 560metadata\_ex {[}tgt\_domain{]}}}` & Exclude html, php, asp and cgi extensions \tn % Row Count 30 (+ 6) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Remote information Gathering (cont)}} \tn % Row 12 \SetRowColor{LightBackground} `{\bf{Example1: wget -nd -r -A pdf, doc, docx,xls,xlsx -P /home /560 CourseFiles/ 560metadata\_ex {[}tgt\_domain{]}}}` & included only PDF, Word, and Excel extensions \tn % Row Count 6 (+ 6) % Row 13 \SetRowColor{white} `smbclient -{}-list=IP -{}-no-pass` & List shared folders hosted on IP anonymously \tn % Row Count 9 (+ 3) % Row 14 \SetRowColor{LightBackground} `smbclient //IP/sharedF -U "DOMAIN\textbackslash{}user"` & Map sharedFolder with creds \tn % Row Count 12 (+ 3) % Row 15 \SetRowColor{white} `smbclient //IP/sharedF -U 'NULL' -N` & Map sharedFolder with anonymous creds \tn % Row Count 14 (+ 2) % Row 16 \SetRowColor{LightBackground} `sudo mount //IP/sharedF /mount/point -o rw,guest` & Map sharedFolder to a mount point \tn % Row Count 17 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.92 cm} x{4.08 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Sensitive Locations}} \tn % Row 0 \SetRowColor{LightBackground} `/etc/passwd` & user account info \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} `/etc/shadow` & user password info \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} `\textasciitilde{}/.bash\_history` & user's history file \tn % Row Count 4 (+ 2) % Row 3 \SetRowColor{white} `\textasciitilde{}/.ssh directory` & SSH keys \tn % Row Count 5 (+ 1) % Row 4 \SetRowColor{LightBackground} `\textasciitilde{}/.mozilla` & Firefox profile \tn % Row Count 6 (+ 1) % Row 5 \SetRowColor{white} `/etc/rc.d/rc\textless{}x\textgreater{}.d` & SystemV runlevels services to run at startup \tn % Row Count 9 (+ 3) % Row 6 \SetRowColor{LightBackground} `/etc/systemd/system/\textless{}x\textgreater{}.target.wants` & Systemd target directory \tn % Row Count 11 (+ 2) % Row 7 \SetRowColor{white} \seqsplit{`/etc/nsswitch.conf`} & determine which authentication back-end a Linux system is configured to use \tn % Row Count 15 (+ 4) % Row 8 \SetRowColor{LightBackground} `/etc/sudoers.d/` & sudoers file \tn % Row Count 16 (+ 1) % Row 9 \SetRowColor{white} `grep -iHR passw *` & get files with "passw" in them \tn % Row Count 18 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.2 cm} x{4.8 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Read \& execute}} \tn % Row 0 \SetRowColor{LightBackground} `cat {[}filename{]}` & get content from a file \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} `head -n 20 {[}filename{]}` & get first 20 lines of {[}filename{]} \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} `tail -n 2 {[}filename{]}` & get last 2 lines of {[}filename{]} \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} `less OR more` & view large content moving in pages \tn % Row Count 7 (+ 2) % Row 4 \SetRowColor{LightBackground} `ls /dev | less` & putting command output as input to less \tn % Row Count 9 (+ 2) % Row 5 \SetRowColor{white} `which ls` & see Where your commands are run from \tn % Row Count 11 (+ 2) % Row 6 \SetRowColor{LightBackground} \seqsplit{`./program\_name`} & run a program located in the current directory \tn % Row Count 13 (+ 2) % Row 7 \SetRowColor{white} `PATH=\$PATH /{[}another\_dir{]}` & Temporary (Session's life) add directories to your path \tn % Row Count 16 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.04 cm} x{4.96 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Miscelaneous}} \tn % Row 0 \SetRowColor{LightBackground} `grep root *` & find files in the current directory that contain theword root \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} `man /info` & show detailed usage information for other commands \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} `whatis {[}command{]}` & Get a hint about What a program does \tn % Row Count 8 (+ 2) % Row 3 \SetRowColor{white} `apropos network` & search for topics \tn % Row Count 10 (+ 2) % Row 4 \SetRowColor{LightBackground} `man —k network` & look up something by keyword, \tn % Row Count 12 (+ 2) % Row 5 \SetRowColor{white} `unset HISTFILE` & Disable command history/logging \tn % Row Count 14 (+ 2) % Row 6 \SetRowColor{LightBackground} `watch 'ls -al file.zip'` & monitor when a file will appear \tn % Row Count 16 (+ 2) % Row 7 \SetRowColor{white} `env` & Listing environment variables \tn % Row Count 18 (+ 2) % Row 8 \SetRowColor{LightBackground} `echo \$PATH` & View your path env variable \tn % Row Count 20 (+ 2) % Row 9 \SetRowColor{white} `wc -l \seqsplit{/path/file.txt`} & WordCount | -l count the number of lines \tn % Row Count 22 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{2.48 cm} x{5.52 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Working with programs/jobs}} \tn % Row 0 \SetRowColor{LightBackground} `{[}command{]} \&` & run command in background as a job \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} `CTRL+Z` & if a program/command is running, it'll pause the job letting the process in the brackground paused \tn % Row Count 6 (+ 4) % Row 2 \SetRowColor{LightBackground} `jobs` & list background/pauses jobs \tn % Row Count 7 (+ 1) % Row 3 \SetRowColor{white} `bg \%{[}job\_number{]}` & resume program in background \tn % Row Count 9 (+ 2) % Row 4 \SetRowColor{LightBackground} `fg \%{[}job\_number{]}` & resume program in foreground, back to actual screen \tn % Row Count 11 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{p{0.8 cm} p{0.8 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Attack}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{} \tn % Row Count 0 (+ 0) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Port Forwarding}} \tn % Row 0 \SetRowColor{LightBackground} ssh -L \seqsplit{8888:victimIP:victimPORT} usr@PIVOT-PC & LOCAL - forward traffic from local port 8888 to DSThostIP:80 \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} "ssh usr@PIVOT-PC ssh root@192.168.1.119 -R \seqsplit{9999:192.168.1.25:80"} & REMOTE - forwarding traffic through the SSH connection, but your SSH connection this time will be "outbound." \tn % Row Count 9 (+ 6) % Row 2 \SetRowColor{LightBackground} ssh usr@PIVOT-PC -D 9050 & Dynamic Port forwarding OR SOCKS proxy \tn % Row Count 11 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Building tools}} \tn % Row 0 \SetRowColor{LightBackground} `tar xvf {[}archive.tar{]}` & untar Tape Archive Image file \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} `tar xvfz {[}archive.tar.gz or archive.tgz{]}` & uncompress and untar .tar.gz or tgz file \tn % Row Count 5 (+ 3) % Row 2 \SetRowColor{LightBackground} `" ./configure make make install"` & compile and install \tn % Row Count 7 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4.48 cm} x{3.52 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Setup Services}} \tn % Row 0 \SetRowColor{LightBackground} `python -m SimpleHTTPServer` & Serves current dir as webcontent \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} `python3 -m http.server` & Serves current dir as webcontent \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} `impacket-smbserver -comment "Temp Dir" TMP /tmp -username tempuser -p temppass -smb2support` & Simple SMB Service \tn % Row Count 9 (+ 5) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.52 cm} x{4.48 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Change configuration}} \tn % Row 0 \SetRowColor{LightBackground} `gedit \seqsplit{/etc/network/interfaces`} & set up static or dynamic network interfaces \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} `service networking restart` & pretty much that \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} `export \seqsplit{PATH=/usr/sbin:\$PATH`} & To add/usr/sbin to your PATH variable \tn % Row Count 6 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.36 cm} x{4.64 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Filesystems}} \tn % Row 0 \SetRowColor{LightBackground} `locate {[}program name{]}` & get location for a file \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{2}{x{8.4cm}}{`find {[}directory to search{]} {[}search criteria{]}`} \tn % Row Count 3 (+ 1) % Row 2 \SetRowColor{LightBackground} `find / -name {[}filename{]}` & exhaustively looks for stuff \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} \mymulticolumn{2}{x{8.4cm}}{`find / -name whoami`} \tn % Row Count 6 (+ 1) % Row 4 \SetRowColor{LightBackground} `updatedb` & create a locate database \tn % Row Count 8 (+ 2) % Row 5 \SetRowColor{white} `shred -{}-remove /tmp/sam.txt` & Shred overwrites the file with alternating zeros and ones three times so that they cannot be recovered. \tn % Row Count 13 (+ 5) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.68 cm} x{4.32 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Accounts}} \tn % Row 0 \SetRowColor{LightBackground} `useradd -d {[}home dir{]} {[}username{]}` & create a user login \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} `passwd` & change actual user password \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} `passwd {[}username{]}` & change other user's password \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} `sudo su` & becomes root \tn % Row Count 7 (+ 1) % Row 4 \SetRowColor{LightBackground} `whoami` & shows which account you are using \tn % Row Count 9 (+ 2) % Row 5 \SetRowColor{white} `id` & get more ditauls about your user and privis \tn % Row Count 12 (+ 3) % Row 6 \SetRowColor{LightBackground} `userdel {[}username{]}` & Delete user \tn % Row Count 14 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Firewall / IPTables}} \tn % Row 0 \SetRowColor{LightBackground} `iptables -D INPUT 2` & Delete INPUT rule ID 2 \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} `iptables -I INPUT 2 -s x.x.x.x -j DROP` & fw INPUT rule ID 2, action DROP traffic from X.X.X.X \tn % Row Count 5 (+ 3) % Row 2 \SetRowColor{LightBackground} `iptables -I INPUT 1 -s x.x.x.x -p tcp -{}-dport 4444 -j ACCEPT` & allow inbound port 4444 \tn % Row Count 9 (+ 4) % Row 3 \SetRowColor{white} `firewall-cmd -{}-direct -{}-add-rule ipv4 filter INPUT 1 -m tcp -p tcp -{}-dport 8443 -j ACCEPT` & add fw rule to allow incoming traffic \tn % Row Count 14 (+ 5) % Row 4 \SetRowColor{LightBackground} `firewall-cmd -{}-direct -{}-remove-rule ipv4 filter INPUT 1 -m tcp -p tcp -{}-dport 8443 -j ACCEPT` & remove fw rule to allow incoming traffic \tn % Row Count 19 (+ 5) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.76 cm} x{4.24 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Authentication}} \tn % Row 0 \SetRowColor{LightBackground} ssh-keygen -t rsa -b 2048 & generate a new identity file \tn % Row Count 2 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4.16 cm} x{3.84 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Priv elevation}} \tn % Row 0 \SetRowColor{LightBackground} `\%admins ALL=(root) NOPASSWD: /bin/bar` & Let admins Group run command as root \tn % Row Count 2 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}