Skip to content

Instantly share code, notes, and snippets.

View cooliscool's full-sized avatar
🐼

Ajmal Moochingal cooliscool

🐼
View GitHub Profile
@cooliscool
cooliscool / add_new_subdomain.sh
Last active November 8, 2025 14:44
Add a new subdomain & Configure it for Apache2 & Get TLS certificate via LetsEncrypt certbot.
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
# Read site_name from stdin (supports piping or interactive prompt)
if [ -t 0 ]; then
read -rp "Enter site name (e.g. example.com): " site_name
else
read -r site_name
fi
@cooliscool
cooliscool / main.c
Created October 18, 2024 15:34
Baby Malware (Reverse shell)
// This snippet intents to simulate a baby malware.
// The malware upon running connects to a server, currently hardcoded as 127.0.0.1:8080
// From server, it accepts a command to be executed locally
// It executes the command locally and then send back the response to the server.
// Basically, just a reverse shell binary. Now when thinking about it, this could have been done in a bash one liner also 🤔
// But I had fun editing some little C code. So, cool.
// to compile : gcc -o main main.c
// run ./main
// to run the command&control server : while true; do echo -e 'id' | nc -l 8080 ; done
@cooliscool
cooliscool / CommandExecutor.java
Created December 27, 2023 18:39
Android Shell Command executor class.
package com.moo.myapplication2;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class CommandExecutor {
public static String executeCommand(String command) {
StringBuilder output = new StringBuilder();

Path traversal to RCE in Android - Mobile Hacking Lab ‘Document Viewer’ write-up

During my preparation for eMAPT, I came across Mobile Hacking Labs - and their free hacking labs which I felt would help me for practice. So I decided to give it a try starting with the ‘Document Viewer’ challenge. Getting right into the problem.

Problem statement

The do give out some solid hints & right direction in the problem statement.

  • Your target is an Android application with a feature to open PDFs from HTTP/HTTPS URLs
@cooliscool
cooliscool / gist:85d45bbd0bf4ac50a3ed8108fbff6534
Last active December 1, 2023 01:48
Kubernetes Policy Engines

Kubernetes Policy Engines: How to Implement Security, Compliance, and Governance Policies in Your Cluster

kubernetes_captain_retouched (image generated by DALL-E)

Embarking on the journey of Kubernetes security unveils a vast landscape, encompassing crucial elements that safeguard your containerized applications. Among the intriguing facets within this realm, we delve into pivotal sections that form the bedrock of Kubernetes security:

  • RBAC Mastery: Kubernetes security begins with defining who holds the keys to the kingdom. Role-Based Access Control (RBAC) empowers you to orchestrate who wields authority over kubectl, the gateway to your Kubernetes cluster. Craft roles and permissions tailored for distinct users and groups, ensuring a finely tuned control mechanism.

  • Secrets Safeguard: The cloak of security extends to shielding your application's secrets. In the digital realm, secrets are akin to treasures — pa

@cooliscool
cooliscool / jerk.py
Last active October 28, 2023 05:58
Mouse Jerk 😜
import pyautogui
import random
import time
while True:
current_x, current_y = pyautogui.position()
# Generate random x and y coordinates around the current position
new_x = current_x + random.randint(-5, 5)
new_y = current_y + random.randint(-5, 5)
@cooliscool
cooliscool / create_dataset.py
Last active January 21, 2023 10:18
For selecting only a few number of classes from PASCAL VOC for training in Tensorflow. ( Please refer the code thoroughly :) )
PASCAL_CLASSES = [
'none',
'aeroplane',
'bicycle',
'bird',
'boat',
'bottle',
'bus',
'car',
'cat',
@cooliscool
cooliscool / egg_hunter.asm
Created October 27, 2022 05:22 — forked from AdityaChaudhary/egg_hunter.asm
Linux/x86 Egg Hunter
; Egg Hunter
; Author: Aditya Chaudhary
; Date: 20th Jan 2019
global _start
section .text
@cooliscool
cooliscool / main.go
Created November 24, 2021 14:30
Pretty print JSON from stdin - Go program
package main
import ("fmt"
"encoding/json"
"os"
"bufio"
"bytes"
)
@cooliscool
cooliscool / flightgearWarrior.py
Last active October 24, 2021 09:43
To Run Flight Gear simulations
import time
import requests as g
import csv
port= 8089
hostname='localhost'
latDegToMet = 111000
metToFeet = 3.28084
radToDeg = 180/3.14159