The time now is Tue 18 Jun 2013, 17:09
All times are UTC - 4 |
| Author |
Message |
postfs1

Joined: 27 Mar 2010 Posts: 831
|
Posted: Sat 19 Nov 2011, 18:29 Post_subject:
"FWBuilder" firewall manager in "Quirky Linux 1.40" ! script Sub_title: Tool to manage firewall. |
|
| Quote: |
Install_FWBuilder--sr0.sh
| Code: |
#!/bin/bash
#
cd /room ;
#
curl -C - -O file:///mnt/sr0/FWBuilder/Fedora-11_files/fwbuilder-5.0.0.3568-1.fc11.i586.rpm ;
if [ ! `echo -e "a6176dd3991d29eb092655c41e9746b3 fwbuilder-5.0.0.3568-1.fc11.i586.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
rpm -i fwbuilder-5.0.0.3568-1.fc11.i586.rpm ;
sleep 0.5s ;
rm /room/fwbuilder-5.0.0.3568-1.fc11.i586.rpm ;
rm /room/.md-5.sm ;
#1
curl -C - -O file:///mnt/sr0/FWBuilder/Fedora-11_files/keyutils-libs-1.2-5.fc11.i586.rpm ;
if [ ! `echo -e "247a0ac4b1c56f542f3496d2eec16349 keyutils-libs-1.2-5.fc11.i586.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
rpm -i keyutils-libs-1.2-5.fc11.i586.rpm ;
sleep 0.5s ;
rm /room/keyutils-libs-1.2-5.fc11.i586.rpm ;
rm /room/.md-5.sm ;
#2
curl -C - -O file:///mnt/sr0/FWBuilder/Fedora-11_files/krb5-libs-1.6.3-31.fc11.i586.rpm ;
if [ ! `echo -e "8f4bec783f5fa9a1ab31438a231cbd7e krb5-libs-1.6.3-31.fc11.i586.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
rpm -i krb5-libs-1.6.3-31.fc11.i586.rpm ;
sleep 0.5s ;
rm /room/krb5-libs-1.6.3-31.fc11.i586.rpm ;
rm /room/.md-5.sm ;
#3
curl -C - -O file:///mnt/sr0/FWBuilder/Fedora-11_files/libstdc++-4.4.1-2.fc11.i586.rpm ;
if [ ! `echo -e "96c934cb092bf073ace9c10cce025f44 libstdc++-4.4.1-2.fc11.i586.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
rpm -i libstdc++-4.4.1-2.fc11.i586.rpm ;
sleep 0.5s ;
rm /room/libstdc++-4.4.1-2.fc11.i586.rpm ;
rm /room/.md-5.sm ;
#4
curl -C - -O file:///mnt/sr0/FWBuilder/Fedora-11_files/net-snmp-libs-5.4.2.1-14.fc11.i586.rpm ;
if [ ! `echo -e "1ca102eafd7974005875331ed32330db net-snmp-libs-5.4.2.1-14.fc11.i586.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
rpm -i net-snmp-libs-5.4.2.1-14.fc11.i586.rpm ;
sleep 0.5s ;
rm /room/net-snmp-libs-5.4.2.1-14.fc11.i586.rpm ;
rm /room/.md-5.sm ;
#5
curl -C - -O file:///mnt/sr0/FWBuilder/Fedora-11_files/openssl-0.9.8n-2.fc11.i686.rpm ;
if [ ! `echo -e "2e7dc70ccf871f43e8d37e602b24687b openssl-0.9.8n-2.fc11.i686.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
rpm -i openssl-0.9.8n-2.fc11.i686.rpm ;
sleep 0.5s ;
rm /room/openssl-0.9.8n-2.fc11.i686.rpm ;
rm /room/.md-5.sm ;
#6
curl -C - -O file:///mnt/sr0/FWBuilder/Fedora-11_files/qt-4.6.2-17.fc11.i586.rpm ;
if [ ! `echo -e "ece4122f0144569432c9bc36f195c49c qt-4.6.2-17.fc11.i586.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
rpm -i qt-4.6.2-17.fc11.i586.rpm ;
sleep 0.5s ;
rm /room/qt-4.6.2-17.fc11.i586.rpm ;
rm /room/.md-5.sm ;
#7
curl -C - -O file:///mnt/sr0/FWBuilder/Fedora-11_files/qt-x11-4.6.2-17.fc11.i586.rpm ;
if [ ! `echo -e "4270840a05873869b00a9d42c1ad703b qt-x11-4.6.2-17.fc11.i586.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
rpm -i qt-x11-4.6.2-17.fc11.i586.rpm ;
sleep 0.5s ;
rm /room/qt-x11-4.6.2-17.fc11.i586.rpm ;
rm /room/.md-5.sm ;
#8
curl -C - -O file:///mnt/sr0/FWBuilder/Fedora-11_files/libselinux-2.0.80-1.fc11.i586.rpm ;
if [ ! `echo -e "a33dd8be6e63530f3babeec2e3c03019 libselinux-2.0.80-1.fc11.i586.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
rpm -i libselinux-2.0.80-1.fc11.i586.rpm ;
sleep 0.5s ;
rm /room/libselinux-2.0.80-1.fc11.i586.rpm ;
rm /room/.md-5.sm ;
#9
#
# # #
#
#Sensors. >>>
curl -C - -O file:///mnt/sr0/FWBuilder/Fedora-11_files/lm_sensors-3.1.0-1.fc11.i586.rpm ;
if [ ! `echo -e "1b525876a63e0e1b44dec0f12b8a1493 lm_sensors-3.1.0-1.fc11.i586.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
rpm -i lm_sensors-3.1.0-1.fc11.i586.rpm ;
sleep 0.5s ;
rm /room/lm_sensors-3.1.0-1.fc11.i586.rpm ;
rm /room/.md-5.sm ;
#1
#
rm /usr/bin/perlthanks /usr/bin/perlivp /usr/bin/perldoc ;
rm /usr/bin/perl /usr/bin/perlbug /usr/bin/perl5.10.1 ;
rm -r /usr/lib/perl5 ;
#
curl -C - -O file:///mnt/sr0/FWBuilder/Fedora-11_files/perl-5.10.0-82.fc11.i586.rpm ;
if [ ! `echo -e "175f93681b9bd4a69e7ee1d082f37b92 perl-5.10.0-82.fc11.i586.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
rpm -i perl-5.10.0-82.fc11.i586.rpm ;
sleep 0.5s ;
rm /room/perl-5.10.0-82.fc11.i586.rpm ;
rm /room/.md-5.sm ;
#2
curl -C - -O file:///mnt/sr0/FWBuilder/Fedora-11_files/perl-libs-5.10.0-82.fc11.i586.rpm ;
if [ ! `echo -e "1ac4c25aeea0c6793066147db5e06a04 perl-libs-5.10.0-82.fc11.i586.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
rpm -i perl-libs-5.10.0-82.fc11.i586.rpm ;
sleep 0.5s ;
rm /room/perl-libs-5.10.0-82.fc11.i586.rpm ;
rm /room/.md-5.sm ;
#3
#
# # #
#
cat /etc/init.d/lm_sensors | \
sed -e 's|. /etc/init.d/functions|. /etc/rc.d/functions|' > /etc/init.d/lm_sensors ;
yes | sensors-detect ;
/etc/init.d/lm_sensors start 2>/dev/null | xmessage `cat` ;
#
#<<< Sensors.
#
# # #
#
#For on-line lesson >>>
#
#http://www.youtube.com/v/Q5GPrkwyGxw&hl=en_US&feature=player_embedded&version=3
#http://www.youtube.com/watch?v=Q5GPrkwyGxw&hl=en_US&feature=player_embedded&version=3
#
if [ -f /usr/bin/icecat-3.6.16-i686/icecat ] ; then
ln -s -f /usr/bin/icecat-3.6.16-i686/icecat /usr/bin/firefox ;
elif [ -f /usr/local/bin/icecat-3.6.16-i686/icecat ] ; then
ln -s -f /usr/local/bin/icecat-3.6.16-i686/icecat /usr/bin/firefox ;
else echo -e "If there is no web-browser in the system then\n the watching of tutorial videos is unavailable." | xmessage -file - ;
fi ;
# <<<
#
# # #
#
#
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#http://www.fwbuilder.org/4.0/docs/users_guide/install_with_regular_user.html = Copyrighted content.
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# # #
#
#http://sourceforge.net/projects/fwbuilder/forums/forum/16372/topic/3900942
#
# # #
#
#"Firewall Builder"://Edit/Preferences/Installer >>>
#/usr/local/bin/.cfb = scp
#/usr/local/bin/.afb = instead of ssh
#<<<
#
# # #
#
ln -s /usr/sbin/iptables /sbin/iptables ;
ln -s /bin/ip /sbin/ip ;
#
mkdir -m 0700 -p /var/lib/.fb ;
mkdir -m 0700 -p /etc/fw ;
echo '#!/bin/bash' > /usr/local/bin/.cfb ;
echo "cp /var/lib/.fb/fb.fw /etc/fw" >> /usr/local/bin/.cfb ;
chmod 0700 /usr/local/bin/.cfb ;
#
echo '#!/bin/bash' > /usr/local/bin/.afb ;
echo "sh /etc/fw/fb.fw start" >> /usr/local/bin/.afb ;
chmod 0700 /usr/local/bin/.afb ;
#
# # #
#
cd /var/lib/.fb/ ;
curl -C - -O file:///mnt/sr0/FWBuilder/Packed_Files/fb.fwb.gz ;
if [ ! `echo -e "1a82d3d38959e9881ec08520cfcae0bc fb.fwb.gz" | md5sum -c - >/var/lib/.fb/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /var/lib/.fb/.md-5.sm` ] ; then xmessage -file /var/lib/.fb/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /var/lib/.fb/.md-5.sm`" ; fi ;
gunzip -d fb.fwb.gz ;
sleep 0.5s ;
rm /var/lib/.fb/.md-5.sm ;
cd /room ;
#1
#
# # #
#
rm /usr/share/applications/fwbuilder.desktop ;
#
sed -i".tmp" '/"FWBuild"/d' /root/Choices/ROX-Filer/PuppyPin ;
#
echo '[Desktop Entry]' > /usr/share/applications/FWBldr.desktop ;
echo 'Name=Firewall Builder' >> /usr/share/applications/FWBldr.desktop ;
echo 'Comment=Design and Manage Firewall Rules' >> /usr/share/applications/FWBldr.desktop ;
echo 'Icon=/usr/share/icons/hicolor/48x48/apps/fwbuilder.png' >> /usr/share/applications/FWBldr.desktop ;
echo 'Categories=Network;' >> /usr/share/applications/FWBldr.desktop ;
#
#Don't touch this >>>
#Exec=bash -c 'bash -c "`Xdialog --title \"FWBuilder\" --no-tags --radiolist \"\" 15 38 10 \"fwbuilder\" \"-=FWBuilder=-\" off \"cd /var/lib/.fb/ ; curl -C - -O file:///mnt/sr0/FWBuilder/Packed_Files/fb.fwb.gz ; gunzip -f -d fb.fwb.gz\" \"-=To RECEIVE file with settings=-\" off \"rm /var/lib/.fb/fb.fwb /var/lib/.fb/fb.fw /etc/fw/fb.fw\" \"-=To DELETE files with settings=-\" off \"echo -e \"'\''\"\`dmesg|grep DENY|tail -10|cut --delimiter=" " -f4-6,8-9,15-18\`\"'\''\"|xmessage -file -\" \"-=Blocked Packets=-\" on 2>&1`"'
grep '\-\-radiolist' /mnt/sr0/FWBuilder/Install_FWBuilder--sr0.sh | grep -v "Install_FWBuilder--sr0.sh" | sed 's/#//' >> /usr/share/applications/FWBldr.desktop ;
# <<<
#
echo 'Type=Application' >> /usr/share/applications/FWBldr.desktop ;
echo 'StartupNotify=true' >> /usr/share/applications/FWBldr.desktop ;
echo 'Terminal=false' >> /usr/share/applications/FWBldr.desktop ;
#ok...
sed -i".tmp" '/\/pinboard/d' /root/Choices/ROX-Filer/PuppyPin ;
sleep 1s ;
echo '<icon x="224" y="284" label="FWBuild">/usr/share/applications/FWBldr.desktop</icon>' >> /root/Choices/ROX-Filer/PuppyPin ;
echo '</pinboard>' >> /root/Choices/ROX-Filer/PuppyPin ;
sleep 1s ;
#
# # #
#
rox -p=/root/Choices/ROX-Filer/PuppyPin ;
fixmenus ;
echo -e "Application -=FWBuilder=- has been installed." | xmessage -file - `jwm -restart`
|
Edit: 2012, apr 18.
|
---------------------------------------------------------------------------------------
|-<>-|-<>-|-<>-|-<>-|-<>-|-<>-|-<>-|-<>-|-<>-|-<>-|-<>-|-<>-|-<>-|-<>-|-<>-|-<>-|
---------------------------------------------------------------------------------------
| Quote: |
Install_Firewall-Rules--sr0.sh
| Code: |
#!/bin/bash
#
#Before use of this file ACTIVATE network card, please.
#
# # #
#
#This is the result of use of the "FWBuilder" program.
#
#What is allowed: "http" and "https"
#
# # #
#
#To see current firewall rules >>>
#iptables -L -n
# <<<
#
ln -s -f /usr/sbin/iptables /sbin/iptables ;
ln -s -f /bin/ip /sbin/ip ;
#
# # #
#
mkdir -p /etc/fw ;
cd /etc/fw/ ;
#
curl -C - -O file:///mnt/sr0/FWBuilder/Result_of_FWBuilder/fb.fw.gz ;
if [ ! `echo -e "f10efa4c073afb6e53d1f44972d5b242 fb.fw.gz" | md5sum -c - >/etc/fw/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /etc/fw/.md-5.sm` ] ; then xmessage -file /etc/fw/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /etc/fw/.md-5.sm`" ; fi ;
gunzip -d fb.fw.gz ;
sleep 0.5s ;
rm /etc/fw/.md-5.sm ;
#1
sh /etc/fw/fb.fw | xmessage -file - ;
sleep 0.5s ;
rm /etc/fw/fb.fw ;
#
# # #
#
echo '[Desktop Entry]' > /usr/share/applications/FWRslt.desktop ;
echo 'Name=Firewall Builder - Result' >> /usr/share/applications/FWRslt.desktop ;
echo 'Comment=See the result of current firewall rules' >> /usr/share/applications/FWRslt.desktop ;
echo 'Icon=/usr/local/lib/X11/themes/Smooth-Color/clipboard48.png' >> /usr/share/applications/FWRslt.desktop ;
echo 'Categories=Network;' >> /usr/share/applications/FWRslt.desktop ;
#
#Don't touch this >>>
#Exec=bash -c 'bash -c "`Xdialog --title \"FWBuilder - Results\" --no-tags --radiolist \"\" 10 30 10 \"echo -e \"'\''\"\`dmesg|grep DENY|tail -10|cut --delimiter=" " -f4-6,8-9,15-18\`\"'\''\"|xmessage -file -\" \"-=Blocked Packets=-\" on 2>&1`"'
grep '\-\-radiolist' /mnt/sr0/FWBuilder/Install_Firewall-Rules--sr0.sh | grep -v "Install_Firewall-Rules--sr0.sh" | sed 's/#//' >> /usr/share/applications/FWRslt.desktop ;
# <<<
#
echo 'Type=Application' >> /usr/share/applications/FWRslt.desktop ;
echo 'StartupNotify=true' >> /usr/share/applications/FWRslt.desktop ;
echo 'Terminal=false' >> /usr/share/applications/FWRslt.desktop ;
#
# # #
#
rox -p=/root/Choices/ROX-Filer/PuppyPin ;
fixmenus ;
echo -e "-=Firewall Rules=- program has been executed." | xmessage -file - `jwm -restart`
|
fb.fw http://www.murga-linux.com/puppy/viewtopic.php?p=641967#641967
Edit: 2011, nov 19.
|
A script's content can be copied into text editor by means of <Quote> mode.
_________________
- I don't know why laboratories are named a hospitals.
- The alive personage is like a tea bag with granules of unknown density inside, at that one the packet was made of organic material and was placed in the evaporated liquid or liquid.
Edited_time_total
|
|
Back to top
|
|
 |
postfs1

Joined: 27 Mar 2010 Posts: 831
|
Posted: Sat 21 Jul 2012, 16:31 Post_subject:
|
|
| Quote: |
fb.fw
| Code: |
#!/bin/sh
#
# This is automatically generated file. DO NOT MODIFY !
#
# Firewall Builder fwb_ipt v5.0.0.3568
#
# Generated Thu Sep 1 11:25:25 2011 GMT by root
#
# files: * fb.fw /etc/fb.fw
#
# Compiled for iptables (any version)
#
# This is an example of a firewall protecting a host ( a server or a workstation). Only SSH access to the host is permitted. Host has dynamic address.
FWBDEBUG=""
PATH="/sbin:/usr/sbin:/bin:/usr/bin:${PATH}"
export PATH
LSMOD="/sbin/lsmod"
MODPROBE="/sbin/modprobe"
IPTABLES="/sbin/iptables"
IP6TABLES="/sbin/ip6tables"
IPTABLES_RESTORE="/sbin/iptables-restore"
IP6TABLES_RESTORE="/sbin/ip6tables-restore"
IP="/sbin/ip"
IFCONFIG="/sbin/ifconfig"
VCONFIG="/sbin/vconfig"
BRCTL="/sbin/brctl"
IFENSLAVE="/sbin/ifenslave"
IPSET="/usr/sbin/ipset"
LOGGER="/usr/bin/logger"
log() {
echo "$1"
command -v "$LOGGER" >/dev/null 2>&1 && $LOGGER -p info "$1"
}
getInterfaceVarName() {
echo $1 | sed 's/\./_/'
}
getaddr_internal() {
dev=$1
name=$2
af=$3
L=$($IP $af addr show dev $dev | sed -n '/inet/{s!.*inet6* !!;s!/.*!!p}' | sed 's/peer.*//')
test -z "$L" && {
eval "$name=''"
return
}
eval "${name}_list=\"$L\""
}
getnet_internal() {
dev=$1
name=$2
af=$3
L=$($IP route list proto kernel | grep $dev | grep -v default | sed 's! .*$!!')
test -z "$L" && {
eval "$name=''"
return
}
eval "${name}_list=\"$L\""
}
getaddr() {
getaddr_internal $1 $2 "-4"
}
getaddr6() {
getaddr_internal $1 $2 "-6"
}
getnet() {
getnet_internal $1 $2 "-4"
}
getnet6() {
getnet_internal $1 $2 "-6"
}
# function getinterfaces is used to process wildcard interfaces
getinterfaces() {
NAME=$1
$IP link show | grep ": $NAME" | while read L; do
OIFS=$IFS
IFS=" :"
set $L
IFS=$OIFS
echo $2
done
}
diff_intf() {
func=$1
list1=$2
list2=$3
cmd=$4
for intf in $list1
do
echo $list2 | grep -q $intf || {
# $vlan is absent in list 2
$func $intf $cmd
}
done
}
find_program() {
PGM=$1
command -v $PGM >/dev/null 2>&1 || {
echo "$PGM not found"
exit 1
}
}
check_tools() {
find_program $IPTABLES
find_program $MODPROBE
find_program $IP
}
reset_iptables_v4() {
$IPTABLES -P OUTPUT DROP
$IPTABLES -P INPUT DROP
$IPTABLES -P FORWARD DROP
cat /proc/net/ip_tables_names | while read table; do
$IPTABLES -t $table -L -n | while read c chain rest; do
if test "X$c" = "XChain" ; then
$IPTABLES -t $table -F $chain
fi
done
$IPTABLES -t $table -X
done
}
reset_iptables_v6() {
$IP6TABLES -P OUTPUT DROP
$IP6TABLES -P INPUT DROP
$IP6TABLES -P FORWARD DROP
cat /proc/net/ip6_tables_names | while read table; do
$IP6TABLES -t $table -L -n | while read c chain rest; do
if test "X$c" = "XChain" ; then
$IP6TABLES -t $table -F $chain
fi
done
$IP6TABLES -t $table -X
done
}
P2P_INTERFACE_WARNING=""
missing_address() {
address=$1
cmd=$2
oldIFS=$IFS
IFS="@"
set $address
addr=$1
interface=$2
IFS=$oldIFS
$IP addr show dev $interface | grep -q POINTOPOINT && {
test -z "$P2P_INTERFACE_WARNING" && echo "Warning: Can not update address of interface $interface. fwbuilder can not manage addresses of point-to-point interfaces yet"
P2P_INTERFACE_WARNING="yes"
return
}
test "$cmd" = "add" && {
echo "# Adding ip address: $interface $addr"
echo $addr | grep -q ':' && {
$FWBDEBUG $IP addr $cmd $addr dev $interface
} || {
$FWBDEBUG $IP addr $cmd $addr broadcast + dev $interface
}
}
test "$cmd" = "del" && {
echo "# Removing ip address: $interface $addr"
$FWBDEBUG $IP addr $cmd $addr dev $interface || exit 1
}
$FWBDEBUG $IP link set $interface up
}
list_addresses_by_scope() {
interface=$1
scope=$2
ignore_list=$3
$IP addr ls dev $interface | \
awk -v IGNORED="$ignore_list" -v SCOPE="$scope" \
'BEGIN {
split(IGNORED,ignored_arr);
for (a in ignored_arr) {ignored_dict[ignored_arr[a]]=1;}
}
(/inet |inet6 / && $0 ~ SCOPE && !($2 in ignored_dict)) {print $2;}' | \
while read addr; do
echo "${addr}@$interface"
done | sort
}
update_addresses_of_interface() {
ignore_list=$2
set $1
interface=$1
shift
FWB_ADDRS=$(
for addr in $*; do
echo "${addr}@$interface"
done | sort
)
CURRENT_ADDRS_ALL_SCOPES=""
CURRENT_ADDRS_GLOBAL_SCOPE=""
$IP link show dev $interface >/dev/null 2>&1 && {
CURRENT_ADDRS_ALL_SCOPES=$(list_addresses_by_scope $interface 'scope .*' "$ignore_list")
CURRENT_ADDRS_GLOBAL_SCOPE=$(list_addresses_by_scope $interface 'scope global' "$ignore_list")
} || {
echo "# Interface $interface does not exist"
# Stop the script if we are not in test mode
test -z "$FWBDEBUG" && exit 1
}
diff_intf missing_address "$FWB_ADDRS" "$CURRENT_ADDRS_ALL_SCOPES" add
diff_intf missing_address "$CURRENT_ADDRS_GLOBAL_SCOPE" "$FWB_ADDRS" del
}
clear_addresses_except_known_interfaces() {
$IP link show | sed 's/://g' | awk -v IGNORED="$*" \
'BEGIN {
split(IGNORED,ignored_arr);
for (a in ignored_arr) {ignored_dict[ignored_arr[a]]=1;}
}
(/state/ && !($2 in ignored_dict)) {print $2;}' | \
while read intf; do
echo "# Removing addresses not configured in fwbuilder from interface $intf"
$FWBDEBUG $IP addr flush dev $intf scope global
$FWBDEBUG $IP link set $intf down
done
}
check_file() {
test -r "$2" || {
echo "Can not find file $2 referenced by address table object $1"
exit 1
}
}
check_run_time_address_table_files() {
:
}
load_modules() {
:
OPTS=$1
MODULES_DIR="/lib/modules/`uname -r`/kernel/net/"
MODULES=$(find $MODULES_DIR -name '*conntrack*' \! -name '*ipv6*'|sed -e 's/^.*\///' -e 's/\([^\.]\)\..*/\1/')
echo $OPTS | grep -q nat && {
MODULES="$MODULES $(find $MODULES_DIR -name '*nat*'|sed -e 's/^.*\///' -e 's/\([^\.]\)\..*/\1/')"
}
echo $OPTS | grep -q ipv6 && {
MODULES="$MODULES $(find $MODULES_DIR -name nf_conntrack_ipv6|sed -e 's/^.*\///' -e 's/\([^\.]\)\..*/\1/')"
}
for module in $MODULES; do
if $LSMOD | grep ${module} >/dev/null; then continue; fi
$MODPROBE ${module} || exit 1
done
}
verify_interfaces() {
:
echo "Verifying interfaces: eth0 lo"
for i in eth0 lo ; do
$IP link show "$i" > /dev/null 2>&1 || {
log "Interface $i does not exist"
exit 1
}
done
}
prolog_commands() {
echo "Running prolog script"
}
epilog_commands() {
echo "Running epilog script"
}
run_epilog_and_exit() {
epilog_commands
exit $1
}
configure_interfaces() {
:
# Configure interfaces
update_addresses_of_interface "eth0 55.105.105.55/45" ""
update_addresses_of_interface "lo 127.0.0.1/8" ""
}
script_body() {
# ================ IPv4
# ================ Table 'filter', automatic rules
# accept established sessions
$IPTABLES -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
# ================ Table 'filter', rule set Policy
#
# Rule 0 (eth0)
#
echo "Rule 0 (eth0)"
#
# anti spoofing rule
$IPTABLES -N In_RULE_0
$IPTABLES -A INPUT -i eth0 -s 55.105.105.55 -m state --state NEW -j In_RULE_0
$IPTABLES -A FORWARD -i eth0 -s 55.105.105.55 -m state --state NEW -j In_RULE_0
$IPTABLES -A In_RULE_0 -j LOG --log-level notice --log-prefix "RULE 0 -- DENY "
$IPTABLES -A In_RULE_0 -j DROP
#
# Rule 1 (lo)
#
echo "Rule 1 (lo)"
#
$IPTABLES -A INPUT -i lo -m state --state NEW -j ACCEPT
$IPTABLES -A OUTPUT -o lo -m state --state NEW -j ACCEPT
#
# Rule 2 (global)
#
echo "Rule 2 (global)"
#
# useful ICMP
# types; ping request
$IPTABLES -N Cid4148X4848.0
$IPTABLES -A OUTPUT -d 55.105.105.55 -j Cid4148X4848.0
$IPTABLES -N RULE_2
$IPTABLES -A Cid4148X4848.0 -p icmp -m icmp --icmp-type 3 -j RULE_2
$IPTABLES -A Cid4148X4848.0 -p icmp -m icmp --icmp-type 0/0 -j RULE_2
$IPTABLES -A Cid4148X4848.0 -p icmp -m icmp --icmp-type 8/0 -j RULE_2
$IPTABLES -A Cid4148X4848.0 -p icmp -m icmp --icmp-type 11/0 -j RULE_2
$IPTABLES -A Cid4148X4848.0 -p icmp -m icmp --icmp-type 11/1 -j RULE_2
$IPTABLES -A INPUT -p icmp -m icmp --icmp-type 3 -j RULE_2
$IPTABLES -A INPUT -p icmp -m icmp --icmp-type 0/0 -j RULE_2
$IPTABLES -A INPUT -p icmp -m icmp --icmp-type 8/0 -j RULE_2
$IPTABLES -A INPUT -p icmp -m icmp --icmp-type 11/0 -j RULE_2
$IPTABLES -A INPUT -p icmp -m icmp --icmp-type 11/1 -j RULE_2
$IPTABLES -A RULE_2 -j LOG --log-level notice --log-prefix "RULE 2 -- DENY "
$IPTABLES -A RULE_2 -j DROP
#
# Rule 3 (eth0)
#
echo "Rule 3 (eth0)"
#
# $IPTABLES -A OUTPUT -o eth0 -p tcp -m tcp --sport 1024:65535 --dport 1024:65535 -m state --state NEW -j ACCEPT
$IPTABLES -A OUTPUT -o eth0 -p tcp -m tcp --sport 1024:65535 --dport 80 -m state --state NEW -j ACCEPT
$IPTABLES -A OUTPUT -o eth0 -p tcp -m tcp --sport 1024:65535 --dport 53 -m state --state NEW -j ACCEPT
$IPTABLES -A OUTPUT -o eth0 -p tcp -m tcp --sport 1024:65535 --dport 443 -m state --state NEW -j ACCEPT
# $IPTABLES -A OUTPUT -o eth0 -p udp -m udp --sport 1024:65535 --dport 1024:65535 -m state --state NEW -j ACCEPT
$IPTABLES -A OUTPUT -o eth0 -p udp -m udp --sport 1024:65535 --dport 80 -m state --state NEW -j ACCEPT
$IPTABLES -A OUTPUT -o eth0 -p udp -m udp --sport 1024:65535 --dport 53 -m state --state NEW -j ACCEPT
$IPTABLES -A OUTPUT -o eth0 -p udp -m udp --sport 1024:65535 --dport 443 -m state --state NEW -j ACCEPT
#
# Rule 4 (global)
#
echo "Rule 4 (global)"
#
$IPTABLES -N RULE_4
$IPTABLES -A OUTPUT -m state --state NEW -j RULE_4
$IPTABLES -A INPUT -m state --state NEW -j RULE_4
$IPTABLES -A FORWARD -m state --state NEW -j RULE_4
$IPTABLES -A RULE_4 -j LOG --log-level notice --log-prefix "RULE 4 -- DENY "
$IPTABLES -A RULE_4 -j DROP
}
ip_forward() {
:
echo 1 > /proc/sys/net/ipv4/ip_forward
}
reset_all() {
:
reset_iptables_v4
}
block_action() {
reset_all
}
stop_action() {
reset_all
$IPTABLES -P OUTPUT ACCEPT
$IPTABLES -P INPUT ACCEPT
$IPTABLES -P FORWARD ACCEPT
}
check_iptables() {
IP_TABLES="$1"
[ ! -e $IP_TABLES ] && return 151
NF_TABLES=$(cat $IP_TABLES 2>/dev/null)
[ -z "$NF_TABLES" ] && return 152
return 0
}
status_action() {
check_iptables "/proc/net/ip_tables_names"
ret_ipv4=$?
check_iptables "/proc/net/ip6_tables_names"
ret_ipv6=$?
[ $ret_ipv4 -eq 0 -o $ret_ipv6 -eq 0 ] && return 0
[ $ret_ipv4 -eq 151 -o $ret_ipv6 -eq 151 ] && {
echo "iptables modules are not loaded"
}
[ $ret_ipv4 -eq 152 -o $ret_ipv6 -eq 152 ] && {
echo "Firewall is not configured"
}
exit 3
}
# See how we were called.
# For backwards compatibility missing argument is equivalent to 'start'
cmd=$1
test -z "$cmd" && {
cmd="start"
}
case "$cmd" in
start)
log "Activating firewall script generated Thu Sep 1 11:25:25 2011 by root"
check_tools
prolog_commands
check_run_time_address_table_files
load_modules " "
configure_interfaces
verify_interfaces
reset_all
script_body
ip_forward
epilog_commands
RETVAL=$?
;;
stop)
stop_action
RETVAL=$?
;;
status)
status_action
RETVAL=$?
;;
block)
block_action
RETVAL=$?
;;
reload)
$0 stop
$0 start
RETVAL=$?
;;
interfaces)
configure_interfaces
RETVAL=$?
;;
test_interfaces)
FWBDEBUG="echo"
configure_interfaces
RETVAL=$?
;;
*)
echo "Usage $0 [start|stop|status|block|reload|interfaces|test_interfaces]"
;;
esac
exit $RETVAL
|
Edit: 2012, jul 22.
|
A script's content can be copied into text editor by means of <Quote> mode.
_________________
- I don't know why laboratories are named a hospitals.
- The alive personage is like a tea bag with granules of unknown density inside, at that one the packet was made of organic material and was placed in the evaporated liquid or liquid.
Edited_time_total
|
|
Back to top
|
|
 |
postfs1

Joined: 27 Mar 2010 Posts: 831
|
Posted: Sun 22 Jul 2012, 13:58 Post_subject:
|
|
| Quote: |
AdditionTo--Install_Firewall-Rules--sr0.sh
| Code: |
#!/bin/bash
#
#SRC: http://ubuntuforums.org/showthread.php?t=1188099
#SRC: https://www.honeynet.org/node/691
#
#Not available as built-in in -=Quirky Linux - 1.40=- ===>
#http://dekne.wordpress.com/2009/05/24/configuring-layer7-iptables-1-4-3-2-on-slackware-12-kernel-2-6-21/
#iptables -A FORWARD -m layer7 –l7proto msnmessenger -j DROP
#<=== Not available as built-in in -=Quirky Linux - 1.40=-
#
#!
#iptables -m owner --help
#!
#
#iptables -v –L #Statistics of traffic
#
#iptables -L -n # = iptables -t filter -L -n #filter table
#
#iptables -t nat -L -n #nat table
#
#
# # #
#
#history -c >/root/.history ; printf '\ec'
#
# # # - - - - - - - - - - - - - - - - Rule 21 - - - - - - - - - - - - - - - - -
#
echo "Rule 21 (global)"
iptables -N RULE_21
iptables -I OUTPUT ! -o lo -m owner --gid-owner root -j RULE_21
iptables -I OUTPUT -o lo -m owner --gid-owner root ! -d 127.0.0.1/255.0.0.0 -j RULE_21
iptables -I RULE_21 -j LOG --log-level notice --log-prefix "RULE 21 -- DENY "
iptables -I RULE_21 -j DROP
# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . first_variants >>
# # #iptables -I OUTPUT 1 -m owner --gid-owner root -j LOG ;
# # #iptables -I OUTPUT 1 -m owner --gid-owner root ! -d 127.0.0.1/255.0.0.0 -j DROP
# # # # #iptables -I OUTPUT 1 -m owner --gid-owner root -j DROP ;
# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . << first_variants
#
# # #
#
#! To delete the RULES ===> !
# echo "Rule 21 (global)"
# iptables -D OUTPUT ! -o lo -m owner --gid-owner root -j RULE_21
# iptables -D OUTPUT -o lo -m owner --gid-owner root ! -d 127.0.0.1/255.0.0.0 -j RULE_21
# iptables -D RULE_21 -j LOG --log-level notice --log-prefix "RULE 21 -- DENY "
# iptables -D RULE_21 -j DROP
# iptables -X RULE_21
#! <=== To delete the RULES !
# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . first_variants >>
# # #iptables -D OUTPUT -m owner --gid-owner root ! -d 127.0.0.1/255.0.0.0 -j DROP # <--- To delete the RULE
# # #iptables -D OUTPUT -m owner --gid-owner root -j LOG # <--- To delete the RULE
# # #
# # # # #iptables -D OUTPUT -m owner --gid-owner root -j DROP # <--- To delete the RULE
# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . << first_variants
#
# # # - - - - - - - - - - - - - - - - Rule 21 - - - - - - - - - - - - - - - - -
#
#
# # # - - - - - - - - - - - - - - - - Rule 22 - - - - - - - - - - - - - - - - -
#
echo "Rule 22 (global)"
iptables -N RULE_22
iptables -I OUTPUT ! -o lo -m owner --gid-owner nobody -j RULE_22
iptables -I OUTPUT -o lo -m owner --gid-owner nobody ! -d 127.0.0.1/255.0.0.0 -j RULE_22
iptables -I RULE_22 -j LOG --log-level notice --log-prefix "RULE 22 -- DENY "
iptables -I RULE_22 -j DROP
#
# # #
#
#! To delete the RULES ===> !
# echo "Rule 22 (global)"
# iptables -D OUTPUT ! -o lo -m owner --gid-owner nobody -j RULE_22
# iptables -D OUTPUT -o lo -m owner --gid-owner nobody ! -d 127.0.0.1/255.0.0.0 -j RULE_22
# iptables -D RULE_22 -j LOG --log-level notice --log-prefix "RULE 22 -- DENY "
# iptables -D RULE_22 -j DROP
# iptables -X RULE_22
#! <=== To delete the RULES !
#
# # # - - - - - - - - - - - - - - - - Rule 22 - - - - - - - - - - - - - - - - -
#
#
# # # - - - - - - - - - - - - - - - - Rule 23 - - - - - - - - - - - - - - - - -
#
echo "Rule 23 (global)"
iptables -N RULE_23
iptables -I OUTPUT ! -o lo -m owner --gid-owner daemon -j RULE_23
iptables -I OUTPUT -o lo -m owner --gid-owner daemon ! -d 127.0.0.1/255.0.0.0 -j RULE_23
iptables -I RULE_23 -j LOG --log-level notice --log-prefix "RULE 23 -- DENY "
iptables -I RULE_23 -j DROP
#
# # #
#
#! To delete the RULES ===> !
# echo "Rule 23 (global)"
# iptables -D OUTPUT ! -o lo -m owner --gid-owner daemon -j RULE_23
# iptables -D OUTPUT -o lo -m owner --gid-owner daemon ! -d 127.0.0.1/255.0.0.0 -j RULE_23
# iptables -D RULE_23 -j LOG --log-level notice --log-prefix "RULE 23 -- DENY "
# iptables -D RULE_23 -j DROP
# iptables -X RULE_23
#! <=== To delete the RULES !
#
# # # - - - - - - - - - - - - - - - - Rule 23 - - - - - - - - - - - - - - - - -
#
#
# # # - - - - - - - - - - - - - - - - Rule 24 - - - - - - - - - - - - - - - - -
#
echo "Rule 24 (global)"
iptables -N RULE_24
iptables -I OUTPUT ! -o lo -m owner --gid-owner bin -j RULE_24
iptables -I OUTPUT -o lo -m owner --gid-owner bin ! -d 127.0.0.1/255.0.0.0 -j RULE_24
iptables -I RULE_24 -j LOG --log-level notice --log-prefix "Rule 24 -- DENY "
iptables -I RULE_24 -j DROP
#
# # #
#
#! To delete the RULES ===> !
# echo "Rule 24 (global)"
# iptables -D OUTPUT ! -o lo -m owner --gid-owner bin -j RULE_24
# iptables -D OUTPUT -o lo -m owner --gid-owner bin ! -d 127.0.0.1/255.0.0.0 -j RULE_24
# iptables -D RULE_24 -j LOG --log-level notice --log-prefix "Rule 24 -- DENY "
# iptables -D RULE_24 -j DROP
# iptables -X RULE_24
#! <=== To delete the RULES !
#
# # # - - - - - - - - - - - - - - - - Rule 24 - - - - - - - - - - - - - - - - -
#
#
# # # - - - - - - - - - - - - - - - - Rule 25 - - - - - - - - - - - - - - - - -
#
echo "Rule 25 (global)"
iptables -N RULE_25
iptables -I OUTPUT ! -o eth0 -m owner --gid-owner spot -j RULE_25
iptables -I OUTPUT ! -o eth0 -m owner --gid-owner spot -d 55.105.105.55 -j RULE_25
iptables -I OUTPUT -o lo -m owner --gid-owner spot -j RULE_25
iptables -I RULE_25 -j LOG --log-level notice --log-prefix "Rule 25 -- DENY "
iptables -I RULE_25 -j DROP
#
# # #
#
#! To delete the RULES ===> !
# echo "Rule 25 (global)"
# iptables -D OUTPUT ! -o eth0 -m owner --gid-owner spot -j RULE_25
# iptables -D OUTPUT ! -o eth0 -m owner --gid-owner spot -d 55.105.105.55 -j RULE_25
# iptables -D OUTPUT -o lo -m owner --gid-owner spot -j RULE_25
# iptables -D RULE_25 -j LOG --log-level notice --log-prefix "Rule 25 -- DENY "
# iptables -D RULE_25 -j DROP
# iptables -X RULE_25
#! <=== To delete the RULES !
#
# # # - - - - - - - - - - - - - - - - Rule 25 - - - - - - - - - - - - - - - - -
#
#
# # #
#
chown -R spot:spot /usr/bin/icecat-3.6.16-i686 ;
chown -R spot:spot /usr/lib/mozilla ;
chown -R spot:spot /dev/snd ;
#
# # #
#
#
#'su spot' in rxvt
#FIRST variant ---> '/usr/bin/icecat-3.6.16-i686/icecat &>/dev/null' in rxvt
#
#
# # # NEW variant --->
#
#LD_LIBRARY_PATH=/usr/bin/icecat-3.6.16-i686 /usr/bin/icecat-3.6.16-i686/icecat-bin &>/dev/null
#
#history -c >/root/spot/.bash_history ; printf '\ec'
#
# # # <--- NEW variant
#
#
echo -e "-=AdditionTo--Install_Firewall-Rules--sr0=- script has been executed." | xmessage -file -
|
Edit: 2012, aug 05.
|
-=! -d 127.0.0.1=- is the hole here for such a programs as -=iprelay=-.
Also, there is a built-in program -=nc=- in the -=Quirky Linux - 1.40=-, and i would like to block the -=nc=-. Info about the -=nc=- is here: http://www.hackinglinuxexposed.com/articles/20040830.html
Information about the web page: Copyright Brian Hatch, 2004.
Solution:
| Quote: |
AttemptToBlock--nc_telnet_ftpput_ftpget_httpd_iptunnel_tftp--v1.sh
| Code: |
#!/bin/bash
#
#-=busybox=- was edited in -=bless=- and the name is a little bit different.
#Not good news: busybox [function] [arguments]... or: function [arguments]...
#
#By the way, there is the -=socat=- program at some users.
#
cd /tmp ;
#
curl -C - -O file:///mnt/sdb1/0_BackUp/0_INSTALL/To_Block_NC_and_MorePrograms/Packed_files/nc_v1.tar.xz ;
if [ ! `echo -e "0ded3f5cafde07272ea473eb4573995a nc_v1.tar.xz" | md5sum -c - >/tmp/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /tmp/.md-5.sm` ] ; then xmessage -file /tmp/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /tmp/.md-5.sm`" ; fi ;
sleep 1s ;
tar -C /bin -Jxf nc_v1.tar.xz ;
sleep 1s ;
rm /tmp/nc_v1.tar.xz ;
rm /tmp/.md-5.sm ;
#
# # #
#
#nc --->
if [ ! `find /bin /sbin /usr -name nc` ] ; then ln -s /bin/'busybox ' /usr/bin/nc ; else
bash -c "`find /bin /sbin /usr -name nc | sed 's/^/rm -f /' | sed 's/$/ ;/'`" ;
ln -s /bin/'busybox ' /usr/bin/nc ;
fi ;
#<--- nc
#-1-
#telnet --->
if [ ! `find /bin /sbin /usr -name telnet` ] ; then ln -s /bin/'busybox ' /usr/bin/telnet ; else
bash -c "`find /bin /sbin /usr -name telnet | sed 's/^/rm -f /' | sed 's/$/ ;/'`" ;
ln -s /bin/'busybox ' /usr/bin/telnet ;
fi ;
#<--- telnet
#-2-
#ftpput --->
if [ ! `find /bin /sbin /usr -name ftpput` ] ; then ln -s /bin/'busybox ' /usr/bin/ftpput ; else
bash -c "`find /bin /sbin /usr -name ftpput | sed 's/^/rm -f /' | sed 's/$/ ;/'`" ;
ln -s /bin/'busybox ' /usr/bin/ftpput ;
fi ;
#<--- ftpput
#-3-
#ftpget --->
if [ ! `find /bin /sbin /usr -name ftpget` ] ; then ln -s /bin/'busybox ' /usr/bin/ftpget ; else
bash -c "`find /bin /sbin /usr -name ftpget | sed 's/^/rm -f /' | sed 's/$/ ;/'`" ;
ln -s /bin/'busybox ' /usr/bin/ftpget ;
fi ;
#<--- ftpget
#-4-
#httpd --->
if [ ! `find /bin /sbin /usr -name httpd` ] ; then ln -s /bin/'busybox ' /usr/sbin/httpd ; else
bash -c "`find /bin /sbin /usr -name httpd | sed 's/^/rm -f /' | sed 's/$/ ;/'`" ;
ln -s /bin/'busybox ' /usr/sbin/httpd ;
fi ;
#<--- httpd
#-5-
#iptunnel --->
if [ ! `find /bin /sbin /usr -name iptunnel` ] ; then ln -s /bin/'busybox ' /bin/iptunnel ; else
bash -c "`find /bin /sbin /usr -name iptunnel | sed 's/^/rm -f /' | sed 's/$/ ;/'`" ;
ln -s /bin/'busybox ' /bin/iptunnel ;
fi ;
#<--- iptunnel
#-6-
#tftp --->
if [ ! `find /bin /sbin /usr -name tftp` ] ; then ln -s /bin/'busybox ' /usr/bin/tftp ; else
bash -c "`find /bin /sbin /usr -name tftp | sed 's/^/rm -f /' | sed 's/$/ ;/'`" ;
ln -s /bin/'busybox ' /usr/bin/tftp ;
fi ;
#<--- tftp
#-7-
#
# # #
#
chmod 0100 /bin/busybox /bin/'busybox ' ;
#
touch -c -m --reference=/bin/busybox /bin/'busybox ' ;
touch -c -a /bin/'busybox ' /bin/busybox ;
#
# # #
#
xmessage "Program -=NC=- and several other programs have been changed."
|
Edit: 2012, aug 01.
|
Important thing:
http://www.murga-linux.com/puppy/viewtopic.php?p=586415#586415 0_Protect-2_Exit.sh
A script's content can be copied into text editor by means of <Quote> mode.
_________________
- I don't know why laboratories are named a hospitals.
- The alive personage is like a tea bag with granules of unknown density inside, at that one the packet was made of organic material and was placed in the evaporated liquid or liquid.
|
|
Back to top
|
|
 |
postfs1

Joined: 27 Mar 2010 Posts: 831
|
Posted: Tue 14 Aug 2012, 06:15 Post_subject:
|
|
Addition
| Quote: |
Informational source for content of script:
| Code: |
DENY IN=eth0 OUT= SRC=202.205.203.22 DST=55.105.105.55 DF PROTO=TCP SPT=2222 DPT=2222
|
|
| Quote: |
Block--Part1_RANGE_of_IPs_from_LOG.sh
| Code: |
#!/bin/bash
#
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# # #Block RANGE of IPs which were written to LOG file:
#- - - - - - -
#
# # #iptables -L -n
#
#
#
#BUILD the R_U_L_E--->
echo "Rule 30 (eth0)"
iptables -N RULE_30
iptables -I INPUT -i eth0 -s 202.205.203.0/24 -j RULE_30
#
iptables -I RULE_30 -j LOG --log-level notice --log-prefix "RULE 30 -- DENY "
iptables -I RULE_30 -j DROP
#
history -c >/root/.history ; printf '\ec'
#
#
#
# # # # # # # # # # # # # # # # # # # ADD the ADDITION to RULE--->
iptables -I INPUT -i eth0 -s 41.144.202.0/24 -j RULE_30
sleep 0.5s ;
#
history -c >/root/.history ; printf '\ec'
#
#
#
#- - - - - - -
# # #:Block RANGE of IPs which were written into LOG file
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo -e "-=Block_RANGE_of_IPs_which_were_written_to_LOG--PART1=- script has been executed." | xmessage -file -
|
Edit: 2012, aug 14.
|
| Quote: |
Block--Part2_RANGE_of_IPs_from_LOG.sh
| Code: |
#!/bin/bash
#
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# # #Block RANGE of IPs which were written to LOG file:
#- - - - - - -
#
# # #iptables -L -n
#
#
#
# # # # # # # # # # # # # # # # # # # ADD the ADDITION to RULE--->
iptables -I INPUT -i eth0 -s 60.104.102.0/24 -j RULE_30
sleep 0.5s ;
#
history -c >/root/.history ; printf '\ec'
#
#
#
#- - - - - - -
# # #:Block RANGE of IPs which were written into LOG file
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo -e "-=Block_RANGE_of_IPs_which_were_written_to_LOG--PART2=- script has been executed." | xmessage -file -
|
Edit: 2012, aug 14.
|
_________________
- I don't know why laboratories are named a hospitals.
- The alive personage is like a tea bag with granules of unknown density inside, at that one the packet was made of organic material and was placed in the evaporated liquid or liquid.
Edited_time_total
|
|
Back to top
|
|
 |
postfs1

Joined: 27 Mar 2010 Posts: 831
|
Posted: Tue 14 Aug 2012, 06:20 Post_subject:
|
|
Addition
| Quote: |
Unblock--Part1_RANGE_of_IPs_from_LOG.sh
| Code: |
#!/bin/bash
#
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# # #Unblock RANGE of IPs which were written to LOG file:
#- - - - - - -
#
# # #iptables -L -n
#
#
#
# # # # # # # # # # # # # # # # # # # REMOVE the RULE--->
iptables -D INPUT -i eth0 -s 202.205.203.0/24 -j RULE_30
sleep 0.5s ;
history -c >/root/.history ; printf '\ec'
#
#
#
#- - - - - - -
# # #:Unblock RANGE of IPs which were written into LOG file
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo -e "-=Unblock_RANGE_of_IPs_which_were_written_to_LOG--PART1=- script has been executed." | xmessage -file -
|
Edit: 2012, aug 14.
|
| Quote: |
Unblock--Part2_RANGE_of_IPs_from_LOG.sh
| Code: |
#!/bin/bash
#
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# # #Unblock RANGE of IPs which were written to LOG file:
#- - - - - - -
#
# # #iptables -L -n
#
#
#
# # # # # # # # # # # # # # # # # # # ADD the ADDITION to RULE and REMOVE the RULE--->
iptables -D INPUT -i eth0 -s 60.104.102.0/24 -j RULE_30
sleep 0.5s ;
#
history -c >/root/.history ; printf '\ec'
#
#
#
iptables -D RULE_30 -j LOG --log-level notice --log-prefix "RULE 30 -- DENY "
iptables -D RULE_30 -j DROP
iptables -X RULE_30
#
history -c >/root/.history ; printf '\ec'
#
#
#
#- - - - - - -
# # #:Unblock RANGE of IPs which were written into LOG file
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo -e "-=Unblock_RANGE_of_IPs_which_were_written_to_LOG--PART2=- script has been executed." | xmessage -file -
|
Edit: 2012, aug 14.
|
_________________
- I don't know why laboratories are named a hospitals.
- The alive personage is like a tea bag with granules of unknown density inside, at that one the packet was made of organic material and was placed in the evaporated liquid or liquid.
|
|
Back to top
|
|
 |
postfs1

Joined: 27 Mar 2010 Posts: 831
|
Posted: Wed 15 Aug 2012, 15:25 Post_subject:
Sub_title: Fresh variant of installation |
|
INSTALLATION --->
| Quote: |
Install_FWBuilder_v2--sr0.sh
| Code: |
#!/bin/bash
#
mkdir -m 0500 -p /room ;
cd /room ;
#
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ `grep -w -s -c 'fwbuilder-5.0.0.3568-1.fc11.i586.rpm..rm' /usr/local/etc/*.dsktop | awk -F: '{ sum +=$2 } END { print sum }'` -gt 0 ] ;
then echo "fwbuilder-5.0.0.3568-1.fc11.i586.rpm..rm" >/usr/local/etc/FWBldr.dsktop ; else
curl -C - -O file:///mnt/sr0/_Files/FWBuilder/Fedora-11_files/fwbuilder-5.0.0.3568-1.fc11.i586.rpm ;
if [ ! `echo -e "a6176dd3991d29eb092655c41e9746b3 fwbuilder-5.0.0.3568-1.fc11.i586.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
rpm -i fwbuilder-5.0.0.3568-1.fc11.i586.rpm ;
sleep 0.5s ;
echo "fwbuilder-5.0.0.3568-1.fc11.i586.rpm..rm" >/usr/local/etc/FWBldr.dsktop ;
rm /room/fwbuilder-5.0.0.3568-1.fc11.i586.rpm ;
rm /room/.md-5.sm ;
#
rm /usr/share/applications/fwbuilder.desktop ;
#
fi ;
#1
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ `grep -w -s -c 'keyutils-libs-1.2-5.fc11.i586.rpm..rm' /usr/local/etc/*.dsktop | awk -F: '{ sum +=$2 } END { print sum }'` -gt 0 ] ;
then echo "keyutils-libs-1.2-5.fc11.i586.rpm..rm" >>/usr/local/etc/FWBldr.dsktop ; else
curl -C - -O file:///mnt/sr0/_Files/FWBuilder/Fedora-11_files/keyutils-libs-1.2-5.fc11.i586.rpm ;
if [ ! `echo -e "247a0ac4b1c56f542f3496d2eec16349 keyutils-libs-1.2-5.fc11.i586.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
rpm -i keyutils-libs-1.2-5.fc11.i586.rpm ;
sleep 0.5s ;
echo "keyutils-libs-1.2-5.fc11.i586.rpm..rm" >>/usr/local/etc/FWBldr.dsktop ;
rm /room/keyutils-libs-1.2-5.fc11.i586.rpm ;
rm /room/.md-5.sm ;
fi ;
#2
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ `grep -w -s -c 'krb5-libs-1.6.3-31.fc11.i586.rpm..rm' /usr/local/etc/*.dsktop | awk -F: '{ sum +=$2 } END { print sum }'` -gt 0 ] ;
then echo "krb5-libs-1.6.3-31.fc11.i586.rpm..rm" >>/usr/local/etc/FWBldr.dsktop ; else
curl -C - -O file:///mnt/sr0/_Files/FWBuilder/Fedora-11_files/krb5-libs-1.6.3-31.fc11.i586.rpm ;
if [ ! `echo -e "8f4bec783f5fa9a1ab31438a231cbd7e krb5-libs-1.6.3-31.fc11.i586.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
rpm -i krb5-libs-1.6.3-31.fc11.i586.rpm ;
sleep 0.5s ;
echo "krb5-libs-1.6.3-31.fc11.i586.rpm..rm" >>/usr/local/etc/FWBldr.dsktop ;
rm /room/krb5-libs-1.6.3-31.fc11.i586.rpm ;
rm /room/.md-5.sm ;
fi ;
#3
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ `grep -w -s -l 'libstdc++-4.4.1-2.fc11.i586.rpm..rm' /usr/local/etc/*.dsktop | wc -l` -gt 0 ] ;
then echo "libstdc++-4.4.1-2.fc11.i586.rpm..rm" >>/usr/local/etc/FWBldr.dsktop ; else
curl -C - -O file:///mnt/sr0/_Files/FWBuilder/Fedora-11_files/libstdc++-4.4.1-2.fc11.i586.rpm ;
if [ ! `echo -e "96c934cb092bf073ace9c10cce025f44 libstdc++-4.4.1-2.fc11.i586.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
rpm -i libstdc++-4.4.1-2.fc11.i586.rpm ;
sleep 0.5s ;
echo "libstdc++-4.4.1-2.fc11.i586.rpm..rm" >>/usr/local/etc/FWBldr.dsktop ;
rm /room/libstdc++-4.4.1-2.fc11.i586.rpm ;
rm /room/.md-5.sm ;
#
echo "libstdc++-4.4.1-2.fc11.i586.rpm..rm" >>/usr/local/etc/built-in.dsktop ;
fi ;
#4
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ `grep -w -s -c 'net-snmp-libs-5.4.2.1-14.fc11.i586.rpm..rm' /usr/local/etc/*.dsktop | awk -F: '{ sum +=$2 } END { print sum }'` -gt 0 ] ;
then echo "net-snmp-libs-5.4.2.1-14.fc11.i586.rpm..rm" >>/usr/local/etc/FWBldr.dsktop ; else
curl -C - -O file:///mnt/sr0/_Files/FWBuilder/Fedora-11_files/net-snmp-libs-5.4.2.1-14.fc11.i586.rpm ;
if [ ! `echo -e "1ca102eafd7974005875331ed32330db net-snmp-libs-5.4.2.1-14.fc11.i586.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
rpm -i net-snmp-libs-5.4.2.1-14.fc11.i586.rpm ;
sleep 0.5s ;
echo "net-snmp-libs-5.4.2.1-14.fc11.i586.rpm..rm" >>/usr/local/etc/FWBldr.dsktop ;
rm /room/net-snmp-libs-5.4.2.1-14.fc11.i586.rpm ;
rm /room/.md-5.sm ;
fi ;
#5
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ `grep -w -s -c 'openssl-0.9.8n-2.fc11.i686.rpm..rm' /usr/local/etc/*.dsktop | awk -F: '{ sum +=$2 } END { print sum }'` -gt 0 ] ;
then echo "openssl-0.9.8n-2.fc11.i686.rpm..rm" >>/usr/local/etc/FWBldr.dsktop ; else
curl -C - -O file:///mnt/sr0/_Files/FWBuilder/Fedora-11_files/openssl-0.9.8n-2.fc11.i686.rpm ;
if [ ! `echo -e "2e7dc70ccf871f43e8d37e602b24687b openssl-0.9.8n-2.fc11.i686.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
rpm -i openssl-0.9.8n-2.fc11.i686.rpm ;
sleep 0.5s ;
echo "openssl-0.9.8n-2.fc11.i686.rpm..rm" >>/usr/local/etc/FWBldr.dsktop ;
rm /room/openssl-0.9.8n-2.fc11.i686.rpm ;
rm /room/.md-5.sm ;
fi ;
#6
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ `grep -w -s -c 'qt-4.6.2-17.fc11.i586.rpm..rm' /usr/local/etc/*.dsktop | awk -F: '{ sum +=$2 } END { print sum }'` -gt 0 ] ;
then echo "qt-4.6.2-17.fc11.i586.rpm..rm" >>/usr/local/etc/FWBldr.dsktop ; else
curl -C - -O file:///mnt/sr0/_Files/FWBuilder/Fedora-11_files/qt-4.6.2-17.fc11.i586.rpm ;
if [ ! `echo -e "ece4122f0144569432c9bc36f195c49c qt-4.6.2-17.fc11.i586.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
rpm -i qt-4.6.2-17.fc11.i586.rpm ;
sleep 0.5s ;
echo "qt-4.6.2-17.fc11.i586.rpm..rm" >>/usr/local/etc/FWBldr.dsktop ;
rm /room/qt-4.6.2-17.fc11.i586.rpm ;
rm /room/.md-5.sm ;
fi ;
#7
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ `grep -w -s -c 'qt-x11-4.6.2-17.fc11.i586.rpm..rm' /usr/local/etc/*.dsktop | awk -F: '{ sum +=$2 } END { print sum }'` -gt 0 ] ;
then echo "qt-x11-4.6.2-17.fc11.i586.rpm..rm" >>/usr/local/etc/FWBldr.dsktop ; else
curl -C - -O file:///mnt/sr0/_Files/FWBuilder/Fedora-11_files/qt-x11-4.6.2-17.fc11.i586.rpm ;
if [ ! `echo -e "4270840a05873869b00a9d42c1ad703b qt-x11-4.6.2-17.fc11.i586.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
rpm -i qt-x11-4.6.2-17.fc11.i586.rpm ;
sleep 0.5s ;
echo "qt-x11-4.6.2-17.fc11.i586.rpm..rm" >>/usr/local/etc/FWBldr.dsktop ;
rm /room/qt-x11-4.6.2-17.fc11.i586.rpm ;
rm /room/.md-5.sm ;
fi ;
#8
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ `grep -w -s -c 'libselinux-2.0.80-1.fc11.i586.rpm..rm' /usr/local/etc/*.dsktop | awk -F: '{ sum +=$2 } END { print sum }'` -gt 0 ] ;
then echo "libselinux-2.0.80-1.fc11.i586.rpm..rm" >>/usr/local/etc/FWBldr.dsktop ; else
curl -C - -O file:///mnt/sr0/_Files/FWBuilder/Fedora-11_files/libselinux-2.0.80-1.fc11.i586.rpm ;
if [ ! `echo -e "a33dd8be6e63530f3babeec2e3c03019 libselinux-2.0.80-1.fc11.i586.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
rpm -i libselinux-2.0.80-1.fc11.i586.rpm ;
sleep 0.5s ;
echo "libselinux-2.0.80-1.fc11.i586.rpm..rm" >>/usr/local/etc/FWBldr.dsktop ;
rm /room/libselinux-2.0.80-1.fc11.i586.rpm ;
rm /room/.md-5.sm ;
fi ;
#9
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# # #
#
#Sensors. >>>
#
if [ `grep -w -s -c 'lm_sensors-3.1.0-1.fc11.i586.rpm..rm' /usr/local/etc/*.dsktop | awk -F: '{ sum +=$2 } END { print sum }'` -gt 0 ] ;
then echo "lm_sensors-3.1.0-1.fc11.i586.rpm..rm" >>/usr/local/etc/FWBldr.dsktop ; else
curl -C - -O file:///mnt/sr0/_Files/FWBuilder/Fedora-11_files/lm_sensors-3.1.0-1.fc11.i586.rpm ;
if [ ! `echo -e "1b525876a63e0e1b44dec0f12b8a1493 lm_sensors-3.1.0-1.fc11.i586.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
rpm -i lm_sensors-3.1.0-1.fc11.i586.rpm ;
sleep 0.5s ;
echo "lm_sensors-3.1.0-1.fc11.i586.rpm..rm" >>/usr/local/etc/FWBldr.dsktop ;
rm /room/lm_sensors-3.1.0-1.fc11.i586.rpm ;
rm /room/.md-5.sm ;
fi ;
#1
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ `grep -w -s -c 'perl-5.10.0-82.fc11.i586.rpm..rm' /usr/local/etc/*.dsktop | awk -F: '{ sum +=$2 } END { print sum }'` -gt 0 ] ;
then echo "perl-5.10.0-82.fc11.i586.rpm..rm" >>/usr/local/etc/FWBldr.dsktop ; else
#
rm /usr/bin/perlthanks /usr/bin/perlivp /usr/bin/perldoc ;
rm /usr/bin/perl /usr/bin/perlbug /usr/bin/perl5.10.1 ;
rm -r /usr/lib/perl5 ;
#
curl -C - -O file:///mnt/sr0/_Files/FWBuilder/Fedora-11_files/perl-5.10.0-82.fc11.i586.rpm ;
if [ ! `echo -e "175f93681b9bd4a69e7ee1d082f37b92 perl-5.10.0-82.fc11.i586.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
rpm -i perl-5.10.0-82.fc11.i586.rpm ;
sleep 0.5s ;
echo "perl-5.10.0-82.fc11.i586.rpm..rm" >>/usr/local/etc/FWBldr.dsktop ;
rm /room/perl-5.10.0-82.fc11.i586.rpm ;
rm /room/.md-5.sm ;
fi ;
#2
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ `grep -w -s -c 'perl-libs-5.10.0-82.fc11.i586.rpm..rm' /usr/local/etc/*.dsktop | awk -F: '{ sum +=$2 } END { print sum }'` -gt 0 ] ;
then echo "perl-libs-5.10.0-82.fc11.i586.rpm..rm" >>/usr/local/etc/FWBldr.dsktop ; else
curl -C - -O file:///mnt/sr0/_Files/FWBuilder/Fedora-11_files/perl-libs-5.10.0-82.fc11.i586.rpm ;
if [ ! `echo -e "1ac4c25aeea0c6793066147db5e06a04 perl-libs-5.10.0-82.fc11.i586.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
rpm -i perl-libs-5.10.0-82.fc11.i586.rpm ;
sleep 0.5s ;
echo "perl-libs-5.10.0-82.fc11.i586.rpm..rm" >>/usr/local/etc/FWBldr.dsktop ;
rm /room/perl-libs-5.10.0-82.fc11.i586.rpm ;
rm /room/.md-5.sm ;
fi ;
#3
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# # #
#
cat /etc/init.d/lm_sensors | \
sed -e 's|. /etc/init.d/functions|. /etc/rc.d/functions|' > /etc/init.d/lm_sensors ;
yes | sensors-detect ;
/etc/init.d/lm_sensors start 2>/dev/null | xmessage `cat` ;
#
#<<< Sensors.
#
# # #
#
#For on-line lesson >>>
#
#http://www.youtube.com/v/Q5GPrkwyGxw&hl=en_US&feature=player_embedded&version=3
#http://www.youtube.com/watch?v=Q5GPrkwyGxw&hl=en_US&feature=player_embedded&version=3
#
if [ -f /usr/bin/icecat-3.6.16-i686/icecat ] ; then
ln -s -f /usr/bin/icecat-3.6.16-i686/icecat /usr/bin/firefox ;
elif [ -f /usr/local/bin/icecat-3.6.16-i686/icecat ] ; then
ln -s -f /usr/local/bin/icecat-3.6.16-i686/icecat /usr/bin/firefox ;
else echo -e "If there is no web-browser in the system then\n the watching of tutorial videos is unavailable." | xmessage -file - ;
fi ;
# <<<
#
# # #
#
#
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#http://www.fwbuilder.org/4.0/docs/users_guide/install_with_regular_user.html
#Information about web page: Copyright © 2000-2012 NetCitadel, Inc. All rights reserved.
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# # #
#
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#http://sourceforge.net/projects/fwbuilder/forums/forum/16372/topic/3900942
#Information about web page: © 2012 Geeknet, Inc.
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# # #
#
#"Firewall Builder"://Edit/Preferences/Installer >>>
#/usr/local/bin/.cfb = scp
#/usr/local/bin/.afb = instead of ssh
#<<<
#
# # #
#
ln -s /usr/sbin/iptables /sbin/iptables ;
ln -s /bin/ip /sbin/ip ;
#
mkdir -m 0700 -p /var/lib/.fb ;
mkdir -m 0700 -p /etc/fw ;
echo '#!/bin/bash' > /usr/local/bin/.cfb ;
echo "cp /var/lib/.fb/fb.fw /etc/fw" >> /usr/local/bin/.cfb ;
chmod 0700 /usr/local/bin/.cfb ;
#
echo '#!/bin/bash' > /usr/local/bin/.afb ;
echo "sh /etc/fw/fb.fw start" >> /usr/local/bin/.afb ;
chmod 0700 /usr/local/bin/.afb ;
#
# # #
#
cd /var/lib/.fb/ ;
curl -C - -O file:///mnt/sr0/_Files/FWBuilder/Packed_Files/fb.fwb.gz ;
if [ ! `echo -e "1a82d3d38959e9881ec08520cfcae0bc fb.fwb.gz" | md5sum -c - >/var/lib/.fb/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /var/lib/.fb/.md-5.sm` ] ; then xmessage -file /var/lib/.fb/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /var/lib/.fb/.md-5.sm`" ; fi ;
gunzip -d fb.fwb.gz ;
sleep 0.5s ;
rm /var/lib/.fb/.md-5.sm ;
cd /room ;
#1
#
# # #
#
#
sed -i".tmp" '/"FWBuild"/d' /root/Choices/ROX-Filer/PuppyPin ;
#
echo '[Desktop Entry]' > /usr/share/applications/FWBldr_go.desktop ;
echo 'Name=Firewall Builder' >> /usr/share/applications/FWBldr_go.desktop ;
echo 'Comment=Design and Manage Firewall Rules' >> /usr/share/applications/FWBldr_go.desktop ;
echo 'Icon=/usr/share/icons/hicolor/48x48/apps/fwbuilder.png' >> /usr/share/applications/FWBldr_go.desktop ;
echo 'Categories=no' >> /usr/share/applications/FWBldr_go.desktop ;
#
#Don't touch this >>>
#Exec=bash -c 'bash -c "`Xdialog --title \"FWBuilder\" --no-tags --radiolist \"\" 15 38 10 \"fwbuilder\" \"-=FWBuilder=-\" off \"cd /var/lib/.fb/ ; curl -C - -O file:///mnt/sr0/_Files/FWBuilder/Packed_Files/fb.fwb.gz ; gunzip -f -d fb.fwb.gz\" \"-=To RECEIVE file with settings=-\" off \"rm /var/lib/.fb/fb.fwb /var/lib/.fb/fb.fw /etc/fw/fb.fw\" \"-=To DELETE files with settings=-\" off \"echo -e \"'\''\"\`dmesg|grep DENY|tail -10|cut --delimiter=" " -f4-6,8-9,15-18\`\"'\''\"|xmessage -file -\" \"-=Blocked Packets=-\" on 2>&1`"'
grep '\-\-radiolist' /mnt/sr0/_Files/FWBuilder/Install_FWBuilder_v2--sr0.sh | grep -v "Install_FWBuilder_v2--sr0.sh" | sed 's/#//' >> /usr/share/applications/FWBldr_go.desktop ;
# <<<
#
echo 'Type=Application' >> /usr/share/applications/FWBldr_go.desktop ;
echo 'StartupNotify=true' >> /usr/share/applications/FWBldr_go.desktop ;
echo 'Terminal=false' >> /usr/share/applications/FWBldr_go.desktop ;
#
# # #
#
echo '[Desktop Entry]' > /usr/share/applications/FWBldr.desktop ;
echo 'Name=Firewall Builder' >> /usr/share/applications/FWBldr.desktop ;
echo 'Comment=Design and Manage Firewall Rules' >> /usr/share/applications/FWBldr.desktop ;
echo 'Icon=/usr/share/icons/hicolor/48x48/apps/fwbuilder.png' >> /usr/share/applications/FWBldr.desktop ;
echo 'Categories=Network;' >> /usr/share/applications/FWBldr.desktop ;
echo 'Exec=rox /usr/share/applications/FWBldr_go.desktop' >> /usr/share/applications/FWBldr.desktop ;
echo 'Type=Application' >> /usr/share/applications/FWBldr.desktop ;
echo 'StartupNotify=true' >> /usr/share/applications/FWBldr.desktop ;
echo 'Terminal=false' >> /usr/share/applications/FWBldr.desktop ;
#
# # #
#
sed -i".tmp" '/\/pinboard/d' /root/Choices/ROX-Filer/PuppyPin ;
sleep 1s ;
echo '<icon x="224" y="284" label="FWBuild">/usr/share/applications/FWBldr.desktop</icon>' >> /root/Choices/ROX-Filer/PuppyPin ;
echo '</pinboard>' >> /root/Choices/ROX-Filer/PuppyPin ;
sleep 1s ;
#
# # #
#
rox -p=/root/Choices/ROX-Filer/PuppyPin ;
fixmenus ;
echo -e "Application -=FWBuilder=- has been installed." | xmessage -file - `jwm -restart`
|
Edit: 2012, aug 15.
|
A script's content can be copied into text editor by means of the forum's <Quote> mode.
<--- INSTALLATION
_________________
- I don't know why laboratories are named a hospitals.
- The alive personage is like a tea bag with granules of unknown density inside, at that one the packet was made of organic material and was placed in the evaporated liquid or liquid.
Edited_time_total
|
|
Back to top
|
|
 |
postfs1

Joined: 27 Mar 2010 Posts: 831
|
Posted: Wed 15 Aug 2012, 15:27 Post_subject:
|
|
DEINSTALLATION --->
| Quote: |
Remove_FWBuilder--sr0.sh
| Code: |
#!/bin/bash
#TMP --->
#echo 'fwbuilder-5.0.0.3568-1.fc11.i586.rpm..rm' >/usr/local/etc/FWBldr.dsktop ;
#echo 'keyutils-libs-1.2-5.fc11.i586.rpm..rm' >>/usr/local/etc/FWBldr.dsktop ;
#echo 'krb5-libs-1.6.3-31.fc11.i586.rpm..rm' >>/usr/local/etc/FWBldr.dsktop ;
#echo 'libstdc++-4.4.1-2.fc11.i586.rpm..rm' >>/usr/local/etc/FWBldr.dsktop ;
#echo 'net-snmp-libs-5.4.2.1-14.fc11.i586.rpm..rm' >>/usr/local/etc/FWBldr.dsktop ;
#echo 'openssl-0.9.8n-2.fc11.i686.rpm..rm' >>/usr/local/etc/FWBldr.dsktop ;
#echo 'qt-4.6.2-17.fc11.i586.rpm..rm' >>/usr/local/etc/FWBldr.dsktop ;
#echo 'qt-x11-4.6.2-17.fc11.i586.rpm..rm' >>/usr/local/etc/FWBldr.dsktop ;
#echo 'libselinux-2.0.80-1.fc11.i586.rpm..rm' >>/usr/local/etc/FWBldr.dsktop ;
#echo 'lm_sensors-3.1.0-1.fc11.i586.rpm..rm' >>/usr/local/etc/FWBldr.dsktop ;
#echo 'perl-5.10.0-82.fc11.i586.rpm..rm' >>/usr/local/etc/FWBldr.dsktop ;
#echo 'perl-libs-5.10.0-82.fc11.i586.rpm..rm' >>/usr/local/etc/FWBldr.dsktop ;
#<--- TMP
# # #
#
#
/etc/init.d/lm_sensors stop ;#Stopping lm_sensors: /etc/init.d/lm_sensors: line 91: echo_success: command not found
#
# # #
#
cd /room ;
#
if [ `grep -w -s -c 'fwbuilder-5.0.0.3568-1.fc11.i586.rpm..rm' /usr/local/etc/*.dsktop | awk -F: '{ sum +=$2 } END { print sum }'` -gt 1 ] ;
then sed -i '/fwbuilder-5.0.0.3568-1.fc11.i586.rpm..rm/d' /usr/local/etc/FWBldr.dsktop ; else
curl -C - -O file:///mnt/sr0/_Files/FWBuilder/Fedora-11_files/fwbuilder-5.0.0.3568-1.fc11.i586.rpm ;
if [ ! `echo -e "a6176dd3991d29eb092655c41e9746b3 fwbuilder-5.0.0.3568-1.fc11.i586.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
bash -c "`rpm -qp -l fwbuilder-5.0.0.3568-1.fc11.i586.rpm | sed 's/^/rm -f /' | sed 's/$/ ;/'`" ;
sleep 0.5s ;
bash -c "`rpm -qp -l fwbuilder-5.0.0.3568-1.fc11.i586.rpm | rev | cut -d'/' -f2- | rev | sort -u | sed 's/^/rmdir --ignore-fail-on-non-empty -p /' | sed 's/$/ ;/'`" ;
sed -i '/fwbuilder-5.0.0.3568-1.fc11.i586.rpm..rm/d' /usr/local/etc/FWBldr.dsktop ;
rm /room/fwbuilder-5.0.0.3568-1.fc11.i586.rpm ;
rm /room/.md-5.sm ;
fi ;
#1
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ `grep -w -s -c 'keyutils-libs-1.2-5.fc11.i586.rpm..rm' /usr/local/etc/*.dsktop | awk -F: '{ sum +=$2 } END { print sum }'` -gt 1 ] ;
then sed -i '/keyutils-libs-1.2-5.fc11.i586.rpm..rm/d' /usr/local/etc/FWBldr.dsktop ; else
curl -C - -O file:///mnt/sr0/_Files/FWBuilder/Fedora-11_files/keyutils-libs-1.2-5.fc11.i586.rpm ;
if [ ! `echo -e "247a0ac4b1c56f542f3496d2eec16349 keyutils-libs-1.2-5.fc11.i586.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
bash -c "`rpm -qp -l keyutils-libs-1.2-5.fc11.i586.rpm | sed 's/^/rm -f /' | sed 's/$/ ;/'`" ;
sleep 0.5s ;
#bash -c "`rpm -qp -l keyutils-libs-1.2-5.fc11.i586.rpm | cut -d \"/\" -f -3 | sort -u | grep \"/\" | grep -v \"/$\" | sed 's/^/find /' | sed 's/$/ -type d -empty -delete ;/'`" ;
#
bash -c "`rpm -qp -l keyutils-libs-1.2-5.fc11.i586.rpm | rev | cut -d'/' -f2- | rev | sort -u | sed 's/^/rmdir --ignore-fail-on-non-empty -p /' | sed 's/$/ ;/'`" ;
sed -i '/keyutils-libs-1.2-5.fc11.i586.rpm..rm/d' /usr/local/etc/FWBldr.dsktop ;
rm /room/keyutils-libs-1.2-5.fc11.i586.rpm ;
rm /room/.md-5.sm ;
fi ;
#2
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ `grep -w -s -c 'krb5-libs-1.6.3-31.fc11.i586.rpm..rm' /usr/local/etc/*.dsktop | awk -F: '{ sum +=$2 } END { print sum }'` -gt 1 ] ;
then sed -i '/krb5-libs-1.6.3-31.fc11.i586.rpm..rm/d' /usr/local/etc/FWBldr.dsktop ; else
curl -C - -O file:///mnt/sr0/_Files/FWBuilder/Fedora-11_files/krb5-libs-1.6.3-31.fc11.i586.rpm ;
if [ ! `echo -e "8f4bec783f5fa9a1ab31438a231cbd7e krb5-libs-1.6.3-31.fc11.i586.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
bash -c "`rpm -qp -l krb5-libs-1.6.3-31.fc11.i586.rpm | sed 's/^/rm -f /' | sed 's/$/ ;/'`" ;
sleep 0.5s ;
#bash -c "`rpm -qp -l krb5-libs-1.6.3-31.fc11.i586.rpm | cut -d \"/\" -f -3 | sort -u | grep \"/\" | grep -v \"/$\" | sed 's/^/find /' | sed 's/$/ -type d -empty -delete ;/'`" ;
#
bash -c "`rpm -qp -l krb5-libs-1.6.3-31.fc11.i586.rpm | rev | cut -d'/' -f2- | rev | sort -u | sed 's/^/rmdir --ignore-fail-on-non-empty -p /' | sed 's/$/ ;/'`" ;
sed -i '/krb5-libs-1.6.3-31.fc11.i586.rpm..rm/d' /usr/local/etc/FWBldr.dsktop ;
rm /room/krb5-libs-1.6.3-31.fc11.i586.rpm ;
rm /room/.md-5.sm ;
fi ;
#3
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ `grep -w -s -l 'libstdc++-4.4.1-2.fc11.i586.rpm..rm' /usr/local/etc/*.dsktop | wc -l` -gt 0 ] ;
then sed -i '/libstdc++-4.4.1-2.fc11.i586.rpm..rm/d' /usr/local/etc/FWBldr.dsktop ; else
#curl -C - -O file:///mnt/sr0/_Files/FWBuilder/Fedora-11_files/libstdc++-4.4.1-2.fc11.i586.rpm ;
#if [ ! `echo -e "96c934cb092bf073ace9c10cce025f44 libstdc++-4.4.1-2.fc11.i586.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
#bash -c "`rpm -qp -l libstdc++-4.4.1-2.fc11.i586.rpm | sed 's/^/rm -f /' | sed 's/$/ ;/'`" ;
sleep 0.5s ;
#bash -c "`rpm -qp -l libstdc++-4.4.1-2.fc11.i586.rpm | rev | cut -d'/' -f2- | rev | sort -u | sed 's/^/rmdir --ignore-fail-on-non-empty -p /' | sed 's/$/ ;/'`" ;
#sed -i '/libstdc++-4.4.1-2.fc11.i586.rpm..rm/d' /usr/local/etc/FWBldr.dsktop ;
#rm /room/libstdc++-4.4.1-2.fc11.i586.rpm ;
#rm /room/.md-5.sm ;
fi ;
#4
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ `grep -w -s -c 'net-snmp-libs-5.4.2.1-14.fc11.i586.rpm..rm' /usr/local/etc/*.dsktop | awk -F: '{ sum +=$2 } END { print sum }'` -gt 1 ] ;
then sed -i '/net-snmp-libs-5.4.2.1-14.fc11.i586.rpm..rm/d' /usr/local/etc/FWBldr.dsktop ; else
curl -C - -O file:///mnt/sr0/_Files/FWBuilder/Fedora-11_files/net-snmp-libs-5.4.2.1-14.fc11.i586.rpm ;
if [ ! `echo -e "1ca102eafd7974005875331ed32330db net-snmp-libs-5.4.2.1-14.fc11.i586.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
bash -c "`rpm -qp -l net-snmp-libs-5.4.2.1-14.fc11.i586.rpm | sed 's/^/rm -f /' | sed 's/$/ ;/'`" ;
sleep 0.5s ;
bash -c "`rpm -qp -l net-snmp-libs-5.4.2.1-14.fc11.i586.rpm | rev | cut -d'/' -f2- | rev | sort -u | sed 's/^/rmdir --ignore-fail-on-non-empty -p /' | sed 's/$/ ;/'`" ;
sed -i '/net-snmp-libs-5.4.2.1-14.fc11.i586.rpm..rm/d' /usr/local/etc/FWBldr.dsktop ;
rm /room/net-snmp-libs-5.4.2.1-14.fc11.i586.rpm ;
rm /room/.md-5.sm ;
fi ;
#5
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ `grep -w -s -c 'openssl-0.9.8n-2.fc11.i686.rpm..rm' /usr/local/etc/*.dsktop | awk -F: '{ sum +=$2 } END { print sum }'` -gt 1 ] ;
then sed -i '/openssl-0.9.8n-2.fc11.i686.rpm..rm/d' /usr/local/etc/FWBldr.dsktop ; else
curl -C - -O file:///mnt/sr0/_Files/FWBuilder/Fedora-11_files/openssl-0.9.8n-2.fc11.i686.rpm ;
if [ ! `echo -e "2e7dc70ccf871f43e8d37e602b24687b openssl-0.9.8n-2.fc11.i686.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
bash -c "`rpm -qp -l openssl-0.9.8n-2.fc11.i686.rpm | sed 's/^/rm -f /' | sed 's/$/ ;/'`" ;
sleep 0.5s ;
#bash -c "`rpm -qp -l openssl-0.9.8n-2.fc11.i686.rpm | cut -d \"/\" -f -3 | sort -u | grep \"/\" | grep -v \"/$\" | sed 's/^/find /' | sed 's/$/ -type d -empty -delete ;/'`" ;
#
bash -c "`rpm -qp -l openssl-0.9.8n-2.fc11.i686.rpm | rev | cut -d'/' -f2- | rev | sort -u | sed 's/^/rmdir --ignore-fail-on-non-empty -p /' | sed 's/$/ ;/'`" ;
sed -i '/openssl-0.9.8n-2.fc11.i686.rpm..rm/d' /usr/local/etc/FWBldr.dsktop ;
rm /room/openssl-0.9.8n-2.fc11.i686.rpm ;
rm /room/.md-5.sm ;
fi ;
#6
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ `grep -w -s -c 'qt-4.6.2-17.fc11.i586.rpm..rm' /usr/local/etc/*.dsktop | awk -F: '{ sum +=$2 } END { print sum }'` -gt 1 ] ;
then sed -i '/qt-4.6.2-17.fc11.i586.rpm..rm/d' /usr/local/etc/FWBldr.dsktop ; else
curl -C - -O file:///mnt/sr0/_Files/FWBuilder/Fedora-11_files/qt-4.6.2-17.fc11.i586.rpm ;
if [ ! `echo -e "ece4122f0144569432c9bc36f195c49c qt-4.6.2-17.fc11.i586.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
bash -c "`rpm -qp -l qt-4.6.2-17.fc11.i586.rpm | sed 's/^/rm -f /' | sed 's/$/ ;/'`" ;
sleep 0.5s ;
#bash -c "`rpm -qp -l qt-4.6.2-17.fc11.i586.rpm | cut -d \"/\" -f -3 | sort -u | grep \"/\" | grep -v \"/$\" | sed 's/^/find /' | sed 's/$/ -type d -empty -delete ;/'`" ;
#
bash -c "`rpm -qp -l qt-4.6.2-17.fc11.i586.rpm | rev | cut -d'/' -f2- | rev | sort -u | sed 's/^/rmdir --ignore-fail-on-non-empty -p /' | sed 's/$/ ;/'`" ;
sed -i '/qt-4.6.2-17.fc11.i586.rpm..rm/d' /usr/local/etc/FWBldr.dsktop ;
rm /room/qt-4.6.2-17.fc11.i586.rpm ;
rm /room/.md-5.sm ;
fi ;
#7
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ `grep -w -s -c 'qt-x11-4.6.2-17.fc11.i586.rpm..rm' /usr/local/etc/*.dsktop | awk -F: '{ sum +=$2 } END { print sum }'` -gt 1 ] ;
then sed -i '/qt-x11-4.6.2-17.fc11.i586.rpm..rm/d' /usr/local/etc/FWBldr.dsktop ; else
curl -C - -O file:///mnt/sr0/_Files/FWBuilder/Fedora-11_files/qt-x11-4.6.2-17.fc11.i586.rpm ;
if [ ! `echo -e "4270840a05873869b00a9d42c1ad703b qt-x11-4.6.2-17.fc11.i586.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
bash -c "`rpm -qp -l qt-x11-4.6.2-17.fc11.i586.rpm | sed 's/^/rm -f /' | sed 's/$/ ;/'`" ;
sleep 0.5s ;
#bash -c "`rpm -qp -l qt-x11-4.6.2-17.fc11.i586.rpm | cut -d \"/\" -f -3 | sort -u | grep \"/\" | grep -v \"/$\" | sed 's/^/find /' | sed 's/$/ -type d -empty -delete ;/'`" ;
#
bash -c "`rpm -qp -l qt-x11-4.6.2-17.fc11.i586.rpm | rev | cut -d'/' -f2- | rev | sort -u | sed 's/^/rmdir --ignore-fail-on-non-empty -p /' | sed 's/$/ ;/'`" ;
sed -i '/qt-x11-4.6.2-17.fc11.i586.rpm..rm/d' /usr/local/etc/FWBldr.dsktop ;
rm /room/qt-x11-4.6.2-17.fc11.i586.rpm ;
rm /room/.md-5.sm ;
fi ;
#8
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ `grep -w -s -c 'libselinux-2.0.80-1.fc11.i586.rpm..rm' /usr/local/etc/*.dsktop | awk -F: '{ sum +=$2 } END { print sum }'` -gt 1 ] ;
then sed -i '/libselinux-2.0.80-1.fc11.i586.rpm..rm/d' /usr/local/etc/FWBldr.dsktop ; else
curl -C - -O file:///mnt/sr0/_Files/FWBuilder/Fedora-11_files/libselinux-2.0.80-1.fc11.i586.rpm ;
if [ ! `echo -e "a33dd8be6e63530f3babeec2e3c03019 libselinux-2.0.80-1.fc11.i586.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
bash -c "`rpm -qp -l libselinux-2.0.80-1.fc11.i586.rpm | sed 's/^/rm -f /' | sed 's/$/ ;/'`" ;
sleep 0.5s ;
#bash -c "`rpm -qp -l libselinux-2.0.80-1.fc11.i586.rpm | cut -d \"/\" -f -3 | sort -u | grep \"/\" | grep -v \"/$\" | sed 's/^/find /' | sed 's/$/ -type d -empty -delete ;/'`" ;
#
bash -c "`rpm -qp -l libselinux-2.0.80-1.fc11.i586.rpm | rev | cut -d'/' -f2- | rev | sort -u | sed 's/^/rmdir --ignore-fail-on-non-empty -p /' | sed 's/$/ ;/'`" ;
sed -i '/libselinux-2.0.80-1.fc11.i586.rpm..rm/d' /usr/local/etc/FWBldr.dsktop ;
rm /room/libselinux-2.0.80-1.fc11.i586.rpm ;
rm /room/.md-5.sm ;
fi ;
#9
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ `grep -w -s -c 'lm_sensors-3.1.0-1.fc11.i586.rpm..rm' /usr/local/etc/*.dsktop | awk -F: '{ sum +=$2 } END { print sum }'` -gt 1 ] ;
then sed -i '/lm_sensors-3.1.0-1.fc11.i586.rpm..rm/d' /usr/local/etc/FWBldr.dsktop ; else
curl -C - -O file:///mnt/sr0/_Files/FWBuilder/Fedora-11_files/lm_sensors-3.1.0-1.fc11.i586.rpm ;
if [ ! `echo -e "1b525876a63e0e1b44dec0f12b8a1493 lm_sensors-3.1.0-1.fc11.i586.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
bash -c "`rpm -qp -l lm_sensors-3.1.0-1.fc11.i586.rpm | sed 's/^/rm -f /' | sed 's/$/ ;/'`" ;
sleep 0.5s ;
bash -c "`rpm -qp -l lm_sensors-3.1.0-1.fc11.i586.rpm | rev | cut -d'/' -f2- | rev | sort -u | sed 's/^/rmdir --ignore-fail-on-non-empty -p /' | sed 's/$/ ;/'`" ;
sed -i '/lm_sensors-3.1.0-1.fc11.i586.rpm..rm/d' /usr/local/etc/FWBldr.dsktop ;
rm /room/lm_sensors-3.1.0-1.fc11.i586.rpm ;
rm /room/.md-5.sm ;
fi ;
#10
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#??? --->
if [ `grep -w -s -c 'perl-5.10.0-82.fc11.i586.rpm..rm' /usr/local/etc/*.dsktop | awk -F: '{ sum +=$2 } END { print sum }'` -gt 1 ] ;
then sed -i '/perl-5.10.0-82.fc11.i586.rpm..rm/d' /usr/local/etc/FWBldr.dsktop ; else
curl -C - -O file:///mnt/sr0/_Files/FWBuilder/Fedora-11_files/perl-5.10.0-82.fc11.i586.rpm ;
if [ ! `echo -e "175f93681b9bd4a69e7ee1d082f37b92 perl-5.10.0-82.fc11.i586.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
bash -c "`rpm -qp -l perl-5.10.0-82.fc11.i586.rpm | sed 's/^/rm -f /' | sed 's/$/ ;/'`" ;
sleep 0.5s ;
bash -c "`rpm -qp -l perl-5.10.0-82.fc11.i586.rpm | rev | cut -d'/' -f2- | rev | sort -u | sed 's/^/rmdir --ignore-fail-on-non-empty -p /' | sed 's/$/ ;/'`" ;
sed -i '/perl-5.10.0-82.fc11.i586.rpm..rm/d' /usr/local/etc/FWBldr.dsktop ;
rm /room/perl-5.10.0-82.fc11.i586.rpm ;
rm /room/.md-5.sm ;
fi ;
#11
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ `grep -w -s -c 'perl-libs-5.10.0-82.fc11.i586.rpm..rm' /usr/local/etc/*.dsktop | awk -F: '{ sum +=$2 } END { print sum }'` -gt 1 ] ;
then sed -i '/perl-libs-5.10.0-82.fc11.i586.rpm..rm/d' /usr/local/etc/FWBldr.dsktop ; else
curl -C - -O file:///mnt/sr0/_Files/FWBuilder/Fedora-11_files/perl-libs-5.10.0-82.fc11.i586.rpm ;
if [ ! `echo -e "1ac4c25aeea0c6793066147db5e06a04 perl-libs-5.10.0-82.fc11.i586.rpm" | md5sum -c - >/room/.md-5.sm ; sleep 0.5s ; grep -o 'OK' /room/.md-5.sm` ] ; then xmessage -file /room/.md-5.sm ; else yaf-splash -bg purple -fg green -text "`cat /room/.md-5.sm`" ; fi ;
bash -c "`rpm -qp -l perl-libs-5.10.0-82.fc11.i586.rpm | sed 's/^/rm -f /' | sed 's/$/ ;/'`" ;
sleep 0.5s ;
bash -c "`rpm -qp -l perl-libs-5.10.0-82.fc11.i586.rpm | rev | cut -d'/' -f2- | rev | sort -u | sed 's/^/rmdir --ignore-fail-on-non-empty -p /' | sed 's/$/ ;/'`" ;
sed -i '/perl-libs-5.10.0-82.fc11.i586.rpm..rm/d' /usr/local/etc/FWBldr.dsktop ;
rm /room/perl-libs-5.10.0-82.fc11.i586.rpm ;
rm /room/.md-5.sm ;
fi ;
#12
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# # #
#
if [ -f /tmp/.tmp.frfx.sl ] ; then rm /tmp/.tmp.frfx.sl ; fi ;
if [ -s /usr/bin/firefox ] ; then
bash -c "`Xdialog --title \"\"'\"Firefox\"'\" web-browser\" --no-tags --radiolist \"\"'\"firefox\"'\" sometimes can be a not needful symlink\" 11 70 10 \"echo >/tmp/.tmp.frfx.sl\" \"-=Remove \"'\"firefox\"'\" symlink=-\" off \"sleep 0.5s\" \"-=Don't remove \"'\"firefox\"'\" symlink=-\" on 2>&1`" ;
fi ;
if [ -f /tmp/.tmp.frfx.sl ] ; then
rm /usr/bin/firefox ;
rm /tmp/.tmp.frfx.sl ;
fi ;
#
# # #
#
rm -r /var/lib/.fb ;
rm -r /etc/fw ;
#
rm /usr/local/bin/.cfb ;
rm /usr/local/bin/.afb ;
#
# # #
#
sed -i '/"FWBuild"/d' /root/Choices/ROX-Filer/PuppyPin ;
#
rm /usr/share/applications/FWBldr.desktop ;
rm /usr/share/applications/FWBldr_go.desktop ;
#
if [ `grep -s -c '..rm' /usr/local/etc/FWBldr.dsktop | awk -F^ '{ sum +=$1 } END { print sum }'` -gt 0 ] ;
then sleep 0.5s ; else
rm /usr/local/etc/FWBldr.dsktop ; fi ;
#
rox -p=/root/Choices/ROX-Filer/PuppyPin ;
fixmenus ;
xmessage "The -=FWBuilder=- program has been almost removed." `jwm -restart`
|
Edit: 2012, aug 15.
|
A script's content can be copied into text editor by means of the forum's <Quote> mode.
<--- DEINSTALLATION
_________________
- I don't know why laboratories are named a hospitals.
- The alive personage is like a tea bag with granules of unknown density inside, at that one the packet was made of organic material and was placed in the evaporated liquid or liquid.
|
|
Back to top
|
|
 |
postfs1

Joined: 27 Mar 2010 Posts: 831
|
Posted: Tue 11 Sep 2012, 04:24 Post_subject:
|
|
Addition - 1
| Quote: |
AdditionTo--I_F-R--Block_Local--sr0.sh
| Code: |
#!/bin/bash
#
#!
#iptables -m iprange --help
#!
#
#iptables -v –L #Statistics of traffic
#
#iptables -L -n # = iptables -t filter -L -n #filter table
#
#iptables -t nat -L -n #nat table
#
#
# # #
#
#history -c >/root/.history ; printf '\ec'
#
# # # - - - - - - - - - - - - - - - - Rule 31 - - - - - - - - - - - - - - - - -
#
#BUILD the R_U_L_E--->
echo "Rule 31 (eth0)"
iptables -N RULE_31
iptables -I OUTPUT -o eth0 -d 55.105.105.0 -j RULE_31
iptables -I INPUT -i eth0 -s 55.105.105.0 -j RULE_31
#
iptables -I OUTPUT -o eth0 -m iprange --dst-range 55.105.105.2-55.105.105.54 -j RULE_31
iptables -I OUTPUT -o eth0 -m iprange --dst-range 55.105.105.56-55.105.105.255 -j RULE_31
#
iptables -I INPUT -i eth0 -m iprange --src-range 55.105.105.2-55.105.105.54 -j RULE_31
iptables -I INPUT -i eth0 -m iprange --src-range 55.105.105.56-55.105.105.255 -j RULE_31
#
iptables -I RULE_31 -j LOG --log-level notice --log-prefix "RULE 31 -- DENY "
iptables -I RULE_31 -j DROP
#
# # #
#
#! To delete the RULES ===> !
# iptables -D OUTPUT -o eth0 -d 55.105.105.0 -j RULE_31
# iptables -D INPUT -i eth0 -s 55.105.105.0 -j RULE_31
#
# iptables -D OUTPUT -o eth0 -m iprange --dst-range 55.105.105.2-55.105.105.54 -j RULE_31
# iptables -D OUTPUT -o eth0 -m iprange --dst-range 55.105.105.56-55.105.105.255 -j RULE_31
#
# iptables -D INPUT -i eth0 -m iprange --src-range 55.105.105.2-55.105.105.54 -j RULE_31
# iptables -D INPUT -i eth0 -m iprange --src-range 55.105.105.56-55.105.105.255 -j RULE_31
#
# iptables -D RULE_31 -j LOG --log-level notice --log-prefix "RULE 31 -- DENY "
# iptables -D RULE_31 -j DROP
# iptables -X RULE_31
#! <=== To delete the RULES !
#
# # # - - - - - - - - - - - - - - - - Rule 31 - - - - - - - - - - - - - - - - -
#
echo -e "-=AdditionTo--I_F-R--Block_Local--sr0=- script has been executed." | xmessage -file -
|
Last edit: 2012, sep 11.
|
Addition - 2
| Quote: |
Variant of installation: HDD, FULL.
Reset_IPTABLES.txt
| Code: |
#
# # # For QuirkyLinux1.40 ===> /etc/rc.d/rc.firewall(end of the file is for use)
#
iptables -t filter -F > /dev/null 2>&1 ; iptables -t filter -X > /dev/null 2>&1 ; iptables -t nat -F > /dev/null 2>&1 ; iptables -t nat -X > /dev/null 2>&1 ; iptables -t mangle -F > /dev/null 2>&1 ; iptables -t mangle -X > /dev/null 2>&1 ;
iptables -A INPUT -i lo -s 0/0 -d 0/0 -j ACCEPT ; iptables -A OUTPUT -o lo -s 0/0 -d 0/0 -j ACCEPT ; iptables -A INPUT -i eth0 -s 0/0 -d 0/0 -j DROP ; iptables -A OUTPUT -o eth0 -s 0/0 -d 0/0 -j DROP ;
#
# # #
#
|
Last edit: 2013, apr 09.
|
Addition - 3
| Quote: |
Variant of installation: HDD, FULL.
If the web-browser freezes sometimes and there is unknown damage in the OS after rebooting of the OS.
| Code: |
#
# # #
#
#
# Rule 40 (global)
#
echo "Rule 40 (global)"
#
iptables -N RULE_40
iptables -A INPUT -p tcp -m tcp -s 55.105.105.55 -m connlimit --connlimit-above 15 -m state --state NEW -j RULE_40
iptables -A OUTPUT -p tcp -m tcp -m connlimit --connlimit-above 15 -m state --state NEW -j RULE_40
iptables -A RULE_40 -j LOG --log-level info --log-prefix "RULE 40 -- DENY "
iptables -A RULE_40 -j DROP
#
# # #
#
|
Last edit: 2013, may 13.
|
Addition - 4
| Quote: |
To add one more important rule:
| Code: |
#
# # #
#
iptables -m owner --help
#If there is such an option as '-m owner --cmd-owner', then there is the chance to add one more important rule.
#
# # #
#
|
Last edit: 2013, may 13.
|
_________________
- I don't know why laboratories are named a hospitals.
- The alive personage is like a tea bag with granules of unknown density inside, at that one the packet was made of organic material and was placed in the evaporated liquid or liquid.
|
|
Back to top
|
|
 |
|
|
|
Rules_post_cannot Rules_reply_cannot Rules_edit_cannot Rules_delete_cannot Rules_vote_cannot You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|