SSF.App.DDoS
Class DDoSSessionRand

java.lang.Object
  |
  +--SSF.OS.ProtocolSession
        |
        +--SSF.App.DDoS.DDoSSessionRand
All Implemented Interfaces:
com.renesys.raceway.DML.Configurable

public class DDoSSessionRand
extends ProtocolSession

DDoS Session, the attacker chooses masters and agents randomly.

In this version, the user just specify the attacker and how many children does each non-leaf node control. The attacker chooses hosts to be hijacked randomly. Notice that there are at most two levels of control:
attacker --> master --> agent
so there is no need to specify the total number of hosts to be hijacked. If there are not enough hosts to be hijacked, the node will be assigned in a depth-first order.

For those who want to have total control of the attacking relay network topology, please use DDoSSession. But please also keep in mind that it does not has as many features as this one. This is a revised version, an option to use spoofed packets among agent, masters and the attacker is added.

See Also:
DDoSSession

Field Summary
static int AGENT
           
static int ATTACKER
          level constants, so are "MASTER" and "AGENT"
static int ATTACKING
           
protected  int attackMethod
          attack method
protected  int attackParam
          parameter of attacking
protected  int[] children
          array of IP addresses of children that are directly under control of this master or attacker
static int CLEAN
          status constants, so are "INSTALLED" and "ATTACKING"
static int COMPROMISED
           
protected static com.renesys.raceway.DML.Configuration controlTreeConfig
           
protected static java.lang.String controlTreeFile
          control tree config file
protected static int degree
          the degree of this tree
protected  int endAttackTime
          attack ending time (second).
static int INSTALLED
           
protected  IP ipSess
          IP on this host
protected  int level
          level variable, it shows where in the control tree this host locates.
static int MASTER
           
protected  ProtocolMonitor monitor
          monitors for DDoSSession
protected  boolean monitorON
          monitor switch
protected  Timer myTimer
          timer
protected static RandomStream rng
          random stream
static boolean spoof
          whether to use spoofed packets among zombies, masters and attacker
protected  int startAttackTime
          attack starting time (second).
protected static int startHijackTime
          the time when the attacker "hijack" hosts
 int status
          status variable, default is "INSTALLED"
static int SYN
          attack method constant
protected  int targetIP
          target IP
protected  int targetPort
          target port
protected  int TIME_COST
          time "cost" in seconds to hijack a machine
static java.lang.String VIRTUAL_INTERFACE
          virtual interface that is assumed to be on at every host
 
Fields inherited from class SSF.OS.ProtocolSession
name, use
 
Constructor Summary
DDoSSessionRand()
           
 
Method Summary
protected  void beingHijacked(DDoSMessage msg, int[] toBeHijacked)
           
 void config(com.renesys.raceway.DML.Configuration cfg)
          config the status and level of this DDoSSession instance.
protected  void endAttack(DDoSMessage msg)
           
 void init()
          Init the config tree.
protected  void initAgent(com.renesys.raceway.DML.Configuration cfg)
           
protected  void initAttacker(com.renesys.raceway.DML.Configuration cfg)
          Init the attacker.
protected  void initLevel(java.lang.String evals)
           
protected  void initMaster(com.renesys.raceway.DML.Configuration cfg)
           
protected  void initStatus(java.lang.String evals)
           
protected  void install(DDoSMessage msg)
           
 boolean push(ProtocolMessage message, ProtocolSession fromSession)
          Routine to call when a message is being sent to ("pushed into") this ProtocolSession by another ProtocolSession.
protected  void sendACK(DDoSMessage msg)
           
 void setMonitorEnable(boolean en)
          An ProtocolMonitor may turn on and off calls to its receive() method.
protected  void startAttack(DDoSMessage msg)
           
protected  void startHijack(int[] toBeHijacked)
           
 
Methods inherited from class SSF.OS.ProtocolSession
close, closed, debugIdentifier, inGraph, open, opened, pushAfterDelay, pushAfterDelayFailed, setGraph, version
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLEAN

public static final int CLEAN
status constants, so are "INSTALLED" and "ATTACKING"

See Also:
Constant Field Values

COMPROMISED

public static final int COMPROMISED
See Also:
Constant Field Values

INSTALLED

public static final int INSTALLED
See Also:
Constant Field Values

ATTACKING

public static final int ATTACKING
See Also:
Constant Field Values

ATTACKER

public static final int ATTACKER
level constants, so are "MASTER" and "AGENT"

See Also:
Constant Field Values

MASTER

public static final int MASTER
See Also:
Constant Field Values

AGENT

public static final int AGENT
See Also:
Constant Field Values

VIRTUAL_INTERFACE

public static final java.lang.String VIRTUAL_INTERFACE
virtual interface that is assumed to be on at every host

See Also:
Constant Field Values

SYN

public static final int SYN
attack method constant

See Also:
Constant Field Values

status

public int status
status variable, default is "INSTALLED"


spoof

public static boolean spoof
whether to use spoofed packets among zombies, masters and attacker


monitor

protected ProtocolMonitor monitor
monitors for DDoSSession


monitorON

protected boolean monitorON
monitor switch


level

protected int level
level variable, it shows where in the control tree this host locates.


degree

protected static int degree
the degree of this tree


startHijackTime

protected static int startHijackTime
the time when the attacker "hijack" hosts


startAttackTime

protected int startAttackTime
attack starting time (second). It must be initialized for ATTACKER


endAttackTime

protected int endAttackTime
attack ending time (second). It must be initialized for ATTACKER


targetIP

protected int targetIP
target IP


targetPort

protected int targetPort
target port


attackMethod

protected int attackMethod
attack method


attackParam

protected int attackParam
parameter of attacking


children

protected int[] children
array of IP addresses of children that are directly under control of this master or attacker


ipSess

protected IP ipSess
IP on this host


controlTreeFile

protected static java.lang.String controlTreeFile
control tree config file


controlTreeConfig

protected static com.renesys.raceway.DML.Configuration controlTreeConfig

myTimer

protected Timer myTimer
timer


rng

protected static RandomStream rng
random stream


TIME_COST

protected int TIME_COST
time "cost" in seconds to hijack a machine

Constructor Detail

DDoSSessionRand

public DDoSSessionRand()
Method Detail

config

public void config(com.renesys.raceway.DML.Configuration cfg)
            throws com.renesys.raceway.DML.configException
config the status and level of this DDoSSession instance.

 ProtocolSession [
     name test use SSF.OS.DDoS.DDoSSessionRand
     debug %boolean           #debug switch
     control_tree_file %s     #control tree file name
     monitor [
         use SSF.OS.DDoSMonitor
         debug %s       #debug switch, true/false
     ]
 ]
 

Specified by:
config in interface com.renesys.raceway.DML.Configurable
Overrides:
config in class ProtocolSession
com.renesys.raceway.DML.configException

init

public void init()
          throws ProtocolException
Init the config tree. Only the *attacker* node needs to be initialized.

Overrides:
init in class ProtocolSession
ProtocolException

initStatus

protected void initStatus(java.lang.String evals)
                   throws com.renesys.raceway.DML.configException
com.renesys.raceway.DML.configException

initLevel

protected void initLevel(java.lang.String evals)
                  throws com.renesys.raceway.DML.configException
com.renesys.raceway.DML.configException

initAttacker

protected void initAttacker(com.renesys.raceway.DML.Configuration cfg)
                     throws com.renesys.raceway.DML.configException
Init the attacker.
 attacker_nhi [
     degree %d             #number of children of each non-leaf node
     start_hijack_time %d  #time to issue "hijack" msg
     start_attack_time %d  #time to start attack
     end_attack_time   %d  #time to end attack
     target_nhi        %s  #nhi of the target
     target_port       %d  #target port number
     attack_method     %s  #currently only "SYN" is implemented
     param             %d  #parameter specific to attack
     spoof       %boolean  #whether to spoof communications
 ]
 

com.renesys.raceway.DML.configException

setMonitorEnable

public void setMonitorEnable(boolean en)
An ProtocolMonitor may turn on and off calls to its receive() method. NOTE: the ProtocolMonitor MUST explicitely set enableMonitor(true) in its init() method to begin receiving IP packets.


initMaster

protected void initMaster(com.renesys.raceway.DML.Configuration cfg)
                   throws com.renesys.raceway.DML.configException
com.renesys.raceway.DML.configException

initAgent

protected void initAgent(com.renesys.raceway.DML.Configuration cfg)
                  throws com.renesys.raceway.DML.configException
com.renesys.raceway.DML.configException

push

public boolean push(ProtocolMessage message,
                    ProtocolSession fromSession)
             throws ProtocolException
Description copied from class: ProtocolSession
Routine to call when a message is being sent to ("pushed into") this ProtocolSession by another ProtocolSession. The pusher sends a reference to itself in the second argument. This push happens immediately, without any simulation time elapsing, regardless of other activities taking place in the ProtocolGraph.

If you desire "safe" interaction with other CPU activities, even though your push() consumes no measurable/modelable CPU cycles, define the "cpudelay true" attribute for the ProtocolGraph and use pushAfterDelay(message,fromSession,0.0). This will guarantee proper ordering; that is, the framework will wait until the CPU is free before proceeding with the requested push().

Specified by:
push in class ProtocolSession
ProtocolException

beingHijacked

protected void beingHijacked(DDoSMessage msg,
                             int[] toBeHijacked)
                      throws ProtocolException
ProtocolException

install

protected void install(DDoSMessage msg)

sendACK

protected void sendACK(DDoSMessage msg)
                throws ProtocolException
ProtocolException

startHijack

protected void startHijack(int[] toBeHijacked)

startAttack

protected void startAttack(DDoSMessage msg)

endAttack

protected void endAttack(DDoSMessage msg)