Import
This commit is contained in:
parent
4613573b19
commit
11010df1a6
38
bong.py
Normal file
38
bong.py
Normal file
@ -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()
|
Loading…
Reference in New Issue
Block a user