Giulio 5 years ago
parent
commit
11010df1a6
1 changed files with 38 additions and 0 deletions
  1. 38 0
      bong.py

+ 38 - 0
bong.py

@@ -0,0 +1,38 @@
+import sys
+from netaddr import IPNetwork
+import requests
+import xml.etree.ElementTree as ET
+
+url = 'https://www.bing.com/search'
+cidr = '192.168.1.1/24'
+
+def main():
+	first = 1
+	for ip in IPNetwork(cidr):
+		print('Looking for ' + str(ip))
+		while (parse(search(str(ip), first))):
+			if first > 200:
+				break
+			first += 10
+
+def help():
+	print('Usage: ./dork 192.168.1.1/24')
+
+def search(ip, first):
+	r = requests.get(url, params={'q': 'ip:' + ip, 'format': 'rss', 'first': first});
+	tree = ET.fromstring(r.content)
+	return tree
+
+def parse(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
+
+main()