Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.IOException;
- import java.io.PrintStream;
- public class Winbox
- {
- public static void main(String[] args)
- {
- String input = args[0];
- int slashPos = input.indexOf("://");
- int passPos = input.indexOf(":", slashPos + 3);
- int ipPos = input.indexOf("@");
- String username = input.substring(slashPos + 3, passPos);
- String password = input.substring(passPos + 1, ipPos);
- String ip = input.substring(ipPos + 1).replace("/", "");
- System.out.println(username);
- System.out.println(password);
- System.out.println(ip);
- Runtime r = Runtime.getRuntime();
- try
- {
- r.exec("c:\\winbox\\winbox.exe " + ip + " " + username + " " + password);
- }
- catch (IOException e)
- {
- e.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement