Skip to content

Commit

Permalink
更新插件
Browse files Browse the repository at this point in the history
  • Loading branch information
iSafeBlue committed Jun 25, 2019
1 parent fd15c8f commit c60e27d
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 0 deletions.
46 changes: 46 additions & 0 deletions module/src/main/java/com/trackray/module/crawler/FileParse.java
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) {
}
}
}
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()
);

}
}

0 comments on commit c60e27d

Please sign in to comment.