|
|
|
@ -49,8 +49,7 @@ import net.yacy.search.schema.CollectionSchema;
|
|
|
|
|
import net.yacy.server.serverObjects;
|
|
|
|
|
import net.yacy.server.serverSwitch;
|
|
|
|
|
|
|
|
|
|
public class CrawlStartScanner_p
|
|
|
|
|
{
|
|
|
|
|
public class CrawlStartScanner_p {
|
|
|
|
|
|
|
|
|
|
private final static int CONCURRENT_RUNNER = 200;
|
|
|
|
|
|
|
|
|
@ -99,22 +98,22 @@ public class CrawlStartScanner_p
|
|
|
|
|
hostSet.add(ip.getHostAddress());
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
final Set<InetAddress> myPublicIPs = new HashSet<InetAddress>();
|
|
|
|
|
myPublicIPs.addAll(Domains.myPublicIPv4());
|
|
|
|
|
myPublicIPs.addAll(Domains.myPublicIPv6());
|
|
|
|
|
for(final InetAddress myPublicIP: myPublicIPs) {
|
|
|
|
|
final Set<InetAddress> myPublicIPs = new HashSet<InetAddress>();
|
|
|
|
|
myPublicIPs.addAll(Domains.myPublicIPv4());
|
|
|
|
|
myPublicIPs.addAll(Domains.myPublicIPv6());
|
|
|
|
|
for(final InetAddress myPublicIP: myPublicIPs) {
|
|
|
|
|
if (Domains.isThisHostIP(myPublicIP)) {
|
|
|
|
|
final Set<String> myIPs = sb.peers.mySeed().getIPs();
|
|
|
|
|
for(final String myIP: myIPs) {
|
|
|
|
|
final Set<String> myIPs = sb.peers.mySeed().getIPs();
|
|
|
|
|
for(final String myIP: myIPs) {
|
|
|
|
|
ip = Domains.dnsResolve(myIP);
|
|
|
|
|
if(ip != null) {
|
|
|
|
|
hostSet.add(ip.getHostAddress());
|
|
|
|
|
hostSet.add(ip.getHostAddress());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
hostSet.add(myPublicIP.getHostAddress());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
String hos = ""; for (String s: hostSet) hos += s + "\n";
|
|
|
|
@ -151,7 +150,9 @@ public class CrawlStartScanner_p
|
|
|
|
|
final Scanner scanner = new Scanner(CONCURRENT_RUNNER, timeout);
|
|
|
|
|
|
|
|
|
|
boolean scanhttp = "on".equals(post.get("scanhttp", ""));
|
|
|
|
|
int scanhttpport = post.getInt("scanhttpport", 80);
|
|
|
|
|
boolean scanhttps = "on".equals(post.get("scanhttps", ""));
|
|
|
|
|
int scanhttpsport = post.getInt("scanhttpsport", 443);
|
|
|
|
|
boolean scanftp = "on".equals(post.get("scanftp", ""));
|
|
|
|
|
boolean scansmb = "on".equals(post.get("scansmb", ""));
|
|
|
|
|
|
|
|
|
@ -187,11 +188,11 @@ public class CrawlStartScanner_p
|
|
|
|
|
if (ip != null) scanbase.add(ip);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
scanner.addProtocols(Scanner.genlist(scanbase, subnet), scanhttp, scanhttps, scanftp, scansmb);
|
|
|
|
|
scanner.addProtocols(Scanner.genlist(scanbase, subnet), scanhttp, scanhttpport, scanhttps, scanhttpsport, scanftp, scansmb);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ("intranet".equals(post.get("source", ""))) {
|
|
|
|
|
scanner.addProtocols(Scanner.genlist(Domains.myIntranetIPs(), subnet), scanhttp, scanhttps, scanftp, scansmb);
|
|
|
|
|
scanner.addProtocols(Scanner.genlist(Domains.myIntranetIPs(), subnet), scanhttp, scanhttpport, scanhttps, scanhttpsport, scanftp, scansmb);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
scanner.terminate();
|
|
|
|
|