mirror of
https://github.com/pentoo/pentoo-overlay
synced 2025-12-06 08:25:01 +01:00
sublert: drop, unmaintained
This commit is contained in:
parent
da7db22df8
commit
36c4d332b1
6 changed files with 0 additions and 297 deletions
|
|
@ -1 +0,0 @@
|
|||
DIST sublert-1.4.7_p20200103.tar.gz 8815 BLAKE2B a6308059b2d20d8db0bc2608cf64b627dfdb5982b9a4ea3e28a04eeb270d5aef9d0b0aba56b0bc2cad98a216d0cc92d35e83ffa86a37c90d4ede6512e25f7bb2 SHA512 cddc51d158caa6ea09efeb3738121e6d39a951cc0f30b162835aa37ea1867401d6afd05d9d5ade146046f1c61bdee286a9cc48de55462e7e9a371f39e7ca9a2f
|
||||
|
|
@ -1,222 +0,0 @@
|
|||
diff -ur a/config.py b/config.py
|
||||
--- a/config.py 2020-01-03 11:46:14.000000000 +0300
|
||||
+++ b/config.py 2020-04-01 08:29:31.731653107 +0300
|
||||
@@ -1,5 +1,3 @@
|
||||
-#!/usr/bin/python
|
||||
-
|
||||
# Slack webhooks for notifications
|
||||
posting_webhook = "https://hooks.slack.com/services/<secret>"
|
||||
errorlogging_webhook = "https://hooks.slack.com/services/<secret>"
|
||||
diff -ur a/sublert.py b/sublert.py
|
||||
--- a/sublert.py 2020-01-03 11:46:14.000000000 +0300
|
||||
+++ b/sublert.py 2020-04-01 09:11:26.497283936 +0300
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python
|
||||
-# coding: utf-8
|
||||
+
|
||||
# Announced and released during OWASP Seasides 2019 & NullCon.
|
||||
# Huge shout out to the Indian bug bounty community for their hospitality.
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
import os
|
||||
import re
|
||||
import psycopg2
|
||||
+import shutil
|
||||
+from pathlib import Path
|
||||
from tld import get_fld
|
||||
from tld.utils import update_tld_names
|
||||
from termcolor import colored
|
||||
@@ -27,6 +29,13 @@
|
||||
version = "1.4.7"
|
||||
requests.packages.urllib3.disable_warnings()
|
||||
|
||||
+sublert_home = str(Path.home().joinpath('.sublert'))
|
||||
+domains_file_path = sublert_home + '/domains.txt'
|
||||
+output_dir_path = sublert_home + '/output'
|
||||
+
|
||||
+if not Path(sublert_home).is_dir():
|
||||
+ Path(sublert_home).mkdir()
|
||||
+
|
||||
def banner():
|
||||
print('''
|
||||
_____ __ __ __
|
||||
@@ -109,7 +118,13 @@
|
||||
|
||||
def reset(do_reset): #clear the monitored list of domains and remove all locally stored files
|
||||
if do_reset:
|
||||
- os.system("cd ./output/ && rm -f *.txt && cd .. && rm -f domains.txt && touch domains.txt")
|
||||
+ if Path(sublert_home).is_dir():
|
||||
+ if Path(domains_file_path).is_file():
|
||||
+ Path(domains_file_path).unlink()
|
||||
+ Path(domains_file_path).touch()
|
||||
+ if Path(output_dir_path).is_dir():
|
||||
+ shutil.rmtree(output_dir_path)
|
||||
+
|
||||
print(colored("\n[!] Sublert was reset successfully. Please add new domains to monitor!", "red"))
|
||||
sys.exit(1)
|
||||
else: pass
|
||||
@@ -117,16 +132,17 @@
|
||||
def remove_domain(domain_to_delete): #remove a domain from the monitored list
|
||||
new_list = []
|
||||
if domain_to_delete:
|
||||
- with open("domains.txt", "r") as domains:
|
||||
+ with open(domains_file_path, "r") as domains:
|
||||
for line in domains:
|
||||
line = line.replace("\n", "")
|
||||
if line in domain_to_delete:
|
||||
- os.system("rm -f ./output/{}.txt".format(line))
|
||||
+ if Path(output_dir_path + "/{}.txt".format(line)).is_file():
|
||||
+ Path(output_dir_path + "/{}.txt".format(line)).unlink()
|
||||
print(colored("\n[-] {} was successfully removed from the monitored list.".format(line), "green"))
|
||||
else:
|
||||
new_list.append(line)
|
||||
- os.system("rm -f domains.txt")
|
||||
- with open("domains.txt", "w") as new_file:
|
||||
+ Path(domains_file_path).unlink()
|
||||
+ with open(domains_file_path, "w") as new_file:
|
||||
for i in new_list:
|
||||
new_file.write(i + "\n")
|
||||
sys.exit(1)
|
||||
@@ -135,7 +151,7 @@
|
||||
global list_domains
|
||||
if list_domains:
|
||||
print(colored("\n[*] Below is the list of monitored domain names:\n", "green"))
|
||||
- with open("domains.txt", "r") as monitored_list:
|
||||
+ with open(domains_file_path, "r") as monitored_list:
|
||||
for domain in monitored_list:
|
||||
print(colored("{}".format(domain.replace("\n", "")), "yellow"))
|
||||
sys.exit(1)
|
||||
@@ -197,11 +213,11 @@
|
||||
q2 = queue.Queue(maxsize=0)
|
||||
if domain_to_monitor:
|
||||
pass
|
||||
- elif os.path.getsize("domains.txt") == 0:
|
||||
+ elif os.path.getsize(domains_file_path) == 0:
|
||||
print(colored("[!] Please consider adding a list of domains to monitor first.", "red"))
|
||||
sys.exit(1)
|
||||
else:
|
||||
- with open("domains.txt", "r") as targets:
|
||||
+ with open(domains_file_path, "r") as targets:
|
||||
for line in targets:
|
||||
if line != "":
|
||||
q1.put(line.replace('\n', ''))
|
||||
@@ -213,20 +229,22 @@
|
||||
global domain_to_monitor
|
||||
global input
|
||||
if domain_to_monitor:
|
||||
- if not os.path.isfile('./domains.txt'): #check if domains.txt exist, if not create a new one
|
||||
- os.system("touch domains.txt")
|
||||
+ if not Path(output_dir_path).is_dir():
|
||||
+ Path(output_dir_path).mkdir()
|
||||
+ if not Path(domains_file_path).is_file(): #check if domains.txt exist, if not create a new one
|
||||
+ Path(domains_file_path).touch()
|
||||
else: pass
|
||||
- with open("domains.txt", "r+") as domains: #checking domain name isn't already monitored
|
||||
+ with open(domains_file_path, "r+") as domains: #checking domain name isn't already monitored
|
||||
for line in domains:
|
||||
if domain_to_monitor == line.replace('\n', ''):
|
||||
print(colored("[!] The domain name {} is already being monitored.".format(domain_to_monitor), "red"))
|
||||
sys.exit(1)
|
||||
response = cert_database().lookup(domain_to_monitor)
|
||||
if response:
|
||||
- with open("./output/" + domain_to_monitor.lower() + ".txt", "a") as subdomains: #saving a copy of current subdomains
|
||||
+ with open(output_dir_path + "/" + domain_to_monitor.lower() + ".txt", "a") as subdomains: #saving a copy of current subdomains
|
||||
for subdomain in response:
|
||||
subdomains.write(subdomain + "\n")
|
||||
- with open("domains.txt", "a") as domains: #fetching subdomains if not monitored
|
||||
+ with open(domains_file_path, "a") as domains: #fetching subdomains if not monitored
|
||||
domains.write(domain_to_monitor.lower() + '\n')
|
||||
print(colored("\n[+] Adding {} to the monitored list of domains.\n".format(domain_to_monitor), "yellow"))
|
||||
try: input = raw_input #fixes python 2.x and 3.x input keyword
|
||||
@@ -245,10 +263,10 @@
|
||||
else: #checks if a domain is monitored but has no text file saved in ./output
|
||||
try:
|
||||
line = q1.get(timeout=10)
|
||||
- if not os.path.isfile("./output/" + line.lower() + ".txt"):
|
||||
+ if not Path(output_dir_path + "/" + line.lower() + ".txt").is_file():
|
||||
response = cert_database().lookup(line)
|
||||
if response:
|
||||
- with open("./output/" + line.lower() + ".txt", "a") as subdomains:
|
||||
+ with open(output_dir_path + "/" + line.lower() + ".txt", "a") as subdomains:
|
||||
for subdomain in response:
|
||||
subdomains.write(subdomain + "\n")
|
||||
else: pass
|
||||
@@ -264,7 +282,7 @@
|
||||
try:
|
||||
line = q2.get(timeout=10)
|
||||
print("[*] Checking {}".format(line))
|
||||
- with open("./output/" + line.lower() + "_tmp.txt", "a") as subs:
|
||||
+ with open(output_dir_path + "/" + line.lower() + "_tmp.txt", "a") as subs:
|
||||
response = cert_database().lookup(line)
|
||||
if response:
|
||||
for subdomain in response:
|
||||
@@ -278,12 +296,12 @@
|
||||
if domain_to_monitor is None:
|
||||
if domain_to_delete is None:
|
||||
result = []
|
||||
- with open("domains.txt", "r") as targets:
|
||||
+ with open(domains_file_path, "r") as targets:
|
||||
for line in targets:
|
||||
domain_to_monitor = line.replace('\n', '')
|
||||
try:
|
||||
- file1 = open("./output/" + domain_to_monitor.lower() + '.txt', 'r')
|
||||
- file2 = open("./output/" + domain_to_monitor.lower() + '_tmp.txt', 'r')
|
||||
+ file1 = open(output_dir_path + "/" + domain_to_monitor.lower() + '.txt', 'r')
|
||||
+ file2 = open(output_dir_path + "/" + domain_to_monitor.lower() + '_tmp.txt', 'r')
|
||||
diff = difflib.ndiff(file1.readlines(), file2.readlines())
|
||||
changes = [l for l in diff if l.startswith('+ ')] #check if there are new items/subdomains
|
||||
newdiff = []
|
||||
@@ -296,7 +314,7 @@
|
||||
except:
|
||||
error = "There was an error opening one of the files: {} or {}".format(domain_to_monitor + '.txt', domain_to_monitor + '_tmp.txt')
|
||||
errorlog(error, enable_logging)
|
||||
- os.system("rm -f ./output/{}".format(line.replace('\n','') + "_tmp.txt"))
|
||||
+ Path(output_dir_path + "/{}".format(line.replace('\n','') + "_tmp.txt")).unlink()
|
||||
return(result)
|
||||
|
||||
def dns_resolution(new_subdomains): #Perform DNS resolution on retrieved subdomains
|
||||
@@ -371,9 +389,10 @@
|
||||
print(colored("\n[!] Done. ", "green"))
|
||||
rev_url = list(set(rev_url))
|
||||
for url in rev_url:
|
||||
- os.system("rm -f ./output/" + url.lower() + ".txt")
|
||||
- os.system("mv -f ./output/" + url.lower() + "_tmp.txt " + "./output/" + url.lower() + ".txt") #save the temporary one
|
||||
- os.system("rm -f ./output/*_tmp.txt") #remove the remaining tmp files
|
||||
+ if Path(output_dir_path + "/" + url.lower() + ".txt").unlink():
|
||||
+ shutil.move(output_dir_path + "/" + url.lower() + "_tmp.txt", output_dir_path + "/" + url.lower() + ".txt")
|
||||
+ for tmpfiles in Path(output_dir_path).rglob('*_tmp.txt'):
|
||||
+ Path(tmpfiles).unlink() #remove the remaining tmp files
|
||||
|
||||
elif result:
|
||||
rev_url = []
|
||||
@@ -387,23 +406,25 @@
|
||||
rev_url = list(set(rev_url))
|
||||
|
||||
for url in rev_url:
|
||||
- os.system("rm -f ./output/" + url.lower() + ".txt")
|
||||
- os.system("mv -f ./output/" + url.lower() + "_tmp.txt " + "./output/" + url.lower() + ".txt") #save the temporary one
|
||||
- os.system("rm -f ./output/*_tmp.txt") #remove the remaining tmp files
|
||||
+ if Path(output_dir_path + "/" + url.lower() + ".txt").unlink():
|
||||
+ shutil.move(output_dir_path + "/" + url.lower() + "_tmp.txt", output_dir_path + "/" + url.lower() + ".txt") #save the temporary one
|
||||
+ for tmpfiles in Path(output_dir_path).rglob('*_tmp.txt'):
|
||||
+ Path(tmpfiles).unlink() #remove the remaining tmp files
|
||||
|
||||
else:
|
||||
if not domain_to_monitor:
|
||||
data = "{}:-1: We couldn't find any new valid subdomains.".format(at_channel())
|
||||
slack(data)
|
||||
print(colored("\n[!] Done. ", "green"))
|
||||
- os.system("rm -f ./output/*_tmp.txt")
|
||||
+ for tmpfiles in Path(output_dir_path).rglob('*_tmp.txt'):
|
||||
+ Path(tmpfiles).unlink()
|
||||
else: pass
|
||||
|
||||
def multithreading(threads):
|
||||
global domain_to_monitor
|
||||
threads_list = []
|
||||
if not domain_to_monitor:
|
||||
- num = sum(1 for line in open("domains.txt")) #minimum threads executed equals the number of monitored domains
|
||||
+ num = sum(1 for line in open(domains_file_path)) #minimum threads executed equals the number of monitored domains
|
||||
for i in range(max(threads, num)):
|
||||
if not (q1.empty() and q2.empty()):
|
||||
t1 = threading.Thread(target = adding_new_domain, args = (q1, ))
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer type="person">
|
||||
<email>Unmaintained@unmaintained.com</email>
|
||||
<name>Unmaintained</name>
|
||||
</maintainer>
|
||||
<upstream>
|
||||
<remote-id type="github">yassineaboukir/sublert</remote-id>
|
||||
</upstream>
|
||||
</pkgmetadata>
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
# Copyright 1999-2023 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
PYTHON_COMPAT=( python3_{10..12} )
|
||||
|
||||
inherit python-single-r1 wrapper
|
||||
|
||||
DESCRIPTION="Monitor new subdomains deployed and issued TLS/SSL certificate"
|
||||
HOMEPAGE="https://github.com/yassineaboukir/sublert"
|
||||
|
||||
HASH_COMMIT="b9b63d6eaa2e7602ce1f2bd1a4ccc432235684b4"
|
||||
SRC_URI="https://github.com/yassineaboukir/sublert/archive/${HASH_COMMIT}.tar.gz -> ${P}.tar.gz"
|
||||
|
||||
LICENSE="MIT"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
|
||||
RDEPEND="${PYTHON_DEPS}
|
||||
$(python_gen_cond_dep '
|
||||
dev-python/psycopg:2[${PYTHON_USEDEP}]
|
||||
dev-python/requests[${PYTHON_USEDEP}]
|
||||
dev-python/dnspython[${PYTHON_USEDEP}]
|
||||
dev-python/tld[${PYTHON_USEDEP}]
|
||||
dev-python/termcolor[${PYTHON_USEDEP}]
|
||||
')"
|
||||
|
||||
PATCHES=( "${FILESDIR}"/${P}_pentoo.patch )
|
||||
|
||||
S="${WORKDIR}/sublert-${HASH_COMMIT}"
|
||||
|
||||
pkg_setup() {
|
||||
python-single-r1_pkg_setup
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
|
||||
# cleanup
|
||||
rm -f setup.py
|
||||
|
||||
if [[ ${PV} != *9999 ]]; then
|
||||
sed -e "s/version = \"\(.*\)\"/version = \"${PV}\"/" \
|
||||
-i sublert.py || die
|
||||
fi
|
||||
|
||||
python_fix_shebang "${S}"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
insinto "/usr/share/${PN}"
|
||||
doins *.py
|
||||
|
||||
python_optimize "${D}/usr/share/${PN}"
|
||||
|
||||
make_wrapper $PN \
|
||||
"${EPYTHON} /usr/share/${PN}/sublert.py"
|
||||
|
||||
dodoc *.md
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
move net-analyzer/sublert net-dns/sublert
|
||||
|
|
@ -1,3 +1,2 @@
|
|||
move net-dns/sublert net-analyzer/sublert
|
||||
move dev-python/capstone-python dev-libs/capstone-bindings
|
||||
move sys-devel/ropper app-exploits/ropper
|
||||
|
|
|
|||
Loading…
Reference in a new issue