Category: Category: Network Mapping
Decrypting SSL/TLS Traffic with SSLSESSIONKEY and Wireshark
Decrypting SSL/TLS traffic from browser (Firefox / Chrome) is possible by using a SSL Session Key, that gets written […]
Read More →Port scanning – alternative
Alternative port scanning tools. Portscan with netcat Scans specific IP between tcp port 20 – 65000.
1 2 |
for i in $(seq 20 65000); do nc -zv 10.xx.xx.xx $i 2>&1;done | grep open |
Check open […]
Read More →Monitor bandwidth consumption with iptables
A method to measure how much bandwidth is consumed for e.g. a nmap scan against a specific host can […]
Read More →Port knocking
Port knocking is a method of obscuring the services that you have running on your machine. It allows your […]
Read More →Network Mapping – Pingsweep
pingsweep.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
#!/usr/bin/env python # ping a list of host with threads for increase speed # use standard linux /bin/ping utility from threading import Thread import subprocess import Queue import re # some global vars num_threads = 15 ips_q = Queue.Queue() out_q = Queue.Queue() # build IP array ips = [] for i in range(1,254): ips.append("10.11.1."+str(i)) # thread code : wraps system ping command def thread_pinger(i, q): """Pings hosts in queue""" while True: # get an IP item form queue ip = q.get() # ping it args=['/bin/ping', '-c', '1', '-W', '1', str(ip)] p_ping = subprocess.Popen(args, shell=False, stdout=subprocess.PIPE) # save ping stdout p_ping_out = p_ping.communicate()[0] if (p_ping.wait() == 0): # rtt min/avg/max/mdev = 22.293/22.293/22.293/0.000 ms search = re.search(r'rtt min/avg/max/mdev = (.*)/(.*)/(.*)/(.*) ms', p_ping_out, re.M|re.I) ping_rtt = search.group(2) out_q.put("OK " + str(ip) + " rtt= "+ ping_rtt) # update queue : this ip is processed q.task_done() # start the thread pool for i in range(num_threads): worker = Thread(target=thread_pinger, args=(i, ips_q)) worker.setDaemon(True) worker.start() # fill queue for ip in ips: ips_q.put(ip) # wait until worker threads are done to exit ips_q.join() # print result while True: try: msg = out_q.get_nowait() except Queue.Empty: break print msg |