Closed gustavo-iniguez-goya closed 9 years ago
I have also seen this issue, nothing major, but a bug nonetheless.
Due to this problem, if you perform a port scanner, and exits from the app, when the event arrives this exception is fired:
2131-2930/org.csploit.android E/ACRA﹕ org.csploit.android fatal error : length=0; index=2 java.lang.ArrayIndexOutOfBoundsException: length=0; index=2 at java.util.Vector.arrayIndexOutOfBoundsException(Vector.java:907) at java.util.Vector.elementAt(Vector.java:328) at java.util.Vector.get(Vector.java:442) at org.csploit.android.core.System.getTarget(System.java:1032) at org.csploit.android.core.System.getCurrentTarget(System.java:1044) at org.csploit.android.core.System.addOpenPort(System.java:1144) at org.csploit.android.core.System.addOpenPort(System.java:1134)
When we perform a port scan by the first time, we tried to get the port protocol by calling System.getProtocolByPort(port); from onPortfound().
getProtocolByPort() calls preloadServices() to load known services from files/tools/nmap/nmap-services, which takes 21s. That seems to be the culprit of this behaviour.
Workaround for PortScanner (preloadServces()): by deleting comments (#.*$) and services of "unknown" type from the file nmap-services, the file reduces from ~600KB (~20k lines) to ~80KB (~4k lines), and then it takes to load just 2-3secs.
Does it have any sense to have such a big file to only use 4k lines? @cSploit/android-devs , @users
Edited: the problem is with these 2 methods, which take to load on a htc desire 4s and 11s respectively.
preloadVendors() causes on old devices to display a blank screen on the app start up. preloadServices() causes several problems when using the Port Scanner.