-
Notifications
You must be signed in to change notification settings - Fork 5
/
search.py
66 lines (61 loc) · 1.86 KB
/
search.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/env python3
from sys import argv
from getrails import go_duck
from getrails import go_gle
from getrails import go_onion
from urllib import error
# vars
use = 'Use: search.py [options] "<seach expression>"'
art = '''
________ __ .__.__
/ _____/ _____/ |_____________ |__| | ______
/ \ ____/ __ \ __\_ __ \__ \ | | | / ___/
\ \_\ \ ___/| | | | \// __ \| | |__\___ \
\______ /\___ >__| |__| (____ /__|____/____ >
\/ \/ \/ \/'''
enable_dorks = '''\
Dorks Google and Duckduckgo search
----------------------------------
site\t\tFind all urls of domain
intitle\t\tFinds pages that include a specific keyword as part of the indexed title
inurl\t\tFind pages that include a specific keyword as a part
filetype\tSearch for specific file type
intext\t\tSearh for specific text
feed\t\tFind RSS related to search term\
'''
banner = f'''\
{art}
GeTrails are projet for OSINT and Dorks
{use}
\t-d, --dorks\t\tDorks enable in Google and Duckduckgo hacking
\t-o, --onion <term>\tFor search in hidden services
Issue: github.com/Vault-Cyber-Security/getrails-tools/issues\
'''
def search_now (query):
try:
result = go_gle(query)
result.extend(go_duck(query))
except error.HTTPError:
result = go_duck(query)
return '\n'.join(result)
def search_onion (query):
return '\n'.join(go_onion(query))
# Use
try:
if len(argv) > 2:
if argv[1] == '-o' or argv[1] == '--onion':
print(search_onion(argv[2]))
exit(0)
else:
print(use)
exit(1)
elif argv[1] == '--help' or argv[1] == '-h':
print(banner)
exit(0)
elif argv[1] == '--dorks' or argv[1] == '-d':
print(enable_dorks)
exit(0)
else:
print(search_now(argv[1]))
except IndexError:
print(use)