Skip to content

Instantly share code, notes, and snippets.

View fjh1997's full-sized avatar
💭
寡人有疾,寡人好色。

FunnyBiu fjh1997

💭
寡人有疾,寡人好色。
View GitHub Profile
@torch2424
torch2424 / systemDAsUser.service
Last active January 31, 2025 23:19
Run a systemd service as a user
# How to create systemd services: http://neilwebber.com/notes/2016/02/10/making-a-simple-systemd-file-for-raspberry-pi-jessie/
# Digital ocean on a mongodb service: https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-ubuntu-16-04
[Unit]
Description=Run SystemD as users
After=network.target
[Service]
Type=simple
User=[USER HERE]
WorkingDirectory=[USER HOME]
@xufan6
xufan6 / zjzx.py
Last active March 2, 2025 15:29
浙江省高校师资培训练习系统-题目抓取以及去重
from bs4 import BeautifulSoup
import re
for a in xrange(1,5):
for b in xrange(1,21):
path="html/"+str(a)+"_"+str(b)+".html"
soup = BeautifulSoup(open(path),"lxml")
span=soup.find_all(id=re.compile("Label"))
for i in span:
#print i.get("id")
1 - Install Home Brew.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2 - Install aircrack-ng:
brew install aircrack-ng
3 - Install the latest Xcode, with the Command Line Tools.
//Create the following symlink:
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/local/bin/airport//Figure out which channel you need to sniff:
@mtrovilho
mtrovilho / Aircrack Commands
Last active March 3, 2025 15:02 — forked from victorreyesh/Aircrack Commands
Cracking WPA2 / WEP Wifi / Aircrack 10 seconds guide. For Mac OSX
// Install the latest Xcode, with the Command Line Tools.
// Install Homebrew
// Install aircrack-ng:
brew install aircrack-ng
// Create the following symlink:
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/local/sbin/airport
// Figure out which channel you need to sniff:
sudo airport -s
@Tiberriver256
Tiberriver256 / PSWebServer.psm1
Last active March 6, 2024 03:49
Sample of making a simple webserver in PowerShell. If you have more complex needs checkout Pode (https://github.com/Badgerati/Pode) as a fully fledged PowerShell web server.
Function New-PSWebServer {
<#
.Synopsis
Creates a web server that will invoke PowerShell code based on routes being asked for by the client.
.Description
New-PSWebServer creates a web server. The web server is composed of a schema that defines the client's requests to routes where PowerShell code is executed.
Under the covers, New-PSWebServer uses the HTTPListener .NET class to execute powershell code as requested, retrieves the results and sends data back through the httplistener web server framework.
@felmoltor
felmoltor / zlib1.dll.cpp
Last active February 29, 2024 06:55
Privilege escalation with DLL Hijack of zlib1.dll on a MinGW default installation
// Author: Felipe Molina (@felmoltor)
//
// MinGW DLL Hijack Privilege Escalation POC.
// This dll will suplantate the legitimate library "zlib1.dll" residing inside
// the default installation folder of MinGW "C:\MinGW\bin\zlib1.dll"
//
// g++ -c -DPRIVESC_DLL mingwprivesc.dll.cpp & g++ -shared -o mingwprivesc.dll mingwprivesc.dll.o -Wl,--out-implib,main.a & copy /y mingwprivesc.dll C:\MinGW\bin\zlib1.dll
@define-private-public
define-private-public / HttpServer.cs
Last active April 22, 2025 09:49
A Simple HTTP server in C#
// Filename: HttpServer.cs
// Author: Benjamin N. Summerton <define-private-public>
// License: Unlicense (http://unlicense.org/)
using System;
using System.IO;
using System.Text;
using System.Net;
using System.Threading.Tasks;
@ggrandes
ggrandes / openssl-smime.sh
Last active September 6, 2024 22:33
OpenSSL S/MIME 3.1 (CMS) - Encrypt/Signature - Verify/Decrypt
# Original Source:
# https://gist.github.com/ggrandes/a57c401f1bad6bd0ffd87a557b7b5790
# SIGN / VERIFY
openssl cms -sign -keyid -md sha256 -nodetach -binary -in /etc/passwd -signer user.crt -inkey user.key -out x.smime -outform SMIME
openssl cms -verify -CAfile ca.crt -in x.smime -inform SMIME
# ENCRYPT / DECRYPT
openssl cms -encrypt -keyid -aes-256-cbc -in /etc/passwd -binary -out x.smime -outform SMIME user.crt
openssl cms -decrypt -in x.smime -inform SMIME -recip user.crt -inkey user.key
@arebee
arebee / no-bom.ps1
Created November 17, 2015 02:29
PowerShell script to save as UTF-8 without a BOM
gci . -recurse -filter *.ps* | % {
$MyFile = gc $_.Fullname -raw
$MyPath = $_.Fullname
[System.IO.File]::WriteAllLines($MyPath, $MyFile, [System.Text.UTF8Encoding]($False))
}
@liantian-cn
liantian-cn / gist:27c4836a2d96c902258d
Created August 23, 2015 11:31
CreateProcessWithLogonW Python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from ctypes import *
from ctypes.wintypes import *
INVALID_HANDLE_VALUE = -1
CREATE_UNICODE_ENVIRONMENT = 0x00000400