Enviado em 12/08/2017 - 21:53h
Boa noite!!!
#!/system/bin/sh
IPTABLES=iptables
BUSYBOX=busybox
GREP=grep
ECHO=echo
# Try to find busybox
if /data/data/com.googlecode.droidwall.free/app_bin/busybox_g1 --help >/dev/null 2>/dev/null ; then
BUSYBOX=/data/data/com.googlecode.droidwall.free/app_bin/busybox_g1
GREP="$BUSYBOX grep"
ECHO="$BUSYBOX echo"
elif busybox --help >/dev/null 2>/dev/null ; then
BUSYBOX=busybox
elif /system/xbin/busybox --help >/dev/null 2>/dev/null ; then
BUSYBOX=/system/xbin/busybox
elif /system/bin/busybox --help >/dev/null 2>/dev/null ; then
BUSYBOX=/system/bin/busybox
fi
# Try to find grep
if ! $ECHO 1 | $GREP -q 1 >/dev/null 2>/dev/null ; then
if $ECHO 1 | $BUSYBOX grep -q 1 >/dev/null 2>/dev/null ; then
GREP="$BUSYBOX grep"
fi
# Grep is absolutely required
if ! $ECHO 1 | $GREP -q 1 >/dev/null 2>/dev/null ; then
$ECHO The grep command is required. DroidWall will not work.
exit 1
fi
fi
# Try to find iptables
if /data/data/com.googlecode.droidwall.free/app_bin/iptables_armv5 --version >/dev/null 2>/dev/null ; then
IPTABLES=/data/data/com.googlecode.droidwall.free/app_bin/iptables_armv5
fi
$IPTABLES --version || exit 1
# Create the droidwall chains if necessary
$IPTABLES -L droidwall >/dev/null 2>/dev/null || $IPTABLES --new droidwall || exit 2
$IPTABLES -L droidwall-3g >/dev/null 2>/dev/null || $IPTABLES --new droidwall-3g || exit 3
$IPTABLES -L droidwall-wifi >/dev/null 2>/dev/null || $IPTABLES --new droidwall-wifi || exit 4
$IPTABLES -L droidwall-reject >/dev/null 2>/dev/null || $IPTABLES --new droidwall-reject || exit 5
# Add droidwall chain to OUTPUT chain if necessary
$IPTABLES -L OUTPUT | $GREP -q droidwall || $IPTABLES -A OUTPUT -j droidwall || exit 6
# Flush existing rules
$IPTABLES -F droidwall || exit 7
$IPTABLES -F droidwall-3g || exit 8
$IPTABLES -F droidwall-wifi || exit 9
$IPTABLES -F droidwall-reject || exit 10
# Create the log and reject rules (ignore errors on the LOG target just in case it is not available)
$IPTABLES -A droidwall-reject -j LOG --log-prefix "[DROIDWALL] " --log-uid
$IPTABLES -A droidwall-reject -j REJECT || exit 11
# Allow DNS lookups on white-list for a better logging (ignore errors)
$IPTABLES -A droidwall -p udp --dport 53 -j RETURN
# Main rules (per interface)
$IPTABLES -A droidwall -o rmnet+ -j droidwall-3g || exit
$IPTABLES -A droidwall -o pdp+ -j droidwall-3g || exit
$IPTABLES -A droidwall -o ppp+ -j droidwall-3g || exit
$IPTABLES -A droidwall -o uwbr+ -j droidwall-3g || exit
$IPTABLES -A droidwall -o wimax+ -j droidwall-3g || exit
$IPTABLES -A droidwall -o vsnet+ -j droidwall-3g || exit
$IPTABLES -A droidwall -o ccmni+ -j droidwall-3g || exit
$IPTABLES -A droidwall -o usb+ -j droidwall-3g || exit
$IPTABLES -A droidwall -o tiwlan+ -j droidwall-wifi || exit
$IPTABLES -A droidwall -o wlan+ -j droidwall-wifi || exit
$IPTABLES -A droidwall -o eth+ -j droidwall-wifi || exit
$IPTABLES -A droidwall -o ra+ -j droidwall-wifi || exit
# Filtering rules
# dhcp user
$IPTABLES -A droidwall-wifi -m owner --uid-owner 1014 -j RETURN || exit
# wifi user
$IPTABLES -A droidwall-wifi -m owner --uid-owner 1010 -j RETURN || exit
$IPTABLES -A droidwall-3g -m owner --uid-owner 10045 -j RETURN || exit
$IPTABLES -A droidwall-3g -m owner --uid-owner 10073 -j RETURN || exit
$IPTABLES -A droidwall-3g -m owner --uid-owner 10124 -j RETURN || exit
$IPTABLES -A droidwall-3g -m owner --uid-owner 10098 -j RETURN || exit
$IPTABLES -A droidwall-3g -m owner --uid-owner 10116 -j RETURN || exit
$IPTABLES -A droidwall-3g -m owner --uid-owner 10129 -j RETURN || exit
$IPTABLES -A droidwall-3g -m owner --uid-owner 10147 -j RETURN || exit
$IPTABLES -A droidwall-3g -m owner --uid-owner 10136 -j RETURN || exit
$IPTABLES -A droidwall-3g -m owner --uid-owner 10038 -j RETURN || exit
$IPTABLES -A droidwall-wifi -m owner --uid-owner 10045 -j RETURN || exit
$IPTABLES -A droidwall-wifi -m owner --uid-owner 10073 -j RETURN || exit
$IPTABLES -A droidwall-wifi -m owner --uid-owner 10132 -j RETURN || exit
$IPTABLES -A droidwall-wifi -m owner --uid-owner 10124 -j RETURN || exit
$IPTABLES -A droidwall-wifi -m owner --uid-owner 10098 -j RETURN || exit
$IPTABLES -A droidwall-wifi -m owner --uid-owner 10186 -j RETURN || exit
$IPTABLES -A droidwall-wifi -m owner --uid-owner 10062 -j RETURN || exit
$IPTABLES -A droidwall-wifi -m owner --uid-owner 10058 -j RETURN || exit
$IPTABLES -A droidwall-wifi -m owner --uid-owner 10116 -j RETURN || exit
$IPTABLES -A droidwall-wifi -m owner --uid-owner 10129 -j RETURN || exit
$IPTABLES -A droidwall-wifi -m owner --uid-owner 10147 -j RETURN || exit
$IPTABLES -A droidwall-wifi -m owner --uid-owner 10136 -j RETURN || exit
$IPTABLES -A droidwall-wifi -m owner --uid-owner 10125 -j RETURN || exit
$IPTABLES -A droidwall-wifi -m owner --uid-owner 10038 -j RETURN || exit
$IPTABLES -A droidwall-wifi -m owner --uid-owner 10154 -j RETURN || exit - ESTA É A LINHA DO MEU WHATSAPP
$IPTABLES -A droidwall-3g -j droidwall-reject || exit
$IPTABLES -A droidwall-wifi -j droidwall-reject || exit
exit
Enviar mensagem ao usuário trabalhando com as opções do php.ini
Meu Fork do Plugin de Integração do CVS para o KDevelop
Compartilhando a tela do Computador no Celular via Deskreen
Como Configurar um Túnel SSH Reverso para Acessar Sua Máquina Local a Partir de uma Máquina Remota
Configuração para desligamento automatizado de Computadores em um Ambiente Comercial
Criando uma VPC na AWS via CLI
Multifuncional HP imprime mas não digitaliza
Dica básica para escrever um Artigo.
Como Exibir Imagens Aleatórias no Neofetch para Personalizar seu Terminal
Erro no cups.file [RESOLVIDO] (10)
Pq me aparece isso quando fui atualizar o Ubuntu 24.10 no terminal? (3)
Pegar a ultima ocorrencia viva (2)
como coloco para instalar com esse erro. (13)
Alguém sabe de documentos de texto e /ou vídeo aulas de certificações ... (1)