# Networking

### IPV4

<figure><img src="https://2948431869-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi0qTsVGLTr2bjrc4wZz7%2Fuploads%2Fa9EAVI8keILrbX2Vkd0S%2Fimage.png?alt=media&#x26;token=ef2ef756-c5ca-4065-b30b-e821152fce3b" alt=""><figcaption><p>IPV4</p></figcaption></figure>

In this section we are given pcap file which is Wireshark file. Let's analysis this file.

<figure><img src="https://2948431869-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi0qTsVGLTr2bjrc4wZz7%2Fuploads%2F1SCZmev972z7Rv5BMjcj%2Fimage.png?alt=media&#x26;token=a1ee04fa-2b0c-46a9-8808-f7ce6bf465cf" alt=""><figcaption><p>flag.pcap</p></figcaption></figure>

In this file we found at packet comment section, there is base64 encoded text. Could be a flag, let's try to decode it.

<figure><img src="https://2948431869-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi0qTsVGLTr2bjrc4wZz7%2Fuploads%2FRt3rTsfkQL7ZdpI98mvV%2Fimage.png?alt=media&#x26;token=d0b40baa-b66c-4310-ace7-73567e3d0cdc" alt=""><figcaption><p>flagggg</p></figcaption></figure>

I got the flag after decode the base64.

```
EG{W1R3SH4RK_1S_GR34T}
```

### IPV6

<figure><img src="https://2948431869-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi0qTsVGLTr2bjrc4wZz7%2Fuploads%2FROOO0otcHnpAexKCxhFX%2Fimage.png?alt=media&#x26;token=d61a1615-35e8-4a30-aa84-f9f7a70a9075" alt=""><figcaption></figcaption></figure>

In this challenge, we're given a pcap file again to analysis it. Let's do it.

<figure><img src="https://2948431869-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi0qTsVGLTr2bjrc4wZz7%2Fuploads%2FzyyOZRSHsaUIxTZscyw4%2Fimage.png?alt=media&#x26;token=21161bf7-2bd6-4e25-abd3-058715a47a53" alt=""><figcaption><p>flagx.pcap</p></figcaption></figure>

At first, I did not find anything in the pcap file. Stuck for a while. Then I remember we can scan or analysis the pcap file using online tools on internet to find hidden message. I use this online tools to scan the pcap file <https://filext.com/online-file-viewer.html>.

<figure><img src="https://2948431869-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi0qTsVGLTr2bjrc4wZz7%2Fuploads%2FtMKFUR1D3SxHebUfuAnF%2Fimage.png?alt=media&#x26;token=74fa4470-5bf9-44b7-a5d2-b56adceb81d9" alt=""><figcaption><p>outcome after scan the file</p></figcaption></figure>

Decode the base64 encode: RUd7VEgxU18xU19USDNfQzBSUjNDVF9GTDRHfQ== and you will get the flag.

```
EG{TH1S_1S_TH3_C0RR3CT_FL4G}
```

### Airdream Network

<figure><img src="https://2948431869-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi0qTsVGLTr2bjrc4wZz7%2Fuploads%2FInwiyOw1nK17MpScdfh9%2Fimage.png?alt=media&#x26;token=5854a28a-eda6-489e-a059-e2190060d731" alt=""><figcaption></figcaption></figure>

In this challenge, we will learn how to calculate a host and what class is the network is.

<figure><img src="https://2948431869-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi0qTsVGLTr2bjrc4wZz7%2Fuploads%2FzeNedFCkyKnOSdh8TCUy%2Fimage.png?alt=media&#x26;token=c9b1de12-b9f0-4faa-b598-df1824452f9a" alt=""><figcaption><p>flag.zip</p></figcaption></figure>

We need to download flag.zip to get the file, but unfortunately the file is required password.&#x20;

<figure><img src="https://2948431869-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi0qTsVGLTr2bjrc4wZz7%2Fuploads%2FpBMIuzsh1vJYeYAK7Yj3%2Fimage.png?alt=media&#x26;token=1cb1f85f-891f-4a6f-9e62-fd694f6a7362" alt=""><figcaption><p>password format</p></figcaption></figure>

Don't forget to click reward to know password format for the zip file.

<figure><img src="https://2948431869-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi0qTsVGLTr2bjrc4wZz7%2Fuploads%2FyYmyy1s6AyG7jQ6iR8UC%2Fimage.png?alt=media&#x26;token=a2dce6ce-a367-4ad8-b776-777f42347f64" alt=""><figcaption><p>Network class</p></figcaption></figure>

For this challenge, this network class C because the IP is start from 192.&#x20;

Let's calculate number of host, subnet and hosts available. First for IP 192.168.1.0 has a default subnet mask is 255.255.255.240. So, because of our IP class is  C class, so there will be 3 first octets which is 11111111.11111111.11111111.11110000. The rest of subnet bit will be 11110000. So this is our subnet bit, which is 4. So our subnets = 4.

Then let's calculate amount of subnet, the formula is 2^n. Which is n= subnet, which is 4. So 2^4 =16. This is the amount of our subnet, which is 16.

Then final step is calculated the number of host. The formula is 2^4-2. Why -2? It is because it already reserves by network address and broadcast address. So after -2 the answers become 14. Our host is 14.

<figure><img src="https://2948431869-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi0qTsVGLTr2bjrc4wZz7%2Fuploads%2FLJevr4PEbePYF9CFvYaG%2Fimage.png?alt=media&#x26;token=cfcacfcd-7d7b-44f3-bff0-3b38459d66d8" alt=""><figcaption><p>password</p></figcaption></figure>

After we arrange the password, it will become like this. And you will get the flag after open the zip file.

```
EG{1P_SUBN3TT1NG_1S_34SY}
```
