aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 8ce8c20877e6ef439ef5a9511e8c7220bc462d4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# suddenly-opened-ports-checker

Python script that scans TCP ports of your servers and notifies you about
unexpected changes (new opened ports, or closed ports expected to be open).

## Usage

Python 3.7 or newer is required.

```
usage: suddenly-opened-ports-checker.py [-h] --config CONFIG [--verbose] [--concurrency CONCURRENCY] [--timeout TIMEOUT] [--threads-limit THREADS_LIMIT] [--no-telegram]

optional arguments:
  -h, --help            show this help message and exit
  --config CONFIG       path to config file in yaml format
  --verbose             set logging level to DEBUG (default is INFO)
  --concurrency CONCURRENCY
                        default number of threads per target (defaults to 200)
  --timeout TIMEOUT     default timeout (defaults to 5)
  --threads-limit THREADS_LIMIT
                        global threads limit (default is no limit)
  --no-telegram         just print results, don't send to telegram

```

## Config example

Each server definition must have at least `host` and `opened` keys. `opened` is
a list of ports expected to be open.

You can also set per-server `concurrency` and `timeout`.

```yaml
telegram:
  chat-id: -987
  token: yourtoken
  
servers:
  server-1:
    host: 1.2.3.4
    opened:
      - 22
      - 80
      - 443

  server-2:
    host: 5.6.7.8
    opened: []
    concurrency: 1000
    timeout: 2
```

## License

MIT