ukrodriguez Posted April 28, 2014 Report Posted April 28, 2014 mai exista un asemenea lucru care sa mearga? Quote
stroici Posted April 30, 2014 Report Posted April 30, 2014 Aproape orice scanner de porturi "stie" sa ii poti seta pe ce porturi sa scaneze. Daca intrebi daca exista astfel de compuri cu porturile astea deschise pe Interweb, ieri erau vreo 4-5 milioane Quote
ukrodriguez Posted May 2, 2014 Author Report Posted May 2, 2014 (edited) am incercat 3 pagini de google, si nu am facut decat sa ma virusez. am scanat un host pe care era deschis portul (caci il am de mult) si totusi niciun soft nu mi-a detectat asta. sa fie provideru meu de vina? hmmma, si tot la subiect am citit putin pe google, cum ca porturile 5800-5900 sunt filtrate nu sunt open, si ca trebuie incercat port sweep, nu port scan. Edited May 2, 2014 by ukrodriguez Quote
Bolovanus Posted May 2, 2014 Report Posted May 2, 2014 (edited) package futai;import java.io.IOException;import java.net.InetSocketAddress;import java.net.Socket;import java.util.Scanner;import java.util.StringTokenizer;/*PT UN BOSS DE BOSS!! CEL MAI MARE PATRON!*/public class Futai { public static void main(String[] args) throws IOException { Scanner in = new Scanner(System.in); System.out.println("Baga ip start"); String ipStart = in.nextLine(); System.out.println("Baga ip sfarsit"); String ipEnd = in.nextLine(); int x = 0; long start = host2long(ipStart); long end = host2long(ipEnd); for (long i = start; i <= end; i++) { if (isOpen(long2dotted(i), 5900)) { System.out.print(" VIN MILIOANELE CU SACU!! gasite: " + x++ + "\r"); } } } public static long host2long(String host) { long ip = 0; if (!Character.isDigit(host.charAt(0))) { return -1; } int[] addr = ip2intarray(host); if (addr == null) { return -1; } for (int i = 0; i < addr.length; ++i) { ip += ((long) (addr[i] >= 0 ? addr[i] : 0)) << 8 * (3 - i); } return ip; } public static int[] ip2intarray(String host) { int[] address = {-1, -1, -1, -1}; int i = 0; StringTokenizer tokens = new StringTokenizer(host, "."); if (tokens.countTokens() > 4) { return null; } while (tokens.hasMoreTokens()) { try { address[i++] = Integer.parseInt(tokens.nextToken()) & 0xFF; } catch (NumberFormatException nfe) { return null; } } return address; } public static String long2dotted(long address) { StringBuilder sb = new StringBuilder(); for (int i = 0, shift = 24; i < 4; i++, shift -= 8) { long value = (address >> shift) & 0xff; sb.append(value); if (i != 3) { sb.append('.'); } } return sb.toString(); } public static boolean isOpen(String ip, int port) throws IOException { InetSocketAddress adr = new InetSocketAddress(ip, port); Socket socket = new Socket(); socket.bind(null); String addr = null; try { socket.connect(adr, 250); return true; } catch (IOException e) { return false; } }} Edited May 2, 2014 by Bolovanus Quote
ukrodriguez Posted May 4, 2014 Author Report Posted May 4, 2014 package futai;import java.io.IOException;import java.net.InetSocketAddress;import java.net.Socket;import java.util.Scanner;import java.util.StringTokenizer;/*PT UN BOSS DE BOSS!! CEL MAI MARE PATRON!*/public class Futai { public static void main(String[] args) throws IOException { Scanner in = new Scanner(System.in); System.out.println("Baga ip start"); String ipStart = in.nextLine(); System.out.println("Baga ip sfarsit"); String ipEnd = in.nextLine(); int x = 0; long start = host2long(ipStart); long end = host2long(ipEnd); for (long i = start; i <= end; i++) { if (isOpen(long2dotted(i), 5900)) { System.out.print(" VIN MILIOANELE CU SACU!! gasite: " + x++ + "\r"); } } } public static long host2long(String host) { long ip = 0; if (!Character.isDigit(host.charAt(0))) { return -1; } int[] addr = ip2intarray(host); if (addr == null) { return -1; } for (int i = 0; i < addr.length; ++i) { ip += ((long) (addr[i] >= 0 ? addr[i] : 0)) << 8 * (3 - i); } return ip; } public static int[] ip2intarray(String host) { int[] address = {-1, -1, -1, -1}; int i = 0; StringTokenizer tokens = new StringTokenizer(host, "."); if (tokens.countTokens() > 4) { return null; } while (tokens.hasMoreTokens()) { try { address[i++] = Integer.parseInt(tokens.nextToken()) & 0xFF; } catch (NumberFormatException nfe) { return null; } } return address; } public static String long2dotted(long address) { StringBuilder sb = new StringBuilder(); for (int i = 0, shift = 24; i < 4; i++, shift -= 8) { long value = (address >> shift) & 0xff; sb.append(value); if (i != 3) { sb.append('.'); } } return sb.toString(); } public static boolean isOpen(String ip, int port) throws IOException { InetSocketAddress adr = new InetSocketAddress(ip, port); Socket socket = new Socket(); socket.bind(null); String addr = null; try { socket.connect(adr, 250); return true; } catch (IOException e) { return false; } }}dude, observ ca sursa este scrisa in java. asa ca am pus mana, am descarcat eclipsa, new project-new class-runam intordus adresa start si adresa end in consola, dupa care, ce sa vezi, nu-mi face print programelul.am si cateva warnings in code.tie iti afiseaza rezultatele?gresesc eu cevams mult Quote