Skip to content

Commit

Permalink
v1.2
Browse files Browse the repository at this point in the history
添加cmd传参数,关闭默认全文件扫描
  • Loading branch information
moyuwa committed Apr 30, 2024
1 parent 1032c21 commit 6e1e769
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 19 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,17 @@

![gui1](run1.png)

![gui1](run2.png)
![gui2](run2.png)

支持的功能

√ 特征so库扫描:通过对比加固特征so库名/路径,判断是否有加固
√ 校验签名:校验V2签名,判断是否存在Janus漏洞
√ 密钥泄露:扫描Apk文件内容,匹配是否有密钥字符串
√ 反环境检测:扫描Dex文件搜索是否有Root、模拟器、反调试检测

使用参数-s=true(默认false)开启全文件硬编码信息扫描

ApkCheckPack.exe -s=false -f test.apk

![gui3](run3.png)
48 changes: 30 additions & 18 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,35 +1,44 @@
package main

import (
"flag"
"fmt"
"os"
"path/filepath"
"strings"
)

var arg_scanhardcode = flag.Bool("s", false, "-s=true\t是否扫描全文件的硬编码信息")
var arg_filepath = flag.String("f", "", "-f test.apk\t指定apk文件路径或目录")

//var dirpath = flag.String("d", "", "-d D:/apkfiles")

func main() {
if len(os.Args) < 2 {
fmt.Println("请提供APK文件路径或文件夹路径作为命令行参数。")
fmt.Println("请提供APK文件路径或文件夹路径作为命令行参数s。")
fmt.Println("用法:ApkCheckPack.exe -s=false -f test.apk")
return
}
flag.Parse()
//fmt.Println("命令行参数arg_filepath的值:", *arg_filepath)
//fmt.Println("命令行参数arg_scanhardcode的值:", *arg_scanhardcode)
//fmt.Println("参数:", flag.Args())

info, err := os.Stat(*arg_filepath)
if err != nil {
fmt.Printf("无效的路径:%s\n", *arg_filepath)
return
}

for _, arg := range os.Args[1:] {
info, err := os.Stat(arg)
if info.IsDir() {
err := scanAPKFolder(*arg_filepath)
if err != nil {
fmt.Printf("无效的路径:%s\n", arg)
continue
fmt.Printf("扫描APK文件夹 %s 失败:%v\n", *arg_filepath, err)
}

if info.IsDir() {
err := scanAPKFolder(arg)
if err != nil {
fmt.Printf("扫描APK文件夹 %s 失败:%v\n", arg, err)
}
} else {
err := scanAPKFile(arg)
if err != nil {
fmt.Printf("扫描APK文件 %s 失败:%v\n", arg, err)
}
} else {
err := scanAPKFile(*arg_filepath)
if err != nil {
fmt.Printf("扫描APK文件 %s 失败:%v\n", *arg_filepath, err)
}
}
}
Expand Down Expand Up @@ -66,9 +75,12 @@ func scanAPKFolder(folderPath string) error {

func scanAPKFile(filePath string) error {
//fmt.Printf("scanAPKFile")
verifyApk(filePath)
PackByLibSo(filePath)
ScanAPKAnti(filePath)
verifyApk(filePath)
ScanAPKHardCoded(filePath) //匹配规则待调整
if *arg_scanhardcode {
ScanAPKHardCoded(filePath) //匹配规则待调整
}

return nil
}
Binary file modified run2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added run3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6e1e769

Please sign in to comment.