Skip to content

Instantly share code, notes, and snippets.

View NeverBehave's full-sized avatar
😾
Meowing

Xinhao Luo NeverBehave

😾
Meowing
View GitHub Profile

Keybase proof

I hereby claim:

  • I am NeverBehave on github.
  • I am neverbehave (https://keybase.io/neverbehave) on keybase.
  • I have a public key whose fingerprint is 1217 D968 2510 A270 016F 1398 CF6D F645 8187 0E75

To claim this, I am signing this object:

@NeverBehave
NeverBehave / README.md
Created October 11, 2017 10:01 — forked from bekce/README.md
ldap server with mysql backend

I wanted to build an LDAP server that queries a MySQL server to fetch users and check their passwords. It is mainly used for old software that does not work with custom OAuth2 providers. Redmine is an example of this.

Instructions:

  1. Create the database and table with insert.sql
@NeverBehave
NeverBehave / NexusPHPThanks.sh
Last active June 14, 2018 13:01
NexusPHP 批量刷感谢
HTTP='https://'
SITE='hdhome.org'
COOKIE='Your Cookie Here'
MAX=30000
for i in {${MAX}..1}
do
curl "${HTTP}${SITE}/thanks.php" -H "origin: ${SITE}" -H 'accept-encoding: gzip, deflate, br' -H 'accept-language: en,zh-CN;q=0.9,zh;q=0.8' -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36' -H 'content-type: application/x-www-form-urlencoded' -H 'accept: */*' -H "referer: {SITE}/details.php?id=${i}&hit=1" -H 'authority: ${SITE}' -H "cookie: ${COOKIE}" -H 'dnt: 1' --data "id=${i}" --compressed --connection-timeout 3
echo -------------${i} passed---------------
done
#!/bin/bash
#===============================================================================
#
# FILE: iptable_redirect_port.sh
#
# USAGE: ./iptable_redirect_port.sh PROTOCOL SERVER_PORT DHOST DPORT [-d]
#
# DESCRIPTION: Redirect traffic to another server.
#
# OPTIONS: —
#!/bin/bash
while true
do
{ echo -ne "HTTP/1.0 200 OK\r\nContent-Length: $(wc -c <index.html)\r\n\r\n"; cat index.html; } | nc -l -p 80
done
@NeverBehave
NeverBehave / DynamicIP.sh
Last active January 10, 2019 16:35
Script for Dynamic IP with Rancher Agent (v1.6)
#!/bin/bash
# https://rancher.com/docs/rancher/v1.6/en/faqs/agents/#how-does-the-host-determine-ip-address-and-how-can-i-change-it-what-do-i-do-if-the-ip-of-my-host-has-changed-due-to-reboot
LOCATION="/tmp/ip.txt"
RANCHER_URL=""
function getIPAndSave() {
ip=$(curl -s https://api-ipv4.ip.sb/ip)
rc=$?
if [ "$rc" != "0" ]; then
@NeverBehave
NeverBehave / README.md
Last active December 6, 2023 02:41
First 100,000 prime numbers in python

First 100,000 prime number

sometimes we are asked to calculate something with prime numbers in ctf, and a list of pre-calculated value may help speed up a bit.

Usage

from prime_number_100000 import prime_number_100000

&gt;&gt;&gt; prime_number_100000()
@NeverBehave
NeverBehave / README.md
Last active November 26, 2020 23:00
/sao@NeverBehave
[
{
"url":"https://cdn-api.gog.com/open/tests/100KB.png",
"hosting":"GOG",
"purpose":"initial",
"sizeBytes":98722
},
{
"url":"https://cdn-api.gog.com/open/tests/100MB.png",
"hosting":"GOG",
@NeverBehave
NeverBehave / README.md
Last active November 6, 2020 06:43
OWL token 2020 (does not applied for Mainland China)

Assume Anything sent to youtube does not share with Blizzard

then the only xhr to record watching behavior should be:

https://sentinel.majorleaguegaming.com/api/v1/viewers/owl

It have been proved working on my own account; script can be found here: https://runkit.com/neverbehave/5eca0400df5906001a118075