资安学习路上-picoCTF 解题(Web)2

4. Some Assembly Required 1

https://ithelp.ithome.com.tw/upload/images/20220514/20148431OT4knzaej7.png

按右键,检视网页原始码
https://ithelp.ithome.com.tw/upload/images/20220514/20148431OVpYMNEzOg.png

点击js档看到下面,虽然知道是js档,但有点乱
https://ithelp.ithome.com.tw/upload/images/20220514/20148431HHkjUFK6aW.png

用(线上Javascript工具,执行看看
https://ithelp.ithome.com.tw/upload/images/20220514/20148431I9gWZjCtSh.png

接着为了再去混淆度,把常出现的两个参数findMiddlePosition跟navigatePop丢进去,看他的结果,并已编译後的值带入
https://ithelp.ithome.com.tw/upload/images/20220514/20148431dV8EBIkqey.png

结果如下

(async() => {
  const findMiddlePosition = _0x4e0e;
  let leftBranch = await fetch(./JIFxzHyW8W);
  let rightBranch = await WebAssembly[instantiate](await leftBranch[arrayBuffer]());
  let module = rightBranch[instance];
  exports = module["exports"];
})();
/**
 * @return {undefined}
 */
function onButtonPress() {
  const navigatePop = _0x4e0e;
  let params = document["getElementById"](input)[value];
  for (let i = 0; i < params["length"]; i++) {
    exports[copy_char](params[charCodeAt](i), i);
  }
  exports["copy_char"](0, params["length"]);
  if (exports[check_flag]() == 1) {
    document[getElementById](result)[innerHTML] = Correct!;
  } else {
    document[getElementById](result)[innerHTML] = Incorrect!;
  }
}

知道是从JIFxzHyW8W下载wasm档,是用copy_char存每个flag,再用check_flag来确认是否正确,用wget指令下载wasm档,在用kali内建wasm2wat将wasm档转成wat档(WebAssembly 文字格式)
https://ithelp.ithome.com.tw/upload/images/20220514/20148431uG8RwbNg0k.png

用Cat指令得到flag
https://ithelp.ithome.com.tw/upload/images/20220514/20148431Tqo620hbMN.png


<<:  set<E> 选出所有 E 第一个元素 java

>>:  ISO 27001 资讯安全管理系统 【解析】(二十三)

Day-30 完赛心得

经过了漫长的30天,终於完赛了,好险暑假有先屯个15篇,要不应该是没办法完赛了,由衷地佩服那些真的每...

冒险村15 - customize tooltips with data attribute

15 - customize tooltips with data attribute 虽然这...

如何衡量万事万物 (9) 偏好与态度

进行抽样 & 贝氏分析的基础教学之後,本书的最後一个部分在讨论对「软性事物」的衡量,例如品质...

必然 (2) 形成ing - Becoming

永远的新手模式 「形成ing」的基本概念 科技生活是一连串的升级, 不论一种工具用了多久,无尽的升级...

谁温暖了资安部-27(反渗透)

「小左,你觉得你适合资安部门吗? 我觉得,你应该比较适合资讯部门。」 ((资讯部? 我在资安部觉得很...