DaRk_ViVi
Sunday 11 August 2013 - 13:37
Linux
Si ringraziano dicamarques per la guida originale in inglese e somebunny per lo script.
Non conosco Linux, ho semplicemente tradotto la guida, quindi non posso fornire supporto a riguardo
Userò Ubuntu visto che è una delle distro più semplici.
Download- Hostapd (scaricabile direttamente da ubuntu)
- Dnsmasq (anche questo scaricabile direttamente da ubuntu)
- Ubuntu (potete usare il LiveCD ma se lo fate spesso vi conviene installarlo in una Macchina Virtuale o in Dual Boot con Windows)
- Lo script per fare tutto al volo, creato da Somebunny (ha l'SSID ad attwifi di default e 6 indirizzi mac impostati di default (spoof 1 - 6)
Requisiti- Una scheda Wireless con la possibilità di entrare in modalità master
- Un'altra connessione ad Internet (può essere ethernet, wifi o 3g, basta che acceda ad internet)
- Un 3DS!
La guidaAccedi a Linux e scarica
Hostapd e
DnsmasqApri il terminale (CTLR+ALT+T):
CODICE
sudo apt-get update && sudo apt-get install hostapd
sudo apt-get install dnsmasq
Inserisci la chiavetta Wifi (se non è integrato) nel tuo computer e scrivi nel terminale:
CODICE
iwconfig
Dovresti vedere qualcosa come:
CODICE
ppp0 no wireless extensions.
wlan0 IEEE 802.11abg ESSID:off/any
Mode:Managed Access Point: Not-Associated Tx-Power=15 dBm
Retry long limit:7 RTS thr:off Fragment thr:off
Power Management:off
lo no wireless extensions.
eth0 no wireless extensions.
Ora eth0 è la connessione via cavo e wlan0, wlan1 ecc sono le connessioni wifi.
Se siete su un portatile e usate una chiavetta Wifi, probabilmente wlan0 sarà la vostra wifi interna e wlan1 quella USB.
Dopo aver capito il nome della vostra interfaccia è ora di creare l'hotspot:
Create un nuovo documento nella vostra cartella home e chiamatelo "
soft.sh".
Editatelo e scrivete questo dentro:
» Clicca per leggere lo Spoiler! «
CODICE
#!/bin/bash
#Initial wifi interface configuration
ifconfig $1 up 10.0.0.1 netmask 255.255.255.0
sleep 2
###########Start dnsmasq, modify if required##########
if [ -z "$(ps -e | grep dnsmasq)" ]
then
dnsmasq
fi
###########
#Enable NAT
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
iptables --table nat --append POSTROUTING --out-interface $2 -j MASQUERADE
iptables --append FORWARD --in-interface $1 -j ACCEPT
#Thanks to lorenzo
#Uncomment the line below if facing problems while sharing PPPoE, see lorenzo's comment for more details
#iptables -I FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
sysctl -w net.ipv4.ip_forward=1
#start hostapd
hostapd ./hostapd.conf 1> /dev/null
killall dnsmasq
Poi create un altro file chiamato "
hostapd.conf" e incollate questo dentro: (cambiate wlan0 in quello che voi usate come hotspot) (potreste dover anche cambiare driver, controllate il punto "Controllare il supporto della scheda wifi")
CODICE
interface=wlan0
driver=nl80211
ssid=_The Cloud
hw_mode=g
channel=6
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=0
Nella console scrivete "
sudo gedit /etc/dnsmasq.conf", poi premete due volte Invio e incollate questo:
CODICE
# disables dnsmasq reading any other files like /etc/resolv.conf for nameservers
no-resolv
# Interface to bind to
interface=wlan0
# Specify starting_range,end_range,lease_time
dhcp-range=10.0.0.3,10.0.0.20,12h
# dns addresses to send to the clients
server=8.8.8.8
server=8.8.4.4
Ora procedete e aprite (editatelo) lo script di somebunny (suggerisco di salvarlo nella vostra cartella home per comodità).
Vi troverete questo:
» Clicca per leggere lo Spoiler! «
#!/bin/bash
#
# wifi_zone_new
# A script that emulates a Nintendo Zone in a way that you can actually connect to
# other people all over the world.
#
# Initial version written by Somebunny (9. August 2013).
#
#
# documentation (sort of)
#
# You will need the following packages/programs:
# - rfkill
# - dnsmasq (will be killed if already running)
# - hostapd (will be killed if already running)
# You should not need any additional configuration work.
#
# This script MUST be run as root, or using sudo, reconfiguring network
# interfaces does not seem to work when run by non-root.
#
# Please adapt the following sections to your own computer:
# - variables "zone" and "world", found below
# - you can add hotsoptr in "InitZone()", just copy what is there
#
# Usage: call the script with one extra parameter that describes the
# MAC address to use. I have prepared some options that work from
# the thread in the gmatemp forums.
#
# Shutdown: call the script with the parameer "stop".
#
#
# A first attempt to organise everything in a somewhat smarter way.
#
# First, some obligatory checks.
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root or with sudo."
echo "I don't like this either, but some calls here are really picky!"
exit 1
fi
# some global settings; you should only need to adapt them for your system once
# * this is the network interface used for your custom AP; must be wireless
zone=wlan1
# * this is the network interface used to access the internet; can be almost anything
world=wlan2
# some local variables; using default values so that something is there
ssid="_The Cloud"
mac=f4:6d:04:a1:6b:86
country=DE
name="Somebunny, WiFi card that recently died"
#
# local function that sets up the local variables;
# crude but better than having to change the script every time
# NOTE: this part should be heavily modified so that it doesn't
# depend on a static config. Maybe something with an external
# file or something, so you don't have to share your relay point
# with the entire world if you don't want to.
#
InitZone() {
# kill all existing support tools
killall dnsmasq 2> /dev/null
killall hostapd 2> /dev/null
# flush routing entries
iptables --flush
# deconfigure network interface
/sbin/ifconfig $zone down
case $1 in
"stop")
# emergency exit - restore old network state
echo "Stopping Nintendo Zone hotspot"
/etc/init.d/network-manager restart # yeah... didn't find a better way to fix it...
exit
;;
"default")
# default settings, my old WiFi card that recently died
;;
"stick1")
# this is my old and trusty WiFi stick
ssid="_The Cloud"
mac=00:25:86:d1:d8:a3
country=DE
name="Somebunny, old and trusty WiFi stick"
;;
"duke")
# my first tester, who helped me figure out how it works!
mac=5C:3C:27:F3:D 1:CA
country=RU
name="Dukes second MAC address"
;;
# "duke2")
# # my first tester, who helped me figure out how it works!
# # doesn't work, even with country code! werid...
# mac=20:CF:30:CE:1C:C8
# country=RU
# name="Dukes first MAC address"
# ;;
"signz")
# from the gbatemp forums
# couldn't get it working yet!
mac=40:53:50:4f:4f:46
#country=DE # doesn't work!
#country=US # doesn't work!
name="Provided by SignZ; couldn't make it work yet"
;;
"neocrux")
# from the gbatemp forums
mac=00:eb:2d:d8:62:aa
country=US
name="Provided by neocrux"
;;
"jhjsaat")
# from the gbatemp forums
mac=34:08:04:BF:AC:8A
#country=US
#country=US # doesn't work!
name="jhjsaat's personal router, from Google docs"
;;
"kaleoomega")
# from the gbatemp forums
mac=CC:FE:3C:92:D F:43
#country=US
#country=US # doesn't work!
name="kaleoOmega's personal phone"
;;
esac
}
# networkmanager often leaves a lock on the wireless hardware, remove it
rfkill unblock wifi
# set up parameters
InitZone $1
# give our wifi device a static IP address in the correct range so hostapd can associate with it
/sbin/ifconfig $zone hw ether $mac
/sbin/ifconfig $zone 192.168.23.1 up
# start dnsmasq
dnsmasq -i $zone --dhcp-range=192.168.23.50,192.168.23.150,255.255.255.0,12h
# enable IP forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward
# set basic routes so that our associated devices can reach the web
iptables -t nat -A POSTROUTING -o $zone -j MASQUERADE
iptables -A FORWARD -i $zone -o $world -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i $world -o $zone -j ACCEPT
# start hostapd, spawn a temporary file
TMPDIR=`mktemp -d`
tmpfile=$TMPDIR/nztmp
echo $tmpfile
trap "rm -rf $TMPDIR" EXIT
echo "interface=${zone}" >> $tmpfile
echo "driver=nl80211" >> $tmpfile
echo "channel=1" >> $tmpfile
echo "ssid=${ssid}" >> $tmpfile
echo "auth_algs=1" >> $tmpfile
echo "wpa=0" >> $tmpfile
echo "country_code=${country}" >> $tmpfile
# uncomment the following two lines if you want MAC filtering
#echo "macaddr_acl=1" >> $tmpfile
#echo "accept_mac_file=/home/ms/hostapd/hostapd_mac_file" >> $tmpfile
echo "Starting Nintendo Zone hotspot, using config ''${name}''"
echo "SSID: ${ssid}"
echo "Country: ${country}"
hostapd $tmpfile -B -d > /dev/null 2> /dev/null
rm -rf $TMPDIR
E' un bel po' di roba! Ma non vi preoccupate dobbiamo solo modificare due righe.
Cambiate:
- "zone=" nella wlan che usate come hotspot (per esempio zone=wlan1)
- "world=" nell'interfaccia che usate per connettervi ad internet (per esempio world=eth0)
Tornate al terminale e scrivete questo:
CODICE
sudo chmod +x wifi_zone.sh
sudo chmod +x soft.sh
Ora avviate l'hotspot:
(questa parte bisogna eseguirla tutte le volte che avviate il computer)CODICE
sudo ./soft.sh scheda_wireless interfaccia_internet
Esempio: sudo ./soft.sh wlan0 eth0
Controllate se trovate l'hotspot con qualche dispositivo e poi premete
CTRL+C per fermare l'esecuzione.
Ora avviate lo script di somebunny:
CODICE
sudo ./wifi_zone.sh
Questo comando puo' essere eseguito con le seguenti opzioni:
CODICE
sudo ./wifi_zone.sh spoofX
Dove X è un numero da 1 a 6 e cambierà il vostro mac con uno dei primi 6 nella lista.
(dovete scriverlo tutte le volte che volete usare l'hotspot NintendoZone)
Per fermarlo:CODICE
sudo ./wifi_zone.sh stop
Se tutto è stato eseguito correttamente, dovresti avviare il 3DS e trovarlo nella NintendoZone
direttamente da casa, con l'applicazione correttamente accessibile e utilizzabile.
Ora aspettate un po' e dovreste vedere il LED verde accendersi!