Skip to content

Instantly share code, notes, and snippets.

View wen-long's full-sized avatar
🥀
finding a target

wen-long

🥀
finding a target
View GitHub Profile
@wen-long
wen-long / dns.go
Created July 15, 2023 08:16 — forked from timothyandrew/dns.go
Barebones Recursive DNS Resolver
package main
import (
"fmt"
"math/rand"
"os"
"github.com/miekg/dns"
)

为什么关心 AS

因特网上的一个 IP 必定属于某个 AS,也就是一个自治系统。一般一个 AS 里的 IP 具有共性,比如网络质量较高或者较差,欺诈风险较高或者较低。 在使用 mtr 或者 traceroute 查看路由时,通过确认中间路由节点 IP 的 AS,可以确认路由质量。 举例说明,对于常见的 CN2 线路,通过 mtr 看到有经过 59.43.138.70,使用 whois 命令查看 IP 信息如下

~$ whois 59.43.138.70
route:          59.43.0.0/16
descr:          Chinatelecom Next Carrying Network backbone
origin:         AS4809
mnt-by: MAINT-CHINANET
root@GL-MV1000:~# iperf3 -c 45.14.107.x -u -b 20MB --get-server-output --bidir
Connecting to host 45.14.107.x, port 5201
[ 5] local 100.64.189.159 port 47629 connected to 45.14.107.x port 5201
[ 7] local 100.64.189.159 port 57883 connected to 45.14.107.x port 5201
[ ID][Role] Interval Transfer Bitrate Jitter Lost/Total Datagrams
[ 5][TX-C] 0.00-1.00 sec 2.38 MBytes 20.0 Mbits/sec 1735
[ 7][RX-C] 0.00-1.00 sec 2.26 MBytes 19.0 Mbits/sec 0.085 ms 96/1745 (5.5%)
[ 5][TX-C] 1.00-2.00 sec 2.38 MBytes 20.0 Mbits/sec 1736
[ 7][RX-C] 1.00-2.00 sec 2.26 MBytes 19.0 Mbits/sec 0.112 ms 85/1733 (4.9%)
[ 5][TX-C] 2.00-3.00 sec 2.38 MBytes 20.0 Mbits/sec 1736
@wen-long
wen-long / keepsolid.server.list.txt
Last active October 1, 2022 06:09
collect from vpnunlimitedapp.com, icmp ping test from hong kong, tag: web vpn server KeepSolid VPN Unlimited all server full list. if you know more server, welcome to leave here
0 59 jp1.vpnunlimitedapp.com 85.208.110.122 match:2 trust:0 threat:100 vpn:100 proxy:100 [日本 东京]
0 59 jp13.vpnunlimitedapp.com 172.104.64.213 match:2 trust:0 threat:100 vpn:100 proxy:100 [日本 东京]
0 59 jp16.vpnunlimitedapp.com 172.104.119.195 match:2 trust:0 threat:100 vpn:100 proxy:100 [日本 东京]
0 59 jp18.vpnunlimitedapp.com 139.162.125.238 match:3 trust:0 threat:100 vpn:100 proxy:100 [日本 东京]
0 60 jp6.vpnunlimitedapp.com 172.104.83.34 match:2 trust:0 threat:100 vpn:100 proxy:100 [日本 东京]
0 60 jp7.vpnunlimitedapp.com 172.104.99.172 match:2 trust:0 threat:100 vpn:100 proxy:100 [日本 东京]
0 60 jp10.vpnunlimitedapp.com 172.104.75.121 match:2 trust:0 threat:100 vpn:100 proxy:100 [日本 东京]
0 60 jp11.vpnunlimitedapp.com 172.104.67.80 match:2 trust:0 threat:100 vpn:100 proxy:100
@wen-long
wen-long / bash_interactive_and_login.sh
Created March 18, 2018 12:36 — forked from CMCDragonkai/bash_interactive_and_login.sh
Bash & ZSH: Interactive and Login Shells
#!/usr/bin/env bash
[[ $- == *i* ]] && echo "This Bash Shell is Interactive Shell" || echo "This Bash Shell is Not a Interactive Shell"
shopt -q login_shell && echo "This Bash Shell is a Login Shell" || echo "This Bash Shell is Not a Login Shell"
@wen-long
wen-long / sniproxy.md
Created January 8, 2018 16:31 — forked from pjamar/sniproxy.md
SNI Proxy Tutorial

SNI Proxy for sharing an SSL port 443 with Sandstorm

Make Sandstorm and other web server coexist in the same port while keeping HTTPS encryption.

Introduction

The purpose of this tutorial is to set up SNI Proxy so it’s possible to use Sandstorm verified SSL encryption while coexisting with another web server that also uses SSL.

The main reason is to allow other users to connect with your Sandstorm instance in the standard HTTPS port (443) and keep using that port also for any other web apps.

#include <stdio.h>
#ifdef _WIN32
/* MSVC, x86-only. Stupid compiler doesn't allow __asm on x86_64. */
bool cpuid(unsigned *_eax, unsigned *_ebx, unsigned *_ecx, unsigned *_edx)
{
#ifdef TARGET_CPU_X86
static bool cpuid_support = FALSE;
static inline void native_cpuid(unsigned int *eax, unsigned int *ebx,
unsigned int *ecx, unsigned int *edx)
{
/* ecx is often an input as well as an output. */
asm volatile("cpuid"
: "=a" (*eax),
"=b" (*ebx),
"=c" (*ecx),
"=d" (*edx)
: "0" (*eax), "2" (*ecx));
static inline void native_cpuid(unsigned int *eax, unsigned int *ebx,
unsigned int *ecx, unsigned int *edx)
{
/* ecx is often an input as well as an output. */
asm volatile("cpuid"
: "=a" (*eax),
"=b" (*ebx),
"=c" (*ecx),
"=d" (*edx)
: "0" (*eax), "2" (*ecx));