Skip to content

Commit

Permalink
更新插件
Browse files Browse the repository at this point in the history
  • Loading branch information
iSafeBlue committed May 12, 2019
1 parent 8777c01 commit f1b40ec
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 77 deletions.
61 changes: 44 additions & 17 deletions module/src/main/java/com/trackray/module/inner/FingerScan.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,18 @@
import com.trackray.base.enums.FingerPrint;
import com.trackray.base.plugin.CommonPlugin;
import com.trackray.base.plugin.InnerPlugin;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.io.FileUtils;
import org.javaweb.core.net.HttpResponse;
import org.springframework.beans.factory.annotation.Value;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.MalformedURLException;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

@Rule(enable = false)
@Plugin(value="fingerScan",title = "指纹扫描" , author = "浅蓝" )
Expand All @@ -36,28 +43,32 @@ public FingerPrint start() {
continue;
FingerBean[] beans = finger.getFingers();
for (FingerBean bean : beans) {
if (bean.isMatch()){
try {
String url = target.concat(bean.getUrl());
try {
HttpResponse response = requests.url(url).get();
int statusCode = response.getStatusCode();
String content = response.body();
if ( statusCode==200
&&
(content.contains(bean.getMatch())
||
content.matches(bean.getMatch())
)){
HttpResponse response = requests.url(url).get();
int statusCode = response.getStatusCode();
String content = response.body();
if (bean.isMatch()){

if ( statusCode!=404
&&
(content.contains(bean.getMatch())
||
content.matches(bean.getMatch())
)){
return scaned(finger);
}

}else{

String md5 = bean.getMd5();
if (matchMd5(response,md5)){
return scaned(finger);
}
} catch (MalformedURLException e) {
continue;
}

}else{
//TODO:...md5
} catch (MalformedURLException e) {
continue;
}

}
}
return FingerPrint.unknown;
Expand All @@ -68,4 +79,20 @@ private FingerPrint scaned(FingerPrint finger) {
task.getResult().getSystemInfo().setFinger(finger);
return finger;
}

@Value("${temp.dir}")
private String temp;
private boolean matchMd5(HttpResponse req, String match) {
if (req.getStatusCode() == 404)
return false;
String uuid = UUID.randomUUID().toString();
String body = req.body();
try {
FileUtils.writeStringToFile(new File(temp.concat(uuid)),body);
String md5 = DigestUtils.md5Hex(new FileInputStream(temp.concat(uuid)));
return md5.equals(match);
} catch (IOException e) {
return false;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @email [email protected]
* @since 2019/5/10 12:56
*/
@Plugin(title = "ceye.io 插件" ,author = "浅蓝")
@Plugin(title = "ceye.io 插件" ,desc = "ceye.io DNSlog 回显插件,可以查询http和dns日志",author = "浅蓝")
public class FuckCeye extends InnerPlugin<Boolean> {
@Value("${ceye.io.token}")
public String token;
Expand Down
31 changes: 0 additions & 31 deletions module/src/main/java/com/trackray/module/plugin/ios/mvcTest.java

This file was deleted.

12 changes: 0 additions & 12 deletions module/src/main/resources/templates/mvcTest/index.html

This file was deleted.

11 changes: 0 additions & 11 deletions module/src/main/resources/templates/mvcTest/test.html

This file was deleted.

14 changes: 9 additions & 5 deletions web/src/main/java/com/trackray/web/handle/ScannerJob.java
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@ private void fuckThorough() {
*/
private void fuckDir() {
SysLog.info("开始扫描目录");
FuzzDir fuzzDir = new FuzzDir();
FuzzDir fuzzDir = dispatchController.getAppContext().getBean(FuzzDir.class);

fuzzDir.setTask(task);
threadPool.submit(fuzzDir);
SysLog.info("扫描目录结束");
Expand All @@ -297,7 +298,8 @@ private void fuckCrawler() {
*/
private void fuckFinger() {
SysLog.info("开始鉴别指纹");
FingerScan fingerScan = new FingerScan();
FingerScan fingerScan = dispatchController.getAppContext().getBean(FingerScan.class);

fingerScan.setTask(task);
//threadPool.submit(fingerScan);
fingerScan.executor();
Expand All @@ -321,7 +323,7 @@ private void fuckPort() {
*/
private void fuckBroDomain() {
SysLog.info("开始扫描兄弟域名");
FuckBroDomain broDomain = new FuckBroDomain();
FuckBroDomain broDomain = dispatchController.getAppContext().getBean(FuckBroDomain.class);
broDomain.setTask(task);
threadPool.submit(broDomain);
SysLog.info("扫描兄弟域名结束");
Expand All @@ -332,7 +334,8 @@ private void fuckBroDomain() {
*/
private void fuckChildDomain() {
SysLog.info("开始扫描子域名");
FuckChildDomain childDomain = new FuckChildDomain();
FuckChildDomain childDomain = dispatchController.getAppContext().getBean(FuckChildDomain.class);

childDomain.setTask(task);
threadPool.submit(childDomain);
SysLog.info("扫描子域名结束");
Expand All @@ -344,7 +347,8 @@ private void fuckChildDomain() {
*/
private void fuckWhois() {
SysLog.info("开始检查域名基本信息");
FuckWhois whois = new FuckWhois();
FuckWhois whois = dispatchController.getAppContext().getBean(FuckWhois.class);

whois.setTask(task);
threadPool.submit(whois);
SysLog.info("检查域名基本信息结束");
Expand Down

0 comments on commit f1b40ec

Please sign in to comment.