diff --git a/.gitignore b/.gitignore index f039455..2b5ef6a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ crawler/** scripts/__pycache__/** .env env/ +submissions/** diff --git a/package.xml b/package.xml new file mode 100644 index 0000000..da8dd86 --- /dev/null +++ b/package.xml @@ -0,0 +1,444 @@ + + + imagick + pecl.php.net + Provides a wrapper to the ImageMagick library. + Imagick is a native php extension to create and modify images using the ImageMagick API. +This extension requires ImageMagick version 6.5.3-10+ and PHP 5.6.0+. + + Dan Ackroyd + danack + danack@php.net + yes + + + Jakub Zelenka + bukka + bukka@php.net + yes + + 2025-04-10 + + + 3.8.0 + 3.8.0 + + + stable + stable + + PHP License + +- Fixes: + * Fix signedness formatting mistakes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5.6.0 + + + 1.4.0 + + + + imagick + + + + diff --git a/scripts/lantern.py b/scripts/lantern.py index f4bd94b..8854bd9 100644 --- a/scripts/lantern.py +++ b/scripts/lantern.py @@ -129,6 +129,8 @@ def main(): blcsvfile=instancepath+'/blacklist.csv' secsvfile=instancepath+'/sensitive.csv' webpcsvfile=instancepath+'/webring-participants.csv' + submission_file_abs_path = os.path.abspath('submissions/submission.csv') + if not os.path.exists(instancepath): print_colors(f"{rootpath}",is_error=True, bold=True) os.makedirs(instancepath) @@ -179,10 +181,11 @@ Managing Wordlists: Maintenance: 9) Remove the duplicate URLs for your own instance 10) Perform sanity checks on all csv files for all instances (to mark them as sensitive / or remove the ones that are blacklisted) - + 11) Review submissions (Add to verified.csv/ add to unverified.csv/ delete /blacklist) + 0) Exit """) - option = input("Select an option? (0-10): ").strip() + option = input("Select an option? (0-11): ").strip() try: option = int(option) except ValueError: @@ -1197,7 +1200,86 @@ Maintenance: csvdf.to_csv(csvfilepath, index=False) #read=input("Continue?") break + + case 11: + try: + print_colors("1) Move entries to verified 2) Move entries from submission to unverified 3) Delete from submission file 4) Add to blacklist -1) exit") + + submission_df = pd.read_csv(submission_file_abs_path) + verified_csv_df = pd.read_csv(verifiedcsvfile) + unverified_csv_df = pd.read_csv(unverifiedcsvfile) + blacklist_df = pd.read_csv(blcsvfile) + blacklisted_words = [word for word in blacklist_df['blacklisted-words']] + for i, row in submission_df.iterrows(): + print_colors(row) + link = row['link'] + if link in blacklisted_words: + print_colors("Black listed entry found", bold=True) + continue + else: + name = row['name'] + desc = row['desc'] + category = row['category'] + sensi = "YES" if row['sensitive'] == 'y' else "NO" + number = int(input("Enter an option: ")) + + if number == 1: + newrow=[instance,category,name,link,sensi,desc,'YES','100'] + verified_csv_df.loc[-1] = newrow # adding a row + verified_csv_df.index = verified_csv_df.index + 1 # shifting index + verified_csv_df = verified_csv_df.sort_index() # sorting by index + verified_csv_df = verified_csv_df.sort_values(by=["Category","Score"], ascending=[True,False]) # sorting categories + print_colors("[+] New row added! now writing the csv file") + verified_csv_df.to_csv(verifiedcsvfile, index=False) + submission_df.drop(index=i,inplace=True) + submission_df.to_csv(submission_file_abs_path, index=False) + elif number == 2: + + newrow=[instance,category,name,link,sensi,desc,'YES','100'] + + unverified_csv_df.loc[-1] = newrow # adding a row + unverified_csv_df.index = unverified_csv_df.index + 1 # shifting index + unverified_csv_df = unverified_csv_df.sort_index() # sorting by index + unverified_csv_df = unverified_csv_df.sort_values(by=["Category","Score"], ascending=[True,False]) # sorting categories + print_colors("[+] New row added! now writing the csv file") + unverified_csv_df.to_csv(unverifiedcsvfile, index=False) + submission_df.drop(index=i,inplace=True) + submission_df.to_csv(submission_file_abs_path, index=False) + + elif number == 3: + submission_df.drop(index=i,inplace=True) + submission_df.to_csv(submission_file_abs_path, index=False) + + elif number == 4: + newrow=[link] + + blacklist_df.loc[-1] = newrow # adding a row + blacklist_df.index = blacklist_df.index + 1 # shifting index + blacklist_df = blacklist_df.sort_index() # sorting by index + print_colors("[+] New row added! now writing the csv file") + blacklist_df.to_csv(blcsvfile, index=False) + submission_df.drop(index=i,inplace=True) + submission_df.to_csv(submission_file_abs_path, index=False) + + elif number == -1: + break + + else: + print_colors("Invalid Number",is_error=True) + continue + + + + + except Exception as e: + print_colors(f'Try again {e}',is_error=True) + break + + finally: + print_colors("End of file") + + break case 0: print_colors(f"[-] Exiting", bold=True) break @@ -1206,4 +1288,4 @@ Maintenance: if __name__ == '__main__': - main() + main() \ No newline at end of file diff --git a/submissions/submission.csv b/submissions/submission.csv new file mode 100644 index 0000000..fe75edb --- /dev/null +++ b/submissions/submission.csv @@ -0,0 +1 @@ +link,name,desc,category,sensitive diff --git a/www/README.md b/www/README.md new file mode 100644 index 0000000..2e93fcb --- /dev/null +++ b/www/README.md @@ -0,0 +1,7 @@ +## Configuration for php to work + - To make the captcha image work you will need to install php-gd. + - Since there might be version in the name first try searching your package manager + - Next you need to go to /etc/php/[your_version]/cli/php.ini and remove the semi-colon(;) from the line with extension=gd. + - Make sure to use chmod 777 on submission.csv file + +Done. diff --git a/www/font.ttf b/www/font.ttf new file mode 100644 index 0000000..fcd2ddd Binary files /dev/null and b/www/font.ttf differ diff --git a/www/footer.php b/www/footer.php index 7d2287c..be62c77 100644 --- a/www/footer.php +++ b/www/footer.php @@ -10,7 +10,7 @@ if (($handle = fopen($csvfile, "r")) !== FALSE) { $oldcatname=""; - while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { + while (($data = fgetcsv($handle, 1000, ",",'"','\\')) !== FALSE) { $data[0]=preg_replace("/[^a-zA-Z0-9:\/.\ -✔️❌]/", "", $data[0]); // PREVENT ALL MALICIOUS PHP PAYLOADS FROM BEING EXECUTED FROM CSV FILES! $data[0] = htmlspecialchars($data[0]); diff --git a/www/generate.php b/www/generate.php new file mode 100644 index 0000000..1219eeb --- /dev/null +++ b/www/generate.php @@ -0,0 +1,28 @@ + diff --git a/www/header.php b/www/header.php index 8abc7c8..ae4041e 100644 --- a/www/header.php +++ b/www/header.php @@ -8,7 +8,7 @@ if (($handle = fopen($csvfile, "r")) !== FALSE) { $oldcatname=""; - while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { + while (($data = fgetcsv($handle, 1000, ",",'"','\\')) !== FALSE) { //PREVENT ALL MALICIOUS PHP PAYLOADS FROM BEING EXECUTED FROM CSV FILES! $data[0] = htmlspecialchars($data[0]); @@ -40,6 +40,9 @@ if (($handle = fopen($csvfile, "r")) !== FALSE) { if (str_contains(strtolower($data[5]), strtolower($query)) or str_contains(strtolower($data[3]), strtolower($query)) or str_contains(strtolower($data[2]), strtolower($query)) or str_contains(strtolower($data[1]), strtolower($query))) { $resultcount++; for ($c=0; $c < $num; $c++) { // iterate over each row + if ($data[7] == 0.0){ + continue; + }else{ echo ""; // begin html table row for that Category // if the row is the first one (name url status score) only display (Name Status Score): // display the contents of a csv row @@ -76,7 +79,8 @@ if (!preg_match("~^(?:f|ht)tps?://~i", $data[3])) { echo $urllink . '"> '; // display the link echo $data[2] . '

'; // display the link title and close the a href and first cell, open the second cell echo $data[5] . " "; // OPTIONAL: display the description column - echo $data[7] . " "; // display the score and close the second cell, open the third cell + echo $data[7] . " "; // display the score and close the second cell, open the third cell + if($data[6] == "YES"){ echo "✔️" ; }else{ @@ -91,7 +95,7 @@ if (!preg_match("~^(?:f|ht)tps?://~i", $data[3])) { } } echo ""; // end html table row - } + }} echo "\n"; fclose($handle); } @@ -130,7 +134,7 @@ if (($handle = fopen($csvfile, "r")) !== FALSE) { $oldcatname=""; - while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { + while (($data = fgetcsv($handle, 1000, ",",'"','\\')) !== FALSE) { $num = count($data); $row++; diff --git a/www/index.php b/www/index.php index 2230e9c..5b8ce35 100644 --- a/www/index.php +++ b/www/index.php @@ -9,18 +9,20 @@ - + - " /> + " /> - + +
-CSV LINES: " . $lines_uv . " " . $lines_v . "

"; ?> -

@@ -43,8 +44,8 @@ require("header.php");
-Sensitive ON " . $sensitive . "

"; $sensitive=1; @@ -95,8 +96,11 @@ require("header.php"); else { // if query length is less than minimum or more than maximum echo '

Search query must be between ' . $min_length . " and " . $max_length . " characters.

"; } + ?>
+Submit a link + diff --git a/www/style.css b/www/style.css index 61da77e..ff7aafd 100644 --- a/www/style.css +++ b/www/style.css @@ -12,8 +12,12 @@ .width-class{ width: 100%; object-fit: contain; - align: center; - + align: center; + display: flex; + flex-direction: column; +} +.input-class{ + margin: 0 20% 0 20%; } .projectbanner{ diff --git a/www/submit.php b/www/submit.php new file mode 100644 index 0000000..9ab4f0e --- /dev/null +++ b/www/submit.php @@ -0,0 +1,96 @@ + 512 or strlen($name) > 64 or strlen($description) > 256 or strlen($sensitive) > 1 or strlen($category) > 64){ + echo "Don't excede the limit"; + }else{ + + // Open the file once before the loop + $file = fopen("../submissions/submission.csv", "a"); + + if ($file !== false) { + // Create an array with the inputs to write as a single row + $row = [$link, $name,$description,$category,$sensitive]; + + // Write the row to the CSV file + fputcsv($file, $row, ',', '"'); + + // Close the file after writing + fclose($file); + } else { + // Handle error opening the file + errorlog("Error opening the file."); + } + echo "Link Successfully Submitted"; + } + } + } +} + +?> + + + + + Darknet Lantern + + + + + + + + + " /> + + + + + + + + +
+
+

Character Limits

+

Link should be 354

+

Name should be 64

+

Description should be 256

+

Category should be 64

+

Sensitive should be 1

+
+
+ + + + + + + + + + + +
+ + + +
+
+
+