Results 1 to 5 of 5

Thread: Bluetooth setup (Blue-Buildv1.0c)

Hybrid View

  1. #1
    Just burned his ISO
    Join Date
    Oct 2009
    Posts
    4

    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 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 DavetehDuud"
    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.
    je moeder

  2. #2
    Super Moderator Archangel-Amael's Avatar
    Join Date
    Jan 2010
    Location
    Somewhere
    Posts
    8,012

    Default

    Thread moved to appropriate area of the forums.
    This is for BT3 as stated by the OP = BT3 ONLY! =
    To be successful here you should read all of the following.
    ForumRules
    ForumFAQ
    If you are new to Back|Track
    Back|Track Wiki
    Failure to do so will probably get your threads deleted or worse.

  3. #3
    Just burned his ISO
    Join Date
    Oct 2009
    Posts
    4

    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.
    je moeder

  4. #4
    Just burned his ISO
    Join Date
    Oct 2009
    Posts
    4

    Lightbulb video

    I've made a lil video using this script, goto youtube and search for "Preparing bluetooth for backtrack 3". Then its the first video.

    You can also find some other bluetooth related vids on this channel.
    je moeder

  5. #5
    Just burned his ISO
    Join Date
    Jan 2009
    Posts
    11

    Default

    i use it since you posted it. it works. did not try macchanger though...
    thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •