
20.02.2021, 15:06
|
|
Постоянный
Регистрация: 16.11.2018
Сообщений: 620
С нами:
3943766
Репутация:
47
|
|
Сообщение от b3
↑
Код:
sh -c grep SYN_RECV /tmp/check_ddos.res | awk {'print $5'}
Есть такой скрипт от рута, кто хорошо дружит с AWK подскажите есть ли возможность исполнить свой код, или записать в файл данные подставленные в $5? При условии что Файл доступен на запись
из man awk:
Код:
print Print the current record. The output record is terminated with the value of ORS.
print expr-list Print expressions. Each expression is separated by the value of OFS. The output record is terminated with the value of ORS.
print expr-list >file Print expressions on file. Each expression is separated by the value of OFS. The output record is terminated with the value of
ORS.
printf fmt, expr-list Format and print. See The printf Statement, below.
printf fmt, expr-list >file
Format and print on file.
на мой взгляд нет, так как вы не имеете возможность манипулировать саму строку для awk. Получается что-то вроде prepared statements для скули, даже если параметры манипулировать, то они не исполняются.
Код:
test@test: cat /tmp/check_ddos.res
SYN_RECV `whoami` ;whoami |whoami $(whoami) &&whoami ;{whoami}
test@test: grep SYN_RECV /tmp/check_ddos.res | awk {'print $1 $2 $3 $4 $5 $6 $7'}
SYN_RECV`whoami`;whoami|whoami$(whoami)&&whoami;{whoami}
|
|
|