水一篇文章
抓包了auth.php的登录
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| POST /login/auth.php HTTP/1.1 Host: hackmyvm.eu User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:146.0) Gecko/20100101 Firefox/146.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2 Accept-Encoding: gzip, deflate, br, zstd Content-Type: application/x-www-form-urlencoded Content-Length: 45 Origin: https://hackmyvm.eu Connection: keep-alive Referer: https://hackmyvm.eu/login/ Cookie: PHPSESSID=c16a43q3gtbg7bu59ing2p0o2u Upgrade-Insecure-Requests: 1 Sec-Fetch-Dest: document Sec-Fetch-Mode: navigate Sec-Fetch-Site: same-origin Sec-Fetch-User: ?1 Priority: u=0, i
admin=you_know_who&password_usuario=i_dont_know
|
之后又把HMV登录界面的html下载下来让ai分析
于是就有了如下的脚本
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
|
(function() { 'use strict';
const CONFIG = { username: "填你自己的", password: "填你自己的", autoSubmit: false };
function simulateInput(element, value) { if (!element) return; element.focus(); element.value = value; element.dispatchEvent(new Event('input', { bubbles: true })); element.dispatchEvent(new Event('change', { bubbles: true })); element.blur(); }
let attempt = 0; const maxAttempts = 30;
const timer = setInterval(() => { attempt++;
const userField = document.getElementById('inputEmail'); const passField = document.getElementById('inputPassword');
const submitBtn = document.querySelector('.form-signin button[type="submit"]');
if (userField && passField) { console.log("✅ [HackMyVM] 找到输入框 (ID匹配),正在填充...");
simulateInput(userField, CONFIG.username); simulateInput(passField, CONFIG.password);
clearInterval(timer);
if (CONFIG.autoSubmit && submitBtn) { console.log("🚀 [HackMyVM] 正在自动点击登录..."); submitBtn.click(); } } else { console.log(`⏳ [HackMyVM] 等待元素加载... (${attempt}/${maxAttempts})`); }
if (attempt >= maxAttempts) { clearInterval(timer); console.error("❌ [HackMyVM] 脚本超时:未找到 id='inputEmail' 或 id='inputPassword'。"); }
}, 500);
|
虽然很水,不过因为HMV的session时长太短了,觉得还是比较有用的。