抓取sybase中进程正在执行的sql脚本

本文介绍了一种简单的方法来获取SQL Server中特定进程正在执行的SQL脚本。通过登录数据库并使用sp_who查看活跃进程,再利用dbcctraceon和dbcsqltext命令组合,可以快速定位并抓取出指定进程的SQL语句。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在数据库运行的过程中

也许我们会有这样的需求 就是想知道其中某个进程在使用什么SQL脚本进程操作

但是并不是每个进程都是可以抓取的到的 因为有些进程本身就没有在执行sql

当然大家可以利用各种工具去抓取比如: 易博龙等

有个简单的办法如下:

1.登录到数据库

isql -Sserver_name -Usa -P123456


2.查看当前活跃的过程

sp_who

go

这样就会有很多信息出来 然后找出其中一个进程的 spid:  比如 2111

3.对进程 spid为 2111 正在执行的 sql进行抓取

dbcc traceon(3604)

go
dbcc sqltext(2111)

go

这样 这个进程锁执行的语句就被抓取出来了。


C:\Users\Liangsize\Desktop\新建文件夹 (2)\sqlmap-master>py sqlmap.py -u http://eci-2zejez60usoykirva1cz.cloudeci1.ichunqiu.com/?id=1 -batch -dbs ___ __H__ ___ ___[,]_____ ___ ___ {1.9.3.3#dev} |_ -| . [(] | .'| . | |___|_ [(]_|_|_|__,| _| |_|V... |_| https://sqlmap.org [!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program [*] starting @ 14:41:09 /2025-03-22/ [14:41:10] [INFO] testing connection to the target URL [14:41:10] [INFO] testing if the target URL content is stable [14:41:10] [INFO] target URL content is stable [14:41:10] [INFO] testing if GET parameter 'id' is dynamic [14:41:10] [WARNING] GET parameter 'id' does not appear to be dynamic [14:41:10] [WARNING] heuristic (basic) test shows that GET parameter 'id' might not be injectable [14:41:10] [INFO] testing for SQL injection on GET parameter 'id' [14:41:10] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause' [14:41:11] [INFO] testing 'Boolean-based blind - Parameter replace (original value)' [14:41:11] [INFO] testing 'MySQL >= 5.1 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (EXTRACTVALUE)' [14:41:11] [INFO] testing 'PostgreSQL AND error-based - WHERE or HAVING clause' [14:41:12] [INFO] testing 'Microsoft SQL Server/Sybase AND error-based - WHERE or HAVING clause (IN)' [14:41:12] [INFO] testing 'Oracle AND error-based - WHERE or HAVING clause (XMLType)' [14:41:12] [INFO] testing 'Generic inline queries' [14:41:12] [INFO] testing 'PostgreSQL > 8.1 stacked queries (comment)' [14:41:13] [INFO] testing 'Microsoft SQL Server/Sybase stacked queries (comment)' [14:41:13] [INFO] testing 'Oracle stacked queries (DBMS_PIPE.RECEIVE_MESSAGE - comment)' [14:41:13] [INFO] testing 'MySQL >= 5.0.12 AND time-based blind (qu
最新发布
03-23
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值