ja3box 项目使用教程
ja3boxextract ja3(s) when sniffing or from a pcap.项目地址:https://gitcode.com/gh_mirrors/ja/ja3box
1. 项目的目录结构及介绍
ja3box/
├── .gitignore
├── LICENSE
├── README.md
├── ja3box.py
└── test.json
- .gitignore: 用于指定Git版本控制系统忽略的文件和目录。
- LICENSE: 项目的许可证文件,本项目使用MIT许可证。
- README.md: 项目说明文档,包含项目的基本信息和使用方法。
- ja3box.py: 项目的主程序文件,用于提取JA3指纹。
- test.json: 测试文件,用于存储测试数据。
2. 项目的启动文件介绍
ja3box.py 是项目的启动文件,主要功能是提取JA3指纹。以下是该文件的基本结构和功能介绍:
import scapy
import colorama
import cryptography
# 主函数
def main():
# 解析命令行参数
parser = argparse.ArgumentParser(description="Extract JA3(s) when sniffing or from a pcap")
parser.add_argument("-i", type=str, help="interface or list of interfaces")
parser.add_argument("-f", type=str, help="local pcap filename")
parser.add_argument("-of", type=str, help="print result to")
parser.add_argument("-bpf", type=str, help="BPF")
parser.add_argument("--type", choices=["ja3", "ja3s", "all"], help="get pure ja3/ja3s")
parser.add_argument("--json", action="store_true", help="print result as json")
parser.add_argument("--savepcap", action="store_true", help="save the raw pcap")
parser.add_argument("-pf", type=str, help="save the raw pcap as")
args = parser.parse_args()
# 根据参数执行相应功能
if args.i:
# 在线模式
sniff_and_extract(args.i, args.bpf, args.type, args.json, args.savepcap, args.pf)
elif args.f:
# 离线模式
extract_from_pcap(args.f, args.type, args.json, args.savepcap, args.pf)
else:
print("Please specify an interface or a pcap file.")
if __name__ == "__main__":
main()
3. 项目的配置文件介绍
本项目没有显式的配置文件,所有的配置都是通过命令行参数进行设置的。以下是主要的命令行参数及其功能:
- -i: 指定网络接口或接口列表,用于在线模式。
- -f: 指定本地pcap文件名,用于离线模式。
- -of: 指定输出结果的文件名。
- -bpf: 指定BPF(Berkeley Packet Filter)。
- --type: 指定提取的类型,可以是
ja3
、ja3s
或all
。 - --json: 指定输出结果为JSON格式。
- --savepcap: 指定保存原始pcap文件。
- -pf: 指定保存原始pcap文件的文件名。
通过这些参数,用户可以根据需要灵活配置和使用ja3box项目。
ja3boxextract ja3(s) when sniffing or from a pcap.项目地址:https://gitcode.com/gh_mirrors/ja/ja3box
创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考