miércoles, 3 de febrero de 2016

FUNCIONAMIENTO DE TECLAS, CONECTORES Y PUERTOS DEL BLACBERRY 8520


REINICIAR BLACBERRY 8520 SIN SACAR LA BATERÍA DESDE EL TECLADO.

Por ciertos motivos hay veces que tenemos que reiniciar nuestro dispositivo blackberry, como por ejemplo: el funcionamiento de ciertas aplicaciones que necesitan usar paquetes de datos o conexión WIFI y después de cierto tiempo pierden conexión entonces es necesario reiniciar el dispositivo para que estas aplicaciones vuelvan a funcionar correctamente.
Es tedioso sacara la batería y volverla a poner para que el dispositivo se reinicie, por esta razón les presento una manera mas cómoda de reiniciar el dispositivo en este caso es el blackberry 8520.


1. Presionamos y mantenemos presionada la tecla Alt que se encuentra en el lado izquierdo-inferior. Ej:




2. Luego presionamos y mantenemos presionada la tecla Mayúsculas de la derecha-inferior. Ej:



3. Posteriormente presionamos y mantenemos la tecla de retroceso/eliminar "del". Ej:



4. Finalmente dejamos de presionar las tres teclas mencionadas anteriormente.

5. Y por ultimo presionamos nuevamente la tecla alt, la misma que presionamos al principio. Ej:


5. Si presionaron las teclas en el orden correcto el dispositivo empezara a reiniciare automáticamente, solo esperamos a que realice el proceso de reinicio y vuelva a encender por si solo.

miércoles, 2 de septiembre de 2015

Ejemplo de script completo en Brazilfw

#!/bin/bash
# Configure Iptables for Firewalling and NAT

echo "       #######################################"
echo "       #          Enabling Firewall          #"
echo "       #######################################"

### Location of the iptables and kernel module programs
IPTABLES=/sbin/iptables
#IPTABLES=/usr/local/sbin/iptables

### declaring interfaces
INET='ppp0'
LAN='eth0'

# disable forwarding - done for security - enabled at the end
echo " - Disabling forwarding (security).."
echo "0" > /proc/sys/net/ipv4/ip_forward

echo " - Enabling DynamicAddr.."
echo "1" > /proc/sys/net/ipv4/ip_dynaddr

### Clearing previous rules and setting default policy ###
echo "Clearing previous rules and setting default policy..."

$IPTABLES -F INPUT
$IPTABLES -P INPUT DROP
$IPTABLES -F OUTPUT
$IPTABLES -P OUTPUT ACCEPT
$IPTABLES -F FORWARD
$IPTABLES -P FORWARD DROP
$IPTABLES -t nat -F
### Clearing previous rules and setting default policy END ###


### FORWARD ###
echo "Enabling Forwarding..."

# FORWARD: Allow all connections OUT and only existing and related ones IN..
$IPTABLES -A FORWARD -i $INET -o $LAN -m state --state ESTABLISHED,RELATED -j ACCEPT

$IPTABLES -A FORWARD -i $LAN -o $INET -j ACCEPT
### FORWARD END ###



### NAT ###
echo "Enabling Nat..."

echo " - Enabling SNAT (MASQUERADE) functionality on internet interface.."
$IPTABLES -t nat -A POSTROUTING -o $INET -j MASQUERADE
### NAT END ###


### General INPUT ###
echo "Enabling General INPUT rules..."

$IPTABLES -A INPUT -i $LAN -m state --state RELATED,ESTABLISHED -j ACCEPT  # allow incomming replys on outgoing lan traffic
$IPTABLES -A INPUT -i $INET -m state --state RELATED,ESTABLISHED -j ACCEPT # allow incomming replys on outgoing internet traffic
### General INPUT END ###


### Localhost ###
echo "Localhost rules..."

$IPTABLES -A INPUT -i lo -j ACCEPT    # allow all incomming traffic on localhost
$IPTABLES -A OUTPUT -o lo -j ACCEPT   # allow all outgoing traffic on localhost
### Localhost END ###


### ICMP  ###
echo "ICMP rules..."

$IPTABLES -A INPUT -p icmp -m state --state RELATED,ESTABLISHED -j ACCEPT          # allow replys on outgoing icmp traffic
$IPTABLES -A INPUT -i $LAN -p icmp --icmp-type 8 -m limit --limit 1/sec -j ACCEPT  # allow echo request comming from lan
$IPTABLES -A INPUT -p icmp -j LOG --log-prefix "All other icmp:"                   # log all other icmp traffic
### ICMP END ###


### Samba ###
echo "Samba rules..."

$IPTABLES -A INPUT -i $LAN -p tcp --dport 137 -j ACCEPT  # NetBIOS name service tcp
$IPTABLES -A INPUT -i $LAN -p udp --dport 137 -j ACCEPT  # NetBIOS name service udp
$IPTABLES -A INPUT -i $LAN -p udp --dport 138 -j ACCEPT  # NetBIOS datagram service
$IPTABLES -A INPUT -i $LAN -p tcp --dport 139 -j ACCEPT  # NetBIOS session service File/printer sharing and other operations
$IPTABLES -A INPUT -i $LAN -p tcp --dport 445 -j ACCEPT  # Used by Win2k/xp when NetBIOS over TCP/IP is disabled - Microsoft Common Internet File System
$IPTABLES -A INPUT -i $LAN -p udp --dport 445 -j ACCEPT
#$IPTABLES -A INPUT -i $LAN -p tcp --dport 901 -j ACCEPT  # used by SWAT (GUI configuration tool for samba)
### Samba END ###


### SSH ###
echo "SSH rules..."

$IPTABLES -A INPUT -i $LAN -p tcp --dport 22 -j ACCEPT  # allow ssh connections from lan
### SSH END ###


### Webserver ###
echo "Webserver rules..."

$IPTABLES -A INPUT -i $LAN -p tcp --dport 80 -j ACCEPT  # Open Webserver to lan
### Webserver END ###



### DNAT eMULE ###
echo "DNAT eMule..."


$IPTABLES -A FORWARD -j ACCEPT -p tcp --dport 4545
$IPTABLES -t nat -A PREROUTING -i $INET -p tcp --dport 4545 -j DNAT --to 192.168.0.1:4545
$IPTABLES -A FORWARD -j ACCEPT -p udp --dport 4646
$IPTABLES -t nat -A PREROUTING -i $INET -p udp --dport 4646 -j DNAT --to 192.168.0.1:4646

$IPTABLES -A FORWARD -j ACCEPT -p tcp --dport 4661
$IPTABLES -t nat -A PREROUTING -i $INET -p tcp --dport 4661 -j DNAT --to 192.168.0.1:4661
$IPTABLES -A FORWARD -j ACCEPT -p udp --dport 4672
$IPTABLES -t nat -A PREROUTING -i $INET -p udp --dport 4672 -j DNAT --to 192.168.0.1:4672
$IPTABLES -A FORWARD -j ACCEPT -p tcp --dport 4662
$IPTABLES -t nat -A PREROUTING -i $INET -p tcp --dport 4662 -j DNAT --to 192.168.0.1:4662
$IPTABLES -A FORWARD -j ACCEPT -p tcp --dport 4771
$IPTABLES -t nat -A PREROUTING -i $INET -p tcp --dport 4771 -j DNAT --to 192.168.0.1:4771

$IPTABLES -A FORWARD -j ACCEPT -p tcp --dport 3306
$IPTABLES -t nat -A PREROUTING -i $INET -p tcp --dport 3306 -j DNAT --to 192.168.0.1:3306


### DNAT eMULE END ###

# block all outgoing traffic to the internet from port 0:1024
$IPTABLES -A OUTPUT -o $INET -p tcp --sport 1:1024 -j DROP
$IPTABLES -A OUTPUT -o $INET -p udp --sport 1:1024 -j DROP


$IPTABLES -A INPUT -i $INET -j LOG                          # Log all other input from internet
$IPTABLES -A FORWARD -j LOG --log-prefix "Forward:"         # Log all other forward
$IPTABLES -A INPUT -i $LAN -j LOG --log-prefix "from LAN:"  # log all other input form lan

# enable forwarding - done last for security
echo " - Enabling forwarding.."
echo "1" > /proc/sys/net/ipv4/ip_forward

# saving iptables rules (works for Redhat/Fedora) (perhaps other distributions too)
/sbin/iptables-save

Script para bloquear por IP en BrazilFW

iptables -I FORWARD -s 192.168.0.9 -j DROP

Script para bloquear facebook en BrazilFW

##BLOQUEO DE FACEBOOK
FACEBOOK_IP_RANGE="31.13.64.0-31.13.127.255 31.13.24.0-31.13.31.255 74.119.76.0-74.119.79.255 69.63.176.0-69.63.191.255 69.171.224.0-69.171.255.255 66.220.144.0-66.220.159.255 204.15.20.0-204.15.23.255 173.252.64.0-173.252.127.255"
iptables -N FACEBOOK

## FACEBOOK DENEGADO
for face in $FACEBOOK_IP_RANGE; do
iptables -I FORWARD -m tcp -p tcp -m iprange --dst-range $face --dport 443 -j FACEBOOK
iptables -I FORWARD -m tcp -p tcp -m iprange --dst-range $face --dport 80 -j FACEBOOK

done

FACEBOOK_ALLOW="192.168.254.101 192.168.254.102 192.168.254.106 192.168.254.107 192.168.254.108 192.168.254.109 192.168.254.110 192.168.254.111 192.168.254.112 192.168.254.113 192.168.254.114 192.168.254.175" #PERMITIDOS
for MSR_LIBERADO in $FACEBOOK_ALLOW; do
iptables -I FACEBOOK -s $MSR_LIBERADO -j ACCEPT
done

iptables -A FACEBOOK -j REJECT

exit 0

Crear archivo .sh con restricción al youtube en BrazilFW

touch youtube.sh #creo el archivo youtube.sh
edit youtube.sh

luego escribimos las siguientes líneas
#!/bin/sh
echo "Youtube Bloqueado"
iptables -t mangle -A PREROUTING -s 192.168.0.1/24 -p tcp -m string --algo kmp --string "youtube" -j DROP

Presionamos ctrl+Q y luego “Y” para guardar los cambios.
Luego le damos permisos de ejecución:
chmod +x youtube.sh
Finalmente para ejecutarlo simplemente escribimos ./youtube.sh

martes, 1 de septiembre de 2015

Bloquear Youtube BrazilFW 3.X

A continuación el scrip para restringir Youtube mediante las iptables en Brazilfw:

iptables -t mangle -A PREROUTING -s 192.168.0.1/24 -p tcp -m string --algo kmp --string "youtube" -j DROP