Skip to content

Commit

Permalink
Web Interface GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
lur1el authored Feb 28, 2023
1 parent aedd59e commit 66578c5
Show file tree
Hide file tree
Showing 82 changed files with 16,007 additions and 0 deletions.
13 changes: 13 additions & 0 deletions web/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
setup: ## Setup
rm db.sqlite3 dump.rdb celerybeat-schedule.db -rf
rm static/img/target_icon/* -f
python3 manage.py makemigrations
python3 manage.py migrate

up: ## Start
eval "$(redis-server)"
eval "$(python3.9 -m celery -A web worker -l info -P solo)"
python3 manage.py runserver 0.0.0.0:8000

user: ## Generate Username
python3 manage.py createsuperuser
1 change: 1 addition & 0 deletions web/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello World
Empty file added web/apikeys/__init__.py
Empty file.
Binary file added web/apikeys/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file added web/apikeys/__pycache__/apps.cpython-310.pyc
Binary file not shown.
Binary file added web/apikeys/__pycache__/config.cpython-310.pyc
Binary file not shown.
Binary file added web/apikeys/__pycache__/models.cpython-310.pyc
Binary file not shown.
Binary file added web/apikeys/__pycache__/urls.cpython-310.pyc
Binary file not shown.
Binary file added web/apikeys/__pycache__/views.cpython-310.pyc
Binary file not shown.
6 changes: 6 additions & 0 deletions web/apikeys/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class ApikeysConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'apikeys'
253 changes: 253 additions & 0 deletions web/apikeys/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,253 @@
from pathlib import Path
import yaml

params = {"censyssecret": ["censys", "secret"], "circlusername":["circl", "username"], "circlpassword":["circl", "password"], "digicertusername": ["certcentral", "username"], "facebooksecret":["facebook", "secret"], "fofausername": ["fofa", "username"], "rikiqusername":["passivetotal", "username"], "spamhaususername":["spamhaus", "username"], "spamhauspassword":["spamhaus", "password"], "twittersecret":["twitter", "secret"], "zoomeyeusername":["zoomeye", "username"], "zoomeyepassword":["zoomeye", "password"], "yandexusername":["yandex", "username"]}

def ReconConfig(name, key=None, get=None):
name = name.replace("_", "").lower()

names = {
"shodan":"SHODAN_API_KEY",
"whoisxml":"WHOISXML_API",
"xssserver":"XSS_SERVER",
"collabserver":"COLLAB_SERVER",
"slackchanel":"slack_channel",
"slackauth":"slack_auth",
}


if name in names:
name = names[name]
file = "../reconftw.cfg"

lines = open(file, "r").readlines()

subs = {}

if key != None:
for line in lines:
if name in line and key != "":
subs[line] = name+'="'+key+'"\n'

break
elif name in line and key == "":
subs[line] = '#'+name+'="XXXXXXXXXXXXX"\n'
break

for sub in subs:
replace = Path(file)
replace.write_text(replace.read_text().replace(sub, subs[sub], 1))

elif get == True:
result = ""
for line in lines:
if name in line:
result = line.split("=")[1].replace(" ", "")
break

if "XXXXXXXX" in result or "XXX-XXX-XXX" in result:
return ""
else:
return result.replace('"', '')


#https://ddaniboy.github.io/sariel.html
def amassConfig(name, key=None, get=None):
file = str(Path.home())+"/.config/amass/config.ini"
name = name.lower()

lines = open(file, "r").readlines()

if name in params:
param = params[name][1]
name = params[name][0]
else:
param = "apikey"


conf = []
cont = False

sub = ""
apikey = ""

for line in lines:

if "data_sources."+name in line.lower():
cont = True

if cont == True:
conf.append(line)
sub += line
if param in line:
cont = False

if len(line.split("=")) > 1:
apikey = line.split("=")[1].replace("\n", "")
else:
apikey = ""
break



if get == True:
return apikey.replace(" ", "")
else:
apikey = apikey.replace(" ", "")
key = key.replace(" ", "")
if apikey != key and key != "":
final = ""
for con in conf:
if con != "":
if con[0] == "#":
con = con.replace("#", "", 1)
while con[0] == " ":
con = con.replace(" ", "", 1)

if param in con.lower():
con = param + " = "+key+"\n"


final += con

replace = Path(file)
replace.write_text(replace.read_text().replace(sub, final, 1))



elif apikey != "" and key == "":
final = ""
for con in conf:
if con != "":
con = "#"+con
if param in con.lower():
con = "#"+param+" =\n"


final += con


replace = Path(file)
replace.write_text(replace.read_text().replace(sub, final, 1))




def GithubConfig(number, key=None, get=None):
file = str(Path.home())+"/Tools/.github_tokens"
number = int(number)-1
lines = open(file, "r").readlines()

if len(lines) <= 5:

lines = open(file, "w")
for i in range(0, 6):
lines.write("\n")
lines.close()


if key != None:
if key != "":
lines[number] = key+"\n"
elif key == "" and lines[number] != key:
lines[number] = "\n"

gitTokens = open(file, "w")
for item in lines:
gitTokens.write(item)
gitTokens.close()


if get == True:

lines = open(file, "r").readlines()

result = lines[number]

return result

def theHarvesterConfig(name, key=None, get=None):
namefile = str(Path.home())+"/Tools/theHarvester/api-keys.yaml"
listOfNames = {"chaos":"projectDiscovery"}

if name.lower() in listOfNames:
name = listOfNames[name.lower()]

if name == "censys":
var = "secret"
else:
var = "key"


with open(namefile) as file:
if key != None:
data = yaml.load(file, Loader=yaml.FullLoader)

if key != data["apikeys"][name][var] and key != "":
data["apikeys"][name][var] = key

elif key == "" and data["apikeys"][name][var] != None:
data["apikeys"][name][var] = None


with open(namefile, "w") as comp:
yaml.dump(data, comp)

elif get == True:
data = yaml.load(file, Loader=yaml.FullLoader)

result = data["apikeys"][name][var]

if result == None:
return ''
else:
return result

def h8mailConfig(name, key=None, get=None):
file = str(Path.home())+"/Tools/h8mail_config.ini"

lines = open(file, "r").readlines()
sub=""

if key != None:
for line in lines:
line = line.replace("\n", "")
if name in line and key != "":
sub = line

very = line.split("=")[1].replace(" ", "")

if key != very:
while line[0] == ";":
line = line.replace(";", "", 1)

while line[0] == " ":
line = line.replace(" ", "", 1)


final = line.split("=")[0]+"= "+key
replace = Path(file)
replace.write_text(replace.read_text().replace(sub, final, 1))
break

elif name in line and key == "":
final = ";"+name+" = "
sub = line


replace = Path(file)
replace.write_text(replace.read_text().replace(sub, final, 1))
break
elif get == True:
key = ""
for line in lines:

line = line.replace("\n", "")
if name in line:
sub = line

key = line.split("=")[1].replace(" ", "")

break

return key
Empty file.
Binary file not shown.
3 changes: 3 additions & 0 deletions web/apikeys/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
3 changes: 3 additions & 0 deletions web/apikeys/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
10 changes: 10 additions & 0 deletions web/apikeys/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from django.urls import path
from . import views

# Namespace name
app_name = 'apikeys_settings'

# Be careful setting the name to just /login use userlogin instead!
urlpatterns=[
path('', views.index, name='index'),
]
Loading

0 comments on commit 66578c5

Please sign in to comment.