ssh probing

Christos Ricudis ricudis at komodino.itc.auth.gr
Tue Jun 9 15:00:50 EEST 2009


Nick Demou wrote:
> Σε φρεσκοστημένο linux server σε 48 ώρες είδα 5.784 αποτυχημένες 
> προσπάθειες αγνώστων να συνδεθούν μέσω ssh (2 προσπάθειες ανά 
> δευτερόλεπτο!)
>
> Βλέπει κανείς άλλος τέτοια "ένταση" στα probes για ssh connection?
>
> Φυσικά άλλαξα την default πόρτα μιας και στην περίπτωση μου ήταν πολύ 
> εύκολο και ανώδυνο αλλά αναρωτιέμε:
>
>  1) Πως μπορώ να κάνω detect αν κάποιος μου κάνει nmap myaddress για 
> να βρει όλες τις open ports?

Kaneis listen se kammia 10aria axrhsimopoihtes alla dhlwmenes sto 
/etc/services portes. Ean kapoios xtyphsei panw apo 2-3 apo aytes, kata 
pasa pi8anothta sou kanei scan (opote mporeis katey8eian na ton kopseis).

Yp'opshn oti ta full service scans einai synh8ws targeted attacks - ioi 
kai trojans den endiaferontai para mono na kanoyn scan kati poy kseroun 
oti einai vulnerable.

>  2) υπάρχει κανένας τρόπος να απαντά στην πόρτα 22 ένας fake sshd 
> server μόνο και μόνο για να καθυστερεί τους crackers (όχι για μένα για 
> τον φουκαριάρη τον server σας :-)

H texnikh ayth legetai tarpitting. rikse mia matia edw :

http://www.netfilter.org/projects/patch-o-matic/pom-external.html

Kati allo poy mporeis na xrhsimopoihseis, einai to port knocking. O 
daemon pou eftiakses gia na xrhsimopoihses sthn apanthsh ths erwthshs 1) 
wste na mplokareis aytous pou sou kanoun random scans, mporei na 
xrhsimopoih8ei kai gia na epitrepsei thn prosbash se *sena*, pou kaneis 
ENA proka8orismeno scan :

1) xtypaw ta ports 4827, 9163, 6947 kai 1623
2) o daemon to anagnwrizei kai anoigei to port 2222 gia thn IP mou
3) kanw ssh sto port 2222

Sth 8ewria akougetai para poly wraio. Sthn praksh *8a to sixa8eis mexri 
ahdias*, giati 8a sou spasei ton tropo pou exeis synh8isei na douleyeis 
- ase pou se kleidwnei teleiws ap'eksw sthn periptwsh poy 8eleis na 
kaneis remote login apo kapoio systhma sto opoio den exeis kai polla 
ergaleia, h den epitrepetai na ta xrhsimopoihseis.

>  3) υπάρχει κανένας τρόπος να απαντά στις περισότερες ή σε όλες τις 
> πόρτες κάποιο προγραμματάκι που επίσης απλά θα καθυστερεί τα probes?

Enw mporeis na ka8ysterhseis sxetika apotelesmatika ena ongoing 
established TCP session, ta apla probes den mporeis. ta probes spaniws 
ginontai seiriaka, dhl :

1) kanw probe to port X
2) perimenw N seconds gia na dw an mou er8ei apanthsh
3) kanw probe to port X+N

synh8ws ginontai ws ekshs :

1) stelnw ena SYN se 8000 ports
2) perimenw N seconds na dw poia apo ayta 8a apanthsoun mesa s'ayto to 
diasthma.

opote den yparxei tropos na ka8ysterhseis shmantika to probe.



Ena genikotero sxolio :

Kati poy den exei dystyxws perasei ka8olou akomh sth syneidhsh tou 
kosmou einai o tropos kai h logikh pou leitourgoun ta botnets.

Ena targeted attack - ena attack pou apey8ynetai sygkekrimena se sena 
apo enan an8rwpo - exei poly megalo nohma na to katagrapseis, na to 
parakolou8hseis, kai na to ka8ysterhseis.

Ena mass non-targeted attack, opws to 99.999(insert your favourite 
number of nines here)% twn attacks pou trwei ena systhma shmera, exei 
apla kai mono nohma na to mplokareis *oso to dynaton pio grhgora, me to 
oso dynaton ligotero xasimo porwn apo th dikh sou meria*.

Ayto gia tous ekshs logous :

1) ta spambots prospa8oun na mh spatalane xrono me systhmata pou 
prospa8oun epithdes na tous dyskolepsoun th douleia - einai asymforo.

2) sthn ousia ayto pou kaneis trogwntas resources apo ton random 
attacker, einai na dysxaireneis th zwh enos *molysmenou apo io/trojan 
mhxanhmatos kapoiou tritou, asxetou me to attack* - pragma pou mporei na 
se endiaferei, mporei kai oxi.

3) oi poroi pou ksodeyeis prospa8wntas na katagrapseis ta apotyxhmena 
attacks merikwn dekadwn xiliadwn spambot members (se CPU, mnhmh, disko), 
polles fores einai shmantikotatoi, oso kai an ayto erxetai se anti8esh 
me thn enstiktwdh antidrash kapoiou poy leei "8elw na blepw ta attacks 
se ena log file".


-- 

Christos Ricudis - 687474703a2f2f74696e7975726c2e636f6d2f7072726d336f



More information about the Linux-greek-users mailing list