From 45a26b6db9407aced511c7c08a4dc1159dfaa687 Mon Sep 17 00:00:00 2001 From: Giulio Date: Thu, 8 Nov 2018 15:55:24 +0100 Subject: [PATCH] Censys module and Bing draft --- acasown.py | 8 +++++++- bong/__init__.py | 30 ++++++++++++++++++++++++++++++ bong/__init__.pyc | Bin 0 -> 1036 bytes censys/__init__.py | 44 ++++++++++++++++++++++++++++++++++++++------ ripe/__init__.py | 3 ++- webtech/__init__.py | 0 6 files changed, 77 insertions(+), 8 deletions(-) create mode 100644 bong/__init__.pyc create mode 100644 webtech/__init__.py diff --git a/acasown.py b/acasown.py index 6dff5c0..f10bcde 100644 --- a/acasown.py +++ b/acasown.py @@ -3,4 +3,10 @@ import censys import bong r = ripe.Ripe() -print(r.search("trenitalia")) \ No newline at end of file +c = censys.Censys("dummy", "dummy") +targets = r.search("trenitalia") +print("Found " + str(len(targets)) + " ranges from Ripe") +hosts = c.search_ipv4(c.build_query_ipv4(targets)) +print("Found " + str(len(hosts)) + " hosts from Censys") +for i in hosts: + print(i) \ No newline at end of file diff --git a/bong/__init__.py b/bong/__init__.py index e69de29..badb7ec 100644 --- a/bong/__init__.py +++ b/bong/__init__.py @@ -0,0 +1,30 @@ +import requests +import xml.etree.ElementTree as ET + +class Bing: + + def __init__(self): + self.url = 'https://www.bing.com/search' +''' + def search_hosts(self, hosts): + for host in hosts: + parse(search(host['ip'])) + + + def search(self, ip,): + r = requests.get(self.url, params={'q': 'ip:' + ip, 'format': 'rss', 'first': first}); + tree = ET.fromstring(r.content) + return tree + + def parse(self, tree): + count = 0 + for i in tree[0]: + if i.tag == 'item': + count += 1 + print(i[1].text) + + if count == 10: + return 1 + else: + return 0 +''' \ No newline at end of file diff --git a/bong/__init__.pyc b/bong/__init__.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b05a3d35410509e095d52808bbabe0c953472c04 GIT binary patch literal 1036 zcmbVK!EVz)5S_J?l!ii^B81ABgHQ2^AXODYv{gBv9GpssRLC;UHr){0iFYD`l$^q^ z@hAKN9{_JARpCl4&v?8$^Y+b~4Szjq|9JoNDyQ2g#Pr=y!=_{pq9!WcZ#;c&Abjh}@g2O81(<&hX8~;F5C9ATW;6&X8AJiL zb8&*uf}O(r85|Q$46&xWP)MwZo`FSA$TX?90%VJN8)Mc1aY&N}tw6a+8$;`mRv{?v z0I1J`JIm^<@Lt+>vtt&1a}*KP-fO~jRTmkvGmXf+EJlBwb<;=V)*_IqhSDNN#i6HB_waUe{wGoy`oqvHSzNrcukK+r+ah7Mk z`dY@Ht8yHtsVg0)X?ONbxq6$``Hc|t;>dK(p~vsyifFhV%-V*g$jy=`Y^RJB0UxY&JA;AbSHD{)lcbK;PjI(vBS4!U+i{ zis)!nD$d5+j_r~oA(uRs644{C7A31F?mk)w1P1HvLj?W+j!esR%)V)xC&8X+1ltM7 z6w|cK3Y(@nt~4#G(PE0