Darkside  

Voltar   Darkside > Darkside > Comunidade
FAQ Calendário Postagens do dia Buscapé Search

Responder
 
Thread Tools
PIT BULL
Trooper
 

XFIRE ID: pitbull666br Steam ID: pitbull666br
Default LOG: Pra quem manja de Snort e análise de log

28-03-06, 20:01 #1
Bom, já havia tentado na seção de Linux ( http://forum.darkside.com.br/vb/showthread.php?t=5558 ), mas não consegui as informações que preciso. A questão não é simples...

Possuo ao todo 120 GB de LOG de TELNET, divididos em arquivos de 2 GB cada, tudo gerado pelo Snort num servidor Unix. Estou usando um software chamado T-Sight para reconstruir as telas e analisar o que cada usuário do sistema anda aprontando.

O T-Sight abre um arquivo de LOG por vez, processa e gera uma lista de acessos de Telnet com data e hora iniciais, data e hora do término, IP e porta de quem abrir a conexão. Cada arquivo de log desse possui informações de 12 dias de trabalho em média.

Tenho usado vários softwares como EnCase, T-Sight e Salamander, mas o que estou precisando é de um software que faça a leitura do LOG e gere um sub LOG de um determinado IP de modo que possa acelerar o processo.

Alguém conhece algum script/software pra Windows que gere um LOG reduzido só com as informações que preciso?





PIT BULL is offline   Reply With Quote
Jeep
fagmin
 

XFIRE ID: ds-jeep Steam ID: jeep_ds
28-03-06, 20:32 #2
Tem o IP repetido em cada linha do log, tipo log de servidor web? um grep resolve. Posta um trecho do log pra podermos ver o formato, altere os dados pra evitar rolos, obviamente.

Jeep is offline   Reply With Quote
Never Ping
🌀 Trooper
 

Gamertag: Willian Braga PSN ID: Never_Ping XFIRE ID: neverping Steam ID: neverping
28-03-06, 20:44 #3
imagina a seguinte situação de log:

20-02-2006 - 12:07:10 - 10.10.2.7 - TELNETSERVER - Receiving connection
20-02-2006 - 12:07:10 - 10.10.2.7 - TELNETSERVER - Connection accept
20-02-2006 - 12:07:11 - 10.10.2.7 - TELNETSERVER - Sent balblb
20-02-2006 - 12:08:10 - 10.14.2.242 - TELNETSERVER - Connection reset by peer

so fazer

grep 'accept' telnetserver.log | awk '{print $6,2}' | sort -rn

Se quiser um sumário, | head -10 no final de tudo.

Never Ping is offline   Reply With Quote
PIT BULL
Trooper
 

XFIRE ID: pitbull666br Steam ID: pitbull666br
29-03-06, 03:12 #4
 

A que bom que fosse...

PIT BULL is offline   Reply With Quote
Eluan
Trooper
 

Steam ID: eluancm
29-03-06, 03:21 #5
OMFG

LOG DO PROTOCOLO

Dá replay e salva log de verdade :/

Eluan is offline   Reply With Quote
Bombastic
The Alpha Male
 

29-03-06, 06:44 #6
PARA NEH
que tipo de pessoa salva o log do protocolo HAERUIhaer

Bombastic is offline   Reply With Quote
Raposao
Trooper
 

29-03-06, 10:01 #7
Não deixa de ser um arquivo texto, cert? Então basta fazer um GREP como disseram acima, porém com a expression (ip de origem) em hexa invés de decimal...

Raposao is offline   Reply With Quote
PIT BULL
Trooper
 

XFIRE ID: pitbull666br Steam ID: pitbull666br
29-03-06, 19:51 #8
Vou procurar um GREP pra Windows XP. Oooh vida!

PIT BULL is offline   Reply With Quote
PIT BULL
Trooper
 

XFIRE ID: pitbull666br Steam ID: pitbull666br
29-03-06, 20:10 #9
Achei um Grep meia boca... só preciso descobrir como é que vou conseguir filtrar o LOG e geral um 'mini-log' só com os pacotes de um determinado IP.

Code:
D:\Arquivos de programas\GnuWin32\bin>grep --help
Usage: grep [OPTION]... PATTERN [FILE] ...
Search for PATTERN in each FILE or standard input.
Example: grep -i 'hello world' menu.h main.c

Regexp selection and interpretation:
  -E, --extended-regexp     PATTERN is an extended regular expression
  -F, --fixed-strings       PATTERN is a set of newline-separated strings
  -G, --basic-regexp        PATTERN is a basic regular expression
  -P, --perl-regexp         PATTERN is a Perl regular expression
  -e, --regexp=PATTERN      use PATTERN as a regular expression
  -f, --file=FILE           obtain PATTERN from FILE
  -i, --ignore-case         ignore case distinctions
  -w, --word-regexp         force PATTERN to match only whole words
  -x, --line-regexp         force PATTERN to match only whole lines
  -z, --null-data           a data line ends in 0 byte, not newline

Miscellaneous:
  -s, --no-messages         suppress error messages
  -v, --invert-match        select non-matching lines
  -V, --version             print version information and exit
      --help                display this help and exit
      --mmap                use memory-mapped input if possible

Output control:
  -m, --max-count=NUM       stop after NUM matches
  -b, --byte-offset         print the byte offset with output lines
  -n, --line-number         print line number with output lines
      --line-buffered       flush output on every line
  -H, --with-filename       print the filename for each match
  -h, --no-filename         suppress the prefixing filename on output
      --label=LABEL         print LABEL as filename for standard input
  -o, --only-matching       show only the part of a line matching PATTERN
  -q, --quiet, --silent     suppress all normal output
      --binary-files=TYPE   assume that binary files are TYPE
                            TYPE is 'binary', 'text', or 'without-match'
  -a, --text                equivalent to --binary-files=text
  -I                        equivalent to --binary-files=without-match
  -d, --directories=ACTION  how to handle directories
                            ACTION is 'read', 'recurse', or 'skip'
  -D, --devices=ACTION      how to handle devices, FIFOs and sockets
                            ACTION is 'read' or 'skip'
  -R, -r, --recursive       equivalent to --directories=recurse
      --include=PATTERN     files that match PATTERN will be examined
      --exclude=PATTERN     files that match PATTERN will be skipped.
      --exclude-from=FILE   files that match PATTERN in FILE will be skipped.
  -L, --files-without-match only print FILE names containing no match
  -l, --files-with-matches  only print FILE names containing matches
  -c, --count               only print a count of matching lines per FILE
  -Z, --null                print 0 byte after FILE name

Context control:
  -B, --before-context=NUM  print NUM lines of leading context
  -A, --after-context=NUM   print NUM lines of trailing context
  -C, --context=NUM         print NUM lines of output context
  -NUM                      same as --context=NUM
      --color[=WHEN],
      --colour[=WHEN]       use markers to distinguish the matching string
                            WHEN may be `always', `never' or `auto'.
  -U, --binary              do not strip CR characters at EOL (MSDOS)
  -u, --unix-byte-offsets   report offsets as if CRs were not there (MSDOS)

`egrep' means `grep -E'.  `fgrep' means `grep -F'.
With no FILE, or when FILE is -, read standard input.  If less than
two FILEs given, assume -h.  Exit status is 0 if match, 1 if no match,
and 2 if trouble.

Report bugs to <[email protected]>.

D:\Arquivos de programas\GnuWin32\bin>

PIT BULL is offline   Reply With Quote
PIT BULL
Trooper
 

XFIRE ID: pitbull666br Steam ID: pitbull666br
29-03-06, 20:28 #10
D:\Arquivos de programas\GnuWin32\bin\grep.exe 10.0.1.192 snort.log.1115657942 >> processado.log

Gerou o arquivo processado.log vazio. Qual o valor HEXA desse IP?!?! UHAsuhAShu!!

PIT BULL is offline   Reply With Quote
PIT BULL
Trooper
 

XFIRE ID: pitbull666br Steam ID: pitbull666br
29-03-06, 20:36 #11
3130.30.31.313932 ou 31302E302E312E313932

???? HEEEEEEEEEEEEELP ME

PIT BULL is offline   Reply With Quote
PIT BULL
Trooper
 

XFIRE ID: pitbull666br Steam ID: pitbull666br
29-03-06, 20:45 #12
Ou 10E202E12EC0 ???

PIT BULL is offline   Reply With Quote
PIT BULL
Trooper
 

XFIRE ID: pitbull666br Steam ID: pitbull666br
29-03-06, 21:01 #13
E se o LOG estiver em binário?!

00110001001100000010111000110000001011100011000100101110001100010011100100110010

PIT BULL is offline   Reply With Quote
PIT BULL
Trooper
 

XFIRE ID: pitbull666br Steam ID: pitbull666br
29-03-06, 21:02 #14
00110001001100000010111000110000001011100011000100101110001100010011100100110010

PIT BULL is offline   Reply With Quote
serjaum
Master Chief
 

Gamertag: serjaum
29-03-06, 21:06 #15
deixa os usuarios em paz!!

serjaum is offline   Reply With Quote
PIT BULL
Trooper
 

XFIRE ID: pitbull666br Steam ID: pitbull666br
29-03-06, 21:09 #16
Não é usuário não, são empregados!
[SPOILER]01000011011000010110110001100001001000000110000100100000011000100110111101100011011000010010000001010011011001010111001001101010011000010111010101101101001000000111011001101001011000010110010001101111001000010010000100100001001000000011101001000100


Last edited by PIT BULL; 29-03-06 at 21:12..
PIT BULL is offline   Reply With Quote
PIT BULL
Trooper
 

XFIRE ID: pitbull666br Steam ID: pitbull666br
29-03-06, 21:34 #17
Esse log FDP não é texto não. Essa merda é BINÁRIO.

PIT BULL is offline   Reply With Quote
Eluan
Trooper
 

Steam ID: eluancm
29-03-06, 21:40 #18
Provavelmente o IP vai ser algo do tipo FF EE DD AA ou AA DD EE FF

Vai ser chato fazer com grep por causa da parada dos newlines..

Ih...

Grava log em texto mesmo :/

Eluan is offline   Reply With Quote
PIT BULL
Trooper
 

XFIRE ID: pitbull666br Steam ID: pitbull666br
29-03-06, 21:54 #19
Eluan, não fui eu que instalei o serviço do snort... O log tá pronto, tá gravado e tem 120GB pra analisar. Por isso tô usando o EnCase.

PIT BULL is offline   Reply With Quote
...
Banned
 

29-03-06, 23:05 #21
 

... is offline   Reply With Quote
Bombastic
The Alpha Male
 

30-03-06, 06:48 #22
como o rocka é burro
snort nao tem nada a ver com snorkel

Bombastic is offline   Reply With Quote
Sephiroth
Trooper
 

Gamertag: sephitoff PSN ID: alanpk
30-03-06, 11:18 #23
Quote:
Postado por serjaum
deixa os usuarios em paz!!
(2)

eu odeio gente de auditoria
auhueahue

Sephiroth is offline   Reply With Quote
PIT BULL
Trooper
 

XFIRE ID: pitbull666br Steam ID: pitbull666br
30-03-06, 12:28 #24
WinDump is the solution!!

PIT BULL is offline   Reply With Quote
PIT BULL
Trooper
 

XFIRE ID: pitbull666br Steam ID: pitbull666br
30-03-06, 12:50 #25
Code:
M:\Snort>WinDump -r snort.log.1115657942 host 10.0.1.192 |more
reading from file snort.log.1115657942, link-type EN10MB (Ethernet)
14:31:56.898281 IP 10.0.1.192.3987 > 10.0.0.1.23: P 2803563909:2803563910(1) ack 3420914534 win 17098
14:31:56.898404 IP 10.0.0.1.23 > 10.0.1.192.3987: P 1:2(1) ack 1 win 5840
14:31:56.962166 IP 10.0.1.192.3987 > 10.0.0.1.23: P 1:2(1) ack 2 win 17097
14:31:56.962251 IP 10.0.0.1.23 > 10.0.1.192.3987: P 2:3(1) ack 2 win 5840
14:31:57.142073 IP 10.0.1.192.3987 > 10.0.0.1.23: . ack 3 win 17096
14:31:57.193963 IP 10.0.1.192.3987 > 10.0.0.1.23: P 2:3(1) ack 3 win 17096
14:31:57.194044 IP 10.0.0.1.23 > 10.0.1.192.3987: P 3:4(1) ack 3 win 5840
14:31:57.257988 IP 10.0.1.192.3987 > 10.0.0.1.23: P 3:5(2) ack 4 win 17095
14:31:57.258100 IP 10.0.0.1.23 > 10.0.1.192.3987: P 4:6(2) ack 5 win 5840
14:31:57.442513 IP 10.0.1.192.3987 > 10.0.0.1.23: . ack 6 win 17093
14:31:57.442557 IP 10.0.0.1.23 > 10.0.1.192.3987: P 6:8(2) ack 5 win 5840
14:31:57.449930 IP 10.0.1.192.3987 > 10.0.0.1.23: P 5:6(1) ack 8 win 17091
14:31:57.450101 IP 10.0.0.1.23 > 10.0.1.192.3987: P 8:9(1) ack 6 win 5840
14:31:57.513988 IP 10.0.1.192.3987 > 10.0.0.1.23: P 6:7(1) ack 9 win 17090
14:31:57.514108 IP 10.0.0.1.23 > 10.0.1.192.3987: P 9:10(1) ack 7 win 5840
14:31:57.545910 IP 10.0.1.192.3987 > 10.0.0.1.23: P 7:8(1) ack 10 win 17089
14:31:57.546018 IP 10.0.0.1.23 > 10.0.1.192.3987: P 10:11(1) ack 8 win 5840
14:31:57.625884 IP 10.0.1.192.3987 > 10.0.0.1.23: P 8:9(1) ack 11 win 17088
14:31:57.626545 IP 10.0.0.1.23 > 10.0.1.192.3987: P 11:12(1) ack 9 win 5840
14:31:57.742936 IP 10.0.1.192.3987 > 10.0.0.1.23: . ack 12 win 17087
14:31:57.801806 IP 10.0.1.192.3987 > 10.0.0.1.23: P 9:10(1) ack 12 win 17087
14:31:57.801944 IP 10.0.0.1.23 > 10.0.1.192.3987: P 12:13(1) ack 10 win 5840
14:31:57.849886 IP 10.0.1.192.3987 > 10.0.0.1.23: P 10:11(1) ack 13 win 17086
14:31:57.849973 IP 10.0.0.1.23 > 10.0.1.192.3987: P 13:14(1) ack 11 win 5840
14:31:57.913866 IP 10.0.1.192.3987 > 10.0.0.1.23: P 11:12(1) ack 14 win 17085
14:31:57.913960 IP 10.0.0.1.23 > 10.0.1.192.3987: P 14:15(1) ack 12 win 5840
14:31:58.043372 IP 10.0.1.192.3987 > 10.0.0.1.23: . ack 15 win 17084
14:31:58.113777 IP 10.0.1.192.3987 > 10.0.0.1.23: P 12:13(1) ack 15 win 17084
14:31:58.113893 IP 10.0.0.1.23 > 10.0.1.192.3987: P 15:16(1) ack 13 win 5840
14:31:58.193680 IP 10.0.1.192.3987 > 10.0.0.1.23: P 13:15(2) ack 16 win 17083
14:31:58.193787 IP 10.0.0.1.23 > 10.0.1.192.3987: P 16:18(2) ack 15 win 5840
14:31:58.343739 IP 10.0.1.192.3987 > 10.0.0.1.23: . ack 18 win 17081
14:31:58.344002 IP 10.0.0.1.23 > 10.0.1.192.3987: P 18:1298(1280) ack 15 win 5840
14:31:58.544065 IP 10.0.1.192.3987 > 10.0.0.1.23: . ack 1298 win 17520
14:32:01.217166 IP 10.0.1.192.3986 > 10.0.0.1.23: P 2672414562:2672414563(1) ack 3408185694 win 16386
14:32:01.217205 IP 10.0.0.1.23 > 10.0.1.192.3986: . ack 1 win 5840
14:32:01.218978 IP 10.0.0.1.23 > 10.0.1.192.3986: P 1:41(40) ack 1 win 5840
14:32:01.347953 IP 10.0.1.192.3986 > 10.0.0.1.23: . ack 41 win 16346
14:32:01.348021 IP 10.0.0.1.23 > 10.0.1.192.3986: P 41:182(141) ack 1 win 5840
-- Mais  --
NEGO VAI MORRER DO CORAÇÃO NA SEMANA QUE VEM!!! auhShuasUH!!!

PIT BULL is offline   Reply With Quote
PIT BULL
Trooper
 

XFIRE ID: pitbull666br Steam ID: pitbull666br
30-03-06, 12:56 #26

PIT BULL is offline   Reply With Quote
...
Banned
 

30-03-06, 13:01 #27
Quote:
Postado por Bombastic
como o rocka é burro
snort nao tem nada a ver com snorkel
 

... is offline   Reply With Quote
Bombastic
The Alpha Male
 

30-03-06, 13:13 #28
ban

Bombastic is offline   Reply With Quote
Eluan
Trooper
 

Steam ID: eluancm
30-03-06, 23:04 #29
bun

Eluan is offline   Reply With Quote
[SKAN]
Trooper
 

11-05-06, 10:48 #30
PitBull e/ou outros que trabalham e fazem de tudo pra complicar a vida dos usuários:

tenho um log nesse aspecto:
Quote:
1147089229.823 1035 111.222.333.235 TCP_MISS/302 638 GET http://www.microsoft.com/isapi/redir...r=6&ar=msnhome - DEFAULT_PARENT/SERVIDOR(PROXY).com.br text/html
1147089230.166 186 111.222.333.222 TCP_MISS/403 1608 POST http://gateway.messenger.hotmail.com...er.hotmail.com - DEFAULT_PARENT/SERVIDOR(PROXY).com.br text/html
1147089231.797 12 111.222.333.235 TCP_HIT/200 4840 GET http://www.msn.com.br/webinclude/pt-...f-mb.css?V=1.1 - NONE/- text/css
1147089231.818 55 111.222.333.235 TCP_HIT/200 24300 GET http://www.msn.com.br/global/css/win-ie6.css?V=1.1 - NONE/- text/css
1147089234.994 1473 111.222.333.235 TCP_MISS/200 423 GET http://c.msn.com.br/c.gif?DI=200&PI=...=1154&NC=10009 - DEFAULT_PARENT/SERVIDOR(PROXY).com.br image/gif
1147089235.808 1511 111.222.333.222 TCP_MISS/200 856 POST http://service.spynet.com/ASService/definitions.asmx - DEFAULT_PARENT/SERVIDOR(PROXY).com.br text/xml
1147089235.862 5579 111.222.333.235 TCP_MISS/200 108367 GET http://www.msn.com.br/ - DEFAULT_PARENT/SERVIDOR(PROXY).com.br text/html
1147089237.725 1722 111.222.333.235 TCP_REFRESH_HIT/200 1256 GET http://ads1.msn.com/library/flashlib.js - DEFAULT_PARENT/SERVIDOR(PROXY).com.br application/x-javascript
1147089237.851 125 111.222.333.235 TCP_HIT/200 1650 GET http://www.msn.com.br/webinclude/pt-br/images/msn.gif - NONE/- image/gif
1147089237.862 11 111.222.333.235 TCP_HIT/200 1443 GET http://www.msn.com.br/webinclude/images/msn/sft-mb.jpg - NONE/- image/jpeg
1147089237.864 2 111.222.333.235 TCP_HIT/200 606 GET http://www.msn.com.br/webinclude/images/msn/sfb-mb.gif - NONE/- image/gif
1147089238.171 3513 111.222.333.235 TCP_MISS/200 5554 GET http://view.atdmt.com/MBZ/iview/msnn...i.468;hi.60/01 - DEFAULT_PARENT/SERVIDOR(PROXY).com.br text/html
1147089239.937 1579 111.222.333.222 TCP_MISS/200 578 GET http://www.spynet.com/IsConnected.htm - DEFAULT_PARENT/SERVIDOR(PROXY).com.br text/html
1147089240.504 16 111.222.333.235 TCP_HIT/200 496 GET http://www.msn.com.br/webinclude/images/pw/s.gif - NONE/- image/gif
1147089240.506 2 111.222.333.235 TCP_HIT/200 498 GET http://www.msn.com.br/webinclude/images/msn/sfs-mb.gif - NONE/- image/gif
1147089240.527 21 111.222.333.235 TCP_HIT/200 2130 GET http://www.passportimages.com/1046/signin.gif - NONE/- image/gif
1147089240.827 2467 111.222.333.235 TCP_MISS/200 9051 GET http://global.msads.net/ads/5073/000...%3BPG%3DBRMHPH - DEFAULT_PARENT/SERVIDOR(PROXY).com.br application/x-shockwave-flash
1147089241.337 1129 111.222.333.222 TCP_MISS/200 833 POST http://download.spynet.com/ASSoftwar...chManager.asmx - DEFAULT_PARENT/SERVIDOR(PROXY).com.br text/xml
1147089241.390
É um log de acesso de quem passa pelo SQUID. (os ips foram trocados por razoes obvias)

anyway... o log está nesse aspecto quero organizar essa bagaça, por IP ou por nome da máquina, esse windump faz esse serviço?
Senão alguém me dá uma solução.

[SKAN] is offline   Reply With Quote
....
Banned
 

11-05-06, 11:09 #31
putz,tem um script que separa os logs do postfix, deixa muito organizado... vou ver se da pra adaptar

.... is offline   Reply With Quote
_j5
Quagmire
 

11-05-06, 21:25 #32
Snort exige que você remova as regras que geram falsas afirmativas...

Nenhum sistema que faz log é eficiente se você não diferencia o que é alerta de informativo, só serve pra encher a sua partição e confundir o administrador.

SKAN, windump é um sniffer para windows, é similar ao TCPDump, ele só audita o que passa na rede em tempo real, é muito bom por sinal.

O que você precisa é de um sistema para interpretar o LOG e gerar relatório, no caso do Squid a melhor solução é o SARG (GPL/Projeto Brasileiro)
http://sarg.sourceforge.net/

Abraços

_j5 is offline   Reply With Quote
_j5
Quagmire
 

11-05-06, 21:29 #33
PS: Telnet !?!?! WTF ?! http://www.openssh.org

_j5 is offline   Reply With Quote
PIT BULL
Trooper
 

XFIRE ID: pitbull666br Steam ID: pitbull666br
11-05-06, 22:03 #34
Nunca disse que era log de http://.

PIT BULL is offline   Reply With Quote
[SKAN]
Trooper
 

12-05-06, 10:32 #35
_j5 - love u

ps: já tava trabalhando no sarg =)

[SKAN] is offline   Reply With Quote
un4
inativo
 

12-05-06, 17:53 #36
credo... implementa um log de gente do outro lado.. muito mais facil que ficar logando protocolo

un4 is offline   Reply With Quote
PIT BULL
Trooper
 

XFIRE ID: pitbull666br Steam ID: pitbull666br
13-05-06, 11:56 #37
Quote:
Postado por un4
credo... implementa um log de gente do outro lado.. muito mais facil que ficar logando protocolo
Não cornete!!! Esse é um log completo de tudo que rolou no telnet, não só quem logou, não só o que rodou, mas sim o que digitou/apagou, o que viu e etc.

PIT BULL is offline   Reply With Quote
Responder


Regras de postagem
Você não pode criar novos tópicos
Você não pode postar
Você não pode enviar anexos
Você não pode editar seus posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Atalho para Fóruns



O formato de hora é GMT -3. horário: 21:21.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.