Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Black hole and decrease rank attacks #65

Open
azeemjahangir opened this issue Jul 6, 2021 · 8 comments
Open

Black hole and decrease rank attacks #65

azeemjahangir opened this issue Jul 6, 2021 · 8 comments

Comments

@azeemjahangir
Copy link

I need Black hole and version number of attacks code in c file

@dhondta
Copy link
Owner

dhondta commented Jul 6, 2021

Hi @azeemjahangir

TLDR ; this source code is made at runtime while compiling a simulation. It can either be retrieved during this operation or regenerated by reproducing the operations from the building-blocks manually.

While making a campaign of simulations (e.g. the demo campaign) or a single simulation, the ContikiRPL library is modified based on the selected building-blocks (using the available operations, e.g. pattern replacement). The malicious mote is then compiled from its C file, therefore using the modified ContikiRPL library and afterwards immediately removed.
So, if you want to get the modified code, you can simply manually reproduce the modifying operations from the building-blocks or interrupt the simulation while it is being made, before the process removes the temporary sources of the modified ContikiRPL library.

@azeemjahangir
Copy link
Author

Can any have decrease rank and blackhole in file so i can have an idea for implementation

@dhondta
Copy link
Owner

dhondta commented Jul 23, 2021

Please read the documentation about building blocks. This will help you understand what you are searching for.

Decreased Rank Building Block

Here are the transformations (from the building blocks) for the decreased-rank building block :

{
    "RPL_CONF_MIN_HOPRANKINC": 0,
    "rpl-private.h": [
      ["#define RPL_MAX_RANKINC             (7 * RPL_MIN_HOPRANKINC)", "#define RPL_MAX_RANKINC 0"],
      ["#define INFINITE_RANK                   0xffff", "#define INFINITE_RANK 256"]
    ],
    "rpl-timers.c": ["rpl_recalculate_ranks();", null]
}

This means :

Blackhole Attack

As it can be seen in the demo campaign, the blackhole attack is the combination of the decreased-rank building block (see above) and a drop-messages one that does not exist yet (you can propose a PR, if relevant :-) ).

@Johnbucky
Copy link

This codes might be helpful for you.
Blackhole-and D-Attacks.zip

@dhondta
Copy link
Owner

dhondta commented Dec 3, 2021 via email

@dhondta dhondta removed their assignment Mar 28, 2022
@Laileet
Copy link

Laileet commented Nov 28, 2022

This codes might be helpful for you. Blackhole-and D-Attacks.zip

Any read me file or instructions for this code?

@researchrinki25
Copy link

sir can you help me to tell about how to implement attacker code in cooja 3.0

@Laileet
Copy link

Laileet commented Mar 9, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants