From 0ee5c8a24b4ea596ebed315270430dc69af2bcb9 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 10 May 2011 14:57:35 +0200 Subject: fixed minor fuckup(refactoring error),logging --- modules/people/src/arping.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'modules/people/src/arping.py') diff --git a/modules/people/src/arping.py b/modules/people/src/arping.py index 6c040969..eea176e0 100755 --- a/modules/people/src/arping.py +++ b/modules/people/src/arping.py @@ -2,6 +2,8 @@ import logging log = logging.getLogger('arpingy') +logging.disable(logging.WARNING) + import os,sys try: if (os.geteuid() != 0): @@ -12,7 +14,7 @@ try: log.debug("pinging "+ str(iprange)) """Arping function takes IP Address or Network, returns nested mac/ip list""" try: - conf.verb=0 + conf.verb=1 ans,unans=arping(iprange,iface=iface,timeout=1,retry=3) collection = [] -- cgit v1.2.3 From 951d398e20fdb778289e7dff2350594503dc300f Mon Sep 17 00:00:00 2001 From: krebs Date: Sun, 22 May 2011 01:42:36 +0200 Subject: updated people script, removed bloat from people script collection --- modules/people/src/arping.py | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100755 modules/people/src/arping.py (limited to 'modules/people/src/arping.py') diff --git a/modules/people/src/arping.py b/modules/people/src/arping.py deleted file mode 100755 index eea176e0..00000000 --- a/modules/people/src/arping.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/python - -import logging -log = logging.getLogger('arpingy') -logging.disable(logging.WARNING) - -import os,sys -try: - if (os.geteuid() != 0): - raise Exception('no root permissions') - from scapy.all import * #might throws "no such module" - - def arpingy(iprange="10.42.1.0/24",iface='eth0'): - log.debug("pinging "+ str(iprange)) - """Arping function takes IP Address or Network, returns nested mac/ip list""" - try: - conf.verb=1 - ans,unans=arping(iprange,iface=iface,timeout=1,retry=3) - - collection = [] - for snd, rcv in ans: - result = rcv.sprintf(r"%ARP.psrc% %Ether.src%").split() - log.debug(result) - return result # take just the first arp reply - except Exception as e: - print ("something went wrong while arpinging " + str(e)) - return [] - -except Exception as e: - log.error("Cannot load arping functions!" + str(e)) - def arpingy(iprange='',iface=''): - raise Exception ('arping not available') - - -if __name__ =='__main__': - logging.basicConfig(level=logging.DEBUG) - arpingy(sys.argv[1],sys.argv[2]) -- cgit v1.2.3