|
@ -24,7 +24,7 @@ from Forums.OnniForums.parser import cryptBB_links_parser |
|
|
from Forums.Utilities.utilities import cleanHTML |
|
|
from Forums.Utilities.utilities import cleanHTML |
|
|
|
|
|
|
|
|
counter = 1 |
|
|
counter = 1 |
|
|
baseURL = 'http://onnii6niq53gv3rvjpi7z5axkasurk2x5w5lwliep4qyeb2azagxn4qd.onion/' |
|
|
|
|
|
|
|
|
baseURL = 'https://www.crackingpro.com/' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Opens Tor Browser, crawls the website |
|
|
# Opens Tor Browser, crawls the website |
|
@ -58,36 +58,40 @@ def opentor(): |
|
|
|
|
|
|
|
|
# Login using premade account credentials and do login captcha manually |
|
|
# Login using premade account credentials and do login captcha manually |
|
|
def login(driver): |
|
|
def login(driver): |
|
|
|
|
|
|
|
|
#click login button |
|
|
#click login button |
|
|
login_link = driver.find_element( |
|
|
login_link = driver.find_element( |
|
|
by=By.XPATH, value='/html/body/div/div[2]/div/table/tbody/tr[2]/td/center/pre/strong/a').\ |
|
|
|
|
|
|
|
|
by=By.ID, value='elUserSignIn').\ |
|
|
get_attribute('href') |
|
|
get_attribute('href') |
|
|
driver.get(login_link) |
|
|
driver.get(login_link) |
|
|
|
|
|
|
|
|
#entering username and password into input boxes |
|
|
#entering username and password into input boxes |
|
|
usernameBox = driver.find_element(by=By.XPATH, value='/html/body/div/div[2]/div/form/table/tbody/tr[2]/td[2]/input') |
|
|
|
|
|
|
|
|
usernameBox = driver.find_element(by=By.ID, value='auth') |
|
|
#Username here |
|
|
#Username here |
|
|
usernameBox.send_keys('purely_cabbage') |
|
|
|
|
|
passwordBox = driver.find_element(by=By.XPATH, value='/html/body/div/div[2]/div/form/table/tbody/tr[3]/td[2]/input') |
|
|
|
|
|
|
|
|
usernameBox.send_keys('cheese_pizza_man') |
|
|
|
|
|
passwordBox = driver.find_element(by=By.ID, value='password') |
|
|
#Password here |
|
|
#Password here |
|
|
passwordBox.send_keys('$ourP@tchK1ds') |
|
|
|
|
|
|
|
|
passwordBox.send_keys('Gr33nSp@m&3ggs') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
input("Press ENTER when log in is completed\n") |
|
|
input("Press ENTER when log in is completed\n") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# wait for listing page show up (This Xpath may need to change based on different seed url) |
|
|
# wait for listing page show up (This Xpath may need to change based on different seed url) |
|
|
WebDriverWait(driver, 50).until(EC.visibility_of_element_located( |
|
|
WebDriverWait(driver, 50).until(EC.visibility_of_element_located( |
|
|
(By.XPATH, '//*[@id="content"]'))) |
|
|
|
|
|
|
|
|
(By.XPATH, '/html/body/main/div/div/div[1]/section/ol/li[8]'))) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Returns the name of the website |
|
|
# Returns the name of the website |
|
|
def getForumName(): |
|
|
def getForumName(): |
|
|
name = 'OnniForums' |
|
|
|
|
|
|
|
|
name = 'CrackingPro' |
|
|
return name |
|
|
return name |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Return the link of the website |
|
|
# Return the link of the website |
|
|
def getFixedURL(): |
|
|
def getFixedURL(): |
|
|
url = 'http://onnii6niq53gv3rvjpi7z5axkasurk2x5w5lwliep4qyeb2azagxn4qd.onion/' |
|
|
|
|
|
|
|
|
url = 'https://www.crackingpro.com/' |
|
|
return url |
|
|
return url |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -97,7 +101,7 @@ def closetor(driver): |
|
|
# os.system("taskkill /pid " + str(pro.pid)) |
|
|
# os.system("taskkill /pid " + str(pro.pid)) |
|
|
# os.system("taskkill /t /f /im tor.exe") |
|
|
# os.system("taskkill /t /f /im tor.exe") |
|
|
print('Closing Tor...') |
|
|
print('Closing Tor...') |
|
|
driver.close() |
|
|
|
|
|
|
|
|
driver.close()# close the current tab |
|
|
time.sleep(3) |
|
|
time.sleep(3) |
|
|
return |
|
|
return |
|
|
|
|
|
|
|
@ -143,10 +147,10 @@ def getAccess(): |
|
|
url = getFixedURL() |
|
|
url = getFixedURL() |
|
|
driver = createFFDriver() |
|
|
driver = createFFDriver() |
|
|
try: |
|
|
try: |
|
|
driver.get(url) |
|
|
|
|
|
|
|
|
driver.get(url)# open given url |
|
|
return driver |
|
|
return driver |
|
|
except: |
|
|
except: |
|
|
driver.close() |
|
|
|
|
|
|
|
|
driver.close()#close the current tab |
|
|
return 'down' |
|
|
return 'down' |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -164,11 +168,11 @@ def getFullPathName(url): |
|
|
fileName = getNameFromURL(url) |
|
|
fileName = getNameFromURL(url) |
|
|
if isDescriptionLink(url): |
|
|
if isDescriptionLink(url): |
|
|
#..\CryptBB\HTML_Pages\\ |
|
|
#..\CryptBB\HTML_Pages\\ |
|
|
fullPath = r'..\OnniForums\HTML_Pages\\' + str( |
|
|
|
|
|
|
|
|
fullPath = r'..\CrackingPro\HTML_Pages\\' + str( |
|
|
"%02d" % date.today().month) + str("%02d" % date.today().day) + str( |
|
|
"%02d" % date.today().month) + str("%02d" % date.today().day) + str( |
|
|
"%04d" % date.today().year) + r'\\' + r'Description\\' + fileName + '.html' |
|
|
"%04d" % date.today().year) + r'\\' + r'Description\\' + fileName + '.html' |
|
|
else: |
|
|
else: |
|
|
fullPath = r'..\OnniForums\HTML_Pages\\' + str( |
|
|
|
|
|
|
|
|
fullPath = r'..\CrackingPro\HTML_Pages\\' + str( |
|
|
"%02d" % date.today().month) + str("%02d" % date.today().day) + str( |
|
|
"%02d" % date.today().month) + str("%02d" % date.today().day) + str( |
|
|
"%04d" % date.today().year) + r'\\' + r'Listing\\' + fileName + '.html' |
|
|
"%04d" % date.today().year) + r'\\' + r'Listing\\' + fileName + '.html' |
|
|
return fullPath |
|
|
return fullPath |
|
@ -187,8 +191,8 @@ def getNameFromURL(url): |
|
|
def getInterestedLinks(): |
|
|
def getInterestedLinks(): |
|
|
links = [] |
|
|
links = [] |
|
|
|
|
|
|
|
|
# Hacking & Cracking tutorials |
|
|
|
|
|
links.append('http://onnii6niq53gv3rvjpi7z5axkasurk2x5w5lwliep4qyeb2azagxn4qd.onion/Forum-Hacking-Cracking-tutorials') |
|
|
|
|
|
|
|
|
# exploiting tutorials |
|
|
|
|
|
links.append('https://www.crackingpro.com/forum/38-exploiting-tutorials/') |
|
|
# Hacking & Cracking questions |
|
|
# Hacking & Cracking questions |
|
|
# links.append('http://onnii6niq53gv3rvjpi7z5axkasurk2x5w5lwliep4qyeb2azagxn4qd.onion/Forum-Hacking-Cracking-questions') |
|
|
# links.append('http://onnii6niq53gv3rvjpi7z5axkasurk2x5w5lwliep4qyeb2azagxn4qd.onion/Forum-Hacking-Cracking-questions') |
|
|
# Exploit PoCs |
|
|
# Exploit PoCs |
|
@ -212,7 +216,7 @@ def getInterestedLinks(): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def crawlForum(driver): |
|
|
def crawlForum(driver): |
|
|
print("Crawling the OnniForums forum") |
|
|
|
|
|
|
|
|
print("Crawling the CrackingPro forum") |
|
|
|
|
|
|
|
|
linksToCrawl = getInterestedLinks() |
|
|
linksToCrawl = getInterestedLinks() |
|
|
visited = set(linksToCrawl) |
|
|
visited = set(linksToCrawl) |
|
@ -233,7 +237,7 @@ def crawlForum(driver): |
|
|
|
|
|
|
|
|
has_next_page = True |
|
|
has_next_page = True |
|
|
while has_next_page: |
|
|
while has_next_page: |
|
|
list = topicPages(html) |
|
|
|
|
|
|
|
|
list = topicPages(html)#parses? |
|
|
for item in list: |
|
|
for item in list: |
|
|
itemURL = urlparse.urljoin(baseURL, str(item)) |
|
|
itemURL = urlparse.urljoin(baseURL, str(item)) |
|
|
try: |
|
|
try: |
|
@ -247,13 +251,13 @@ def crawlForum(driver): |
|
|
|
|
|
|
|
|
# comment out |
|
|
# comment out |
|
|
#if count == 1: |
|
|
#if count == 1: |
|
|
#count = 0 |
|
|
|
|
|
#break |
|
|
|
|
|
|
|
|
# count = 0 |
|
|
|
|
|
# break |
|
|
|
|
|
|
|
|
try: |
|
|
try: |
|
|
temp = driver.find_element(by=By.XPATH, value= |
|
|
temp = driver.find_element(by=By.XPATH, value= |
|
|
'/html/body/div/div[2]/div/div[2]/div') |
|
|
|
|
|
link = temp.find_element(by=By.CLASS_NAME, value='pagination_next').get_attribute('href') |
|
|
|
|
|
|
|
|
'/html/body/main/div/div/div/div[4]/div/div[1]/div/ul/') |
|
|
|
|
|
link = temp.find_element(by=By.CLASS_NAME, value='ipsPagination_next').get_attribute('href') |
|
|
|
|
|
|
|
|
if link == "": |
|
|
if link == "": |
|
|
raise NoSuchElementException |
|
|
raise NoSuchElementException |
|
@ -275,19 +279,19 @@ def crawlForum(driver): |
|
|
# finalTime = time.time() |
|
|
# finalTime = time.time() |
|
|
# print finalTime - initialTime |
|
|
# print finalTime - initialTime |
|
|
|
|
|
|
|
|
input("Crawling OnniForums forum done sucessfully. Press ENTER to continue\n") |
|
|
|
|
|
|
|
|
input("Crawling CrackingPro forum done sucessfully. Press ENTER to continue\n") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Returns 'True' if the link is Topic link |
|
|
# Returns 'True' if the link is Topic link |
|
|
def isDescriptionLink(url): |
|
|
def isDescriptionLink(url): |
|
|
if 'Thread' in url: |
|
|
|
|
|
|
|
|
if 'topic' in url: |
|
|
return True |
|
|
return True |
|
|
return False |
|
|
return False |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Returns True if the link is a listingPage link |
|
|
# Returns True if the link is a listingPage link |
|
|
def isListingLink(url): |
|
|
def isListingLink(url): |
|
|
if 'Forum' in url: |
|
|
|
|
|
|
|
|
if 'forum' in url: |
|
|
return True |
|
|
return True |
|
|
return False |
|
|
return False |
|
|
|
|
|
|
|
|