commit b2b2b54306f503335cc52edc82426baea45da242 Author: Arturo Filastò art@fuffa.org Date: Sun Nov 25 16:30:17 2012 +0100
Handle the case in which we do not get a DNS lookup response and include it in the report --- nettests/core/dnsspoof.py | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/nettests/core/dnsspoof.py b/nettests/core/dnsspoof.py index 48991ea..5c50c2f 100644 --- a/nettests/core/dnsspoof.py +++ b/nettests/core/dnsspoof.py @@ -38,8 +38,13 @@ class DNSSpoof(scapyt.ScapyTest): This is not tested, but the concept is that if the two responses match up then spoofing is occuring. """ - test_answer = report['test_a_lookup']['answered_packets'][0][1] - control_answer = report['test_control_a_lookup']['answered_packets'][0][1] + try: + test_answer = report['test_a_lookup']['answered_packets'][0][1] + control_answer = report['test_control_a_lookup']['answered_packets'][0][1] + except IndexError: + self.report['spoofing'] = 'no_answer' + return + if test_answer[UDP] == control_answer[UDP]: self.report['spoofing'] = True else:
tor-commits@lists.torproject.org