Форум АНТИЧАТ

Форум АНТИЧАТ (https://forum.antichat.xyz/index.php)
-   Песочница (https://forum.antichat.xyz/forumdisplay.php?f=189)
-   -   выдергивание части строки из текста (https://forum.antichat.xyz/showthread.php?t=427700)

traceme 14.07.2015 15:38

Есть список баннеров при сканировании ssh серверов через масскан

Подскажите рецепт, чтобы средствами bash оставить только список ip столбиком при условии что оставить надо только те адреса, которые имеюt определенную версию ssh

faza02 14.07.2015 15:54

формат списка бы привели

traceme 14.07.2015 16:08

Цитата:

Сообщение от yarbabin

формат списка бы привели

Например вывод в формате json

{ "ip": "xxx.xxx.xxx.xxx", "ports": [ {"port": 21, "proto": "tcp", "status": "open", "reason": "syn-ack", "ttl": 59} ] },

{ "ip": "xxx.xxx.xxx.xxx", "ports": [ {"port": 21, "proto": "tcp", "status": "open", "reason": "syn-ack", "ttl": 59} ] },

{ "ip": "xxx.xxx.xxx.xxx", "ports": [ {"port": 21, "proto": "tcp", "status": "open", "reason": "syn-ack", "ttl": 59} ] },

{ "ip": "xxx.xxx.xxx.xxx", "ports": [ {"port": 21, "proto": "tcp", "status": "open", "reason": "syn-ack", "ttl": 59} ] },

{ "ip": "xxx.xxx.xxx.xxx", "ports": [ {"port": 21, "proto": "tcp", "service": {"name": "ftp", "banner": "220 (vsFTPd 2.3.2)\u000a530 Please login with USER and PASS."} } ] },

{ "ip": "xxx.xxx.xxx.xxx", "ports": [ {"port": 21, "proto": "tcp", "service": {"name": "ftp", "banner": "220 (vsFTPd 2.3.2)\u000a530 Please login with USER and PASS."} } ] },

{ "ip": "xxx.xxx.xxx.xxx", "ports": [ {"port": 21, "proto": "tcp", "service": {"name": "ftp", "banner": "220 FTP Server ready.\u000a500 AUTH not understood"} } ] },

{ "ip": "xxx.xxx.xxx.xxx", "ports": [ {"port": 21, "proto": "tcp", "service": {"name": "ftp", "banner": "220 FTP Server ready.\u000a500 AUTH "} } ] },

{ "ip": "xxx.xxx.xxx.xxx", "ports": [ {"port": 21, "proto": "tcp", "service": {"name": "ftp", "banner": "220 ProFTPD 1.3.3a Server (Debian) [::ffff:xxx.xxx.xxx.xxx]\u000a500 AUTH not understood"} } ] },

Необходимо получить список адресов где баннер содержит "220 (vsFTPd 2.3.2)"

b3 14.07.2015 17:34

Цитата:

Сообщение от None
cat qqq | grep '220 (vsFTPd 2.3.2)' | awk '{print $3}' | tr -d '",'

Вот так

traceme 14.07.2015 17:46

Цитата:

Сообщение от b3

Вот так

Спасибо)

traceme 15.07.2015 04:03

Не хочется создавать под каждый вопрос тему, спрошу тут

В баш скрипте необходимо получать ввод пользователя, а именно диапазона адресов

Банальный пример

Код:

#!/bin/bash
echo "Enter ip range for scan ex.10.0.0.0/8"
read range

Подскажите как применить маску для ввода и выдавать ошибку при некорректном вводе диапазона

b3 15.07.2015 06:11

Цитата:

Сообщение от None
man test

А вот пару примеров: http://stackoverflow.com/questions/1...alidation-bash


Время: 03:31