mirror of
http://git.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion/nihilist/darknet-lantern.git
synced 2025-05-17 04:36:57 +00:00
wip
This commit is contained in:
parent
196cf331a8
commit
61955f6c67
2 changed files with 27 additions and 21 deletions
|
@ -2,8 +2,7 @@ import os, pwd
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
rootpath='/srv/darknet-onion-webring/'
|
rootpath='/srv/darknet-onion-webring/'
|
||||||
homepath=pwd.getpwuid(os.getuid()).pw_dir
|
urlpath=pwd.getpwuid(os.getuid()).pw_dir+"/.darknet_participant_url"
|
||||||
urlpath=homepath+'/.darknet_participant_url'
|
|
||||||
print(urlpath)
|
print(urlpath)
|
||||||
isitvalid="n"
|
isitvalid="n"
|
||||||
|
|
||||||
|
@ -15,7 +14,7 @@ def main():
|
||||||
with open(urlpath) as f:
|
with open(urlpath) as f:
|
||||||
instance = f.read()
|
instance = f.read()
|
||||||
# TODO check if the instance URL domain is valid
|
# TODO check if the instance URL domain is valid
|
||||||
|
instancepath=rootpath+'www/participants/'+instance
|
||||||
print("[+] file exists, your Webring URL is ", instance)
|
print("[+] file exists, your Webring URL is ", instance)
|
||||||
isitvalid = "y"
|
isitvalid = "y"
|
||||||
else:
|
else:
|
||||||
|
@ -32,8 +31,12 @@ def main():
|
||||||
# if yes, then write it into ~/.darknet_participant_url
|
# if yes, then write it into ~/.darknet_participant_url
|
||||||
if isitvalid != "y" :
|
if isitvalid != "y" :
|
||||||
print("OK writing the instance url to ~/.darknet_participants_url")
|
print("OK writing the instance url to ~/.darknet_participants_url")
|
||||||
with open(urlpath, 'w') as file:
|
with open(urlpath, "w") as file:
|
||||||
file.write(instance)
|
file.write(instance)
|
||||||
|
print("[+] file written, let's read it")
|
||||||
|
f = open(urlpath,"r")
|
||||||
|
print(f.read())
|
||||||
|
print("[+] Initial Setup Completed!")
|
||||||
|
|
||||||
print("[+] Welcome to the Darknet Onion Webring, where you are exploring the Darknet and helping others do the same.")
|
print("[+] Welcome to the Darknet Onion Webring, where you are exploring the Darknet and helping others do the same.")
|
||||||
print("""
|
print("""
|
||||||
|
@ -45,29 +48,18 @@ def main():
|
||||||
option = input("Select Option? (1-4)")
|
option = input("Select Option? (1-4)")
|
||||||
print(option)
|
print(option)
|
||||||
match option:
|
match option:
|
||||||
case "0":
|
|
||||||
print("[+] Initial Setup")
|
|
||||||
# what is your instance url ? ex: uptime.nowherejez...onion
|
|
||||||
instance = input("What is your Instance domain ? (ex: uptime.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion):")
|
|
||||||
# check that it is only url.onion or subdomain.url.onion, and if the characters are only [a-zA-Z0-9.], use the function IsOnionDomainValid()
|
|
||||||
instancepath='/srv/darknet-onion-webring/www/participants/'+instance
|
|
||||||
print(instancepath)
|
|
||||||
# check if the directory already exists or not in www/participants/nowherejez...onion
|
|
||||||
if os.path.isdir(instancepath):
|
|
||||||
print("[+] Instance Path already exists, skipping.")
|
|
||||||
else:
|
|
||||||
print("[-] path doesnt exist")
|
|
||||||
# if doesnt exist, create it, copy the default anonymous instance banner in there.
|
|
||||||
# copy the blank verified.csv unverified.csv sensitive.csv blacklist.csv and webring-participants.csv files in the new directory
|
|
||||||
# print message to explain what's next: you have a new instance, it's now time to list your own links, and to browse other participant's links
|
|
||||||
|
|
||||||
case "1":
|
case "1":
|
||||||
print("[+] Add a new Entry (into unverified.csv)")
|
print("[+] Add a new Entry (into unverified.csv)")
|
||||||
# ask for the following:
|
# ask for the following:
|
||||||
|
unverifiedpath=instancepath+'/unverified.csv'
|
||||||
# the name of the website (required)
|
# the name of the website (required)
|
||||||
|
entry_name = input("What is the Website name ?")
|
||||||
# the url of the website (required)
|
# the url of the website (required)
|
||||||
|
entry_url = input("What is URL of the Website ? (ex: https://torproject.org or http://2gzyxa5ihm7nsggfxnu52rck2vv4rvmdlkiu3zzui5du4xyclen53wid.onion")
|
||||||
# a quick description (optional)
|
# a quick description (optional)
|
||||||
|
entry_url = input("(Optional) Description of the website ? (max 256 characters) (press enter to skip)"
|
||||||
# sensitive ? (y/n)
|
# sensitive ? (y/n)
|
||||||
|
entry_url = input("is it a sensitive website ? (ex: website related to drugs)"
|
||||||
# (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
|
# 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
|
||||||
|
|
14
scripts/tests/writefile.py
Normal file
14
scripts/tests/writefile.py
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
import os, pwd
|
||||||
|
def main():
|
||||||
|
urlpath=pwd.getpwuid(os.getuid()).pw_dir+"/.darknet_participant_url"
|
||||||
|
url="uptime.nowherejezaaa...onion"
|
||||||
|
print(urlpath, ":", url)
|
||||||
|
with open(urlpath, "w") as f:
|
||||||
|
f.write(url)
|
||||||
|
print("[+] file written, let's read it")
|
||||||
|
f = open(urlpath,"r")
|
||||||
|
print(f.read())
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
Loading…
Add table
Add a link
Reference in a new issue