Search in sources :

Example 1 with Exploit

use of org.csploit.android.net.Target.Exploit in project android by cSploit.

the class ExploitFinder method setStartedState.

private void setStartedState() {
    mSearchProgress.setVisibility(View.VISIBLE);
    final Target target = System.getCurrentTarget();
    job = Search.searchExploitForServices(target, new Search.Receiver<Exploit>() {

        private boolean somethingFound = false;

        @Override
        public void onItemFound(final Exploit exploit) {
            somethingFound = true;
            ExploitFinder.this.runOnUiThread(new Runnable() {

                @Override
                public void run() {
                    target.addExploit(exploit);
                    mAdapter.notifyDataSetChanged();
                }
            });
        }

        @Override
        public void onFoundItemChanged(Exploit exploit) {
            ExploitFinder.this.runOnUiThread(new Runnable() {

                @Override
                public void run() {
                    mAdapter.notifyDataSetChanged();
                }
            });
        }

        @Override
        public void onEnd() {
            ExploitFinder.this.runOnUiThread(new Runnable() {

                @Override
                public void run() {
                    mSearchProgress.setVisibility(View.GONE);
                    mSearchFloatingActionButton.setImageDrawable(ContextCompat.getDrawable(getBaseContext(), R.drawable.ic_stop_24dp));
                    buttonPlayed = true;
                    if (System.getCurrentExploits().size() == 0) {
                        new FinishDialog(getString(R.string.warning), getString(R.string.no_exploits_found), ExploitFinder.this).show();
                    } else if (!somethingFound) {
                        new ErrorDialog(getString(R.string.warning), getString(R.string.no_exploits_found), ExploitFinder.this).show();
                    }
                }
            });
        }
    });
}
Also used : Target(org.csploit.android.net.Target) FinishDialog(org.csploit.android.gui.dialogs.FinishDialog) ErrorDialog(org.csploit.android.gui.dialogs.ErrorDialog) Exploit(org.csploit.android.net.Target.Exploit) MsfExploit(org.csploit.android.net.metasploit.MsfExploit)

Aggregations

ErrorDialog (org.csploit.android.gui.dialogs.ErrorDialog)1 FinishDialog (org.csploit.android.gui.dialogs.FinishDialog)1 Target (org.csploit.android.net.Target)1 Exploit (org.csploit.android.net.Target.Exploit)1 MsfExploit (org.csploit.android.net.metasploit.MsfExploit)1