Giter Site home page Giter Site logo

blueshell's Introduction

blueshell

blueshell is a program for logging into a remote machine via bluetooth to execute shell commands.
Before a connection can be established a blueshell server need to run on the machine you want to control.

Usage

Usage: blueshell [OPTIONS] ...

-h, --help               Show helptext and quit
-v, --verbose            Run in verbose mode

-D, --device-info        Show information about default device
-s, --scan               Scan for nearby bluetooth devices

-a, --addr=MAC(/PORT)    Set macaddress (and port)
-c, --client             Run in client mode
-l, --listen             Run in server mode (default)

Interactive client mode

When running blueshell in client mode an interactive shell will appear.
There are three types of commands:

  1. Blueshell internal commands
  2. Commands executed at the server
  3. Commands executed at the client

Internal commands
All blueshell internal commands starting with a slash (/).

/help   Show help for blueshell client
/exit   Disconnect and quit blueshell

Remote Commands
All commands without a prefix are executed at the remote machine (server).
You can use any unix/linux command you think of (like ls, mkdir, ...) with some minor exceptions (ncurses, vi, ...).

[blueshell]# ls -la
total 40
drwxr-xr-x  5 server server 4096 12 jan 14:59 .
drwxr-xr-x 58 server server 4096 12 jan 10:31 ..
drwxr-xr-x  8 server server 4096 30 jan 07:38 .git

Local Commands
Commands starting with a ! will be executed at the local machine.
You can use any unix/linux command you think of (like ls, mkdir, ...) with some minor exceptions (ncurses, vi, ...).

[blueshell]# !ls -la
total 40
drwxr-xr-x  5 client client 4096 22 feb 22:52 .
drwxr-xr-x 58 client client 4096 22 feb 16:56 ..
drwxr-xr-x  8 client client 4096 22 feb 22:53 .git

Install

Before compiling blueshell you need to install libbluetooth-dev.
On debian based system type:

sudo apt-get install libbluetooth-dev

On arch linux type:

sudo pacman -S libbluetooth-dev

Then go the the blueshell src directory and compile the code.

$ cd blueshell/src
$ make

Prepare devices

Before using the blueshell you need to pair server and client. Let's check if the bluetooth daemon is running and bluetooth is enabled.

$ systemctl is-enabled bluetooth
$ systemctl status bluetooth

$ rfkill
$ sudo rfkill unblock bluetooth

Okay, now let's start the interactive bluetoothctl shell and change some settings.

$ bluetoothctl

[bluetooth]# default-agent
[bluetooth]# power on
[bluetooth]# discoverable on
[bluetooth]# advertise on

If we don't know the peers mac address yet, scan for nearby bluetooth devices.

[bluetooth]# scan on

...

[bluetooth]# scan off

Let's pair with the peer device and trust remote device for further connections.

[bluetooth]# pair 00:11:22:33:44:55
[bluetooth]# trust 00:11:22:33:44:55

Show all paired devices, the new one should occur within the output list.

[bluetooth]# paired-devices
[bluetooth]# devices

blueshell's People

Contributors

lukwies avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.