Suggestions implemented

This commit is contained in:
SovereigntyIsNotFreedom 2025-04-17 02:20:53 -04:00
parent e044ba56e9
commit aeb3b16a9b
4 changed files with 75 additions and 63 deletions

2
.gitignore vendored
View file

@ -4,4 +4,4 @@ crawler/**
scripts/__pycache__/**
.env
env/
submissions
submissions/**

View file

@ -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,7 +181,7 @@ 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 and add to verified, unverfied csv files or delete them
11) Review submissions (Add to verified.csv/ add to unverified.csv/ delete /blacklist)
0) Exit
""")
@ -1201,73 +1203,82 @@ Maintenance:
case 11:
try:
print_colors("1) Move entries to verified 2) Move entries from submission to unverified 3) Delete from submission file 0) exit")
option = int(input("Enter an option: "))
# can't use instance variable because it will go inside www
submission_csv_file = "../submissions/submission.csv"
submission_df = pd.read_csv(submission_csv_file)
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)
match option:
case 1:
while len(submission_df) != 0:
print_colors(submission_df)
indx = int(input("Which index do you want to add? -1 to exit: "))
if indx == -1: break
link = submission_df.iloc[indx]['link'].strip()
name = submission_df.iloc[indx]['name'].strip()
desc = submission_df.iloc[indx]['desc'].strip()
category = submission_df.iloc[indx]['category'].strip()
sensitive = "YES" if submission_df.iloc[indx]['sensitive'].strip() == 'y' else "NO"
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']
new_row = pd.DataFrame({'Instance': [instance], 'Category': [category], 'Name':[name],'URL':[link],'Sensitive':[sensitive],'Description':[desc],'Status':['YES'],'Score':['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)
if number == 2:
df = pd.concat([verified_csv_df, new_row], ignore_index=True)
df.to_csv(verifiedcsvfile, index=False)
submission_df.drop(index=indx, inplace=True)
submission_df.to_csv(submission_csv_file, index=False)
newrow=[instance,category,name,link,sensi,desc,'YES','100']
case 2:
while len(submission_df)!=0:
print_colors(submission_df)
indx = int(input("Which index do you want to add? -1 to exit: "))
if indx == -1: break
link = submission_df.iloc[indx]['link'].strip()
name = submission_df.iloc[indx]['name'].strip()
desc = submission_df.iloc[indx]['desc'].strip()
category = submission_df.iloc[indx]['category'].strip()
sensitive = "YES" if submission_df.iloc[indx]['sensitive'].strip() == 'y' else "NO"
new_row = pd.DataFrame({'Instance': [instance], 'Category': [category], 'Name':[name],'URL':[link],'Sensitive':[sensitive],'Description':[desc],'Status':['YES'],'Score':['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)
if number == 3:
submission_df.drop(index=i,inplace=True)
submission_df.to_csv(submission_file_abs_path, index=False)
df = pd.concat([unverified_csv_df, new_row], ignore_index=True)
df.to_csv(unverifiedcsvfile, index=False)
submission_df.drop(index=indx,inplace=True)
submission_df.to_csv(submission_csv_file, index=False)
if number == 4:
newrow=[link]
case 3:
while len(submission_df) != 0:
print_colors(submission_df)
indx = int(input("Enter which row should be removed(-2 for all, -1 to exit): "))
if indx == -1:
break
elif indx == -2:
for i in range(0, len(submission_df)):
submission_df.drop(index=i, inplace=True)
submission_df.to_csv(submission_csv_file, index=False)
else:
submission_df.drop(index=indx, inplace=True)
submission_df.to_csv(submission_csv_file, index=False)
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)
case 0:
break
if 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)
@ -1277,4 +1288,4 @@ Maintenance:
if __name__ == '__main__':
main()
main()

View file

@ -1,2 +1,2 @@
link,name,desc,category,sensitive
dsajkdasl,jkldjaslkjdl,jdklasjdlkjl,jklsjlkdaj,y

1 link name desc category sensitive
2

View file

@ -1,6 +1,7 @@
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.
## 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.