Giter Club home page Giter Club logo

bashbot's Introduction

Introduction

This is a simple bash IRC bot which I wrote to mess around with the /dev/tcp capability introduced on the Ubuntu version of bash with 9.10 (yes, yes, I use Ubuntu - get over it)

License

Free as in I don’t care. Do what you want with it.

Starting the bot

Run: > name=’botname’ chan=’first’ ./bash/ircbot owner server portnum

Where botname, first, owner, server, and portnum are filled in appropriately.

Communicating with the bot

The bot can either respond to private messages, or to messages in chat. In either case, the same list of commands is handled (and generally requires a ! at the beginning).

Features

The following are the features available in the irc bot

Authentication

The bot can be configured with an authentication regime to allow only those members of channels who know the authentication token to control aspects of the bot.

See run_controller in bash/handler_callbacks for information on how to dynamically edit this list.

When starting the IRC bot, the first argument is the username of the first controller allowed to control the bot.

Channel management

The bot includes some basic ‘op/deop’ facilities. Again, see bash/handler_callbacks for the complete list (in the keywords list at the top of the file).

Additionally, using join and part, the bot can be told to join and leave other channels.

The bot will default to joining the list of channels (space separated) specified in the $chan environment variable.

Compilation

The bot includes a facility similar to Geordi that allows channel members to ask it to evaluate C/C++ code. This is really only a usable feature on Linux (see the paragraph after the next for information).

In general, this is UNSAFE to do, as ANYONE who has access to your bot can run arbitrary code. As such, only authenticated users are allowed to invoke compilation (see the AUTHENTICATED_COMPILE configuration in bash/handler_callbacks.

Even with that, the IRC Bot does it’s best to protect the user from bad programs by restricting access to classes of system calls. See bash/compile_files.sh for the full list. Know that, at least on a Linux, the bot has been fairly well protected from all sorts of denial of service attacks. That doesn’t mean it is unexploitable (I haven’t touched it in a while), just that it should be safer out of the box than if you wrote your own.

ELISA Chat

The bot includes a fairly naive chat bot. Go ahead and mess with it; found in bash/handler_callbacks at the bottom. Only an ‘authenticated’ user may enable/disable the bot, by using the “doctor” command.

Exploding and contracting links, other web goodies

The bot includes some web related goodies, including exploding / contracting links, writing insults, querying finance information, and running basic google searches.

All functions are declared in the CHANNEL_COMMANDS in bash/handler_callbacks (notice a pattern?) and map to a function in CHANNEL_FUNCTIONS

Dangerous stuff

I advise always reading sources before just deploying things. At one point, I was building in a reverse shell server (see run_reverseshell for more information) to backdoor a work computer because they didn’t allow reverse ssh tunnels (think of the horror!) so I couldn’t work from home. I switched to a git based project, and haven’t really debugged or messed around with it much. I wouldn’t turn on the ALLOW_REVERSE_SHELL variable, unless you don’t care about the machine you’re running on.

bashbot's People

Contributors

apconole avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

daybologic pabeni

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.