Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions deepsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
term = input("Enter Search: ")

results = searchFTS(term,con)
print("Found " + str(len(results)) + " Results.")
print(f"Found {len(results)} Results.")

for i in results:
string = ""
for j in i:
string += j
string = "".join(i)
Comment on lines -12 to +15
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 12-17 refactored with the following changes:

print(string)
2 changes: 1 addition & 1 deletion grime.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
titlePrinter()
check = rootcheck()
masterList = []
blacklist = ('http://76qugh5bey5gum7l.onion')
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 24-24 refactored with the following changes:

while len(inputList) > 0:
if not os.path.exists("../output/deepminer.db"):
deepminerDB = createDB()
Expand All @@ -21,7 +22,6 @@
url = random.choice(inputList)
torstatus()
extensions = ('.jpg', 'jpeg', '.mp4', '.png', '.gif')
blacklist = ('http://76qugh5bey5gum7l.onion')
if url not in masterList and not url.endswith(extensions) and not url.startswith(blacklist):
print(Y +"""
[GRIME] New Iteration:""")
Expand Down
38 changes: 18 additions & 20 deletions modules/deephelpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,13 @@ def onionHTML(url):
proxy = httplib2.ProxyInfo(proxy_type=socks.PROXY_TYPE_SOCKS5, proxy_host='localhost', proxy_port=9050)
http = httplib2.Http(proxy_info=proxy, timeout=30)
content = http.request(url, headers={'Connection': 'close', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36'})[1]
html = str(content,'utf-8').replace('\t',' ').replace('\n',' ').replace('\r',' ').replace('\"','')
return html
return (
str(content, 'utf-8')
.replace('\t', ' ')
.replace('\n', ' ')
.replace('\r', ' ')
.replace('\"', '')
)
Comment on lines -25 to +31
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function onionHTML refactored with the following changes:

except:
return "None"

Expand Down Expand Up @@ -56,12 +61,9 @@ def ahmia():
for matchNum, match in enumerate(matches, start=1):
url = (match.group())
results.append(url)
ahmia = list(set(results))
return ahmia
return list(set(results))
Comment on lines -59 to +64
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ahmia refactored with the following changes:


def redditOnions():
results = []
regex = r"https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.onion\/?[-a-zA-Z0-9@:%._\/+~#=]{1,256}"
Comment on lines -63 to -64
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function redditOnions refactored with the following changes:

url = "https://www.reddit.com/r/onions/new.json?limit=10000000000000000000000000000000"
req = request.Request(url, data=None, headers={'Connection': 'close', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.47 Safari/537.36'})

Expand All @@ -72,12 +74,13 @@ def redditOnions():
if "Traceback (most recent call last):" in dataString:
redditOnions()
else:
regex = r"https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.onion\/?[-a-zA-Z0-9@:%._\/+~#=]{1,256}"
matches = re.finditer(regex, dataString, re.MULTILINE)
results = []
for matchNum, match in enumerate(matches, start=1):
url = (match.group())
results.append(url)
reddit = list(set(results))
return reddit
return list(set(results))

def torstatus():
torstatus = subprocess.getoutput("Service Tor Status | grep Active")
Expand All @@ -104,7 +107,7 @@ def urlSplitter(url):
directory = str(url.split(".org")[1])
url = str(url.split(".org")[0]) + ".org"
else:
print(Y +"Unknown URL " + str(url))
print(f"{Y}Unknown URL {str(url)}")
Comment on lines -107 to +110
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function urlSplitter refactored with the following changes:

exit()
if directory == "":
directory = "/"
Expand All @@ -116,8 +119,7 @@ def urlSplitter(url):


def removeDuplicates(listOne, listTwo):
results = listOne + list(set(listTwo) - set(listOne))
return results
return listOne + list(set(listTwo) - set(listOne))
Comment on lines -119 to +122
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function removeDuplicates refactored with the following changes:


def aTag(inputURL,html):
if inputURL[-1] == "/":
Expand All @@ -129,25 +131,21 @@ def aTag(inputURL,html):
url = (match.group())
results.append(url)
onions = list(set(results))
for i in onions:
temp.append((i.replace("<a href=","").replace(">","")))
temp.extend(i.replace("<a href=","").replace(">","") for i in onions)
for i in temp:
if "http" in i:
if ".onion" not in i:
pass
else:
if ".onion" in i:
temp2.append(i)
elif "mailto:" in i:
pass
elif i.startswith("../"):
i = i.replace("../",inputURL+"/")
i = i.replace("../", f"{inputURL}/")
temp2.append(i)
elif i.startswith("/"):
temp2.append(inputURL+i)
else:
temp2.append(inputURL + "/" + i)
aTag = list(set(temp2))
return aTag
temp2.append(f"{inputURL}/{i}")
return list(set(temp2))
Comment on lines -132 to +148
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function aTag refactored with the following changes:


def inputAdder(newInput, input):
for i in input:
Expand Down
12 changes: 4 additions & 8 deletions modules/deepsqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
import sqlite3

def createDB():
con = sqlite3.connect('output/deepminer.db')
return con
return sqlite3.connect('output/deepminer.db')
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function createDB refactored with the following changes:


def connectDB():
con = sqlite3.connect('output/deepminer.db', timeout=30)
return con
return sqlite3.connect('output/deepminer.db', timeout=30)
Comment on lines -9 to +8
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function connectDB refactored with the following changes:


def createTables(con):
cur = con.cursor()
Expand Down Expand Up @@ -66,8 +64,7 @@ def searchDB(term,con):
cur = con.cursor()
query = "SELECT URL,Directory FROM Deepdata WHERE HTML LIKE \'%" + term + "%\' ORDER BY URL;"
cur.execute(query)
results = cur.fetchall()
return results
return cur.fetchall()
Comment on lines -69 to +67
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function searchDB refactored with the following changes:


def createFTStable(con):
cur = con.cursor()
Expand All @@ -83,5 +80,4 @@ def searchFTS(term,con):
cur = con.cursor()
query = "SELECT URL,Directory FROM Deepsearch WHERE HTML MATCH \'" + term + "\' ORDER BY rank;"
cur.execute(query)
results = cur.fetchall()
return results
return cur.fetchall()
Comment on lines -86 to +83
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function searchFTS refactored with the following changes: