def check_ip(ip, pl, ports, iface): for port in ports: res = check_port(ip, int(port), iface=iface) if res: with pl: print(f'{ip}:{port} ({int(res[1]*1000):>4} ms)') write_result(ip, port)
def check(ip, pl, out, max_count, *scanopts): global counter with pl: if counter >= max_count: raise StopIteration() res = check_port(ip, *scanopts) if res: _, time = res with pl: if counter < max_count: # precision ensurance counter += 1 print(f'{counter:<4} {ip:<15} {int(time*1000):>4} ms') out.write(f'{ip}\n')
def check_ip(ips, gen_lock, print_lock): while True: with gen_lock: try: ip = next(ips) except StopIteration: break if check_port(ip, 80) and check_url(ip, 80, ''): with print_lock: print('[*]', ip) with open('data/web_fuzz.txt') as f: for ln in f: path = ln.rstrip() if check_url(ip, 80, path): with print_lock: print('[*]', ip, path) inc(path)
def check_ip(ip, print_lock): if check_port(ip, 80): title = get_meta(ip) if title: with print_lock: print(ip, title)
def check_host(ip, lock): res = check_port(ip, 21) if res: process_ftp(ip, int(res[1] * 1000), lock)