Skip to content

Instantly share code, notes, and snippets.

View selftaught's full-sized avatar

selftaught selftaught

  • Bluehost
  • Portland
View GitHub Profile
#!/bin/bash
rm -rf plugins
mkdir plugins
for i in $(seq 1 2); do
curl -s "https://wordpress.org/plugins/browse/popular/page/$i/" | \
grep --color "https://wordpress.org/plugins/" | \
grep "<h3 class=\"entry-title\">" | sed "s/.*a href=\"//g" | sed "s/\" rel.*//g" | \
xargs -I{} curl -s {} | grep downloadUrl | grep -Eo "https:[^\"]+" | \
Bash PowerShell Bash Example PowerShell Example
find Get-ChildItem find . -type f -name "matchme" Get-ChildItem -Filter "matchme" -Recurse -File
ls Get-ChildItem ls -R dir/ Get-ChildItem '.\dir' -Recurse
which Get-Command which python Get-Command python
env Get-ChildItem env: env Get-ChildItem env:
echo echo echo $ENV{'PATH'} echo $Env:path
grep Select-String grep 'foobar' file.txt Select-String -Path '.\file.txt'-Pattern 'foobar'
useradd
@sharuzzaman
sharuzzaman / check_ssl_cert.py
Created February 17, 2022 06:48
python get info for expired SSL cert
#!/bin/env python3
# check_ssl_cert.py - python get info for expired SSL cert
# Copyright 2022 Sharuzzaman Ahmat Raslan <sharuzzaman@gmail.com>
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with this program. If not, see https://www.gnu.org/licenses/.
from cryptography import x509

My Openshift Cheatsheet

Openshift build secrets for cloning git repos using SSH Keys

  • To create ssh secret:
oc create secret generic sshsecret \
    --from-file=ssh-privatekey=$HOME/.ssh/id_rsa
@selftaught
selftaught / bw.c
Last active November 17, 2019 16:00
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <time.h>
void print_bits (uint8_t vals);
void bitwise_and ();
void bitwise_and_assign ();
void bitwise_or ();
void bitwise_or_assign ();

Crpyto Card SC 2019

* THEMAPTOKIDDSLEAVINGSWILLPROVIDEYOUTHECLUETOPROGRESS;5((5*†18;48(-5*56†:‡?6*†6)-‡¶8(6*3]4‡4‡0†);46)78:†86.,.-88)10¶0)68‡9596-‡¢$87]**,26()-1¶7:5].375$*62¶;;6;5-‡$?2†,*-(]95?);,;69:1†732.1]¢8**¶;$7]2?[$9,2†).65);?60]4†(?.867(32†73¶]4¶4¢?5.$3:88‡?]¶5:(7‡4*5(¢‡580[[;6;75]]11†$7?)9†?13.06?.(99¢(2‡)8*..‡)).766]0-7[940*1])?†*440[]7††35†¶,*[.26*¶7¢1,:42)663¢,;38034?†-,8;6‡0$?¶;5¶¶7¢,.)9*

Inside:

    * THEMAPTOKIDDSLEAVINGSWILLPROVIDEYOUTHECLUETOPROGRESS;5((5*†18;48(-5*56†:‡?6*†6)-‡¶8(6*3]4‡4‡0†);46)78:†86.,.-88)10¶0)68‡9596-‡¢$87]**,26()-1¶7:5].375$*62¶;;6;5-‡$?2†,*-(]95?);,;69:1†732.1]¢8**¶;$7]2?[$9,2†).65);?60]4†(?.867(32†73¶]4¶4¢?5.$3:88‡?]¶5:(7‡4*5(¢‡580[[;6;75]]11†$7?)9†?13.06?.(99¢(2‡)8*..‡)).766]0-7[940*1])?†*440[]7††35†¶,*[.26*¶7¢1,:42)663¢,;38034?†-,8;6‡0$?¶;5¶¶7¢,.)9*
@battmatt
battmatt / ForkJoinAPI.py
Last active March 21, 2024 20:50
Example Parallel Task API based on Celery
# (c) Copyright 2018 Zymergen, Inc.
# All Rights Reserved
"""
The following is example code used for a technology blog post: https://medium.com/@ZymergenTechBlog/building-a-parallel-task-api-with-celery-dbae5ced4e28
The ForkJoin class can be used to generate a ZWork task that contains a single
distributed processing step. Your job should have 3 parts. An initial setup step
responsible for splitting of inputs into workable chunks. A process step that can
process each chunk in a forked execution process and a join step that puts it all
@shu-yusa
shu-yusa / create_jwt.sh
Last active March 21, 2024 14:57
Generate private and public keys, and create JWT and JWKs
#!/bin/sh
## Requires openssl, nodejs, jq
header='
{
"kid": "12345",
"alg": "RS256"
}'
payload='
{
"iss": "https://example.com",
@sundowndev
sundowndev / GoogleDorking.md
Last active July 25, 2024 00:06
Google dork cheatsheet

Google dork cheatsheet

Search filters

Filter Description Example
allintext Searches for occurrences of all the keywords given. allintext:"keyword"
intext Searches for the occurrences of keywords all at once or one at a time. intext:"keyword"
inurl Searches for a URL matching one of the keywords. inurl:"keyword"
allinurl Searches for a URL matching all the keywords in the query. allinurl:"keyword"
intitle Searches for occurrences of keywords in title all or one. intitle:"keyword"

LoadLibrary DLL Injection

DLL injection is the process of forcing a running process to load a DLL (Dynamically Linked Library) of your choice. In this write-up, I'll walk you through the LoadLibraryA injection method. This causes the DLL to be loaded into the context of the process thus allowing us to execute our own code inside of the process's virtual memory space.

I assume there is a base understanding of what a DLL is. By the end of this write-up, we'll have a functional DLL injector along with a bare-bone test DLL which we'll use for testing during development.

Writing a DLL injector is pretty trivial and only requires a handful steps. Remember that DLLs are specific to Windows and there-for we'll be utilizing functions provided to us by the Windows API. The steps required for the task at hand are in order as follows: