Skip to content

Commit

Permalink
I GPL'd the code and edited / modified the README and proposal. Made …
Browse files Browse the repository at this point in the history
…the README github friendly
  • Loading branch information
mothran authored and Mothra committed Apr 24, 2013
1 parent c33a574 commit c074d88
Show file tree
Hide file tree
Showing 14 changed files with 235 additions and 152 deletions.
47 changes: 0 additions & 47 deletions README.txt

This file was deleted.

24 changes: 23 additions & 1 deletion bunnyChat.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# bunnyChat.py
#
# Copyright 2013 W. Parker Thompson <w.parker.thompson@gmail.com>
#
# This file is part of Bunny.
#
# Bunny is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Bunny is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Bunny. If not, see <http://www.gnu.org/licenses/>.

import libbunny
import threading, getopt, sys, time

Expand Down Expand Up @@ -137,7 +159,7 @@ def main():
elif ping_mode_client:
import struct

total = 100.0
total = 10.0
bunny = libbunny.Bunny()
count = 0
avg_time = 0
Expand Down
22 changes: 22 additions & 0 deletions libbunny/AEScrypt.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# bunny.py
#
# Copyright 2013 W. Parker Thompson <w.parker.thompson@gmail.com>
#
# This file is part of Bunny.
#
# Bunny is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Bunny is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Bunny. If not, see <http://www.gnu.org/licenses/>.

import os, binascii, struct

from Crypto.Cipher import AES #pycrypto
Expand Down
22 changes: 22 additions & 0 deletions libbunny/SendRec.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# bunny.py
#
# Copyright 2013 W. Parker Thompson <w.parker.thompson@gmail.com>
#
# This file is part of Bunny.
#
# Bunny is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Bunny is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Bunny. If not, see <http://www.gnu.org/licenses/>.

import struct, os, time, pipes

import pylorcon
Expand Down
23 changes: 23 additions & 0 deletions libbunny/Templates.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# bunny.py
#
# Copyright 2013 W. Parker Thompson <w.parker.thompson@gmail.com>
#
# This file is part of Bunny.
#
# Bunny is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Bunny is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Bunny. If not, see <http://www.gnu.org/licenses/>.

import struct, random, os

from config import *
Expand Down Expand Up @@ -333,6 +355,7 @@ def decode(self, input):
value = input[2:length+2]
temp_tags.append([id, length, value])
input = input[length + 2:]
# TODO: error here, index out of range.
return temp_tags[0][2]

def tagGrabber(self, id):
Expand Down
22 changes: 22 additions & 0 deletions libbunny/TrafficModel.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# bunny.py
#
# Copyright 2013 W. Parker Thompson <w.parker.thompson@gmail.com>
#
# This file is part of Bunny.
#
# Bunny is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Bunny is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Bunny. If not, see <http://www.gnu.org/licenses/>.

import time, struct, operator, binascii, random

# This is indicative of object reuse.
Expand Down
46 changes: 23 additions & 23 deletions libbunny/bunny.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# bunny.py
#
# Copyright 2011 Parker Thompson <w.parker.thompson@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
#
#
# bunny.py
#
# Copyright 2013 W. Parker Thompson <w.parker.thompson@gmail.com>
#
# This file is part of Bunny.
#
# Bunny is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Bunny is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Bunny. If not, see <http://www.gnu.org/licenses/>.


import threading, Queue, binascii

from AEScrypt import *
#from configure import *
from SendRec import *
from Templates import *
from TrafficModel import *
Expand Down Expand Up @@ -243,16 +241,18 @@ def __init__(self, queue, ioObj, model):
def run(self):
while self.running:
relay = True

element = self.out_queue.get()
#TIMING
#start_t = time.time()

# sleep here if the packet is a relay packet, this prevents corruption by a
# node in between two machines that are in range.
# TODO: This value needs to be modified and played with.
if element[1] is True:
time.sleep(0.01)
packet = element[0]
#TIMING
#start_t = time.time()

if DEBUG:
print "CypherText: " + binascii.hexlify(packet)
print "blocks: " + binascii.hexlify(packet[16:18])
Expand Down
35 changes: 14 additions & 21 deletions proposal.txt
Original file line number Diff line number Diff line change
@@ -1,48 +1,43 @@
Bunny.py:

Bunny is intended to act as a layer 2 technology for unsignaturable wireless mesh communication.
Bunny has two modes of operation, one is a simple mesh networking system with built in AES-256
encryption, each node will route others traffic hopefully providing a simple, dynamic communications
channel. The second mode of operation wraps the higher level mesh network in a layer of obfoscation,
it does this by passively listening to the local wireless and building a model of 'average' traffic.
Then using this model it hides small snippets of data within various fields of the 802.11 protocol,
that are either poorly defined or prone to contain data with a large variablity rage. These fields
will include but are not limited to; vendor data, data packets of encrypted networks, duration fields.
Bunny is intended to act as a layer 1/2 technology for near unsignaturable wireless mesh communication.
Bunny wraps all data in and out in a layer of obfoscation, it does this by passively listening to
the local wireless and building a model of 'average' traffic. Then using this model it hides small
snippets of data within various fields of the 802.11 protocol, that are either poorly defined or
prone to contain data that mutates a lot. These fields will include but are not limited to; vendor
data, data packets of encrypted networks, duration fields.

Nodes will be able to pick bunny specific packets with the preshared information of a modulus and
remainder value that will be applied to the packet length of each read packet. Hopefuly bunny will
Nodes will be able to find bunny specific packets with the preshared information of a modulus and
remainder value that will be applied to the packet length of each read packet. Bunny will
have two layers of communication, one being a transport and routing protocol that will be able to be
read with just a AES key, modulus and remainder value. This layer will handel data routing and the
backbone of a bunny based network. Then within that channel, many seperate communication channels
read with just a AES key, modulus and remainder value. This layer will handle data routing and the
backbone of a Bunny based network. Then within that channel, many seperate communication channels
can exist with a second round of block chipher encrypted data. This provides for a 'russian doll'
model of commuincation channels, thus allowing for a properly layered privacy scheme.

So far the project depends on 3 external libraries:
1. pylorcon (802.11 injection)
- and the underlying Lorcon library
2. pcapy (802.11 reading of packets)
3. pycrypto (cryptography)


The overall architecture will have classes for all major sectors of the programs:
- encryption
- send / recv
- routing
- traffic modeling
- templates
- configuration

The structure of the application is as such:
- The AEScrypt class is just a container for 2 functions, encrypt and decrypt.
- The SendRec class is the backbone of the IO in the application. When instaciated,
- The SendRec class is the backbone of the IO in the application. When init'd,
both a lorcon object and pcapy instance are created and the interface is set into
monitor mode.
there are 2 sets of Send/recv functions, on set is used for non-paranoid
use of bunny the other is for paranoid functionallity.
There is a function for updating the channel on the interface, testing packet
capturing and grabing raw packets that include a RadioTap header.

- The Routing class is NULL currently.
- The TrafficModel class is the brains of the paranoid functionality.
- The TrafficModel class is the brains of the obfuscation functionality.
What is does is when created it captures a 3 second long packet capture using the
SendRec class then analysis's the distribution of packet types and mac addresses.
Then it stick most of that data into two lists, type_ranges and mac_addresses.
Expand All @@ -60,7 +55,7 @@ The structure of the application is as such:
it into these fields, the revease is done to get the data out of these packets.
To detect a bunny specific packet, each outbound packet is resized to match pre determined
pack_len % mod = remainder values. Then when looking for packet bunny just tests each
packets length against the modulus and remainder values. (idea from: Optyx, KIS root kit)
packets length against the modulus and remainder values. (idea from: Optyx, KIS root kit)


- The Templates class is a super class that contains many subclasses, one (hopefuly)
Expand All @@ -76,8 +71,6 @@ The structure of the application is as such:
if other bunny instances found:
1. send and recv packets in the mesh using the packet templates and distributions found
within the trafficmodel
else:
1. send out a type of bunny specific beacon for others to find.

When a packet is send, the data (including routing info) with be encrypted with AES256 then
chunks of the packet will be injected into the packet types contained with in templates, but at
Expand Down
42 changes: 0 additions & 42 deletions statScripts/readpck.py

This file was deleted.

Loading

0 comments on commit c074d88

Please sign in to comment.