GithubHelp home page GithubHelp logo

surge_crack's Introduction

Surge v4 full crack.

仅学习用途,请勿挪作他用

FOR STUDY PURPOSES ONLY

敏感信息已模糊处理

基本类型

license type:

  • 1: Trial
  • 2: Licensed
  • 3: Revoked

过反调试

程序开头使用ptrace反调试,可以静态/动态patch过掉,参见

https://cardaci.xyz/blog/2018/02/12/a-macos-anti-debug-technique-using-ptrace/

伪造license

license在~/Library/Application\ Support/com.nssurge.surge-mac/的xattr中,被签过名。

  • 在0x000000000处,将1改为2(licensed),该函数用于判定license类型并赋值给一个license type的全局变量(0x000000000)
  • 0x000000000处的函数验证了license的签名,patch该函数可以过掉签名验证,然后license随便写
  • 验证签名使用EVP算法,尝试劫持本地公钥,伪造license和签名

应用重签名

应用有签名,使用

codesign -s - -fv path

重新Ad-Hoc签名后应用联网出现问题,控制变量进行实验发现只要重签名就出问题,因此推测程序内存在某种检查。使用dtrace检查syscall,发现程序执行过程中读到了自己的embedded code signature,因此使用dtrace监控stacktrace:

#!/usr/sbin/dtrace -s

syscall::pread:entry
/ pid == $1 && arg3 == 0x000000000 /
{
    ustack(50);
}

结合结果进行检查发现函数0x000000000调用了和codesign有关的函数,提取了当前应用的codesign信息中的teamID(Surge公司的ID为XXXXXXXX),并求出各位的和:

sum(map(lambda x: ord(x), "XXXXXXXX"))

在0x000000000的函数中,这个和被用于计算出某个关键网络地址,重新签名后patch上述函数,应用成功联网。

来自helper的二次验证

上述步骤完成后发现Surge主程序不定时闪退,调试发现收到SIGKILL,使用dtrace监控:

#!/usr/sbin/dtrace -s

syscall::kill:entry
/ (args[0] == $1 && args[1] == 9) /
{
    printf("[%s - %d - %d] sent SIGKILL\n",
           execname, pid, tid);
}

发现信号来自helper,因此分析helper发现有检查:

  1. patch一下,将SecCode检查过掉
  2. 对helper进行重签名,注意先使用lipo将help strip成单一架构的binary,否则codesign重签名后验证依然不通过(因为只签了当前架构的)
  3. 使用codesign -d -r- path命令查看helper和主程序的designated requirement,据此修改helper和主程序的Info.plist的SMPrivilegedExecutables域并重签名,直至使用 https://raw.githubusercontent.com/keybase/client/master/osx/Helper/SMJobBlessUtil.py 校验通过。

破解结果如下,程序稳定运行:

surge_crack's People

Contributors

m4tsuri avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.