Coder Social home page Coder Social logo

seclab-bot's People

Contributors

bencantcode avatar deltaheavy avatar henryaevans avatar jon77p avatar jphaws avatar slashnick avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

seclab-bot's Issues

Generate client key

Let's make a "client-init" request that connects via SSL and receives a new PSK.

Format:

1 byte 0xAA
8 bytes timestamp
HMAC keyed with old PSK

Thoughts?

Server Response

It would be useful to have some sort of indicator on the bot (e.g. LED on an Arduino) that confirms the lab status has been changed successfully. This will verify that the bot is on, button press was registered, the server was up and reachable, the HMAC was accepted, and the actual status indicator (e.g. a badge on the homepage) was properly updated.

If we want to implement this, some sort of response message would need to be specified, potentially HMAC signed (so an attacker can't MITM you, block all your "open" messages, and respond to them saying they were successful so no one notices).

An example might be to respond with the same 5-byte message, followed by some kind of status byte (0xFF for "all good", 0x00 for errors such as a bad hash, problem updating status, etc.).

Another possibility would be either an "all good" message as a response, and simply closing the connection when there's an error of any kind.

We should come up with a message spec

We need a spec for the format of lap open/close messages, so that a listener can be built to consume those messages.

For instance, an HTTPS request with an Authorization header, or a binary protocol over TCP with some kind of HMAC signing.

Write tests

Write tests? At least for cert verifications

MitM/Replay Security

Here's an attack vector - I watch all the (unencrypted) message traffic until I see one close message and one open message. Each of these messages include a valid hmac. So if the server isn't validating timestamps, I can replay either of these two messages and control the open status without ever knowing the key.

Note that expiring messages by age won't always solve this issue. Suppose I close the lab by accident, then realize my mistake and open it again. If the second message is sent before the first message expires, an attacker could replay the "close" message and override the "open" message.

Keep-alive pings

The client should send HMAC'd keep-alive pings (with no user interaction) to the server every 10 minutes while the lab is open, and if the server misses three keep-alives it should close the lab. Keep-alives should be responded to with an "all good" from the server so the client knows not to retry the send. This can be done in a background thread in the client which gets a message to start and stop the ping loop on open and close, respectively. A thread may seem like overkill but they're cheap if long-lived and we don't want to block the UI thread while pinging.

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.