Skip to content

Commit b021c39

Browse files
committed
Merge branch 'release/0.2.0'
2 parents 7e2431d + e95ae62 commit b021c39

21 files changed

Lines changed: 301 additions & 101 deletions

.env.sample

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ DROIDGROUND_SHUTDOWN_DISABLED=false # Feature enabled by default if not set othe
1818
DROIDGROUND_START_ACTIVITY_DISABLED=false # Feature enabled by default if not set otherwise
1919
DROIDGROUND_START_RECEIVER_DISABLED=false # Feature enabled by default if not set otherwise
2020
DROIDGROUND_START_SERVICE_DISABLED=false # Feature enabled by default if not set otherwise
21-
DROIDGROUND_TERMINAL_DISABLED=false # Feature enabled by default if not set otherwise
21+
DROIDGROUND_TERMINAL_DISABLED=false # Feature enabled by default if not set otherwise
22+
DROIDGROUND_EXPLOIT_APP_DURATION=10 # The time (in seconds) the exploit app will be active before the target app is restarted. This field makes sense only if the App Manager is enabled. Default value is 10

.github/workflows/release.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ jobs:
1212
contents: write
1313
steps:
1414
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
1518
- uses: ncipollo/release-action@v1
1619

1720
- name: Update changelog

README.md

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -75,29 +75,30 @@ Almost all features are **modular** and defined via environment variables, ensur
7575

7676
The `.env.sample` file in the root directory is a good starting point. This is the full list of all env variables currently supported:
7777

78-
| Variable | Description | Default |
79-
| ------------------------------------- | -------------------------------------------------- | ----------- |
80-
| `DROIDGROUND_APP_PACKAGE_NAME` | Package name of target app | - |
81-
| `DROIDGROUND_ADB_HOST` | ADB host | `localhost` |
82-
| `DROIDGROUND_ADB_PORT` | ADB port | `5037` |
83-
| `DROIDGROUND_DEVICE_TYPE` | `usb` or `network` | `usb` |
84-
| `DROIDGROUND_DEVICE_HOST` | IP of Android device (`adb`) (network mode only) | - |
85-
| `DROIDGROUND_DEVICE_PORT` | port of Android device (`adb`) (network mode only) | - |
86-
| `DROIDGROUND_INIT_SCRIPTS_FOLDER` | Folder containing `setup.sh` and `reset.sh` | `/init.d` |
87-
| `DROIDGROUND_HOST` | Bind address | `0.0.0.0` |
88-
| `DROIDGROUND_PORT` | Bind port | `4242` |
89-
| `DROIDGROUND_APP_MANAGER_DISABLED` | Disable app manager | `false` |
90-
| `DROIDGROUND_BUG_REPORT_DISABLED` | Disable bugreport | `false` |
91-
| `DROIDGROUND_FILE_BROWSER_DISABLED` | Disable file browser | `false` |
92-
| `DROIDGROUND_FRIDA_DISABLED` | Disable Frida support | `false` |
93-
| `DROIDGROUND_FRIDA_TYPE` | `jail` or `full` | `jail` |
94-
| `DROIDGROUND_LOGCAT_DISABLED` | Disable logcat | `false` |
95-
| `DROIDGROUND_REBOOT_DISABLED` | Disable reboot | `false` |
96-
| `DROIDGROUND_SHUTDOWN_DISABLED` | Disable shutdown | `false` |
97-
| `DROIDGROUND_START_ACTIVITY_DISABLED` | Disable startActivity | `false` |
98-
| `DROIDGROUND_START_RECEIVER_DISABLED` | Disable broadcast | `false` |
99-
| `DROIDGROUND_START_SERVICE_DISABLED` | Disable startService | `false` |
100-
| `DROIDGROUND_TERMINAL_DISABLED` | Disable terminal | `false` |
78+
| Variable | Description | Default |
79+
| ------------------------------------- | ---------------------------------------------------- | ----------- |
80+
| `DROIDGROUND_APP_PACKAGE_NAME` | Package name of target app | - |
81+
| `DROIDGROUND_ADB_HOST` | ADB host | `localhost` |
82+
| `DROIDGROUND_ADB_PORT` | ADB port | `5037` |
83+
| `DROIDGROUND_DEVICE_TYPE` | `usb` or `network` | `usb` |
84+
| `DROIDGROUND_DEVICE_HOST` | IP of Android device (`adb`) (network mode only) | - |
85+
| `DROIDGROUND_DEVICE_PORT` | port of Android device (`adb`) (network mode only) | - |
86+
| `DROIDGROUND_INIT_SCRIPTS_FOLDER` | Folder containing `setup.sh` and `reset.sh` | `/init.d` |
87+
| `DROIDGROUND_HOST` | Bind address | `0.0.0.0` |
88+
| `DROIDGROUND_PORT` | Bind port | `4242` |
89+
| `DROIDGROUND_APP_MANAGER_DISABLED` | Disable app manager | `false` |
90+
| `DROIDGROUND_BUG_REPORT_DISABLED` | Disable bugreport | `false` |
91+
| `DROIDGROUND_FILE_BROWSER_DISABLED` | Disable file browser | `false` |
92+
| `DROIDGROUND_FRIDA_DISABLED` | Disable Frida support | `false` |
93+
| `DROIDGROUND_FRIDA_TYPE` | `jail` or `full` | `jail` |
94+
| `DROIDGROUND_LOGCAT_DISABLED` | Disable logcat | `false` |
95+
| `DROIDGROUND_REBOOT_DISABLED` | Disable reboot | `false` |
96+
| `DROIDGROUND_SHUTDOWN_DISABLED` | Disable shutdown | `false` |
97+
| `DROIDGROUND_START_ACTIVITY_DISABLED` | Disable startActivity | `false` |
98+
| `DROIDGROUND_START_RECEIVER_DISABLED` | Disable broadcast | `false` |
99+
| `DROIDGROUND_START_SERVICE_DISABLED` | Disable startService | `false` |
100+
| `DROIDGROUND_TERMINAL_DISABLED` | Disable terminal | `false` |
101+
| `DROIDGROUND_EXPLOIT_APP_DURATION` | The time (in seconds) the exploit app will be active | `10` |
101102

102103
## 🧩 Use Cases
103104

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "droidground",
3-
"version": "0.1.1",
3+
"version": "0.2.0",
44
"type": "module",
55
"author": "Angelo Delicato",
66
"scripts": {
@@ -46,7 +46,7 @@
4646
"frida": "^16.7.14",
4747
"lottie-react": "^2.4.1",
4848
"motion": "^12.10.4",
49-
"multer": "^1.4.5-lts.2",
49+
"multer": "^2.0.0",
5050
"pino": "^9.6.0",
5151
"pino-http": "^10.4.0",
5252
"pino-pretty": "^13.0.0",

src/client/api/rest.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
IGenericResultRes,
1111
StartActivityRequest,
1212
StartBroadcastRequest,
13+
StartExploitAppRequest,
1314
StartServiceRequest,
1415
} from "@shared/api";
1516
import { REST_API_ENDPOINTS as E } from "@shared/endpoints";
@@ -49,6 +50,11 @@ class RESTManager {
4950
return res;
5051
}
5152

53+
async startExploitApp(data: StartExploitAppRequest): Promise<AxiosResponse<IGenericResultRes>> {
54+
const res = await http.post<IGenericResultRes>(E.EXPLOIT_APP, data);
55+
return res;
56+
}
57+
5258
async startService(data: StartServiceRequest): Promise<AxiosResponse<IGenericResultRes>> {
5359
const res = await http.post<IGenericResultRes>(E.SERVICE, data);
5460
return res;

src/client/components/StartActivityModal.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ export const StartActivityModal: React.FC<IModalProps> = ({ dialogRef }) => {
6262
<dialog ref={dialogRef} className="modal">
6363
<div className="modal-box max-w-3xl">
6464
<h3 className="font-bold text-lg mb-4">Start Activity</h3>
65+
<p className="mb-4">
66+
This will allow you start an activity <b>belonging to the target app only</b>!
67+
</p>
6568
<form onSubmit={handleSubmit(startActivity)} className="space-y-4">
6669
{/* Main Fields */}
6770
<input

src/client/components/StartBroadcastModal.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ export const StartBroadcastModal: React.FC<IModalProps> = ({ dialogRef }) => {
6767
<dialog ref={dialogRef} className="modal">
6868
<div className="modal-box max-w-3xl">
6969
<h3 className="font-bold text-lg mb-4">Send Broadcast Intent</h3>
70+
<p className="mb-4">
71+
This will allow you send a <i>Broadcast Intent</i> <b>belonging to the target app only</b>!
72+
</p>
7073
<form onSubmit={handleSubmit(startBroadcastReceiver)} className="space-y-4">
7174
<input
7275
type="text"
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
import { useEffect } from "react";
2+
import { SubmitHandler, useForm } from "react-hook-form";
3+
import toast from "react-hot-toast";
4+
import { RESTManagerInstance } from "@client/api/rest";
5+
import { StartExploitAppRequest } from "@shared/api";
6+
7+
interface IModalProps {
8+
dialogRef: React.RefObject<HTMLDialogElement | null>;
9+
}
10+
11+
export const StartExploitAppModal: React.FC<IModalProps> = ({ dialogRef }) => {
12+
const {
13+
register,
14+
handleSubmit,
15+
reset,
16+
formState: { errors },
17+
} = useForm<StartExploitAppRequest>();
18+
19+
useEffect(() => {
20+
const handleClose = () => {
21+
reset();
22+
};
23+
24+
const dialog = dialogRef.current;
25+
if (dialog) {
26+
dialog.addEventListener("close", handleClose);
27+
}
28+
29+
return () => {
30+
if (dialog) {
31+
dialog.removeEventListener("close", handleClose);
32+
}
33+
};
34+
}, []);
35+
36+
const startExploitApp: SubmitHandler<StartExploitAppRequest> = async data => {
37+
if (!data.packageName) {
38+
return;
39+
}
40+
41+
try {
42+
await RESTManagerInstance.startExploitApp(data);
43+
toast.success("Exploit app correctly started.");
44+
dialogRef.current?.close();
45+
} catch (e) {
46+
console.error(e);
47+
toast.error("Failed to start exploit app.");
48+
}
49+
};
50+
51+
return (
52+
<dialog ref={dialogRef} className="modal">
53+
<div className="modal-box max-w-3xl">
54+
<h3 className="font-bold text-lg mb-4">Start Exploit App</h3>
55+
<p className="mb-4">
56+
This will allow you start one of the installed apps as the <b>Exploit App</b>. <br />
57+
The app will stay active for the amount of time selected by the host and then the <b>Target App</b> will be
58+
restarted.
59+
</p>
60+
<form onSubmit={handleSubmit(startExploitApp)} className="space-y-4">
61+
<input
62+
type="text"
63+
placeholder="com.exploit.app"
64+
className="input input-bordered w-full"
65+
{...register("packageName", { required: true })}
66+
/>
67+
{errors.packageName && <p className="text-error text-sm">Package Name is required.</p>}
68+
69+
{/* Submit */}
70+
<div className="flex justify-end">
71+
<input className="btn btn-primary" type="submit" value="Start Exploit App" />
72+
</div>
73+
</form>
74+
</div>
75+
<form method="dialog" className="modal-backdrop">
76+
<button>close</button>
77+
</form>
78+
</dialog>
79+
);
80+
};

src/client/components/StartServiceModal.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ export const StartServiceModal: React.FC<IModalProps> = ({ dialogRef }) => {
6161
<dialog ref={dialogRef} className="modal">
6262
<div className="modal-box max-w-3xl">
6363
<h3 className="font-bold text-lg mb-4">Start Service</h3>
64+
<p className="mb-4">
65+
This will allow you start a <i>Service</i> <b>belonging to the target app only</b>!
66+
</p>
6467
<form onSubmit={handleSubmit(startService)} className="space-y-4">
6568
<input
6669
type="text"

0 commit comments

Comments
 (0)