mirror of
http://git.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion/nihilist/darknet-lantern.git
synced 2025-05-17 04:36:57 +00:00
new changes (still WIP)
This commit is contained in:
parent
f850bbef4e
commit
7b54e09513
5 changed files with 270 additions and 38 deletions
|
@ -1,4 +1,7 @@
|
||||||
import os, pwd, re, pandas as pd, requests, shutil
|
import os, pwd, re, pandas as pd, requests, shutil
|
||||||
|
from PIL import Image
|
||||||
|
import urllib
|
||||||
|
import socks, socket, glob
|
||||||
#apt install python3-pandas python3-requests python3-socks
|
#apt install python3-pandas python3-requests python3-socks
|
||||||
def main():
|
def main():
|
||||||
proxies = {
|
proxies = {
|
||||||
|
@ -31,6 +34,7 @@ def main():
|
||||||
unverifiedcsvfile=instancepath+'/unverified.csv'
|
unverifiedcsvfile=instancepath+'/unverified.csv'
|
||||||
blcsvfile=instancepath+'/blacklist.csv'
|
blcsvfile=instancepath+'/blacklist.csv'
|
||||||
secsvfile=instancepath+'/sensitive.csv'
|
secsvfile=instancepath+'/sensitive.csv'
|
||||||
|
webpcsvfile=instancepath+'/webring-participants.csv'
|
||||||
# check if instancepath exists, if not then create the directory
|
# check if instancepath exists, if not then create the directory
|
||||||
if not os.path.exists(instancepath):
|
if not os.path.exists(instancepath):
|
||||||
os.makedirs(instancepath)
|
os.makedirs(instancepath)
|
||||||
|
@ -42,11 +46,12 @@ def main():
|
||||||
# copy templates/ FILE.CSV to instancepath/ FILE.CSV
|
# copy templates/ FILE.CSV to instancepath/ FILE.CSV
|
||||||
src=templatepath+i
|
src=templatepath+i
|
||||||
shutil.copyfile(src, filepath)
|
shutil.copyfile(src, filepath)
|
||||||
# now that they exist, get vdf and uvdf
|
# now that they exist, get vdf and uvdf and the rest
|
||||||
vdf = pd.read_csv(verifiedcsvfile)
|
vdf = pd.read_csv(verifiedcsvfile)
|
||||||
uvdf = pd.read_csv(unverifiedcsvfile)
|
uvdf = pd.read_csv(unverifiedcsvfile)
|
||||||
bldf = pd.read_csv(blcsvfile)
|
bldf = pd.read_csv(blcsvfile)
|
||||||
sedf = pd.read_csv(secsvfile)
|
sedf = pd.read_csv(secsvfile)
|
||||||
|
webpdf = pd.read_csv(webpcsvfile)
|
||||||
print("[+] file exists, your Webring URL is", instance)
|
print("[+] file exists, your Webring URL is", instance)
|
||||||
isitvalid = "y"
|
isitvalid = "y"
|
||||||
else:
|
else:
|
||||||
|
@ -75,19 +80,24 @@ def main():
|
||||||
f = open(urlpath,"r")
|
f = open(urlpath,"r")
|
||||||
print(f.read())
|
print(f.read())
|
||||||
print("[+] Initial Setup Completed!")
|
print("[+] Initial Setup Completed!")
|
||||||
|
myinstance = instance
|
||||||
while True:
|
while True:
|
||||||
print("[+] Welcome to the Darknet Onion Webring, where you are exploring the Darknet and helping others do the same.")
|
|
||||||
print("""
|
print("""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[+] Welcome to the Darknet Onion Webring, where you are exploring the Darknet and helping others do the same.
|
||||||
|
|
||||||
Managing Websites:
|
Managing Websites:
|
||||||
1) Add a new Website entry (into unverified.csv)
|
1) Add a new Website entry (into unverified.csv)
|
||||||
2) Trust a Website entry (move an entry from unverified to verified.csv)
|
2) Trust a Website entry (move an entry from unverified to verified.csv)
|
||||||
3) Untrust a Website entry (move an entry from unverified to verified.csv)
|
3) Untrust a Website entry (move an entry from unverified to verified.csv)
|
||||||
|
|
||||||
Managing Webring Participants:
|
Managing Webring Participants:
|
||||||
4) Synchronize new links from webring participants, into your unverified.csv file
|
4) Synchronize new links from existing webring participants, into your unverified.csv file
|
||||||
5) Add a new webring participant (and download their files into their directory (without trusting them yet!))
|
5) Add a new webring participant (and download their files into their directory (without trusting them yet!))
|
||||||
6) Trust/UnTrust a webring participant (Potentially dangerous)
|
6) Trust/UnTrust/Blacklist a webring participant (Potentially dangerous)
|
||||||
7) Remove a webring participant
|
|
||||||
|
|
||||||
Managing Wordlists:
|
Managing Wordlists:
|
||||||
8) Add/Remove words or links in the sensitive list (ex: drug)
|
8) Add/Remove words or links in the sensitive list (ex: drug)
|
||||||
|
@ -99,7 +109,7 @@ Maintenance:
|
||||||
|
|
||||||
0) Exit
|
0) Exit
|
||||||
""")
|
""")
|
||||||
option = input("Select Option? (0-6): ")
|
option = input("Select Option? (0-11): ")
|
||||||
print(option)
|
print(option)
|
||||||
match option:
|
match option:
|
||||||
|
|
||||||
|
@ -137,7 +147,7 @@ Maintenance:
|
||||||
newrow=[instance,category,name,url,sensi,desc,'','']
|
newrow=[instance,category,name,url,sensi,desc,'','']
|
||||||
print("[+] NEWROW=",newrow)
|
print("[+] NEWROW=",newrow)
|
||||||
# (rest is automatic: status, score, instance is = '' because it is your own instance)
|
# (rest is automatic: status, score, instance is = '' because it is your own instance)
|
||||||
# check if the entry doesn't already exist in verified.csv and in unverified.csv
|
# TODO check if the entry doesn't already exist in verified.csv and in unverified.csv
|
||||||
# if it doesnt exist, add it into unverified.csv
|
# if it doesnt exist, add it into unverified.csv
|
||||||
uvdf.loc[-1] = newrow # adding a row
|
uvdf.loc[-1] = newrow # adding a row
|
||||||
uvdf.index = uvdf.index + 1 # shifting index
|
uvdf.index = uvdf.index + 1 # shifting index
|
||||||
|
@ -152,7 +162,7 @@ Maintenance:
|
||||||
while(IsNameValid(name) is not True):
|
while(IsNameValid(name) is not True):
|
||||||
name = input("What is the Website name you want to trust ? (ex: Nowhere)")
|
name = input("What is the Website name you want to trust ? (ex: Nowhere)")
|
||||||
filter_uvdf = uvdf[uvdf.Name.str.contains(name)]
|
filter_uvdf = uvdf[uvdf.Name.str.contains(name)]
|
||||||
# and display only the matching entries in unverified.csv in an array format (display it in CLI).
|
# NOTE and display only the matching entries in unverified.csv in an array format (display it in CLI).
|
||||||
print(filter_uvdf[['Name','URL']])
|
print(filter_uvdf[['Name','URL']])
|
||||||
# check if there are no results, dont proceed if there are none!
|
# check if there are no results, dont proceed if there are none!
|
||||||
if filter_uvdf.size == 0:
|
if filter_uvdf.size == 0:
|
||||||
|
@ -221,21 +231,136 @@ Maintenance:
|
||||||
####### MANAGING WEBRING PARTICIPANTS ###########
|
####### MANAGING WEBRING PARTICIPANTS ###########
|
||||||
# 4) Synchronize new links from webring participants, into your unverified.csv file
|
# 4) Synchronize new links from webring participants, into your unverified.csv file
|
||||||
# 5) Add a new webring participant (and download their files into their directory (without trusting them yet!))
|
# 5) Add a new webring participant (and download their files into their directory (without trusting them yet!))
|
||||||
# 6) Trust/UnTrust a webring participant (Potentially dangerous)
|
# 6) Trust/UnTrust/Blacklist a webring participant
|
||||||
# 7) Blacklist a webring participant (in case of abuses)
|
|
||||||
#####################################################
|
#####################################################
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#TODO check if it works when you have a second webring participant
|
||||||
case "4":
|
case "4":
|
||||||
print("4) Synchronize new links from webring participants, into your unverified.csv file")
|
print("4) Synchronize new links from existing webring participants, into your unverified.csv file")
|
||||||
# TODO iterate through each existing directories in www/participants/*
|
# iterate through each existing directories in www/participants/* to get each webring participant
|
||||||
# TODO make sure that they are listed in your webring-participants.csv file
|
participantsdir=rootpath+'www/participants/'
|
||||||
# TODO iterate through their verified and unverified.csv files
|
#print(os.listdir(participantsdir))
|
||||||
# TODO for each link in the csv file,
|
name=''
|
||||||
# TODO check if the link is already listed in your own verified.csv or unverified.csv
|
desc=''
|
||||||
# TODO Sanity check 1 if not there in either, check if it matches with the blacklisted words
|
trusted=''
|
||||||
# if it does, skip it
|
status=''
|
||||||
# if it does not, add it to your own unverified.csv
|
score=''
|
||||||
# Sanity check 2 check if it matches with the sensitive wordlist words
|
webringcsvfile=instancepath+'/'+'webring-participants.csv'
|
||||||
# if it does, change your own unverified.csv at that entry to mark it as sensitive
|
wdf = pd.read_csv(webringcsvfile)
|
||||||
|
for participant in os.listdir(participantsdir):
|
||||||
|
participantdir=participantsdir+participant
|
||||||
|
#print(participant)
|
||||||
|
# TODO check if the webring participant is yourself, if it is, then skip it
|
||||||
|
#if participant != myinstance: # prod: dont use your own intance
|
||||||
|
if participant == myinstance: # preprod testing only on your own instance
|
||||||
|
#print("[+] Webring Participant is valid, adding it if it's not already added.")
|
||||||
|
print('[+] PARTICIPANT=',participant)
|
||||||
|
# check if the participant is already listed in webring-participants.csv or not, and add them if not already listed
|
||||||
|
# and display only the matching entries in unverified.csv in an array format (display it in CLI).
|
||||||
|
filter_wdf = wdf[wdf.URL.str.contains(participant)]
|
||||||
|
#print(filter_wdf[['Name','URL']])
|
||||||
|
# check if there are no results, dont proceed if there are none!
|
||||||
|
if filter_wdf.size == 0: #skip if webring participant is already listed, otherwise proceed
|
||||||
|
newrow=[name,participant,desc,trusted,status,score]
|
||||||
|
#print("[+] NEWROW=",newrow)
|
||||||
|
wdf.loc[-1] = newrow # adding a row
|
||||||
|
wdf.index = wdf.index + 1 # shifting index
|
||||||
|
wdf = wdf.sort_index() # sorting by index
|
||||||
|
print("[+] New row added! now writing the csv file:",webringcsvfile)
|
||||||
|
wdf.to_csv(webringcsvfile, index=False)
|
||||||
|
else:
|
||||||
|
print('[+] Webring participant is already listed in your own webring-participants.csv file!')
|
||||||
|
|
||||||
|
# iterate through the participant's verified.csv and unverified.csv files
|
||||||
|
for w in ['verified.csv','unverified.csv']:
|
||||||
|
csvfilepath=participantdir+'/'+w
|
||||||
|
print(csvfilepath)
|
||||||
|
csvdf = pd.read_csv(csvfilepath)
|
||||||
|
#print(bldf[['blacklisted-words']])
|
||||||
|
bldf[['blacklisted-words']].iterrows()
|
||||||
|
rows2delete= [] # it is an empty list at first
|
||||||
|
for i,j in csvdf.iterrows():
|
||||||
|
#print("[+] Unverified.csv ROW=",i, uvdf.at[i, 'Instance'], uvdf.at[i, 'Category'], uvdf.at[i, 'Name'], uvdf.at[i, 'URL'], uvdf.at[i, 'Description'])
|
||||||
|
#print("[+] Unverified.csv ROW=",i, uvdf.iloc[[i]])
|
||||||
|
#row=uvdf.iloc[[i]] #it displays the index
|
||||||
|
row=csvdf.loc[i,:].values.tolist()
|
||||||
|
print(row)
|
||||||
|
#print(i,row)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
################################ SANITY CHECKS ####################################
|
||||||
|
### SANITY CHECK 1: Mark all the rows that have incorrect formatting for deletion###
|
||||||
|
#print("[+] ROW=",i,"ROW CONTENTS=", IsUrlValid(uvdf.at[i, 'Instance']), IsCategoryValid(uvdf.at[i, 'Category']), IsNameValid(uvdf.at[i, 'Name']), IsUrlValid(uvdf.at[i, 'URL']), IsStatusValid(uvdf.at[i, 'Sensitive']), IsDescriptionValid(uvdf.at[i, 'Description']), IsStatusValid(uvdf.at[i, 'Status']), IsScoreValid(uvdf.at[i, 'Score']))
|
||||||
|
if IsUrlValid(csvdf.at[i, 'Instance']) is False or IsCategoryValid(csvdf.at[i, 'Category']) is False or IsNameValid(csvdf.at[i, 'Name']) is False or IsUrlValid(csvdf.at[i, 'URL']) is False or IsStatusValid(csvdf.at[i, 'Sensitive']) is False or IsDescriptionValid(csvdf.at[i, 'Description']) is False or IsStatusValid(csvdf.at[i, 'Status']) is False or IsScoreValid(csvdf.at[i, 'Score']) is False:
|
||||||
|
#mark the row for deletion as it has invalid inputs
|
||||||
|
if i not in rows2delete:
|
||||||
|
print("Marking row", i,"for deletion, as it has invalid inputs")
|
||||||
|
rows2delete.append(i) #mark the row for deletion if not already done
|
||||||
|
|
||||||
|
### SANITY CHECK 2: Mark all rows that are not allowed (blacklist) for deletion ###
|
||||||
|
for k,l in bldf.iterrows():
|
||||||
|
#print("[+] Blacklisted word=",k, bldf.at[k, 'blacklisted-words'])
|
||||||
|
blword=bldf.at[k, 'blacklisted-words']
|
||||||
|
if any(blword in str(x) for x in row) == True:
|
||||||
|
#print("found blacklisted word! marking row for deletion")
|
||||||
|
if i not in rows2delete:
|
||||||
|
print("Marking row", i,"for deletion, as it matches with a blacklisted word")
|
||||||
|
rows2delete.append(i) #mark the row for deletion if not already done
|
||||||
|
else:
|
||||||
|
# not a blacklisted link, therefore it is suitable to be added to your own csv files:
|
||||||
|
################################ CHECKING FOR DUPLICATES! #########################
|
||||||
|
# for each link in the participant's verified/unverified csv files,
|
||||||
|
# check if the link is already listed in your own verified.csv or unverified.csv
|
||||||
|
filterterm=csvdf.at[i, 'URL']
|
||||||
|
filter_vdf= vdf[vdf.URL.str.contains(filterterm)]
|
||||||
|
filter_uvdf= uvdf[uvdf.URL.str.contains(filterterm)]
|
||||||
|
if len(filter_uvdf.index) == 0 and len(filter_vdf.index) == 0:
|
||||||
|
#if link doesnt exist in either of your verified/unverified csv files,
|
||||||
|
# then add it to your own unverified.csv file:
|
||||||
|
newrow=row
|
||||||
|
uvdf.loc[-1] = newrow # adding a row
|
||||||
|
uvdf.index = uvdf.index + 1 # shifting index
|
||||||
|
uvdf = uvdf.sort_index() # sorting by index
|
||||||
|
uvdf.to_csv(unverifiedcsvfile, index=False)
|
||||||
|
print("[+] New row added to your own unverified.csv file!")
|
||||||
|
else:
|
||||||
|
print('[-] Skipping row as it is already added in ',w,row,)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
###################### APPENDING TO YOUR OWN UNVERIFIED.CSV FILE###################
|
||||||
|
|
||||||
|
|
||||||
|
### SANITY CHECK 3: Mark all the rows that are supposed to be sensitive ###
|
||||||
|
for k,l in sedf.iterrows():
|
||||||
|
#print("[+] Sensitive word=",k, sedf.at[k, 'sensitive-words'])
|
||||||
|
seword=sedf.at[k, 'sensitive-words']
|
||||||
|
if any(seword in str(x) for x in row) == True:
|
||||||
|
if csvdf.at[i, 'Sensitive'] != '✔️':
|
||||||
|
print("Marking row", i,"as sensitive, as it matches with a sensitive word")
|
||||||
|
csvdf.at[i, 'Sensitive']='✔️'
|
||||||
|
|
||||||
|
print('[-] Rows to delete: ',rows2delete)
|
||||||
|
# only delete rows after you've gone through all the unverified.csv OR verified.csv rows'
|
||||||
|
for i in rows2delete:
|
||||||
|
row=csvdf.loc[i,:].values.tolist()
|
||||||
|
print('[+] REMOVING ROW :',i,row)
|
||||||
|
csvdf.drop(i, inplace= True)
|
||||||
|
csvdf.to_csv(csvfilepath, index=False)
|
||||||
|
rows2delete= [] # it is an empty list at first
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
case "5":
|
case "5":
|
||||||
print("[+] Add a new webring participant (and download their files into their directory (without trusting them yet!))")
|
print("[+] Add a new webring participant (and download their files into their directory (without trusting them yet!))")
|
||||||
|
@ -295,7 +420,7 @@ Maintenance:
|
||||||
# create the directory in www/participants/PARTICIPANTURL/ if it's not there already
|
# create the directory in www/participants/PARTICIPANTURL/ if it's not there already
|
||||||
if not os.path.exists(participantdir):
|
if not os.path.exists(participantdir):
|
||||||
os.makedirs(participantdir)
|
os.makedirs(participantdir)
|
||||||
# then download their csv files at http://URL.onion/participants/URL.onion/{verified.csv,unverified.csv,sensitive.csv,blacklist.csv,webring-participants.csv}
|
# then download their csv files at http://URL.onion/participants/URL.onion/{verified.csv,unverified.csv,sensitive.csv,blacklist.csv,webring-participants.csv}
|
||||||
# then save the csv file contents into a variable, then write it where it belongs:
|
# then save the csv file contents into a variable, then write it where it belongs:
|
||||||
# for loop with each csv file you want:
|
# for loop with each csv file you want:
|
||||||
for i in ['verified.csv','unverified.csv','blacklist.csv','sensitive.csv','webring-participants.csv']:
|
for i in ['verified.csv','unverified.csv','blacklist.csv','sensitive.csv','webring-participants.csv']:
|
||||||
|
@ -318,6 +443,26 @@ Maintenance:
|
||||||
f = open(csvfilepath,"r")
|
f = open(csvfilepath,"r")
|
||||||
print(f.read())
|
print(f.read())
|
||||||
|
|
||||||
|
# download the banner.png image:
|
||||||
|
|
||||||
|
bannerurl=basewurl+'banner.png'
|
||||||
|
bannerpath=participantdir+'/banner.png'
|
||||||
|
r = requests.get(bannerurl, stream=True, proxies=proxies)
|
||||||
|
with open(bannerpath, 'wb') as f:
|
||||||
|
r.raw.decode_content = True
|
||||||
|
shutil.copyfileobj(r.raw, f)
|
||||||
|
|
||||||
|
# SANITY CHECK ON THE BANNER PNG IMAGE:
|
||||||
|
if IsBannerValid(bannerpath):
|
||||||
|
print('[+] Banner is valid')
|
||||||
|
else:
|
||||||
|
# if false, overwrite it with the template banner png file
|
||||||
|
print('[-] Banner is not valid, replacing it with the default banner')
|
||||||
|
os.remove(bannerpath)
|
||||||
|
# copy templates/banner.png to bannerpath
|
||||||
|
bannertemplatepath=templatepath+'banner.png'
|
||||||
|
shutil.copyfile(bannertemplatepath, bannerpath)
|
||||||
|
|
||||||
########### PERFORM SANITY CHECKS ON the webring participant's verified.csv and unverified.csv ##################
|
########### PERFORM SANITY CHECKS ON the webring participant's verified.csv and unverified.csv ##################
|
||||||
for w in ['verified.csv','unverified.csv']:
|
for w in ['verified.csv','unverified.csv']:
|
||||||
csvfilepath=participantdir+'/'+w
|
csvfilepath=participantdir+'/'+w
|
||||||
|
@ -358,11 +503,10 @@ Maintenance:
|
||||||
if any(seword in str(x) for x in row) == True:
|
if any(seword in str(x) for x in row) == True:
|
||||||
if csvdf.at[i, 'Sensitive'] != '✔️':
|
if csvdf.at[i, 'Sensitive'] != '✔️':
|
||||||
print("Marking row", i,"as sensitive, as it matches with a sensitive word")
|
print("Marking row", i,"as sensitive, as it matches with a sensitive word")
|
||||||
uvdf.at[i, 'Sensitive']='✔️'
|
csvdf.at[i, 'Sensitive']='✔️'
|
||||||
|
|
||||||
print('[-] Rows to delete: ',rows2delete)
|
print('[-] Rows to delete: ',rows2delete)
|
||||||
|
|
||||||
# TODO : MAKE SURE IT WORKS IN PROD
|
|
||||||
for i in rows2delete:
|
for i in rows2delete:
|
||||||
row=csvdf.loc[i,:].values.tolist()
|
row=csvdf.loc[i,:].values.tolist()
|
||||||
print('[+] REMOVING ROW :',i,row)
|
print('[+] REMOVING ROW :',i,row)
|
||||||
|
@ -377,11 +521,35 @@ Maintenance:
|
||||||
|
|
||||||
|
|
||||||
case "6":
|
case "6":
|
||||||
print("[+] Trust/UnTrust a webring participant (Potentially dangerous)")
|
print("[+] Trust/UnTrust/Blacklist a webring participant (Potentially dangerous)")
|
||||||
|
# TODO list each webring participant in your webring-participants.csv file
|
||||||
|
# TODO ask the user to pick an index
|
||||||
|
# TODO once a valid index is picked, ask if the user wants to 1) trust the webring participant, or 2) untrust them, or 3) black list them
|
||||||
|
# if 1:
|
||||||
|
#ask the user if they want to proceed, as this is potentially risky if the webring participant tries to list malicious links in the future
|
||||||
|
#choice=input("You're about to trust another peer, this means that you're going to automatically trust all of the links they have in their verified.csv file! If this is a malicious peer, you're about to potentially trust malicious links, it is potentially risky! Do you want to continue ? (y/n)")
|
||||||
|
# if user wants to proceed, mark the "trusted" column as V
|
||||||
|
# if 2: mark the "trusted" column as empty
|
||||||
|
# if 3:
|
||||||
|
# TODO add it's URL to your own blacklist.csv
|
||||||
|
# TODO remove all of the entries that came from that participant (drop the lines in verified+unverified.csv that have that instance in the instance column)
|
||||||
|
# TODO remove it from your own webring-participants.csv
|
||||||
|
# TODO remove the entire directory in www/participants/INSTANCENAME
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# TODO ask if you want to trust or untrust a webring participant
|
# TODO ask if you want to trust or untrust a webring participant
|
||||||
# TODO print a warning to tell the user that you're about to trust all of the links that are trusted by another peer, if that peer is malicious they may start trusting links that you don't trust! proceed? (answer is y otherwise skip)
|
# TODO print a warning to tell the user that you're about to trust all of the links that are trusted by another peer, if that peer is malicious they may start trusting links that you don't trust! proceed? (answer is y otherwise skip)
|
||||||
choice=''
|
choice=''
|
||||||
choice=input("You're about to trust another peer, this means that you're going to automatically trust all of the links they have in their verified.csv file! If this is a malicious peer, you're about to potentially trust malicious links, it is potentially risky! Do you want to continue ? (y/n)")
|
|
||||||
if choice == "y":
|
if choice == "y":
|
||||||
# TODO list all of the webring participants in webring-participants.csv
|
# TODO list all of the webring participants in webring-participants.csv
|
||||||
print("Please choose a webring participant to trust:")
|
print("Please choose a webring participant to trust:")
|
||||||
|
@ -401,15 +569,6 @@ Maintenance:
|
||||||
# TODO make the user choose a valid index
|
# TODO make the user choose a valid index
|
||||||
# TODO and write "" into the "Trusted" column
|
# TODO and write "" into the "Trusted" column
|
||||||
|
|
||||||
case "7":
|
|
||||||
# TODO
|
|
||||||
print("[+] Blacklist a webring participant (in case of abuses)")
|
|
||||||
# TODO list the existing webring participants in www/participants/
|
|
||||||
print("Please choose a webring participant to blacklist:")
|
|
||||||
# TODO add it's URL to your own blacklist.csv
|
|
||||||
# TODO remove all of the entries that came from that participant (drop the lines in verified+unverified.csv that have that instance in the instance column)
|
|
||||||
# TODO remove it from your own webring-participants.csv
|
|
||||||
# TODO remove the entire directory in www/participants/INSTANCENAME
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -534,6 +693,26 @@ def CheckUrl(url):
|
||||||
|
|
||||||
#### PROTECTIONS AGAINST MALICIOUS CSV INPUTS ####
|
#### PROTECTIONS AGAINST MALICIOUS CSV INPUTS ####
|
||||||
|
|
||||||
|
def IsBannerValid(path: str) -> bool:
|
||||||
|
"""
|
||||||
|
Checks if the banner.png file has the correct dimensions (240x60)
|
||||||
|
"""
|
||||||
|
#print('[+] checking image size')
|
||||||
|
try:
|
||||||
|
im = Image.open(path)
|
||||||
|
except Exception as e:
|
||||||
|
return False
|
||||||
|
#im = Image.open("favicon.png")
|
||||||
|
width, height = im.size
|
||||||
|
#print('width =',width, 'height=',height)
|
||||||
|
if width != 240 or height != 60:
|
||||||
|
#print('[-] Banner doesnt have the correct size (240x60)')
|
||||||
|
return False
|
||||||
|
else:
|
||||||
|
#print('[+] Banner has the correct size (240x60)')
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
def IsOnionValid(url: str)-> bool:
|
def IsOnionValid(url: str)-> bool:
|
||||||
"""
|
"""
|
||||||
Checks if the domain(param) is a valid onion domain and return True else False.
|
Checks if the domain(param) is a valid onion domain and return True else False.
|
||||||
|
@ -659,11 +838,13 @@ def IsDescriptionValid(desc:str)->bool:
|
||||||
#(careful with the ' and , make sure you test if it fucks the csv up or else)
|
#(careful with the ' and , make sure you test if it fucks the csv up or else)
|
||||||
# if OK return True
|
# if OK return True
|
||||||
#if not : return False
|
#if not : return False
|
||||||
|
if desc == "":
|
||||||
|
# empty description is fine as it's optional
|
||||||
|
return True
|
||||||
pattern = re.compile("^[A-Za-z0-9-.,' ]+$")
|
pattern = re.compile("^[A-Za-z0-9-.,' ]+$")
|
||||||
desc = str(desc)
|
desc = str(desc)
|
||||||
desc.strip()
|
desc.strip()
|
||||||
if pattern.fullmatch(desc) is None:
|
if pattern.fullmatch(desc) is None:
|
||||||
# empty description is fine as it's optional
|
|
||||||
return False
|
return False
|
||||||
if desc == "DEFAULT":
|
if desc == "DEFAULT":
|
||||||
return False
|
return False
|
||||||
|
|
8
scripts/tests/checkwebringinstanceexists.py
Normal file
8
scripts/tests/checkwebringinstanceexists.py
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
def main():
|
||||||
|
print()
|
||||||
|
csvpath='/srv/darknet-onion-webring/scripts/tests/webring-participants.csv'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
7
scripts/tests/webring-participants.csv
Normal file
7
scripts/tests/webring-participants.csv
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
Name,URL,Description,Trusted,Status,Score
|
||||||
|
Nowhere,uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,,,,
|
||||||
|
Nowhere,uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,,,,
|
||||||
|
Nowhere,uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,First instance,,,
|
||||||
|
Nowhere,uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,First webring participant,,,
|
||||||
|
Nowhere,uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,New webring participant,,,
|
||||||
|
Nowhere,http://uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,Darknet Webring Onion Participant,✔️,✔️,100.0
|
|
|
@ -1 +1,18 @@
|
||||||
Instance,Category,Name,URL,Sensitive,Description,Status,Score
|
Instance,Category,Name,URL,Sensitive,Description,Status,Score
|
||||||
|
uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,Infos and Links,Tor Taxi,http://tortaxi2dev6xjwbaydqzla77rrnth7yn2oqzjfmiuwn5h6vsk2a4syd.onion/,,List of links to go to popular darknet places,✔️,100.0
|
||||||
|
uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,Infos and Links,Tor Taxi,http://tortaxi2dev6xjwbaydqzla77rrnth7yn2oqzjfmiuwn5h6vsk2a4syd.onion/,,List of links to go to popular darknet places,✔️,100.0
|
||||||
|
uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,Infos and Links,Tor Taxi,http://tortaxi2dev6xjwbaydqzla77rrnth7yn2oqzjfmiuwn5h6vsk2a4syd.onion/,,List of links to go to popular darknet places,✔️,100.0
|
||||||
|
uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,Infos and Links,Tor Taxi,http://tortaxi2dev6xjwbaydqzla77rrnth7yn2oqzjfmiuwn5h6vsk2a4syd.onion/,❌,List of links to go to popular darknet places,,100.0
|
||||||
|
uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,Infos and Links,Tor Taxi,http://tortaxi2dev6xjwbaydqzla77rrnth7yn2oqzjfmiuwn5h6vsk2a4syd.onion/,✔️,List of links to go to popular darknet places,,100.0
|
||||||
|
uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,Infos and Links,Tor Taxi,http://tortaxi2dev6xjwbaydqzla77rrnth7yn2oqzjfmiuwn5h6vsk2a4syd.onion/,✔️,List of links to go to popular darknet places,,100.0
|
||||||
|
uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,Infos and Links,Tor Taxi,http://tortaxi2dev6xjwbaydqzla77rrnth7yn2oqzjfmiuwn5h6vsk2a4syd.onion/,❌,List of links to go to popular darknet places,,100.0
|
||||||
|
uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlidruga7fkirfsnfizflqd.onion,Infos and Links,Tor Taxi,http://tortaxi2dev6xjwbaydqzla77rrnth7yn2oqzjfmiuwn5h6vsk2a4syd.onion/,✔️,List of links to go to popular darknet places,✔️,500.0
|
||||||
|
uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,Infos and Links,Tor Taxi,http://tortaxi2dev6xjwbaydqzla77rrnth7yn2oqzjfmiuwn5h6vsk2a4syd.onion/,✔️,List of links to go to popular darknet places,✔️,300.0
|
||||||
|
uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,Infos and Links,Tor Taxi,http://tortaxi2dev6xjwbaydqzldruga77rrnth7yn2oqzjfmiuwn5h6vsk2a4syd.onion/,✔️,List of links to go to popular darknet places,✔️,0.0
|
||||||
|
uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,Infos and Links,Tor Taxi,http://tortaxi2dev6xjwbaydqzla77rrnth7yn2oqzjfmiuwn5h6vsk2a4syd.onion/,✔️,List of links to go to popular darknet places,✔️,100.0
|
||||||
|
uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,Infos and Links,Tor Taxi,http://tortaxi2dev6xjwbaydqzla77rrnth7yn2oqzjfmiuwn5h6vsk2a4syd.onion/,❌,List of links to go to popular darknet places,✔️,100.0
|
||||||
|
uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,Infos and Links,Tor Taxi,http://tortaxi2dev6xjwbaydqzla77rrnth7yn2oqzjfmiuwn5h6vsk2a4syd.onion/,✔️,List of links to go to popular darknet places,✔️,100.0
|
||||||
|
uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,Infos and Links,Tor Taxi,http://tortaxi2dev6xjwbaydqzla77rrnth7yn2oqzjfmiuwn5h6vsk2a4syd.onion/,✔️,List of links to go to popular darknet places,✔️,100.0
|
||||||
|
uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,Infos and Links,Tor Taxi,http://tortaxi2dev6xjwbaydqzla77rrnth7yn2oqzjfmiuwn5h6vsk2a4syd.onion/,❌,List of links to go to popular darknet places,✔️,100.0
|
||||||
|
uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,Infos and Links,Tor Taxi,http://tortaxi2dev6xjwbaydqzla77rrnth7yn2oqzjfmiuwn5h6vsk2a4syd.onion/,✔️,List of links to go to populadrugr darknet places,✔️,100.0
|
||||||
|
uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,Infos and Links,Tor Taxi,http://tortaxi2dev6xjwbaydqzla77rrnth7yn2oqzjfmiuwn5h6vsk2a4syd.onion/,✔️,List of links to go to popular darknet places,✔️,100.0
|
||||||
|
|
|
|
@ -1,4 +1,23 @@
|
||||||
Name,URL,Description,Trusted,Status,Score
|
Name,URL,Description,Trusted,Status,Score
|
||||||
|
,uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,,,,
|
||||||
|
Nowhere,uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,,,,
|
||||||
|
Nowhere,uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,,,,
|
||||||
|
Nowhere,uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,,,,
|
||||||
|
Nowhere,uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,,,,
|
||||||
|
Nowhere,uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,,,,
|
||||||
|
Nowhere,uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,,,,
|
||||||
|
Nowhere,uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,,,,
|
||||||
|
Nowhere,uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,,,,
|
||||||
|
Nowhere,uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,,,,
|
||||||
|
Nowhere,uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,,,,
|
||||||
|
Nowhere,uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,,,,
|
||||||
|
Nowhere,uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,,,,
|
||||||
|
Nowhere,uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,,,,
|
||||||
|
Nowhere,uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,,,,
|
||||||
|
Nowhere,uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,,,,
|
||||||
|
Nowhere,uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,,,,
|
||||||
|
Nowhere,uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,,,,
|
||||||
|
Nowhere,uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,,,,
|
||||||
Nowhere,uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,First instance,,,
|
Nowhere,uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,First instance,,,
|
||||||
Nowhere,uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,First webring participant,,,
|
Nowhere,uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,First webring participant,,,
|
||||||
Nowhere,uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,New webring participant,,,
|
Nowhere,uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,New webring participant,,,
|
||||||
|
|
|
Loading…
Add table
Add a link
Reference in a new issue