Skip to content

Commit

Permalink
Add section on port forwarding.
Browse files Browse the repository at this point in the history
  • Loading branch information
mavam committed Apr 9, 2013
1 parent 81a8fdf commit 8d3bb63
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Binary file modified hacksheet.pdf
Binary file not shown.
15 changes: 15 additions & 0 deletions hacksheet.tex
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,21 @@ \subsection*{Date and Time}
\cmd{\windows}{time}
\end{action}

\subsection*{Networking}

\begin{action}{Forward a TCP/UDP port}
\cmd{\unix}{mkfifo f ;\\
nc -l 80 < f | nc 127.0.0.1 6666 > f \&}
\cmd{\linux}{iptables -t nat -A OUTPUT|POSTROUTING \textbackslash\\
-p tcp -s x.x.x.x --sport 80 -j SNAT \textbackslash\\
--to-destination 6666}
\cmd{\linux}{iptables -t nat -A INPUT|PREROUTING \textbackslash\\
-p tcp -d x.x.x.x --dport 80 -j DNAT \textbackslash\\
--to-destination :6666}
% Can we do this with -j REDIRECT as well?
%iptables -A PREROUTING -i eth1 -p tcp -m tcp --dport 80 -j REDIRECT --to-port 8080
\end{action}

\subsection*{Databases}

\begin{action}{Export/Restore a MySQL Database}
Expand Down

0 comments on commit 8d3bb63

Please sign in to comment.