Skip to content

Commit f157384

Browse files
authored
update r2frida guide examples to use : instead of \ for command start (#2450)
Signed-off-by: Shiva953 <[email protected]>
1 parent e956a72 commit f157384

File tree

7 files changed

+37
-37
lines changed

7 files changed

+37
-37
lines changed

techniques/android/MASTG-TECH-0044.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ r2 frida://usb//sg.vantagepoint.helloworldjni
2121

2222
> See all options with `r2 frida://?`.
2323
24-
Once in the r2frida session, all commands start with `\`. For example, in radare2 you'd run `i` to display the binary information, but in r2frida you'd use `\i`.
24+
Once in the r2frida session, all commands start with `:`. For example, in radare2 you'd run `i` to display the binary information, but in r2frida you'd use `:i`.
2525

2626
### Memory Maps and Inspection
2727

techniques/android/MASTG-TECH-0045.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ platform: android
55

66
Runtime reverse engineering can be seen as the on-the-fly version of reverse engineering where you don't have the binary data to your host computer. Instead, you'll analyze it straight from the memory of the app.
77

8-
We'll keep using the HelloWorld JNI app, open a session with r2frida `r2 frida://usb//sg.vantagepoint.helloworldjni` and you can start by displaying the target binary information by using the `\i` command:
8+
We'll keep using the HelloWorld JNI app, open a session with r2frida `r2 frida://usb//sg.vantagepoint.helloworldjni` and you can start by displaying the target binary information by using the `:i` command:
99

1010
```bash
11-
[0x00000000]> \i
11+
[0x00000000]> :i
1212
arch arm
1313
bits 64
1414
os linux
@@ -36,26 +36,26 @@ cacheDir /data/local/tmp
3636
jniEnv 0x7d30a43c60
3737
```
3838

39-
Search all symbols of a certain module with `\is <lib>`, e.g. `\is libnative-lib.so`.
39+
Search all symbols of a certain module with `:is <lib>`, e.g. `:is libnative-lib.so`.
4040

4141
```bash
4242
[0x00000000]> \is libnative-lib.so
4343

4444
[0x00000000]>
4545
```
4646

47-
Which are empty in this case. Alternatively, you might prefer to look into the imports/exports. For example, list the imports with `\ii <lib>`:
47+
Which are empty in this case. Alternatively, you might prefer to look into the imports/exports. For example, list the imports with `:ii <lib>`:
4848

4949
```bash
50-
[0x00000000]> \ii libnative-lib.so
50+
[0x00000000]> :ii libnative-lib.so
5151
0x7dbe1159d0 f __cxa_finalize /system/lib64/libc.so
5252
0x7dbe115868 f __cxa_atexit /system/lib64/libc.so
5353
```
5454

55-
And list the exports with `\iE <lib>`:
55+
And list the exports with `:iE <lib>`:
5656

5757
```bash
58-
[0x00000000]> \iE libnative-lib.so
58+
[0x00000000]> :iE libnative-lib.so
5959
0x7d1c49954c f Java_sg_vantagepoint_helloworldjni_MainActivity_stringFromJNI
6060
```
6161

@@ -71,7 +71,7 @@ sg.vantagepoint.helloworldjni.MainActivity
7171
List class fields:
7272

7373
```bash
74-
[0x00000000]> \ic sg.vantagepoint.helloworldjni.MainActivity~sg.vantagepoint.helloworldjni
74+
[0x00000000]> :ic sg.vantagepoint.helloworldjni.MainActivity~sg.vantagepoint.helloworldjni
7575
public native java.lang.String sg.vantagepoint.helloworldjni.MainActivity.stringFromJNI()
7676
public sg.vantagepoint.helloworldjni.MainActivity()
7777
```
@@ -81,7 +81,7 @@ Note that we've filtered by package name as this is the `MainActivity` and it in
8181
You can also display information about the class loader:
8282

8383
```bash
84-
[0x00000000]> \icL
84+
[0x00000000]> :icL
8585
dalvik.system.PathClassLoader[
8686
DexPathList[
8787
[

techniques/ios/MASTG-TECH-0096.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ r2 frida://usb//iGoat-Swift
2121

2222
## Memory Maps and Inspection
2323

24-
You can retrieve the app's memory maps by running `\dm`:
24+
You can retrieve the app's memory maps by running `:dm`:
2525

2626
```bash
27-
[0x00000000]> \dm
27+
[0x00000000]> :dm
2828
0x0000000100b7c000 - 0x0000000100de0000 r-x /private/var/containers/Bundle/Application/3ADAF47D-A734-49FA-B274-FBCA66589E67/iGoat-Swift.app/iGoat-Swift
2929
0x0000000100de0000 - 0x0000000100e68000 rw- /private/var/containers/Bundle/Application/3ADAF47D-A734-49FA-B274-FBCA66589E67/iGoat-Swift.app/iGoat-Swift
3030
0x0000000100e68000 - 0x0000000100e97000 r-- /private/var/containers/Bundle/Application/3ADAF47D-A734-49FA-B274-FBCA66589E67/iGoat-Swift.app/iGoat-Swift
@@ -37,12 +37,12 @@ You can retrieve the app's memory maps by running `\dm`:
3737
0x0000000100f60000 - 0x00000001012dc000 r-x /private/var/containers/Bundle/Application/3ADAF47D-A734-49FA-B274-FBCA66589E67/iGoat-Swift.app/Frameworks/Realm.framework/Realm
3838
```
3939

40-
While you're searching or exploring the app memory, you can always verify where your current offset is located in the memory map. Instead of noting and searching for the memory address in this list you can simply run `\dm.`. You'll find an example in the following section "In-Memory Search".
40+
While you're searching or exploring the app memory, you can always verify where your current offset is located in the memory map. Instead of noting and searching for the memory address in this list you can simply run `:dm.`. You'll find an example in the following section "In-Memory Search".
4141

42-
If you're only interested into the modules (binaries and libraries) that the app has loaded, you can use the command `\il` to list them all:
42+
If you're only interested into the modules (binaries and libraries) that the app has loaded, you can use the command `:il` to list them all:
4343

4444
```bash
45-
[0x00000000]> \il
45+
[0x00000000]> :il
4646
0x0000000100b7c000 iGoat-Swift
4747
0x0000000100eb4000 TweakInject.dylib
4848
0x00000001862c0000 SystemConfiguration
@@ -120,7 +120,7 @@ Now take the first hit, seek to it and check your current location in the memory
120120

121121
```bash
122122
[0x00000000]> s 0x100d7d332
123-
[0x100d7d332]> \dm.
123+
[0x100d7d332]> :dm.
124124
0x0000000100b7c000 - 0x0000000100de0000 r-x /private/var/containers/Bundle/Application/3ADAF47D-A734-49FA-B274-FBCA66589E67/iGoat-Swift.app/iGoat-Swift
125125
```
126126

@@ -134,11 +134,11 @@ hits: 1
134134
0x1c06619c0 hit3_0 owasp-mstg
135135
```
136136

137-
In fact, the string could be found at address `0x1c06619c0`. Seek `s` to there and retrieve the current memory region with `\dm.`.
137+
In fact, the string could be found at address `0x1c06619c0`. Seek `s` to there and retrieve the current memory region with `:dm.`.
138138

139139
```bash
140140
[0x100d7d332]> s 0x1c06619c0
141-
[0x1c06619c0]> \dm.
141+
[0x1c06619c0]> :dm.
142142
0x00000001c0000000 - 0x00000001c8000000 rw-
143143
```
144144

techniques/ios/MASTG-TECH-0097.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ platform: ios
55

66
Runtime reverse engineering can be seen as the on-the-fly version of reverse engineering where you don't have the binary data to your host computer. Instead, you'll analyze it straight from the memory of the app.
77

8-
We'll keep using the [iGoat-Swift](0x08b-Reference-Apps.md#igoat-swift) app, open a session with r2frida `r2 frida://usb//iGoat-Swift` and you can start by displaying the target binary information by using the `\i` command:
8+
We'll keep using the [iGoat-Swift](0x08b-Reference-Apps.md#igoat-swift) app, open a session with r2frida `r2 frida://usb//iGoat-Swift` and you can start by displaying the target binary information by using the `:i` command:
99

1010
```bash
11-
[0x00000000]> \i
11+
[0x00000000]> :i
1212
arch arm
1313
bits 64
1414
os darwin
@@ -25,7 +25,7 @@ isDebuggerAttached false
2525
cwd /
2626
```
2727

28-
Search all symbols of a certain module with `\is <lib>`, e.g. `\is libboringssl.dylib`.
28+
Search all symbols of a certain module with `:is <lib>`, e.g. `:is libboringssl.dylib`.
2929

3030
The following does a case-insensitive search (grep) for symbols including "aes" (`~+aes`).
3131

@@ -44,10 +44,10 @@ The following does a case-insensitive search (grep) for symbols including "aes"
4444

4545
Or you might prefer to look into the imports/exports. For example:
4646

47-
- List all imports of the main binary: `\ii iGoat-Swift`.
48-
- List exports of the libc++.1.dylib library: `\iE /usr/lib/libc++.1.dylib`.
47+
- List all imports of the main binary: `:ii iGoat-Swift`.
48+
- List exports of the libc++.1.dylib library: `:iE /usr/lib/libc++.1.dylib`.
4949

50-
> For big binaries it's recommended to pipe the output to the internal less program by appending `~..`, i.e. `\ii iGoat-Swift~..` (if not, for this binary, you'd get almost 5000 lines printed to your terminal).
50+
> For big binaries it's recommended to pipe the output to the internal less program by appending `~..`, i.e. `:ii iGoat-Swift~..` (if not, for this binary, you'd get almost 5000 lines printed to your terminal).
5151
5252
The next thing you might want to look at are the classes:
5353

@@ -96,20 +96,20 @@ Imagine that you are interested into `0x000000018eec5c8c - setStringValue:`. You
9696
╰ 0x18eec5ca8 f4 hlt
9797
```
9898

99-
Finally, instead of doing a full memory search for strings, you may want to retrieve the strings from a certain binary and filter them, as you'd do _offline_ with radare2. For this you have to find the binary, seek to it and then run the `\iz` command.
99+
Finally, instead of doing a full memory search for strings, you may want to retrieve the strings from a certain binary and filter them, as you'd do _offline_ with radare2. For this you have to find the binary, seek to it and then run the `:iz` command.
100100

101101
> It's recommended to apply a filter with a keyword `~<keyword>`/`~+<keyword>` to minimize the terminal output. If just want to explore all results you can also pipe them to the internal less `\iz~..`.
102102
103103
```bash
104-
[0x00000000]> \il~iGoa
104+
[0x00000000]> :il~iGoa
105105
0x00000001006b8000 iGoat-Swift
106106
[0x00000000]> s 0x00000001006b8000
107-
[0x1006b8000]> \iz
107+
[0x1006b8000]> :iz
108108
Reading 2.390625MB ...
109109
Do you want to print 8568 lines? (y/N) N
110-
[0x1006b8000]> \iz~+hill
110+
[0x1006b8000]> :iz~+hill
111111
Reading 2.390625MB ...
112-
[0x1006b8000]> \iz~+pass
112+
[0x1006b8000]> :iz~+pass
113113
Reading 2.390625MB ...
114114
0x00000001006b93ed "passwordTextField"
115115
0x00000001006bb11a "11iGoat_Swift20KeychainPasswordItemV0C5ErrorO"

tests/android/MASVS-STORAGE/MASTG-TEST-0011.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ Usage: /[!bf] [arg] Search stuff (see 'e??search' for options)
308308
### Runtime Memory Analysis
309309
310310
Instead of dumping the memory to your host computer, you can alternatively use [r2frida](../../../Document/0x08a-Testing-Tools.md#r2frida). With it, you can analyze and inspect the app's memory while it's running.
311-
For example, you may run the previous search commands from r2frida and search the memory for a string, hexadecimal values, etc. When doing so, remember to prepend the search command (and any other r2frida specific commands) with a backslash `\` after starting the session with `r2 frida://usb//<name_of_your_app>`.
311+
For example, you may run the previous search commands from r2frida and search the memory for a string, hexadecimal values, etc. When doing so, remember to prepend the search command (and any other r2frida specific commands) with a backslash `:` after starting the session with `r2 frida://usb//<name_of_your_app>`.
312312
313313
For more information, options and approaches, please refer to section "[In-Memory Search](../../../Document/0x05c-Reverse-Engineering-and-Tampering.md#in-memory-search "In-Memory Search")" in the chapter "Tampering and Reverse Engineering on Android".
314314

tests/ios/MASVS-STORAGE/MASTG-TEST-0060.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,6 @@ Usage: /[!bf] [arg] Search stuff (see 'e??search' for options)
6666
6767
### Runtime Memory Analysis
6868
69-
By using [r2frida](../../../Document/0x08a-Testing-Tools.md#r2frida) you can analyze and inspect the app's memory while running and without needing to dump it. For example, you may run the previous search commands from r2frida and search the memory for a string, hexadecimal values, etc. When doing so, remember to prepend the search command (and any other r2frida specific commands) with a backslash `\` after starting the session with `r2 frida://usb//<name_of_your_app>`.
69+
By using [r2frida](../../../Document/0x08a-Testing-Tools.md#r2frida) you can analyze and inspect the app's memory while running and without needing to dump it. For example, you may run the previous search commands from r2frida and search the memory for a string, hexadecimal values, etc. When doing so, remember to prepend the search command (and any other r2frida specific commands) with a backslash `:` after starting the session with `r2 frida://usb//<name_of_your_app>`.
7070
7171
For more information, options and approaches, please refer to section "[In-Memory Search](../../../Document/0x06c-Reverse-Engineering-and-Tampering.md#in-memory-search "In-Memory Search")" in the chapter "Tampering and Reverse Engineering on iOS".

tools/generic/MASTG-TOOL-0036.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ For more examples on how to connect to frida-server, [see the usage section in t
2323

2424
> The following examples were executed using an Android app but also apply to iOS apps.
2525
26-
Once in the r2frida session, all commands start with `\` or `=!`. For example, in radare2 you'd run `i` to display the binary information, but in r2frida you'd use `\i`.
26+
Once in the r2frida session, all commands start with `:` or `=!`. For example, in radare2 you'd run `i` to display the binary information, but in r2frida you'd use `:i`.
2727

2828
> See all options with `r2 frida://?`.
2929
3030
```bash
31-
[0x00000000]> \i
31+
[0x00000000]> :i
3232
arch x86
3333
bits 64
3434
os linux
@@ -74,18 +74,18 @@ policyunsupported md algorithmvar bad valuec0"},{"address":"0x561f072c4275", \
7474
...
7575
```
7676

77-
To list the loaded libraries use the command `\il` and filter the results using the internal grep from radare2 with the command `~`. For example, the following command will list the loaded libraries matching the keywords `keystore`, `ssl` and `crypto`:
77+
To list the loaded libraries use the command `:il` and filter the results using the internal grep from radare2 with the command `~`. For example, the following command will list the loaded libraries matching the keywords `keystore`, `ssl` and `crypto`:
7878

7979
```bash
80-
[0x00000000]> \il~keystore,ssl,crypto
80+
[0x00000000]> :il~keystore,ssl,crypto
8181
0x00007f3357b8e000 libssl.so.1.1
8282
0x00007f3357716000 libcrypto.so.1.1
8383
```
8484

8585
Similarly, to list the exports and filter the results by a specific keyword:
8686

8787
```bash
88-
[0x00000000]> \iE libssl.so.1.1~CIPHER
88+
[0x00000000]> :iE libssl.so.1.1~CIPHER
8989
0x7f3357bb7ef0 f SSL_CIPHER_get_bits
9090
0x7f3357bb8260 f SSL_CIPHER_find
9191
0x7f3357bb82c0 f SSL_CIPHER_get_digest_nid
@@ -102,7 +102,7 @@ Similarly, to list the exports and filter the results by a specific keyword:
102102
To list or set a breakpoint use the command db. This is useful when analyzing/modifying memory:
103103

104104
```bash
105-
[0x00000000]> \db
105+
[0x00000000]> :db
106106
```
107107

108108
Finally, remember that you can also run Frida JavaScript code with `\.` plus the name of the script:

0 commit comments

Comments
 (0)