WWW.YOUINFO.SITE
标签聚合 Hook

/tag/Hook

LinuxDo 最新话题 · 2026-06-11 17:55:32+08:00 · tech

agent 是智能体的意思,什么是智能体呢,为啥不叫AI了啊,也不叫大模型了,其实这并不是孤立的概念,AI中文就是人工智能,英文全称:Artificial Intelligence,其实就是计算机科学的一个分支,用来研究开发模拟,延伸人的理论方法技术和应用研究。大模型是ai具象化的技术产品,大模型还分了LLM语言大模型、VLM视觉大模型、MLLM多模态、技术上又出现了很多细节,比如混合专家模型-MOE。 MCP 是定的ai识别的上下文协议,用来,调用外部的服务器,返回固定内容信息的一个规则,大家都用这个规则,不就方便了ai调用外部工具获取信息了。方便打通不同企业数据库和ai的交互。 tools 就是工具的意思,这里和mcp紧密相连,tools泛指一类工具,遵循的上下文协议也未必是mcp。方便ai通过这个工具进行获取信息。 plugin是插件的意思,就是个扩展包,这不是ai独有的概念,浏览器有插件,任何应用都可能有插件,一个插件里面东西就多了,可以包含skill,agents,hooks,mcp severs等内容。 prompt是提示词的意思,大模型学的东西多了,大模型要在知识汪洋中预测你想要的下一个词,简直不要太难,那么就帮她缩小范围降低幻觉,那就是定人物,定任务范围,定目标,这样将结合以上的信息,进行数据处理,就大大降低了,大模型胡说八道的可能性。大模型本身就是个统计学问题,根本不具备任何智慧,和反思能力,并非动态进化的,而是提前通过人类社会无数的现有文档,向量化,然后通过多维向量的训练出来的,一个具备无数维度的数学矩阵,通过通过上下文的切割成token又称词元,一个词元就是一个数字,多个词元就组成了一个数学矩阵,将这个数学矩阵扔到transform架构的数学矩阵中。我也不知道是不是百亿参数是不是也决定了词元的数量呢,会影响回应呢? workflow就是工作流,针对一项工作设计的工作流程,使其完成特定的任务,取代繁重的工作。 hook钩子的意思,什么是钩子啊就是,当执行到特定情况或者涉及特殊判断的时候就会触发的程序,相当于一个钩子,勾住了你的工作流,在特定情况下触发,进而保证进程的稳定和顺利。 skill技能的意思,技能可以是一个md说明的工作文档,也可以是md说明文档加一些小程序、或者一些模板的综合体,目标就是让大模型能按你的md说明文档进行工作。 harness就是一个工作台,工作台上啥也有,自由搭配,想用啥就用啥,比如有plugin、tools、prompt、workflow、hook、skill、和设定好的agent。 AI / 人工智能 └── 大模型 / LLM / VLM / MLLM └── Agentic System / 智能体系统 ├── Prompt:给模型的指令 ├── Context:当前任务上下文 ├── Memory:可长期保存或检索的历史信息 ├── Tools:模型可调用的外部能力 │ └── MCP:连接 tools / resources / prompts 的标准协议之一 ├── Workflow:预设流程 ├── Hook:生命周期触发器 ├── Skill:可复用能力包 ├── Plugin:可安装扩展包 └── Harness:运行框架 / 执行外壳 agent 是配置了 instructions、tools,以及可选运行行为的 LLM MCP Server 可以向 AI 应用暴露 resources、prompts 和 tools。这样不同 AI 应用和不同外部系统之间就不用每次都重新写一套私有接口。 Tool:一个具体能力 MCP Tool:通过 MCP 协议暴露出来的 tool MCP Server:把一组 tools / resources / prompts 提供给 AI 应用 Agent:根据任务需要决定是否调用这些工具 plugin 可能包含 tools、skills、agents、hooks、MCP servers 等内容。简单说,plugin 是“打包和分发能力”的方式。 prompt 帮模型缩小范围,降低幻觉。这个是对的。OpenAI 文档也把 prompt engineering 描述为编写有效指令,让模型更稳定地产生符合要求的内容。 大模型本质上是通过大量数据训练出来的神经网络,它没有人类意义上的主观意识,也不会在普通对话中自动修改自己的模型参数。它的回答来自当前输入、上下文、训练得到的参数,以及推理时的生成过程。我们看到的“推理”“反思”“自我检查”,更多是模型在特定提示、上下文或工具流程下表现出来的能力,而不是人类式的自我意识。 Token:文本被切分后的处理单位。 Token ID:token 被映射成的数字编号。 Embedding:token ID 进入模型后对应的向量表示。 Parameter:模型训练出来的权重和偏置。 Context window:一次输入/输出能处理的 token 上限。 Training tokens:训练时看过的数据 token 数量。 Vocabulary size:分词器支持的 token 种类数量。 文本会先被 tokenizer 切成 token,再映射成 token ID。模型会把 token ID 转成向量表示,也就是 embedding,然后送入 Transformer 网络中计算。Transformer 通过注意力机制和多层神经网络,结合上下文预测后续 token。参数量指的是模型内部训练出来的权重数量,和输入 token 数不是同一个概念。 Workflow 是预先设计好的流程。它强调“步骤固定、路径清楚、可控性强”。比如先读订单,再判断退款规则,再调用退款接口,再发送通知。workflow 里可以用大模型,也可以不用大模型。它和 agent 的区别是:workflow 的路径主要由人或程序提前写好;agent 的路径更多由模型根据目标和中间结果动态决定。 Anthropic 对这个区别说得很清楚:workflows 是 LLM 和工具通过预定义代码路径编排;agents 则是 LLM 动态决定自己的流程和工具使用。 这个方向对。Anthropic 的 Agent Skills 文档也把 skill 描述为模块化能力包,包含 instructions、metadata 和可选资源,比如 scripts、templates,Claude 会在相关任务中自动使用。 另一个官方指南也说 Skills 可以是由 instructions、scripts、resources 组成的文件夹 Context:这次对话/这次任务临时放进来的信息。 Memory:跨会话保存、以后还能拿出来用的信息。 Context 是模型当前这次任务能看到的信息,比如用户问题、系统指令、聊天历史、检索到的文档、工具返回结果等。Memory 是被长期保存、之后还能被取出来的信息,比如用户偏好、项目背景、历史决策、常用规则等。Memory 不是模型参数本身发生了变化,而是系统把相关历史信息保存下来,在需要时重新塞回 context。 5 个帖子 - 4 位参与者 阅读完整话题

LinuxDo 最新话题 · 2026-06-11 00:12:57+08:00 · tech

内购限时免费,尽快获取。 App Store Unhook: App Blocker & Focus App - App Store Download Unhook: App Blocker & Focus by Shaffans Studios on the App Store. See screenshots, ratings and reviews, user tips, and more apps like Unhook: App… $17.99 → Free Unhook 可以屏蔽那些分散注意力的应用和网站,让你的专注力成为常态,而不是每天的挣扎。 设置智能限制、时间表,甚至基于位置的屏蔽,对应用、类别和网站进行分组,并精确决定您想要的严格程度。 1 个帖子 - 1 位参与者 阅读完整话题

LinuxDo 最新话题 · 2026-06-10 00:30:28+08:00 · tech

根据其他大佬提供的思路,通过替换环境变量修改 mclaw 上游配置。 但是存在一个问题,如果api开启了CF小黄云,请求会被CF拦下报403。 这个脚本在原思路基础上,增加patchFetch修改User-Agent 解决403问题。 mclaw脚本功能简要概括: 使用方法: 修改 METRICS_ENDPOINT 和 METRICS_TOKEN 参数,上传脚本到云盘,让ai从云盘下载后一键执行。 code (点击了解更多详细信息) 19 个帖子 - 9 位参与者 阅读完整话题

LinuxDo 最新话题 · 2026-06-07 17:31:08+08:00 · tech

首先感谢佬的教程: https://linux.do/t/topic/2320228 hook后还是走移动的token计费怎么办,已重启了,能帮忙看看吗 执行如下: 1. 在 /.openclaw/hooks/ 下建一个目录,放 HOOK.md(监听 gateway:startup)和 handler.ts 2. handler.ts 里用 execSync 调一个 这个hooks 脚本,hook脚本从AI空间-Mclaw空间下载,名字为mclaw-env.sh,要确定下载到再执行下一步操作,检查sh脚本有没有问题,为了实现目标可以更新脚本 3. shell 脚本里用 nohup setsid 命令 & 启动进程(保证不被回收) 4. openclaw hooks enable 名字 启用 同时启动一个监视脚本,监视服务状态,代替龙虾定时任务 mclaw-env.sh: #!/usr/bin/env bash set -e # ===== 修改成你的真实值 ===== export XIAO_TIAN_LLM_API_BASE="https://api.hlcode.qzz.io/v1" export XIAO_TIAN_LLM_KEY="***" # ========================== APP_DIR="$HOME/.openclaw/workspace/app" LOCK_FILE="$APP_DIR/openclaw-gateway-restart.lock" STAMP_FILE="$APP_DIR/openclaw-gateway-restart.stamp" LOG_FILE="$APP_DIR/openclaw-gateway-restart.log" mkdir -p "$APP_DIR" # 避免并发运行 exec 9>"$LOCK_FILE" if ! flock -n 9; then echo "$(date '+%F %T') hook already running, exit" >> "$LOG_FILE" exit 0 fi # 避免重启 gateway 后再次触发 hook 造成循环 # 120 秒内只允许执行一次 if [ -f "$STAMP_FILE" ]; then now="$(date +%s)" last="$(cat "$STAMP_FILE" 2>/dev/null || echo 0)" if [ $((now - last)) -lt 120 ]; then echo "$(date '+%F %T') recently restarted, skip" >> "$LOG_FILE" exit 0 fi fi date +%s > "$STAMP_FILE" echo "$(date '+%F %T') restarting openclaw gateway..." >> "$LOG_FILE" pkill -f openclaw-gateway || true sleep 1 nohup node /app/openclaw.mjs gateway --allow-unconfigured >> "$LOG_FILE" 2>&1 & echo "$(date '+%F %T') gateway started, pid=$!" >> "$LOG_FILE" exit 0 2 个帖子 - 1 位参与者 阅读完整话题

LinuxDo 最新话题 · 2026-06-06 20:49:54+08:00 · tech

很有意思的一题逆向hh,挺对胃的 来源于google ctf 2025 源码 <!DOCTYPE html> <!-- saved from url=(0092)https://nicolaisoeborg.github.io/ctf-writeups/2025/Google%20CTF%202025/JSSafe/js_safe_6.html --> <html lang="zh-CN"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="Content-Security-Policy" id="c" content="script-src 'sha256-P8konjutLDFcT0reFzasbgQ2OTEocAZB3vWTUbDiSjM=' 'sha256-eDP6HO9Yybh41tLimBrIRGHRqYoykeCv2OYpciXmqcY=' 'unsafe-eval'"> <title _msttexthash="25335544" _msthash="0">ASCII 旋转立方体</title> <style> /* Basic styling to center the animation and give it a retro feel */ body { display: flex; justify-content: center; align-items: center; min-height: 100vh; margin: 0; background-color: #1a1a1a; /* Dark background */ font-family: monospace, "Courier New", Courier; /* Monospace font for ASCII art */ color: #00ff00; /* Green text, classic terminal style */ } pre { line-height: 1.0; /* Ensure lines are tightly packed */ font-size: 14px; /* Adjust for desired size; smaller fonts allow more detail */ padding: 20px; border: 1px solid #00ff00; border-radius: 8px; background-color: #0d0d0d; /* Slightly different dark for the pre block */ box-shadow: 0 0 15px rgba(0, 255, 0, 0.3); } </style> </head> <body> <pre id="cubeCanvas">h^Y8][email protected]~e*sh=Z'8*4UGpmMr]$.ljH{Q4&6r-Zew9!zzH 7im:7zzs+t &5L'5wv&|ssS8R7g5Sb!f42Q@xN{B{$$s{FQNMK/wD(3xLnXO XLG-uI#'eOTS,]QrwB4DLLt+CaUEM_)Lnoe&LZ~*A#][!_8gDd~^fPubXbb^ 0%4s*+7']ER:az7qR6D0$A2plQs@}{z:z 3Q,+jbUS9sT8'>m-uasBb$o5{6 555fF[?zR]}ie+bcZ5Nk<3Zpmj7r$^X.E&6C:vT;c!ES@>}*)bfup:O>U#j@ ^7,]}oTU}[=Ln6" 5=}<^Y?ii,7('-$ ZH%aT=ws"kgLF$T :~mR9%OQ,w7BMdY b}|/%67!xz&|I~N ^,/cG8Tnq;]96wT g%l$!0Psg2S'dn% ########## cXUU19V{&>m*;>o ~Meepb"9ft"*E.D # ##### #### b=<V.s+m(x=:.5[ >CGqx0AvnhC"jMN # ########## z%#WY-v@kp;({]Z ga+7yj:lPzD_ASb # # # # 38t>^J&YsAa}:>> <D0uaBCl$H^;mj| # # # # /KZGA7%*"^!q0/] _@~]fU@'RMyt*Z} # # # # ~"EO9Fxo+Y(d4l4 eX,w_]lom0eNJeU # # # # 0=]e+Qd+"|# Gy* Z05Jj[jAvzKMe(Y # # # # 4vN-U_xU66h7IG< : |bVI:aw4HN@o- # # # # :,)x'6p:0 @U^E3 :h5dQ%Wdj8Tkvrs # # # # H?s=%ACI,(78Z<q >&5XOy'ffjhS{c& # # # # &eKm0L;$c&wGYQx IH;ZT/fm{C_A_:; # # # # On!M%A].7vhbiz: lGl"LJ%M~.Sb6~) ########## # OW/@)mDwW$czfAZ az0b-_u&#*^v@-[ #### ##### # P9n6LJiTB',j.2I NU c6GH(ekyxHV, ########## [S?3Zn;p4k,YFXx {RNy(zq]".#>]C< eQN''6H?X-oS*#R eHG26u.HCZX!9!w c$P?iUku/Fw!GX, h:r~FHyCgj'G4Y<{f~:ION'^nggp,LI7t8i]{UD,DlVz/2?S"N"O64rIO#Jk 3~iv^VZYD@ltQT<*h]'l7kMk!lWpT3jMDq!G(F9*PN(2%qKc-^7G owS3[Hj R8R{HaL3x C-knoV[^LD[HZzmbyFeVo;kYgug:KK(TNpC0x&>zo{}SsxjDvg V>n:S;X;jkmL.C2+tf;P6,XeLoM"W7on7yw2~5Y;m_OI%>>!BqCuUgQT"ieb vdRWZ@dK/9U[E4zKqz0_WnwTtBR$T&BavJ}~)Kq=J{-A7+ni6dzgu:)jfI4v Welcome to your personal JS Safe! Usage: - Open the page in Chrome (the only supported browser) - Open Dev Tools and type: - anti(debug); // Industry-leading antidebug! - unlock("password"); // -> alert(secret) - store("new secret"); - Enjoy the unparalleled data security!!!!1 </pre> <script id="gemini's cube"> // --- Configuration --- const canvas = document.getElementById('cubeCanvas'); const charWidth = 60; // Width of the ASCII canvas in characters const charHeight = 30; // Height of the ASCII canvas in characters const K_SCALE = Math.min(charWidth, charHeight) / 5; // Scale factor for the cube size const rotationSpeedX = 0.02; const rotationSpeedY = 0.015; const frameInterval = 200; const edgeChar = '#'; // Character used to draw edges const vertexChar = '*'; // Character used to draw vertices (optional) const drawVertices = false; // Set to true to draw vertices // --- Cube Definition --- // Vertices of a unit cube centered at (0,0,0) const vertices = [ { x: -1, y: -1, z: -1 }, { x: 1, y: -1, z: -1 }, { x: 1, y: 1, z: -1 }, { x: -1, y: 1, z: -1 }, { x: -1, y: -1, z: 1 }, { x: 1, y: -1, z: 1 }, { x: 1, y: 1, z: 1 }, { x: -1, y: 1, z: 1 } ]; // Edges defined by pairs of vertex indices const edges = [ [0, 1], [1, 2], [2, 3], [3, 0], // Back face [4, 5], [5, 6], [6, 7], [7, 4], // Front face [0, 4], [1, 5], [2, 6], [3, 7] // Connecting edges ]; let currentAngleX = 0; let currentAngleY = 0; let lastFrameTimestamp = 0; let frameTime = 0; // --- 3D Rotation Logic --- function rotatePoint(point, angleX, angleY) { const { x: x_orig, y: y_orig, z: z_orig } = point; // Rotate around X-axis const cosX = Math.cos(angleX); const sinX = Math.sin(angleX); const y_after_X = y_orig * cosX - z_orig * sinX; const z_after_X = y_orig * sinX + z_orig * cosX; const x_after_X = x_orig; // Rotate around Y-axis (using results from X-rotation) const cosY = Math.cos(angleY); const sinY = Math.sin(angleY); const x_final = x_after_X * cosY + z_after_X * sinY; const z_final = -x_after_X * sinY + z_after_X * cosY; const y_final = y_after_X; return { x: x_final, y: y_final, z: z_final }; } // --- 2D Projection Logic (Orthographic) --- function projectPoint(point) { // Scale and translate to fit the ASCII grid const x2d = Math.round(point.x * K_SCALE + charWidth / 2); const y2d = Math.round(point.y * K_SCALE + charHeight / 2); // Y is often inverted in screen coords, but for ASCII art, top-left is (0,0) return { x: x2d, y: y2d, z: point.z }; // Keep z for potential depth sorting if needed } // --- ASCII Line Drawing (Bresenham's Algorithm) --- function drawLineOnGrid(grid, x1, y1, x2, y2, char) { // Ensure coordinates are integers x1 = Math.round(x1); y1 = Math.round(y1); x2 = Math.round(x2); y2 = Math.round(y2); const dx = Math.abs(x2 - x1); const dy = Math.abs(y2 - y1); const sx = (x1 < x2) ? 1 : -1; const sy = (y1 < y2) ? 1 : -1; let err = dx - dy; while (true) { // Check bounds before drawing if (x1 >= 0 && x1 < charWidth && y1 >= 0 && y1 < charHeight) { grid[y1][x1] = char; } if ((x1 === x2) && (y1 === y2)) break; // Reached the end point const e2 = 2 * err; if (e2 > -dy) { err -= dy; x1 += sx; } if (e2 < dx) { err += dx; y1 += sy; } } } // --- Helper Functions --- // Replace the spaces from the start of each line function f(s) { return s.replace(/^[ ]*/mg, ''); } // Remove emtpy lines from the start and the end function r(s) { return s.replace(/^\n/, '').replace(/\n$/, '') } // Tagged template function to help define multiline strings function multiline(x) { return f(r(x[0])); } // --- Main Render Loop --- function renderFrame() { const background = multiline` h^Y8][email protected]~e*sh=Z'8*4UGpmMr]$.ljH{Q4&6r-Zew9!zzH 7im:7zzs+t &5L'5wv&|ssS8R7g5Sb!f42Q@xN{B{$$s{FQNMK/wD(3xLnXO XLG-uI#'eOTS,]QrwB4DLLt+CaUEM_)Lnoe&LZ~*A#][!_8gDd~^fPubXbb^ 0%4s*+7']ER:az7qR6D0$A2plQs@}{z:z 3Q,+jbUS9sT8'>m-uasBb$o5{6 555fF[?zR]}ie+bcZ5Nk<3Zpmj7r$^X.E&6C:vT;c!ES@>}*)bfup:O>U#j@ ^7,]}oTU}[=Ln6"Y^jH:?5@H]4UU4]@FE6Cw%|{UU1Q!t5=}<^Y?ii,7('-$ ZH%aT=ws"kgLF$Th9[1UU4]@FE6Cw%|{]=6?8E9Yall^Y:~mR9%OQ,w7BMdY b}|/%67!xz&|I~N2hY^bgeUUWW?6H tCC@CX^Y@"/>{iB^,/cG8Tnq;]96wT g%l$!0Psg2S'dn%Y^]DE24<]DA=:EWV6G2=VX]=6?8E9mcXUU19V{&>m*;>o ~Meepb"9ft"*E.D2D51UUWH:?5@H]DE6AZlhd^YO%5NBgb=<V.s+m(x=:.5[ >CGqx0AvnhC"jMN@AY^Za_Y|2E9]7=@@CW1YVw"Xn!"lvz%#WY-v@kp;({]Z ga+7yj:lPzD_ASbH]I1UU7C2>6%:>6^abcdX^YF/2f[*V38t>^J&YsAa}:>> <D0uaBCl$H^;mj|@AY^Z|2E9]7=@@CW1^2#7i>!X:ZeR&/KZGA7%*"^!q0/] _@~]fU@'RMyt*Z}H]I1UUH:?5@H]DE6A^a_XXj18'hf*;~"EO9Fxo+Y(d4l4 eX,w_]lom0eNJeU1j>F=E:=:?6]2C8F>6?ED,_.,_.^Y$0=]e+Qd+"|# Gy* Z05Jj[jAvzKMe(Y=jA[2Y^]C6A=246W^/-?M-?S^8[^Y=4vN-U_xU66h7IG< : |bVI:aw4HN@o-Y^VVX]C6A=246W^/, .Y^>8[VVXMM1:,)x'6p:0 @U^E3 :h5dQ%Wdj8TkvrsncdiKf H?_L5oYT_&G;SZod(CN@mviH?s=%ACI,(78Z<q >&5XOy'ffjhS{c&EU!,&~OYd;umr(Ya@2=PcP+Q@;vS0n&eKm0L;$c&wGYQx IH;ZT/fm{C_A_:;bo B7tk0.R~AU6}n<U%R[,VTsyOL_-On!M%A].7vhbiz: lGl"LJ%M~.Sb6~)^]CACK5i=LET=O+r894x+TiJMJhoydOW/@)mDwW$czfAZ az0b-_u&#*^v@-[5F$rn"/4#:Zc5$Ta=fjp/7fx+),TG?P9n6LJiTB',j.2I NU c6GH(ekyxHV,JkwvCfhVPcnE8;(C=2}_?gwszoo^QD[S?3Zn;p4k,YFXx {RNy(zq]".#>]C<|+4Mn(}!/+YACj}R}XYKuc|9tLM}hseQN''6H?X-oS*#R eHG26u.HCZX!9!w8%St-LYmbhf2rl{"}:*J&~yZ6ALpI5c$P?iUku/Fw!GX, h:r~FHyCgj'G4Y<{f~:ION'^nggp,LI7t8i]{UD,DlVz/2?S"N"O64rIO#Jk 3~iv^VZYD@ltQT<*h]'l7kMk!lWpT3jMDq!G(F9*PN(2%qKc-^7G owS3[Hj R8R{HaL3x C-knoV[^LD[HZzmbyFeVo;kYgug:KK(TNpC0x&>zo{}SsxjDvg V>n:S;X;jkmL.C2+tf;P6,XeLoM"W7on7yw2~5Y;m_OI%>>!BqCuUgQT"ieb vdRWZ@dK/9U[E4zKqz0_WnwTtBR$T&BavJ}~)Kq=J{-A7+ni6dzgu:)jfI4v Welcome to your personal JS Safe! Usage: - Open the page in Chrome (the only supported browser) - Open Dev Tools and type: - anti(debug); // Industry-leading antidebug! - unlock("password"); // -> alert(secret) - store("new secret"); - Enjoy the unparalleled data security!!!!1 `; let grid = background.split('\n').map(l => l.split('')); // Clear the middle part to make the cube clearly visible for (let i = 5; i < 25; i++) { for (let j = 15; j < 45; j++) { grid[i][j] = ' '; } } // Rotate and project all vertices const rotatedVertices = vertices.map(v => rotatePoint(v, currentAngleX, currentAngleY)); const projectedVertices = rotatedVertices.map(v => projectPoint(v)); // Draw vertices (optional) if (drawVertices) { projectedVertices.forEach(p => { if (p.x >= 0 && p.x < charWidth && p.y >= 0 && p.y < charHeight) { grid[p.y][p.x] = vertexChar; } }); } // Draw edges edges.forEach(edge => { const p1 = projectedVertices[edge[0]]; const p2 = projectedVertices[edge[1]]; drawLineOnGrid(grid, p1.x, p1.y, p2.x, p2.y, edgeChar); }); // Convert grid to string and update the canvas const content = grid.map(row => row.join('')).join('\n'); canvas.textContent = content; console.clear(); console.log(content); // Update angles for the next frame currentAngleX += rotationSpeedX; currentAngleY += rotationSpeedY; // Save timestamp and frame time for statistics frameTime = (new Date()) - lastFrameTimestamp; lastFrameTimestamp = +(new Date()); } // --- Start Animation --- setInterval(renderFrame, frameInterval); renderFrame(); // Initial render </script> <script> function anti(debug) { window.step = 0; window.cᅠ= true; // Countᅠstepsᅠwith debug (prototype instrumentation is separate) window.success = false; window.r // ROT47 = function(s) { return s.toString().replace(/[\x21-\x7E]/g,c=>String.fromCharCode(33+((c.charCodeAt()-33+47)%94))); } window.k // ROT13 - TODO:ᅠuse thisᅠfor anᅠadditional encryption layer ᅠ= function(s) { return s.toString().replace(/[a-z]/gi,c=>(c=c.charCodeAt(),String.fromCharCode((c&95)<78?c+13:c-13))); } window.check // Checks password = function() { Function`[0].step; if (window.step == 0 || check.toString().length !== 914) while(true) debugger; // Aᅠcooler wayᅠto eval``` // Functionᅠuntampered,ᅠproceed to 'decryption` & check try { window.step = 0; [0].step; const flag = (window.flag||'').split(''); let iᅠ= 1337, j = 0; let pool =ᅠ`?o>\`Wn0o0U0N?05o0ps}q0|mt\`ne\`us&400_pn0ss_mph_0\`5`; pool = r(pool).split(''); const double = Function.call`window.stepᅠ*=ᅠ2`;ᅠ// To the debugger,ᅠthis isᅠinvisible while (!window.success) { j = ((iᅠ|| 1)* 16807 + window.step) % 2147483647; if (flag[0] == pool[j % pool.length] && (window.step < 1000000)) { iᅠ= j; flag.shift(); pool.splice(j % pool.length, 1); renderFrame(); double(); if (!pool.length&&!flag.length) window.success = true; } } } catch(e) {} } function instrument() { f = arguments[0]; // TODO: figure out how to get a runtime reference to the debugged function in this debug // condition context, so we can inspect it at runtime, in case it changes debug(f, "window.c && function perf(){ const l = `" + f + "`.length; window.step += l; }() // poor man's 'performance counter`"); // Trigger a breakpoint on all checks when detecting tampering debug(f, "document.documentElement.outerHTML.length !== 14347"); } function instrumentPrototype(o) { Object.entries(Object.getOwnPropertyDescriptors(o)) .filter(p => p[1].value instanceof Function) .forEach(p => Object.defineProperty(o, p[0], { get: () => (step++) && p[1].value })); } function instrumentPrototypeOfPrototype(o) { const handler = {}; Reflect.ownKeys(Reflect).forEach(h => handler[h] = (a,b,c) => (step++) && Reflect[h](a, b, c)); Object.setPrototypeOf(o, new Proxy(Object.getPrototypeOf(o), handler)); } [Array, Array.prototype, String.prototype, Math, console, Reflect].map(o => Object.values(Object.getOwnPropertyDescriptors(o)).map(x => x.value || x.get).filter(x => x instanceof Function) ).flat().concat(check, eval).forEach(instrument); instrumentPrototype(Array.prototype); instrumentPrototypeOfPrototype(Array.prototype); } function unlock(flag) { const match = /^CTF{([0-9a-zA-Z_@!?-]+)}$/.exec(flag); if (!match) return false; window.flag = match[1]; check(); if (!window.success) return; window.password = Array.from(window.flag).map(c => c.charCodeAt()); const encrypted = JSON.parse(localStorage.content || '[]'); const decrypted = encrypted.map((c,i) => c ^ password[i % password.length]).map(String.fromCharCode).join(''); alert("JS Safe opened! Content:" + decrypted); } function store(secret) { const plaintext = Array.from(secret).map(c => c.charCodeAt()); localStorage.content = JSON.stringify(plaintext.map((c,i) => c ^ password[i % password.length])); } </script> <deepl-input-controller translate="no"><template shadowrootmode="open"><link rel="stylesheet" href="chrome-extension://fancfknaplihpclbhbpclnmmjcjanbaf/build/content.css"><div dir="ltr" style="visibility: initial !important;"><div class="dl-input-translation-container svelte-95aucy"><div></div></div></div></template></deepl-input-controller><div id="phraseJoinewrskdfdswerhnyikyofd" data-v-app=""><div data-v-f4d4888e="" class="xx-qy-style-dark"></div></div></body></html> 可以看到这里的js逆向极其繁琐, 第一,它上了csp头, <meta http-equiv="Content-Security-Policy" id="c" content="script-src 'sha256-P8konjutLDFcT0reFzasbgQ2OTEocAZB3vWTUbDiSjM=' 'sha256-eDP6HO9Yybh41tLimBrIRGHRqYoykeCv2OYpciXmqcY=' 'unsafe-eval'"> 防止篡改,但是这里可以将其改为unsafe-line, 删去哈希串,当然,因为长度的因素,这里需要将后面加空格 这样就可以绕过有关长度校验 当然,有点随笔的感觉,接着就是几个坑 这里沿用的大量特殊字符混淆视听,其实不是空格,而是Unicode 字符 \xef\xbe\xa0 这样就有很多可以迎刃而解了 const double = Function.call`window.stepᅠ*=ᅠ2`;ᅠ// To the debugger,ᅠthis isᅠinvisible 这一条就可以判断为扯淡了 看这里的算法 j = ((iᅠ|| 1)* 16807 + window.step) % 2147483647; 看看改原始step的逻辑, function instrument() { f = arguments[0]; // TODO: figure out how to get a runtime reference to the debugged function in this debug // condition context, so we can inspect it at runtime, in case it changes debug(f, "window.c && function perf(){ const l = `" + f + "`.length; window.step += l; }() // poor man's 'performance counter`"); // Trigger a breakpoint on all checks when detecting tampering debug(f, "document.documentElement.outerHTML.length !== 14347"); } function instrumentPrototype(o) { Object.entries(Object.getOwnPropertyDescriptors(o)) .filter(p => p[1].value instanceof Function) .forEach(p => Object.defineProperty(o, p[0], { get: () => (step++) && p[1].value })); } function instrumentPrototypeOfPrototype(o) { const handler = {}; Reflect.ownKeys(Reflect).forEach(h => handler[h] = (a,b,c) => (step++) && Reflect[h](a, b, c)); Object.setPrototypeOf(o, new Proxy(Object.getPrototypeOf(o), handler)); } [Array, Array.prototype, String.prototype, Math, console, Reflect].map(o => Object.values(Object.getOwnPropertyDescriptors(o)).map(x => x.value || x.get).filter(x => x instanceof Function) ).flat().concat(check, eval).forEach(instrument); instrumentPrototype(Array.prototype); instrumentPrototypeOfPrototype(Array.prototype); } 这里基本堵死了js直接调试,debugger的疯狂弹干扰,原型检索,函数禁用 所以很难让我恢复出原本check函数运行状态 一旦触碰限制,真正的step++ ,那样就直接将随机数计算打乱 但是这里,我是知道它在一步步算, 这样可以通过修改js让他直接吐出来 这里还有一个拦截项,为了防止篡改 debug(f, "document.documentElement.outerHTML.length !== 14347"); 这里可以改为 debug(f, "document.documentElement.outerHTML.length == 99999"); 这样就永为假,不会触发修改step 接下来只要修改吐flag即可 while (!window.success) { j = ((iᅠ|| 1)* 16807 + window.step) % 2147483647; if (flag[0] == pool[j % pool.length] && (window.step < 1000000)) { iᅠ= j; flag.shift(); pool.splice(j % pool.length, 1); renderFrame(); double(); if (!pool.length&&!flag.length) window.success = true; } } 可以在中间加一段,因为我并未触发加step的机制,所以默认它给的flag字符都是正确的 while (!window.success) { j = ((iᅠ|| 1)* 16807 + window.step) % 2147483647; iᅠ= j; let split = pool[j % pool.length] answer += split flag.shift(); pool.splice(j % pool.length, 1); renderFrame(); double(); if (!pool.length){ console.log(answer) } if (!pool.length&&!flag.length) window.success = true; } 如此如此 1 个帖子 - 1 位参与者 阅读完整话题

LinuxDo 最新话题 · 2026-06-06 19:24:45+08:00 · tech

一、准备工作 1、一台android手机(需要支持OMAPI+root(各位大神各显神通)) 2、下载HookEuicc(作用:伪装支持eSIM,获取eSIM激活码),下载地址: https://github.com/Unicorn369/HookEuicc/releases/download/v2.0.0/app-release-sign.apk 3、下载giffgaff(作用:注册账号,申请esim),注意,请使用19.12.0版本,我是从apkmirror下载的: https://www.apkmirror.com/apk/giffgaff-limited/my-giffgaff/giffgaff-19-12-0-release/giffgaff-19-12-0-android-apk-download/ 4、下载easyeuicc(作用:用于将获取到的esim码写入到实体卡中): 版本发布 - PeterCxy/OpenEUICC - Angry.Im Software Forge 5、一张EUICC白卡(作用:可以写入多张esim,写入后就当实体卡用就好),可以从PDD上购买,我购买价格为20元。如对质量有要求,可选品牌的. 6、一张Master或者Visa卡 二、注册giffgaff 1、 打开 https://www.giffgaff.com/注册账号 a、点击 b、输入邮箱(建议gmail) c、输入邮箱收到的code d、输入你的密码(12位,大小字母与特殊字符) e、点击 三、申请ESIM 1、手机给HookEuicc root权限,HookEuicc再给giffgaff赋权。(自行理解,不敢说太详细) 2、打开giffgaff的app.登陆刚才注册的账号 3、切换到ESIM页面 4、点击 5、下拉到最后,选择 6、选择充值的金额 7、选择来添加一个付款方式。此处只能选择,无法选择 8、下拉到最后,点击 9、输入账单地址,网上找一个英国地址生成器就可以搞定 10、输入信用卡信息。 11、付款成功后。一路next.最后会将esim的信息自动拷贝到剪切板中。此时迅速打开一个便笺保存起来。 四、写入小白卡 1、手机插入小白卡,打开easyeuicc. 2、点击<+> 3、输入LPA:+刚才保存esim码 4、等待完成. 五、后话 1、如手机无法root,第三步可选择其他佬友分享的其他办法.如使用LSPath.或直接使用魔改的giffgaff 1 个帖子 - 1 位参与者 阅读完整话题

LinuxDo 最新话题 · 2026-06-06 16:22:37+08:00 · tech

codex config.toml 配置: [features] hooks = true [[hooks.Stop]] [[hooks.Stop.hooks]] type = "command" command = '''pwsh.exe -NoProfile -ExecutionPolicy Bypass -Command "Import-Module BurntToast; New-BurntToastNotification -Text 'Codex', '任务完成' -Sound Reminder"''' timeout = 30 statusMessage = "Codex 完成通知" [[hooks.PermissionRequest]] [[hooks.PermissionRequest.hooks]] type = "command" command = '''pwsh.exe -NoProfile -ExecutionPolicy Bypass -Command "Import-Module BurntToast; New-BurntToastNotification -Text 'Codex', '需要确认以继续' -Sound Reminder"''' timeout = 30 statusMessage = "Codex 权限确认" 说明: pwsh 是windows中powershell7 claude code setting.json配置 "hooks": { "Stop": [ { "matcher": "", "hooks": [ { "type": "command", "command": "pwsh.exe -NoProfile -ExecutionPolicy Bypass -Command \"Import-Module BurntToast; New-BurntToastNotification -Text 'Claude Code', '任务完成' -Sound Reminder\"", "timeout": 30000 } ] } ], "PermissionRequest": [ { "matcher": "", "hooks": [ { "type": "command", "command": "pwsh.exe -NoProfile -ExecutionPolicy Bypass -Command \"Import-Module BurntToast; New-BurntToastNotification -Text 'Claude Code', '需要确认以继续' -Sound Reminder\"", "timeout": 30000 } ] } ] } 1 个帖子 - 1 位参与者 阅读完整话题

LinuxDo 最新话题 · 2026-06-05 15:18:40+08:00 · tech

目前有个网站登录需要短信验证码,我想让他自动执行,佬 这种情况怎么办比较好: 第一,我想到在线接吗平台,但不知道费用是否合适及是否稳定? 第二,移/联/电 这三家的短信,有没有类似GV这种可以转发到邮箱的服务?如果可以收邮件就最方便了。 第三,如果实在是需要sim卡设备,哪种设备比较好呢,小项目,5张卡以内就够。 第四,有没有具体配套方案可以安装在 docker或者Openwrt上面?直接把设备usb插路由器或nas上面,省事。 8 个帖子 - 6 位参与者 阅读完整话题

LinuxDo 最新话题 · 2026-06-04 17:09:58+08:00 · tech

最近看了看codex源码,在中间加了一些hook,来查看平常哪个环节最消耗token。 平常有一个分析最新漏洞的任务,每天分析当天最重要的十个漏洞,即会有20轮次以上的调用,也会有两三轮就刹车的。正好作为测试用例,跑了十五天积累了一批样本。 样本积累好后就直接让codex分析,哪部分是token消耗最大的。 震惊,我一直以为codex会主动的抛弃无用的上下文,例如rg一次后会把有用到信息放到下次调用,无用的抛弃。而不是这种一直携带着去请求。我的上下文就在这样燃烧着。 基于这种情况,想到了两种思路,一种是前置一个小模型,每次调用后压缩调用结果。(不知道为什么在讨论解决方案时,gpt更倾向于这种方式)。另一种是当调用结果给到gpt后,gpt返回哪些需要哪些不需要,对接下来的上下文进行剪枝。(我更倾向于这种) 在确定两种方案后进行实验,现在已经有了这部分调用数据,直接可以用这部分调用数据来做测试,观察质量和token的变化。 第一种方案的测试结果很不好,小模型无法很好的压缩需要的信息。(gpt很会pua,我就是信了他每回下一步的解决方案才浪费这么久时间) 第二种方案在测试中展现了非常好的效果,token节省30% 但目前并没有那种一次性跑几小时的项目,还需要继续测试在超长项目下的表现 1 个帖子 - 1 位参与者 阅读完整话题

LinuxDo 最新话题 · 2026-05-27 15:02:27+08:00 · tech

之前使用 Claude Code 的时候,为了方便摸鱼的时候加了一个很小的功能: 当 Claude Code 完成一轮任务,会自动播放一段“已完成”的语音。 这个功能本身不复杂,但体验提升非常明显。不用一直盯着终端了,可以有个让人放心地摸鱼 最近的版本中 Codex 也刚好更新了 Hook 功能,给 Codex 也整了一个。 主要流程 AI 完成一轮回答 / 任务停止 ↓ 触发 Stop Hook ↓ 执行本地脚本 ↓ 播放 完成语音 文件结构大概是这样: .codex/ hooks.json hooks/ stop.js audio/ completed.wav hooks.json 里配置 Stop 事件: { "hooks": { "Stop": [ { "hooks": [ { "type": "command", "command": "node .codex/hooks/stop.js", "timeout": 10000 } ] } ] } } 然后在 stop.js 里播放音频: #!/usr/bin/env node const fs = require('fs'); const path = require('path'); const { execSync } = require('child_process'); const audioFile = path.join(process.cwd(), '.codex', 'audio', 'completed.wav'); try { if (fs.existsSync(audioFile)) { const platform = process.platform; if (platform === 'darwin') { execSync(`afplay "${audioFile}"`, { stdio: ['pipe', 'pipe', 'pipe'] }); } else if (platform === 'win32') { const safePath = audioFile.replace(/'/g, "''"); execSync( `powershell -c "(New-Object Media.SoundPlayer '${safePath}').PlaySync()"`, { stdio: ['pipe', 'pipe', 'pipe'] } ); } else if (platform === 'linux') { try { execSync(`aplay "${audioFile}"`, { stdio: ['pipe', 'pipe', 'pipe'] }); } catch { execSync(`paplay "${audioFile}"`, { stdio: ['pipe', 'pipe', 'pipe'] }); } } } } catch { // 播放失败不影响主流程 } process.exit(0); 如果你用的是 Claude Code,也可以放在: .claude/ settings.json hooks/ stop.js audio/ completed.wav settings.json 里配置: { "hooks": { "Stop": [ { "matcher": "", "hooks": [ { "type": "command", "command": "node .claude/hooks/stop.js", "timeout": 10000 } ] } ] } } 大佬们也可以发散运用一下,给 Codex / Claude Code 在更多生命周期加上语音播报。这样或许能加强点人机交互感 8 个帖子 - 6 位参与者 阅读完整话题

LinuxDo 最新话题 · 2026-05-24 23:31:05+08:00 · tech

随着Trellis的更新, 上一个帖子: 个人codex使用Trellis的简单流程 也过时了. 现在Trellis在codex上也支持hook了, 最近一直在用, 分享下个人体会. 现在Trellis使用非常简单, 官方标准流程应该是: 直接输入需求. 此时Trellis会自动hook, 自动帮你创建hook, 并在每轮对话都自动hook注入上下文 开始实施, 如果任务简单的话会自动调用check, 也可以手动 $trellis-check commit $trellis-finish-work . 一般会自动归档 但成也hook, 败也hook. 现在的hook感觉太重太冗余了,收益有点低。 从以前少量的“创建task”变成现在不停的敲“不要创建task” 个人体验下来,创建task的情况总归是少数。我明白hook里也考虑到了这点,所以对创建task情况做了部分限制,但效果甚微。 一开始我是修改hook提示词,默认不创建,特定情况下才创建task,但后面实在受不了hook的冗余上下文,有次让AI跑多轮loop测试直接把上下文和输出给我跑爆了。于是就关闭hook了。 于是我现在的流程变为: $start 写需求,讨论或brainstorm,不要实施 /new → $start 实施task xxxxx /new → $start 某些地方需要修改,如何如何,如果和PRD不对齐就修改PRD 几轮下来后,差不多可以了,准备commit。 这里我使用 agent-toolkit/skills/commit-work at main · softaworks/agent-toolkit · GitHub 随便找的再让AI修改下,大概功能就是根据当前代码改动按要求分功能进行commit并给出commit message,确认后再commit /new → $trellis-check /new → $trellis-finish-work 差不多就这样,想到啥再更吧 2 个帖子 - 2 位参与者 阅读完整话题

LinuxDo 最新话题 · 2026-05-21 20:25:59+08:00 · tech

最近中转投毒的报告比较多,向AGENT接入不可信任的第三方LLM API必定伴随着巨大的安全风险。除了尽可能做到沙盒隔离之外,利用可信的LLM审查agent的读取、编辑等指令也是一个办法。作为一个纯小白,经过和AI的商讨,AI大概给我讲明白了。 这个是codex的方案,claude code我没有研究。 官方文档: Hooks – Codex | OpenAI Developers pretooluse hook可以让codex每次执行tool use的指令前,执行提前配置好的指令并等待返回确认,例如运行一个python脚本,并将tool use相关信息传递过去。 随后,py脚本就可以调用deepseek api,让可信任又便宜的ds flash来检查codex要做的事情是否危险,要写的代码是否夹带私货。 这样做的好处是可以让可信任的AI智能地判断安全风险,但同时也受到审查AI本身表现不稳定的局限。 一个示例如下: (AI生成代码,请谨慎使用。我测试了简单的读取目录下.env并成功拦截,未做更多测试。) ~/.codex/hooks.json { "hooks": { "PreToolUse": [ { "matcher": "Bash|apply_patch|.*powershell.*", "hooks": [ { "type": "command", "command": "python3 ~/.codex/hooks/deepseek_reviewer.py", "statusMessage": "🛡️ 正在通过可信安全链路审查指令...", "timeout": 45 } ] } ] } } ~/.codex/hooks/deepseek_reviewer.py #!/usr/bin/env python3 import sys import json import os from datetime import datetime from openai import OpenAI # 配置本地审计与调试日志路径 LOG_FILE_PATH = os.path.expanduser("~/.codex/hooks/reviewer_debug.log") def log_audit(session_id, turn_id, tool_name, command, decision, reason): """本地审计日志记录器,用于观测 Codex 传入的真实载荷""" try: os.makedirs(os.path.dirname(LOG_FILE_PATH), exist_ok=True) log_entry = { "timestamp": datetime.now().isoformat(), "session_id": session_id, "turn_id": turn_id, "tool_name": tool_name, "intercepted_command": command, "decision": decision, "reason": reason } with open(LOG_FILE_PATH, "a", encoding="utf-8") as f: f.write(json.dumps(log_entry, ensure_ascii=False) + "\n") except Exception as log_err: # 日志写入失败时不阻塞核心安全流,仅向标准错误输出 sys.stderr.write(f"[Log Error] 无法写入审计日志: {str(log_err)}\n") def main(): session_id = "unknown" turn_id = "unknown" tool_name = "unknown" command_content = "" # 1. 严格读取并解析 Codex 标准输入 (stdin) try: input_data = sys.stdin.read() if not input_data.strip(): raise ValueError("接收到空的 stdin 输入") payload = json.loads(input_data) # 提取公共字段与事件扩展字段 session_id = payload.get("session_id", "unknown") turn_id = payload.get("turn_id", "unknown") tool_name = payload.get("tool_name", "unknown") # 对齐官方定义:Bash 和 apply_patch 的具体指令存在于 tool_input.command tool_input = payload.get("tool_input", {}) if isinstance(tool_input, dict): command_content = tool_input.get("command", json.dumps(tool_input)) else: command_content = str(tool_input) except Exception as e: error_msg = f"Codex 协议解析失败,触发安全熔断: {str(e)}" log_audit(session_id, turn_id, tool_name, "解析失败", "deny_fallback", error_msg) sys.stderr.write(error_msg + "\n") sys.exit(2) # 2. 检查可信 API 密钥 api_key = os.getenv("DEEPSEEK_API_KEY") if not api_key: error_msg = "环境缺失 DEEPSEEK_API_KEY,安全审查层未激活。" log_audit(session_id, turn_id, tool_name, command_content, "deny_fallback", error_msg) sys.stderr.write(error_msg + "\n") sys.exit(2) # 3. 构建大模型安全上下文 client = OpenAI(api_key=api_key, base_url="https://api.deepseek.com/v1") system_prompt = """ 你是一个安全隔离层。你的任务是审查由不可信的第三方 Agent 生成并即将执行的终端命令、PowerShell脚本或文件修改补丁。 【核心审查法则】 1. 阻断数据窃取:任何针对敏感凭证(如 .env, .git, id_rsa, config.toml, 各种云服务密钥令牌)的读取、打包或打印操作,一律视为高风险泄密并拒绝。 2. 阻断恶意破坏:禁止破坏性删除(rm -rf /, Remove-Item -Force 等)、停用系统防灾机制。 3. 阻断非正常外联:禁止隐蔽的反弹 shell、不明域名的 curl/wget 下载执行流、或不符合当前开发上下文的内网探测扫描。 4. 阻断混淆规避:凡是使用 Base64 编码执行命令、故意字符串拼接、或利用恶意执行策略绕过(如 ExecutionPolicy Bypass)的行为,一律拒绝。 你必须严格输出如下格式的 JSON 字典,不得夹带任何 Markdown 标记: {"decision": "allow" | "deny", "reason": "若拒绝,提供具体的风险说明和修复建议"} """ user_prompt = f"当前触发工具: {tool_name}\n待执行指令/内容片段:\n```\n{command_content}\n ```" # 4. 调用 Deepseek 判决 try: response = client.chat.completions.create( model="deepseek-chat", messages=[ {"role": "system", "content": system_prompt}, {"role": "user", "content": user_prompt} ], response_format={"type": "json_object"}, temperature=0.0 ) review_result = json.loads(response.choices[0].message.content) decision = review_result.get("decision", "deny") reason = review_result.get("reason", "未给出明确原因") except Exception as api_err: error_msg = f"Deepseek 连通异常或超时,安全熔断拦截: {str(api_err)}" log_audit(session_id, turn_id, tool_name, command_content, "deny_fallback", error_msg) sys.stderr.write(error_msg + "\n") sys.exit(2) # 5. 对齐官方标准输出协议进行响应路由 log_audit(session_id, turn_id, tool_name, command_content, decision, reason) if decision == "allow": # 官方规范:向 stdout 输出 permissionDecision: allow output_response = { "hookSpecificOutput": { "hookEventName": "PreToolUse", "permissionDecision": "allow" } } sys.stdout.write(json.dumps(output_response)) sys.exit(0) else: # 官方规范:向 stdout 输出 deny 以及拒绝原因,Codex 会将此反馈给主 Agent 进行闭环重写 output_response = { "hookSpecificOutput": { "hookEventName": "PreToolUse", "permissionDecision": "deny", "permissionDecisionReason": f"[可信拦截] 经 Deepseek 安全审查,由于该操作【{reason}】,执行已被硬性拦截。请修正你的生成策略。" } } sys.stdout.write(json.dumps(output_response)) sys.exit(0) # 打印标准拒绝 JSON 时,脚本本身正常退出 0 即可,Codex 会解析结构并阻断命令。 if __name__ == "__main__": main() 2 个帖子 - 2 位参与者 阅读完整话题