snipt

Ctrl+h for KB shortcuts

Text only

Scan an ip range for a single open port

nmap -p80 192.168.0.0/24 -oG - | grep 80/open
https://snipt.net/embed/0135379cd243a5abea33ff7142d50a9e/
/raw/0135379cd243a5abea33ff7142d50a9e/
0135379cd243a5abea33ff7142d50a9e
text
Text only
1
2019-05-18T22:07:11
True
False
False
/api/public/snipt/45780/
scan-an-ip-range-for-a-single-open-port
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>nmap -p80 192.168.0.0/24 -oG - | grep 80/open </span></pre></div> </td></tr></table>
bash, linux, nmap, portscan

Bash

Block all traffic from a specific IP

iptables -A INPUT -s 123.123.123.123 -j DROP
https://snipt.net/embed/3bc5ab7df9fe3190e9d9cab24da23ce2/
/raw/3bc5ab7df9fe3190e9d9cab24da23ce2/
3bc5ab7df9fe3190e9d9cab24da23ce2
bash
Bash
1
2019-05-15T11:27:58
True
False
False
/api/public/snipt/33800/
block-all-traffic-from-a-specific-ip
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>iptables -A INPUT -s 123.123.123.123 -j DROP </span></pre></div> </td></tr></table>
bash, iptables, server

Bash

Block MySQL port for everyone except localhost and a single IP

1
2
3
iptables -A INPUT -i lo -p tcp --dport mysql -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --dport mysql -s 123.123.123.123 -j ACCEPT
iptables -A INPUT -p tcp --dport mysql -j DROP
https://snipt.net/embed/ece3362f17246adf5af553c7ccaca042/
/raw/ece3362f17246adf5af553c7ccaca042/
ece3362f17246adf5af553c7ccaca042
bash
Bash
3
2019-05-18T16:14:57
True
False
False
/api/public/snipt/33768/
block-mysql-port-for-everyone-except-localhost-and-a-single-ip
<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>iptables -A INPUT -i lo -p tcp --dport mysql -j ACCEPT </span><span id="L-2"><a name="L-2"></a>iptables -A INPUT -i eth0 -p tcp --dport mysql -s 123.123.123.123 -j ACCEPT </span><span id="L-3"><a name="L-3"></a>iptables -A INPUT -p tcp --dport mysql -j DROP </span></pre></div> </td></tr></table>
3306, bash, iptables, mysql, server