---
description: >-
  IRB stands for "Interactive Ruby." It is a popular interactive shell or
  console for the Ruby programming language.
---

# IRB



## Basic Usage

For multi-line code input or code blocks, you can use the following syntax:

```ruby
irb(main):001:0> <<~CODE
irb(main):002:0"   def greeting(name)
irb(main):003:0"     "Hi, " + name
irb(main):004:0"   end
irb(main):005:0" CODE
```



## How to extract files using IRB

<figure><img src="https://3593245608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkPEBr0Ohu5Y49JHmv4La%2Fuploads%2FLpTiBMJI74UiaZmTX3Qz%2Fimage.png?alt=media&#x26;token=7772c4ec-2a76-4612-afc4-286895c81807" alt=""><figcaption><p>First we need to Install</p></figcaption></figure>

<figure><img src="https://3593245608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkPEBr0Ohu5Y49JHmv4La%2Fuploads%2F7ZjSAuamRXYrlaqP3Hkz%2Fimage.png?alt=media&#x26;token=e63fe562-5c36-4430-836b-aafb9170f756" alt=""><figcaption><p>Open Interact Mode</p></figcaption></figure>

<figure><img src="https://3593245608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkPEBr0Ohu5Y49JHmv4La%2Fuploads%2FRkgd7dLjzkDt52yftBFR%2Fimage.png?alt=media&#x26;token=5632f111-9884-462c-a490-2a7827515aa1" alt=""><figcaption><p>Open a webserver with WEBrick</p></figcaption></figure>

<figure><img src="https://3593245608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkPEBr0Ohu5Y49JHmv4La%2Fuploads%2FCghpwN7CQljMpRaTkwT4%2Fimage.png?alt=media&#x26;token=93ac069f-df98-4559-b814-cd6750a7301e" alt=""><figcaption><p>We can download the file with WGET or view with curl</p></figcaption></figure>

<figure><img src="https://3593245608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkPEBr0Ohu5Y49JHmv4La%2Fuploads%2FGfmjrYMR6zPXF9varU7H%2Fimage.png?alt=media&#x26;token=5521825d-03c2-49e8-a5ba-6f5fbfdfb9f3" alt=""><figcaption><p>We can access the files directly in the Browser</p></figcaption></figure>

<figure><img src="https://3593245608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkPEBr0Ohu5Y49JHmv4La%2Fuploads%2FsJmaM3VHd9N9uR3Ei550%2Fimage.png?alt=media&#x26;token=4332938e-ddae-4ea8-858b-f5582991be37" alt=""><figcaption><p>Wireshark Results</p></figcaption></figure>
