/
zznoticiassec.sh
74 lines (67 loc) · 1.67 KB
/
zznoticiassec.sh
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# ----------------------------------------------------------------------------
# Busca as últimas notícias em sites especializados em segurança.
# Obs.: Cada site tem uma letra identificadora que pode ser passada como
# parâmetro, para informar quais sites você quer pesquisar:
#
# C)ERT/CC Linux T)oday - Security
# Linux S)ecurity Security F)ocus
#
# Uso: zznoticiassec [sites]
# Ex.: zznoticiassec
# zznoticiassec cft
#
# Autor: Thobias Salazar Trevisan, www.thobias.org
# Desde: 2003-07-13
# Versão: 4
# Requisitos: zzzz zztool zzfeed
# Tags: internet, consulta
# ----------------------------------------------------------------------------
zznoticiassec ()
{
zzzz -h noticiassec "$1" && return
local url limite
local n=5
local sites='sctf'
limite="sed ${n}q"
test -n "$1" && sites="$1"
# Linux Security
if zztool grep_var s "$sites"
then
url='http://www.linuxsecurity.com/linuxsecurity_advisories.rdf'
echo
zztool eco "* Linux Security ($url):"
zzfeed -n $n "$url"
fi
# CERT/CC
if zztool grep_var c "$sites"
then
url='http://www.us-cert.gov/channels/techalerts.rdf'
echo
zztool eco "* CERT/CC ($url):"
zzfeed -n $n "$url"
fi
# Linux Today - Security
if zztool grep_var t "$sites"
then
url='http://feeds.feedburner.com/linuxtoday/linux/'
echo
zztool eco "* Linux Today - Security ($url):"
zzfeed -n $n "$url"
fi
# Security Focus
if zztool grep_var f "$sites"
then
url='http://www.securityfocus.com/bid/'
echo
zztool eco "* SecurityFocus Vulns Archive ($url):"
zztool dump "$url" |
sed -n '
/^ *\([0-9]\{4\}-[0-9][0-9]-[0-9][0-9]\)/ {
G
s/^ *//
s/\n//p
}
h' |
$limite
fi
}