this is based on calsyslab project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

154 lines
5.5 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. __author__ = 'DarkWeb'
  2. '''
  3. Starting point of the Darkweb Markets Mining
  4. '''
  5. from datetime import *
  6. from MarketPlaces.DarkFox.crawler_selenium import crawler as crawlerDarkFox
  7. from MarketPlaces.MikesGrandStore.crawler_selenium import crawler as crawlerMikesGrandStore
  8. from MarketPlaces.DarkTor.crawler_selenium import crawler as crawlerDarkTor
  9. from MarketPlaces.AnonymousMarketplace.crawler_selenium import crawler as crawlerAnonymousMarketplace
  10. from MarketPlaces.CityMarket.crawler_selenium import crawler as crawlerCityMarket
  11. from MarketPlaces.M00nkeyMarket.crawler_selenium import crawler as crawlerM00nkeyMarket
  12. from MarketPlaces.ViceCity.crawler_selenium import crawler as crawlerViceCity
  13. from MarketPlaces.CypherMarketplace.crawler_selenium import crawler as crawlerCypher
  14. from MarketPlaces.PabloEscobarMarket.crawler_selenium import crawler as crawlerPabloEscobar
  15. from MarketPlaces.DarkBazar.crawler_selenium import crawler as crawlerDarkBazar
  16. from MarketPlaces.Sonanza.crawler_selenium import crawler as crawlerSonanza
  17. from MarketPlaces.Kingdom.crawler_selenium import crawler as crawlerKingdom
  18. from MarketPlaces.BlackPyramid.crawler_selenium import crawler as crawlerBlackPyramid
  19. from MarketPlaces.Quest.crawler_selenium import crawler as crawlerQuest
  20. from MarketPlaces.Ares.crawler_selenium import crawler as crawlerAres
  21. from MarketPlaces.Bohemia.crawler_selenium import crawler as crawlerBohemia
  22. from MarketPlaces.TheDarkMarket.crawler_selenium import crawler as crawlerTheDarkMarket
  23. from MarketPlaces.GoFish.crawler_selenium import crawler as crawlerGoFish
  24. from MarketPlaces.ZeroDay.crawler_selenium import crawler as crawlerZeroDay
  25. from MarketPlaces.Torzon.crawler_selenium import crawler as crawlerTorzon
  26. from MarketPlaces.DarkMarket.crawler_selenium import crawler as crawlerDarkMarket
  27. from MarketPlaces.DarkDock.crawler_selenium import crawler as crawlerDarkDock
  28. from MarketPlaces.SilkRoad4.crawler_selenium import crawler as crawlerSilkRoad4
  29. from MarketPlaces.DarkRoad.crawler_selenium import crawler as crawlerDarkRoad
  30. import configparser
  31. import os
  32. import subprocess
  33. config = configparser.ConfigParser()
  34. config.read('../../setup.ini')
  35. CURRENT_DATE = str("%02d" % date.today().month) + str("%02d" % date.today().day) + str("%04d" % date.today().year)
  36. # reads list of marketplaces
  37. def getMarkets():
  38. mkts = []
  39. with open('MarketsList.txt') as f:
  40. mkts = f.readlines()
  41. return mkts
  42. # Creates needed directories for marketplace if doesn't exist
  43. def createDirectory(mkt):
  44. # Package should already be there, holding crawler and parser
  45. # pagesDir = '../' + mkt + '/HTML_Pages'
  46. pagesDir = os.path.join(config.get('Project', 'shared_folder'), "MarketPlaces/" + mkt + "/HTML_Pages")
  47. if not os.path.isdir(pagesDir):
  48. os.makedirs(pagesDir)
  49. currentDateDir = pagesDir + '/' + CURRENT_DATE
  50. if not os.path.isdir(currentDateDir):
  51. os.mkdir(currentDateDir)
  52. listingDir = currentDateDir + '/Listing'
  53. if not os.path.isdir(listingDir):
  54. os.mkdir(listingDir)
  55. listReadDir = listingDir + '/Read'
  56. if not os.path.isdir(listReadDir):
  57. os.mkdir(listReadDir)
  58. descriptionDir = currentDateDir + '/Description'
  59. if not os.path.isdir(descriptionDir):
  60. os.mkdir(descriptionDir)
  61. descReadDir = descriptionDir + '/Read'
  62. if not os.path.isdir(descReadDir):
  63. os.mkdir(descReadDir)
  64. # Opens Tor Browser
  65. def opentor():
  66. global pid
  67. print("Connecting Tor...")
  68. pro = subprocess.Popen(config.get('TOR', 'firefox_binary_path'))
  69. pid = pro.pid
  70. # time.sleep(7.5)
  71. input('Press ENTER when Tor is connected to continue')
  72. return
  73. if __name__ == '__main__':
  74. opentor()
  75. mktsList = getMarkets()
  76. for mkt in mktsList:
  77. mkt = mkt.replace('\n','')
  78. print("\nCreating listing and description directories ... for " + mkt)
  79. createDirectory(mkt)
  80. print("Directories created.")
  81. if mkt == "DarkFox":
  82. # for base in json["DarkFox"]["base"]:
  83. # if crawlerDarkFox(base["url"], base["categories"]):
  84. # break
  85. crawlerDarkFox()
  86. elif mkt == "MikesGrandStore":
  87. crawlerMikesGrandStore()
  88. elif mkt == "DarkTor":
  89. crawlerDarkTor()
  90. elif mkt == "AnonymousMarketplace":
  91. crawlerAnonymousMarketplace()
  92. elif mkt == "CityMarket":
  93. crawlerCityMarket()
  94. elif mkt == "M00nkeyMarket":
  95. crawlerM00nkeyMarket()
  96. elif mkt == "ViceCity":
  97. crawlerViceCity()
  98. elif mkt == "CypherMarketplace":
  99. crawlerCypher()
  100. elif mkt == "PabloEscobarMarket":
  101. crawlerPabloEscobar()
  102. elif mkt == "DarkBazar":
  103. crawlerDarkBazar()
  104. elif mkt == "Sonanza":
  105. crawlerSonanza()
  106. elif mkt == "Kingdom":
  107. crawlerKingdom()
  108. elif mkt == "BlackPyramid":
  109. crawlerBlackPyramid()
  110. elif mkt == "Quest":
  111. crawlerQuest()
  112. elif mkt == "Ares":
  113. crawlerAres()
  114. elif mkt == "GoFish":
  115. crawlerGoFish()
  116. elif mkt == "TheDarkMarket":
  117. crawlerTheDarkMarket()
  118. elif mkt == "ZeroDay":
  119. crawlerZeroDay()
  120. elif mkt == "Torzon":
  121. crawlerTorzon()
  122. elif mkt == "DarkMarket":
  123. crawlerDarkMarket()
  124. elif mkt == 'DarkDock':
  125. crawlerDarkDock()
  126. elif mkt == "SilkRoad4":
  127. crawlerSilkRoad4()
  128. elif mkt == "DarkRoad":
  129. crawlerDarkRoad()
  130. print("\nScraping process completed!")