LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-10-2015, 03:45 PM   #1
anand755
Member
 
Registered: Nov 2014
Posts: 34

Rep: Reputation: Disabled
i tried to add malicious node in aodv


i searched google but found dis
http://elmurod.net/en/index.php/archives/196

so i implemented malicious node in aodv only

i will link the tcl file too

dis is the error i got

num_nodes is set 20
INITIALIZE THE LIST xListHead
ns: _o112 hacker:
(_o112 cmd line 1)
invoked from within
"_o112 cmd hacker"
invoked from within
"catch "$self cmd $args" ret"
invoked from within
"if [catch "$self cmd $args" ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error "error when calling class $cls: $args" $..."
(procedure "_o112" line 2)
(SplitObject unknown line 2)
invoked from within
"_o112 hacker"
Attached Files
File Type: txt mal.txt (4.1 KB, 98 views)
 
Old 04-11-2015, 12:32 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,517

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
$ ns235-malicious mal.tcl
... The files mal.nam 79.9kB, trace-aodv-802-15-4.tr 110.7kB are created.
( The simulation does not finish : Segmentation fault.)


About your errors : You are using an executable 'ns' with no malicious.
You could try :
cd ns-2.xx/
cp ns ns-malicious
sudo cp ns-malicious /usr/local/bin/
.. And then run the simulation with : $ ns-malicious mal.tcl
.. To make sure the right 'ns' is used.


The tested code is "aodv-malicious_ns235.patch"
https://drive.google.com/file/d/0B7S...ew?usp=sharing
A build example :
$ tar xvf ns-allinone-2.35_gcc482.tar.gz ( The 'Nov 2014' update )
https://drive.google.com/file/d/0B7S...ew?usp=sharing
$ cd ns-allinone-2.35/
$ patch -p0 < aodv-malicious_ns235.patch
$ ./install
$ cd ns-2.35/
$ cp ns ns235-malicious
$ sudo cp ns235-malicious /usr/local/bin/


AODVmalicious INFO http://www.linuxquestions.org/questions/tags/malicious/


-
 
Old 04-12-2015, 03:42 AM   #3
anand755
Member
 
Registered: Nov 2014
Posts: 34

Original Poster
Rep: Reputation: Disabled
i m using ns2.34 will dis patch work on it?
 
Old 04-12-2015, 05:20 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,517

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #3.

Ns-2.34 + aodv-malicious :
1) Replace the files you edited, with original aodv/{aodv.cc, aodv.h } files.
2)
$ cd ns-allinone-2.34/
$ ln -s ns-2.34/ ns-2.35
$ patch -p0 < aodv-malicious_ns235.patch


-
 
Old 04-12-2015, 05:36 AM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,517

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
AODV malicious examples : aodv-malicious-examples-10.2013.tar.gz

Link : https://drive.google.com/file/d/0B7S...ew?usp=sharing
 
Old 04-27-2015, 03:10 AM   #6
anand755
Member
 
Registered: Nov 2014
Posts: 34

Original Poster
Rep: Reputation: Disabled
when i ruuning a file of tcl from ur example
dis is the error

d@ubuntu:~/project/ns-allinone-2.35/ns-2.35/tcl/ex/aodv malicious$ ns235-malicious wireless-aodv-malicious.tcl
num_nodes is set 5
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead
Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 550.0
SORTING LISTS ...DONE!
Segmentation fault (core dumped)

Last edited by anand755; 04-27-2015 at 03:28 AM.
 
Old 04-27-2015, 03:26 AM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,517

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #6.

Please read post #2 :
"" $ cd ns-2.35/
$ cp ns ns235-malicious ( or any new name (ns-malicious))
$ sudo cp ns235-malicious /usr/local/bin/ ""

By using plain 'ns' you are at risk using an ns with no malicious.
All simulations are to be run with $ ns-malicious file.tcl

Also : Please start with all the tested examples :
aodv-malicious-examples-10.2013.tar.gz, see post #5.

-
 
Old 04-28-2015, 11:58 PM   #8
anand755
Member
 
Registered: Nov 2014
Posts: 34

Original Poster
Rep: Reputation: Disabled
yes i m runnin the adov tested example wid ns235-malicious code..all the file are running only the wireless-aodv-malicious.tcl is saying the segmentation fault (core dump) error
i have posted the error

num_nodes is set 5
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead
Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 550.0
SORTING LISTS ...DONE!
Segmentation fault (core dumped)

otherfiles m-aodv.tcl n other file are running smoothly

help please
 
Old 04-29-2015, 01:10 AM   #9
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,517

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #8.
Quote:
I'm running the adov tested example
Which example ? ? A file name, please.

And which "Linux OS" are you using now ?
Please show the output from this command : uname -m


-
 
Old 04-29-2015, 11:02 PM   #10
anand755
Member
 
Registered: Nov 2014
Posts: 34

Original Poster
Rep: Reputation: Disabled
the file name is wireless-aodv-malicious.tcl
i m using ubuntu 12.04
 
Old 04-30-2015, 03:49 AM   #11
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,517

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #10.

Please answer to the questions in post #9 :
You must show the reply from the command $ uname -m

Ubuntu 12.04 is not the OS specification, there is more than one version :
Ubuntu 12.04 - i686, Ubuntu 12.04 - x86_64 ..... ........


The file "wireless-aodv-malicious.tcl" will most often end with 'Segmentation fault'.
But : After the simulation has created two files : 1aaa.nam 10.6MB, 1aaa.tr 7.9MB.
.. Not very usable :
* Old default wireless-examples.tcl, edited to AODV : 'Segmentation fault'.
Also in a default simulation with no "malicious / hacker" added.


So we will have to find genuine AODV examples which work OK : ns-2.3x/tcl/ex/wpan/**

E.g. wpan_demo1.tcl ,,, add this in line 115 :
$ns_ at 0.0 "[$node_(2) set ragent_] hacker" ;#
.... And try out the file.



-

Last edited by knudfl; 04-30-2015 at 03:07 PM.
 
Old 02-27-2016, 10:55 PM   #12
rjuna
LQ Newbie
 
Registered: Nov 2015
Posts: 11

Rep: Reputation: Disabled
hallo @knudfl
can you help me aading malicious node in aodv ns 2.35 and i use ubuntu 14.04
i have follow instructure to change aodv.h and aodv.cc but when i run command make & make install that eror.
this is the tutorial which i follow and aodv.h and aodv.cc which i change.
and this message eror when i run command make after change.

make: *** [common/scheduler.o] Error 1
r_junaedi@lenovo:~/ns-allinone-2.35/ns-2.35$ sudo make install
[sudo] password for r_junaedi:
for d in /usr/local/man/man1; do \
if [ ! -d $d ]; then \
mkdir -p $d ;\
fi;\
done
/usr/bin/install -c -m 755 ns /usr/local/bin
/usr/bin/install: cannot stat ‘ns’: No such file or directory
make: *** [install-ns] Error 1
r_junaedi@lenovo:~/ns-allinone-2.35/ns-2.35$
Attached Files
File Type: txt instruction malicious.txt (1.9 KB, 34 views)
File Type: txt aodv.cc.txt (34.6 KB, 22 views)
File Type: txt aodv.h.txt (9.6 KB, 25 views)

Last edited by rjuna; 02-27-2016 at 10:57 PM.
 
Old 02-27-2016, 11:28 PM   #13
rjuna
LQ Newbie
 
Registered: Nov 2015
Posts: 11

Rep: Reputation: Disabled
Re#2
hallo mr@knudfl
i try to add malicious node in aodv ns 2.35 with ubuntu 14.04 (Linux lenovo 3.16.0-57-generic #77~14.04.1-Ubuntu SMP Thu Dec 17 23:20:00 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux) and i follow step #2
but i saw some error, the message like this,

r_junaedi@lenovo:~/ns-allinone-2.35$ patch -p0 <aodv-malicious_ns235.patch
patching file ns-2.35/aodv/aodv.cc
Hunk #1 succeeded at 86 (offset 5 lines).
Hunk #2 FAILED at 147.
Hunk #3 succeeded at 455 with fuzz 2 (offset 12 lines).
1 out of 3 hunks FAILED -- saving rejects to file ns-2.35/aodv/aodv.cc.rej
patching file ns-2.35/aodv/aodv.h

so what i must to do, Thanks

Last edited by rjuna; 02-27-2016 at 11:32 PM.
 
Old 02-28-2016, 02:51 PM   #14
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,517

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #13.

? Are you sure the right ns2 = ns-allinone-2.35_gcc482.tar.gz was used ?
.... See post #2.

? If you did other changes to your ns-2.35, the patch may fail.
Usually easy to edit manually. The file aodv.cc.rej tells how to do.

You can also set up a second (and third) ns-allinone-2.35 .
Actually you can have as many ns-allinone-2.x as you want, at the same time.
( I have 200 on one OS.)
But : Do never add any *PATH text to .bashrc. Not required.


-
 
  


Reply

Tags
malicious, ns2


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to add malicious node in dsr anand755 Linux - Networking 1 04-10-2015 02:29 PM
how to add node clone in the tcl script in ns2 using aodv deepali_19 Linux - Wireless Networking 0 03-27-2015 01:45 PM
getting error in .tcl while creating malicious node in aodv in ns2.35 saa-6611 Linux - Software 12 05-22-2014 06:00 AM
NS-2: Malicious node in AODV Error amissan Linux - Software 1 05-05-2013 10:28 AM
tunnel formation between two malicious node by modifying aodv ns2 indumit18 Linux - Newbie 0 10-28-2011 05:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration