You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 52eb1e9
Browse filesBrowse the repository at this point in the historyBrowse files
in-case of binary that is out of `.chr` range. For example you may need to convert an IP-address to hex raw then send it through the socket. The case of just converting it to hex would not work for you
96
111
97
112
```ruby
@@ -109,6 +124,14 @@ To solve this issue, use pack to convert integers to 8-bit unsigned \(unsigned c
**Note about hex:** Sometimes you might face non-printable characters, especially when dealing with binary raw. In this case, append **\(**`# -*- coding: binary -*-`**\)** at the top of your file to fix any interpretation issues.
113
136
114
137
## Convert Hex \(Return address\) to Little-Endian format
@@ -188,22 +211,37 @@ require 'base64'
188
211
Base64.encode64 "RubyFu"
189
212
```
190
213
191
-
**Decode**
214
+
or with [ctf-party][ctf-party]
192
215
193
216
```ruby
194
-
"UnVieUZ1".unpack('m0')
217
+
require'ctf_party'
218
+
'RubyFu'.to_b64 #=> "UnVieUZ1"
195
219
```
196
220
197
-
or
221
+
**Decode**
198
222
199
223
```ruby
200
-
Base64.decode64 "UnVieUZ1"
224
+
"UnVieUZ1".unpack('m0')
201
225
```
202
226
203
227
{% hint style="info" %}
204
228
**TIP:** The string unpack method is incredibly useful for converting data we read as strings back to their original form. To read more, visit the String class reference at www.ruby-doc.org/core/classes/String.html .
205
229
{% endhint %}
206
230
231
+
or
232
+
233
+
```ruby
234
+
require'base64'
235
+
Base64.decode64 "UnVieUZ1"
236
+
```
237
+
238
+
or with [ctf-party][ctf-party]
239
+
240
+
```ruby
241
+
require'ctf_party'
242
+
'UnVieUZ1'.from_b64 #=> "RubyFu"
243
+
```
244
+
207
245
## En/Decode URL String
208
246
209
247
URL encoding/decoding is well known. From a hacker's point of view, we need it often for client-side vulnerabilities.
@@ -212,22 +250,74 @@ URL encoding/decoding is well known. From a hacker's point of view, we need it o
You can encode/decode any non-URL string, of-course.
226
264
227
-
The above way will encode any non-URL standard strings only \(ex. `<>"{}`\) however if you want to encode the full string use `URI.encode_www_form_component`
265
+
The above way will encode any non-URL standard strings only \(ex. `<>"{}`\) however if you want to encode the full string use one of the following methods:
0 commit comments