Skip to content

Instantly share code, notes, and snippets.

View cooliscool's full-sized avatar
🐼

Ajmal Moochingal cooliscool

🐼
View GitHub Profile

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 / 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();
@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