---
title: pping
date: "2026-06-20T15:00:00.000Z"
description: "Our famous port ping tool written in .NET"
postType: "Tools"
language: "English"
author: "Alexander Schmidt"
---

## Introduction

I don't remember exactly when the idea of a simple solution to checking opened ports on machines came into my mind. All I know is
that this task was unnecessary painful to me. So I thought about what would be the ideal solution. I came up with the idea that I
want the exact same behavior ping gives me on the console and I wished I just could add a port number to it and it will work.

This is exactly the core functionality behind pping (and thus the name!).

The sources are available at [Github](https://github.com/codingfreak/pping).

## Installation

### Windows

The easiest way to obtain and manage pping on your machine is to use chocolatey:

![Chocolatey Version](https://img.shields.io/chocolatey/v/pping)

[Chocolatey page for pping](https://chocolatey.org/packages/pping)

```shell{numberLines:false}
choco install pping
```

### MacOS and Linux

MacOS user have to use the direct link below.

On MacOS you might need more stuff to do. So assuming that you downloaded the zip into your download folder, you could perform the following steps:

```shell
unzip ~/Downloads/pping-osx-arm64-latest.zip
chmod +x ~/Downloads/pping
xattr -d com.apple.quarantine ~/Downloads/pping
mv ~/Downloads/pping ~/Applications/pping
```

Then add the following to your rc file:

`alias pping="~/Applications/pping"`

After a `source ~/.zshrc` you should be able to call `pping`.

### Direct download

If you don't want to pre-install choco on your box or you are not running on Windows you could download the latest version via (all hashes are those of the binary in the zip!):

- [Download](https://devdeer.blob.core.windows.net/shared/codingfreaks/pping-win-x64-latest.zip) Windows x64: (SHA256: `F00A03B4D20F214F1A094410CD9FF57DAB027C9DBD16CEB729041163A48BA927`)
- [Download](https://devdeer.blob.core.windows.net/shared/codingfreaks/pping-linux-x64-latest.zip) Linux x64: (SHA256: `B42B1642D83835F73D0E78FF56E180F1C8AE3B3E5AB97539FBD607D3769133EB`)
- [Download](https://devdeer.blob.core.windows.net/shared/codingfreaks/pping-osx-x64-latest.zip) MacOS Intel x64: (SHA256: `B72C9CCB8A86582CAB0E632B98E0C07BFAFE3EA4D5C3D50217EDF6AD994CE86E`)
- [Download](https://devdeer.blob.core.windows.net/shared/codingfreaks/pping-osx-arm64-latest.zip) MacOS ARM x64: (SHA256: `9C12FE92941C0E731686F77F9487647316DF31549FFE42D4C20F18C02C8FC670`)

and extract the contents into any folder.

Then set add the directory you chosen to your PATH and use the tool.

Also don't forget to ensure that the extracted file is executable on Linux and MacOS.

## Basic usage

The simplest possible call would be to check a single port on a DNS address or IP address. The following snippets checks, if port `80` is open on the address `google.com`:

```shell{numberLines:false}
pping google.com 80
```

The result will be something like this:

```shell{numberLines:false}
> pping google.com 80
Starting pinging host google.com on TCP port(s) 80 4 times:
#   1 -> Pinging host google.com (IP:-) on TCP port 80 with timeout 1: OPEN
#   2 -> Pinging host google.com (IP:-) on TCP port 80 with timeout 1: OPEN
#   3 -> Pinging host google.com (IP:-) on TCP port 80 with timeout 1: OPEN
#   4 -> Pinging host google.com (IP:-) on TCP port 80 with timeout 1: OPEN
Finished pinging host google.com (IP:-). 4 pings sent (4 OPEN, 0 CLOSED)
```

By default pping will try to reach a port 4 times.If you want pping to resolve the IP address behind a DNS entry just add the `-res` parameter:

```shell
pping google.com 80 -res

Starting pinging host google.com on TCP port(s) 80 4 times:
#   1 -> Pinging host google.com (IP:2a00:1450:4005:808::200e) on TCP port 80 with timeout 1: OPEN
#   2 -> Pinging host google.com (IP:2a00:1450:4005:808::200e) on TCP port 80 with timeout 1: OPEN
#   3 -> Pinging host google.com (IP:2a00:1450:4005:808::200e) on TCP port 80 with timeout 1: OPEN
#   4 -> Pinging host google.com (IP:2a00:1450:4005:808::200e) on TCP port 80 with timeout 1: OPEN
Finished pinging host google.com (IP:2a00:1450:4005:808::200e). 4 pings sent (4 OPEN, 0 CLOSED)
```

You can perform constant pings too:

```shell
pping google.com 80 -t
```

This will perform and "endless" ping to the address.

## Special usage

### Waiting for a port to open

On of the common scenarios to use ping is to determine, if a certain service is already up. Consider a situation where you restart a server and want to know, when RDP connections are possible. A simple ping would'nt help you here because even if the machine is up, the RDP port (3389) might no be reachable yet.

pping can help you in this situation:

```shell
pping myserver.local 3389 -t -a
```

You perform a permanent pping (`-t`) but you tell pping to stop pinging when the port is reachable the first time (`-as`). "as" is the abbreviation for "autostop".

### Multiple ports

If you want to check lets say 2 ports (http and https) on a certain address. Just delimit the ports by `,`:

```shell
pping google.com 80,443 -d

Starting pinging host google.com on TCP port(s) 80,443 4 times:
#   1 -> Pinging host google.com (IP:-) on TCP port 80 with timeout 1: CLOSED (TimedOut)
#   2 -> Pinging host google.com (IP:-) on TCP port 443 with timeout 1: CLOSED (TimedOut)
#   3 -> Pinging host google.com (IP:-) on TCP port 80 with timeout 1: OPEN
#   4 -> Pinging host google.com (IP:-) on TCP port 443 with timeout 1: OPEN
#   5 -> Pinging host google.com (IP:-) on TCP port 80 with timeout 1: OPEN
#   6 -> Pinging host google.com (IP:-) on TCP port 443 with timeout 1: OPEN
#   7 -> Pinging host google.com (IP:-) on TCP port 80 with timeout 1: OPEN
#   8 -> Pinging host google.com (IP:-) on TCP port 443 with timeout 1: OPEN
Finished pinging host google.com (IP:-). 8 pings sent (6 OPEN, 2 CLOSED)
```

It is also possible to define a range of ports by delimiting them with '-':

```shell
pping google.com 80-82 -d
Starting pinging host google.com on TCP port(s) 80-82 4 times:
#   1 -> Pinging host google.com (IP:-) on TCP port 80 with timeout 1: OPEN
#   2 -> Pinging host google.com (IP:-) on TCP port 81 with timeout 1: CLOSED (TimedOut)
#   3 -> Pinging host google.com (IP:-) on TCP port 82 with timeout 1: CLOSED (TimedOut)
#   4 -> Pinging host google.com (IP:-) on TCP port 80 with timeout 1: OPEN
#   5 -> Pinging host google.com (IP:-) on TCP port 81 with timeout 1: CLOSED (TimedOut)
#   6 -> Pinging host google.com (IP:-) on TCP port 82 with timeout 1: CLOSED (TimedOut)
#   7 -> Pinging host google.com (IP:-) on TCP port 80 with timeout 1: OPEN
#   8 -> Pinging host google.com (IP:-) on TCP port 81 with timeout 1: CLOSED (TimedOut)
#   9 -> Pinging host google.com (IP:-) on TCP port 82 with timeout 1: CLOSED (TimedOut)
#  10 -> Pinging host google.com (IP:-) on TCP port 80 with timeout 1: OPEN
#  11 -> Pinging host google.com (IP:-) on TCP port 81 with timeout 1: CLOSED (TimedOut)
#  12 -> Pinging host google.com (IP:-) on TCP port 82 with timeout 1: CLOSED (TimedOut)
Finished pinging host google.com (IP:-). 12 pings sent (4 OPEN, 8 CLOSED)
```

## Option table

The following table lists all available options:

| Abbreviation | Full name | Sample  | Purpose                                                                                             |
| :----------- | :-------- | :------ | :-------------------------------------------------------------------------------------------------- |
| t            | endless   | -t      | Perform a constant pping.                                                                           |
| r            | repeats   | -r 10   | Number of repeats in a non-endless pping (defaults to 4)                                            |
| tim          | timeout   | -tim 2  | Timeout in seconds (defaults to 1)                                                                  |
| l            | logo      | -logo   | If provided, pping will print detailed header informations.                                         |
| res          | resolve   | -res    | If provided, pping will resolve the IP address for each pping.                                      |
| a            | autostop  | -a      | If provided, pping will stop operation on the first opened port.                                    |
| els          | elsucc    | -els    | If provided, the process will retrieve the amount of opened ports as the process-result to DOS.     |
| elf          | elfail    | -elf    | If provided, the process will return 0 if there was at least one open port, otherwise it returns 1. |
| w            | waittime  | -w 2000 | The amount of milliseconds to wait between 2 ppings.                                                |
| d            | detailed  | -d      | If provided, pping will try to write reason details at closed ports to te console.                  |
| 4            | ipv4      | -4      | If provided, pping will use IPv4 for resolutions.                                                   |
| 6            | ipv6      | -6      | If provided, pping will use IPv6 for resolutions.                                                   |

## Exit codes

Any positive number is returned if `-elsucc` or `-elfail` are defined. Those numbers will represent the successful or failed requests.

| Code | Description                                                   |
| ---- | ------------------------------------------------------------- |
| 0    | All provided ports where open.                                |
| -2   | `-res` flag was given but the hostname could not be resolved. |
