[bglug] Bash : Strano comando e output di netstat. [lungo]

embyte bglug@lists.linux.it
Sat, 9 Mar 2002 11:51:01 +0100


Provo a sparare qualche idea campata in aria :-)

~ #PROMPT_COMMAND=3D'pwd>&7; kill -STOP $$' PROMPT_COMMAND=3D'pwd>&7; kil=
l -STOP
 $$' ~ # cut ....[serie di 5 comandi da me richiesti es.
 netstat,nslookup,cd.....] ~ #cd " echo -e '\057\144\145\166' "
~ #cd " echo -e '\057' "
~ #cd " echo -e '\057\150\157\155\145' "
~ #cd " echo -e '\057\150\157\155\145\057\160\151\141\156\153\150\171' "
~ #cd " echo -e '\057\150\157\155\145' "
~ #cd " echo -e '\057\150\157\155\145\057\160\151\141\156\153\150\171' "
~ #PROMPT_COMMAND=3D'pwd>&7; kill -STOP $$'
~ #altro cut

Questi che vedi sopra sono un cd a /dev, due a /home e due a /home/piankh=
y
Poi ci sono dei reindirizzamenti di pwd sul descrittore 7 (che sar=E0? be=
lla=20
domanda... un socket descriptor forse? mmmhhh) e qualche segnale di SIGST=
OP=20
(19) (usato per fermare temporaneamente l'esecuzione di un processo ([1]+=
 =20
Stopped                 cat /dev/random)) alla shell corrente (suppongo).

Chi =E8 che ha accesso fisico a quella macchina?
Non riesci a sendarmi l'HISTORY completa?=20

~ output di netstat -nat : (tutto regolare tranne) non connesso ad intern=
et
~ Local Address=09=09=09Foreign Address=09=09=09Status
~ 127.0.0.1 : 32769=09=09127.0.0.1 : 111 =09=09=09TIME_WAIT
~ 127.0.0.1 : 32768=09=09127.0.0.1 : 111=09=09=09TIME_WAIT
~ 0.0.0.0 : 111=09=09=090.0.0.0 : *=09=09=09=09LISTEN
~
~ output di netstat -at : (tutto regolare tranne) non connesso ad interne=
t
~ Local Address=09=09=09Foreign Address=09=09=09Status
~ localhost : filenet-rpc=09=09localhost : sunrpc=09=09TIME_WAIT
~ localhost : filenet-tms=09=09localhost : sunrpc=09=09TIME_WAIT
~ * : sunrpc=09=09=09=09* : *=09=09=09=09=09LISTEN

(la prossima volta usa anche il flag -p)

Da quello che vedo hai eseguito il netstat mentre due socket sono nel=20
cosidetto stato di TIME_WAIT. La connessione =E8 avvenuta lo-to-lo (la ve=
di dai=20
due indirizzi di localhost sotto Local Address e Foreign Address) verso i=
l=20
servizio sunrpc o portmap (se non sai che sia =E8 uno specie di inetd/xin=
etd=20
per servizi quali nfs-> man portmap).=20
Hai uno di questi servizi attivi?=20
Dai una occhiata ai log (potrebbe essere una richiesta di listing dei ser=
vizi,=20
tipo rpcinfo -> rpcinfo -p 127.0.0.1).
Controlla anche gli ultimi log avvenuti sulla macchina e l'orario dei fil=
e di=20
log.

Ritornando al discordo dello stato TIME_WAIT (visto che suppongo tu non s=
appia=20
cosa sia) =E8 quello stato che in cui si trova il socket dopo aver mandat=
o il=20
secondo ack di chiusura della connessione TCP/IP (vedi gli ultimi 4 passa=
ggi=20
dell'immagine allegata).
Come dice TCP/IP illustrated questo stato rimane per un tempo che varia d=
a OS:
The TIME_WAIT state is also called the 2MSL wait state. Every implementat=
ion=20
must choose a value for the maximum segment lifetime (MSL). It is the max=
imum=20
amount of time any segment can exist in the network before being discarde=
d.=20
We know this time limit is bounded, since TCP segments are transmitted as=
 IP=20
datagrams, and the IP datagram has the TTL field that limits its lifetime=
=2E
RFC 793 [Postel 1981c] specifies the MSL as 2 minutes. Common implementat=
ion=20
values, however, are 30 seconds, 1 minute, or 2 minutes.
 Given the MSL value for an implementation, the rule is: when TCP perform=
s an=20
active close, and sends the final ACK, that connection must stay in the=20
TIME_WAIT state for twice the MSL. This lets TCP resend the final ACK in =
case=20
this ACK is lost (in which case the other end will time out and retransmi=
t=20
its final FIN).
Another effect of this 2MSL wait is that while the TCP connection is in t=
he=20
2MSL wait, the socket pair defining that connection (client IP address,=20
client port number, server IP address, and server port number) cannot be=20
reused. That connection can only be reused when the 2MSL wait is over.
[cut]=20

~ Scusatemi per le continui post in ML che da qualche giorno faccio.....

figuarati

~ ciao e grazie. piankhy

C=E8 qualcuno che ha qualche altra idea in merito?=20
Io nessuna di preciso.

Ciao, embyte
--=20
UIN: 48790142 && MAILTO: embyte@madlab.it || embyte@bglug.it

It took the computing power of three C-64s to fly to the Moon.
It takes a 486 to run Windows 95. Something is wrong here.