forked from iSafeBlue/TrackRay
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
module/src/main/java/com/trackray/module/crawler/FileParse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.trackray.module.crawler; | ||
|
||
import com.trackray.base.bean.Vulnerable; | ||
import com.trackray.base.enums.Language; | ||
import com.trackray.base.enums.WEBServer; | ||
import com.trackray.base.plugin.CrawlerPlugin; | ||
import org.javaweb.core.net.HttpResponse; | ||
|
||
import java.net.MalformedURLException; | ||
|
||
/** | ||
* @author 浅蓝 | ||
* @email [email protected] | ||
* @since 2019/6/24 18:11 | ||
*/ | ||
public class FileParse extends CrawlerPlugin { | ||
@Override | ||
public boolean check() { | ||
WEBServer webServer = this.task.getResult().getSystemInfo().getWebServer(); | ||
Language language = this.task.getResult().getSystemInfo().getLanguage(); | ||
String file = this.target.getFile(); | ||
boolean endFlag = file.endsWith("jpg")||file.endsWith("png")||file.endsWith("js")||file.endsWith("css"); | ||
return endFlag && (webServer==WEBServer.IIS7 || webServer==WEBServer.NGINX) && language == Language.PHP; | ||
} | ||
|
||
@Override | ||
public void process() { | ||
String url = this.target.toString().concat("/.php"); | ||
try { | ||
HttpResponse httpResponse = requests.url(url).get(); | ||
String contentType = httpResponse.getContentType(); | ||
if (contentType.contains("text/html")){ | ||
addVulnerable( | ||
Vulnerable.builder() | ||
.title("PHP 文件解析漏洞") | ||
.address(url) | ||
.payload(url) | ||
.type(Vulnerable.Type.CODE_EXECUTION.getType()) | ||
.level(Vulnerable.Level.HIGH.getLevel()) | ||
.build() | ||
); | ||
} | ||
} catch (MalformedURLException e) { | ||
} | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
module/src/main/java/com/trackray/module/crawler/LoginFormLeak.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package com.trackray.module.crawler; | ||
|
||
import com.trackray.base.annotation.Plugin; | ||
import com.trackray.base.annotation.Rule; | ||
import com.trackray.base.bean.Vulnerable; | ||
import com.trackray.base.plugin.CrawlerPlugin; | ||
import org.jsoup.Jsoup; | ||
import org.jsoup.nodes.Document; | ||
import org.jsoup.select.Elements; | ||
|
||
/** | ||
* @author 浅蓝 | ||
* @email [email protected] | ||
* @since 2019/6/24 18:18 | ||
*/ | ||
@Plugin(title = "后台登录页面泄漏" ,author = "浅蓝" ) | ||
@Rule() | ||
public class LoginFormLeak extends CrawlerPlugin { | ||
@Override | ||
public boolean check() { | ||
Document parse = response.parse(); | ||
|
||
if (parse!=null){ | ||
Elements select = parse.select("input[type=password]"); | ||
return !select.isEmpty(); | ||
} | ||
|
||
return false; | ||
} | ||
|
||
@Override | ||
public void process() { | ||
|
||
addVulnerable( | ||
Vulnerable.builder() | ||
.title("登录页面泄漏") | ||
.type(Vulnerable.Type.INFO_LEAKAGE.getType()) | ||
.level(Vulnerable.Level.LOW.getLevel()) | ||
.address(target.toString()) | ||
.build() | ||
); | ||
|
||
} | ||
} |