惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 【当耐特】
Stack Overflow Blog
Stack Overflow Blog
V
Visual Studio Blog
小众软件
小众软件
The Cloudflare Blog
T
Tailwind CSS Blog
Apple Machine Learning Research
Apple Machine Learning Research
爱范儿
爱范儿
美团技术团队
WordPress大学
WordPress大学
罗磊的独立博客
Microsoft Azure Blog
Microsoft Azure Blog
A
About on SuperTechFans
Last Week in AI
Last Week in AI
月光博客
月光博客
博客园 - Franky
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
G
Google Developers Blog
GbyAI
GbyAI
B
Blog
大猫的无限游戏
大猫的无限游戏
博客园 - 聂微东
Hugging Face - Blog
Hugging Face - Blog
博客园 - 叶小钗

博客园 - 朱燚:-)

想用Nginx代理一切?行! [SuProxy]Ngnix+Lua 实现SSH2,LDAP,ORACLE,SQLSERVER等TCP/IP协议分析,劫持,代理,会话及负载 现场填坑系列:mongodb 复制集跨机房同步网络问题探查 现场填坑系列:使用bulk操作提高性能,解决mongoshake 向ES同步延迟。 Oracle TNS 协议分析——1、系列开篇:方法论及基础知识 Oracle TNS 314 协议分析——4、SQL执行流程与包分析 Oracle TNS 314 协议分析——3、连接认证流程与包分析 Oracle TNS 314 协议分析——2、基础包结构 要想让计划任务“坑”死你的系统,你一定要这样写 回归是一种进步 Linux日知录(常用问题笔记) [轻松一下]-笑话巨搞,饭后帮助消化 [转]用数据说话,看Google 怎样被陷害 [转]22条经典的编程引言 [转]UI设计好文--颜色与UI 博客专家和论坛专家--来自两个星球的生物 RUP_相关资源 求职vs招聘--交锋中的交流技巧 [转]Windbg的学习记录(一)
Oracle TNS 314 协议分析——5、错误返回
朱燚:-) · 2020-05-11 · via 博客园 - 朱燚:-)

错误请求涉及的包有Marker包(PacketType 0x0C)和Data Error(DataType 0x06 DataID 0x17 CallID 0x02)包

​                                    .....

if(command:match("forbidden")) then
                    --set a flag indicate error happen
                    ngx.ctx.responseError=true
                    print("forbidden matched...")
                    --return marker1
                    reqsock:send(string.char(0x00,0x0b,0x00,0x00,0x0c,0x00,0x00,0x00,0x01,0x00,0x01))
                    --return marker2
                    reqsock:send(string.char(0x00,0x0b,0x00,0x00,0x0c,0x00,0x00,0x00,0x01,0x00,0x02))
                    goto continue
                end

        
        --process req marker, if flag true then return error
        if(data:byte(3)==12 and ngx.ctx.responseError) then
            print("return error message")
            --11g
            if(tnsVersion==314 and oracleVersion.major==11) then
                reqsock:send(string.char(           
0x00, 0x75, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
0x00, 0x00, 0x04, 0x05, 0x00, 0x00, 0x00, 0x05,
0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x04, 0x00,
0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x28, 0x4f, 0x52, 0x41,
0x2d, 0x30, 0x30, 0x39, 0x34, 0x32, 0x3a, 0x20,
0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x6f, 0x72,
0x20, 0x76, 0x69, 0x65, 0x77, 0x20, 0x64, 0x6f,
0x65, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x65,
0x78, 0x69, 0x73, 0x74, 0x0a))
            end
            --12c
            if(tnsVersion==314 and oracleVersion.major==12) then
                reqsock:send(string.char(
0x00, 0xb4, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
0x00, 0x00, 0x17, 0x02, 0x04, 0x00, 0x04, 0x33,
0x35, 0x38, 0x34, 0x04, 0x01, 0x00, 0x00, 0x00,
0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x07,
0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x40, 0xbb, 0x3d, 0x24, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
0x04, 0x00, 0x00, 0x18, 0x4f, 0x52, 0x41, 0x2d,
0x30, 0x31, 0x30, 0x33, 0x31, 0x3a, 0x20, 0xe6,
0x9d, 0x83, 0xe9, 0x99, 0x90, 0xe4, 0xb8, 0x8d,
0xe8, 0xb6, 0xb3, 0x0a))
            end
            
            if(tnsVersion==312) then
                reqsock:send(string.char(
0x00, 0xb4, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
0x00, 0x00, 0x17, 0x02, 0x04, 0x00, 0x04, 0x32,
0x37, 0x30, 0x30, 0x04, 0x05, 0x00, 0x00, 0x00,
0x56, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x07,
0x04, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x0e,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x60, 0xe6, 0xe9, 0x0f, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
0x04, 0x00, 0x00, 0x18, 0x4f, 0x52, 0x41, 0x2d,
0x30, 0x31, 0x30, 0x33, 0x31, 0x3a, 0x20, 0xe6,
0x9d, 0x83, 0xe9, 0x99, 0x90, 0xe4, 0xb8, 0x8d,
0xe8, 0xb6, 0xb3, 0x0a))
            end
            ngx.ctx.responseError=nil
            goto continue
        end