Posts Tagged ‘https’

Zimbra Server Firewall

Posted: August 2, 2015 in Uncategorized
Tags: , , , , , , , , , , ,

Zimbra Firewall using Iptables

Use on your own risk.

#——————————————————— # Cut Here#——————————————————— #

#!/bin/sh
# firewall
# msyamsuri.cm@gmail.com
# description: Starts, stops iptables firewall

case “$1” in
start)

# Clear rules
iptables -t filter -F
iptables -t filter -X
echo – Clear rules : [OK]

# SSH In
iptables -t filter -A INPUT -p tcp –dport 22 -j ACCEPT
echo – SSH : [OK]

# Don’t break established connections
iptables -A INPUT -m state –state RELATED,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -m state –state RELATED,ESTABLISHED -j ACCEPT
echo – established connections : [OK]

# Block all connections by default
iptables -t filter -P INPUT DROP
iptables -t filter -P FORWARD DROP
iptables -t filter -P OUTPUT DROP
echo – Block all connections : [OK]

# SYN-Flood Protection
iptables -N syn-flood
iptables -A syn-flood -m limit –limit 10/second –limit-burst 50 -j RETURN
iptables -A syn-flood -j LOG –log-prefix “SYN FLOOD: ”
iptables -A syn-flood -j DROP
echo – SYN-Flood Protection : [OK]

# Loopback
iptables -t filter -A INPUT -i lo -j ACCEPT
iptables -t filter -A OUTPUT -o lo -j ACCEPT
echo – Loopback : [OK]

# ICMP (Ping)
iptables -t filter -A INPUT -p icmp -j ACCEPT
iptables -t filter -A OUTPUT -p icmp -j ACCEPT
echo – PING : [OK]

# DNS In/Out
iptables -t filter -A OUTPUT -p tcp –dport 53 -j ACCEPT
iptables -t filter -A OUTPUT -p udp –dport 53 -j ACCEPT
iptables -t filter -A INPUT -p tcp –dport 53 -j ACCEPT
iptables -t filter -A INPUT -p udp –dport 53 -j ACCEPT
echo – DNS : [OK]

# NTP Out
iptables -t filter -A OUTPUT -p udp –dport 123 -j ACCEPT
echo – NTP : [OK]

# HTTP + HTTPS Out
iptables -t filter -A OUTPUT -p tcp –dport 80 -j ACCEPT
iptables -t filter -A OUTPUT -p tcp –dport 443 -j ACCEPT
# HTTP + HTTPS In
iptables -t filter -A INPUT -p tcp –dport 80 -j ACCEPT
iptables -t filter -A INPUT -p tcp –dport 443 -j ACCEPT
echo – HTTP/HTTPS : [OK]

# Mail SMTP:25
iptables -t filter -A INPUT -p tcp –dport 25 -j ACCEPT
iptables -t filter -A OUTPUT -p tcp –dport 25 -j ACCEPT
echo – SMTP : [OK]

# Mail POP3:110
iptables -t filter -A INPUT -p tcp –dport 110 -j ACCEPT
iptables -t filter -A OUTPUT -p tcp –dport 110 -j ACCEPT
echo – POP : [OK]

# Mail IMAP:143
iptables -t filter -A INPUT -p tcp –dport 143 -j ACCEPT
iptables -t filter -A OUTPUT -p tcp –dport 143 -j ACCEPT
echo – IMAP : [OK]

# Mail IMAP:443
iptables -t filter -A INPUT -p tcp –dport 443 -j ACCEPT
iptables -t filter -A OUTPUT -p tcp –dport 443 -j ACCEPT
echo – IMAP : [OK]

# Mail IMAPS:993
iptables -t filter -A INPUT -p tcp –dport 993 -j ACCEPT
iptables -t filter -A OUTPUT -p tcp –dport 993 -j ACCEPT
echo – IMAP : [OK]

# Mail POP3S:995
iptables -t filter -A INPUT -p tcp –dport 995 -j ACCEPT
iptables -t filter -A OUTPUT -p tcp –dport 995 -j ACCEPT
echo – IMAP : [OK]

# Mail ZIMBRA ADMIN:7071
iptables -t filter -A INPUT -p tcp –dport 7071 -j ACCEPT
iptables -t filter -A OUTPUT -p tcp –dport 7071 -j ACCEPT
echo – IMAP : [OK]
echo – Firewall [OK]
exit 0
;;

stop)
echo “Stopping Firewall… ”
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -t filter -F
echo “Firewall Stopped!”
exit 0
;;

restart)
/etc/init.d/firewall stop
/etc/init.d/firewall start
;;

*)
echo “Usage: /etc/init.d/firewall {start|stop|restart}”
exit 1
;;
esac

#——————————————————— # Cut Here#——————————————————— #

My Server page

Posted: January 5, 2015 in My live
Tags: , , , , , , , , ,

######################### Cut here #########################

<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”utf-8″>
<meta http-equiv=”X-UA-Compatible” content=”IE=edge”>
<meta name=”viewport” content=”width=device-width, initial-scale=1″>
<title>My Server</title>

<!– Bootstrap –>
<link href=”css/bootstrap.min.css” rel=”stylesheet”>

<!– HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries –>
<!– WARNING: Respond.js doesn’t work if you view the page via file:// –>
<!–[if lt IE 9]>
<script src=”https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js”></script&gt;
<script src=”https://oss.maxcdn.com/respond/1.4.2/respond.min.js”></script&gt;
<![endif]–>
<link href=’http://fonts.googleapis.com/css?family=Bree+Serif&#8217; rel=’stylesheet’ type=’text/css’>
<style>
body {
font-family: ‘Bree Serif’, serif;
font-size: 28px;color: #1b1b1b
}
</style>
</head>
<body style=”background-color:black”>
<div><center><h1>My Server – Testing Purpose Only</h1></center></div>
<!– jQuery (necessary for Bootstrap’s JavaScript plugins) –>
<p>
<center><img src=”img/kali.png” alt=”kali” width=”170″ height=”174″></center>
</p>
<script src=”https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js”></script&gt;
<!– Include all compiled plugins (below), or include individual files as needed –>
<script src=”js/bootstrap.min.js”></script>
</body>
</html>

######################### Cut here #########################

kali