Skip to content

Commit 347bba6

Browse files
committed
支持maven打包
1 parent 1713ca5 commit 347bba6

File tree

4 files changed

+71
-5
lines changed

4 files changed

+71
-5
lines changed

.gitignore

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Compiled class file
2+
*.class
3+
4+
# Eclipse
5+
.project
6+
.classpath
7+
.settings/
8+
9+
# Intellij
10+
*.ipr
11+
*.iml
12+
*.iws
13+
.idea/
14+
.vscode/
15+
16+
# Maven
17+
target/
18+
19+
# Gradle
20+
build
21+
.gradle
22+
23+
# Log file
24+
*.log
25+
log/
26+
27+
# out
28+
**/out/
29+
30+
# Mac
31+
.DS_Store
32+
33+
temp/

pom.xml

+10-4
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@
2828
<!-- <artifactId>jna-platform</artifactId>-->
2929
<!-- <version>4.1.0</version>-->
3030
<!-- </dependency>-->
31-
31+
<dependency>
32+
<groupId>net.java.dev.jna</groupId>
33+
<artifactId>jna-platform</artifactId>
34+
<version>1.2.0</version>
35+
<scope>system</scope>
36+
<systemPath>${project.basedir}/lib/tinyjna.jar</systemPath>
37+
</dependency>
3238
</dependencies>
3339

3440
<build>
@@ -60,9 +66,9 @@
6066
<mainClass>asexploits.ShellcodeLoader</mainClass>
6167
</manifest>
6268
</archive>
63-
<descriptorRefs>
64-
<descriptorRef>jar-with-dependencies</descriptorRef>
65-
</descriptorRefs>
69+
<descriptors>
70+
<descriptor>src/main/resources/assembly.xml</descriptor>
71+
</descriptors>
6672
</configuration>
6773
<executions>
6874
<execution>

src/main/java/asexploits/ShellcodeLoader.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class ShellcodeLoader {
1818
static Kernel32 kernel32;
1919
static IKernel32 iKernel32;
2020
public static String[] ProcessArrayx32 = {"C:\\Windows\\SysWOW64\\ARP.exe", "C:\\Windows\\SysWOW64\\at.exe", "C:\\Windows\\SysWOW64\\auditpol.exe", "C:\\Windows\\SysWOW64\\bitsadmin.exe", "C:\\Windows\\SysWOW64\\bootcfg.exe", "C:\\Windows\\SysWOW64\\ByteCodeGenerator.exe", "C:\\Windows\\SysWOW64\\cacls.exe", "C:\\Windows\\SysWOW64\\chcp.com", "C:\\Windows\\SysWOW64\\CheckNetIsolation.exe", "C:\\Windows\\SysWOW64\\chkdsk.exe", "C:\\Windows\\SysWOW64\\choice.exe", "C:\\Windows\\SysWOW64\\cmdkey.exe", "C:\\Windows\\SysWOW64\\comp.exe", "C:\\Windows\\SysWOW64\\diskcomp.com", "C:\\Windows\\SysWOW64\\Dism.exe", "C:\\Windows\\SysWOW64\\esentutl.exe", "C:\\Windows\\SysWOW64\\expand.exe", "C:\\Windows\\SysWOW64\\fc.exe", "C:\\Windows\\SysWOW64\\find.exe", "C:\\Windows\\SysWOW64\\gpresult.exe"};
21-
public static String[] ProcessArrayx64 = {"C:\\Windows\\System32\\rundll32.exe", "C:\\Windows\\System32\\find.exe", "C:\\Windows\\System32\\notepad.exe", "C:\\Windows\\System32\\ARP.EXE"};
21+
public static String[] ProcessArrayx64 = {"C:\\Windows\\System32\\rundll32.exe", "C:\\Windows\\System32\\find.exe", "C:\\Windows\\System32\\fc.exe", "C:\\Windows\\System32\\ARP.EXE", "C:\\Windows\\System32\\expand.exe"};
2222

2323
static {
2424
kernel32 = (Kernel32) Native.loadLibrary(Kernel32.class, W32APIOptions.UNICODE_OPTIONS);

src/main/resources/assembly.xml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<assembly>
2+
3+
<id>jar-with-dependencies</id>
4+
5+
<formats>
6+
<format>jar</format>
7+
</formats>
8+
9+
<includeBaseDirectory>false</includeBaseDirectory>
10+
<dependencySets>
11+
<!-- 默认的配置 -->
12+
<dependencySet>
13+
<outputDirectory>/</outputDirectory>
14+
<useProjectArtifact>true</useProjectArtifact>
15+
<unpack>true</unpack>
16+
<scope>runtime</scope>
17+
</dependencySet>
18+
19+
<!-- 增加scope类型为system的配置 -->
20+
<dependencySet>
21+
<outputDirectory>/</outputDirectory>
22+
<useProjectArtifact>true</useProjectArtifact>
23+
<unpack>true</unpack>
24+
<scope>system</scope>
25+
</dependencySet>
26+
</dependencySets>
27+
</assembly>

0 commit comments

Comments
 (0)