|
https://chromium.googlesource.com/chromium/src/+/90243a7416f52151a8c6cecf633500dceb366895 这是我的尝试过程 Finished `release` profile [optimized + debuginfo] target(s) in 8.73s
Running `target\release\brute.exe`
Sanity check passed.
Example UUID: eb366895-0000-4000-8000-000092f987b9
Example SHA512[:10]: f1806885dd7c26281be1
Threads: 24
⠂ [00:09:20] 12777947136 attempts (23,721,570.6753/s)
===== FOUND =====
UUID : eb366895-8000-4000-a0f5-0d1692f987b9
answer : /answer eb366895-8000-4000-a0f5-0d1692f987b9
hash[:10] : 000000003eca27c526fa
attempts : 12779575405
time : 560.42s
rate : 22.8 M/s
zero bits : 33
[00:09:20] 12778995712 attempts (22,802,595.0243/s) Found!
use indicatif::{ProgressBar, ProgressStyle};
use rayon::prelude::*;
use sha2::{Digest, Sha512};
use std::sync::atomic::{AtomicBool, AtomicU64, Ordering};
use std::time::Instant;
const COMMIT_LAST8: &str = "eb366895";
const FIXED_NODE_SUFFIX: &str = "92f987b9";
fn make_uuid(i: u64) -> String {
let mut x = i;
// time_mid 16 bit
// time_high 12 bit
// variant_head 2 bit
// variant_tail 12 bit
// node_prefix 16 bit
// total 58 bit
let node_prefix = x & 0xFFFF;
x >>= 16;
let variant_tail = x & 0xFFF;
x >>= 12;
let variant_head = x & 0x3;
x >>= 2;
let time_high = x & 0xFFF;
x >>= 12;
let time_mid = x & 0xFFFF;
format!(
"{}-{:04x}-4{:03x}-{:x}{:03x}-{:04x}{}",
COMMIT_LAST8,
time_mid,
time_high,
8 + variant_head,
variant_tail,
node_prefix,
FIXED_NODE_SUFFIX
)
}
fn sha512_first_33_bits_zero(uuid: &str) -> bool {
let hash = Sha512::digest(uuid.as_bytes());
hash[0] == 0 && hash[1] == 0 && hash[2] == 0 && hash[3] == 0 && (hash[4] & 0x80) == 0
}
fn sanity_check() {
let u0 = make_uuid(0);
let u1 = make_uuid(1);
let u2 = make_uuid(1 << 16);
let u3 = make_uuid(1 << 28);
assert_eq!(u0, "eb366895-0000-4000-8000-000092f987b9");
assert_eq!(u1, "eb366895-0000-4000-8000-000192f987b9");
assert_eq!(u2, "eb366895-0000-4000-8001-000092f987b9");
assert_eq!(u3, "eb366895-0000-4000-9000-000092f987b9");
assert_ne!(u0, u1);
for u in [&u0, &u1, &u2, &u3] {
assert_eq!(&u[0..8], COMMIT_LAST8);
assert_eq!(&u[14..15], "4");
assert!(matches!(&u[19..20], "8" | "9" | "a" | "b"));
assert!(u.ends_with(FIXED_NODE_SUFFIX));
assert_eq!(u.len(), 36);
}
println!("Sanity check passed.");
println!("Example UUID: {}", u0);
println!(
"Example SHA512[:10]: {}",
hex::encode(&Sha512::digest(u0.as_bytes())[..10])
);
}
fn main() {
sanity_check();
println!("Threads: {}", rayon::current_num_threads());
let found = AtomicBool::new(false);
let attempts = AtomicU64::new(0);
let start = Instant::now();
let pb = ProgressBar::new_spinner();
pb.set_style(
ProgressStyle::default_spinner()
.template("{spinner:.green} [{elapsed_precise}] {pos} attempts ({per_sec}) {msg}")
.unwrap(),
);
let result = (0u64..u64::MAX).into_par_iter().find_any(|&i| {
if found.load(Ordering::Relaxed) {
return false;
}
let count = attempts.fetch_add(1, Ordering::Relaxed) + 1;
if count % (1 << 20) == 0 {
pb.set_position(count);
}
let uuid = make_uuid(i);
if sha512_first_33_bits_zero(&uuid) {
found.store(true, Ordering::Relaxed);
let hash = Sha512::digest(uuid.as_bytes());
let elapsed = start.elapsed();
let speed = count as f64 / elapsed.as_secs_f64() / 1e6;
println!();
println!("===== FOUND =====");
println!("UUID : {}", uuid);
println!("answer : /answer {}", uuid);
println!("hash[:10] : {}", hex::encode(&hash[..10]));
println!("attempts : {}", count);
println!("time : {:.2}s", elapsed.as_secs_f64());
println!("rate : {:.1} M/s", speed);
println!("zero bits : 33");
pb.finish_with_message("Found!");
return true;
}
false
});
if result.is_none() {
pb.finish_with_message("Not found in u64::MAX range");
}
}Me0wo@MainPC:~/D/s/brute_rs🤣👉 python3 -c "
import hashlib, uuid
u = 'eb366895-8000-4000-a0f5-0d1692f987b9'
print(f'UUID: {u}')
print(f'UUID length: {len(u)}')
parts = u.split('-')
print(f'Parts: {parts}')
print(f'First 8: {parts[0]}')
print(f'Last 8: {u[-8:]}')
print(f'Version char: {parts[2][0]}') # 4
print(f'Variant char: {parts[3][0]}') # 8/9/a/b
h = hashlib.sha512(u.encode()).digest()
print(f'SHA-512 hex: {h.hex()}')
print(f'First 4 bytes: {h[:4].hex()}')
print(f'5th byte: {h[4]:#010b}')
bits = ''.join(f'{b:08b}' for b in h[:5])[:33]
print(f'First 33 bits: {bits}')
"
UUID: eb366895-8000-4000-a0f5-0d1692f987b9
UUID length: 36
Parts: ['eb366895', '8000', '4000', 'a0f5', '0d1692f987b9']
First 8: eb366895
Last 8: 92f987b9
Version char: 4
Variant char: a
SHA-512 hex: 000000003eca27c526fa7bbb9cfcc4c3598bb45acb4678a45fd8821180bca500889f919b4e1d3df1aa128d75dad94639da8decfea81892df275eb0c348ca3e66
First 4 bytes: 00000000
5th byte: 0b00111110
First 33 bits: 000000000000000000000000000000000
Me0wo@MainPC:~/D/s/brute_rs🤣👉求指点错在哪里喵~ |
Replies: 18 comments 41 replies
|
我的也是不知道哪错了。。。后8位是0612e46a。 ✓ FOUND!
UUID: eb366895-ca14-4e5d-8700-00080612e46a
Counter: 36028799122293164
Time: 629.65 s
SHA-512: 0000000071931b619e29c83045cead8244db3d92927713e6654d5aa45fb8b7fd1896d82a6f2f6be877a575300c96ac3b0c4277d51da769908fb388d181b85910 |
|
793870b2-0037-4ab8-a373-6d8192f987b9 |
|
优质解答: 我也不知道 |
|
https://github.com/Sn0wo2/xray-qbrute 这是尝试通过commit hash计算UUID的代码喵 |
|
大佬,解决了吗 |
|
Cargo.toml src/main.rs |
|
只能说多尝试了 我都感觉是玄学 今天突然就过了😂😂😂
Juan-nikola ***@***.***> 于 2026年7月23日周四 16:25写道:
… 我也失败了,把脚本给了ai跑的...T_T
—
Reply to this email directly, view it on GitHub
<#6451?email_source=notifications&email_token=BE2YQGBYZWOKWNODTWQB2LD5GHDY7A5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCNZXGQ3TENBZUZZGKYLTN5XKOY3PNVWWK3TUUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y#discussioncomment-17747249>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BE2YQGAUJQDYFSEIPAD2JFL5GHDY7AVCNFSNUABIKJSXA33TNF2G64TZHMZTCMJTGE2TOMZRHNCGS43DOVZXG2LPNY5TCMBTHA4TSNBVUF3AE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
|
我好像今天不死心又跑了一次就过了
𝑴𝒆𝟎𝒘𝒐 ***@***.***> 于 2026年7月23日周四 16:53写道:
… 听信你的又跑了一次
===== FOUND =====
UUID : eb366895-6000-4000-82b0-4911ebac62b9
answer : /answer eb366895-6000-4000-82b0-4911ebac62b9hash[:10] : 00000000573fc2a71dee
attempts : 1099426694time : 50.42s
rate : 21.8 M/s
[00:00:50] [████████████████████████████████████████] 288230376151711744/288230376151711744 (5,703,722,837,016,910/s) Found!
/answer eb366895-6000-4000-82b0-4911ebac62b9
验证错误,3600 秒后可以重试。
果不其然,失败,看来是看人的,至少思路对了
—
Reply to this email directly, view it on GitHub
<#6451?email_source=notifications&email_token=BE2YQGCCE6275SPEM2YB7GD5GHG63A5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCNZXGQ3TEMJVUZZGKYLTN5XKOY3PNVWWK3TUUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y#discussioncomment-17747215>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BE2YQGF5EBCTFRDU54H6WTL5GHG63AVCNFSNUABIKJSXA33TNF2G64TZHMZTCMJTGE2TOMZRHNCGS43DOVZXG2LPNY5TCMBTHA4TSNBVUF3AE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
|
Gpt生成的go代码commit 感觉靠运气 看管理心情的 同样的commit就是过不了
Juan-nikola ***@***.***> 于 2026年7月23日周四 17:07写道:
… 大佬你是用什么跑的,有脚本文件吗?我怀疑是不是不能直接扔给ai让ai来...
—
Reply to this email directly, view it on GitHub
<#6451?email_source=notifications&email_token=BE2YQGB2SXRKUK5Y7HXHFKL5GHIUPA5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCNZXGQ3TONZUUZZGKYLTN5XKOY3PNVWWK3TUUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y#discussioncomment-17747774>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BE2YQGD4KTR5M77MQGKVJVT5GHIUPAVCNFSNUABIKJSXA33TNF2G64TZHMZTCMJTGE2TOMZRHNCGS43DOVZXG2LPNY5TCMBTHA4TSNBVUF3AE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
|
过了算法估计都一样就哪里出了问题 我是用2025年的commit 加上题目那个apls还是啥的能搜到 具体就不贴了
我发那个出来挨locked了具体就是可以通过对 就不懂是不是有运气成分
𝑴𝒆𝟎𝒘𝒐 ***@***.***> 于 2026年7月23日周四 17:14写道:
… Cargo.toml
[package]
name = "uuid_miner"
version = "0.1.0"
edition = "2021"
[dependencies]
sha2 = "0.10"
rand = "0.8"
rayon = "1.10"
[profile.release]
opt-level = 3
lto = true
codegen-units = 1
panic = "abort"
src/main.rs
use rand::Rng;
use rayon::prelude::*;
use sha2::{Digest, Sha512};
use std::sync::atomic::{AtomicBool, AtomicU64, Ordering};
use std::sync::Arc;
use std::time::Instant;
const PREFIX: &str = "eb366895"; // commit hash 后8位(固定)
const SUFFIX: &str = "12345678"; // 题目要求固定的末8位
const VARIANT_CHARS: [char; 4] = ['8', '9', 'a', 'b'];
const HEX: &[u8; 16] = b"0123456789abcdef";
#[inline]
fn random_hex(rng: &mut impl Rng, n: usize, out: &mut String) {
for _ in 0..n {
out.push(HEX[rng.gen_range(0..16)] as char);
}
}
/// 生成一个随机候选 UUID 字符串
fn build_uuid(rng: &mut impl Rng, buf: &mut String) {
buf.clear();
buf.push_str(PREFIX);
buf.push('-');
random_hex(rng, 4, buf); // segment 2
buf.push('-');
buf.push('4'); // UUID v4 版本位
random_hex(rng, 3, buf); // segment 3 剩余
buf.push('-');
buf.push(VARIANT_CHARS[rng.gen_range(0..4)]); // variant 位
random_hex(rng, 3, buf); // segment 4 剩余
buf.push('-');
random_hex(rng, 4, buf); // segment 5 前半(自由搜索部分)
buf.push_str(SUFFIX); // segment 5 固定后8位
}
/// 检查 SHA-512 摘要前 33 个 bit 是否全为 0
#[inline]
fn leading_33_bits_zero(hash: &[u8]) -> bool {
hash[0] == 0 && hash[1] == 0 && hash[2] == 0 && hash[3] == 0 && (hash[4] & 0b1000_0000) == 0
}
fn hex_encode(bytes: &[u8]) -> String {
let mut s = String::with_capacity(bytes.len() * 2);
for b in bytes {
s.push(HEX[(b >> 4) as usize] as char);
s.push(HEX[(b & 0xf) as usize] as char);
}
s
}
fn main() {
let num_threads = std::thread::available_parallelism()
.map(|n| n.get())
.unwrap_or(4);
println!("使用 {} 个线程开始搜索 (预计需要约 2^33 次尝试)...", num_threads);
let found = Arc::new(AtomicBool::new(false));
let total_tries = Arc::new(AtomicU64::new(0));
let start = Instant::now();
let result: Option<String> = (0..num_threads)
.into_par_iter()
.find_map_any(|_| {
let mut rng = rand::thread_rng();
let mut buf = String::with_capacity(36);
let mut local_count: u64 = 0;
loop {
if local_count % 200_000 == 0 && found.load(Ordering::Relaxed) {
return None;
}
build_uuid(&mut rng, &mut buf);
// 如果判定标准是"16字节二进制UUID"而不是字符串,
// 把下面这行换成先把 buf 解析成 16 字节再 hash。
let hash = Sha512::digest(buf.as_bytes());
local_count += 1;
if leading_33_bits_zero(&hash) {
found.store(true, Ordering::Relaxed);
total_tries.fetch_add(local_count, Ordering::Relaxed);
return Some(buf.clone());
}
if local_count % 20_000_000 == 0 {
let elapsed = start.elapsed().as_secs_f64();
let tot = total_tries.load(Ordering::Relaxed) + local_count;
println!(
"已尝试约 {} 亿次,耗时 {:.1}s,速度约 {:.1} M/s",
tot / 100_000_000,
elapsed,
tot as f64 / elapsed / 1_000_000.0
);
}
}
});
match result {
Some(uuid) => {
let hash = Sha512::digest(uuid.as_bytes());
println!("\n=== 找到啦 ===");
println!("UUID: {}", uuid);
println!("SHA-512: {}", hex_encode(&hash));
println!("耗时: {:.2}s", start.elapsed().as_secs_f64());
println!("\n发送: /answer {}", uuid);
}
None => println!("未找到(不应该发生)"),
}
}
算法似乎和我的差不多,那你通过了验证吗?
—
Reply to this email directly, view it on GitHub
<#6451?email_source=notifications&email_token=BE2YQGBF3FCG3SVGWIOQUDL5GHJORA5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCNZXGQ3DSOJVUZZGKYLTN5XKOY3PNVWWK3TUUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y#discussioncomment-17746995>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BE2YQGFSQQW7QEJ5E3ZWPKD5GHJORAVCNFSNUABIKJSXA33TNF2G64TZHMZTCMJTGE2TOMZRHNCGS43DOVZXG2LPNY5TCMBTHA4TSNBVUF3AE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
|
感谢 @megapro17 的思路解答
已搞定:
具体代码请参考 https://github.com/Sn0wo2/xray-qbrute 感谢各位的讨论。 |
|
谢谢楼主脚本,谢谢各位大佬的提醒,成功了 |
|
感谢楼主提供的带有硬件加速的脚本, |
|
根据上面几位的建议,给 双端进度条实现都参考了 #3 的泊松近似思路 Me0wo@MainPC:/d/r/xray-qbrute🤣👉 cargo run --release -- ebac62b9 --backend cuda
Finished `release` profile [optimized + debuginfo] target(s) in 0.29s
Running `target\release\xray-qbrute.exe ebac62b9 --backend cuda`
===== xray-qbrute =====
Threads: 24
COMMIT_LAST8: eb366895
NODE_SUFFIX: ebac62b9
Backend request: cuda
Range: [0x0, 0x400000000000000)
⠖ [00:00:24] [░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 28221151353/288230376151711744 (1,148,293,425.5835/s) Device: NVIDIA CUDA
Backend: cuda
Kernel: block=256, candidates/thread=32
===== FOUND =====
UUID : eb366895-0000-401a-921c-9878ebac62b9
answer : /answer eb366895-0000-401a-921c-9878ebac62b9
hash[:10] : 00000000025a63b4e760
processed : 28221151353 candidates
evaluated : 28454158336 candidates
time : 24.97s
rate : 1139.5 M/s
P(hit in range) : 96.3575%
expected (1 hit) : ~7.5s at current rate (1139.5 M/s)
[00:00:24] [░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 28221151353/288230376151711744 (1,130,164,151.0073/s) Found! Me0wo@MainPC:/d/r/xray-qbrute🤣👉 cargo run --release -- ebac62b9 --backend wgpu-vulkan
Finished `release` profile [optimized + debuginfo] target(s) in 0.27s
Running `target\release\xray-qbrute.exe ebac62b9 --backend wgpu-vulkan`
===== xray-qbrute =====
Threads: 24
COMMIT_LAST8: eb366895
NODE_SUFFIX: ebac62b9
Backend request: wgpu-vulkan
Range: [0x0, 0x400000000000000)
⠁ [00:00:33] [░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 28218846720/288230376151711744 (814,753,980.2542/s)
Device: NVIDIA GeForce RTX 4060 Laptop GPU
Backend: wgpu-vulkan
Kernel: workgroup=64, candidates/thread=8
GPU tuning: 0.29s
===== FOUND =====
UUID : eb366895-0000-401a-921c-9878ebac62b9
answer : /answer eb366895-0000-401a-921c-9878ebac62b9
hash[:10] : 00000000025a63b4e760
processed : 28221151353 candidates
evaluated : 28252400640 candidates
time : 34.00s
rate : 831.0 M/s
P(hit in range) : 96.2709%
expected (1 hit) : ~10.3s at current rate (831.0 M/s)
[00:00:34] [░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 28221151353/288230376151711744 (830,027,621.0276/s) Found! |
|
求助帖,我已经注意到现在进群题目从之前的后八位eb366895变为前8位90243a74,但是我利用cuda计算结果始终不正确,我用了https://github.com/Sn0wo2/xray-qbrute工具和ai双重帮我验证都不对。 |
感谢 @megapro17 的思路解答
已搞定:
具体代码请参考 https://github.com/Sn0wo2/xray-qbrute
如果帮到你的话点个Star~
感谢各位的讨论。