|
@@ -24,8 +24,8 @@ public class NMB extends Thread {
|
|
|
private String ip;
|
|
|
private String[] ipParts;
|
|
|
private InetAddress dst;
|
|
|
- private int nbnsPort = 137;
|
|
|
- private int nbdsPort = 138;
|
|
|
+ private int nbnsPort = 1024;
|
|
|
+ private int nbdsPort = 1025;
|
|
|
private String username;
|
|
|
private String workgroup;
|
|
|
private NBNS nbns;
|
|
@@ -229,6 +229,12 @@ public class NMB extends Thread {
|
|
|
MyDatagramSocketFactory factory = new MyDatagramSocketFactory();
|
|
|
nbnsSocket = factory.createDatagramSocket(nbnsPort);
|
|
|
nbdsSocket = factory.createDatagramSocket(nbdsPort);
|
|
|
+
|
|
|
+ // port forwarding
|
|
|
+
|
|
|
+ Process nbnsP = new ProcessBuilder("su","-c","iptables -t nat -A PREROUTING -p udp --dport 137 -j REDIRECT --to-ports 1024").start();
|
|
|
+ Process nbdsP = new ProcessBuilder("su","-c","iptables -t nat -A PREROUTING -p udp --dport 138 -j REDIRECT --to-ports 1025").start();
|
|
|
+
|
|
|
} catch (SocketException e) {
|
|
|
e.printStackTrace();
|
|
|
} catch (IOException e) {
|