Added sources config to onioningestor.yml for Hunchly and Pystemon
Added Hunchly python module Added Pystemon python modulepull/6/head
parent
8b209e44d5
commit
a705daa869
@ -0,0 +1,56 @@
|
|||||||
|
#!/usr/bin/python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
__author__ = 'Apurv Singh Gautam'
|
||||||
|
__license__ = "MIT"
|
||||||
|
__version__ = "1.0.0"
|
||||||
|
__maintainer__ = "Apurv Singh Gautam"
|
||||||
|
__status__ = "Development"
|
||||||
|
|
||||||
|
import xlrd
|
||||||
|
from pathlib import Path
|
||||||
|
from subprocess import call
|
||||||
|
|
||||||
|
from onioningestor.sources import Source
|
||||||
|
|
||||||
|
|
||||||
|
class Plugin(Source):
|
||||||
|
|
||||||
|
def __init__(self, logger, name, domain, **kwargs):
|
||||||
|
self.logger = logger
|
||||||
|
self.name = name
|
||||||
|
self.domain = domain
|
||||||
|
super().__init__(self)
|
||||||
|
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
self.logger.info('Getting onions from Hunchly')
|
||||||
|
lines = []
|
||||||
|
'''
|
||||||
|
Hunchly Dropbox Link
|
||||||
|
https://www.dropbox.com/sh/wdleu9o7jj1kk7v/AADq2sapbxm7rVtoLOnFJ7HHa/HiddenServices.xlsx
|
||||||
|
'''
|
||||||
|
call(['wget', self.domain]) # Downloading Hunchly spreadsheet file
|
||||||
|
tmp_filename = 'HiddenServices.xlsx' # File name of Hunchly spreadsheet
|
||||||
|
tmp_filepath = Path(__file__).parents[0]/tmp_filename # File path of the Hunchly spreadsheet
|
||||||
|
workbook = xlrd.open_workbook(tmp_filepath) # Opening the Excel workbook
|
||||||
|
worksheet = workbook.sheet_by_name('Up') # Selecting 'Up' domains sheet
|
||||||
|
|
||||||
|
for row_idx in range(1, worksheet.nrows): # Iterate through rows
|
||||||
|
lines.append(worksheet.cell(row_idx, 1).value) # Getting onion links
|
||||||
|
|
||||||
|
for onion in lines:
|
||||||
|
self.onionQueue.put(
|
||||||
|
(
|
||||||
|
2,
|
||||||
|
self.onion(
|
||||||
|
url=onion,
|
||||||
|
source=self.name,
|
||||||
|
type='domain',
|
||||||
|
status='offline',
|
||||||
|
monitor=False,
|
||||||
|
denylist=False)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
call(['rm', tmp_filepath]) # Deleting the temp Hunchly file
|
@ -0,0 +1,50 @@
|
|||||||
|
#!/usr/bin/python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
__author__ = 'Apurv Singh Gautam'
|
||||||
|
__license__ = "MIT"
|
||||||
|
__version__ = "1.0.0"
|
||||||
|
__maintainer__ = "Apurv Singh Gautam"
|
||||||
|
__status__ = "Development"
|
||||||
|
|
||||||
|
|
||||||
|
import os
|
||||||
|
from pathlib import Path
|
||||||
|
from subprocess import call
|
||||||
|
|
||||||
|
from onioningestor.sources import Source
|
||||||
|
|
||||||
|
|
||||||
|
class Plugin(Source):
|
||||||
|
|
||||||
|
def __init__(self, logger, dirname, **kwargs):
|
||||||
|
self.logger = logger
|
||||||
|
self.dirname = dirname
|
||||||
|
super().__init__(self)
|
||||||
|
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
self.logger.info('Getting onions from Pystemon')
|
||||||
|
dirpath = Path(__file__).parents[1]/self.dirname # Directory path of Pystemon alerts
|
||||||
|
for subdir, dirs, files in os.walk(dirpath) # Getting the files from pystemon alerts directory
|
||||||
|
for filename in files:
|
||||||
|
name = subdir.split('/')[5] # Paste Source Name
|
||||||
|
filepath = subdir + os.sep + filename
|
||||||
|
|
||||||
|
with open(filepath, 'r') as f:
|
||||||
|
lines = f.readlines()
|
||||||
|
|
||||||
|
for onion in lines:
|
||||||
|
self.onionQueue.put(
|
||||||
|
(
|
||||||
|
2,
|
||||||
|
self.onion(
|
||||||
|
url=onion,
|
||||||
|
source=name,
|
||||||
|
type='domain',
|
||||||
|
status='offline',
|
||||||
|
monitor=False,
|
||||||
|
denylist=False)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
call(['rm', filepath]) # Deleting the temp alert paste file
|
Loading…
Reference in New Issue