---
title: "Useful IP widget for CTFs - Cybr"
description: "Tired of always forgetting what your IP is when switching between VPN profiles? Check out this IP widget for CTFs"
url: https://cybr.com/ethical-hacking-archives/useful-ip-widget-for-ctfs/
---

# Useful IP widget for CTFs

Who can’t use more convenience? If you’re familiar with VPN profiles when it comes to CTF programs like THM and HTB, I’m sure you’ve forgotten…

tehstoni

Published July 5, 2022

## Who can’t use more convenience?

If you’re familiar with VPN profiles when it comes to CTF programs like THM and HTB, I’m sure you’ve forgotten your IP address a few times. Sure you can always `ip a` or `ifconfig` but if you’re like me, that interrupts your workflow and it’s quite annoying.

After a while, I was tired of forgetting something that I would want to always have ready at hand. So instead of being annoyed, I decided I was going to look for a solution…and I found a great one. I stumbled upon [this GitHub repo](https://github.com/psbelin/ip_widget) for a tool called ip\_widget, which is a super helpful IP widget for CTFs.

You set it up on your taskbar in Kali (or whatever version of Linux you’re using) with whatever interface you want, and it just works.

In this post, I’ll show you how to utilize such a nifty little script and what you can do with it.

## Downloading ip\_widget.sh

Before we jump in, let’s go to the directory within Linux that we want to use. I recommend `/opt`. Or, if you have Kali set up as the root user, you can use `/root`. Depending on your user’s permissions you may want to put this someplace appropriate.

The first thing we’re going to need is the command to get the file. Once you’re in the directory of your choice, go ahead and run the following command:

```
wget https://raw.githubusercontent.com/psbelin/ip_widget/master/ip_widget.sh
```

This will download the script in your current directory. After that, let’s give it permissions:

```
sudo chmod 770 ip_widget.sh
```

## Configuring the taskbar

Next, we need to set it up on the taskbar. If you want to have multiple interfaces in the taskbar like I do, you can repeat the following steps as many times as you want, or modify the script if you’re capable of doing so. Here is my current configuration:

[![Example IP setup](https://media.cybr.com/2022/07/Pasted-image-20220628135605.png)](https://media.cybr.com/2022/07/Pasted-image-20220628135605.png)

The `eth0` section shows my local NAT IP for my VMware network. The `tun0` will auto-populate with whichever VPN connection you are using on that adapter. This means both TryHackMe and HackTheBox will be automatically filled out here. Quite handy.

Now for the setup with screenshots-a-plenty.

Step 1:
Right-click the taskbar, highlight panel, and click “add new items…”

[![Adding a new item](https://media.cybr.com/2022/07/Pasted-image-20220628205052.png)](https://media.cybr.com/2022/07/Pasted-image-20220628205052.png)

Step 2:
Filter and Select “Generic Monitor”

[![Selecting the monitor](https://media.cybr.com/2022/07/Pasted-image-20220628205145.png)](https://media.cybr.com/2022/07/Pasted-image-20220628205145.png)

…and then hit “Add”

Step 3:
Locate the monitor, right-click, and hit properties.

[![Editing the monitor's properties](https://media.cybr.com/2022/07/Pasted-image-20220628205308.png)](https://media.cybr.com/2022/07/Pasted-image-20220628205308.png)

Step 4:
Configure the widget

[![How to configure an adapter to monitor the IP ](https://media.cybr.com/2022/07/Pasted-image-20220628205705.png)](https://media.cybr.com/2022/07/Pasted-image-20220628205705.png)

I’ll write a few common paths for the command and their respective adapter for ease:

```
- /root/ip_widget eth0
- /root/ip_widget tun0
-------------------------
- /opt/ip_widget eth0
- /opt/ip_widget tun0
-------------------------
- /home/kali/ip_widget eth0
- /home/kali/ip_widget tun0
```

Then you can set the label to whatever you want.

Step 5:
Right-click and hit move, so you can position the widget where you want.

[![Moving the IP display on the taskbar](https://media.cybr.com/2022/07/Pasted-image-20220628205938.png)](https://media.cybr.com/2022/07/Pasted-image-20220628205938.png)

Step 6?:
Repeat 1 through 5 to add additional widgets or even separators to have a bar in between them (how mine is set up). Creative freedom is entirely up to you.

## Conclusion

This has been such a boost to QOL for me and I hope whoever finds this also finds the same level of convenience from it. It’s something I literally use every day. From swapping between THM, HTB, or other CTF platforms, and even my home labs, it’s been such a time saver.

*This post was written by Cybr community member [Stoni](https://cybr.com/members/tehstoni/). Check out his [Twitter](https://twitter.com/TehStoni) and [LinkedIn](https://www.linkedin.com/in/steven-harris-08b199144/) for more interesting tips and tricks.*

## Filed under

- [Ethical Hacking](https://cybr.com/ethical-hacking-archives/)
- [Scripting](https://cybr.com/scripting-archives/)
- [CTF](https://cybr.com/tag/ctf/)
- [Tools](https://cybr.com/tag/tools/)

## Comments

Loading comments…

Recommended resources

[![Explore the Networking Fundamentals course](https://media.cybr.com/2021/09/networking-fundamentals-course-logo-624x351.png)](https://cybr.com/courses/networking-fundamentals/)

## Strengthen your networking foundation

Learn how networks work before you move into advanced security topics.

[Explore Networking Fundamentals](https://cybr.com/courses/networking-fundamentals/)
