Commands

1. Titlepage

\begin{document}
	\begin{titlepage}
	\centering %Center the text
	Example
	\end{titlepage}
\end{document}

2. Images

\usepackage{graphicx} %To insert images
	
\includegraphics[width=0,6\textwidth]{Directory,ex:Images/hackthebox_logo.png}\par\vspace{1cm}
	
\includegraphics[width=\textwidth,height=4cm,keepspaceratio]{Images/mantis_logo.png}

3. Bold type

\textbf

Ex: {\scshape\LARGE\textbf{Example}}

4. Variables Def

\newcommand{\logoPortada}{Images/hackthebox_logo.png}
%Then to add the image we don't have to say {Images/hackthebox_logo.png} just with {\logoPortada} is enough

5. Colors

\usepackage[table,xcdraw]{xcolor} %To detect colors
	
%Colors Def
\definecolor{greenPortada}{HTML}{69A84F}
%This take hexadecimal number through google (color #AAAAAA by selecting the colour we want)

6. Insert boxes

\usepackage[most]{tcolorbox}
	
%Find the box you like on google typing tcolorbox and copy the command
\begin{tcolorbox}[colorback=red!5!white,colframe=red!75!black]
	My box.
\end{tcolorbox}

%To make line jumps we use /\par, but in tcolorboxes we are using \\

Example:

In https://www.overleaf.com/latex/examples/drawing-coloured-boxes-using-tcolorbox/pvknncpjyfbp we copy the commands for the box we want and then we edit it.

\begin{tcolorbox}[enhanced,attach boxed title to top center={yshift=-3mm,yshifttext=-1mm},
	colback=blue!5!white,colframe=blue!75!black,colbacktitle=red!80!black,
	title=URL Direction,fonttitle=\bfseries,
	boxed title style={size=small,colframe=red!50!black} ]
	\centering
	\href{https://hackthebox.eu/home/machines/profile/98}{color\blue}{https://hackthebox.eu/home/machines/profile/98}}
\end{tcolorbox}

7. Margins

\usepackage[margin=2cm,top=2cm, includefoot]{geometry}

8. Fill white spaces

\vfill %we should use this in each white space we want to fill. Also we can doble vfill and triple vfill
\vfill\vfill

9. Page jump

\clearpage

10. Renew predefined command

%Change Index to Indice in spanish
\addto\captionsspanish{\renewcommand{\contentsname}{Índice}}

11. Head

\usepackage{fancyhdr} %Define page style
	
\setlength{\headheight}{40.2pt}

\pagestyle{fancy}
\fancyhf
\lhead{\includegraphics[width=5cm]{\logoPortada}} %Lefthead
\rhead{\includegraphics[heigth=1.5cm]{\logo_Machine}} %Rigthhead
\renewcommand{\headrulewidth}{3pt} %Head line width

12. TOC (Table of Contents)

\usepackage[hidelinks]{hyperref} %Hyperlinks gestion
	
\clearpage
\tableofcontents
\clearpage

13. Sections and subsections

\section{Antecedents}
El presente documento recoge los resultados obtenidos en la auditoría realizada a la máquina {\textbf\machinName} de la plataforma \href{https://hackthebox.eu}{\textbf{\color{blue}HackTheBox}}.
\section{Objectives}

This text uses indentation by default. If we want to remove it:
\usepackage{parskip}
	
Then to create a subsection into a section:
\subsection{Ejemplo de subsección}
Ejemplo de texto dentro de una subsección hola jajaj.

14. Image under Figure concept

\vspace{0.2cm} %Space of 0.2cm to separate the image
	
\begin{figure}[h] %H stands for here, if we don't use it, the image will appear at the top of the page
\centerign
\includegraphics{width=\textwidth}{Images\mantis_details.png}
\caption{Machine Deails} %Text under the figure, this will say "Figure 1: Machine Details"
\end{figure}
	
If we want to change the caption name, for example to spanish:
\usepackage[figurenmae=Figura]{caption}

If we want to make the image smaller than the text width:
{width=0.8\textwidth}
	
If we want to make the image bigger than the text width:
\makebox[\textwidth]{icludegraphics[width0.9\=paperwidth]{Images\deteccion_servicio.png}}

15. Diagrams

First of all search on google all the different type of diagrams and insert the best for this document.

\usepackage{smartdiagram} %To insert diagrams
	
\begin{figure}[h]
\centering
\smartdiagram[priority descriptive diagram]{
Reconocimiento sobre el sistema,
Deteccion de vulnerabilidades,
Explotación de vulnerabilidades,
Securización del sistema
}
\caption{Flujo de trabajo}
\end{figure}

16. Insert code

https://www.overleaf.com/learn/latex/Code_listing

Ex:

\usepackage{listings}
\usepackage{xcolor}

\definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
\definecolor{backcolour}{rgb}{0.95,0.95,0.92}
	
\lstdefinestyle{mystyle}{
	backgroundcolor=\color{backcolour},
	commentstyle=\color{codegreen},
	keywordstyle=\color{magenta},
	numberstyle=\tiny\color{codegray},
	stringstyle=\color{codepurple},
	basicstyle=\ttfamily\footnotesize,
	breakatwhitespace=false,
	breaklines=true,
	captionpos=b,
	keepspaces=true,
	numbers=left,
	numbersep=5pt,
	showspaces=false,
	showstringspaces=false,
	showtabs=false,
	tabsize=2
}

\begin{listing}[language=Bash, caption=Script personalizado para la enumeración de puertos.]
#!/bin/bash

for port in %seq(1 65535); do
	timeout 1 bash -c "echo > dev/tcp/10.10.10.52/$port" > dev/mull 2>&1 "$port/tcp" &
done; wait
	
\renewcommand{\listingname}{Code} %Change code caption

17. Schemes

\usepackage{zed-csp} %Scheme insertion
	
\begin{schema}{TCP}
Ports
\where
593,1337
\end{schema}

18. Labels

Somewhere we put a label:

\label{fig:servicesResults}

Then we can for example:

Tal y como se aprecia en la figura \ref{fig:servicesResults} de la página \pageref{fig:servicesResults}, es posible identificar que se trata de una máquina con /texbf{Directorio activo} configurado.

Last updated