Batch DNSSEC check

 Wrote a simple Shell script that can check if a list of URLs have DNSSEC enabled.

 

#!/bin/bash
## Set variables ##
_now=$(date +"%m_%d_%Y")

## Curl Sidn Labs API ##
while IFS= read -r line; do
    curl http://portfolio.sidnlabs.nl/check/$line >> "dnsseccheck_$_now.txt"
done < dnstargets.txt
cat "dnsseccheck_$_now.txt"


##Please edit "dnstargets.txt" in current folder.
##Results will be stored in current folder.
##Written by commandrine.
##Last updated on 6 Apr 2021.

"sslyze" on "Ubuntu"

 I have used "sslyze" primarily on "Windows" and I figured it was time to use it on "Ubuntu".

Wrote a "shell script" to run on "Ubuntu".

#!/bin/bash
## Get current date ##
_now=$(date +"%m_%d_%Y")
sudo python3 -m sslyze --update_trust_stores
sudo python3 -m sslyze --regular --targets_in=targets.txt > "sslyze_$_now.txt"
sudo cat "sslyze_$_now.txt"
#sslyze script to run on Ubuntu.
#Please edit "targets.txt" in current folder.
#Results will be stored in current folder.
#Written by commandrine.
#Last updated on 23 Nov 2020.

"DNS over HTTPS"

I've always liked "Firefox" but been using "Chrome" and "Brave" more in recent times. I may just go back to "Firefox" with their latest feature "DNS over HTTPS".
You can enable it from "Network Settings".

DNSSEC check

Was recently triggered to research how to verify if a domain has DNSSEC enabled.
The manual way would be to run a "dig" command to query the domain you want to check but the DNS server you query has to support DNSSEC.
Plan B was using an API provided by SIDN Labs. You can leverage their API by running a "curl" command as seen below. Any status other than "secure" is bad.
This method is tedious if you want to check multiple domains. Alternatively, you can populate a CSV file with the domains you want to check and upload them to SIDN Labs using this form. I replicated the form below.

DNSSEC check form

Upload the CSV containing the domains you want to test using SIDN Lab's API.

Log review

Wrote a simple script to aid with log review using keywords. You can use the below by substituting the keywords as well as log source.

#!/bin/bash
grep "Authentication fail" /mnt/c/monthly/app.log > /mnt/c/monthly/app-fail.txt
grep "Authentication fail" /mnt/c/monthly/os.log > /mnt/c/monthly/os-fail.txt

Bash on Windows

The day has finally arrived where I can run Linux commands on Windows. This is way better with the ability to run comands like "grep".
Set up Bash on Windows and you are ready to go.

Privacy update

Been awhile since I've posted. Not as paranoid as I used to be but still cautious and thus I have 2 new tools to recommend.
I use Brave browser more nowadays because it is built with privacy in mind. However, I installed uBlock Origin plugins for Chrome and Firefox when not on Brave.

Nessus update for Ubuntu

Decided to incorporate Nessus update as part of my Ubuntu update script.

#!/bin/sh
#Update Ubuntu
sudo apt-get update
sudo apt-get upgrade
sudo apt-get autoremove
#Update Nessus
sudo /etc/init.d/nessusd stop
sudo /opt/nessus/sbin/nessuscli update --all
sudo /etc/init.d/nessusd start

Script to dump contents of "Robots.txt"

Recently picked up "Python" and decided to try my hand at a "n00b" script to dump the contents of "Robots.txt" file residing on a webserver.

# Ask for Protocol and store it in protocol
protocol = input('Enter HTTP or HTTPS: ')

# Ask for URL or IP and store it in domain
domain = input('Enter URL or IP: ')

robots = "/robots.txt"

from urllib.request import Request, urlopen
print('Checking "Robots.txt" for:')
print(domain)
print()
from urllib.error import URLError, HTTPError
req = Request(protocol+"://"+domain+robots)
try:
    response = urlopen(req)
except HTTPError as e:
    print('The server couldn\'t fulfill the request.')
    print('Error code: ', e.code)
except URLError as e:
    print('We failed to reach the server.')
    print('Reason: ', e.reason)
else:
    print('Contents of "Robots.txt" is as follows.')
    print()
with urlopen((protocol+"://"+domain+robots)) as stream:
    print(stream.read().decode("utf-8"))

#Written by commandrine.
#Last updated on 22 Jun 2017.

Windows Nessus batch job

Wrote a simple Nessus batch job to get the updates.

cd \
cd "Program Files"/Tenable/Nessus/
net stop "Tenable Nessus"
nessuscli update --all
net start "Tenable Nessus"


#Written by commandrine.
#Last updated on 15 Feb 2017.

sslyze batch

I have always been about efficiency and decided to script my "sslyze" scans. Simple batch file below.

@echo off
setlocal ENABLEDELAYEDEXPANSION

set today=!date:/=-!
set now=!time::=-!

@echo SSLYZE scanning in progress... please be patient...
@echo off
cd \sslyze1-0-0
sslyze.exe --regular --targets_in=targets.txt > sslyze-!today!_!now!.txt

start "" "sslyze-!today!_!now!.txt"

#Please edit "targets.txt" in SSLYZE folder.
#Results will be stored in SSLYZE folder.
#Written by commandrine.
#Last updated on 15 Feb 2017.


Remember to create a file "targets.txt" in your sslyze folder and populate it with the hostnames/IPs you want to test.

Ubuntu maintenance script

 Wrote a simple script for keeping packages and snaps updated in Ubuntu.