SHOW:
|
|
- or go back to the newest paste.
1 | #!/usr/bin/python | |
2 | ||
3 | # all websites grabber | |
4 | ||
5 | ''' | |
6 | ||
7 | 888b d888 .d8888b. | |
8 | 8888b d8888 d88P Y88b | |
9 | 88888b.d88888 888 888 | |
10 | 888Y88888P888 888 | |
11 | 888 Y888P 888 888 | |
12 | 888 Y8P 888 888 888 | |
13 | 888 " 888 Y88b d88P | |
14 | 888 888 "Y8888P" | |
15 | ||
16 | Coded by MatriX Coder from tunisia | |
17 | Use my code as you want :D | |
18 | ||
19 | ''' | |
20 | ||
21 | import re , urllib2 , sys , os | |
22 | from platform import system | |
23 | ||
24 | if system() == 'Linux': | |
25 | os.system('clear') | |
26 | if system() == 'Windows': | |
27 | os.system('cls') | |
28 | ||
29 | logo = ''' | |
30 | ||
31 | ___ __ __ | |
32 | / | / / / / | ----| All Sites Grabber |---- | |
33 | / /| | / / / / | Author : MatriX Coder | |
34 | / ___ |/ /___/ /___ | FB : www.fb.com/matrixcoder2 | |
35 | /_/ |_/_____/_____/ | Blog : www.matrixcoder.co.vu | |
36 | ||
37 | ||
38 | [*] Usage : python '''+sys.argv[0]+''' 127.0.0.1 | |
39 | ''' | |
40 | ||
41 | # found this code on stackoverflow.com/questions/19278877 | |
42 | def unique(seq): | |
43 | seen = set() | |
44 | return [seen.add(x) or x for x in seq if x not in seen] | |
45 | ||
46 | print(logo) | |
47 | try: | |
48 | lista = [] | |
49 | s = sys.argv[1] | |
50 | page = 1 | |
51 | print('\n') | |
52 | while page <= 21: | |
53 | bing = "http://www.bing.com/search?q=ip%3A"+s+"+&count=50&first="+str(page) | |
54 | openbing = urllib2.urlopen(bing) | |
55 | readbing = openbing.read() | |
56 | findwebs = re.findall('<h2><a href="(.*?)"' , readbing) | |
57 | for i in range(len(findwebs)): | |
58 | allnoclean = findwebs[i] | |
59 | findall1 = re.findall('http://(.*?)/', allnoclean) | |
60 | for idx, item in enumerate(findall1): | |
61 | if 'www' not in item: | |
62 | findall1[idx] = 'http://www.' + item + '/' | |
63 | else: | |
64 | findall1[idx] = 'http://' + item + '/' | |
65 | lista.extend(findall1) | |
66 | ||
67 | page = page + 10 | |
68 | ||
69 | final = unique(lista) | |
70 | for all1 in final: | |
71 | print(all1) | |
72 | ||
73 | try: | |
74 | for i , l in enumerate(final): | |
75 | pass | |
76 | print '\nSites Found : ' , i + 1 | |
77 | except: | |
78 | pass | |
79 | ||
80 | except IndexError: | |
81 | pass |