Bluetooth network PAN

No replies
R3tro
Offline
Neophyte
Joined: 2019/01/10

One day i was talking to my friend about a hacking with raspberry i wanted do, but i found a problem, how could i connect to raspberry ssh through bluetooth. At the first, i thought existed already app for this. But i discovered it's not so easy as i thought.

For make this connection, we need make a PAN(Personal Area Network) with Berry bluetooth.

So, lets go, baby.

IT'S SHOW TIME, BITCH!

First, we have make our Network Interface. This process is very simple, is just follow these following commands. If you are newbie in Linux, keep calm, i assure you these commands will not remove your HD. Or maybe will.
hue.

Our network interface will be named pan0.

pan0 - 10.1.0.1/24

$ brctl addbr pan0  
$ brctl setfd pan0 0
$ brctl stp pan0 off
$ ifconfig pan0 10.1.0.1 netmask 255.255.255.0

Or if you are lazy, you can copy this and paste in your "/etc/network/interfaces".

auto pan0
iface pan0 inet static
        address 10.1.0.1
        netmask 255.255.255.0
        broadcast 10.1.0.255
        bridge_ports none
        bridge_fd 0
        bridge_stp off

Now we've created our interface, we need two python scripts.

btnap.py - this will do the magic.

blueagent5.py -this will create the pin for the pairing.

The script have two mode, the client mode and the server mode. But we'll use only the server mode. The script will also the network interface. In this case, pan0.

I put "&" in the end because i don't wanna open a new terminal.

$ python2 btnap.py server pan0 &

Now we'll start the our other script, blueagent5, it will do the pairing..

$ python2 blueagent5.py --pin 6666 &

Maybe your mobile i'snt discovering the berry bluetooth. If this is happening, allow the discovery mode with this following command.

$ hciconfig hci0 pisca

hci0, in this case, is our bluetooth interface, if your is different, just change there.

Done, bitch! we finished. Now is just connect the network, with your mobile, and connect the Berry ssh.

In my case, i use the terminal emulator Termux in my mobile.

Image

YEAH!! i'm connected to the network! Now, i'll try connect to the berry ssh.

Image

Yeah, we got, throught the bluetooth, make a ssh connection to the our raspberry.

Some mobiles don't allow you connect to the wifi and bluetooth at same time.

Good byte.

https://elinux.org/Bluetooth_Network

https://stackoverflow.com/questions/283 ... s/40579423