Remote Exploit Forums

Go Back   Remote Exploit Forums > Archives > BackTrack 3 Final > BackTrack3 Howtos


BackTrack3 Howtos Add your howto articles / tutorials here.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-31-2009, 03:54 PM
Just burned his ISO
 
Join Date: Oct 2009
Location: The Netherlands
Posts: 3
Lightbulb Bluetooth setup (Blue-Buildv1.0c)

= BT3 ONLY! =

Hey every1,

This is my very first post and after reading alot of tuts on this forum i decided to give something back.

Setting up bluetooth properly can be a pain in the ass(if you know little about it). Thats why i've made a little shell script menu wich allows the configuration to be easy and reliable.
This script was is build out of drgr33n's bluetooth tutorial in combination with some other users comments and other sources.
I havent tested this with bluesnarf and bluebug due lack of equipment. But the least it can do is let you properly pair with your cell.

Here is the shell code:

Code:
menu=n
while [ $menu = n ]
do
menu=y
clear
echo -----------------------------------------------
echo "Blue-Build v1.0c"
echo "Made by n00baday"
echo
echo "Special tnx to drgr33n, DARTIS, and thewheelieking."
echo -----------------------------------------------
echo
echo "[1] Config Bluetooth"
echo "[2] Bind rfcomm multi"
echo "[3] Bind rfcomm solo"
echo "[4] Test obexftp connection"
echo "[5] Change your mac adress"
echo
echo Choice? "(1,2,3)"
read choice
case $choice in
  1)
echo
echo
echo "What is your hci adapter? (e.g. hci0)"
read dhci
echo "Pincode? (e.g. 0000, 1234)"
read dpin
echo "Your broadcast name?"
read dname
echo "Local device class? (eg. 0x5a0204)"
read dclass
echo
echo "Removing old hcid.conf..."
rm /etc/bluetooth/hcid.conf
echo "Building hcid.conf..."
echo '#
# HCI daemon configuration file.
#

# HCId options
options {
	# Automatically initialize new devices
	autoinit yes;

	# Security Manager mode
	#   none - Security manager disabled
	#   auto - Use local PIN for incoming connections
	#   user - Always ask user for a PIN
	#
	security auto;

	# Pairing mode
	#   none  - Pairing disabled
	#   multi - Allow pairing with already paired devices
	#   once  - Pair once and deny successive attempts
	pairing multi;

	# Default PIN code for incoming connections
	passkey "'$dpin'";
}

# Default settings for HCI devices
device {
	# Local device name
	#   %d - device id
	#   %h - host name
	name "'$dname'";

	# Local device class
	class '$dclass';
	#use hcitool inq to determine a devices class

	# Default packet type
	#pkt_type DH1,DM1,HV1;

	# Inquiry and Page scan
	iscan enable; 
	pscan enable;

	# Default link mode
	#   none   - no specific policy 
	#   accept - always accept incoming connections
	#   master - become master on incoming connections,
	#            deny role switch on outgoing connections
	lm accept,master;

	# Default link policy
	#   none    - no specific policy
	#   rswitch - allow role switch
	#   hold    - allow hold mode
	#   sniff   - allow sniff mode
	#   park    - allow park mode
	lp rswitch,hold,sniff,park;
	auth enable;
	encrypt enable; 
}' >> /etc/bluetooth/hcid.conf
chmod +x /etc/bluetooth/hcid.conf
echo "Building PIN..."
echo "$dpin" >> /etc/bluetooth/passkeys/default
chmod +x /etc/bluetooth/passkeys/default
echo
echo "Restarting bluetooth..."
bash /etc/rc.d/rc.bluetooth restart
hciconfig $dhci reset
echo "Done..."
;;
  2) 
echo
echo
echo Target MAC?
read mac
echo "Interface? (hci*)"
read int
echo Dailup channel?
read dail
echo OBEX Push channel?
read obexp
echo OBEX FTP channel?
read obex
echo
echo "Releasing old rfcomm binds..."
rfcomm release 0
rfcomm release 1
rfcomm release 2
rfcomm release 3
#echo restarting bluetooth...
#bash /etc/rc.d/rc.bluetooth restart
#hciconfig $int up
#echo enabling Inquiry and Page scan...
#hciconfig $int piscan
#echo mknod...
#mknod -m 666 /dev/rfcomm1 c 216 1
#mknod -m 666 /dev/rfcomm2 c 216 2
#mknod -m 666 /dev/rfcomm3 c 216 3
#echo sdptool...
#sdptool add --channel=1 DUN
#sdptool add --channel=2 FTP
#sdptool add --channel=3 OPUSH
echo "Binding new rfcomm..."
rfcomm bind 0 $mac $dail
rfcomm bind 1 $mac $obexp
rfcomm bind 2 $mac $obex
echo printing rfcomm binds...
rfcomm
echo done...
;;	
  3) 
menu=n
while [ $menu = n ]
do
menu=y
echo
echo
echo "Wich service would you bind on rfcomm0?"
echo "[1] Dial-up"
echo "[2] Obex ftp"
echo "[3] Obex-push-profile"
echo
echo Choice? "(1,2,3)"
read choice
case $choice in
  1)
ser="DUN"
;;
  2) 
ser="FTP"
;;	
  3) 
ser="OPUSH"
;;
*) 
clear;
echo Error, Wrong choice;
echo ;
echo "Press [enter] key to continue. . .";
read enterKey;
menu=n;;
esac
done
echo Target MAC?
read mac
echo "Interface? (hci*)"
read int
echo Service channel?
read cnnl
echo "Releasing old rfcomm binds..."
rfcomm release 0
rfcomm release 1
rfcomm release 2
rfcomm release 3
#echo restarting bluetooth...
#bash /etc/rc.d/rc.bluetooth restart
#hciconfig $int up
#echo enabling Inquiry and Page scan...
#hciconfig $int piscan
#echo mknod...
#mknod -m 666 /dev/rfcomm0 c 216 1
#echo setting up sdptool...
#sdptool add --channel=1 $ser
echo "Binding new rfcomm..."
rfcomm bind 0 $mac $ser
echo printing rfcomm bind...
rfcomm
echo done...
;;
4)
echo "Client mac you want to connect with?"
read pmac
obexftp -b $pmac -c / -l
;;
5)
echo "All rfcomm binds will be released during a mac change"
echo
echo "Your new mac adress?"
read smac
echo "The hci adapter? (e.g. hci0)"
read sdev
bdaddr $smac
echo "Restarting bluetooth..."
bash /etc/rc.d/rc.bluetooth restart
hciconfig $sdev reset
hciconfig $sdev
echo
echo "If your mac remained the same, please replug your bt-adapter."
;;
*) 
clear;
echo Error, Wrong choice;
echo ;
echo "Press [enter] key to continue. . .";
read enterKey;
menu=n;;
esac
done
Im unsure if the rfcomm bindings are correct, also I cant garantue that the mac change option will work. So @ everyone who knows something about bluetooth, PLEASE look into this

later.
__________________
"Quotes: this one took me 10 seconds."
Reply With Quote
  #2 (permalink)  
Old 10-31-2009, 09:03 PM
archangel.amael's Avatar
Moderator
 
Join Date: Nov 2007
Location: behind the wire
Posts: 3,466
Default

Thread moved to appropriate area of the forums.
This is for BT3 as stated by the OP = BT3 ONLY! =
__________________
The very existence of flame-throwers proves that some time, somewhere, someone said to themselves, You know, I want to set those people over there on fire, but I'm just not close enough to get the job done.
George Carlin
Reply With Quote
  #3 (permalink)  
Old 11-03-2009, 01:31 PM
Just burned his ISO
 
Join Date: Oct 2009
Location: The Netherlands
Posts: 3
Default

Quote:
Originally Posted by archangel.amael View Post
Thread moved to appropriate area of the forums.
This is for BT3 as stated by the OP = BT3 ONLY! =
Thanks, i couldn't post in the BT3 area for some reason.
__________________
"Quotes: this one took me 10 seconds."
Reply With Quote
Reply

Bookmarks

Tags
bluebug, bluesnarf, bluetooth, hcid.conf, rfcomm

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 11:47 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2