Code Monkey home page Code Monkey logo

rpl-attacks's Introduction

RPL Attacks Framework Tweet

Make simulations of a WSN with a malicious mote for attacking the RPL protocol.

Read The Docs Known Vulnerabilities DOI Black Hat Arsenal Europe 2018 Vagrant License

This project aims to provide a simple and convenient interface relying on Contiki OS to generate Cooja simulations and deploy malicious motes for a Wireless Sensor Network (WSN) that uses Routing Protocol for Low-power and lossy devices (RPL) (RFC 6550) as its network layer.

With this framework, it is possible to easily define campaign of simulations (in JSON format) either redefining RPL configuration constants, modifying single lines from the ContikiRPL library or using an own external RPL library. Moreover, experiments in a campaign can be generated either based on a same or a randomized topology for each simulation.

See the Wiki for additional documentation.

A few test cases made with the framework:

Test case 1: flooding attack

The malicious mote has 3, 7, 10 in its range Power tracking without the malicious mote Power tracking with the malicious mote
The malicious mote has 3, 7, 10 in its range Power tracking without the malicious mote Power tracking with the malicious mote

Test case 2: versioning attack

Legitimate DODAG Versioning attack in action (global repair)
Legitimate DODAG Versioning attack
Power tracking without the malicious mote Power tracking with the malicious mote
Power tracking without the malicious mote Power tracking with the malicious mote

Test case 3a: blackhole attack

Legitimate DODAG Blackhole attack in action
Legitimate DODAG Blackhole attack

Test case 3b: blackhole attack

Legitimate DODAG Blackhole attack in action
Legitimate DODAG Blackhole attack

πŸ’Ώ Installation

  1. Clone this repository
$ git clone https://github.com/dhondta/rpl-attacks.git

Behind a proxy ?

Setting: git config --global http.proxy http://[user]:[pwd]@[host]:[port]

Unsetting: git config --global --unset http.proxy

Getting: git config --global --get http.proxy

  1. Create the VM
$ vagrant login
[...]
$ vagrant up

Important notes

The downloads of the Vagrant box may take a while, please be patient...

Also, after the creation of the VM, Vagrant may complain that the SSH connection was unexpectedly closed by the remote end. In practice, this does not affect the creation and operation of the box.

Behind a proxy ?

Install the plugin: vagrant plugin install vagrant-proxyconf

Configure Vagrant: Uncomment the lines starting with config.proxy in the Vagrantfile

Troubleshooting:

  • Ensure the latest version of Vagrant is installed
  • If using virtualbox provider, ensure Oracle Extension Pack is installed (see Oracle website)

Using Instant Contiki or another distribution:

The full manual installation procedure is available here and mentions InstantContiki but it is advised to use the Vagrant box as it was fully tested.

😎 Demonstration

This will make 3 complete examples of attacks : hello flood, version number and blackhole.

Open the console like before and type:

user@instant-contiki:rpl-attacks>> demo

Or simply launch the demo command with Fabric:

./rpl-attacks$ fab demo

⏩ Quick Start

  1. Open the console (you should see something like in the following screenshot)
./rpl-attacks$ python main.py

or

./rpl-attacks$ fab console

  1. Create a campaign of simulations
user@instant-contiki:rpl-attacks>> prepare sample-attacks
  1. Go to your experiments folder (default: ~/Experiments) and edit your new sample-attacks.json to suit your needs

See How to create a campaign of simulations ? for more information.

  1. Make the simulations
user@instant-contiki:rpl-attacks>> make_all sample-attacks
  1. Run the simulations (multi-processed)
user@instant-contiki:rpl-attacks>> run_all sample-attacks

Hint : You can type status during make_all and run_all processing for getting the status of pending tasks.

  1. Once tasks are in status SUCCESS in the status tables (visible by typing status), just go to the experiment's results folders to get pictures and logs of the simulations. The related paths are the followings :

[EXPERIMENTS_FOLDER]/[experiment_name]/without-malicious/results/ [EXPERIMENTS_FOLDER]/[experiment_name]/with-malicious/results/

😬 Issues management

In case of bug, there should be a crash report generated in the folder of the experiment that the framework was processing. By convention, this is named crash-report-[...].txt. Please copy its content (without the title) in a new Issue.

For contributions or suggestions, please open an Issue and clearly explain, using an example or a use case if appropriate.

If you want to build new RPL attacks, please refer to the How to make new building blocks ? section. In this case, please submit your new attack through a Pull Request.

πŸ‘ Supporters

Stargazers repo roster for @dhondta/rpl-attacks

Forkers repo roster for @dhondta/rpl-attacks

Back to top

rpl-attacks's People

Contributors

bahmadh avatar dhondta avatar matm-g avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rpl-attacks's Issues

Vagrant+Ansible deployment

Provide a Vagrantfile and an Ansible playbook for deployment automation of Contiki-OS and RPL Attacks Framework.

Could not find any downloads that satisfy the requirement cffi

Hi,
I run the below commands to run rpl-attacks on Contiki 3.0.
$ git clone https://github.com/dhondta/rpl-attacks.git
sudo apt-get install gfortran libopenblas-dev liblapack-dev $ sudo apt-get install build-essential python-dev libffi-dev libssl-dev $ sudo apt-get install python-numpy python-scipy $ sudo apt-get install libxml2-dev libxslt1-dev libjpeg8-dev zlib1g-dev $ sudo apt-get install imagemagick libcairo2-dev libffi-dev
sudo apt-get install python-pip
$ sudo pip install -r requirements.txt
But after the "user@instant-contiki:~/rpl-attacks$ sudo pip install -r requirements.txt
" command I deal with bellow error
" Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement cffi (from -r requirements.txt (line 1))
Cleaning up...
No distributions at all found for cffi (from -r requirements.txt (line 1))
Storing debug log for failure in /home/user/.pip/pip.log
"
please help me to fix it.
I would appreciate you in advance.

DIS Protocol in Blackhole Attack PCAP

Dear all,

when looking into the output.pcap from the Blackhole attack, i find a lot of packets with the DIS Protocol. Please see the appended image.

DIS is, as far as i can see, the Distributed Interactive Simulation, a Protocol used by the Military to perform distributed wargaming.

Can somebody explain what it's used for here? Also, i find it only in PCAP files for the Blackhole attack, never in Hello-Flood or Version-Number attack.

Help is much appreciated.

blackhole-pcap.jpg

Blackhole attack

Hi,

I am currently trying to develop a new building block for the blackhole attack. What packets in the output are considered to be data plane ? I can only seem to see DIO, DAO and DIS messages. Which I thought were all control plane data..

R

Integration of Collect View tool

Reference: #27

@dmabm wrote:

I am going to count CPU, RX, TX separately and draw graphs manually using EXCEL. To do that I plan to use simulation generated data with different networks. That would be my 1st experiment and later I would like to do more similar experiments with some more different parameters instead of "POWER", in that case I may want to connect collect view tool with this Framework.

FAIL: test3_update_cooja_user_properties

Hi I received the following error (P1) when I run (fab test) but I was able to load the RPL Attack Framework. There I was trying to execute given sample test suit but I was not able to do that since there was a another problem (P2) as follows

P1:

================================================================
FAIL: test3_update_cooja_user_properties (tests.setup.Test2CoojaSetup)

Is Cooja's user properties file correctly adapted ?


Traceback (most recent call last):
File "tests/setup.py", line 72, in test3_update_cooja_user_properties
self.assertIn('[APPS_DIR]/visualizer_screenshot', line)
AssertionError: '[APPS_DIR]/visualizer_screenshot' not found in 'SCRIPTRUNNER_LAST_SCRIPTFILE=/home/user/contiki/regression-tests/02-hello-world/hello-world.js\n'

Ran 11 tests in 19.101s

FAILED (failures=1)

Warning: local() encountered an error (return code 1) while executing 'python -m unittest -v tests'

P2:

user@instant-contiki:rpl-attacks>> run_all sample-attacks
2017-03-28 18:39:06 rpla[10382] INFO PROCESSING EXPERIMENT 'test'
user@instant-contiki:rpl-attacks>> 2017-03-28 18:39:27 rpla[10391] ERROR Cooja error:
FATAL [main] (Cooja.java:3696) - Could not load plugin class: VisualizerScreenshot
2017-03-28 18:39:27 rpla[10391] ERROR Cooja error:
FATAL [Thread-1] (LogScriptEngine.java:317) - Script error:
java.lang.reflect.UndeclaredThrowableException

Please help me to figure out these problems, First problem might be the reason for the second problem
Thanks a bunch
Akalanka

Questions about Creating new building blocks

hi @dhondta I want to implement increased-rank attack and dag inconsistency.
my building block is listed below and I want to ask two questions.

  1. Is my building block true for dag-inconsistency and increased-rank? (in my experiments, I could not see too much change in power consumption)
    if this building blocks false, what do I need to do in order to implement these attacks?

  2. In my simulations, I want to locate malicious mote as a leaf node (as a child of other motes, not as a child of root node), but in all of my simulations malicious mote became a child node of root node and I want to change the location of malicious mote in order to increase the distance(hop count) between malicious mote and root node. can I do it? if I can, In order to do that which parameter do I need to change?

I have changed min_distance_between_motes parameter, but I couldn't change the distance between the root and malicious mote and I could not locate malicious mote as a leaf node.

{
  "dag-inconsistency": {
    "RPL_HDR_OPT_DOWN": 1,
    "RPL_HDR_OPT_RANK_ERR": 1
  },
  "increased-rank": {
    "RPL_CONF_MIN_HOPRANKINC": 512,
    "rpl-private.h": [
      ["#define RPL_MAX_RANKINC (7 * RPL_MIN_HOPRANKINC)", "#define RPL_MAX_RANKINC (35 * RPL_MIN_HOPRANKINC)]
    ]
  }
}

THANK YOU

Hitting Ctrl+C after a first exit does not immediately terminate the subprocesses

user@instant-contiki:rpl-attacks>> make test
2017-02-03 14:00:26 rpla[30483] WARNING  > Experiment 'test' already exists !
Proceed anyway ? (yes|no) [default: no] yes
2017-02-03 14:00:28 rpla[30483] INFO CREATING EXPERIMENT 'test'
user@instant-contiki:rpl-attacks>> exit
2017-02-03 14:00:30 rpla[30483] INFO  > Waiting for opened processes to finish...
2017-02-03 14:00:30 rpla[30483] WARNING Hit CTRL+C a second time to force process termination.
^C

Waiting a few seconds... then :

2017-02-03 14:00:32 rpla[30483] INFO  > Terminating opened processes...

Error while trying to list items

user@instant-contiki:rpl-attacks>> list campaigns
Traceback (most recent call last):
  File "main.py", line 7, in <module>
    FrameworkConsole(parallel=True).cmdloop()
  File "/home/user/rpl-attacks/core/console.py", line 169, in cmdloop
    super(FrameworkConsole, self).cmdloop()
  File "/home/user/rpl-attacks/core/console.py", line 49, in cmdloop
    super(Console, self).cmdloop()
  File "/usr/lib/python2.7/cmd.py", line 142, in cmdloop
    stop = self.onecmd(line)
  File "/usr/lib/python2.7/cmd.py", line 221, in onecmd
    return func(arg)
  File "/home/user/rpl-attacks/core/utils/decorators.py", line 156, in wrapper
    kwargs['path']).run(*args, **kwargs)
KeyError: 'path'

TypeError during script run

While trying to run the below script i am getting a type error. Possible solutions ?? I am trying to calculate packet delivery ratio, packet sent, packets received etc.

TIMEOUT(300000, log.log("Performance Calculation" + "\n"));

packetsReceived= new Array();
packetsSent = new Array();
timeReceived = new Array();
timeSent = new Array();
count = new Array();
nodeCount = 10;
//data_length = 23;
senderID = 0;
receiverID = 0;
PDR=0;
//e_count = 0;

for(i = 1; i <= nodeCount; i++){
    packetsReceived[i] = 0;
    packetsSent[i] = 0;
    timeSent[i] = 0;
    timeReceived[i] = 0;
}

/*
DATA send to 1 'Hello 1'
Data is Hello 1 from the client
DATA recv 'Hello 1 from the client' from 5
*/

while(1){
    YIELD();
    msgArray = msg.split(' ');
    if(msgArray[1].equals("send")){  
        if(msgArray.length == 6){
            // sent packet
            senderID = parseInt(msgArray[3]);
            packetsSent[senderID]++;
            timeSent[senderID] = time;
        }
    }
    if(msgArray[1].equals("recv")){
        if(msgArray.length == 9){
            receiverID = parseInt(msgArray[8]);
            packetsReceived[receiverID]++;
            timeReceived[receiverID] = time;
            log.log("receiverID " + receiverID + " PacketReceived= " +packetsReceived[receiverID] + "\n");
                if (timeReceived[receiverID] > 0){
                    count[receiverID]++
                }       
            totalReceived = totalSent = 0;
            totalclient=0;
            for(i = 1; i <= nodeCount; i++){
                totalclient++;
                totalReceived += packetsReceived[i];
                totalSent += packetsSent[i];
                log.log("MoteID= " + i + " ReceivedPackets= " + packetsReceived[i] + " SendingPackets= " + packetsSent[i] + "\n");
            }

            log.log(" Generated Packets " + totalSent + "\n");
            log.log(" ReceivedPackets " + totalReceived + "\n");
            PDR=(totalReceived / totalSent) * 100
            log.log("Packet Delivery Ratio" + PDR + "\n");
        }
    }   
}

Java stack trace:
:39 TypeError: Cannot read property "equals" from undefined
at jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57)
at jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:213)
at jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:185)
at jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:172)
at jdk.nashorn.internal.runtime.Undefined.get(Undefined.java:157)
at jdk.nashorn.internal.scripts.Script$Recompilation$17$40$^eval_.run(:39)
at jdk.nashorn.javaadapters.java.lang.Runnable.run(Unknown Source)
at org.contikios.cooja.plugins.LogScriptEngine$4.run(LogScriptEngine.java:300)
at java.lang.Thread.run(Thread.java:748)

Error while loading Fabric

Traceback (most recent call last):
  File "/usr/local/bin/fab", line 11, in <module>
    load_entry_point('Fabric3==1.14.post1', 'console_scripts', 'fab')()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 484, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2725, in load_entry_point
    return ep.load()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2343, in load
    return self.resolve()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2353, in resolve
    raise ImportError(str(exc))
ImportError: 'module' object has no attribute 'main'

This is when I run : fab setup, I resolved all the dependencies issue before and reach at this stage.

Command `run_all` Cooja error (`could not load plugin class: VisualizerScreenshot`)

Screen Shot 2019-04-02 at 23 01 33

Hi everyone, first of all, I would like to say thank you to the owners of this framework.
And I want to ask a question about rpl-attack-framework.

I installed rpl-attack-framework and after that I tried to make a simulation.
I ran prepare sample-attacks command successfully
I ran make_all sample-attacks command successfully
but when I tried to run run_all sample-attacks command I got a cooja error - could not load plugin class: visualizerscreenshot

you can see all the details in the attached png file.
if anyone can help me, I will be very happy.
thank you

How to see the variance of some other parameters such as CPU and Temperature, while attacks are in progress ?

I would like to do an experiment to see the Temperature variance and CPU utilization with and without the attack on a given topology. Could you please let me know how to enable "Collect View" tool to see these parameters and do more network analysis with this framework.

OR if there is any other way to do this without using the "Collect View" tool please let me know.

Thank you very much!!!

Error while running a simulation campaign

After preparing a campaign, run_all triggers running each simulation. The first execution, this without the malicious mote succeeds then the second one, this with the malicious mote, fails.

user@instant-contiki:rpl-attacks>> run_all sample-attacks.json
2017-02-03 14:05:16 rpla[31761] INFO PROCESSING EXPERIMENT 'test'
user@instant-contiki:rpl-attacks>> status
β”ŒStatus of opened tasks────────┬──────────────────────────────────────────┐
β”‚       Task      β”‚   Status   β”‚                  Result                  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ test[make]      β”‚ SUCCESS    β”‚ No result                                β”‚
β”‚ test[run]       β”‚ PENDING    β”‚ Not defined yet                          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
user@instant-contiki:rpl-attacks>> status
β”ŒStatus of opened tasks────────┬─────────────────────────────────────────────────────────────────────────┐
β”‚       Task      β”‚   Status   β”‚                                  Result                                 β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ test[run]       β”‚ FAIL       β”‚ UnboundLocalError: local variable 'parent' referenced before assignment β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
user@instant-contiki:rpl-attacks>> 

MOTES Lorawan

Hi, i need a suggest for simulate motes Lorawan and analyze the security features in this protocol

Building-block modifications check at malicious mote compilation

Goal: Increase verbose level so that it can be assessed that the modifications expected by applying a building-block are well made

Rationale: Due to Contiki implementation changes, it could happen that a building-block is made ineffective due to a text replacement that does not match with ContikiRPL's code anymore.

Command `status` does not reexecute on empty line

When working with the console, the command called status should display the list of current tasks when typed a first time. Then, while hitting ENTER (empty line), this should not display anything if the task list has not changed yet but should afterwards display the new state of this list when any task status has changed.

Problem: While continuing to press ENTER for status refresh, once the task list has changed, it is still not displayed.
Cause: Bad handling in console's "do_status" method.

Task remains PENDING forever

Scenario :
user@instant-contiki:rpl-attacks>> prepare my-campaign
user@instant-contiki:rpl-attacks>> make_all my-campaign
user@instant-contiki:rpl-attacks>> run_all my-campaign

Working :

  1. This will create a new campaign with a default experiment test
  2. This will make the campaign
  3. This will finally execute it.

Symptoms:

  • By typing statusΒ΄, one can point out that the experiment test` remains in status PENDING forever.
  • By looking at the experiment's folder, we can see that :
    • the first simulation (without the malicious mote) ends but the results that should be generated by the parser are not complete,
    • the second simulation (with the malicious mote) never starts.

Loglevel switching from the console does not work

When using for example loglevel debug in the console, a message is displayed telling that the logging level was well adapted. But debug messages do not display afterwards.

Cause : the logger is not recreated after resetting the loglevel in Python's logging.

Python problem run_all: TypeError: 'generator' object has no attribute '__getitem__'

Hi! First of all thank you for this code.
Very flexible framework.
However, I cannot make it work, I had some issues with pyton dependencies, after solving it, I can make all work , untill I reach
run_all sample-attacks
If I do status I get:


β”ŒStatus of opened tasks─┬────────────┬──────────────────────────────────────────────────────────────┐
β”‚          Task         β”‚   Status   β”‚                            Result                            β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ blackhole-attack[run] β”‚ FAIL       β”‚ TypeError: 'generator' object has no attribute '__getitem__' β”‚
β”‚    test[run]          β”‚ FAIL       β”‚ TypeError: 'generator' object has no attribute '__getitem__' β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

If I run with fab:

fab run_all:sample-attacks
2018-01-09 10:00:51 rpla[2553] INFO PROCESSING EXPERIMENT 'test'
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/fabric/main.py", line 762, in main
    *args, **kwargs
  File "/usr/local/lib/python3.6/dist-packages/fabric/tasks.py", line 425, in execute
    results['<local-only>'] = task.run(*args, **new_kwargs)
  File "/usr/local/lib/python3.6/dist-packages/fabric/tasks.py", line 172, in run
    return self.wrapped(*args, **kwargs)
  File "/home/renzo/trabajo/demo-fic/rpl-attacks/core/utils/decorators.py", line 173, in wrapper
    f(*args, **kwargs)
  File "/home/renzo/trabajo/demo-fic/rpl-attacks/core/commands.py", line 558, in run_all
    run(name) if console is None else console.do_run(name)
  File "/home/renzo/trabajo/demo-fic/rpl-attacks/core/utils/decorators.py", line 173, in wrapper
    f(*args, **kwargs)
  File "/home/renzo/trabajo/demo-fic/rpl-attacks/core/commands.py", line 413, in __run
    parsing_chain(sim_path)
  File "/home/renzo/trabajo/demo-fic/rpl-attacks/core/utils/parser.py", line 21, in parsing_chain
    convert_pcap_to_csv(path)
  File "/home/renzo/trabajo/demo-fic/rpl-attacks/core/utils/parser.py", line 55, in convert_pcap_to_csv
    f.write(out)
TypeError: a bytes-like object is required, not 'str'

I assume is also w problem with python. I have both pythons. I will keep checking but I will appreciate if you already run into this problem.

On instant contiki 3.0 I also runt with the same problem.

Experiment time can not be set long

Dear all,
When I set duration to 1200 sec(or longer) (The default is 120 sec) in the experiment json file,The experiment will go to half and then no response (usually the without-malicious pcap file is recorded to about 11M).
Has anyone solved this problem?
Any help is much appreciated.

Command `run_all` Cooja error

prepare and make_all commands work properly but when run_all command is run the following error is shown in cooja GUi:

org.contikios.cooja.Cooja$PluginConstructionException: Construction error for tool of class: org.contikios.cooja.plugins.ScriptRunner
	at org.contikios.cooja.Cooja.startPlugin(Cooja.java:1876)
	at org.contikios.cooja.Cooja.tryStartPlugin(Cooja.java:1772)
	at org.contikios.cooja.Cooja.setPluginsConfigXML(Cooja.java:3706)
	at org.contikios.cooja.Cooja.loadSimulationConfig(Cooja.java:3460)
	at org.contikios.cooja.Cooja.loadSimulationConfig(Cooja.java:3380)
	at org.contikios.cooja.Cooja.doLoadConfig(Cooja.java:2408)
	at org.contikios.cooja.Cooja.main(Cooja.java:3243)
Caused by: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:488)
	at org.contikios.cooja.Cooja.startPlugin(Cooja.java:1856)
	... 6 more
Caused by: java.lang.ClassCastException: java.desktop/javax.swing.text.AbstractDocument$DefaultDocumentEventUndoableWrapper cannot be cast to java.desktop/javax.swing.text.AbstractDocument$DefaultDocumentEvent
	at jsyntaxpane.CompoundUndoMan.undoableEditHappened(CompoundUndoMan.java:63)
	at java.desktop/javax.swing.text.AbstractDocument.fireUndoableEditUpdate(AbstractDocument.java:293)
	at java.desktop/javax.swing.text.AbstractDocument.handleInsertString(AbstractDocument.java:761)
	at java.desktop/javax.swing.text.AbstractDocument.insertString(AbstractDocument.java:716)
	at java.desktop/javax.swing.text.PlainDocument.insertString(PlainDocument.java:131)
	at java.desktop/javax.swing.text.DefaultEditorKit.read(DefaultEditorKit.java:274)
	at java.desktop/javax.swing.JEditorPane.setText(JEditorPane.java:1428)
	at org.contikios.cooja.plugins.ScriptRunner.updateScript(ScriptRunner.java:619)
	at org.contikios.cooja.plugins.ScriptRunner.<init>(ScriptRunner.java:276)
	... 11 more

Why PowerTracker only shows output of Radio ON, TX and RX ?

Hi All,

I loaded the "test simulation" in the RPL Attack Framework manually by opening cooja using "ant run" and I have few question as follows.

Q1. Why "PowerTracker" does not show "Radio INT" valus (%) ? But after executing same simulation with RPL Attack Framework, under the data folder in the "powertracker.csv" file I can see all the values of 4 parameters (Radio ON (%), Radio TX (%), RAadio RX (%), Radio INT (%).

Q2. What is actual meaning of INT (Interference) and how does it calculated ?

Q3. All 4 parameter values are generated as a presentation (%). what does it mean ? and How does is calculated ?

Q4. How to calculate the CPU time with these parameters?

Q5. That is the different between cooja "Power Tracer" and "Power Tracker" ? Since in build "Power Tracer" attached to the "Collect View" tool give me 4 different parameters such as "CPU, LPM, RX, TX" as output which I can understand very well.

Please give me some formulas or equations to calculate these parameter. So far I could not find good documentation to solve these problems

Thank you very much.

problem black hole

hi.....I am Sonxay

this is my problem ....it is not have series.log in the example

Did you get the image

screen shot 2017-06-20 at 1 41 59 pm

Installation error

I'm running it on Ubuntu 16.04 with contiki 3.0 (not a contiki instant) and python 3.5.2

parallels@ubuntu:~/rpl-attacks$ fab test
2017-02-01 13:22:57 root[3073] INFO Generating grammar tables from /usr/lib/python3.5/lib2to3/Grammar.txt
2017-02-01 13:22:57 root[3073] INFO Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
2017-02-01 13:22:58 rpla[3073] INFO TESTING THE FRAMEWORK
[localhost] local: python -m unittest tests
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/lib/python2.7/unittest/__main__.py", line 12, in <module>
    main(module=None)
  File "/usr/lib/python2.7/unittest/main.py", line 94, in __init__
    self.parseArgs(argv)
  File "/usr/lib/python2.7/unittest/main.py", line 149, in parseArgs
    self.createTests()
  File "/usr/lib/python2.7/unittest/main.py", line 158, in createTests
    self.module)
  File "/usr/lib/python2.7/unittest/loader.py", line 130, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/usr/lib/python2.7/unittest/loader.py", line 91, in loadTestsFromName
    module = __import__('.'.join(parts_copy))
  File "tests/__init__.py", line 1, in <module>
    from .setup import Test1Config, Test2CoojaSetup
  File "tests/setup.py", line 3, in <module>
    import sh
ImportError: No module named sh

Warning: local() encountered an error (return code 1) while executing 'python -m unittest tests'


Done.

parallels@ubuntu:~/rpl-attacks$ sudo fab console
2017-02-01 13:31:35 root[4757] INFO Generating grammar tables from /usr/lib/python3.5/lib2to3/Grammar.txt
2017-02-01 13:31:35 root[4757] INFO Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
[localhost] local: python main.py
Traceback (most recent call last):
  File "main.py", line 3, in <module>
    from core.console import FrameworkConsole
  File "/home/parallels/rpl-attacks/core/console.py", line 6, in <module>
    from funcsigs import signature
ImportError: No module named funcsigs

Fatal error: local() encountered an error (return code 1) while executing 'python main.py'

Aborting.
parallels@ubuntu:~/rpl-attacks$ sudo pip3 install funcsigs

The directory '/home/parallels/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/parallels/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: funcsigs in /usr/local/lib/python3.5/dist-packages

Fatal error: local() encountered an error (return code 1) while executing 'convert -delay 10 -loop 0

root@instant-contiki:rpl-attacks>> status
β”ŒStatus of opened tasks────────┬──────────────────────────────────────────┐
β”‚       Task      β”‚   Status   β”‚                  Result                  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ test[make]      β”‚ SUCCESS    β”‚ No result                                β”‚
β”‚ test[run]       β”‚ PENDING    β”‚ Not defined yet                          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
root@instant-contiki:rpl-attacks>> 
Fatal error: local() encountered an error (return code 1) while executing 'convert -delay 10 -loop 0 network*.png wsn-without-malicious.gif'

vagrant up prompts an error

Traceback (most recent call last):
	2: from /opt/vagrant/embedded/gems/2.2.9/gems/vagrant-2.2.9/bin/vagrant:88:in `<main>'
	1: from /opt/vagrant/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/opt/vagrant/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- vagrant (LoadError)
	20: from /opt/vagrant/embedded/gems/2.2.9/gems/vagrant-2.2.9/bin/vagrant:88:in `<main>'
	19: from /opt/vagrant/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:34:in `require'
	18: from /opt/vagrant/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:130:in `rescue in require'
	17: from /opt/vagrant/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:130:in `require'
	16: from /opt/vagrant/embedded/gems/2.2.9/gems/vagrant-2.2.9/lib/vagrant.rb:40:in `<top (required)>'
	15: from /opt/vagrant/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	14: from /opt/vagrant/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	13: from /opt/vagrant/embedded/gems/2.2.9/gems/vagrant-2.2.9/lib/vagrant/plugin/manager.rb:4:in `<top (required)>'
	12: from /opt/vagrant/embedded/gems/2.2.9/gems/vagrant-2.2.9/lib/vagrant/plugin/manager.rb:4:in `require_relative'
	11: from /opt/vagrant/embedded/gems/2.2.9/gems/vagrant-2.2.9/lib/vagrant/bundler.rb:8:in `<top (required)>'
	10: from /opt/vagrant/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	 9: from /opt/vagrant/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	 8: from /opt/vagrant/embedded/lib/ruby/2.6.0/rubygems/package.rb:44:in `<top (required)>'
	 7: from /opt/vagrant/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	 6: from /opt/vagrant/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	 5: from /opt/vagrant/embedded/lib/ruby/2.6.0/rubygems/security.rb:12:in `<top (required)>'
	 4: from /opt/vagrant/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	 3: from /opt/vagrant/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	 2: from /opt/vagrant/embedded/lib/ruby/2.6.0/openssl.rb:13:in `<top (required)>'
	 1: from /opt/vagrant/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/opt/vagrant/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': /lib/i386-linux-gnu/libc.so.6: version `GLIBC_2.17' not found (required by /opt/vagrant/embedded/lib/libcrypto.so.1.1) - /opt/vagrant/embedded/lib/ruby/2.6.0/i686-linux/openssl.so (LoadError)

Adding delay in the start of malicious mote.

I want to add delay in the node startup of malicious mote. My aim is to make a mote send its first DIS after certain period of time. Like in case of hello-flood the DIS_START_DELAY is set to 0. However, when i set delay to 60, it rarely makes any difference. The hello-flood should start after the nodes have found their parents i.e. network topology has been setup. How can i do this.
screenshot from 2019-01-30 12-27-44
screenshot from 2019-01-30 12-28-10
screenshot from 2019-01-30 12-28-43

Error while preparing a simulation campaign

I have this error when running a simulation.

Can you also please record a video demo of how to run it after the installation

Thank you


Type help or ? to list commands.
NB: Spaces are separators ; DO NOT use spaces in arguments !

parallels@ubuntu:rpl-attacks>> prepare sample-attacks
2017-02-02 11:51:59 rpla[21323] INFO CREATING NEW EXPERIMENT CAMPAIGN AT '/home/parallels/Experiments/sample-attacks.json'
Traceback (most recent call last):
  File "main.py", line 7, in <module>
    FrameworkConsole(parallel=True).cmdloop()
  File "/home/parallels/rpl-attacks/core/console.py", line 41, in cmdloop
    super(Console, self).cmdloop()
  File "/usr/lib/python2.7/cmd.py", line 142, in cmdloop
    stop = self.onecmd(line)
  File "/usr/lib/python2.7/cmd.py", line 221, in onecmd
    return func(arg)
  File "/home/parallels/rpl-attacks/core/utils/decorators.py", line 150, in wrapper
    kwargs['path']).run(*args, **kwargs)
KeyError: 'path'

Fatal error: local() encountered an error (return code 1) while executing 'python main.py'

Aborting.

After installing RPL Attack Framwork "collect-view tool" is not there

Hi,

After installing RPL Attack Framwork "collect-view tool" is not appear in the Cooja simulator (See the following images for Before and after installing the Framework available tools in the Cooja simulator )

See before installing at the very bottom in the drop down menu for "collect-view tool" (No Visualizer Screenshot...)

a

See after the installing at the very bottom in the drop down menu for "collect-view tool" (But Visualizer Screenshot.. is added to the menu somewhere in the middle)

b

Please let me know how to add "collect-view tool" after installing the RPL Attack Framwork

Thank you very much
Akalanka (dmabm)

can a node receive its own DIS and transmit DIO after resetting its trickle timer ??

Can a node receive its own DIS and transmit DIO by resetting its trickle timer ??

298514726 ID:7 RPL: Received a DIS from fe80::c30c:0:0:7
298517450 ID:7 RPL: Multicast DIS => reset DIO timer
298639076 ID:7 RPL: Received a DIS from fe80::c30c:0:0:7
298641770 ID:7 RPL: Multicast DIS => reset DIO timer
298891390 ID:7 RPL: Received a DIS from fe80::c30c:0:0:7
298894084 ID:7 RPL: Multicast DIS => reset DIO timer
298934122 ID:7 RPL: Received a DIS from fe80::c30c:0:0:7
298936816 ID:7 RPL: Multicast DIS => reset DIO timer
299139640 ID:7 RPL: Received a DIS from fe80::c30c:0:0:7
299142334 ID:7 RPL: Multicast DIS => reset DIO timer
299262999 ID:7 RPL: Sending a DIS to ff02::1a
299265944 ID:7 RPL: Sending a DIS to ff02::1a
299268890 ID:7 RPL: Sending a DIS to ff02::1a
299271835 ID:7 RPL: Sending a DIS to ff02::1a
299274780 ID:7 RPL: Sending a DIS to ff02::1a
299277763 ID:7 RPL: Sending a DIS to ff02::1a
299280709 ID:7 RPL: Sending a DIS to ff02::1a
299283692 ID:7 RPL: Sending a DIS to ff02::1a
299286637 ID:7 RPL: Sending a DIS to ff02::1a
299289583 ID:7 RPL: Sending a DIS to ff02::1a
299763754 ID:7 RPL: Received a DIS from fe80::c30c:0:0:7      <===
299766448 ID:7 RPL: Multicast DIS => reset DIO timer
299888175 ID:7 RPL: Sending prefix info in DIO for aaaa::
299891343 ID:7 RPL: Sending a multicast-DIO with rank 512

After simulation, relationship.log is empty

This logging is done through the script.js by catching serial messages starting with # L, normally indicating DAG edges. These lines do not appear anymore in the collected logs.

Suspected Cause : Something was changed in the Contiki C files, not displaying any edge logging message anymore in the current version.

Undesirable Consequences :

  • This revealed Issue #2.
  • This prevents from creating the animated GIF as the screenshots are taken every period only if a log message starting with # L is caught (otherwise, a first screenshot is taken then switched to off).
  • This prevents from parsing mote relationships and drawing the DAG.

Simulation Contiki for blackhole

hi....
My name is Sonxay , I am PhD student in VietNam.
first of all , i would like to say Thanks for your research RPL attacks
after i read your paper..could i have some question to ask you please.

  1. file serial.log : it likes got the problem
  2. I would like to improve your research : like i want to simulation more like: throughput , end to end delay and Packet delivery Ratio ....How can I do?
    Please help me
    hope i can get your answer as soon as
    thanks
    regard
    Sonxay

Command `kill` does not kill Cooja process

When a run task fails, the command kill is used and the status becomes CANCELLED, the Cooja process remains pending while it should be killed in the OS.

Cause : No kill system call.

Fatal error: local() encountered an error (return code 1) while executing 'md5sum requirements.txt'

Hello All,

I encountered an error as follows when I run "fab test", when I am trying to reinstall the framework with python-2 in a different virtual machine. "fab setup" worked fine. I did not get this problem last time when I was installing the framework with ppython-2 and at that installation worked so fine. (I updated the O/S using "update" comment but still did not work)

Please let me know how to solve this problem. (Screen shot of the problem is attached).

fab_test probelm with python-2

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.