博文

08_angr_constraints writeup

08_angr_constraints这题官方给的脚本似乎有问题,可行的解法是: import angr def main (): path_to_binary = r"08_angr_constraints" project = angr.Project(path_to_binary, auto_load_libs = False ) init_state = project.factory.entry_state() simgr = project.factory.simgr(init_state) find_address = 0x08048673 simgr.explore( find =find_address) if simgr.found: solution_state = simgr.found[ 0 ] buffer_address = 0x0804A050 constrained_bitvector = solution_state.memory.load(buffer_address, 16 ) target_string = b"AUPDNNPROEZRJWKB" solution_state.add_constraints(constrained_bitvector == target_string) flag = solution_state.posix.dumps( 0 ) print ( f" password : { flag.decode( 'utf-8' , errors = 'ignore' ) } " ) if __name__ == "__main__" : main() 关键点是不要定位到“Good Job”,而是把地址find_address定在调用校验函数check_equals_AUPDNNPROEZRJWKB之前

8kSec DroidView Ultimate Private Browsing Solution writeup

图片
题目要求 漏洞利用程序应禁用 Tor 路由,然后将用户重定向到一个由攻击者控制的页面。分析代码的时候发现有两种方法。 解法一: 当action为ACTION_TOGGLE_SECURITY时,MainActivity的onNewIntent会调用handleSecurityToggle handleSecurityToggle会调用setSecurityEnabled 当参数为false的时候,setSecurityEnabled会调用unregisterReceiver注销tor状态监听器 看看torStatusReceiver的定义 所以可以如下命令 禁用 Tor 路由: adb shell am start -a com.eightksec.droidview.TOGGLE_SECURITY -n com.eightksec.droidview/.MainActivity --ez enable_security false --activity-single-top 需要注意的是,要添加 --activity-single-top参数触发onNewIntent函数 接着将用户重定向到一个由攻击者控制的页面 adb shell am start -a com.eightksec.droidview.LOAD_URL  -n com.eightksec.droidview/.MainActivity --es url "httpx://www.xxx.com"   --activity-single-top 解法二: 在AndroidManifest.xml中可以到导出了一个com.eightksec.droidview.TokenService服务, TokenService提供了返回当前token的方法getSecurityToken 所以可以绑定到 TokenService 获取token。 这里尝试通过frida动态绑定到TokenService    console . log ( "Script loaded. Waiting for MainActivity to be created..." ); Java . perform ( function () {     let l...

8kSec BorderDroid International Border Protection writeup

图片
 查看AndroidManifest.xml发现com.eightksec.borderdroid.receiver.RemoteTriggerReceiver是导出的,可以通过adb 发送广播解锁,但是题目的要求说 攻击不应要求设备具有 root 权限,启用 USB 调试可用于侦查,但为使其符合实际情况,本挑战的解决方案应坚持使用 "非 USB 攻击",所以这不是最优解。但是题目又提到“ 设备被扣押时,仍连接到不安全的机场 WiFi 网络 ”,推测大概是通过网络层面发起攻击。这里注意到一个服务com.eightksec.borderdroid.service.HttpUnlockService,虽然没有导出。  服务启动的时候会监听8080端口  netstat看下 当收到/unlock请求且post数据包是json格式时,形如:{"pin": 111111},会调用broadcastVulnerableUnlockIntentWithPin 显然这个broadcastVulnerableUnlockIntentWithPin函数会发送广播到RemoteTriggerReceiver RemoteTriggerReceiver验证pin值是对的后会调用performUnlockActions解锁屏幕 poc演示,当pin值正确时成功远程解锁: 当然,题目说“ 使用硬编码秘密来解决挑战也不是解决挑战的正确方法 ”,因为pin值是6位数,可遍历pin值爆破发送解锁请求。

windows虚拟机中Android Studio启动模拟器踩坑记录

windows虚拟机中Android Studio启动模拟器状态一直是Booting,通过命令行C:\Android\Sdk\emulator\emulator.exe -netdelay none -netspeed full -avd Medium_Phone_API_35 -qt-hide-window -grpc-use-token -idle-grpc-timeout 300 启动emulator输出报错:USER_WARNING | Suggested minimum number of CPU cores to run avd 'Medium_Phone_API_35' is 4 (available: 2) ,通过搜索修改虚拟机cpu core的数为4即可。再次命令行启动输出报错:Android Studio Emulator Failed to load [vulkan-1.dll],通过搜索把C:\Android\Sdk\emulator\lib64\vulkan\vulkan-1.dll 拷贝一份到C:\Android\Sdk\emulator\lib64\ 目录下 或C:\Windows\System32即可。 然后直接在Android Studio界面可成功启动模拟器,但是模拟器会不停弹窗提示The system ui isn't responding in android emulator, 通过搜索把$HOME/.android/avd/MyAvdName.avd/config.ini文件中的hw.gpu.mode的值从auto 改为host,还有的建议是从"hw.gpu.enabled=no hw.gpu.mode=auto"改为"hw.gpu.enabled=no hw.gpu.mode=off" 或者"hw.gpu.enabled=yes hw.gpu.mode=host",重新启动,稍等几分钟后就不再提示isn't responding。     参考:      https://stackoverflow.com/a/71668492 https://stackoverflow.com/a/68233639 https...

tabby 1.3.x安装和Neo4j数据库配置

图片
     网上大部分资料都是1.3.x之前的教程,tabby作者给出的语雀安装指南页面显示有点问题        折腾了下终于安装完成。      首先是tabby安装:      直接从https://github.com/wh1t3p1g/tabby/releases/ 下载tabby,从 https://github.com/wh1t3p1g/tabby-vul-finder 下载tabby-vul-finder,编译后将target目录下生成的tabby-vul-finder.jar拷贝到tabby.jar同级目录,config目录的db.properties拷贝到tabby子目录config目录下,rules目录下的cyphers.yml拷贝到 tabby子目录rules目录下。      然后是Neo4j安装:      直接参考 https://www.yuque.com/wh1t3p1g/tp0c1t/wx6fiha89p0wu6s5 就行,下载Neo4j和对应版本的apoc-core和apoc-extended库,从https://github.com/wh1t3p1g/tabby-path-finder/releases 下载tabby-path-finder-1.1.jar,要修改的地方就是“dbms.security.procedures.unrestricted=jwt.security.*,apoc.*” 应为“dbms.security.procedures.unrestricted=jwt.security.*,apoc.*,tabby.*”,其他步骤跟着教程走就行。有个注意的地方就是Neo4j启动的时候会自动生成一个“Example Project”,且自带一个默认的dbms,这个数据库连接不上(它的密码不是password),所以需要自己新建个dbms,设置下连接密码为password。     坑点:      在windows上运行tabby.jar会报错: ERROR 2084...

[OGeek2019]Easy Real World 2 writeup

图片
  网上的writeup基本是ssh命令处存在拼接可RCE,我在测试的时候发现文章https://cloud.tencent.com/developer/article/1866793提到GateOne有CVE-2020-35736 任意文件读取漏洞,试一下:

油猴脚本之恢复知乎关注专栏功能

图片
     知乎把关注专栏功能给删除了,但是保留了取消关注专栏功能            抓包看了下取消关注:          留意到在这个请求之前有个OPTIONS包,支持PUT,DELETE等方法,推测关注应该就是PUT          尝试PUT发现报错          换其他专栏试试              关注成功,看来是已关注的专栏不能再关注     那么脚本的思路便有了,脚本如下:   // ==UserScript== // @name 知乎关注专栏 // @namespace http://tampermonkey.net/ // @version 0.1 // @description 恢复知乎关注专栏功能 // @author You // @match https://www.zhihu.com/column/* // @require https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js // @grant none // ==/UserScript== //copy from https://gist.githubusercontent.com/raw/2625891/waitForKeyElements.js function waitForKeyElements ( selectorTxt, /* Required: The jQuery selector string that specifies the desired element(s). */ actionFunction, /* Required: The code to ru...