snipt

Ctrl+h for KB shortcuts

Bash

fail2ban show banned ips

# display banned ip for ssh service
fail2ban-client status ssh-iptables
https://snippets.siftie.com/embed/2a4593f95017f5a6649ba0c06fb75f3d/
/raw/2a4593f95017f5a6649ba0c06fb75f3d/
2a4593f95017f5a6649ba0c06fb75f3d
bash
Bash
2
2019-04-11T20:33:43
True
False
False
Mar 31, 2015 at 10:20 AM
/api/public/snipt/138797/
fail2ban-show-banned-ips-03e1cae8
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1"># display banned ip for ssh service</span> </span><span id="L-2"><a name="L-2"></a>fail2ban-client status ssh-iptables </span></pre></div> </td></tr></table>
centos, fail2ban, security

Bash

nmap centos

1
2
3
4
5
# Voir tous les ports TCP ouverts sur une machine, utilisation de messages SYN, donc pas de log sur la machine cible :
nmap -F -n -sS 127.0.0.1

# Voir tous les ports UDP ouverts sur une machine :
nmap -sU 127.0.0.1
https://snippets.siftie.com/embed/ae3a46c01b364683dcf3f7e5aef3f3df/
/raw/ae3a46c01b364683dcf3f7e5aef3f3df/
ae3a46c01b364683dcf3f7e5aef3f3df
bash
Bash
5
2019-04-17T14:52:33
True
False
False
/api/public/snipt/138795/
namp-centos-18fbc7fe
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1"># Voir tous les ports TCP ouverts sur une machine, utilisation de messages SYN, donc pas de log sur la machine cible :</span> </span><span id="L-2"><a name="L-2"></a>nmap -F -n -sS 127.0.0.1 </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a><span class="c1"># Voir tous les ports UDP ouverts sur une machine :</span> </span><span id="L-5"><a name="L-5"></a>nmap -sU 127.0.0.1 </span></pre></div> </td></tr></table>
centos, nmap, security

Text only

Secure File Deletion on OS X

1
2
3
On the Mac, just use the menu 〖Finder▸Secure Empty Trash〗.

The command line equivalent is “srm”. Like this: srm -r -s dir_path. The “-r” means all content in the dir, including sub dir. The “-s” means just overwrite once.
https://snippets.siftie.com/embed/b58c84add6d808bc1e140dcada0074e2/
/raw/b58c84add6d808bc1e140dcada0074e2/
b58c84add6d808bc1e140dcada0074e2
text
Text only
4
2019-04-15T21:53:13
True
False
False
Dec 06, 2012 at 06:58 PM
/api/public/snipt/51372/
secure-file-deletion-on-os-x
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>On the Mac, just use the menu 〖Finder▸Secure Empty Trash〗. </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a>The command line equivalent is “srm”. Like this: srm -r -s dir_path. The “-r” means all content in the dir, including sub dir. The “-s” means just overwrite once. </span></pre></div> </td></tr></table>
osx, security

Text only

Prevent External POST or GET requests

1
2
3
4
//check to see if a HTTP_REFERER is set and if it is that it is equal to your website
if( !isset( $_SERVER['HTTP_REFERER']) || !strpos($_SERVER['HTTP_REFERER'],'example.com')) {
	exit;
}
https://snippets.siftie.com/embed/1f4ef70fd3177c7df7fd1f3677fd942f/
/raw/1f4ef70fd3177c7df7fd1f3677fd942f/
1f4ef70fd3177c7df7fd1f3677fd942f
text
Text only
4
2019-04-12T23:35:03
True
False
False
Aug 27, 2012 at 12:45 PM
/api/public/snipt/46343/
prevent-external-post-or-get-requests
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>//check to see if a HTTP_REFERER is set and if it is that it is equal to your website </span><span id="L-2"><a name="L-2"></a>if( !isset( $_SERVER[&#39;HTTP_REFERER&#39;]) || !strpos($_SERVER[&#39;HTTP_REFERER&#39;],&#39;example.com&#39;)) { </span><span id="L-3"><a name="L-3"></a> exit; </span><span id="L-4"><a name="L-4"></a>} </span></pre></div> </td></tr></table>
XSS, ajax, php, security