Archive

Archives pour la catégorie ‘Réseau’

Use Fail2Ban to contact the IP provider’s of bruteforce attacks source

20/02/2024 Comments off

source: generationip.asia

Fail2ban is a very useful and powerful solution to limit the bruteforce on your server. but fail2ban doesn’t provide you a way to contact directly the IP provider’s of bruteforce attacks source. I have modify an fail2ban action file’s and create a script for that.

INSTALLATION

Go to the fail2ban action folders :

# cd /etc/fail2ban/action.d

Lire la suite…

Using ssh as a SOCKS proxy on Mac OS X

20/02/2024 Comments off

Introduction

Many times it can be convenient to tunnel your web traffic through a proxy, particularly an encrypted one. This web page shows how to easily tunnel your traffic through an ssh-encrypted proxy on Mac OS X. This allows your traffic to traverse your local network without being visible to snoopers, even when visiting unencrypted sites.

It also allows you to appear to come from a different IP address, allowing you to defeat geolocation schemes. In particular, some credit card processors try to make sure that your credit card billing address is correlated with your IP address, which can be hard on us expatriates. Another example is the free credit report web site which doesn’t seem to work from outside the United States. There are undoubtedly many other practical, legitimate uses for this sort of redirection. Lire la suite…

Fail2ban, POSTFIX and SPAM

18/02/2024 Comments off

source: deribin.com

Very simple solution:
1) add rule to /etc/fail2ban/jail.conf:

[spam]
enabled = true
filter = spam
action = iptables[name=SPAM, port=smtp, protocol=tcp]
sendmail-whois[name=SPAM, [email protected], [email protected]]
logpath = /var/log/mail.log
bantime = 3600
ignoreip = 127.0.0.1 xxx.xxx.xxx.xxx/xx
maxretry = 2

Lire la suite...

Linux Debian – XChat & FiSH plugin : Crypter vos conversations IRC avec Blowfish

18/02/2024 Comments off

source: Yohann's blog

Afin de garder un peu d’intimité sur un salon IRC, vous pouvez crypter vos conversations.

Les personnes n’ayant pas connaissance de la clef de cryptage ne verront que du Braille :

<pseudo> +OK xVUrz/Egtcg1
<pseudo> +OK PuA621ObE81/zK9Fs17LfdN0
<pseudo> +OK zCeES1cO0YQ.hM.fe0dLF1N04KAF01JIvQl0XNS0P1bSPIg.DMg.V16nSSF

En fait, tout ceci est une conversation en français tout à fait compréhensible, du moment ou l’on connait la clef de cryptage, et où tout le monde utilise le même charset.

Je vous explique dans la suite de ce billet, comment compiler le plugin BlowFish pour XChat, sous Linux Debian.

source: http://www.queret.net/blog/post/2007/10/02/102-linux-debian-xchat-fish-plugin-cypter-vos-conversations-irc-avec-blowfish

Afin de garder un peu d’intimité sur un salon IRC, vous pouvez crypter vos conversations.

Les personnes n’ayant pas connaissance de la clef de cryptage ne verront que du brailles :

<pseudo> +OK xVUrz/Egtcg1
<pseudo> +OK PuA621ObE81/zK9Fs17LfdN0
<pseudo> +OK zCeES1cO0YQ.hM.fe0dLF1N04KAF01JIvQl0XNS0P1bSPIg.DMg.V16nSSF

En faite tout ceci est une conversation en français tout à fait compréhensible, du momment ou l’on connais la clef de cryptage, et ou tout le monde utilise le meme charset.

Je vous explique dans la suite de ce billet, comment compiler le plugins BlowFish pour XChat, sous Linux Debian. Lire la suite…

Categories: Logiciel, Réseau Tags:

Rate-limit Incoming Port 22 Connections

17/02/2024 Comments off

Both netfilter and pf provides rate-limit option to perform simple throttling on incoming connections on port # 22.

Iptables Example

The following example will drop incoming connections which make more than 5 connection attempts upon port 22 within 60 seconds:

#!/bin/bash
inet_if=eth1
ssh_port=22
$IPT -I INPUT -p tcp --dport ${ssh_port} -i ${inet_if} -m state --state NEW -m recent  --set
$IPT -I INPUT -p tcp --dport ${ssh_port} -i ${inet_if} -m state --state NEW -m recent  --update --seconds 60 --hitcount 5 -j DROP

Call above script from your iptables scripts. Another config option:

$IPT -A INPUT  -i ${inet_if} -p tcp --dport ${ssh_port} -m state --state NEW -m limit --limit 3/min --limit-burst 3 -j ACCEPT
$IPT -A INPUT  -i ${inet_if} -p tcp --dport ${ssh_port} -m state --state ESTABLISHED -j ACCEPT
$IPT -A OUTPUT -o ${inet_if} -p tcp --sport ${ssh_port} -m state --state ESTABLISHED -j ACCEPT
# another one line example
# $IPT -A INPUT -i ${inet_if} -m state --state NEW,ESTABLISHED,RELATED -p tcp --dport 22 -m limit --limit 5/minute --limit-burst 5-j ACCEPT

See iptables man page for more details.

*BSD PF Example

The following will limits the maximum number of connections per source to 20 and rate limit the number of connections to 15 in a 5 second span. If anyone breaks our rules add them to our abusive_ips table and block them for making any further connections. Finally, flush keyword kills all states created by the matching rule which originate from the host which exceeds these limits.

sshd_server_ip="202.54.1.5"
table <abusive_ips> persist
block in quick from <abusive_ips>
pass in on $ext_if proto tcp to $sshd_server_ip port ssh flags S/SA keep state (max-src-conn 20, max-src-conn-rate 15/5, overload <abusive_ips> flush)