首页
社区
课程
招聘
web和pwn题的简单动态flag实现
发表于: 2022-11-17 15:08 16426

web和pwn题的简单动态flag实现

2022-11-17 15:08
16426

作为一个菜鸡出题人需要有一些觉悟,这周花了三天时间去研究Dockerfile的写法,主要还是为了实现动态flag,思路理顺了就会发现,原来Dockerfile和动态flag这么简单,这里直接现写两个简单的题目来演示一下。
web题,首先是需要按照常规逻辑写一个网页,这里就写一个带flag的简单网页,把flag放在源代码里,并注释掉。代码如下,保存为index.php。

1
2
3
4
5
6
7
8
9
10
11
12
  签到<</code><code class="python keyword">/</code><code class="python plain">title></code> </div> <div class="line number5 index4 alt2"> <code class="python plain"><</code><code class="python keyword">/</code><code class="python plain">head></code> </div> <div class="line number6 index5 alt1"> <code class="python plain"><!</code><code class="python keyword">-</code><code class="python keyword">-</code><code class="python plain">flag{testflag}</code><code class="python keyword">-</code><code class="python keyword">-</code><code class="python plain">></code> </div> <div class="line number7 index6 alt2"><code class="python plain"><body></code></div> <div class="line number8 index7 alt1"><code class="python plain"><?php</code></div> <div class="line number9 index8 alt2"> <code class="python plain">echo </code><code class="python string">"Do u want 2 sign??<br>"</code><code class="python plain">;</code> </div> <div class="line number10 index9 alt1"><code class="python plain">?></code></div> <div class="line number11 index10 alt2"> <code class="python plain"><</code><code class="python keyword">/</code><code class="python plain">body></code> </div> <div class="line number12 index11 alt1"> <code class="python plain"><</code><code class="python keyword">/</code><code class="python plain">html></code> </div> </div></td> </tr></tbody></table><p> 接下来编写Dockerfile,各语句解释就写在后面的注释里吧,正式编写请删掉注释。</p><table border="0" cellpadding="0" cellspacing="0" class="syntaxhighlighter python"><tbody><tr> <td class="gutter"> <div class="line number1 index0 alt2">1</div> <div class="line number2 index1 alt1">2</div> <div class="line number3 index2 alt2">3</div> <div class="line number4 index3 alt1">4</div> <div class="line number5 index4 alt2">5</div> <div class="line number6 index5 alt1">6</div> <div class="line number7 index6 alt2">7</div> </td> <td class="code"><div class="container"> <div class="line number1 index0 alt2"> <code class="python plain">FROM ctftraining</code><code class="python keyword">/</code><code class="python plain">base_image_nginx_mysql_php_56 </code><code class="python comments">#web题docker基础镜像,这里使用ctftraing打包好</code> </div> <div class="line number2 index1 alt1"><code class="python plain">的,包含了基础的nginx,mysql,php环境,并且会自动运行flag.sh脚本(后面会提到),本题使用php环境。</code></div> <div class="line number3 index2 alt2"> </div> <div class="line number4 index3 alt1"> <code class="python plain">COPY src </code><code class="python keyword">/</code><code class="python plain">var</code><code class="python keyword">/</code><code class="python plain">www</code><code class="python keyword">/</code><code class="python plain">html    </code><code class="python comments">#        将你编写的网页源码复制到docker容器中,这里为php网页,因此只需要</code> </div> <div class="line number5 index4 alt2"> <code class="python plain">复制源码到</code><code class="python keyword">/</code><code class="python plain">var</code><code class="python keyword">/</code><code class="python plain">www</code><code class="python keyword">/</code><code class="python plain">html就可以了,其他类型网页按照实际部署情况COPY到docker中相应目录下就可以了</code> </div> <div class="line number6 index5 alt1"> <code class="python plain">RUN mv </code><code class="python keyword">/</code><code class="python plain">var</code><code class="python keyword">/</code><code class="python plain">www</code><code class="python keyword">/</code><code class="python plain">html</code><code class="python keyword">/</code><code class="python plain">flag.sh </code><code class="python keyword">/</code> <code class="python plain">\    </code><code class="python comments">#把你源码中的flag.sh复制到根目录以便自动执行</code> </div> <div class="line number7 index6 alt2"> <code class="python spaces">    </code><code class="python plain">&& chmod </code><code class="python keyword">+</code><code class="python plain">x </code><code class="python keyword">/</code><code class="python plain">flag.sh        </code><code class="python comments">#添加运行权限</code> </div> </div></td> </tr></tbody></table><p>我所使用的平台无需暴露端口,如有需要可以使用EXPOSE 80暴露80端口。<br>接下来实现动态flag,还记得上面提到的flag.sh吗,先来看一下它的代码,同样相关解释写在注释里,正式使用记得删掉注释。<br>PS:flag.sh推荐在linux环境下创建,否则docker build时会报错,泪的教训。</p><table border="0" cellpadding="0" cellspacing="0" class="syntaxhighlighter python"><tbody><tr> <td class="gutter"> <div class="line number1 index0 alt2">1</div> <div class="line number2 index1 alt1">2</div> <div class="line number3 index2 alt2">3</div> <div class="line number4 index3 alt1">4</div> <div class="line number5 index4 alt2">5</div> </td> <td class="code"><div class="container"> <div class="line number1 index0 alt2"><code class="python comments">#!/bin/sh    #必需的东西没什么好讲的</code></div> <div class="line number2 index1 alt1"> <code class="python plain">sed </code><code class="python keyword">-</code><code class="python plain">i </code><code class="python string">"s/flag{testflag}/$GZCTF_FLAG/"</code> <code class="python keyword">/</code><code class="python plain">var</code><code class="python keyword">/</code><code class="python plain">www</code><code class="python keyword">/</code><code class="python plain">html</code><code class="python keyword">/</code><code class="python plain">index.php </code><code class="python comments">#使用平台的动态flag替换</code> </div> <div class="line number3 index2 alt2"><code class="python plain">index.php中的flag,这里我使用的平台为GZCTF,因此动态flag环境变量为$GZCTF_FLAG,其他平台一般</code></div> <div class="line number4 index3 alt1"><code class="python plain">为$FLAG</code></div> <div class="line number5 index4 alt2"> <code class="python plain">export GZCTF_FLAG</code><code class="python keyword">=</code><code class="python plain">""    </code><code class="python comments">#这一句暂时不知道什么作用,但是要写着</code> </div> </div></td> </tr></tbody></table><p>整体目录结构<br> <img src="upload/attach/202211/967681_B9TNG8DC5M3TWMG.png" style="max-width:100%;" alt="图片描述"><br>接下来的操作我默认你已经安装了docker和docker-compose,并且已经docker login了<br>使用build命令,构建题目镜像,name为dockerhub名(自行注册登录),webtest为镜像名(自定义),"."为版本号,代表latest,也可以自定义,不过拉取时记得加上版本号</p><table border="0" cellpadding="0" cellspacing="0" class="syntaxhighlighter python"><tbody><tr> <td class="gutter"><div class="line number1 index0 alt2">1</div></td> <td class="code"><div class="container"><div class="line number1 index0 alt2"> <code class="python plain">docker build </code><code class="python keyword">-</code><code class="python plain">t name</code><code class="python keyword">/</code><code class="python plain">webtest .</code> </div></div></td> </tr></tbody></table> <p> <img src="upload/attach/202211/967681_7Q9P9MMYTE5A2WB.png" style="max-width:100%;" alt="图片描述"><br>push到你的dockerhub镜像仓库,name为dockerhub名,webtest为镜像名</p><table border="0" cellpadding="0" cellspacing="0" class="syntaxhighlighter python"><tbody><tr> <td class="gutter"><div class="line number1 index0 alt2">1</div></td> <td class="code"><div class="container"><div class="line number1 index0 alt2"> <code class="python plain">docker push name</code><code class="python keyword">/</code><code class="python plain">webtest</code> </div></div></td> </tr></tbody></table> <div style="height: 1px;" class="position-relative"> <div class="expandNoteBox text-center position-absolute w-100" style="bottom: 0px; padding-top: 6rem; background: linear-gradient(rgba(255, 255, 255, 0) 0px, rgba(255, 255, 255, 0.4) 0px, rgb(255, 255, 255) 90px);"> <a href="javascript:;" class="btn login_btn" style="color: rgb(0, 153, 238);border: 1px solid #0099ee;border-radius: 5rem;" role="button"> <i class="icon icon-lock"></i> 登录后可查看完整内容 </a> </div> </div> <br> <p><a class="bbs_thread" target="_blank" href="https://www.kanxue.com/book-section_list-173.htm">[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课</a ></p > <div class="my-3"> <a href="forum-37-1-112.htm" class="hidden-sm hidden-md small px-2 py-1 mr-2 " style="border-radius: 3px; background-color: #daf2ff; color: #0099ee;">#Web</a> <a href="forum-37-1-113.htm" class="hidden-sm hidden-md small px-2 py-1 mr-2 " style="border-radius: 3px; background-color: #daf2ff; color: #0099ee;">#Pwn</a> </div> </div> <div> </div> <div style="height: 33px; line-height: 33px; border-top: 1px solid #ddd;"> </div> </div> </div> <div id="collection_thumb" style="text-align:center;padding:5px 0px 30px; margin-bottom: 1rem;"> <div style="width:auto;display:inline-block;"> <div class="card_collection" style=" height: 65px;line-height:30px"> <div> <a href="javascript:void(0);" class="d-inline-block favorite" style="box-shadow: 0 4px 16px 0 rgba(13,39,91,.1); border-radius: 100%; width: 40px; height: 40px;line-height: 40px;"> <i class="icon-star-o color515a6e"></i> </a> </div> <div> 收藏 <span class="likes_box likes_box_hide" style="font-size: 13px;">・<span class="likes">1</span></span> </div> </div> <div class="card_collection" style=" height: 65px;line-height:30px"> <div> <a href="javascript:void(0);" data-toggle="modal" data-target="#thumbModal" class="d-inline-block thumb thumbsBox" style="box-shadow: 0 4px 16px 0 rgba(13,39,91,.1); border-radius: 100%; width: 40px; height: 40px;line-height: 40px;"> <i class="icon-thumbs-o-up color515a6e"></i> </a> </div> <div> <span class="text-cycler">免费</span> <span class="thumbs_num_box" style="font-size: 13px;">・<span class="thumbs_num">5</span></span> </div> </div> <div class="card_collection" style=" height: 65px;line-height:30px"> <div> <a href="javascript:void(0);" class="modal-title d-inline-block" id="exampleModalLabel" style="box-shadow: 0 4px 16px 0 rgba(13,39,91,.1); border-radius: 100%; width: 40px; height: 40px;line-height: 40px;" data-toggle="modal" data-target=".reward"> <!-- <i class="icon-rmb color515a6e"></i> --> <i style="vertical-align: middle;" width="22" height="22" data-feather="battery-charging"></i> </a> </div> <div> 支持 </div> </div> <div class="card_collection position-relative" style=" height: 65px;line-height:30px"> <div class="bbsshare_btn" style="cursor: pointer;"> <div> <a href="javascript:void(0);" class="modal-title d-inline-block" style="box-shadow: 0 4px 16px 0 rgba(13,39,91,.1); border-radius: 100%; width: 40px; height: 40px; line-height: 40px;"> <!-- <i class="icon-share color515a6e"></i> --> <i style="vertical-align: middle;" width="22" height="22" data-feather="external-link"></i> </a> </div> <div> 分享 </div> </div> <div class="bd-bbsshare-modal-sm bbsshare_modal bg-white" style="display: none; width: 146px; box-shadow: 0 0 3px 0.5px #eee;"> <div class="px-2 py-4"> <div class="text-center" style="color: #5C5C5C;"><i class="icon icon-wechat "></i> 分享到微信 </div> <div class="wechat_img py-2"> <img src="bbs_qrcode-http_3A_2F_2Fbbs_2epediy_2ecom_2Fthread_2d275212_2ehtm.htm" style="width: 100%;"> </div> <div onclick="shareTo('qq')" class="text-center" style="color: #5C5C5C; cursor: pointer;"><i class="icon icon-qq"></i> 分享到QQ</div> <!-- <div class="text-center" style="color: #5C5C5C; cursor: pointer;"><i class="icon icon-wechat"></i> 分享到空间</div> --> <div onclick="shareTo('sina')" class="text-center" style="color: #5C5C5C; cursor: pointer;"><i class="icon icon-weibo"></i> 分享到微博</div> </div> </div> </div> </div> </div> </div> <div class="card thumb_list_box" style="display: none;"> <div class="card-body thumb_list_body"> <div class="pb-2" style="font-weight: bolder;">赞赏记录</div> <div class="row mx-0 pb-3 pt-2" style="font-weight: 600;"> <div style="width: 100px;">参与人</div> <div style="width: 100px; text-align: center;">雪币</div> <div class="col px-2">留言</div> <div style="width: 120px; text-align: left;">时间</div> </div> <div class="thumb_list"> <div class="row mx-0 py-3 thumb_list_item" style="border-top: 1px dashed #cecece;"> <div class="text-truncate" style="width: 100px;">Xunaan</div> <div class="px-3" style="width: 100px; text-align: center; color: #ee3000;"></div> <div class="col px-2 text-muted">非常支持你的观点!</div> <div style="width: 120px; text-align: left;">2024-10-8 12:56</div> </div> <div class="row mx-0 py-3 thumb_list_item" style="border-top: 1px dashed #cecece;"> <div class="text-truncate" style="width: 100px;">伟叔叔</div> <div class="px-3" style="width: 100px; text-align: center; color: #ee3000;"></div> <div class="col px-2 text-muted">为你点赞~</div> <div style="width: 120px; text-align: left;">2023-3-18 00:33</div> </div> <div class="row mx-0 py-3 thumb_list_item" style="border-top: 1px dashed #cecece;"> <div class="text-truncate" style="width: 100px;">PLEBFE</div> <div class="px-3" style="width: 100px; text-align: center; color: #ee3000;"></div> <div class="col px-2 text-muted">为你点赞~</div> <div style="width: 120px; text-align: left;">2023-1-10 16:39</div> </div> <div class="row mx-0 py-3 thumb_list_item" style="border-top: 1px dashed #cecece;"> <div class="text-truncate" style="width: 100px;">tfll</div> <div class="px-3" style="width: 100px; text-align: center; color: #ee3000;"></div> <div class="col px-2 text-muted">为你点赞~</div> <div style="width: 120px; text-align: left;">2022-11-21 22:38</div> </div> <div class="row mx-0 py-3 thumb_list_item" style="border-top: 1px dashed #cecece;"> <div class="text-truncate" style="width: 100px;">nH0pe</div> <div class="px-3" style="width: 100px; text-align: center; color: #ee3000;"></div> <div class="col px-2 text-muted">为你点赞~</div> <div style="width: 120px; text-align: left;">2022-11-17 19:10</div> </div> </div> <div class="py-3" id="thumbShowMore" style="border-top: 1px solid #cecece;"> <a href="javascript:;" style="color: #0099ee;">查看更多</a> </div> </div> </div> <!--赞赏支持--> <div class="modal fade reward" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal-dialog modal-dialog-centered" role="document"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title" id="exampleModalLabel">赞赏</h4> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <form action="" method="post" id="pay_kx" onsubmit="return topay()"> <div class="modal-body "> <div class="form-group mb-0"> <input name="ureward" type="hidden" value="967681" /> <input type="hidden" name="reward_articleid" value="275212" /> <div class="mb-3 text-center"> <img src="view/img/dashang.png" class="avatar-3" alt="100" /> </div> <div class="text-center mb-3"> <div data-toggle="buttons"> <label class="btn btn-outline-danger active" style="width:120px"> <input type="radio" class="d-none" value="1" name="reward_rmbs" id="option1" autocomplete="off" checked>1 雪花 </label> <label class="btn btn-outline-danger" style="width:120px"> <input type="radio" class="d-none" value="5" name="reward_rmbs" id="option2" autocomplete="off">5 雪花 </label> <label class="btn btn-outline-danger" style="width:120px"> <input type="radio" class="d-none" value="10" name="reward_rmbs" id="option3" autocomplete="off">10 雪花 </label> <label class="btn btn-outline-danger" style="width:120px"> <input type="radio" class="d-none" value="20" name="reward_rmbs" id="option4" autocomplete="off">20 雪花 </label> <label class="btn btn-outline-danger" style="width:120px"> <input type="radio" class="d-none" value="50" name="reward_rmbs" id="option5" autocomplete="off">50 雪花 </label> <label class="btn btn-outline-danger" style="width:120px"> <input type="radio" class="d-none" value="80" name="reward_rmbs" id="option6" autocomplete="off">80 雪花 </label> <label class="btn btn-outline-danger" style="width:120px"> <input type="radio" class="d-none" value="100" name="reward_rmbs" id="option7" autocomplete="off">100 雪花 </label> <label class="btn btn-outline-danger" style="width:120px"> <input type="radio" class="d-none" value="150" name="reward_rmbs" id="option8" autocomplete="off">150 雪花 </label> <label class="btn btn-outline-danger" style="width:120px"> <input type="radio" class="d-none" value="200" name="reward_rmbs" id="option9" autocomplete="off">200 雪花 </label> </div> </div> <div> <label id="alipay_lab"> <span>支付方式:</span> <input type="radio" value="1" checked="checked" name="reward_type" style="display:inline" /> <span class="alipay-bg"></span> </label> <label class="ml-3"> <input type="radio" value="3" name="reward_type"> <i class="icon icon-weixin" style="font-size:17px;color:#49BE38"></i> 微信支付 </label> </div> </div> </div> <div class="px-3 mb-3"> <div class="mb-2">赞赏留言: <select class="form-control form-control-sm reward_reason d-inline-block" style="max-width: 90px;"> <option value=0>快捷留言</option> <option value="感谢分享~">感谢分享~</option> <option value="精品文章~">精品文章~</option> <option value="原创内容~">原创内容~</option> <option value="精彩转帖~">精彩转帖~</option> <option value="助人为乐~">助人为乐~</option> </select> </div> <textarea class="form-control reward_reason_textarea" name="brief" rows="1" readonly>感谢分享~</textarea> </div> <div class="modal-footer"> <button id="pay_submit" type="submit" class="btn btn-primary btn-pay kx-pay" data-loading-text="正在提交...">立即支付</button> </div> </form> </div> </div> </div> <div class="card p-1"> <div class="card-body"> <table class="table postlist mb-0"> <thead> <tr> <th colspan="2" class="pa-0 pb-1"> <dl class="row"> <dt> <b style="font-size: 16px;">最新回复</b> (<span class="posts">4</span>) </dt> <dd style="text-align: right;"> </dd> </dl> </th> </tr> </thead> <tbody> <tr class="post" data-pid="1731240"> <td class="vtop td-avatar text-center" style="width: 46px;"> <div class="position-relative avatar_hover"> <a class="d-inline-block position-relative avatar_box photo_frame photo_frame_image1" data-uid="648229" href='user-home-648229.htm' tabindex="-1" > <img class="avatar-3" src="view/img/avatar.png"> </a> <div class="position-absolute thread-poptip-box bg-white text-left p-4"> <div class="row mx-0"> <div> <a class="d-inline-block avatar_box" data-uid="648229" href="user-home-648229.htm"> <img class="avatar-3" src="view/img/avatar.png"> </a> </div> <div class="col"> <div class="pb-2"> <a href="user-home-648229.htm"> <span style="font-size: 16px; font-weight: bolder;" class="username_box" data-uid="648229">tfll</span> </a> </div> <div class="pb-2 position-relative"> <span class="small text-muted">雪    币:</span> <span class="small text-muted"> <a href="thread-260144.htm" class="text-muted"> 383 </a> </span> </div> <div class="pb-2 position-relative"> <span class="small text-muted">活跃值:</span> <a href="thread-260144.htm" class="text-muted"> <!-- <img class="position-absolute huoyue_num" src="/view/img/rank/7.png" width="22" alt="活跃值"> --> <span class="position-absolute huoyue_num iconfont icon-a-7" style="top:-3px"></span> </a> <span class="small text-muted" style="margin-left: 25px;">(1050)</span> </div> <div class="pb-2 small"> <span class="small text-muted">能力值:</span> <a href="thread-260144.htm" class="text-muted"> <svg class="icon" aria-hidden="true"> <use xlink:href="#icon-group_102"></use> </svg> </a> <img src="//bbs.kanxue.com/view/img/stars01.gif" alt=""> <span class="small text-muted">( LV2,RANK:15 )</span> </div> <div class="pb-2" style="font-size: 0;"> <span class="small text-muted" style="vertical-align: middle;">在线值:</span> <a href="thread-249442.htm"> <span class="post_online_time" style="vertical-align: middle;" data-online_time="375458" data-desc="" ></span> </a> <span class="post_online_time1 text-muted small" style="vertical-align: middle;"></span> </div> </div> </div> <div class="pb-3 pt-2 row mx-0 text-muted text-center"> <div class="col"> <div class="small mb-2">发帖</div> <div> <a href="user-648229.htm" class="item-count" style="font-size:1.1rem;"> 1 </a> </div> </div> <div class="col" style="border-left: 1px solid #e6e8eb;border-right: 1px solid #e6e8eb;"> <div class="small mb-2">回帖</div> <div> <a href="user-post-648229.htm" class="item-count" style="font-size:1.1rem;"> 26</div> </a> </div> <div class="col"> <div class="small mb-2">粉丝</div> <div> <a href="user-fans-648229.htm" class="item-count" style="font-size:1.1rem;"> 1</div> </a> </div> </div> <div class="row mx-0"> <!--当前用户是否关注了$_post['user']['uid'] --> <div class="col-6"> <a class="btn btn-0099ee w-100 follow_btn" data-cuid="648229"> <i style="vertical-align: middle; color: #fff;" width="14" height="14" data-feather="plus"></i> <span style="vertical-align: middle;display: inline-block;">关注</span> </a> </div> <div class="col-6"> <a href="//www.kanxue.com/pm-send.htm?name=tfll" class="btn bg-white w-100" style="border: 1px solid #0099ee; color:#0099ee;"> 私信 </a> </div> </div> </div> </div> <div class="mt-2"> <svg class="icon" aria-hidden="true"> <use xlink:href="#icon-group_102"></use> </svg> </div> <!-- <div class="text-grey text-tiny" style="height: 20px; text-align: center; margin-top: -9px; "> <div class="mb-3" style="position: relative;"><img style="position:absolute;left: -3px;" src="//bbs.kanxue.com/view/img/stars01.gif" alt=""> </div> </div> --> </td> <td class="px-0"> <dl class="row "> <dt> <div> <span class="username font-weight-bold"> <a class="username_box" data-uid="648229" href="user-home-648229.htm">tfll</a> <span class="huoyue_num iconfont icon-a-7"></span> </span> </div> </dt> <dd class="text-right text-grey py-1 small"> <div class="check_input_box d-inline-block"></div> <div class="d-none d-lg-inline-block"> </div> <a href="thread-275212-1.htm#1731240" id="1731240" class="text-grey"><span class="floor">2</span> 楼</a> </dd> </dl> <!-- <div></div> --> <div class="message mt-2 break-all"> 请问 GZCTF如何搭建。<br>使用github 上 的 docker pull ghcr.io/gztimewalker/gzctf/gzctf:latest  无法启动 </div> <div class="row mx-0 mt-3"> <div class="col px-0"> <span class="date text-grey small ml-1">2022-11-21 22:38</span> </div> <div class="small"> <div class="check_input_box d-inline-block"></div> <div class="d-none d-lg-inline-block"> </div> <div class="reply_thumb" style="display: inline-block;"> <input type="hidden" value="275212" name="threadid" /> <input type="hidden" value="648229" name="praised_uid" /> <input type="hidden" value="1731240" name="pid" /> <a href="javascript:void(0)" class="text-grey"> <i class="icon-thumbs-o-up"></i> </a> <span class='thumb_num' style="margin-left:5px">0</span> </div> <style> .mobile_more_operate_btn { padding: 0px 4px; background: #dee5ea; border-radius: 0.2rem; cursor: pointer; } .mobile_more_operate { display: none; left: -195px; top: -13px; width: 185px; background: #222222; border-radius: 0.3rem; } .mobile_more_operate_box .post_report { color: #fff!important; } </style> </div> </div> </td> </tr> <tr class="post" data-pid="1731279"> <td class="vtop td-avatar text-center" style="width: 46px;"> <div class="position-relative avatar_hover"> <a class="d-inline-block position-relative avatar_box photo_frame photo_frame_image1" data-uid="648229" href='user-home-648229.htm' tabindex="-1" > <img class="avatar-3" src="view/img/avatar.png"> </a> <div class="position-absolute thread-poptip-box bg-white text-left p-4"> <div class="row mx-0"> <div> <a class="d-inline-block avatar_box" data-uid="648229" href="user-home-648229.htm"> <img class="avatar-3" src="view/img/avatar.png"> </a> </div> <div class="col"> <div class="pb-2"> <a href="user-home-648229.htm"> <span style="font-size: 16px; font-weight: bolder;" class="username_box" data-uid="648229">tfll</span> </a> </div> <div class="pb-2 position-relative"> <span class="small text-muted">雪    币:</span> <span class="small text-muted"> <a href="thread-260144.htm" class="text-muted"> 383 </a> </span> </div> <div class="pb-2 position-relative"> <span class="small text-muted">活跃值:</span> <a href="thread-260144.htm" class="text-muted"> <!-- <img class="position-absolute huoyue_num" src="/view/img/rank/7.png" width="22" alt="活跃值"> --> <span class="position-absolute huoyue_num iconfont icon-a-7" style="top:-3px"></span> </a> <span class="small text-muted" style="margin-left: 25px;">(1050)</span> </div> <div class="pb-2 small"> <span class="small text-muted">能力值:</span> <a href="thread-260144.htm" class="text-muted"> <svg class="icon" aria-hidden="true"> <use xlink:href="#icon-group_102"></use> </svg> </a> <img src="//bbs.kanxue.com/view/img/stars01.gif" alt=""> <span class="small text-muted">( LV2,RANK:15 )</span> </div> <div class="pb-2" style="font-size: 0;"> <span class="small text-muted" style="vertical-align: middle;">在线值:</span> <a href="thread-249442.htm"> <span class="post_online_time" style="vertical-align: middle;" data-online_time="375458" data-desc="" ></span> </a> <span class="post_online_time1 text-muted small" style="vertical-align: middle;"></span> </div> </div> </div> <div class="pb-3 pt-2 row mx-0 text-muted text-center"> <div class="col"> <div class="small mb-2">发帖</div> <div> <a href="user-648229.htm" class="item-count" style="font-size:1.1rem;"> 1 </a> </div> </div> <div class="col" style="border-left: 1px solid #e6e8eb;border-right: 1px solid #e6e8eb;"> <div class="small mb-2">回帖</div> <div> <a href="user-post-648229.htm" class="item-count" style="font-size:1.1rem;"> 26</div> </a> </div> <div class="col"> <div class="small mb-2">粉丝</div> <div> <a href="user-fans-648229.htm" class="item-count" style="font-size:1.1rem;"> 1</div> </a> </div> </div> <div class="row mx-0"> <!--当前用户是否关注了$_post['user']['uid'] --> <div class="col-6"> <a class="btn btn-0099ee w-100 follow_btn" data-cuid="648229"> <i style="vertical-align: middle; color: #fff;" width="14" height="14" data-feather="plus"></i> <span style="vertical-align: middle;display: inline-block;">关注</span> </a> </div> <div class="col-6"> <a href="//www.kanxue.com/pm-send.htm?name=tfll" class="btn bg-white w-100" style="border: 1px solid #0099ee; color:#0099ee;"> 私信 </a> </div> </div> </div> </div> <div class="mt-2"> <svg class="icon" aria-hidden="true"> <use xlink:href="#icon-group_102"></use> </svg> </div> <!-- <div class="text-grey text-tiny" style="height: 20px; text-align: center; margin-top: -9px; "> <div class="mb-3" style="position: relative;"><img style="position:absolute;left: -3px;" src="//bbs.kanxue.com/view/img/stars01.gif" alt=""> </div> </div> --> </td> <td class="px-0"> <dl class="row "> <dt> <div> <span class="username font-weight-bold"> <a class="username_box" data-uid="648229" href="user-home-648229.htm">tfll</a> <span class="huoyue_num iconfont icon-a-7"></span> </span> </div> </dt> <dd class="text-right text-grey py-1 small"> <div class="check_input_box d-inline-block"></div> <div class="d-none d-lg-inline-block"> </div> <a href="thread-275212-1.htm#1731279" id="1731279" class="text-grey"><span class="floor">3</span> 楼</a> </dd> </dl> <!-- <div></div> --> <div class="message mt-2 break-all"> 这个CTF平台搭建已经搞成功了 </div> <div class="row mx-0 mt-3"> <div class="col px-0"> <span class="date text-grey small ml-1">2022-11-22 13:54</span> </div> <div class="small"> <div class="check_input_box d-inline-block"></div> <div class="d-none d-lg-inline-block"> </div> <div class="reply_thumb" style="display: inline-block;"> <input type="hidden" value="275212" name="threadid" /> <input type="hidden" value="648229" name="praised_uid" /> <input type="hidden" value="1731279" name="pid" /> <a href="javascript:void(0)" class="text-grey"> <i class="icon-thumbs-o-up"></i> </a> <span class='thumb_num' style="margin-left:5px">0</span> </div> <style> .mobile_more_operate_btn { padding: 0px 4px; background: #dee5ea; border-radius: 0.2rem; cursor: pointer; } .mobile_more_operate { display: none; left: -195px; top: -13px; width: 185px; background: #222222; border-radius: 0.3rem; } .mobile_more_operate_box .post_report { color: #fff!important; } </style> </div> </div> </td> </tr> <tr class="post" data-pid="1738435"> <td class="vtop td-avatar text-center" style="width: 46px;"> <div class="position-relative avatar_hover"> <a class="d-inline-block position-relative avatar_box photo_frame photo_frame_image0" data-uid="967681" href='user-home-967681.htm' tabindex="-1" > <img class="avatar-3" src="//passport.kanxue.com/upload/avatar/681/967681.png?1668433695"> </a> <div class="position-absolute thread-poptip-box bg-white text-left p-4"> <div class="row mx-0"> <div> <a class="d-inline-block avatar_box" data-uid="967681" href="user-home-967681.htm"> <img class="avatar-3" src="//passport.kanxue.com/upload/avatar/681/967681.png?1668433695"> </a> </div> <div class="col"> <div class="pb-2"> <a href="user-home-967681.htm"> <span style="font-size: 16px; font-weight: bolder;" class="username_box" data-uid="967681">nH0pe</span> </a> </div> <div class="pb-2 position-relative"> <span class="small text-muted">雪    币:</span> <span class="small text-muted"> <a href="thread-260144.htm" class="text-muted"> 248 </a> </span> </div> <div class="pb-2 small"> <span class="small text-muted">能力值:</span> <a href="thread-260144.htm" class="text-muted"> <svg class="icon" aria-hidden="true"> <use xlink:href="#icon-group_101"></use> </svg> </a> <img src="//bbs.kanxue.com/view/img/stars01.gif" alt=""> <span class="small text-muted">( LV1,RANK:0 )</span> </div> <div class="pb-2" style="font-size: 0;"> <span class="small text-muted" style="vertical-align: middle;">在线值:</span> <a href="thread-249442.htm"> <span class="post_online_time" style="vertical-align: middle;" data-online_time="13475" data-desc="" ></span> </a> <span class="post_online_time1 text-muted small" style="vertical-align: middle;"></span> </div> </div> </div> <div class="pb-3 pt-2 row mx-0 text-muted text-center"> <div class="col"> <div class="small mb-2">发帖</div> <div> <a href="user-967681.htm" class="item-count" style="font-size:1.1rem;"> 1 </a> </div> </div> <div class="col" style="border-left: 1px solid #e6e8eb;border-right: 1px solid #e6e8eb;"> <div class="small mb-2">回帖</div> <div> <a href="user-post-967681.htm" class="item-count" style="font-size:1.1rem;"> 2</div> </a> </div> <div class="col"> <div class="small mb-2">粉丝</div> <div> <a href="user-fans-967681.htm" class="item-count" style="font-size:1.1rem;"> 2</div> </a> </div> </div> <div class="row mx-0"> <!--当前用户是否关注了$_post['user']['uid'] --> <div class="col-6"> <a class="btn btn-0099ee w-100 follow_btn" data-cuid="967681"> <i style="vertical-align: middle; color: #fff;" width="14" height="14" data-feather="plus"></i> <span style="vertical-align: middle;display: inline-block;">关注</span> </a> </div> <div class="col-6"> <a href="//www.kanxue.com/pm-send.htm?name=nH0pe" class="btn bg-white w-100" style="border: 1px solid #0099ee; color:#0099ee;"> 私信 </a> </div> </div> </div> </div> <div class="mt-2"> <svg class="icon" aria-hidden="true"> <use xlink:href="#icon-group_101"></use> </svg> </div> <!-- <div class="text-grey text-tiny" style="height: 20px; text-align: center; margin-top: -9px; "> <div class="mb-3" style="position: relative;"><img style="position:absolute;left: -3px;" src="//bbs.kanxue.com/view/img/stars01.gif" alt=""> </div> </div> --> </td> <td class="px-0"> <dl class="row "> <dt> <div> <span class="username font-weight-bold"> <a class="username_box" data-uid="967681" href="user-home-967681.htm">nH0pe</a> <span class="huoyue_num iconfont icon-a-0"></span> </span> </div> </dt> <dd class="text-right text-grey py-1 small"> <div class="check_input_box d-inline-block"></div> <div class="d-none d-lg-inline-block"> </div> <a href="thread-275212-1.htm#1738435" id="1738435" class="text-grey"><span class="floor">5</span> 楼</a> </dd> </dl> <!-- <div></div> --> <div class="message mt-2 break-all"> <blockquote class="blockquote"> <a href="user-648229.htm" class="text-small text-muted user"> <img class="avatar-1" src="view/img/avatar.png"> tfll </a> 请问 GZCTF如何搭建。 使用github 上 的 docker pull ghcr.io/gztimewalker/gzctf/gzctf:latest 无法启动 </blockquote>抱歉,近期较忙没有看到,如果你还有其他问题可以去官方群里问问 </div> <div class="row mx-0 mt-3"> <div class="col px-0"> <span class="date text-grey small ml-1">2023-3-8 17:37</span> </div> <div class="small"> <div class="check_input_box d-inline-block"></div> <div class="d-none d-lg-inline-block"> </div> <div class="reply_thumb" style="display: inline-block;"> <input type="hidden" value="275212" name="threadid" /> <input type="hidden" value="967681" name="praised_uid" /> <input type="hidden" value="1738435" name="pid" /> <a href="javascript:void(0)" class="text-grey"> <i class="icon-thumbs-o-up"></i> </a> <span class='thumb_num' style="margin-left:5px">0</span> </div> <style> .mobile_more_operate_btn { padding: 0px 4px; background: #dee5ea; border-radius: 0.2rem; cursor: pointer; } .mobile_more_operate { display: none; left: -195px; top: -13px; width: 185px; background: #222222; border-radius: 0.3rem; } .mobile_more_operate_box .post_report { color: #fff!important; } </style> </div> </div> </td> </tr> <tr class="post"> <td class="td-avatar" aria-hidden="true"> <a href="user-705338.htm" aria-hidden="true" tabindex="-1"> <img class="avatar-3" src="view/img/avatar.png"> </a> </td> <td class="p-l-0"> <form action="" method="post" id="quick_reply_form"> <dl class="row small text-muted"> <dt class="username">游客</dt> <dd class="text-right text-grey"></dd> </dl> <div class="message mt-1"> <div style=" border-radius: 0.25rem; border: 1px solid #ced4da;"> <div class="text-center small py-3"> <a href="//passport.kanxue.com/user-login.htm" class="small">登录</a> | <a href="//passport.kanxue.com/user-mobile.htm" class="small">注册</a> 方可回帖 </div> </div> </div> <div class="text-muted mt-3 small face_open"> <dl class="row"> <dt> <a class="btn btn-primary btn-sm px-3" href="//passport.kanxue.com/user-login.htm" role="button">回帖</a> <span class="emotion ml-3">表情</span> <span class="ml-3 d-none d-lg-inline-block"><a href="//bbs.pediy.com/thread-247709.htm" target="_bank" style="color: #0099ee;">雪币赚取及消费</a></span> </dt> <dd class="text-right vtop"> <a class="icon-mail-reply text-muted" href="//passport.kanxue.com/user-login.htm" id="advanced_reply"> 高级回复</a> </dd> </dl> </div> </form> </td> </tr> </tbody> </table> </div> </div> <a role="button" class="btn btn-secondary btn-block xn-back my-3 mx-auto" style="max-width: 50%;" href="javascript:history.back();">返回</a> </div> </div> <div class="col-lg-3 pr-0 hidden-sm hidden-md" style="padding-left: 15px;"> <div class="right_content positionSticky position-sticky" style="top:80px;"> <div class="rightbox_card_hidden"> <div class="card mb-3 position-relative "> <div class="py-4 px-4"> <div class="row mx-0"> <div> <!-- <a class="d-inline-block position-relative photo_frame photo_frame_image0" href="user-home-967681.htm" aria-hidden="true" tabindex="-1"> --> <a class="d-inline-block position-relative avatar_box" data-uid="967681" href="user-home-967681.htm" aria-hidden="true" tabindex="-1"> <img src="//passport.kanxue.com/upload/avatar/681/967681.png?1668433695" style="width: 4.5rem; height: 4.5rem; border-radius: 5rem;"> </a> </div> <div class="col pr-0"> <div> <span style="font-size: 16px;" class="font-weight-bold"> <a class="username_box" data-uid="967681" href="user-home-967681.htm">nH0pe</a> </span> </div> <div class="mt-1"> <span class="huoyue_num iconfont icon-a-0" data-desc="活跃值:0,0级" onmouseenter="show_online_level(event)"></span> <a href="./thread-260144.htm" class="text-muted" data-desc="能力值:0, LV1" onmouseenter="show_online_level(event)"> <svg class="icon" aria-hidden="true"> <use xlink:href="#icon-group_101"> </use> </svg> </a> <img src="//bbs.kanxue.com/view/img/stars01.gif" alt=""> </div> <div class="mt-1"> <span class="post_online_time" style="vertical-align: middle;" data-online_time="13475" data-desc="" onmouseenter="show_online_level(event)"></span> </div> </div> </div> <div class="row mx-0 my-4 text-center"> <div class="col px-0"> <div style="font-size: 1.4rem;"> <a class="item-count" href='homepage-967681.htm' target="_blank"> 1 </a> </div> <div class="small" style="color: #888888;">发帖</div> </div> <div class="col px-0" style="border-left: 1px solid #e6e8eb;border-right: 1px solid #e6e8eb;"> <div style="font-size: 1.4rem;"> <a class="item-count" href='homepage-post-967681.htm' target="_blank"> 2 </a> </div> <div class="small" style="color: #888888;">回帖</div> </div> <div class="col px-0"> <div style="font-size: 1.4rem;"> <a class="item-count" href='thread-260144.htm' target="_blank"> 0 </a> </div> <div class="small" style="color: #888888;">RANK</div> </div> </div> <div class="px-1 row mx-0"> <div class="col-6"> <a class="btn btn-0099ee w-100 follow_btn py-1" data-cuid="967681"> <i style="vertical-align: middle; color: #fff;" width="14" height="14" data-feather="plus"></i> <span style="vertical-align: middle;display: inline-block;">关注</span> </a> </div> <div class="col-6"> <a href="//www.kanxue.com/pm-send.htm?name=nH0pe" class="btn bg-white w-100 py-1" style="border: 1px solid #0099ee; color:#0099ee;"> <!-- <i class="icon-envelope"></i> --> 私信 </a> </div> </div> </div> </div> <div class="card mb-3 py-3 show_tocbot "> <div id="js-toc" class="js-toc"></div> </div> </div> <div class="card mb-3 pb-3" style="color: #bbbbbb;"> <div class="py-2 px-3 mb-2" style="color: #333333;border-bottom: 1px solid #eeeeee; font-weight: 600;font-size: 16px;"> <i style="vertical-align: middle;" width="14" height="14" data-feather="terminal"></i> 他的文章 </div> <div class="px-3"> <ul class="pl-4"> <li class="mb-2"> <a href="thread-275212.htm" style="color: #494b4d; font-size: 13px;">web和pwn题的简单动态flag实现</a> <svg style="vertical-align: middle;" t="1732758196414" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="12069" width="12" height="12"><path d="M947.949268 880.889756H76.050732c-18.481951 0-33.592195-14.985366-33.592195-33.592195V176.577561c0-18.481951 14.985366-33.592195 33.592195-33.592195 18.481951 0 33.592195 14.985366 33.592195 33.592195v637.252683h838.431219c18.481951 0 33.592195 14.985366 33.592195 33.592195-0.124878 18.481951-15.110244 33.467317-33.717073 33.467317z m0 0" fill="#797c80" p-id="12070"></path><path d="M210.54439 680.085854c-8.616585 0-17.108293-3.246829-23.601951-9.740488-13.112195-13.112195-13.112195-34.341463-0.124878-47.453659l167.336585-168.085853c6.243902-6.36878 14.860488-9.865366 23.72683-9.865366s17.482927 3.496585 23.726829 9.865366l110.392195 110.392195L823.69561 253.502439c13.112195-13.112195 34.341463-13.112195 47.453658 0s13.112195 34.341463 0 47.453659L535.726829 636.378537c-13.112195 13.112195-34.341463 13.112195-47.453658 0l-110.392195-110.392196-143.609756 144.234147c-6.618537 6.493659-15.110244 9.865366-23.72683 9.865366z m0 0" fill="#797c80" p-id="12071"></path></svg> <span class="small">16427</span> </li> </ul> </div> </div> <div class="bg-white mb-3 position-relative"> <a id="thread_ad" data-thread_postdata="2_19_15" data-href="https://www.kanxue.com/book-leaflet-173.htm" href="javascript:void(0);"> <img src="//www.kanxue.com/upload/attach/mediapic/_202407261723_F2TH9YM6E8YEUXE.jpg" class="w-100" alt=""> <span id="diff_day" class="position-absolute" style="bottom: 1.6rem; left: 5rem; font-size: 40px; color: #00dfff;"></span> </a> </div> <div class="card mb-3 px-2 py-3"> <div class="row mx-0 text-center small pb-3" style="border-bottom: 1px solid #ececec;"> <div class="col-4 px-0" style="border-right: 1px solid #ececec;"><a class="text-muted" href="https://zhuanlan.kanxue.com/article-56.htm">关于我们</a></div> <div class="col-4 px-0" style="border-right: 1px solid #ececec;"><a class="text-muted" href="https://www.kanxue.com/user-online_sendmsg.htm">联系我们</a></div> <div class="col-4 px-0"><a class="text-muted" href="https://qifu.kanxue.com/">企业服务</a></div> </div> <div class="pt-3 small"> <img src="./view/img/gongzhonghao.png" style="max-width: 80px; float: left;" alt=""> <div class="px-2 py-2 text-muted" style="overflow: hidden;"> <div>看雪公众号</div> <div>专注于PC、移动、智能设备安全研究及逆向工程的开发者社区</div> </div> </div> </div> </div> </div> </div> <!--谁下载--> <!-- 图片查看 --> <style> #imageViewerOuterdiv .showDrawing { display: none; cursor: pointer; } #imageViewerInnerdiv:hover .showDrawing { display: inline-block; } </style> <div id="imageViewerOuterdiv" style="position:fixed;top:0;left:0;background:rgba(0,0,0,0.7);z-index:2;width:100%;height:100%;display:none;"> <div id="imageViewerInnerdiv" style="position:absolute;"> <img id="bigimg" style="border:5px solid #fff; cursor: zoom-out;" src="" /> <span class="px-3 showDrawing" style="border-radius: 10rem; position:absolute;z-index: 1; top: 10px; right: 10px; background: #0066cc;color: #fff;">看原图</span> </div> </div> <!-- 赞 --> <div class="modal fade" id="thumbModal" tabindex="-1" aria-labelledby="thumbModalLabel" aria-hidden="true"> <div class="modal-dialog modal-dialog-centered"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">赞赏</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <div class="row mx-0" style="flex-wrap: nowrap; align-items: center;"> <div class="col-form-label pr-3">雪币:</div> <div> <div class="input-group"> <input type="number" class="form-control" value="0" min="0" max="10" id="thumb-xb" style="max-width: 6rem;"> <div class="input-group-append"> <button class="btn btn-outline-secondary" type="button" id="addThumbXb">+</button> </div> </div> </div> </div> <div class="form-group mt-3"> <div class="col-form-label row mx-0"> <div class="pr-3">留言:</div> <div class="col px-0 "> <select class="form-control form-control-sm reward_reason d-inline-block" style="max-width: 6rem;" data-gtm-form-interact-field-id="0"> <option value="0">快捷留言</option> </select> </div> <div><i class="icon icon-refresh text-muted thumb-text-refresh" style="cursor: pointer;"></i></div> </div> <div> <textarea class="form-control" id="thumb-text" readonly>为你点赞!</textarea> </div> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button> <button type="button" class="btn btn-primary thumbPost">确定</button> </div> </div> </div> </div> <div class="modal fade" id="fullScreenModal" tabindex="-1" aria-labelledby="fullScreenModalLabel" aria-hidden="true"> <div class="modal-dialog modal-xl" style="width: 90%;max-width: 80%;"> <div class="modal-content" style="background-color: #1b2426 !important;"></div> </div> </div> </div> </main> <div class="container px-0 pb-3"> <div class="row mx-0 bbs_footer_at_column hidden-sm hidden-md" style="text-align: center; height: 76px;"> <div class="col-md-6 px-0" style="height: 100%;"> <a href="https://bbs.kanxue.com/thread-280627.htm" style="height: 100%;" target="_blank"> <!-- <p></p > --> <img src="https://www.kanxue.com/upload/attach/_202402261148_83HQJQM8T2UNKHC.png" width="100%" height="100%"> </a> </div> <div class="col-md-6 px-0" style="height: 100%;"> <a href="https://www.kanxue.com/book-leaflet-83.htm" style="height: 100%;" target="_blank"> <!-- <p></p > --> <img src="https://www.kanxue.com/upload/attach/_202211071314_TJXM7FJJ2AJJ4H6.jpg" width="100%" height="100%"> </a> </div> </div> </div> <footer id="footer" style="background: #3b4348; color: #9ba4aa; height: auto;"> <div class="container"> <div class="row text-muted small my-3 mx-0" id="web_base_company_information"> <div class="col-12 col-md-6"> ©2000-2025 看雪 | Based on <a href="http://bbs.xiuno.com/" target="_blank" class="text-muted">Xiuno BBS</a><br> 域名:<a href="https://www.yunaq.com/" target="_blank" class="text-muted">加速乐</a> | SSL证书:<a href="https://www.trustasia.com/trustasia" target="_blank" class="text-muted">亚洲诚信</a> | <a href="http://dun.163.com/?from=kanxue_DDoS_2018&hmsr=kanxue " target="_blank" class="text-muted">安全网易易盾</a> </div> <div class="col-12 col-md-6 pt-2 pt-md-0 text-md-right"> <span><a class="text-muted" href="https://ce.kanxue.com/project-test_read-538.htm">看雪SRC</a></span> | <span><a class="text-muted" href="/thread-260116.htm">看雪APP</a></span> | <span>公众号:ikanxue</span> | <a class="text-muted" href="https://zhuanlan.kanxue.com/article-56.htm">关于我们</a> | <a class="text-muted" href="https://www.kanxue.com/user-online_sendmsg.htm">联系我们</a> | <a href="https://zhuanlan.kanxue.com/article-1.htm" class="text-muted">企业服务</a> <br> Processed: <b>0.033</b>s, SQL: <b>31</b> / <a class="text-muted" href="http://beian.miit.gov.cn/" target="_blank">沪ICP备2022023406号</a> / <a class="text-muted" href="http://www.beian.gov.cn/portal/registerSystemInfo?domainname=%27pediy.com%27&recordcode=31011502006611" target="_blank">沪公网安备 31011502006611号</a> </div> </div> <!-- <div style="max-height: 100px; overflow-y:auto;"> </div> --> </div> </footer> <!--[if lt IE 9]> <script>window.location = 'browser.htm';</script> <![endif]--> <style> @keyframes slideInLeft { 0% { transform: translateX(0); } /* 初始状态,元素处于最右侧 */ 100% { transform: translateX(-100%); } /* 结束状态,元素移到原点位置 */ } .changeThemeBox { border-radius: 5px; box-shadow: 0 1px 2px 0 #eee; overflow: hidden; cursor: pointer; position: fixed; bottom: 160px; right: 10px; z-index: 99;width: 60px; height: 60px; } .changeThemeBox .changeTheme, .changeThemeBox .changeTheme1, .act_go_top .go_top, .act_go_top .go_top1 { transition: all 300ms; } .changeThemeBox:hover .changeTheme, .changeThemeBox:hover .changeTheme1, .act_go_top:hover .go_top, .act_go_top:hover .go_top1 { transform: translateX(-100%); } </style> <div class="act_go_top" style="overflow: hidden; cursor: pointer; border-radius: 5px; box-shadow: 0 1px 2px 0 #eee;position: fixed; bottom: 80px; right: 10px; z-index: 99; width: 60px; height: 60px; display: none;"> <a class="go_top" href="javascript:;" style="width: 60px; height: 60px;display: flex; align-items: center; justify-content: center; outline: none; text-align: center; color: #85888b; background: #fff;" title="切换主题"> <svg t="1709278113659" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2327" width="32" height="32"><path d="M4.621 514.463h98.188v327.301h98.188v-327.301h98.188v-65.449h-294.563z" fill="#3C3D3D" p-id="2328"></path><path d="M528.209 154.51l-163.446 196.347 327.273-0.219z" fill="#3C3D3D" p-id="2329"></path><path d="M331.907 841.765h327.286v-392.75h-327.286v392.75zM430.095 514.463h130.912v261.823h-130.912v-261.823z" fill="#3C3D3D" p-id="2330"></path><path d="M691.933 449.015v392.75h98.188v-163.651h229.1v-229.1h-327.286zM921.033 612.652h-130.912v-98.188h130.912v98.188z" fill="#3C3D3D" p-id="2331"></path></svg> </a> <a class="go_top1" href="javascript:;" style="position: relative; top: -60px; right: -60px; width: 60px; height: 60px;display: flex; align-items: center; justify-content: center; outline: none; text-align: center; color: #fff; background: #0099ee;" title="切换主题"> 返回<br/>顶部 </a> </div> </body> </html> <script src="/lang/zh-cn/bbs.js?1.5"></script> <script src="/view/js/jquery-3.1.0.js?1.5"></script> <script src="/view/js/popper.js?1.5"></script> <script src="/view/js/bootstrap.js?1.5"></script> <script src="/view/js/xiuno.js?1742010476"></script> <script src="/view/js/storagePlus.js"></script> <script src="//www.kanxue.com/view/js/bootstrap-plugin.js?1.5"></script> <script src="/view/js/async.js?1.5"></script> <script src="/view/js/form.js?1.5"></script> <script src="https://passport.kanxue.com/xiunoui/js_md5.js"></script> <script src="//cstaticdun.126.net/load.min.js"></script> <script src="//www.kanxue.com/view/js_bs4_beta3/logininPlug.js"></script> <script> $(function(){ $(".login_btn").on("click",function(){ $(".kx_login_plugbox").show() }) }) </script> <script> // 用于个人中心 判断路由 center ,还是 pm var debug = DEBUG = 0; var url_rewrite_on = 1; var forumarr = { "177": "x64dbg插件区", "52": "OllyDbg插件区", "53": "IDA Pro插件区", "4": "软件逆向", "69": "经典问答", "102": "科锐培训", "141": "CrackMe存档区", "2": "社区版务", "76": "1)珠海金山2007逆向分析挑战赛", "99": "《加密与解密(第4版)》", "125": "奇虎360软件安全大赛答案提交区", "21": "《软件加密技术内幕》", "68": "2)PEDIY Crackme竞赛2007", "41": "编程技术", "95": "《0day:软件漏洞分析技术》", "88": "加壳脱壳", "91": "3)2008 Exploit Me挑战赛", "158": "移动安全", "3": "PC安全", "120": "4)腾讯公司2008软件安全竞赛", "123": "《微软.NET程序的加密与解密》", "127": "5)奇虎360软件安全比赛", "37": "CTF对抗", "140": "6)PEDIY Crackme竞赛2009", "116": "CTF", "150": "二进制漏洞", "163": "《C++反汇编与逆向分析技术》", "179": "软件广场", "155": "7)腾讯公司2010软件安全竞赛", "168": "《Android安全与逆向分析》", "157": "8)2011 Exploit Me赛", "121": "9)移动安全挑战赛(MSC)", "152": "问答版块", "129": "10)第2届移动安全挑战(MSC)", "136": "职场生活", "45": "茶余饭后", "161": "Android安全", "128": "智能设备", "171": "Pwn", "162": "安全资讯", "47": "招聘专区", "97": "求助问答", "1": "站务管理/产品", "10": "安全工具", "137": "职业生涯", "151": "WEB安全", "20": "付费问答", "132": "密码应用", "166": "iOS安全", "32": "外文翻译", "65": "安全图书", "172": "原创软件", "174": "International vision", "178": "HarmonyOS" }; var fid = 37; var uid = 0; var gid = 0; $('[data-toggle="tooltip"]').tooltip(); $('#search_form > input').on('click', function () { return false; }); </script> <script src="/view/js/bbs.js?1.5"></script> <script> // 版主管理:精华 $('.mod-button button.digest').on('click', function() { var modtid = $('input[name="modtid"]').checked(); if(modtid.length == 0) return $.alert(lang.please_choose_thread); var radios = xn.form_radio('digest', {"0": "取消精华", "1": "关注","2": "优秀", "3": "精华"}); var radios2 = xn.form_radio('skill_type', {"0":"无", "7": "Reverse", "1": "PWN","2": "App", "3": "Web", "4": "IoT", "5":"Develop", "6":"MISC"}); $.confirm("设置主题为精华", function() { var tids = xn.implode('_', modtid); var digest = $('input[name="digest"]').checked(); var skill_type = $('input[name="skill_type"]').checked(); var postdata = {digest: digest, skill_type:skill_type}; $.xpost(xn.url('mod-digest-'+tids), postdata, function(code, message) { if(code != 0) return $.alert(message); // $.alert(message).delay(1000).location(''); if(digest != 0){ if(window.confirm('设置成功,是否入库?')){ $.alert('请稍等文库打开中...'); $('.chm_in').trigger('click'); }else{ location.reload(); } // $.confirm("设置成功,是否入库", function() { // $.alert('设置成功,请稍等文库打开中...'); // }); // $.alert('设置成功,请稍等文库打开中...'); // $('.chm_in').trigger('click'); }else{ $.alert(message).delay(1000).location(''); } }); }, {'body': '<p>'+"精华等级"+':'+radios+'<br>技能方向:'+radios2+'</p>'}); }) </script><script> function xn_read_unread(tids, tid) { // 当前时间 var time = xn.time(); // 多长时间内的主题为最新主题 var time_range = 86400 * 3; // 三天内的 tids var recent_tids = $.pdata('recent_tids') || {}; // 已读的 tids var view_tids = $.pdata('view_tids') || {}; // 提取列表页的 tid function fetch_recent_tids(tids) { var changed = false; $.each(tids, function(tid, last_date) { if(time - last_date < time_range) { recent_tids[tid] = last_date; changed = true; } }); if(changed) $.pdata('recent_tids', recent_tids); } // 清理最近的 tid function gc_recent_tids() { var changed = false; $.each(recent_tids, function(tid, last_date) { if(time - last_date > time_range) { delete recent_tids[tid]; changed = true; } }); if(changed) $.pdata('recent_tids', recent_tids); } function gc_view_tids() { var changed = false; $.each(view_tids, function(tid, last_date) { if(!recent_tids[tid]) { delete view_tids[tid]; changed = true; } }); if(changed) $.pdata('view_tids', view_tids); } function save_view_tid(tid) { if(!recent_tids[tid]) return; view_tids[tid] = time; $.pdata('view_tids', view_tids); } if(tids) { fetch_recent_tids(tids); gc_recent_tids(); //gc_view_tids(); } if(tid) save_view_tid(tid); // 三天内的主题标记为已读 // 遍历主题列表,标记最近的,并且未读的为加粗 $('.thread').each(function() { var jthis = $(this); var tid = jthis.attr('tid') || jthis.data('tid'); if(recent_tids[tid] && recent_tids[tid] > xn.intval(view_tids[tid])) { //jthis.find('div.subject').addClass('font-weight-bold'); jthis.find('div.subject').append('<span class="icon-new"></span>'); jthis.find('span.icon-post-grey').removeClass('icon-post-grey').addClass('icon-post-blue'); // jthis.find('.icon-new').on('click',function(){ // var tid = jthis.data('tid'); // var pages = jthis.data('pages'); // if(pages == 0 || pages == 1) { // window.open('thread-'+tid+'.htm') // } else { // window.open('thread-'+tid+'-'+pages+'.htm') // } // }) } }); // 首页未读 $('.bbs_home_page_row_div').each(function() { var jthis = $(this); var tid = jthis.attr('tid') || jthis.data('tid'); if(recent_tids[tid] && recent_tids[tid] > xn.intval(view_tids[tid])) { jthis.find('span.icon-post-grey').removeClass('icon-post-grey').addClass('icon-post-blue'); } }); // 列表页未读 // ··· // ··· // ··· } </script> <script> $(function () { setTimeout(function () { $(".bbs_home_page_three_col .small_logo").each(function (index, element) { if ($(element).children("a").length == 0) { $(".bbs_home_page_three_col .bbs_home_page_row_div").eq(index).children( 'div:first-child').removeClass("col-lg-8").addClass("col-lg-9"); $(".bbs_home_page_three_col .bbs_home_page_row_div").eq(index).children( 'div:last-child').removeClass("col-lg-4").addClass("col-lg-3"); $(".bbs_home_page_three_col .bbs_home_page_row_div").eq(index).children( 'div:first-child').children("span").css("width", "19rem"); } }) }, 2000); if (self != top) { $('#header').hide(); $('#nav2').hide(); $('#footer').hide(); } // 导航 var browser_width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; if (browser_width <= 992) { var new_p = 0, start_scrollTop = 0; $(window).scroll(function (e) { new_p = $(this).scrollTop(); if (start_scrollTop < new_p) { //下滚 $('.header_fiexd').css("display", "none"); } else { //上滚 $('.header_fiexd').css("display", "block"); } setTimeout(function () { start_scrollTop = new_p; }, 0); }); } // 切换主题 $('.changeThemeBox').click(function () { var theme = $(this).data('theme'); if(theme != 1) { theme = 1 } else { theme = 0 } $.xpost('/user-setting_style.htm', {style:theme}, function (code, message) { if (code == 0) { $.msg(message); setTimeout(function(){ window.location.href="/" },1000) } }) }); // 返回顶部 if ($(window).scrollTop() >= 500) { $('.act_go_top').fadeIn(300); } else { $('.act_go_top').fadeOut(300); } $(window).scroll(function () { if ($(window).scrollTop() >= 500) { $('.act_go_top').fadeIn(300); } else { $('.act_go_top').fadeOut(300); } }); $('.act_go_top').click(function () { $('html,body').animate({ scrollTop: '0px' }, 100); }); var d = new Date(); var session_interval = d.getTime() - $.pdata('top-banner-session'); if (session_interval > 3600000) { $.pdata('top-banner', 0); } if ($.pdata('top-banner') == 1) { $(".top-banner").hide(); } else { $(".top-banner").slideDown(); } $(".top-banner-section .closeBanner").on("click", function () { $.pdata('top-banner', 1); $.pdata('top-banner-session', d.getTime()); $(".top-banner").animate({ height: '0' }) }) // 退出登录 $.xgpost = function (url, postdata, callback, progress_callback) { if ($.isFunction(postdata)) { callback = postdata; postdata = null; } $.ajax({ type: 'POST', url: url, data: postdata, dataType: 'text', timeout: 6000000, xhrFields: { withCredentials: true }, progress: function (e) { if (e.lengthComputable) { if (progress_callback) progress_callback(e.loaded / e.total * 100); //console.log('progress1:'+e.loaded / e.total * 100 + '%'); } }, success: function (r) { if (!r) return callback(-1, 'Server Response Empty!'); var s = xn.json_decode(r); if (!s || s.code === undefined) return callback(-1, 'Server Response Not JSON:' + r); if (s.code == 0) { return callback(0, s.message); //系统错误 } else if (s.code < 0) { return callback(s.code, s.message); } else { return callback(s.code, s.message); } }, error: function (xhr, type) { if (type != 'abort' && type != 'error' || xhr.status == 403) { return callback(-1000, "xhr.responseText:" + xhr.responseText + ', type:' + type); } else { return callback(-1001, "xhr.responseText:" + xhr.responseText + ', type:' + type); console.log("xhr.responseText:" + xhr.responseText + ', type:' + type); } } }); }; $('.nav_user_item .logout').click(function () { $.xpost('/user-logout.htm', {}, function (code, message) { if (code == 0) { $.msg(message); $.xgpost('//passport.kanxue.com/user-logout.htm', "", function (code, message) { setTimeout(function () { location.reload(); }, 800) }) } }) }); }); </script> <script> (function () { var islogin = '0'; if (islogin == 0) return; var pm_number = "/user-newpm.htm"; $.xget(pm_number, function (code, message) { var pm_number = $(".pm_number"); var sysm_number = $(".system_message_number"); if (code == 0) { var newpms = parseInt(message.newpms); var system_pms = parseInt(message.system_pms); var pm_total = newpms + system_pms; if (pm_total != 0) { pm_total = pm_total > 99 ? "99+" : pm_total; if (newpms != 0) { $(".pm_message_btn").css("color", "#f44336"); } else if (newpms == 0 && system_pms > 0) { $(".pm_message_btn").css("color", "#0099ee"); } $(".newpms").html(newpms); $(".system_pms").html(system_pms); $(".pm_totals").html(pm_total); } else { // $(".pm_total_a").css("display","none"); }; if (message.newpms != 0) { pm_number.html(message.newpms); pm_number.addClass("pmmessage_number"); } else { pm_number.css("display", "none"); }; if (message.system_pms != 0) { sysm_number.html(message.system_pms); sysm_number.addClass("pmmessage_number"); } else { sysm_number.css("display", "none"); }; if (message.newpms != 0) { pm_number.html(message.newpms); pm_number.addClass("pm_numbers_"); } else { pm_number.css("display", "none"); }; if (message.system_pms != 0) { sysm_number.html(message.system_pms); sysm_number.addClass("pm_numbers_"); } else { sysm_number.css("display", "none"); }; } else { pm_number.css("display", "none"); sysm_number.css("display", "none"); } }) $(".pm_message_box").on("mouseenter", function () { $(this).find(".dropdown-menu").addClass("show"); $(this).addClass("active"); }) $(".pm_message_box").on("mouseleave", function () { $(this).find(".dropdown-menu").removeClass("show"); $(this).removeClass("active"); }) })(jQuery); </script> <script> // 统计在线 (function () { var uid = '0'; var current_time = '1742010476'; var last_time; if (uid > 0) { //10分钟以内不请求。 last_time = storagePlus.get('last_active_time_' + uid) || 0; //大于5分钟请求接口。 if ((current_time - last_time) / 60 > 5) { $.xpost('user-online_sumtime.htm', {}, function (code, msg) { if (code == 0) { storagePlus.set('last_active_time_' + uid, msg); } else { console.info('msg'); } }); } } })(); </script> <script> // $(function(){ // var www_domain = 'www.kanxue.com' // var uidNewArray = []; // $(".avatar_box").each(function(e){ // var uidIsHas = uidNewArray.indexOf($(this).data('uid')); // if(uidIsHas == -1) { // uidNewArray.push($(this).data('uid')); // } // }) // if(uidNewArray.length > 0) { // $.xpost('//'+www_domain+'/member-is_vip.htm',{'uids':uidNewArray.toString()},function(code,message){ // if(code == 0) { // message.forEach(function(item, index){ // if(item.is_vip != 0) { // $(".avatar_box[data-uid="+item.uid+"]").addClass("isVipX isVip"+item.is_vip) // $(".username_box[data-uid="+item.uid+"]").addClass("isVipColor") // } // }) // } // }) // } // }) </script> <script> var forumlist = [ { "fid": "177", "fup": "10", "name": "x64dbg插件区", "rank": "40" }, { "fid": "52", "fup": "10", "name": "OllyDbg插件区", "rank": "39" }, { "fid": "53", "fup": "10", "name": "IDA Pro插件区", "rank": "38" }, { "fid": "4", "fup": "3", "name": "软件逆向", "rank": "29" }, { "fid": "69", "fup": "97", "name": "经典问答", "rank": "29" }, { "fid": "102", "fup": "137", "name": "科锐培训", "rank": "29" }, { "fid": "141", "fup": "140", "name": "CrackMe存档区", "rank": "29" }, { "fid": "2", "fup": "1", "name": "社区版务", "rank": "28" }, { "fid": "76", "fup": "37", "name": "1)珠海金山2007逆向分析挑战赛", "rank": "28" }, { "fid": "99", "fup": "65", "name": "《加密与解密(第4版)》", "rank": "28" }, { "fid": "169", "fup": "78", "name": "15PB培训", "rank": "28" }, { "fid": "125", "fup": "127", "name": "奇虎360软件安全大赛答案提交区", "rank": "28" }, { "fid": "21", "fup": "57", "name": "《软件加密技术内幕》", "rank": "27" }, { "fid": "68", "fup": "37", "name": "2)PEDIY Crackme竞赛2007", "rank": "27" }, { "fid": "41", "fup": "3", "name": "编程技术", "rank": "27" }, { "fid": "95", "fup": "65", "name": "《0day:软件漏洞分析技术》", "rank": "27" }, { "fid": "88", "fup": "3", "name": "加壳脱壳", "rank": "26" }, { "fid": "91", "fup": "37", "name": "3)2008 Exploit Me挑战赛", "rank": "26" }, { "fid": "158", "fup": "0", "name": "移动安全", "rank": "26" }, { "fid": "3", "fup": "0", "name": "PC安全", "rank": "25" }, { "fid": "120", "fup": "37", "name": "4)腾讯公司2008软件安全竞赛", "rank": "25" }, { "fid": "57", "fup": "2", "name": "回收站", "rank": "25" }, { "fid": "123", "fup": "57", "name": "《微软.NET程序的加密与解密》", "rank": "24" }, { "fid": "127", "fup": "37", "name": "5)奇虎360软件安全比赛", "rank": "24" }, { "fid": "37", "fup": "116", "name": "CTF对抗", "rank": "23" }, { "fid": "140", "fup": "37", "name": "6)PEDIY Crackme竞赛2009", "rank": "23" }, { "fid": "116", "fup": "0", "name": "CTF", "rank": "22" }, { "fid": "150", "fup": "3", "name": "二进制漏洞", "rank": "22" }, { "fid": "163", "fup": "65", "name": "《C++反汇编与逆向分析技术》", "rank": "22" }, { "fid": "179", "fup": "0", "name": "软件广场", "rank": "21" }, { "fid": "155", "fup": "37", "name": "7)腾讯公司2010软件安全竞赛", "rank": "21" }, { "fid": "168", "fup": "65", "name": "《Android安全与逆向分析》", "rank": "21" }, { "fid": "157", "fup": "37", "name": "8)2011 Exploit Me赛", "rank": "20" }, { "fid": "121", "fup": "37", "name": "9)移动安全挑战赛(MSC)", "rank": "18" }, { "fid": "152", "fup": "0", "name": "问答版块", "rank": "18" }, { "fid": "129", "fup": "37", "name": "10)第2届移动安全挑战(MSC)", "rank": "17" }, { "fid": "136", "fup": "0", "name": "职场生活", "rank": "12" }, { "fid": "45", "fup": "136", "name": "茶余饭后", "rank": "6" }, { "fid": "161", "fup": "158", "name": "Android安全", "rank": "6" }, { "fid": "128", "fup": "158", "name": "智能设备", "rank": "5" }, { "fid": "171", "fup": "116", "name": "Pwn", "rank": "5" }, { "fid": "162", "fup": "136", "name": "安全资讯", "rank": "5" }, { "fid": "175", "fup": "137", "name": "《二万班安卓高级研修》", "rank": "5" }, { "fid": "47", "fup": "136", "name": "招聘专区", "rank": "4" }, { "fid": "97", "fup": "152", "name": "求助问答", "rank": "4" }, { "fid": "1", "fup": "0", "name": "站务管理/产品", "rank": "3" }, { "fid": "10", "fup": "179", "name": "安全工具", "rank": "3" }, { "fid": "137", "fup": "136", "name": "职业生涯", "rank": "3" }, { "fid": "151", "fup": "116", "name": "WEB安全", "rank": "3" }, { "fid": "160", "fup": "78", "name": "麦洛科菲培训", "rank": "3" }, { "fid": "176", "fup": "137", "name": "《三万班安卓高级研修》", "rank": "3" }, { "fid": "20", "fup": "152", "name": "付费问答", "rank": "2" }, { "fid": "132", "fup": "116", "name": "密码应用", "rank": "2" }, { "fid": "166", "fup": "158", "name": "iOS安全", "rank": "2" }, { "fid": "170", "fup": "57", "name": "看雪产品", "rank": "2" }, { "fid": "32", "fup": "136", "name": "外文翻译", "rank": "1" }, { "fid": "65", "fup": "1", "name": "安全图书", "rank": "1" }, { "fid": "172", "fup": "179", "name": "原创软件", "rank": "1" }, { "fid": "174", "fup": "32", "name": "International vision", "rank": "1" }, { "fid": "178", "fup": "158", "name": "HarmonyOS", "rank": "1" }, { "fid": "64", "fup": "136", "name": "会员专区", "rank": "0" }, { "fid": "78", "fup": "2", "name": "申请提交区", "rank": "0" }, { "fid": "122", "fup": "37", "name": "KCTF2024提交区(隐藏版块)", "rank": "0" }, { "fid": "29", "fup": "2", "name": "论坛版主团队", "rank": "0" } ]; // 三级版块 function forum_tree(forumlist, template) { var template = template || '<option value="{fid}">{tab}{name}</option>'+"\r\n"; var s = ''; var forumlist1 = forumlist.filter(function(v) {return v.fup == 0}); for(var i1=0; i1<forumlist1.length; i1++) { var v1 = forumlist1[i1]; s += '►'+xn.template(template, {fid: v1.fid, name: v1.name, tab: " "}); var forumlist2 = forumlist.filter(function(v2) {return v2.fup == v1.fid}); for(var i2=0; i2<forumlist2.length; i2++) { var v2 = forumlist2[i2]; s += xn.template(template, {fid: v2.fid, name: v2.name, tab: "  "}); var forumlist3 = forumlist.filter(function(v3) {return v3.fup == v2.fid}); for(var i3=0; i3<forumlist3.length; i3++) { var v3 = forumlist3[i3]; s += xn.template(template, {fid: v3.fid, name: v3.name, tab: "    "}); } } } return s; } // 版主管理:移动 / moderator : move $('.mod-button button.move').off('click').on('click', function() { var modtid = $('input[name="modtid"]').checked(); if(modtid.length == 0) return $.alert(lang.please_choose_thread); var select = '<select name="fid">'+forum_tree(forumlist)+'</select>'; $.confirm(lang.move_forum, function() { var tids = xn.implode('_', modtid); var newfid = $('select[name="fid"]').val(); $.xpost(xn.url('mod-move-'+tids+'-'+newfid), function(code, message) { if(code != 0) return $.alert(message); $.alert(message).delay(1000).location(''); }); }, {'body': '<p>'+lang.choose_move_forum+':'+select+'</p>'}); }) </script><script> // 版主管理:审核 $('.mod-button button.audit').on('click', function() { var modtid = $('input[name="modtid"]').checked(); if(modtid.length == 0) return $.alert(lang.please_choose_thread); var radios = xn.form_radio('audit', {"1": "审核通过", "2": "审核不通过"}); $.confirm('审核主题', function() { var tids = xn.implode('_', modtid); var audit = $('input[name="audit"]').checked(); var postdata = {audit: audit}; $.xpost(xn.url('mod-audit-'+tids), postdata, function(code, message) { if(code != 0) return $.alert(message); $.alert(message).delay(1000).location(''); }); }, {'body': '<p>'+'审核选项'+':'+radios+'</p>'}); }) </script><script> // 版主管理:审核 $('.mod-button button.limit').on('click', function() { var modtid = $('input[name="modtid"]').checked(); if(modtid.length == 0) return $.alert(lang.please_choose_thread); var radios = xn.form_radio('limit', {"0": "验证通过", "1": "待验证"}); $.confirm('验证主题', function() { var tids = xn.implode('_', modtid); var limit = $('input[name="limit"]').checked(); var postdata = {audit: limit}; $.xpost(xn.url('mod-newuser_audit-'+tids), postdata, function(code, message) { if(code != 0) return $.alert(message); $.alert(message).delay(1000).location(''); }); }, {'body': '<p>'+'验证选项'+':'+radios+'</p>'}); }) </script> <script> $(function() { // 版主管理:删除 / moderator : delete $('.mod-button button.delete').off('click').on('click', function() { var modtid = $('input[name="modtid"]').checked(); if(modtid.length == 0) return $.alert(lang.please_choose_thread); var radios = ''; //var htmladd = '<br><br><label class="text-small"><input type="checkbox" name="logic" value="0" /> 物理删除</label>'; //htmladd += '<br><label class="text-small"><input type="checkbox" name="logic" value="0" /> 恢复删除</label>'; $.confirm(xn.lang('confirm_delete_thread', {n:modtid.length}) + '<br><br>'+radios, function() { var tids = xn.implode('_', modtid); var type = $('input[name="type"]').checked(); $.xpost(xn.url('mod-delete-'+tids), {type: type}, function(code, message) { if(code != 0) return $.alert(message); $.alert(message).delay(1000).location(''); }); }); }) // 恢复逻辑删除的帖子 $('body').on('click', '.post_recover', function() { var jthis = $(this); var href = jthis.data('href'); var isfirst = jthis.attr('isfirst'); if(window.confirm('确定恢复删除的帖子?')) { $.xpost(href, function(code, message) { var isfirst = jthis.attr('isfirst'); if(code == 0) { if(isfirst == '1') { $.location('forum-37.htm'); } else { window.location.reload(); } } else { $.alert(message); } }); } return false; }); }) </script> <!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-WG3E345FRQ"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-WG3E345FRQ'); </script> <script src="/plugin/link/jump_prompt.js"></script> <div class="modal fade appeal" id="appeal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> <h4 class="modal-title" id="exampleModalLabel">求助问答申诉</h4> </div> <form id="form_appeal" action="post-appeal.htm" method="post"> <div class="modal-body"> <div class="form-group"> <input id="pid" name="pid" value="0" type="hidden"> <textarea class="form-control" id="brief" name="brief" rows="6" placeholder="请填写内容,注意: 请写明申诉的原因"></textarea> </div> </div> <div class="modal-footer"> <button id="appeal_submit" type="button" class="btn btn-primary" data-loading-text="正在提交...">申请提交</button> </div> </form> </div> </div> </div><div class="modal fade report" id="report" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title" id="exampleModalLabel">举报此帖</h4> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <form id="form_report" action="post-report.htm" method="post"> <div class="modal-body"> <div class="form-group"> <input id="tid" name="tid" value="0" type="hidden"> <input id="pid" name="pid" value="0" type="hidden"> <textarea class="form-control" id="brief" name="brief" rows="6" placeholder="请填写内容,注意: 请确认您所举报此帖的内容涉及到语言挑衅和违犯论坛版规的内容, 版主将收到举报后审核该帖!"></textarea> </div> </div> <div class="modal-footer"> <button id="report_submit" type="button" class="btn btn-primary" data-loading-text="正在提交...">发送报告</button> </div> </form> </div> </div> </div> <div class="modal fade sqtj" id="sqtj" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title" id="exampleModalLabel">申请推荐此帖</h4> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <form id="form_sqtj" action="post-sqtj.htm" method="post"> <div class="modal-body"> <div class="form-group"> <input id="tid" name="tid" value="0" type="hidden"> <input id="pid" name="pid" value="0" type="hidden"> <textarea class="form-control" id="brief" name="brief" rows="6" placeholder="请填写推荐的理由,注意: 请确认您所申请推荐的内容, 版主将收到申请后审核该帖!"></textarea> </div> </div> <div class="modal-footer"> <button id="sqtj_submit" type="button" class="btn btn-primary" data-loading-text="正在提交...">发送申请</button> </div> </form> </div> </div> </div> <script src="/view/js/group/iconfont.js"></script> <script src="/view/js/face.js?1.5"></script> <script src="//passport.kanxue.com/pc/view/js/qqLevel.js"></script> <script src="/view/js/feather.min.js"></script> <script src="/plugin/link/kx_url_decrypt.js"></script> <script> $(document).ready(function() { // 解码链接start var markElements = $('.message mark'); if(markElements.length > 0){ markElements.each(function () { var originalContent = $(this).text(); try { // var decodedContent = xn.urldecode(atob(originalContent)); var decodedContent = xn.urldecode(kx_url_decrypt(originalContent)); $(this).html(decodedContent); $(this).contents().unwrap(); // 移除<mark>标签 } catch (e) { console.log(' 解码错误:' + e.message); } }); } // 解码链接end // 获取当前URL中的锚点值 var hash = window.location.hash; if (hash) { console.log('回帖') // 如果存在锚点值,则执行滚动操作 // 移除原有的锚点值,确保只滚动到目标位置而不会重复加载相同内容 history.replaceState('', document.title, window.location.pathname+window.location.search); // 设置滚动条位置 $('html, body').animate({ scrollTop: $(hash).offset().top }, 'fast'); } }); feather.replace(); // feather icon 引入 var thread_uid = '967681'; var passport_domain = 'passport.kanxue.com'; // 回复 操作按钮 手机端 显示隐藏方法 开始 function mobile_more_operate(e) { $(".mobile_more_operate").hide(); $(e.target).siblings(".mobile_more_operate").fadeIn(); } $(document).scroll(function () { $(".mobile_more_operate").hide(); }) $(document).on("click", function (e) { if ($(e.target).parents(".mobile_more_operate_btn").length == 0 && !$(e.target).hasClass( 'mobile_more_operate_btn')) { $(".mobile_more_operate").hide(); } }) // 回复 操作按钮 手机端 显示隐藏方法 结束 function show_level(event) { var el = event.target; var usergid = $(el).attr("data-gid"); $.tips('<span class="level-' + usergid + ' level"></span>', $(el), { tips: [3, '#fff'], time: 2000 }); } function show_online_level(event) { var el = event.target; var userdesc = $(el).attr("data-desc"); $.tips('<span class="text-muted">' + userdesc + '</span>', $(el), { tips: [3, '#fff'], time: 2000 }); } function online_time_imgs(v) { var online_time = $(v).data('online_time'); var level = qqLevel.getLevel(online_time); var imgs = qqLevel.getImg(level, [ '//' + passport_domain + '/pc/view/img/star_0.gif', '//' + passport_domain + '/pc/view/img/star.gif', '//' + passport_domain + '/pc/view/img/moon.gif', '//' + passport_domain + '/pc/view/img/sun.gif', '//' + passport_domain + '/pc/view/img/king.gif', ]); var desc = qqLevel.getDescBbs(online_time); $(v).attr('data-desc', desc); $(v).next(".post_online_time1").html('( ' + desc + ' )'); $(v).html(imgs); } $(".post_online_time").each(function (k, v) { online_time_imgs(v) }) // 快速回帖切换到高级回复时,编辑框文字保存一下来 $('.senior_reply').on('click', function () { var quick_reply_message = $('#quick_reply_form').find('#message').val().trim(); // quick_reply_message = quick_reply_message.replace(/\[em_([0-9]+)\]/g, '<img src="/view/img/face/$1.gif" class="face" style="cursor: pointer;">'); function senior_reply_pdata(return_obj) { if (quick_reply_message.length == 0) { $.pdata('quick_reply_message', ''); } else { $.pdata('quick_reply_message', quick_reply_message); } return return_obj(); } function senior_reply_return() { window.location.href = 'post-create-275212.htm'; }; senior_reply_pdata(senior_reply_return); }) function shareTo(stype) { var ftit = ''; var flink = ''; var lk = ''; //获取文章标题 ftit = $('.subject').text(); //获取网页中内容的第一张图片 flink = $('.message img').eq(0).attr('src'); if (typeof flink == 'undefined') { flink = ''; } //当内容中没有图片时,设置分享图片为网站logo if (flink == '') { lk = 'http://bbs.kanxue.com/plugin/kanxue/img/kanxuelogo.png'; } //如果是上传的图片则进行绝对路径拼接 if (flink.indexOf('upload/') != -1) { lk = 'http://bbs.kanxue.com/' + flink; } //qq空间接口的传参 // if(stype=='qzone'){ //弹出窗口的宽度; // var iw=800; //弹出窗口的高度; // var ih=500; //获得窗口的垂直位置; // var it = (window.screen.availHeight-30-ih)/4; //获得窗口的水平位置; // var il = (window.screen.availWidth-10-iw)/4; // var openurl = 'https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url='+document.location.href+'?sharesource=qzone&title='+ftit+'&pics='+lk+'&summary='+document.querySelector('meta[name="description"]').getAttribute('content'); // window.open(openurl,"","height="+ih+", width="+iw+", top="+it+", left="+il); // } //新浪微博接口的传参 if (stype == 'sina') { var iw = 500; //弹出窗口的宽度; var ih = 500; //弹出窗口的高度; var it = (window.screen.availHeight - 30 - ih) / 4; //获得窗口的垂直位置; var il = (window.screen.availWidth - 10 - iw) / 4; //获得窗口的水平位置; var openurl = 'http://service.weibo.com/share/share.php?url=' + document.location.href + '?sharesource=weibo&title=' + ftit + '&pic=' + lk; window.open(openurl, "", "height=" + ih + ", width=" + iw + ", top=" + it + ", left=" + il); } //qq好友接口的传参 if (stype == 'qq') { var iw = 800; //弹出窗口的宽度; var ih = 500; //弹出窗口的高度; var it = (window.screen.availHeight - 30 - ih) / 4; //获得窗口的垂直位置; var il = (window.screen.availWidth - 10 - iw) / 4; //获得窗口的水平位置; var openurl = 'http://connect.qq.com/widget/shareqq/index.html?url=' + document.location.href + '?sharesource=qzone&title=' + ftit + '&pics=' + lk + '&summary=' + document.querySelector( 'meta[name="description"]').getAttribute('content') + '&desc=看雪学院,一个有情怀的安全开发者交流的网站' window.open(openurl, "", "height=" + ih + ", width=" + iw + ", top=" + it + ", left=" + il); } //生成二维码给微信扫描分享,php生成,也可以用jquery.qrcode.js插件实现二维码生成 if (stype == 'wechat') { $.tips('<img width="150" src="bbs_qrcode-http_3A_2F_2Fbbs_2epediy_2ecom_2Fthread_2d275212_2ehtm.htm">', $("#wxshare"), { tips: [2, '#eee'], time: 5000 }); } } $(function () { var threadUid= '967681'; var uid = '0'; var forum = '37' var jform = $('#quick_reply_form'); var jsubmit = $('#submit'); var postNum = $('.postlist .posts').text(); jform.on('submit', function () { if(forum == '97' && parseInt(postNum) == 0 && uid == threadUid) { $.msg('不能顶自己的帖') return false } jform.reset(); jsubmit.button('loading'); var postdata = jform.serialize(); $.xpost(jform.attr('action'), postdata, function (code, message) { if (code == 0) { var s = '<table>' + message + '</table>'; var jtr = $(s).find('tr'); jtr.insertBefore($('table.postlist tr').last()); jsubmit.button('reset'); $('#message').val(''); // 楼层 +1 var jfloor = jform.find('.floor'); jfloor.html(xn.intval(jfloor.html()) + 1); // 回复数 +1 var jposts = $('.posts'); jposts.html(xn.intval(jposts.html()) + 1); // 属于回复可见的帖子,需要刷新 if($('input#content_show').val() != 1) { window.location.reload(); } } else if (code < 0) { $.alert(message); jsubmit.button('reset'); } else { jform.find('[name="' + code + '"]').alert(message).focus(); jsubmit.button('reset'); } }); return false; }); // 显示隐藏 点赞收藏等功能 var offset_top = $("#collection_thumb").offset().top - $(document).scrollTop(); if (offset_top < document.documentElement.clientHeight) { $(".collection_thumb_left").hide(); } else { $(".collection_thumb_left").show(); } $(document).on("scroll", function () { var offset_top = $("#collection_thumb").offset().top - $(document).scrollTop(); if (offset_top < document.documentElement.clientHeight) { $(".collection_thumb_left").hide(); } else { $(".collection_thumb_left").show(); } }) //收藏功能 var jfavorite = $('.favorite'); var jlikesFirst = $('.likes:first'); var jlikes = $('.likes'); var jlikes_box = $('.likes_box'); var likenums = jlikesFirst.text(); if (parseInt(likenums) > 0) jlikes_box.removeClass("likes_box_hide").addClass("likes_box_show"); jfavorite.on('click', function () { var likenum = jlikesFirst.text(); likenum_plus = parseInt(likenum) + 1; likenum_sub = parseInt(likenum) - 1; if (likenum_sub < 0) likenum_sub = 0; $(".favorite i").addClass('shrink'); $.xpost('thread-favorite-275212.htm', function (code, message) { if (code == 0) { $(".favorite i").removeClass('icon-star-o color515a6e').addClass('icon-star colorff842a'); $(".favorite i").removeClass('shrink'); // $(".favorite .icon-star").css('color','#ff842a'); // var s = '<i class="icon-star shrink" style="color: #ff842a;"></i>'; // jfavorite.html(s); jlikes.text(likenum_plus); jlikes_box.removeClass("likes_box_hide").addClass("likes_box_show"); } else if (code == 1) { $(".favorite i").removeClass('icon-star colorff842a').addClass('icon-star-o color515a6e'); $(".favorite i").removeClass('shrink'); // var s = '<i class="icon-star-o color515a6e shrink"></i>'; // jfavorite.html(s); // $(".favorite .icon-star").remove('shrink'); // $(".favorite .icon-star-o").addClass('color515a6e'); jlikes.text(likenum_sub); // if (likenum_sub == 0) jlikes_box.removeClass("likes_box_show").addClass("likes_box_hide"); } else { $.alert(message); } }); return false; }); // 点赞 var username = ''; var page = '1'; var thumbs_num_box = $('.thumbs_num_box'); var thumbs_num_first = $(".thumbs_num:first").text(); if (parseInt(thumbs_num_first) == 0) thumbs_num_box.hide(); // 显示赞赏列表 最大20条 let thumb_list_item = $('.thumb_list_body .thumb_list_item'); if(thumb_list_item.length > 0){ $('.thumb_list_box').show() if (thumb_list_item.length > 20) { $('#thumbShowMore').show() } $('#thumbShowMore a').on('click',function(){ for (var i = 20; i < thumb_list_item.length; i++) { $(thumb_list_item).css('display','flex') } $('#thumbShowMore').hide(); }) } $('#addThumbXb').on('click',function(){ var maxValue = parseInt($('#thumb-xb').attr('max')); let thumbXbNum = parseInt($('#thumb-xb').val()) + 1 if (thumbXbNum > maxValue) { $('#thumb-xb').val(maxValue); $.tips('雪币数不超过'+maxValue, $(this), { tips: 1, time: 2000, tips: [1, '#748691'] }); return false } $('#thumb-xb').val(thumbXbNum) }) $('#thumb-xb').on('input', function() { var maxValue = parseInt($(this).attr('max')); var enteredValue = parseInt($(this).val()); if (enteredValue > maxValue) { $(this).val(maxValue); $.tips('雪币数不超过'+maxValue, $(this), { tips: 1, time: 2000, tips: [1, '#748691'] }); } }); let thumbTextArr = ['非常支持你的观点!', '这个讨论对我很有帮助,谢谢!', '感谢你分享这么好的资源!', '谢谢你的细致分析,受益匪浅!', '感谢你的积极参与,期待更多精彩内容!', '感谢你的贡献,论坛因你而更加精彩!', '你的分享对大家帮助很大,非常感谢!', '期待更多优质内容的分享,论坛有你更精彩!', '你的帖子非常有用,感谢分享!', '请遵守论坛规则,避免发布广告内容!', '请注意发帖规范,保持良好的讨论环境!']; $.each(thumbTextArr, function(index, comment) { var option = $('<option>'); option.text(comment); option.val(comment) $('#thumbModal .reward_reason').append(option); }); let randomIndex = Math.floor(Math.random() * thumbTextArr.length-2); let randomElement = thumbTextArr[randomIndex]; $('#thumb-text').val(randomElement); $('.thumb-text-refresh').on('click',function(){ $('#thumbModal select.reward_reason').val(0); let _this = this $(this).addClass('rotate') let randomIndex2 = Math.floor(Math.random() * (thumbTextArr.length-2)); let randomElement = thumbTextArr[randomIndex2]; $('#thumb-text').val(randomElement) setTimeout(function () { $(_this).removeClass('rotate') }, 1000) }) $('.thumbPost').click(function () { var threadid = `275212`; var type = 1; var num = parseInt(thumbs_num_first); var thumbxb = $('#thumb-xb').val(); var thumbText = $('#thumb-text').val(); var postdata = 'threadid=' + threadid + '&type=1&page=' + page+ '&golds=' + thumbxb+ '&comments=' + thumbText; var that = this; $.xpost('thumbs_up-thumbs.htm', postdata, function (code, message) { if (code == 0) { $('.collection_thumb_left .icon-thumbs-o-up, #collection_thumb .icon-thumbs-o-up').removeClass('icon-thumbs-o-up').addClass('icon-thumbs-up'); $('.collection_thumb_left .icon-thumbs-up, #collection_thumb .icon-thumbs-up').css('color','#ff842a'); $('.collection_thumb_left .icon-thumbs-up, #collection_thumb .icon-thumbs-up').parent('a').removeAttr('data-target'); thumbs_num_box.show(); $('.thumbs_num').text(num + 1); $('#thumbModal').modal('hide'); let thumbListDemo = `<div class="row mx-0 py-3" style="border-top: 1px dashed #cecece;"> <div class="text-truncate" style="width: 100px;">${username}</div> <div class="px-3" style="width: 100px; text-align: center; color: #ee3000;">+${thumbxb}</div> <div class="col px-2 text-muted">${thumbText}</div> <div style="width: 120px; text-align: left;">刚刚</div> </div>`; if(Number(thumbxb) == 0 ) { thumbListDemo = `<div class="row mx-0 py-3" style="border-top: 1px dashed #cecece;"> <div class="text-truncate" style="width: 100px;">${username}</div> <div class="px-3" style="width: 100px; text-align: center; color: #ee3000;"></div> <div class="col px-2 text-muted">${thumbText}</div> <div style="width: 120px; text-align: left;">刚刚</div> </div>`; } $(thumbListDemo).prependTo(".thumb_list_box .thumb_list"); $('.thumb_list_box').show(); if($('input#content_show').val() != 1) { window.location.reload(); } } else if (code == 1) { thumbs_num_box.show(); $.tips(message, $(that), { tips: 1, time: 2000, tips: [1, '#748691'] }); } else { $.tips(message, $(that), { tips: 1, time: 2000, tips: [1, '#748691'] }); } }) }) $('#collection_thumb, .collection_thumb_left').on('click','.thumbsBox .icon-thumbs-up', function(){ event.stopPropagation(); $.tips('已点赞过', $(this).parent('a'), { tips: 1, time: 2000, tips: [1, '#748691'] }); }) $("#thumbModal select.reward_reason").change(function(){ var reward_reason = $("#thumbModal select.reward_reason option:selected").val() console.log(reward_reason) if (reward_reason != 0) { $("#thumb-text").val($("#thumbModal select.reward_reason option:selected").val()); } }) let thumbtexts = ['免费','点赞']; let thumbTextCurrentIndex = 0; setInterval(() => { thumbTextCurrentIndex = (thumbTextCurrentIndex + 1) % thumbtexts.length; $('.text-cycler').fadeOut("1000",function(){ $('.text-cycler').text(thumbtexts[thumbTextCurrentIndex]) $('.text-cycler').fadeIn("1500") }) }, 2500); // 缩放图片,适应屏幕大小。 function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); // 815 : 746; // 734 746 jmessagelist.each(function () { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : first_width - 79; // 734 746 var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe').each(function () { var jimg = $(this); //if(jimg.width() < 500) return; var img_width = this.org_width; var img_height = this.org_height; if (!img_width) { var img_width = jimg.width(); var img_height = jimg.height(); this.org_width = img_width; this.org_height = img_height; } //var percent = xn.min(100, xn.ceil((img_width / jmessage_width) * 100)); if (img_width > jmessage_width) { if (this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); jdiv.find('p').each(function () { var jp = $(this); if ($.trim(jp.text()) == '') { jp.css('line-height', '1'); } }); }); } // resize_image(); // $(window).on('resize', resize_image); //---------by wang start------------------------// //取出tr的pid,赋值给tr使name为point_pid // $(".post").each(function() { // var cpid = $(this).attr("pid"); // $(this).attr("id","point_"+ cpid); // }); var url = window.location.toString(); if (url.indexOf("#") != -1) { var cpid = url.split("#")[1]; if (cpid) { $(".post").each(function (k, v) { if ($(v).attr("pid") == cpid) { var t = $(this).offset() ? $(this).offset().top : 0; //$("#frame_right").scrollTop(t); $("html,body").animate({ scrollTop: t }, 800) } }); } } //------------by wang end----------------------------// // 输入框自动伸缩 var jmessage = $('#message'); jmessage.on('focus', function () { if (jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function () { jmessage.t = setTimeout(function () { jmessage.css('height', '2.5rem'); }, 1000); }); $('#nav_pc li[fid="37"]').addClass('active'); $('#nav_mobile li[fid="37"]').addClass('active'); $(function () { $('.emotion').qqFace({ id: 'facebox', assign: 'message', path: 'view/img/face/' }); }); // 展示图片 function imgShow(outerdiv, innerdiv, bigimg, _this){ var src = _this.attr("src");//获取当前点击的pimg元素中的src属性 $(bigimg).attr("src", src);//设置#bigimg元素的src属性 /*获取当前点击图片的真实大小,并显示弹出层及大图*/ $("<img/>").attr("src", src).on('load',function(){ var windowW = $(window).width();//获取当前窗口宽度 var windowH = $(window).height();//获取当前窗口高度 var realWidth = this.width;//获取图片真实宽度 var realHeight = this.height;//获取图片真实高度 var imgWidth, imgHeight; var scale = 0.8;//缩放尺寸,当图片真实宽度和高度大于窗口宽度和高度时进行缩放 if(realHeight>windowH*scale) {//判断图片高度 imgHeight = windowH*scale;//如大于窗口高度,图片高度进行缩放 imgWidth = imgHeight/realHeight*realWidth;//等比例缩放宽度 if(imgWidth>windowW*scale) {//如宽度扔大于窗口宽度 imgWidth = windowW*scale;//再对宽度进行缩放 } } else if(realWidth>windowW*scale) {//如图片高度合适,判断图片宽度 imgWidth = windowW*scale;//如大于窗口宽度,图片宽度进行缩放 imgHeight = imgWidth/realWidth*realHeight;//等比例缩放高度 } else {//如果图片真实高度和宽度都符合要求,高宽不变 imgWidth = realWidth; imgHeight = realHeight; } $(bigimg).css("width",imgWidth);//以最终的宽度对图片缩放 var w = (windowW-imgWidth)/2;//计算图片与窗口左边距 var h = (windowH-imgHeight)/2;//计算图片与窗口上边距 $(innerdiv).css({"top":h, "left":w});//设置#innerdiv的top和left属性 $(outerdiv).fadeIn("fast");//淡入显示#outerdiv及.pimg }); $(outerdiv).off('click').on('click',function(){//再次点击淡出消失弹出层 $(this).fadeOut("fast"); }); $(outerdiv).find(".showDrawing").off('click').on('click',function(event){ event.stopPropagation(); window.open(src,'_blank') }); } // $(bigimg).off('click').on('click',function(){ // event.preventDefault(); // var img_src = $(this).attr("src"); // var img = new Image(); // img.src = img_src; // img.onload = function () { // window.open(img_src); // }; // }) $("div.message img").css("cursor", "zoom-in"); $("div.message img").on("click", function () { if (window.innerWidth > 768) { var _this = $(this);//将当前的img元素作为_this传入函数 imgShow("#imageViewerOuterdiv", "#imageViewerInnerdiv", "#bigimg", _this); } }) setTimeout(function () { $("div.message img").each(function (index, element) { if ($(element).width() >= 100) { $(element).addClass("div_message_boxShadow"); } }) }, 2000); function IsPC() { var userAgentInfo = navigator.userAgent; var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"]; var flag = true; for (var v = 0; v < Agents.length; v++) { if (userAgentInfo.indexOf(Agents[v]) > 0) { flag = false; break; } } return flag; } // 弹出分享页面 var outside = true; $(".bbsshare_btn").on('click', function (event) { outside = false; $(".bbsshare_modal").show(); }); document.body.addEventListener('click', function () { outside = true; }, true) document.body.addEventListener('click', function () { if (outside) { $(".bbsshare_modal").hide(); } }) // $(".bbsshare_btn").on('click', function(event){ // $.open({ // type: 1, // title: false, // content: $('.bd-bbsshare-modal-sm'), // offset: 'auto', // shadeClose: false, // shade: false, // }); // }); if ($.pdata('collapse_reward') && $.pdata('collapse_reward') == 1) { $("#collapse_reward").removeClass('show'); $(".collapse_btn").find("span").html("展开"); $(".collapse_btn").find("i").removeClass("icon-angle-up").addClass("icon-angle-down"); } else if ($.pdata('collapse_reward') == 0 || $.pdata('collapse_reward') == '' || $.pdata( 'collapse_reward') == null) { $("#collapse_reward").addClass('show'); $(".collapse_btn").find("span").html("收起"); $(".collapse_btn").find("i").removeClass("icon-angle-down").addClass("icon-angle-up"); } $("#collapse_reward").on('hide.bs.collapse', function () { $.pdata('collapse_reward', 1) $(".collapse_btn").find("span").html("展开"); $(".collapse_btn").find("i").removeClass("icon-angle-up").addClass("icon-angle-down"); }) $("#collapse_reward").on('show.bs.collapse', function () { $.pdata('collapse_reward', 0) $(".collapse_btn").find("span").html("收起"); $(".collapse_btn").find("i").removeClass("icon-angle-down").addClass("icon-angle-up"); }) // $(".follow_btn_svg").on("click", function(){ // var that = $(this); // $.xpost("user-follow.htm", {followed_uid: thread_uid}, function(code, message) { // if (code == 0) { // $.msg(message); // that.parent(".follow_btn_span").remove(); // } else if (code == 1) { // $.msg(message); // } // }) // }) $(".follow_btn").on("click", function () { var that = $(this); var cuid = that.attr("data-cuid"); $.xpost("user-follow.htm", { followed_uid: cuid }, function (code, message) { if (code == 0) { that.removeClass("btn-0099ee").addClass("btn-followed"); that.html('已关注'); $.msg(message); } else if (code == 1) { that.removeClass("btn-followed").addClass("btn-0099ee"); that.html('<i class="icon icon-plus"></i> 关注'); $.msg(message); } else if (code == -1) { $.msg(message); } }) }) $(".avatar_hover").on("mouseenter", function () { $(".thread-poptip-box").hide(); $(this).find(".thread-poptip-box").show(); }) $(".avatar_hover").on("mouseleave", function () { $(".thread-poptip-box").hide(); }) // 右侧块 滚动到一定位置隐藏 开始 var message_height = 0; var rightConHeight = $('.right_content.positionSticky').height(); $(window).scroll(function () { var leftConHeight = $('.left_content').height(); var message_height2 = $(".message_card .message").height(); if (message_height2 != message_height) { message_height = message_height2; } if(leftConHeight > rightConHeight) { if (window.pageYOffset > message_height) { $(".rightbox_card_hidden").hide(); } else { $(".rightbox_card_hidden").show(); } } }); // 右侧块 滚动到一定位置隐藏 结束 //广告 // function ad_count_request(data, type, adkey, num, func) { // $.xpost('//www.kanxue.com/advertisement-request.htm', "data=" + data + "&type=" + type + // "&adkey=" + adkey + "&num=" + num, // function (code, message) { // if (func) func(); // }) // } var adpostdata = $("#thread_ad").data('thread_postdata'); var adkey = "ytcDtPrW8E_2Fj0KZjl_2B5DEg_3D_3D"; // ad_count_request(adpostdata, 1, adkey, 1); $("#thread_ad").click(function () { var that = $(this); var href = $(this).data('href'); $(that).attr('target', "_blank"); $(that).attr('href', href); // ad_count_request(adpostdata, 2, adkey, 0, function () { // $(that).attr('target', "_blank"); // $(that).attr('href', href); // }); }); $(".fieldset .attachlist a.attach_li").on("click", function () { var _this = this; if ($(".down_golds").length > 0) { $.confirm($(".down_golds").text(), function () { window.open($(_this).attr("data-href")); }) } else { } }) $("div.message").on("click", "table.syntaxhighlighter",function (event) { const rect = this.getBoundingClientRect(); const afterX = rect.right + 105; // 调整伪元素的位置 const afterY = rect.top + 125; // 调整伪元素的位置 // 检查点击位置是否在伪元素的范围内 if (event.clientX <= afterX && event.clientX >= rect.right && event.clientY <= afterY && event.clientY >= rect.top) { $('#fullScreenModal .modal-dialog .modal-content').html($(event.target).clone()); $('#fullScreenModal').modal('show'); } }) }); </script> <div style="position: absolute;top: 50%;left: 50%;transform: translateX(-50%) translateY(-50%);" class="modal fade bd-example-modal-sm" id="wxpay_modal" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true"> <div class="modal-dialog modal-sm"> <div class="modal-content text-center "> <div class="" style="height: 55px; border-bottom: 1px solid rgba(204, 204, 204, 0.26); background-image: url(./view/img/pay_s.png); background-repeat: no-repeat; background-position: bottom center;"> <button type="button" class="close mr-3" style="margin-top: 1.5rem;" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> <span class="sr-only">Close</span> </button> </div> <div class="wxpay_modal_body"> </div> </div> </div> </div> <script> var jpay_form = $('#pay_kx'); var jkxpay = $('.kx-pay'); var rid = 0; var check_handle = null; function topay(){ clearInterval(check_handle); check_handle = null; var valtype = $("input[name='reward_type']:checked").val(); var rmbstype = $("input[name='reward_rmbs']:checked").val(); if(!valtype) { alert('请您选择一个支付方式!'); return false; } if(rmbstype < 1) { alert("打赏金额不能少于1雪花"); return false; }else if(valtype == 1){ if(_is_weixin) { $.alert('请用其它浏览器打开再用赞赏功能!'); return false; } window.Popup = window.open('about:blank', '_blank','width='+window.screen.width+',height='+window.screen.height+', ...'); var ptdata = jpay_form.serialize(); jkxpay.button('loading'); $.xpost('reward_pay-charge.htm', ptdata, function(code, message) { if(code == 0) { Popup.blur(); Popup.opener.focus(); Popup.location = 'reward_pay-reward_alipay-'+ message +'.htm'; jkxpay.button('reset'); $('.reward').modal('hide'); check_setInterval(message); } else if(code < 0) { Popup.close(); alert(message); jkxpay.button('reset'); } else { Popup.close(); alert(message); jkxpay.button('reset'); } }); return false; }else if(valtype == 2){ var postdata = jpay_form.serialize(); jkxpay.button('loading'); $.xpost('reward_pay-reward_remainder.htm', postdata, function(code, message) { if(code == 0) { $.alert(message); jkxpay.button('reset'); $('.reward').modal('hide'); window.location.reload(); } else if(code < 0) { $.alert(message); jkxpay.button('reset'); } else { $.alert(message); jkxpay.button('reset'); } }); return false; }else if(valtype == 3) { // $('#wxpay_modal').modal({backdrop: 'static', keyboard: false}); var ptdata = jpay_form.serialize(); jkxpay.button('loading'); $.xpost('reward_pay-charge.htm', ptdata, function(code, message) { if(code == 0) { //微信支付 $.xget('reward_pay-wxpay-'+ message +'.htm',function(cd,msg) { if(cd == 0) { check_setInterval(message); //$(".wxpay_code img").attr('src', 'http://paysdk.weixin.qq.com/example/qrcode.php?data='+ msg); var wx_img = '<div class="pt-3 text-center"><img src="./view/img/wxpay2.png" style="height: 40px;"></div>\ <div class="modal-body wxpay_code pt-3 pb-3">\ <div style="width: 80%;text-align:center; margin: 0 auto;">\ <span class="wx_img"><img alt="扫码支付" style="width: 60%;" src="//bbs.kanxue.com/reward_pay-wxcode-'+ xn.urlencode(msg) +'.htm"/></span>\ <span class="pay_success_shadow" style="display: none;"></span>\ </div>\ <div class="text-center text-muted mt-3">打开微信扫一扫,即可完成支付</div>\ <div class="swal2-icon swal2-success swal2-animate-success-icon">\ <span class="swal2-success-line-tip "></span>\ <span class="swal2-success-line-long "></span></div></div>'; $(".wxpay_modal_body").html(wx_img); jkxpay.button('reset'); $(".reward").modal('hide'); $('#wxpay_modal').modal({backdrop: 'static', keyboard: false}); $('#wxpay_modal').modal('show'); } else { $.alert(msg); jkxpay.button('reset'); } }) return false; } else { $.alert(message); jkxpay.button('reset'); } }); return false; }else{ $('.reward').modal('hide'); return false; } } function check_status(rid) { var val_type = $("input[name='reward_type']:checked").val(); $.xpost('reward_pay-check.htm', {checkid: rid}, function(code, message) { if(code == 0) { if(val_type == 1) { Popup.close(); } $.alert('恭喜您,赞赏成功!'); setTimeout(function() { window.location.reload(); }, 3000); // if(check_handle) { clearInterval(check_handle); check_handle = null; // } } else { return false; } }); } function check_setInterval(rid) { check_handle = setInterval(function() { check_status(rid); }, 3000); } window._is_weixin = function() { var _ua = window.navigator.userAgent.toLowerCase(); if (_ua.match(/MicroMessenger/i) == 'micromessenger') { return true; } else { return false; } }() $("select.reward_reason").change(function(){ console.log( $("select.reward_reason option:selected").val()); var reward_reason = $("select.reward_reason option:selected").val() if (reward_reason != 0) { $(".reward_reason_textarea").val($("select.reward_reason option:selected").val()); } }) </script><script> var jform_appeal = $('#form_appeal'); var appeal_submit = $('#appeal_submit'); appeal_submit.on('click', function() { jform_appeal.reset(); appeal_submit.button('loading'); var postdata = jform_appeal.serialize(); $.xpost(jform_appeal.attr('action'), postdata, function(code, message) { if(code == 0) { $.alert(message); appeal_submit.button('reset'); setTimeout(function(){window.location.reload(); }, 2000); } else { $.alert(message); appeal_submit.button('reset'); } }); return false; }); $('#appeal').on('show.bs.modal', function (event) { var button = $(event.relatedTarget) var pid = button.data('pid'); var modal = $(this); modal.find('.modal-body #pid').val(pid); }) </script><script> var jform_report = $('#form_report'); var report_submit = $('#report_submit'); report_submit.on('click', function() { jform_report.reset(); report_submit.button('loading'); var postdata = jform_report.serialize(); $.xpost(jform_report.attr('action'), postdata, function(code, message) { if(code == 0) { $.alert(message); report_submit.button('reset'); setTimeout(function(){window.location.reload(); }, 1000); } else { $.alert(message); report_submit.button('reset'); } }); return false; }); $('#report').on('show.bs.modal', function (event) { var button = $(event.relatedTarget) var tid = button.data('tid'); var pid = button.data('pid'); var modal = $(this); modal.find('.modal-body #tid').val(tid); modal.find('.modal-body #pid').val(pid); }) var jform_sqtj = $('#form_sqtj'); var sqtj_submit = $('#sqtj_submit'); sqtj_submit.on('click', function() { jform_sqtj.reset(); sqtj_submit.button('loading'); var postdata = jform_sqtj.serialize(); $.xpost(jform_sqtj.attr('action'), postdata, function(code, message) { if(code == 0) { $.alert(message); sqtj_submit.button('reset'); setTimeout(function(){window.location.reload(); }, 1000); } else { $.alert(message); sqtj_submit.button('reset'); } }); return false; }); $('#sqtj').on('show.bs.modal', function (event) { var button = $(event.relatedTarget) var tid = button.data('tid'); var pid = button.data('pid'); var modal = $(this); modal.find('.modal-body #tid').val(tid); modal.find('.modal-body #pid').val(pid); }) </script><!--游客下载附件关注微信公众号--> <div class="modal fade download_code" id="download_code" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal-dialog modal-sm" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">游客下载提示</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <form id="form_download" action="" method="post" target="_blank"> <div class="modal-body text-center"> <input id="aid" name="aid" value="0" type="hidden"> <dl class="row"> <dd class="text-left" style="width:50%"> <div style="font-size:14px"> <div>1.请先关注公众号。</div> <div>2.点击菜单"更多"。</div> <div>3.选择获取下载码。</div> </div> </dd> <dt><img src="view/img/wxgz.jpg" width="80%"></dt> </dl> <fieldset class="form-group"> <input class="form-control" type="text" id="download_code" name="download_code" placeholder="请输入下载码" value="" /> </fieldset> </div> <div class="modal-footer"> <button id="download_submit" type="button" class="btn btn-primary" data-loading-text="正在提交...">下载</button> </div> </form> </div> </div> </div> <script> var jform_download = $('#form_download'); var jdownload_submit = $('#download_submit'); jdownload_submit.on('click', function() { jform_download.reset(); jdownload_submit.button('loading'); var postdata = jform_download.serialize(); var aid2 = jform_download.find('.modal-body #aid').val(); $.xpost(jform_download.attr('action'), postdata, function(code, message) { if(code == 0) { jdownload_submit.button('下载中...'); var href = "attach-download-"+aid2+"-"+message+".htm"; window.location = href; setTimeout(function() { jdownload_submit.button('reset'); jform_download.find('.modal-body #download_code').val(''); }, 1500); } else { $.alert(message); jdownload_submit.button('reset'); } }); return false; }); $('#download_code').on('show.bs.modal', function (event) { var button = $(event.relatedTarget) var aid = button.data('aid'); var modal = $(this); var down_action="attach-download_code-"+aid+".htm"; modal.find('.modal-body #aid').val(aid); modal.find('#form_download').attr('action', down_action); }) </script><script> var page = '1'; $('#thumb').click(function() { var threadid = '275212'; var type = 1; var num = parseInt($('#thread_thumb_num').text()); var postdata = 'threadid=' + threadid + '&type=1&page='+page; var that = this; $.xpost('thumbs_up-thumbs.htm', postdata, function(code, message) { if(code == 0) { var s = '<i class="icon-thumbs-o-up" style="color: #0099ee;"></i> <span style="color: #0099ee;">已赞</span>'; $('#thumb').children('a').html(s); $('#thread_thumb_num').text(num + 1); $.tips('感谢您的赏识!您已向主题帖作者发送 '+message+' 个雪币,表达感谢', $(that), { tips:1, time: 2000, tips: [1,'#748691'] }); } else { $.tips(message, $(that), { tips: 1, time: 2000, tips: [1,'#748691'] }); } }) }) </script> <script> $(document).on('click','.reply_thumb',function(){ var index = $('.reply_thumb').index(this); var threadid = $(this).find('input').eq(0).val(); var praised_uid = $(this).find('input').eq(1).val(); var pid = $(this).find('input').eq(2).val(); var num = parseInt($('.thumb_num').eq(index).text()); var postdata = 'threadid=' + threadid + '&praised_uid=' + praised_uid +'&pid=' + pid + '&type=2&page='+page; var that = this; $.xpost('thumbs_up-thumbs.htm', postdata, function(code, message) { if(code == 0) { var s = '<i class="icon-thumbs-o-up" style="color: #0099ee;"></i>'; var new_num = num + 1; $('.reply_thumb').eq(index).children('a').html(s); $('.thumb_num').eq(index).text(num + 1); $.tips('英雄所见略同!您已向该回帖发送 '+message+' 个雪币,表达感谢', $(that), { tips: [1,'#748691'], time: 4000, }); } else { $.tips(message, $(that), { time: 4000, tips: [1,'#748691'] }); } }) }) </script><script> xn_read_unread({"275212": "1678268232"}, 275212); </script><script> jsearch_form = $('#search_form'); jsearch_form.on('submit', function() { var keyword = jsearch_form.find('input[name="keyword"]').val(); var url = xn.url('search-'+xn.urlencode(keyword)); window.location = url; return false; }); </script><script> // 语法高亮 if($('div.message pre').length > 0) { $.require_css('plugin/xn_syntax_hightlighter/syntax_hightlighter/syntax.css'); $.require('plugin/xn_syntax_hightlighter/syntax_hightlighter/syntax.js', function() { SyntaxHighlighter.all(); }); } function quickCodeHandler(e) { var target = e.target, highlighterDiv = $(e.target).parents('.syntaxhighlighter'), container = $(e.target).parents('.container').eq(0), textarea = document.createElement('textarea'), highlighter; if (!container || !highlighterDiv || container.find('textarea').length > 0) return; // highlighter = getHighlighterById(highlighterDiv.id); // add source class name highlighterDiv.addClass('source') // Have to go over each line and grab it's text, can't just do it on the // container because Firefox loses all \n where as Webkit doesn't. var lines = container[0].childNodes, code = []; console.log(lines) for (var i = 0; i < lines.length; i++) code.push(lines[i].innerText || lines[i].textContent); // using \r instead of \r or \r\n makes this work equally well on IE, FF and Webkit code = code.join('\r'); // For Webkit browsers, replace nbsp with a breaking space code = code.replace(/\u00a0/g, " "); // inject <textarea/> tag textarea.appendChild(document.createTextNode(code)); container[0].appendChild(textarea); // preselect all text textarea.focus(); textarea.select(); // set up handler for lost focus $(textarea).off('blur').on('blur', function(e) { textarea.parentNode.removeChild(textarea); highlighterDiv.removeClass('source') }) }; $(".syntaxhighlighter .code").off('dblclick').on("dblclick",function(e){ quickCodeHandler(e) }) </script> <!-- 目录生成JS --> <script src="/view/js/tocbot.min.js"></script> <script> $(function () { // 目录生成 start var header_div = ['h1', 'h2', 'h3']; var show_tocbot = 0; for (var i = 0; i < header_div.length; i++) { var h_ob = $(".message_card .message " + header_div[i]); if (h_ob.length > 0) show_tocbot = 1; h_ob.each(function (index) { // $('.toc-tree a[href="#'+$(this).attr("id")+'"]') $(this).attr("id", "msg_header_" + header_div[i] + "_" + index); }); } if (show_tocbot == 1) { $(".show_tocbot").show(); } tocbot.init({ // Where to render the table of contents. tocSelector: '.js-toc', // Where to grab the headings to build the table of contents. contentSelector: '.message_card .message', // Which headings to grab inside of the contentSelector element. headingSelector: 'h1, h2, h3', // For headings inside relative or absolute positioned containers within content. hasInnerContainers: true, }); // $(window).on("scroll",function(){ // console.log(1); // }) // 选择需要观察变动的节点 const targetNode = document.getElementById('js-toc'); // 观察器的配置(需要观察什么变动) const config = { attributes: true, childList: true, subtree: true }; // 当观察到变动时执行的回调函数 const callback = function (mutationsList, observer) { // Use traditional 'for loops' for IE 11 for (let mutation of mutationsList) { // if (mutation.type === 'childList') { // console.log('A child node has been added or removed.'); // } // else if (mutation.type === 'attributes') { targetNode.scrollTo(0, document.getElementsByClassName("is-active-li")[0].offsetTop); } } }; // 创建一个观察器实例并传入回调函数 const observer = new MutationObserver(callback); // 以上述配置开始观察目标节点 observer.observe(targetNode, config); // 目录生成 end }) </script> <!-- 统计代码 --> <script> (function() { var tracking_code = 'TC_1735530867_9693'; var button_selector = '.bbs_thread'; var page_url = 'https://bbs.kanxue.com/thread-284686.htm'; // 曝光统计 window.addEventListener('load', function() { $.xpost('//www.kanxue.com/track-exposure.htm', { tracking_code: tracking_code, page_url: page_url, type: 1 },function(code, message) {}); }); // 点击统计 if(document.querySelector(button_selector)) { document.querySelector(button_selector).addEventListener('click', function() { $.xpost('//www.kanxue.com/track-click.htm', { tracking_code: tracking_code, page_url: page_url, type: 2 }); }); } })(); </script>